Skip to content

Commit

Permalink
fix: lint check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yurii.lozytskyi committed Sep 27, 2022
1 parent 3447ba0 commit 01196a6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ vars = {
'chromium_version':
'107.0.5286.0',
'node_version':
'v16.17.0',
'v16.17.1',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':
Expand Down
2 changes: 1 addition & 1 deletion patches/node/build_add_gn_build_files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
+ args = rebase_path(inputs + outputs, root_build_dir)
+}
diff --git a/src/node_version.h b/src/node_version.h
index d79d640b693993ee9db938e857e34629410ca1e4..f7571a5e669c539bfdce14b18acdb778f8570383 100644
index aea46f3dad19d604d76b6726ce46141be48746c4..8620780de82f08940c40bddc449d281e4e348736 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ index c7894baf00ee9ce4684f4c752f1c7c9b98163741..655895dbff8b88daa53c7b40a5feca42
return EVPKeyCtxPointer();

diff --git a/src/crypto/crypto_random.cc b/src/crypto/crypto_random.cc
index 648fda211c4305f0ce2f676159bd23e95b4844f8..147fe4a79bfa1e2063ab9ba2f16dda22f0c40e48 100644
index 1459e410453da6850157444affa48b4a215edb03..2cf5861a110a2579329b9b0327d7b4296d0fb2c1 100644
--- a/src/crypto/crypto_random.cc
+++ b/src/crypto/crypto_random.cc
@@ -147,7 +147,7 @@ Maybe<bool> RandomPrimeTraits::AdditionalConfig(
@@ -146,7 +146,7 @@ Maybe<bool> RandomPrimeTraits::AdditionalConfig(

params->bits = bits;
params->safe = safe;
Expand Down Expand Up @@ -240,10 +240,10 @@ index bd732a70a8ffe6212e06dddb352ca75cb45b50d3..cd025663f58d386e3b7c47823a7d6cf1

if (target
diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc
index 58a5d88d7a10def618170550246fbf50685ac0a4..77af0661dbd056a38a8d7599b9e4f067f6b79f64 100644
index 652f6e0b12e2d56f33b1c18b80ec211b9c6bd5e9..840fe824617b951d4f4421155c5e1ce79c28525e 100644
--- a/src/crypto/crypto_util.cc
+++ b/src/crypto/crypto_util.cc
@@ -534,24 +534,15 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
@@ -522,24 +522,15 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
V(BIO) \
V(PKCS7) \
V(X509V3) \
Expand All @@ -269,7 +269,7 @@ index 58a5d88d7a10def618170550246fbf50685ac0a4..77af0661dbd056a38a8d7599b9e4f067
V(USER) \

#define V(name) case ERR_LIB_##name: lib = #name "_"; break;
@@ -710,7 +701,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
@@ -698,7 +689,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
CHECK(args[0]->IsUint32());
Environment* env = Environment::GetCurrent(args);
uint32_t len = args[0].As<Uint32>()->Value();
Expand All @@ -278,7 +278,7 @@ index 58a5d88d7a10def618170550246fbf50685ac0a4..77af0661dbd056a38a8d7599b9e4f067
if (data == nullptr) {
// There's no memory available for the allocation.
// Return nothing.
@@ -722,7 +713,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
@@ -710,7 +701,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
data,
len,
[](void* data, size_t len, void* deleter_data) {
Expand All @@ -287,7 +287,7 @@ index 58a5d88d7a10def618170550246fbf50685ac0a4..77af0661dbd056a38a8d7599b9e4f067
},
data);
Local<ArrayBuffer> buffer = ArrayBuffer::New(env->isolate(), store);
@@ -730,10 +721,12 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
@@ -718,10 +709,12 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
}

void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) {
Expand Down
14 changes: 7 additions & 7 deletions patches/node/support_v8_sandboxed_pointers.patch
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ index 9cbe99596b1b8c148ac076acf8a9623d6989d505..93d85d46dc6b3b30795b88ffa8070253
void* ret;
if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers)
diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc
index 77af0661dbd056a38a8d7599b9e4f067f6b79f64..642bb2a012b4d96b46b0658223fbd7becacaa28d 100644
index 840fe824617b951d4f4421155c5e1ce79c28525e..b1ae378993723d7a0a71bfe36fc5be94a899082a 100644
--- a/src/crypto/crypto_util.cc
+++ b/src/crypto/crypto_util.cc
@@ -344,10 +344,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept {
@@ -332,10 +332,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept {
return *this;
}

Expand Down Expand Up @@ -66,7 +66,7 @@ index 77af0661dbd056a38a8d7599b9e4f067f6b79f64..642bb2a012b4d96b46b0658223fbd7be
std::unique_ptr<BackingStore> ptr = ArrayBuffer::NewBackingStore(
allocated_data_,
size(),
@@ -359,10 +384,11 @@ std::unique_ptr<BackingStore> ByteSource::ReleaseToBackingStore() {
@@ -347,10 +372,11 @@ std::unique_ptr<BackingStore> ByteSource::ReleaseToBackingStore() {
data_ = nullptr;
size_ = 0;
return ptr;
Expand All @@ -79,7 +79,7 @@ index 77af0661dbd056a38a8d7599b9e4f067f6b79f64..642bb2a012b4d96b46b0658223fbd7be
return ArrayBuffer::New(env->isolate(), std::move(store));
}

@@ -692,6 +718,16 @@ CryptoJobMode GetCryptoJobMode(v8::Local<v8::Value> args) {
@@ -680,6 +706,16 @@ CryptoJobMode GetCryptoJobMode(v8::Local<v8::Value> args) {
}

namespace {
Expand All @@ -96,7 +96,7 @@ index 77af0661dbd056a38a8d7599b9e4f067f6b79f64..642bb2a012b4d96b46b0658223fbd7be
// SecureBuffer uses openssl to allocate a Uint8Array using
// OPENSSL_secure_malloc. Because we do not yet actually
// make use of secure heap, this has the same semantics as
@@ -719,6 +755,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
@@ -707,6 +743,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
Local<ArrayBuffer> buffer = ArrayBuffer::New(env->isolate(), store);
args.GetReturnValue().Set(Uint8Array::New(buffer, 0, len));
}
Expand All @@ -105,10 +105,10 @@ index 77af0661dbd056a38a8d7599b9e4f067f6b79f64..642bb2a012b4d96b46b0658223fbd7be
void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) {
#ifndef OPENSSL_IS_BORINGSSL
diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h
index 07ea8e44da3e54b8c24fd2d57b3922d6ddd35781..6d0d93b5b7c0bd1d8342e81024712df029d7e618 100644
index f26422ee106ab7a816750ee717cb18ea454b5b62..5e5798e7e55dbb2df93ef4a8ab6f40aeb85616b4 100644
--- a/src/crypto/crypto_util.h
+++ b/src/crypto/crypto_util.h
@@ -254,7 +254,7 @@ class ByteSource {
@@ -241,7 +241,7 @@ class ByteSource {
// Creates a v8::BackingStore that takes over responsibility for
// any allocated data. The ByteSource will be reset with size = 0
// after being called.
Expand Down
3 changes: 3 additions & 0 deletions shell/browser/notifications/platform_notification_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "shell/browser/notifications/platform_notification_service.h"

#include <algorithm>
#include <set>
#include <utility>
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/notification_event_dispatcher.h"
#include "content/public/browser/render_process_host.h"
Expand Down
23 changes: 11 additions & 12 deletions shell/browser/notifications/win/windows_toast_notification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <wrl\wrappers\corewrappers.h>
#include <algorithm>
#include <iterator>
#include <memory>
#include <sstream>

#include "base/environment.h"
Expand Down Expand Up @@ -1091,8 +1092,8 @@ IFACEMETHODIMP ToastEventHandler::Invoke(
ABI::Windows::UI::Notifications::IToastNotification* sender,
IInspectable* args) {
// SAP-14036 upgrade for get_Activated callback
if (options_.is_persistent) { // click on persistent notification toast

if (options_.is_persistent) {
// click on persistent notification toast
if (options_.has_reply) {
// Notification::NotificationReplied scope
// SAP-15259 : Add the reply field on a notification
Expand Down Expand Up @@ -1131,8 +1132,7 @@ IFACEMETHODIMP ToastEventHandler::Invoke(
if (IsDebuggingNotifications())
LOG(INFO) << "NotificationReplied";
}
} // if options_.has_reply
else {
} else { // if options_.has_reply
// Notification::NotificationAction scope
ComPtr<IToastActivatedEventArgs> activatedEventArgs;
if (FAILED(args->QueryInterface(activatedEventArgs.GetAddressOf())))
Expand Down Expand Up @@ -1160,9 +1160,8 @@ IFACEMETHODIMP ToastEventHandler::Invoke(
if (IsDebuggingNotifications())
LOG(INFO) << "NotificationAction";
}
} // else options_.has_reply
} else // if options_.is_persistent
{
} // else options_.has_reply
} else { // if options_.is_persistent
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE,
base::BindOnce(&Notification::NotificationClicked, notification_));
Expand Down Expand Up @@ -1412,7 +1411,7 @@ PBITMAPINFO GetBITMAPInfo(HBITMAP hBitmap) {
return pbmi;
}

bool GetBitmapBits(std::vector<BYTE>& bmpBits,
bool GetBitmapBits(std::vector<BYTE>* bmpBits,
HBITMAP hBitmap,
PBITMAPINFO pBitmapInfo) {
HDC hDC = GetDC(NULL); // Get Desktop device context
Expand All @@ -1427,12 +1426,12 @@ bool GetBitmapBits(std::vector<BYTE>& bmpBits,
!nLines)
return false;

bmpBits.resize(pBitmapInfo->bmiHeader.biSizeImage);
bmpBits->resize(pBitmapInfo->bmiHeader.biSizeImage);

// This call is necessary to copy DIB bits into bmpBits vector
if (nLines =
GetDIBits(pDC, hBitmap, 0, (WORD)pBitmapInfo->bmiHeader.biHeight,
bmpBits.data(), pBitmapInfo, DIB_RGB_COLORS),
bmpBits->data(), pBitmapInfo, DIB_RGB_COLORS),
!nLines)
return false;
}
Expand Down Expand Up @@ -1463,7 +1462,7 @@ bool NotificationRegistrator::ExtractAppIconToTempFile(

// Information about color DIB bits icon
std::vector<BYTE> bmpColorBits;
if (!GetBitmapBits(bmpColorBits, iconInfo.hbmColor, bmColorInfo.get()))
if (!GetBitmapBits(&bmpColorBits, iconInfo.hbmColor, bmColorInfo.get()))
return false;

// Information about mask DIB into icon
Expand All @@ -1476,7 +1475,7 @@ bool NotificationRegistrator::ExtractAppIconToTempFile(

// Information about mask DIB bits icon
std::vector<BYTE> bmpMaskBits;
if (!GetBitmapBits(bmpMaskBits, iconInfo.hbmMask, bmMaskInfo.get()))
if (!GetBitmapBits(&bmpMaskBits, iconInfo.hbmMask, bmMaskInfo.get()))
return false;

ico_path_ = tmp_path_ + file_name + L".ico";
Expand Down

0 comments on commit 01196a6

Please sign in to comment.