Skip to content

Commit fb04bbb

Browse files
committed
rebase to Chromium 73
1 parent 74769fb commit fb04bbb

11 files changed

+65
-65
lines changed

patch/patches/buildtools.patch

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
diff --git a/third_party/libc++/BUILD.gn b/third_party/libc++/BUILD.gn
2-
index 6049d72..5b311ef 100644
2+
index 9bcd072..bb61518 100644
33
--- third_party/libc++/BUILD.gn
44
+++ third_party/libc++/BUILD.gn
5-
@@ -22,7 +22,11 @@ component("libc++") {
6-
if (is_component_build) {
7-
no_default_deps = true
8-
} else {
9-
- static_component_type = "source_set"
10-
+ if (is_linux) {
11-
+ static_component_type = "static_library"
12-
+ } else {
13-
+ static_component_type = "source_set"
14-
+ }
15-
}
16-
sources = [
17-
"trunk/src/algorithm.cpp",
5+
@@ -21,7 +21,11 @@ config("config") {
6+
if (libcxx_is_shared) {
7+
_libcxx_target_type = "shared_library"
8+
} else {
9+
- _libcxx_target_type = "source_set"
10+
+ if (is_linux) {
11+
+ _libcxx_target_type = "static_library"
12+
+ } else {
13+
+ _libcxx_target_type = "source_set"
14+
+ }
15+
}
16+
target(_libcxx_target_type, "libc++") {
17+
if (libcxx_is_shared) {
1818
diff --git a/third_party/libc++abi/BUILD.gn b/third_party/libc++abi/BUILD.gn
19-
index c43916b..a1f16db 100644
19+
index 759327c..7df1531 100644
2020
--- third_party/libc++abi/BUILD.gn
2121
+++ third_party/libc++abi/BUILD.gn
22-
@@ -7,7 +7,7 @@ import("//build/config/c++/c++.gni")
23-
# TODO(thomasanderson): Remove this conditional once Android builds always set
24-
# use_custom_libcxx=true.
25-
if (use_custom_libcxx) {
26-
- source_set("libc++abi") {
27-
+ static_library("libc++abi") {
28-
visibility = [
29-
"//buildtools/third_party/libc++",
30-
"//build/config:executable_deps",
22+
@@ -4,7 +4,7 @@
23+
24+
import("//build/config/c++/c++.gni")
25+
26+
-source_set("libc++abi") {
27+
+static_library("libc++abi") {
28+
visibility = [
29+
"//buildtools/third_party/libc++",
30+
"//build/config:executable_deps",

src/api/nw_app_api.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ bool NwAppSetProxyConfigFunction::RunNWSync(base::ListValue* response, std::stri
203203
config = net::ProxyConfigWithAnnotation(pc, TRAFFIC_ANNOTATION_FOR_TESTS);
204204
}
205205

206-
base::ThreadRestrictions::ScopedAllowWait allow_wait;
206+
base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
207207

208208
content::RenderProcessHost* render_process_host = GetSenderWebContents()->GetMainFrame()->GetProcess();
209209
net::URLRequestContextGetter* context_getter =

src/api/nw_clipboard_api.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "extensions/browser/extension_system.h"
1515
#include "extensions/common/error_utils.h"
1616
#include "ui/base/clipboard/clipboard.h"
17+
#include "ui/base/clipboard/clipboard_constants.h"
1718
#include "ui/base/clipboard/scoped_clipboard_writer.h"
1819
#include "ui/gfx/codec/jpeg_codec.h"
1920
#include "ui/gfx/codec/png_codec.h"
@@ -309,13 +310,13 @@ bool NwClipboardReadAvailableTypesFunction::RunNWSync(base::ListValue* response,
309310
std::vector<base::string16> types;
310311
clipboard->ReadAvailableTypes(ui::CLIPBOARD_TYPE_COPY_PASTE, &types, &contains_filenames);
311312
for(std::vector<base::string16>::iterator it = types.begin(); it != types.end(); it++) {
312-
if (base::EqualsASCII(*it, ui::Clipboard::kMimeTypeText)) {
313+
if (base::EqualsASCII(*it, ui::kMimeTypeText)) {
313314
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_TEXT))));
314-
} else if (base::EqualsASCII(*it, ui::Clipboard::kMimeTypeHTML)) {
315+
} else if (base::EqualsASCII(*it, ui::kMimeTypeHTML)) {
315316
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_HTML))));
316-
} else if (base::EqualsASCII(*it, ui::Clipboard::kMimeTypeRTF)) {
317+
} else if (base::EqualsASCII(*it, ui::kMimeTypeRTF)) {
317318
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_RTF))));
318-
} else if (base::EqualsASCII(*it, ui::Clipboard::kMimeTypePNG)) {
319+
} else if (base::EqualsASCII(*it, ui::kMimeTypePNG)) {
319320
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_PNG))));
320321
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_JPEG))));
321322
}

src/api/nw_menu_api_mac.mm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "content/nw/src/api/nw_menu_api.h"
2-
#include "base/containers/hash_tables.h"
32
#include "base/strings/sys_string_conversions.h"
43
#include "chrome/browser/extensions/extension_service.h"
54
#include "chrome/grit/generated_resources.h"
@@ -32,13 +31,13 @@
3231
{ "IDS_ALL_WINDOWS_FRONT_MAC", IDS_ALL_WINDOWS_FRONT_MAC },
3332
};
3433

35-
typedef base::hash_map<std::string, int> MsgIDMap;
34+
typedef std::unordered_map<std::string, int> MsgIDMap;
3635
MsgIDMap g_msgid_map;
3736
static bool g_msgid_inited = false;
3837

3938
void InitMsgIDMap() {
4039
g_msgid_map.clear();
41-
for (size_t i = 0; i < arraysize(msg_map); i++) {
40+
for (size_t i = 0; i < base::size(msg_map); i++) {
4241
g_msgid_map.insert(std::make_pair(msg_map[i].msgstr, msg_map[i].msgid));
4342
}
4443
g_msgid_inited = true;

src/api/nw_window_api_mac.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ - (void)drawRect:(NSRect)dirtyRect {
6767
EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &count));
6868

6969
//static map from web_content to its attention_request_id
70-
static base::hash_map<content::WebContents*, int> attention_request_id;
70+
static std::unordered_map<content::WebContents*, int> attention_request_id;
7171
content::WebContents* web_content = GetSenderWebContents();
7272

7373
if (count != 0) {

src/nw_content_verifier_delegate.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ const uint8_t kNWSignaturesPublicKey[] = {
5555
0x69, 0x71, 0xc4, 0xe1, 0xde, 0xb1, 0xb0, 0xa3, 0x4e, 0x86, 0x5c, 0x29, 0x7c, 0x8b, 0xcd, 0x3d,
5656
0x27, 0xa4, 0x71, 0xcf, 0x9a, 0x62, 0xae, 0x54, 0x54, 0xaa, 0x0f, 0x1e, 0xb3, 0x78, 0x72, 0x67,
5757
0x91, 0x02, 0x03, 0x01, 0x00, 0x01};
58-
58+
5959
const int kNWSignaturesPublicKeySize =
60-
arraysize(kNWSignaturesPublicKey);
60+
base::size(kNWSignaturesPublicKey);
6161

6262
} // namespace
6363

src/nw_custom_bindings.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ void NWCustomBindings::EvalNWBin(
260260
uint8_t *data = reinterpret_cast<uint8_t*>(contents.Data());
261261

262262
WebFrame* main_frame = render_frame->GetWebFrame();
263-
v8::Handle<v8::String> source_string = v8::String::NewFromUtf8(isolate, "");
263+
v8::Handle<v8::String> source_string = v8::String::NewFromUtf8(isolate, "", v8::NewStringType::kNormal).ToLocalChecked();
264264
v8::ScriptCompiler::CachedData* cache;
265265
cache = new v8::ScriptCompiler::CachedData(
266266
data, length, v8::ScriptCompiler::CachedData::BufferNotOwned);
@@ -322,9 +322,9 @@ void NWCustomBindings::GetAbsolutePath(
322322
base::FilePath path = base::FilePath::FromUTF8Unsafe(*v8::String::Utf8Value(isolate, args[0]));
323323
MakePathAbsolute(&path);
324324
#if defined(OS_POSIX)
325-
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, path.value().c_str()));
325+
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, path.value().c_str(), v8::NewStringType::kNormal).ToLocalChecked());
326326
#else
327-
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, path.AsUTF8Unsafe().c_str()));
327+
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, path.AsUTF8Unsafe().c_str(), v8::NewStringType::kNormal).ToLocalChecked());
328328
#endif
329329
}
330330

@@ -333,9 +333,9 @@ void NWCustomBindings::GetOldCwd(
333333
v8::Isolate* isolate = args.GetIsolate();
334334
base::FilePath path = content::g_nw_old_cwd;
335335
#if defined(OS_POSIX)
336-
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, path.value().c_str()));
336+
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, path.value().c_str(), v8::NewStringType::kNormal).ToLocalChecked());
337337
#else
338-
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, path.AsUTF8Unsafe().c_str()));
338+
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, path.AsUTF8Unsafe().c_str(), v8::NewStringType::kNormal).ToLocalChecked());
339339
#endif
340340
}
341341

@@ -374,7 +374,7 @@ void NWCustomBindings::GetProxyForURL(const v8::FunctionCallbackInfo<v8::Value>&
374374
GURL gurl(url);
375375
if (!gurl.is_valid()) {
376376
args.GetReturnValue().Set(isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate,
377-
"Invalid URL passed to App.getProxyForURL()"))));
377+
"Invalid URL passed to App.getProxyForURL()", v8::NewStringType::kNormal).ToLocalChecked())));
378378
return;
379379
}
380380
std::string proxy;
@@ -383,7 +383,7 @@ void NWCustomBindings::GetProxyForURL(const v8::FunctionCallbackInfo<v8::Value>&
383383
args.GetReturnValue().Set(v8::Undefined(isolate));
384384
return;
385385
}
386-
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, proxy.c_str()));
386+
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, proxy.c_str(), v8::NewStringType::kNormal).ToLocalChecked());
387387
return;
388388
}
389389

src/nw_package.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const CommandLine::CharType* const kSwitchPrefixes[] = {L"--", L"-", L"/"};
6666
const CommandLine::CharType* const kSwitchPrefixes[] = {"--", "-"};
6767
#endif
6868

69-
size_t switch_prefix_count = arraysize(kSwitchPrefixes);
69+
size_t switch_prefix_count = base::size(kSwitchPrefixes);
7070

7171
size_t GetSwitchPrefixLength(const CommandLine::StringType& string) {
7272
for (size_t i = 0; i < switch_prefix_count; ++i) {
@@ -341,7 +341,7 @@ bool Package::InitFromPath(const base::FilePath& path_in) {
341341
const char* required_fields[] = {
342342
switches::kmName
343343
};
344-
for (unsigned i = 0; i < arraysize(required_fields); i++)
344+
for (unsigned i = 0; i < base::size(required_fields); i++)
345345
if (!root_->HasKey(required_fields[i])) {
346346
ReportError("Invalid package.json",
347347
std::string("Field '") + required_fields[i] + "'"

src/nw_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#define NW_VERSION_H
2323

2424
#define NW_MAJOR_VERSION 0
25-
#define NW_MINOR_VERSION 36
26-
#define NW_PATCH_VERSION 5
25+
#define NW_MINOR_VERSION 37
26+
#define NW_PATCH_VERSION 0
2727

2828
#define NW_VERSION_IS_RELEASE 1
2929

src/nwjs_browsertest.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class MockWebContentsDelegate : public content::WebContentsDelegate {
349349

350350
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
351351
const GURL& security_origin,
352-
content::MediaStreamType type) override {
352+
blink::MediaStreamType type) override {
353353
checked_ = true;
354354
if (check_message_loop_runner_.get())
355355
check_message_loop_runner_->Quit();
@@ -927,7 +927,7 @@ static std::string DumpPdfAccessibilityTree(const ui::AXTreeUpdate& ax_tree) {
927927
// Create a string representation of the tree starting with the embedded
928928
// object.
929929
std::string ax_tree_dump;
930-
base::hash_map<int32_t, int> id_to_indentation;
930+
std::map<int32_t, int> id_to_indentation;
931931
//bool found_embedded_object = false;
932932
for (auto& node : ax_tree.nodes) {
933933
#if 0
@@ -1226,7 +1226,7 @@ IN_PROC_BROWSER_TEST_F(NWJSDesktopCaptureApiTest, CrossDomain) {
12261226
content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN,
12271227
content::DesktopMediaID::kNullId), false},
12281228
};
1229-
picker_factory_.SetTestFlags(test_flags, arraysize(test_flags));
1229+
picker_factory_.SetTestFlags(test_flags, base::size(test_flags));
12301230
base::FilePath test_dir = test_data_dir_.Append(FILE_PATH_LITERAL("platform_apps")).Append(FILE_PATH_LITERAL("6212-crossdomain-screen"));
12311231
embedded_test_server()->ServeFilesFromDirectory(test_dir);
12321232
ASSERT_TRUE(embedded_test_server()->Start());

0 commit comments

Comments
 (0)