Skip to content

Commit 4dd0145

Browse files
committed
rebase to Chromium 67
1 parent a8197eb commit 4dd0145

24 files changed

+204
-228
lines changed

BUILD.gn

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ if (is_component_build) {
6060
"//third_party/zlib:minizip",
6161
"//skia",
6262
":nw_base",
63-
"//third_party/WebKit/public:blink",
64-
"//third_party/WebKit/Source/platform/wtf",
63+
"//third_party/blink/public:blink",
64+
"//third_party/blink/renderer/platform/wtf",
6565
"//third_party/protobuf:protobuf_lite",
6666
"//third_party/webrtc/modules/desktop_capture",
6767
]
6868
include_dirs = [
6969
"//third_party",
7070
"//third_party/mojo/src",
71-
"//third_party/WebKit/Source",
71+
"//third_party/blink/renderer",
7272
"$target_gen_dir/../../blink",
7373
"$target_gen_dir/../../blink/bindings/core/v8",
7474
]
@@ -186,19 +186,19 @@ static_library("nw_renderer") {
186186
"//base",
187187
"//extensions/common",
188188
"//extensions/renderer",
189-
"//third_party/WebKit/public:blink",
190-
"//third_party/WebKit/Source/platform/wtf",
189+
"//third_party/blink/public:blink",
190+
"//third_party/blink/renderer/platform/wtf",
191191
"//skia",
192192
":nw_base",
193193
"//third_party/protobuf:protobuf_lite",
194194
"//third_party/webrtc/modules/desktop_capture",
195195
]
196196
include_dirs = [
197197
"//third_party",
198-
"//third_party/WebKit/Source",
198+
"//third_party/blink/renderer",
199199
"//third_party/mojo/src",
200-
"$target_gen_dir/../../blink",
201-
"$target_gen_dir/../../blink/bindings/core/v8",
200+
"$target_gen_dir/../../third_party/blink/renderer",
201+
"$target_gen_dir/../../third_party/blink/renderer/bindings/core/v8",
202202
]
203203
sources = [
204204
"src/renderer/nw_chrome_renderer_hooks.h",

patch/patches/ffmpeg.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/BUILD.gn b/BUILD.gn
2-
index 01535c488b..180c1a7769 100755
2+
index 5439b39693..7fbb854abd 100755
33
--- BUILD.gn
44
+++ BUILD.gn
55
@@ -247,7 +247,7 @@ target(link_target_type, "ffmpeg_internal") {
@@ -21,6 +21,6 @@ index 01535c488b..180c1a7769 100755
2121
+ ]
2222
+ }
2323
+
24-
if (is_posix && !is_mac) {
24+
if (is_fuchsia || (is_posix && !is_mac)) {
2525
# Fixes warnings PIC relocation when building as component.
2626
ldflags += [

src/api/nw_app_api.cc

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@
2121
#include "extensions/common/error_utils.h"
2222
#include "net/proxy_resolution/proxy_config.h"
2323
#include "net/proxy_resolution/proxy_config_service_fixed.h"
24-
#include "net/proxy_resolution/proxy_service.h"
24+
#include "net/proxy_resolution/proxy_resolution_service.h"
2525
#include "net/url_request/url_request_context.h"
2626
#include "net/url_request/url_request_context_getter.h"
27+
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
2728

2829
using namespace extensions::nwapi::nw__app;
2930

3031
namespace {
3132
void SetProxyConfigCallback(
3233
base::WaitableEvent* done,
3334
const scoped_refptr<net::URLRequestContextGetter>& url_request_context_getter,
34-
const net::ProxyConfig& proxy_config) {
35+
const net::ProxyConfigWithAnnotation& proxy_config) {
3536
net::ProxyResolutionService* proxy_service =
3637
url_request_context_getter->GetURLRequestContext()->proxy_resolution_service();
3738
proxy_service->ResetConfigService(base::WrapUnique(new net::ProxyConfigServiceFixed(proxy_config)));
@@ -47,21 +48,23 @@ NwAppQuitFunction::NwAppQuitFunction() {
4748
NwAppQuitFunction::~NwAppQuitFunction() {
4849
}
4950

50-
bool NwAppQuitFunction::RunAsync() {
51+
ExtensionFunction::ResponseAction
52+
NwAppQuitFunction::Run() {
5153
ExtensionService* service =
5254
ExtensionSystem::Get(browser_context())->extension_service();
5355
base::MessageLoop::current()->task_runner()->PostTask(
5456
FROM_HERE,
5557
base::Bind(&ExtensionService::TerminateExtension,
5658
service->AsWeakPtr(),
5759
extension_id()));
58-
return true;
60+
return RespondNow(NoArguments());
5961
}
6062

61-
bool NwAppCloseAllWindowsFunction::RunAsync() {
63+
ExtensionFunction::ResponseAction
64+
NwAppCloseAllWindowsFunction::Run() {
6265
AppWindowRegistry* registry = AppWindowRegistry::Get(browser_context());
6366
if (!registry)
64-
return false;
67+
return RespondNow(Error(""));
6568

6669
AppWindowRegistry::AppWindowList windows =
6770
registry->GetAppWindowsForApp(extension()->id());
@@ -70,8 +73,7 @@ bool NwAppCloseAllWindowsFunction::RunAsync() {
7073
if (window->NWCanClose())
7174
window->GetBaseWindow()->Close();
7275
}
73-
SendResponse(true);
74-
return true;
76+
return RespondNow(NoArguments());
7577
}
7678

7779
NwAppGetArgvSyncFunction::NwAppGetArgvSyncFunction() {
@@ -153,23 +155,25 @@ NwAppSetProxyConfigFunction::~NwAppSetProxyConfigFunction() {
153155
}
154156

155157
bool NwAppSetProxyConfigFunction::RunNWSync(base::ListValue* response, std::string* error) {
156-
net::ProxyConfig config;
158+
net::ProxyConfigWithAnnotation config;
157159
std::unique_ptr<nwapi::nw__app::SetProxyConfig::Params> params(
158160
nwapi::nw__app::SetProxyConfig::Params::Create(*args_));
159161
EXTENSION_FUNCTION_VALIDATE(params.get());
160162

161163
std::string pac_url = params->pac_url.get() ? *params->pac_url : "";
162164
if (!pac_url.empty()) {
163165
if (pac_url == "<direct>")
164-
config = net::ProxyConfig::CreateDirect();
166+
config = net::ProxyConfigWithAnnotation::CreateDirect();
165167
else if (pac_url == "<auto>")
166-
config = net::ProxyConfig::CreateAutoDetect();
168+
config = net::ProxyConfigWithAnnotation(net::ProxyConfig::CreateAutoDetect(), TRAFFIC_ANNOTATION_FOR_TESTS);
167169
else
168-
config = net::ProxyConfig::CreateFromCustomPacURL(GURL(pac_url));
170+
config = net::ProxyConfigWithAnnotation(net::ProxyConfig::CreateFromCustomPacURL(GURL(pac_url)), TRAFFIC_ANNOTATION_FOR_TESTS);
169171
} else {
170172
std::string proxy_config;
173+
net::ProxyConfig pc;
171174
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &proxy_config));
172-
config.proxy_rules().ParseFromString(proxy_config);
175+
pc.proxy_rules().ParseFromString(proxy_config);
176+
config = net::ProxyConfigWithAnnotation(pc, TRAFFIC_ANNOTATION_FOR_TESTS);
173177
}
174178

175179
base::ThreadRestrictions::ScopedAllowWait allow_wait;
@@ -193,10 +197,11 @@ bool NwAppGetDataPathFunction::RunNWSync(base::ListValue* response, std::string*
193197
return true;
194198
}
195199

196-
bool NwAppCrashBrowserFunction::RunAsync() {
200+
ExtensionFunction::ResponseAction
201+
NwAppCrashBrowserFunction::Run() {
197202
int* ptr = nullptr;
198203
*ptr = 1;
199-
return true;
204+
return RespondNow(NoArguments());
200205
}
201206

202207

src/api/nw_app_api.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@
99

1010
namespace extensions {
1111

12-
class NwAppQuitFunction : public AsyncExtensionFunction {
12+
class NwAppQuitFunction : public UIThreadExtensionFunction {
1313
public:
1414
NwAppQuitFunction();
1515

1616
protected:
1717
~NwAppQuitFunction() override;
1818

1919
// ExtensionFunction:
20-
bool RunAsync() override;
20+
ResponseAction Run() override;
2121
DECLARE_EXTENSION_FUNCTION("nw.App.quit", UNKNOWN)
2222
private:
2323
void Callback();
2424
};
2525

26-
class NwAppCloseAllWindowsFunction : public AsyncExtensionFunction {
26+
class NwAppCloseAllWindowsFunction : public UIThreadExtensionFunction {
2727
public:
2828
NwAppCloseAllWindowsFunction() {}
2929

3030
protected:
3131
~NwAppCloseAllWindowsFunction() override {}
3232

3333
// ExtensionFunction:
34-
bool RunAsync() override;
34+
ResponseAction Run() override;
3535
DECLARE_EXTENSION_FUNCTION("nw.App.closeAllWindows", UNKNOWN)
3636
};
3737

@@ -105,15 +105,15 @@ class NwAppGetDataPathFunction : public NWSyncExtensionFunction {
105105
DISALLOW_COPY_AND_ASSIGN(NwAppGetDataPathFunction);
106106
};
107107

108-
class NwAppCrashBrowserFunction : public AsyncExtensionFunction {
108+
class NwAppCrashBrowserFunction : public UIThreadExtensionFunction {
109109
public:
110110
NwAppCrashBrowserFunction() {}
111111

112112
protected:
113113
~NwAppCrashBrowserFunction() override {}
114114

115115
// ExtensionFunction:
116-
bool RunAsync() override;
116+
ResponseAction Run() override;
117117
DECLARE_EXTENSION_FUNCTION("nw.App.crashBrowser", UNKNOWN)
118118
};
119119

src/api/nw_object_api.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ NwObjCallObjectMethodAsyncFunction::NwObjCallObjectMethodAsyncFunction() {
103103
NwObjCallObjectMethodAsyncFunction::~NwObjCallObjectMethodAsyncFunction() {
104104
}
105105

106-
bool NwObjCallObjectMethodAsyncFunction::RunAsync() {
106+
ExtensionFunction::ResponseAction
107+
NwObjCallObjectMethodAsyncFunction::Run() {
107108
EXTENSION_FUNCTION_VALIDATE(args_);
108109
base::ListValue* arguments = nullptr;
109110
int id = 0;
@@ -115,8 +116,7 @@ bool NwObjCallObjectMethodAsyncFunction::RunAsync() {
115116

116117
nw::ObjectManager* manager = nw::ObjectManager::Get(browser_context());
117118
manager->OnCallObjectMethod(render_frame_host(), id, type, method, *arguments);
118-
SendResponse(true);
119-
return true;
119+
return RespondNow(NoArguments());
120120
}
121121

122122

src/api/nw_object_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ class NwObjCallObjectMethodSyncFunction : public NWSyncExtensionFunction {
7272
DISALLOW_COPY_AND_ASSIGN(NwObjCallObjectMethodSyncFunction);
7373
};
7474

75-
class NwObjCallObjectMethodAsyncFunction : public AsyncExtensionFunction {
75+
class NwObjCallObjectMethodAsyncFunction : public UIThreadExtensionFunction {
7676
public:
7777
NwObjCallObjectMethodAsyncFunction();
78-
bool RunAsync() override;
7978

8079
protected:
80+
ResponseAction Run() override;
8181
~NwObjCallObjectMethodAsyncFunction() override;
8282

8383
DECLARE_EXTENSION_FUNCTION("nw.Obj.callObjectMethodAsync", UNKNOWN)

src/api/nw_screen_api.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ namespace extensions {
206206

207207
if (screens) {
208208
std::unique_ptr<DesktopMediaList> screen_media_list =
209-
base::MakeUnique<NativeDesktopMediaList>(
209+
std::make_unique<NativeDesktopMediaList>(
210210
content::DesktopMediaID::TYPE_SCREEN,
211211
webrtc::DesktopCapturer::CreateScreenCapturer(options));
212212
media_list_.push_back(std::move(screen_media_list));
213213
}
214214

215215
if (windows) {
216216
std::unique_ptr<DesktopMediaList> window_media_list =
217-
base::MakeUnique<NativeDesktopMediaList>(
217+
std::make_unique<NativeDesktopMediaList>(
218218
content::DesktopMediaID::TYPE_WINDOW,
219219
webrtc::DesktopCapturer::CreateWindowCapturer(options));
220220
media_list_.push_back(std::move(window_media_list));

0 commit comments

Comments
 (0)