diff --git a/ash/aura/wm_window_aura.cc b/ash/aura/wm_window_aura.cc index 6a847e8..c52d0a9 100644 --- a/ash/aura/wm_window_aura.cc +++ b/ash/aura/wm_window_aura.cc
@@ -727,8 +727,7 @@ } void WmWindowAura::Maximize() { - return window_->SetProperty(aura::client::kShowStateKey, - ui::SHOW_STATE_MAXIMIZED); + window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); } void WmWindowAura::Minimize() {
diff --git a/chrome/VERSION b/chrome/VERSION index 6f50fc0..fddaec8 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=57 MINOR=0 -BUILD=2964 +BUILD=2965 PATCH=0
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 443599c..02818f60 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -230,7 +230,7 @@ // Enables or disables emoji, handwriting and voice input on opt-in IME menu. const base::Feature kEHVInputOnImeMenu{"EmojiHandwritingVoiceInput", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; // Enables or disables flash component updates on Chrome OS. const base::Feature kCrosCompUpdates{"CrosCompUpdates",
diff --git a/content/browser/shared_worker/shared_worker_instance.cc b/content/browser/shared_worker/shared_worker_instance.cc index 282cf19..83a631c 100644 --- a/content/browser/shared_worker/shared_worker_instance.cc +++ b/content/browser/shared_worker/shared_worker_instance.cc
@@ -57,10 +57,9 @@ if (url_.GetOrigin() != match_url.GetOrigin()) return false; - if (name_.empty() && match_name.empty()) - return url_ == match_url; - - return name_ == match_name; + if (name_ != match_name || url_ != match_url) + return false; + return true; } bool SharedWorkerInstance::Matches(const SharedWorkerInstance& other) const {
diff --git a/content/browser/shared_worker/shared_worker_instance_unittest.cc b/content/browser/shared_worker/shared_worker_instance_unittest.cc index 238f88ea..4ce3c1a 100644 --- a/content/browser/shared_worker/shared_worker_instance_unittest.cc +++ b/content/browser/shared_worker/shared_worker_instance_unittest.cc
@@ -76,7 +76,7 @@ EXPECT_FALSE(Matches(instance2, "http://example.net/w.js", "")); EXPECT_FALSE(Matches(instance2, "http://example.net/w2.js", "")); EXPECT_TRUE(Matches(instance2, "http://example.com/w.js", "name")); - EXPECT_TRUE(Matches(instance2, "http://example.com/w2.js", "name")); + EXPECT_FALSE(Matches(instance2, "http://example.com/w2.js", "name")); EXPECT_FALSE(Matches(instance2, "http://example.net/w.js", "name")); EXPECT_FALSE(Matches(instance2, "http://example.net/w2.js", "name")); EXPECT_FALSE(Matches(instance2, "http://example.com/w.js", "name2"));
diff --git a/content/browser/shared_worker/shared_worker_message_filter.cc b/content/browser/shared_worker/shared_worker_message_filter.cc index fd306ac..b80aaac 100644 --- a/content/browser/shared_worker/shared_worker_message_filter.cc +++ b/content/browser/shared_worker/shared_worker_message_filter.cc
@@ -16,18 +16,11 @@ namespace content { namespace { + const uint32_t kFilteredMessageClasses[] = { ViewMsgStart, WorkerMsgStart, }; -// TODO(estark): For now, only URLMismatch errors actually stop the -// worker from being created. Other errors are recorded in UMA in -// Blink but do not stop the worker from being created -// yet. https://crbug.com/573206 -bool CreateWorkerErrorIsFatal(blink::WebWorkerCreationError error) { - return (error == blink::WebWorkerCreationErrorURLMismatch); -} - } // namespace SharedWorkerMessageFilter::SharedWorkerMessageFilter( @@ -93,8 +86,6 @@ reply->error = SharedWorkerServiceImpl::GetInstance()->CreateWorker( params, reply->route_id, this, resource_context_, WorkerStoragePartitionId(partition_)); - if (CreateWorkerErrorIsFatal(reply->error)) - reply->route_id = MSG_ROUTING_NONE; } void SharedWorkerMessageFilter::OnForwardToWorker(const IPC::Message& message) {
diff --git a/content/browser/shared_worker/shared_worker_service_impl.cc b/content/browser/shared_worker/shared_worker_service_impl.cc index 291df2c..6d8dfca6 100644 --- a/content/browser/shared_worker/shared_worker_service_impl.cc +++ b/content/browser/shared_worker/shared_worker_service_impl.cc
@@ -311,8 +311,6 @@ filter, route_id, params.document_id, filter->render_process_id(), params.render_frame_route_id)); if (SharedWorkerPendingInstance* pending = FindPendingInstance(*instance)) { - if (params.url != pending->instance()->url()) - return blink::WebWorkerCreationErrorURLMismatch; pending->AddRequest(std::move(request)); if (params.creation_context_type != pending->instance()->creation_context_type()) @@ -493,8 +491,6 @@ blink::WebWorkerCreationErrorNone; SharedWorkerHost* host = FindSharedWorkerHost(*pending_instance->instance()); if (host) { - if (pending_instance->instance()->url() != host->instance()->url()) - return blink::WebWorkerCreationErrorURLMismatch; if (pending_instance->instance()->creation_context_type() != host->instance()->creation_context_type()) { creation_error = blink::WebWorkerCreationErrorSecureContextMismatch;
diff --git a/content/browser/shared_worker/shared_worker_service_impl.h b/content/browser/shared_worker/shared_worker_service_impl.h index d21807ef..ab7eae6 100644 --- a/content/browser/shared_worker/shared_worker_service_impl.h +++ b/content/browser/shared_worker/shared_worker_service_impl.h
@@ -126,9 +126,7 @@ // RenderProcessReservedCallback() or RenderProcessReserveFailedCallback() // will be called on IO thread. Returns blink::WebWorkerCreationErrorNone or // blink::WebWorkerCreationErrorSecureContextMismatch on success. - // (SecureContextMismatch is used for UMA and should be handled as success. - // See CreateWorkerErrorIsFatal() in shared_worker_message_filter.cc for - // details.) + // (SecureContextMismatch is used for UMA and should be handled as success.) blink::WebWorkerCreationError ReserveRenderProcessToCreateWorker( std::unique_ptr<SharedWorkerPendingInstance> pending_instance);
diff --git a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc index 90198f1f..eb877a83 100644 --- a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc +++ b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc
@@ -739,15 +739,18 @@ "name2", kDocumentIDs[1], kRenderFrameRouteIDs[1]); - EXPECT_EQ(MSG_ROUTING_NONE, connector1->route_id()); - EXPECT_EQ(blink::WebWorkerCreationErrorURLMismatch, - connector1->creation_error()); + EXPECT_NE(MSG_ROUTING_NONE, connector1->route_id()); + EXPECT_EQ(blink::WebWorkerCreationErrorNone, connector1->creation_error()); EXPECT_EQ(0U, renderer_host1->QueuedMessageCount()); RunAllPendingInMessageLoop(); - EXPECT_EQ(0U, renderer_host1->QueuedMessageCount()); + EXPECT_EQ(2U, renderer_host1->QueuedMessageCount()); + CheckWorkerProcessMsgCreateWorker( + renderer_host1.get(), "http://example.com/w2x.js", "name2", + blink::WebContentSecurityPolicyTypeReport, &worker_route_id); + CheckViewMsgWorkerCreated(renderer_host1.get(), connector1.get()); } - // Pending case. + // Normal case (name mismatch). { std::unique_ptr<MockSharedWorkerConnector> connector0( new MockSharedWorkerConnector(renderer_host0.get())); @@ -759,17 +762,46 @@ kRenderFrameRouteIDs[0]); EXPECT_NE(MSG_ROUTING_NONE, connector0->route_id()); EXPECT_EQ(0U, renderer_host0->QueuedMessageCount()); - connector1->Create("http://example.com/w3.js", - "name3", - kDocumentIDs[1], + RunAllPendingInMessageLoop(); + EXPECT_EQ(2U, renderer_host0->QueuedMessageCount()); + CheckWorkerProcessMsgCreateWorker( + renderer_host0.get(), "http://example.com/w3.js", "name3", + blink::WebContentSecurityPolicyTypeReport, &worker_route_id); + CheckViewMsgWorkerCreated(renderer_host0.get(), connector0.get()); + connector1->Create("http://example.com/w3.js", "name3x", kDocumentIDs[1], + kRenderFrameRouteIDs[1]); + EXPECT_NE(MSG_ROUTING_NONE, connector1->route_id()); + EXPECT_EQ(blink::WebWorkerCreationErrorNone, connector1->creation_error()); + EXPECT_EQ(0U, renderer_host1->QueuedMessageCount()); + RunAllPendingInMessageLoop(); + EXPECT_EQ(2U, renderer_host1->QueuedMessageCount()); + CheckWorkerProcessMsgCreateWorker( + renderer_host1.get(), "http://example.com/w3.js", "name3x", + blink::WebContentSecurityPolicyTypeReport, &worker_route_id); + CheckViewMsgWorkerCreated(renderer_host1.get(), connector1.get()); + } + + // Pending case. + { + std::unique_ptr<MockSharedWorkerConnector> connector0( + new MockSharedWorkerConnector(renderer_host0.get())); + std::unique_ptr<MockSharedWorkerConnector> connector1( + new MockSharedWorkerConnector(renderer_host1.get())); + connector0->Create("http://example.com/w4.js", + "name4", + kDocumentIDs[0], + kRenderFrameRouteIDs[0]); + EXPECT_NE(MSG_ROUTING_NONE, connector0->route_id()); + EXPECT_EQ(0U, renderer_host0->QueuedMessageCount()); + connector1->Create("http://example.com/w4.js", "name4", kDocumentIDs[1], kRenderFrameRouteIDs[1]); EXPECT_NE(MSG_ROUTING_NONE, connector1->route_id()); EXPECT_EQ(0U, renderer_host1->QueuedMessageCount()); RunAllPendingInMessageLoop(); EXPECT_EQ(2U, renderer_host0->QueuedMessageCount()); CheckWorkerProcessMsgCreateWorker(renderer_host0.get(), - "http://example.com/w3.js", - "name3", + "http://example.com/w4.js", + "name4", blink::WebContentSecurityPolicyTypeReport, &worker_route_id); CheckViewMsgWorkerCreated(renderer_host0.get(), connector0.get()); @@ -783,27 +815,52 @@ new MockSharedWorkerConnector(renderer_host0.get())); std::unique_ptr<MockSharedWorkerConnector> connector1( new MockSharedWorkerConnector(renderer_host1.get())); - connector0->Create("http://example.com/w4.js", - "name4", - kDocumentIDs[0], + connector0->Create("http://example.com/w5.js", "name5", kDocumentIDs[0], kRenderFrameRouteIDs[0]); EXPECT_NE(MSG_ROUTING_NONE, connector0->route_id()); EXPECT_EQ(0U, renderer_host0->QueuedMessageCount()); - connector1->Create("http://example.com/w4x.js", - "name4", - kDocumentIDs[1], + connector1->Create("http://example.com/w5x.js", "name5", kDocumentIDs[1], kRenderFrameRouteIDs[1]); - EXPECT_EQ(MSG_ROUTING_NONE, connector1->route_id()); + EXPECT_NE(MSG_ROUTING_NONE, connector1->route_id()); EXPECT_EQ(0U, renderer_host1->QueuedMessageCount()); RunAllPendingInMessageLoop(); EXPECT_EQ(2U, renderer_host0->QueuedMessageCount()); - CheckWorkerProcessMsgCreateWorker(renderer_host0.get(), - "http://example.com/w4.js", - "name4", - blink::WebContentSecurityPolicyTypeReport, - &worker_route_id); + CheckWorkerProcessMsgCreateWorker( + renderer_host0.get(), "http://example.com/w5.js", "name5", + blink::WebContentSecurityPolicyTypeReport, &worker_route_id); CheckViewMsgWorkerCreated(renderer_host0.get(), connector0.get()); + EXPECT_EQ(2U, renderer_host1->QueuedMessageCount()); + CheckWorkerProcessMsgCreateWorker( + renderer_host1.get(), "http://example.com/w5x.js", "name5", + blink::WebContentSecurityPolicyTypeReport, &worker_route_id); + CheckViewMsgWorkerCreated(renderer_host1.get(), connector1.get()); + } + + // Pending case (name mismatch). + { + std::unique_ptr<MockSharedWorkerConnector> connector0( + new MockSharedWorkerConnector(renderer_host0.get())); + std::unique_ptr<MockSharedWorkerConnector> connector1( + new MockSharedWorkerConnector(renderer_host1.get())); + connector0->Create("http://example.com/w6.js", "name6", kDocumentIDs[0], + kRenderFrameRouteIDs[0]); + EXPECT_NE(MSG_ROUTING_NONE, connector0->route_id()); + EXPECT_EQ(0U, renderer_host0->QueuedMessageCount()); + connector1->Create("http://example.com/w6.js", "name6x", kDocumentIDs[1], + kRenderFrameRouteIDs[1]); + EXPECT_NE(MSG_ROUTING_NONE, connector1->route_id()); EXPECT_EQ(0U, renderer_host1->QueuedMessageCount()); + RunAllPendingInMessageLoop(); + EXPECT_EQ(2U, renderer_host0->QueuedMessageCount()); + CheckWorkerProcessMsgCreateWorker( + renderer_host0.get(), "http://example.com/w6.js", "name6", + blink::WebContentSecurityPolicyTypeReport, &worker_route_id); + CheckViewMsgWorkerCreated(renderer_host0.get(), connector0.get()); + EXPECT_EQ(2U, renderer_host1->QueuedMessageCount()); + CheckWorkerProcessMsgCreateWorker( + renderer_host1.get(), "http://example.com/w6.js", "name6x", + blink::WebContentSecurityPolicyTypeReport, &worker_route_id); + CheckViewMsgWorkerCreated(renderer_host1.get(), connector1.get()); } }
diff --git a/content/renderer/pepper/host_globals.cc b/content/renderer/pepper/host_globals.cc index 6461206a..2b93642 100644 --- a/content/renderer/pepper/host_globals.cc +++ b/content/renderer/pepper/host_globals.cc
@@ -76,7 +76,7 @@ result.append(": "); result.append(message); return WebConsoleMessage(LogLevelToWebLogLevel(level), - WebString(base::UTF8ToUTF16(result))); + WebString::fromUTF8(result)); } } // namespace
diff --git a/content/renderer/pepper/pepper_media_stream_video_track_host.cc b/content/renderer/pepper/pepper_media_stream_video_track_host.cc index 288bae3..f536ef3 100644 --- a/content/renderer/pepper/pepper_media_stream_video_track_host.cc +++ b/content/renderer/pepper/pepper_media_stream_video_track_host.cc
@@ -517,9 +517,9 @@ std::string source_id; base::Base64Encode(base::RandBytesAsString(64), &source_id); blink::WebMediaStreamSource webkit_source; - webkit_source.initialize(base::UTF8ToUTF16(source_id), + webkit_source.initialize(blink::WebString::fromASCII(source_id), blink::WebMediaStreamSource::TypeVideo, - base::UTF8ToUTF16(kPepperVideoSourceName), + blink::WebString::fromASCII(kPepperVideoSourceName), false /* remote */); MediaStreamVideoSource* const source = new VideoSource(weak_factory_.GetWeakPtr());
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc index c039d25..2ce23d6 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -1456,7 +1456,7 @@ pp_instance(), desired_number_of_characters); } -bool PepperPluginInstanceImpl::StartFind(const base::string16& search_text, +bool PepperPluginInstanceImpl::StartFind(const std::string& search_text, bool case_sensitive, int identifier) { // Keep a reference on the stack. See NOTE above. @@ -1464,10 +1464,8 @@ if (!LoadFindInterface()) return false; find_identifier_ = identifier; - return PP_ToBool( - plugin_find_interface_->StartFind(pp_instance(), - base::UTF16ToUTF8(search_text).c_str(), - PP_FromBool(case_sensitive))); + return PP_ToBool(plugin_find_interface_->StartFind( + pp_instance(), search_text.c_str(), PP_FromBool(case_sensitive))); } void PepperPluginInstanceImpl::SelectFindResult(bool forward, int identifier) {
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h index 62fb17a4..5125c2c 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.h +++ b/content/renderer/pepper/pepper_plugin_instance_impl.h
@@ -266,7 +266,7 @@ base::string16 GetSelectedText(bool html); base::string16 GetLinkAtPosition(const gfx::Point& point); void RequestSurroundingText(size_t desired_number_of_characters); - bool StartFind(const base::string16& search_text, + bool StartFind(const std::string& search_text, bool case_sensitive, int identifier); void SelectFindResult(bool forward, int identifier);
diff --git a/content/renderer/pepper/pepper_webplugin_impl.cc b/content/renderer/pepper/pepper_webplugin_impl.cc index 54d2247..d4da6b5e 100644 --- a/content/renderer/pepper/pepper_webplugin_impl.cc +++ b/content/renderer/pepper/pepper_webplugin_impl.cc
@@ -247,11 +247,11 @@ } WebString PepperWebPluginImpl::selectionAsText() const { - return instance_->GetSelectedText(false); + return WebString::fromUTF16(instance_->GetSelectedText(false)); } WebString PepperWebPluginImpl::selectionAsMarkup() const { - return instance_->GetSelectedText(true); + return WebString::fromUTF16(instance_->GetSelectedText(true)); } WebURL PepperWebPluginImpl::linkAtPosition(const WebPoint& position) const { @@ -261,7 +261,7 @@ bool PepperWebPluginImpl::startFind(const blink::WebString& search_text, bool case_sensitive, int identifier) { - return instance_->StartFind(search_text, case_sensitive, identifier); + return instance_->StartFind(search_text.utf8(), case_sensitive, identifier); } void PepperWebPluginImpl::selectFindResult(bool forward, int identifier) {
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc index 3cd4671b..e9e17ff 100644 --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -290,7 +290,7 @@ if (!frame) return; WebConsoleMessage console_message = WebConsoleMessage( - WebConsoleMessage::LevelError, WebString(base::UTF8ToUTF16(message))); + WebConsoleMessage::LevelError, WebString::fromUTF8(message)); frame->addMessageToConsole(console_message); }
diff --git a/content/renderer/pepper/url_request_info_util.cc b/content/renderer/pepper/url_request_info_util.cc index 952994a..b5cd64bd 100644 --- a/content/renderer/pepper/url_request_info_util.cc +++ b/content/renderer/pepper/url_request_info_util.cc
@@ -24,6 +24,7 @@ #include "ppapi/shared_impl/url_request_info_data.h" #include "ppapi/shared_impl/var.h" #include "ppapi/thunk/enter.h" +#include "third_party/WebKit/public/platform/FilePathConversion.h" #include "third_party/WebKit/public/platform/WebData.h" #include "third_party/WebKit/public/platform/WebHTTPBody.h" #include "third_party/WebKit/public/platform/WebURL.h" @@ -86,9 +87,8 @@ default: NOTREACHED(); } - http_body->appendFileRange(platform_path.AsUTF16Unsafe(), - start_offset, - number_of_bytes, + http_body->appendFileRange(blink::FilePathToWebString(platform_path), + start_offset, number_of_bytes, expected_last_modified_time); return true; }
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 0d01a92..c424e70 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -1237,7 +1237,9 @@ #if BUILDFLAG(ENABLE_PLUGINS) new PepperBrowserConnection(this); #endif - new SharedWorkerRepository(this); + shared_worker_repository_ = base::MakeUnique<SharedWorkerRepository>(this); + GetWebFrame()->setSharedWorkerRepositoryClient( + shared_worker_repository_.get()); if (IsLocalRoot()) { // DevToolsAgent is a RenderFrameObserver, and will destruct itself
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index 6b25d8e..6ae3cba3 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -149,6 +149,7 @@ class RenderWidgetFullscreenPepper; class ResourceRequestBodyImpl; class ScreenOrientationDispatcher; +class SharedWorkerRepository; class UserMediaClientImpl; struct CommonNavigationParams; struct CustomContextMenuContext; @@ -1321,6 +1322,7 @@ #endif std::unique_ptr<FrameBlameContext> blame_context_; + std::unique_ptr<SharedWorkerRepository> shared_worker_repository_; // Plugins ------------------------------------------------------------------- #if BUILDFLAG(ENABLE_PLUGINS)
diff --git a/content/renderer/shared_worker_repository.cc b/content/renderer/shared_worker_repository.cc index 96bea06f..cc6ca68 100644 --- a/content/renderer/shared_worker_repository.cc +++ b/content/renderer/shared_worker_repository.cc
@@ -8,17 +8,13 @@ #include "content/common/view_messages.h" #include "content/renderer/render_frame_impl.h" #include "content/renderer/websharedworker_proxy.h" -#include "third_party/WebKit/public/web/WebContentSecurityPolicy.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" namespace content { SharedWorkerRepository::SharedWorkerRepository(RenderFrameImpl* render_frame) - : RenderFrameObserver(render_frame) { - render_frame->GetWebFrame()->setSharedWorkerRepositoryClient(this); -} + : render_frame_(render_frame){}; -SharedWorkerRepository::~SharedWorkerRepository() {} +SharedWorkerRepository::~SharedWorkerRepository() = default; std::unique_ptr<blink::WebSharedWorkerConnector> SharedWorkerRepository::createSharedWorkerConnector( @@ -36,14 +32,12 @@ params.content_security_policy = content_security_policy.utf16(); params.security_policy_type = security_policy_type; params.document_id = document_id; - params.render_frame_route_id = render_frame()->GetRoutingID(); + params.render_frame_route_id = render_frame_->GetRoutingID(); params.creation_address_space = creation_address_space; params.creation_context_type = creation_context_type; ViewHostMsg_CreateWorker_Reply reply; - Send(new ViewHostMsg_CreateWorker(params, &reply)); + render_frame_->Send(new ViewHostMsg_CreateWorker(params, &reply)); *error = reply.error; - if (reply.route_id == MSG_ROUTING_NONE) - return nullptr; documents_with_workers_.insert(document_id); return base::MakeUnique<WebSharedWorkerProxy>( ChildThreadImpl::current()->GetRouter(), reply.route_id); @@ -53,13 +47,9 @@ std::set<DocumentID>::iterator iter = documents_with_workers_.find(document); if (iter != documents_with_workers_.end()) { // Notify the browser process that the document has shut down. - Send(new ViewHostMsg_DocumentDetached(document)); + render_frame_->Send(new ViewHostMsg_DocumentDetached(document)); documents_with_workers_.erase(iter); } } -void SharedWorkerRepository::OnDestruct() { - delete this; -} - } // namespace content
diff --git a/content/renderer/shared_worker_repository.h b/content/renderer/shared_worker_repository.h index cfc98dd5..c4dffb2f 100644 --- a/content/renderer/shared_worker_repository.h +++ b/content/renderer/shared_worker_repository.h
@@ -9,7 +9,6 @@ #include <set> #include "base/macros.h" -#include "content/public/renderer/render_frame_observer.h" #include "third_party/WebKit/public/platform/WebAddressSpace.h" #include "third_party/WebKit/public/web/WebContentSecurityPolicy.h" #include "third_party/WebKit/public/web/WebSharedWorkerCreationContextType.h" @@ -19,11 +18,11 @@ class RenderFrameImpl; -class SharedWorkerRepository : public RenderFrameObserver, - public blink::WebSharedWorkerRepositoryClient { +class SharedWorkerRepository final + : public blink::WebSharedWorkerRepositoryClient { public: explicit SharedWorkerRepository(RenderFrameImpl* render_frame); - ~SharedWorkerRepository() override; + ~SharedWorkerRepository(); // WebSharedWorkerRepositoryClient overrides. std::unique_ptr<blink::WebSharedWorkerConnector> createSharedWorkerConnector( @@ -38,9 +37,7 @@ void documentDetached(DocumentID document_id) override; private: - // RenderFrameObserver implementation. - void OnDestruct() override; - + RenderFrameImpl* render_frame_; std::set<DocumentID> documents_with_workers_; DISALLOW_COPY_AND_ASSIGN(SharedWorkerRepository);
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 3e0cef5..9f38f8e 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1871,8 +1871,6 @@ crbug.com/655458 imported/wpt/workers/semantics/structured-clone/dedicated.html [ Crash Failure Timeout ] crbug.com/655458 imported/wpt/workers/semantics/structured-clone/shared.html [ Crash Failure Timeout ] -crbug.com/538914 imported/wpt/workers/constructors/SharedWorker/URLMismatchError.htm [ Failure Timeout ] - crbug.com/490511 imported/wpt/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document-networkState.html [ Timeout ] crbug.com/602693 imported/wpt/service-workers/service-worker/client-navigate.https.html [ Skip ] crbug.com/602693 imported/wpt/service-workers/service-worker/clients-get-cross-origin.https.html [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/fast/workers/shared-worker-shared-expected.txt b/third_party/WebKit/LayoutTests/fast/workers/shared-worker-shared-expected.txt index b609ed65..66a9a63 100644 --- a/third_party/WebKit/LayoutTests/fast/workers/shared-worker-shared-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/workers/shared-worker-shared-expected.txt
@@ -1,6 +1,6 @@ Test simple shared worker sharing cases. Should print several PASS lines followed by DONE. -PASS: Exception thrown when creating SharedWorker with different URLs but same name: URLMismatchError: Failed to construct 'SharedWorker': The location of the SharedWorker named 'name' does not exactly match the provided URL ('some-other-url.js'). +PASS: Creating SharedWorker with different URLs but the same name PASS: Accessing new instance of shared worker: self.foo: undefined PASS: Setting global variable in shared worker: self.foo = 1234: 1234 PASS: Accessing simultaneously-loaded instance of shared worker: self.foo: 1234
diff --git a/third_party/WebKit/LayoutTests/fast/workers/shared-worker-shared.html b/third_party/WebKit/LayoutTests/fast/workers/shared-worker-shared.html index ef6165d..09f61d4 100644 --- a/third_party/WebKit/LayoutTests/fast/workers/shared-worker-shared.html +++ b/third_party/WebKit/LayoutTests/fast/workers/shared-worker-shared.html
@@ -19,11 +19,11 @@ try { new SharedWorker('resources/some-other-url.js', 'name'); - log("FAIL: Creating SharedWorker with different URLs but the same name should fail"); + log("PASS: Creating SharedWorker with different URLs but the same name"); } catch (ex) { var exString = ex.toString(); exString = exString.replace(/file:\/\/.*\//, "") - log("PASS: Exception thrown when creating SharedWorker with different URLs but same name: " + exString); + log("FAIL: Exception thrown when creating SharedWorker with different URLs but same name: " + exString); }
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-2-expected.html b/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-2-expected.html index f4bba86..cc31027 100644 --- a/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-2-expected.html +++ b/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-2-expected.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <div id='host'> - <div id='fallback1'></div> - <div id='child1' slot='slot2'></div> - <div id='fallback3'></div> + <div id='fallback1'>fallback1</div> + <div id='child1' slot='slot2'>child1</div> + <div id='fallback3'>fallback3</div> + <div id='fallback3'>fallback4</div> </div>
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-2.html b/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-2.html index 7afd360..e14e6c2 100644 --- a/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-2.html +++ b/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-2.html
@@ -3,18 +3,19 @@ <div id='host'> <template data-mode='open'> <slot name='slot1'> - <div id='fallback1'></div> + <div id='fallback1'>fallback1</div> <slot name='slot2'> - <div id='fallback2'></div> + <div id='fallback2'>fallback2</div> </slot> </slot> <slot name='slot3'> + <div id='fallback3'>fallback3</div> <slot name='slot4'> - <div id='fallback3'></div> + <div id='fallback4'>fallback4</div> </slot> </slot> </template> - <div id='child1' slot='slot2'></div> + <div id='child1' slot='slot2'>child1</div> </div> <script> convertTemplatesToShadowRootsWithin(host);
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-3-expected.html b/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-3-expected.html index aa7a03f67..76bd6ad7 100644 --- a/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-3-expected.html +++ b/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-3-expected.html
@@ -1,8 +1,8 @@ <!DOCTYPE html> <div id='host'> <div id='host2'> - <div id='fallback1'></div> - <div id='child1' slot='slot2'></div> - <div id='fallback-a'></div> + <div id='fallback1'>fallback1</div> + <div id='child1' slot='slot2'>child1</div> + <div id='fallback-a'>fallback-a</div> </div> </div>
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-3.html b/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-3.html index 16097ed..b2fd50d 100644 --- a/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-3.html +++ b/third_party/WebKit/LayoutTests/shadow-dom/slots-fallback-3.html
@@ -6,24 +6,26 @@ <template data-mode='open'> <slot name='slot-a'> <slot name='slot-b'> + <div id='fallback-b'>fallback-b</div> </slot> - <div id='fallback-a'></div> + <div id='fallback-a'>fallback-a</div> </slot> </template> <slot name='slot1' slot='slot-b'> - <div id='fallback1'></div> + <div id='fallback1'>fallback1</div> <slot name='slot2'> - <div id='fallback2'></div> + <div id='fallback2'>fallback2</div> </slot> </slot> <slot name='slot3'> <slot name='slot4'> - <div id='fallback3'></div> + <div id='fallback4'>fallback4</div> </slot> + <div id='fallback3'>fallback3</div> </slot> </div> </template> - <div id='child1' slot='slot2'></div> + <div id='child1' slot='slot2'>child1</div> </div> <script> convertTemplatesToShadowRootsWithin(host);
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index 1250ed1..736aae73 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -498,9 +498,7 @@ void LocalDOMWindow::reset() { DCHECK(document()); - // Since |Document| class has multiple |LifecycleNotifier| as base class, - // we need to have |static_cast<ExecutionContext>| here. - static_cast<ExecutionContext*>(document())->notifyContextDestroyed(); + DCHECK(document()->isContextDestroyed()); frameDestroyed(); m_screen = nullptr;
diff --git a/third_party/WebKit/Source/core/frame/Navigator.h b/third_party/WebKit/Source/core/frame/Navigator.h index 08f420b..db93d09 100644 --- a/third_party/WebKit/Source/core/frame/Navigator.h +++ b/third_party/WebKit/Source/core/frame/Navigator.h
@@ -21,6 +21,7 @@ #define Navigator_h #include "bindings/core/v8/ScriptWrappable.h" +#include "core/CoreExport.h" #include "core/frame/DOMWindowProperty.h" #include "core/frame/NavigatorCPU.h" #include "core/frame/NavigatorID.h" @@ -36,14 +37,14 @@ typedef int ExceptionCode; -class Navigator final : public GarbageCollected<Navigator>, - public NavigatorCPU, - public NavigatorID, - public NavigatorLanguage, - public NavigatorOnLine, - public ScriptWrappable, - public DOMWindowProperty, - public Supplementable<Navigator> { +class CORE_EXPORT Navigator final : public GarbageCollected<Navigator>, + public NavigatorCPU, + public NavigatorID, + public NavigatorLanguage, + public NavigatorOnLine, + public ScriptWrappable, + public DOMWindowProperty, + public Supplementable<Navigator> { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(Navigator);
diff --git a/third_party/WebKit/Source/core/frame/NavigatorCPU.h b/third_party/WebKit/Source/core/frame/NavigatorCPU.h index f24e090f..7fc4db40 100644 --- a/third_party/WebKit/Source/core/frame/NavigatorCPU.h +++ b/third_party/WebKit/Source/core/frame/NavigatorCPU.h
@@ -5,9 +5,11 @@ #ifndef NavigatorCPU_h #define NavigatorCPU_h +#include "core/CoreExport.h" + namespace blink { -class NavigatorCPU { +class CORE_EXPORT NavigatorCPU { public: unsigned hardwareConcurrency() const; };
diff --git a/third_party/WebKit/Source/core/frame/NavigatorID.h b/third_party/WebKit/Source/core/frame/NavigatorID.h index 6b212d2..3005ece6 100644 --- a/third_party/WebKit/Source/core/frame/NavigatorID.h +++ b/third_party/WebKit/Source/core/frame/NavigatorID.h
@@ -31,11 +31,12 @@ #ifndef NavigatorID_h #define NavigatorID_h +#include "core/CoreExport.h" #include "wtf/text/WTFString.h" namespace blink { -class NavigatorID { +class CORE_EXPORT NavigatorID { public: String appCodeName(); String appName();
diff --git a/third_party/WebKit/Source/core/frame/NavigatorLanguage.h b/third_party/WebKit/Source/core/frame/NavigatorLanguage.h index 8302638c..7b3b409 100644 --- a/third_party/WebKit/Source/core/frame/NavigatorLanguage.h +++ b/third_party/WebKit/Source/core/frame/NavigatorLanguage.h
@@ -5,11 +5,12 @@ #ifndef NavigatorLanguage_h #define NavigatorLanguage_h +#include "core/CoreExport.h" #include "wtf/text/AtomicString.h" namespace blink { -class NavigatorLanguage { +class CORE_EXPORT NavigatorLanguage { public: NavigatorLanguage();
diff --git a/third_party/WebKit/Source/core/frame/NavigatorOnLine.h b/third_party/WebKit/Source/core/frame/NavigatorOnLine.h index e78654412a..dd5121e 100644 --- a/third_party/WebKit/Source/core/frame/NavigatorOnLine.h +++ b/third_party/WebKit/Source/core/frame/NavigatorOnLine.h
@@ -31,11 +31,12 @@ #ifndef NavigatorOnLine_h #define NavigatorOnLine_h +#include "core/CoreExport.h" #include "core/page/NetworkStateNotifier.h" namespace blink { -class NavigatorOnLine { +class CORE_EXPORT NavigatorOnLine { public: bool onLine() { return networkStateNotifier().onLine(); } };
diff --git a/third_party/WebKit/Source/core/frame/Screen.h b/third_party/WebKit/Source/core/frame/Screen.h index 7b4eeb4..cfc9b8de 100644 --- a/third_party/WebKit/Source/core/frame/Screen.h +++ b/third_party/WebKit/Source/core/frame/Screen.h
@@ -30,6 +30,7 @@ #define Screen_h #include "bindings/core/v8/ScriptWrappable.h" +#include "core/CoreExport.h" #include "core/dom/ContextLifecycleObserver.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h" @@ -38,10 +39,10 @@ class LocalFrame; -class Screen final : public GarbageCollected<Screen>, - public ScriptWrappable, - public ContextClient, - public Supplementable<Screen> { +class CORE_EXPORT Screen final : public GarbageCollected<Screen>, + public ScriptWrappable, + public ContextClient, + public Supplementable<Screen> { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(Screen);
diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h index 4bc74d88..e2aa3fb 100644 --- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h +++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h
@@ -37,7 +37,9 @@ #include "bindings/core/v8/ScriptState.h" #include "core/fileapi/FileReaderLoader.h" #include "core/fileapi/FileReaderLoaderClient.h" +#include "core/frame/LocalDOMWindow.h" #include "core/imagebitmap/ImageBitmapOptions.h" +#include "core/workers/WorkerGlobalScope.h" #include "platform/Supplementable.h" #include "platform/geometry/IntRect.h" #include "third_party/skia/include/core/SkRefCnt.h"
diff --git a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h index 19552c9..51f5bf3e 100644 --- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h +++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
@@ -6,6 +6,7 @@ #define OriginTrialContext_h #include "core/CoreExport.h" +#include "core/dom/ExecutionContext.h" #include "platform/Supplementable.h" #include "wtf/HashSet.h" #include "wtf/Vector.h"
diff --git a/third_party/WebKit/Source/core/timing/DOMWindowPerformance.h b/third_party/WebKit/Source/core/timing/DOMWindowPerformance.h index b2c0d5a2..77cf4632 100644 --- a/third_party/WebKit/Source/core/timing/DOMWindowPerformance.h +++ b/third_party/WebKit/Source/core/timing/DOMWindowPerformance.h
@@ -7,6 +7,7 @@ #include "core/CoreExport.h" #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/LocalDOMWindow.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h" #include "wtf/Noncopyable.h"
diff --git a/third_party/WebKit/Source/core/timing/SharedWorkerPerformance.h b/third_party/WebKit/Source/core/timing/SharedWorkerPerformance.h index 82fb72f..10c37461 100644 --- a/third_party/WebKit/Source/core/timing/SharedWorkerPerformance.h +++ b/third_party/WebKit/Source/core/timing/SharedWorkerPerformance.h
@@ -30,6 +30,7 @@ #ifndef SharedWorkerPerformance_h #define SharedWorkerPerformance_h +#include "core/workers/SharedWorker.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.h b/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.h index 5079252..c92fe223 100644 --- a/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.h +++ b/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.h
@@ -32,6 +32,7 @@ #define WorkerGlobalScopePerformance_h #include "core/timing/WorkerPerformance.h" +#include "core/workers/WorkerGlobalScope.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/core/workers/SharedWorker.cpp b/third_party/WebKit/Source/core/workers/SharedWorker.cpp index 49bfada..97a3759 100644 --- a/third_party/WebKit/Source/core/workers/SharedWorker.cpp +++ b/third_party/WebKit/Source/core/workers/SharedWorker.cpp
@@ -81,13 +81,13 @@ if (scriptURL.isEmpty()) return nullptr; - if (document->frame()->loader().client()->sharedWorkerRepositoryClient()) + if (document->frame()->loader().client()->sharedWorkerRepositoryClient()) { document->frame() ->loader() .client() ->sharedWorkerRepositoryClient() - ->connect(worker, std::move(remotePort), scriptURL, name, - exceptionState); + ->connect(worker, std::move(remotePort), scriptURL, name); + } return worker; }
diff --git a/third_party/WebKit/Source/core/workers/SharedWorkerRepositoryClient.h b/third_party/WebKit/Source/core/workers/SharedWorkerRepositoryClient.h index 7f2f5bcf..cc287d8 100644 --- a/third_party/WebKit/Source/core/workers/SharedWorkerRepositoryClient.h +++ b/third_party/WebKit/Source/core/workers/SharedWorkerRepositoryClient.h
@@ -39,7 +39,6 @@ namespace blink { class Document; -class ExceptionState; class KURL; class SharedWorker; @@ -54,8 +53,7 @@ virtual void connect(SharedWorker*, WebMessagePortChannelUniquePtr, const KURL&, - const String& name, - ExceptionState&) = 0; + const String& name) = 0; virtual void documentDetached(Document*) = 0; };
diff --git a/third_party/WebKit/Source/core/workers/WorkerClients.h b/third_party/WebKit/Source/core/workers/WorkerClients.h index f38fae1..66467fc 100644 --- a/third_party/WebKit/Source/core/workers/WorkerClients.h +++ b/third_party/WebKit/Source/core/workers/WorkerClients.h
@@ -42,8 +42,8 @@ // This is created on the main thread, passed to the worker thread and // attached to WorkerGlobalScope when it is created. // This class can be used to provide "client" implementations to Workers. -class WorkerClients final : public GarbageCollected<WorkerClients>, - public Supplementable<WorkerClients> { +class CORE_EXPORT WorkerClients final : public GarbageCollected<WorkerClients>, + public Supplementable<WorkerClients> { USING_GARBAGE_COLLECTED_MIXIN(WorkerClients); WTF_MAKE_NONCOPYABLE(WorkerClients);
diff --git a/third_party/WebKit/Source/core/workers/WorkerNavigator.h b/third_party/WebKit/Source/core/workers/WorkerNavigator.h index 156948d3..1362720 100644 --- a/third_party/WebKit/Source/core/workers/WorkerNavigator.h +++ b/third_party/WebKit/Source/core/workers/WorkerNavigator.h
@@ -27,6 +27,7 @@ #define WorkerNavigator_h #include "bindings/core/v8/ScriptWrappable.h" +#include "core/CoreExport.h" #include "core/frame/NavigatorCPU.h" #include "core/frame/NavigatorID.h" #include "core/frame/NavigatorOnLine.h" @@ -36,12 +37,13 @@ namespace blink { -class WorkerNavigator final : public GarbageCollectedFinalized<WorkerNavigator>, - public ScriptWrappable, - public NavigatorCPU, - public NavigatorID, - public NavigatorOnLine, - public Supplementable<WorkerNavigator> { +class CORE_EXPORT WorkerNavigator final + : public GarbageCollectedFinalized<WorkerNavigator>, + public ScriptWrappable, + public NavigatorCPU, + public NavigatorID, + public NavigatorOnLine, + public Supplementable<WorkerNavigator> { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(WorkerNavigator);
diff --git a/third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.h b/third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.h index 82d88170..2ba4587 100644 --- a/third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.h +++ b/third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.h
@@ -5,6 +5,7 @@ #ifndef ServiceWorkerRegistrationSync_h #define ServiceWorkerRegistrationSync_h +#include "modules/serviceworkers/ServiceWorkerRegistration.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/bluetooth/NavigatorBluetooth.h b/third_party/WebKit/Source/modules/bluetooth/NavigatorBluetooth.h index 6b91896..81fbc8c 100644 --- a/third_party/WebKit/Source/modules/bluetooth/NavigatorBluetooth.h +++ b/third_party/WebKit/Source/modules/bluetooth/NavigatorBluetooth.h
@@ -5,6 +5,7 @@ #ifndef NavigatorBluetooth_h #define NavigatorBluetooth_h +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/budget/NavigatorBudget.h b/third_party/WebKit/Source/modules/budget/NavigatorBudget.h index 1a418630..2c66933e 100644 --- a/third_party/WebKit/Source/modules/budget/NavigatorBudget.h +++ b/third_party/WebKit/Source/modules/budget/NavigatorBudget.h
@@ -5,6 +5,7 @@ #ifndef NavigatorBudget_h #define NavigatorBudget_h +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" namespace blink {
diff --git a/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h b/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h index 39a582b..5617c8b2 100644 --- a/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h +++ b/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h
@@ -5,6 +5,7 @@ #ifndef WorkerNavigatorBudget_h #define WorkerNavigatorBudget_h +#include "core/workers/WorkerNavigator.h" #include "platform/Supplementable.h" #include "platform/heap/GarbageCollected.h" #include "wtf/Noncopyable.h"
diff --git a/third_party/WebKit/Source/modules/compositorworker/WindowAnimationWorklet.h b/third_party/WebKit/Source/modules/compositorworker/WindowAnimationWorklet.h index 3635ec3..bc3c99c 100644 --- a/third_party/WebKit/Source/modules/compositorworker/WindowAnimationWorklet.h +++ b/third_party/WebKit/Source/modules/compositorworker/WindowAnimationWorklet.h
@@ -6,6 +6,7 @@ #define WindowAnimationWorklet_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/LocalDOMWindow.h" #include "modules/ModulesExport.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.h b/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.h index 214a113..1248c8d5 100644 --- a/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.h +++ b/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.h
@@ -32,6 +32,7 @@ #define DOMWindowCrypto_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/LocalDOMWindow.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h b/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h index 1787373..8689695 100644 --- a/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h +++ b/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h
@@ -6,6 +6,7 @@ #define WindowPaintWorklet_h #include "core/frame/DOMWindowProperty.h" +#include "core/frame/LocalDOMWindow.h" #include "modules/ModulesExport.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.h b/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.h index 6fd2a17..87bdc89 100644 --- a/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.h +++ b/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.h
@@ -32,6 +32,7 @@ #define NavigatorDoNotTrack_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h index 904633e..5efac0b 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h
@@ -8,6 +8,7 @@ #include "core/EventTypeNames.h" #include "core/dom/DOMTypedArray.h" #include "core/events/EventTarget.h" +#include "core/html/HTMLMediaElement.h" #include "modules/ModulesExport.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h index 1fd243d1..226e8ed0 100644 --- a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h +++ b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h
@@ -28,6 +28,7 @@ #include "core/dom/ContextLifecycleObserver.h" #include "core/frame/LocalDOMWindow.h" +#include "core/frame/Navigator.h" #include "core/frame/PlatformEventController.h" #include "modules/ModulesExport.h" #include "platform/AsyncMethodRunner.h"
diff --git a/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.h b/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.h index ad087165..6916e26 100644 --- a/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.h +++ b/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.h
@@ -21,6 +21,7 @@ #define NavigatorGeolocation_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.h b/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.h index 7a9a65ba..17f39de6f 100644 --- a/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.h +++ b/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.h
@@ -6,6 +6,7 @@ #define NavigatorInstalledApp_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.h b/third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.h index 9aafe5b..a6c0eede 100644 --- a/third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.h +++ b/third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.h
@@ -5,6 +5,7 @@ #ifndef NavigatorUserMedia_h #define NavigatorUserMedia_h +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.h b/third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.h index c4f16e1..818ba645 100644 --- a/third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.h +++ b/third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.h
@@ -6,6 +6,7 @@ #define NavigatorNetworkInformation_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" namespace blink {
diff --git a/third_party/WebKit/Source/modules/netinfo/WorkerNavigatorNetworkInformation.h b/third_party/WebKit/Source/modules/netinfo/WorkerNavigatorNetworkInformation.h index ca29a2ec..e118ee6e 100644 --- a/third_party/WebKit/Source/modules/netinfo/WorkerNavigatorNetworkInformation.h +++ b/third_party/WebKit/Source/modules/netinfo/WorkerNavigatorNetworkInformation.h
@@ -5,6 +5,7 @@ #ifndef WorkerNavigatorNetworkInformation_h #define WorkerNavigatorNetworkInformation_h +#include "core/workers/WorkerNavigator.h" #include "platform/Supplementable.h" namespace blink {
diff --git a/third_party/WebKit/Source/modules/nfc/NavigatorNFC.h b/third_party/WebKit/Source/modules/nfc/NavigatorNFC.h index 277001c..64cb1e97 100644 --- a/third_party/WebKit/Source/modules/nfc/NavigatorNFC.h +++ b/third_party/WebKit/Source/modules/nfc/NavigatorNFC.h
@@ -5,6 +5,7 @@ #ifndef NavigatorNFC_h #define NavigatorNFC_h +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/payments/HTMLIFrameElementPayments.h b/third_party/WebKit/Source/modules/payments/HTMLIFrameElementPayments.h index 0d78d608..c68e4f0 100644 --- a/third_party/WebKit/Source/modules/payments/HTMLIFrameElementPayments.h +++ b/third_party/WebKit/Source/modules/payments/HTMLIFrameElementPayments.h
@@ -5,6 +5,7 @@ #ifndef HTMLIFrameElementPayments_h #define HTMLIFrameElementPayments_h +#include "core/html/HTMLIFrameElement.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.h b/third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.h index 3e2b70b..eccebd3 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.h +++ b/third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.h
@@ -5,6 +5,7 @@ #ifndef PaymentAppServiceWorkerRegistration_h #define PaymentAppServiceWorkerRegistration_h +#include "modules/serviceworkers/ServiceWorkerRegistration.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/permissions/NavigatorPermissions.h b/third_party/WebKit/Source/modules/permissions/NavigatorPermissions.h index 51327622..bb92120 100644 --- a/third_party/WebKit/Source/modules/permissions/NavigatorPermissions.h +++ b/third_party/WebKit/Source/modules/permissions/NavigatorPermissions.h
@@ -5,6 +5,7 @@ #ifndef NavigatorPermissions_h #define NavigatorPermissions_h +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/permissions/WorkerNavigatorPermissions.h b/third_party/WebKit/Source/modules/permissions/WorkerNavigatorPermissions.h index 1f4d04b..c5c18da 100644 --- a/third_party/WebKit/Source/modules/permissions/WorkerNavigatorPermissions.h +++ b/third_party/WebKit/Source/modules/permissions/WorkerNavigatorPermissions.h
@@ -5,6 +5,7 @@ #ifndef WorkerNavigatorPermissions_h #define WorkerNavigatorPermissions_h +#include "core/workers/WorkerNavigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/plugins/NavigatorPlugins.h b/third_party/WebKit/Source/modules/plugins/NavigatorPlugins.h index 669f8c7..97fb7ab 100644 --- a/third_party/WebKit/Source/modules/plugins/NavigatorPlugins.h +++ b/third_party/WebKit/Source/modules/plugins/NavigatorPlugins.h
@@ -6,6 +6,7 @@ #define NavigatorPlugins_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" namespace blink {
diff --git a/third_party/WebKit/Source/modules/presentation/NavigatorPresentation.h b/third_party/WebKit/Source/modules/presentation/NavigatorPresentation.h index 8f09dff..f888fe5 100644 --- a/third_party/WebKit/Source/modules/presentation/NavigatorPresentation.h +++ b/third_party/WebKit/Source/modules/presentation/NavigatorPresentation.h
@@ -5,6 +5,7 @@ #ifndef NavigatorPresentation_h #define NavigatorPresentation_h +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/push_messaging/ServiceWorkerRegistrationPush.h b/third_party/WebKit/Source/modules/push_messaging/ServiceWorkerRegistrationPush.h index 935849a5..343581e 100644 --- a/third_party/WebKit/Source/modules/push_messaging/ServiceWorkerRegistrationPush.h +++ b/third_party/WebKit/Source/modules/push_messaging/ServiceWorkerRegistrationPush.h
@@ -5,6 +5,7 @@ #ifndef ServiceWorkerRegistrationPush_h #define ServiceWorkerRegistrationPush_h +#include "modules/serviceworkers/ServiceWorkerRegistration.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.h b/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.h index c2c201e5..0e6fa26 100644 --- a/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.h +++ b/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.h
@@ -32,6 +32,7 @@ #define NavigatorStorageQuota_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/Navigator.h" #include "modules/quota/DeprecatedStorageQuota.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.h b/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.h index ae2c77e3..a10d65fb 100644 --- a/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.h +++ b/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.h
@@ -5,6 +5,7 @@ #ifndef HTMLMediaElementRemotePlayback_h #define HTMLMediaElementRemotePlayback_h +#include "core/html/HTMLMediaElement.h" #include "modules/ModulesExport.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenScreenOrientation.h b/third_party/WebKit/Source/modules/screen_orientation/ScreenScreenOrientation.h index 1138084..0cfc200 100644 --- a/third_party/WebKit/Source/modules/screen_orientation/ScreenScreenOrientation.h +++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenScreenOrientation.h
@@ -5,6 +5,7 @@ #ifndef ScreenScreenOrientation_h #define ScreenScreenOrientation_h +#include "core/frame/Screen.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.h b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.h index a52811b..1d8a239 100644 --- a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.h +++ b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.h
@@ -27,6 +27,7 @@ #define DOMWindowSpeechSynthesis_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/LocalDOMWindow.h" #include "modules/ModulesExport.h" #include "modules/speech/SpeechSynthesis.h" #include "platform/Supplementable.h"
diff --git a/third_party/WebKit/Source/modules/storage/DOMWindowStorage.h b/third_party/WebKit/Source/modules/storage/DOMWindowStorage.h index f97faf3..bf7a0df 100644 --- a/third_party/WebKit/Source/modules/storage/DOMWindowStorage.h +++ b/third_party/WebKit/Source/modules/storage/DOMWindowStorage.h
@@ -6,6 +6,7 @@ #define DOMWindowStorage_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/LocalDOMWindow.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.h b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.h index 64d4e19..b8a9219 100644 --- a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.h +++ b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.h
@@ -21,6 +21,7 @@ #define NavigatorVibration_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/Navigator.h" #include "modules/ModulesExport.h" #include "platform/Supplementable.h" #include "platform/heap/GarbageCollected.h"
diff --git a/third_party/WebKit/Source/modules/vr/NavigatorVR.h b/third_party/WebKit/Source/modules/vr/NavigatorVR.h index 65f7fba..fb6489d5 100644 --- a/third_party/WebKit/Source/modules/vr/NavigatorVR.h +++ b/third_party/WebKit/Source/modules/vr/NavigatorVR.h
@@ -8,6 +8,7 @@ #include "bindings/core/v8/ScriptPromise.h" #include "core/dom/ContextLifecycleObserver.h" #include "core/frame/LocalDOMWindow.h" +#include "core/frame/Navigator.h" #include "core/page/PageVisibilityObserver.h" #include "modules/ModulesExport.h" #include "modules/vr/VRDisplay.h"
diff --git a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h index 0a731a30..71a952f9 100644 --- a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h +++ b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h
@@ -6,6 +6,7 @@ #define ScreenWakeLock_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/LocalFrame.h" #include "core/page/PageVisibilityObserver.h" #include "device/wake_lock/public/interfaces/wake_lock_service.mojom-blink.h" #include "modules/ModulesExport.h"
diff --git a/third_party/WebKit/Source/modules/webaudio/WindowAudioWorklet.h b/third_party/WebKit/Source/modules/webaudio/WindowAudioWorklet.h index c26fe27..53b758c5 100644 --- a/third_party/WebKit/Source/modules/webaudio/WindowAudioWorklet.h +++ b/third_party/WebKit/Source/modules/webaudio/WindowAudioWorklet.h
@@ -6,6 +6,7 @@ #define WindowAudioWorklet_h #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/LocalDOMWindow.h" #include "modules/ModulesExport.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.h b/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.h index cc1a1d8..728f564f 100644 --- a/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.h +++ b/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.h
@@ -33,6 +33,7 @@ #include "bindings/core/v8/ScriptPromise.h" #include "core/dom/ContextLifecycleObserver.h" +#include "core/frame/Navigator.h" #include "modules/webmidi/MIDIOptions.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/webshare/NavigatorShare.h b/third_party/WebKit/Source/modules/webshare/NavigatorShare.h index 7ff50957..6ffe984 100644 --- a/third_party/WebKit/Source/modules/webshare/NavigatorShare.h +++ b/third_party/WebKit/Source/modules/webshare/NavigatorShare.h
@@ -10,6 +10,7 @@ #include "bindings/core/v8/ScriptWrappable.h" #include "core/dom/ContextLifecycleObserver.h" #include "core/events/EventTarget.h" +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h" #include "public/platform/modules/webshare/webshare.mojom-blink.h"
diff --git a/third_party/WebKit/Source/modules/webusb/NavigatorUSB.h b/third_party/WebKit/Source/modules/webusb/NavigatorUSB.h index 59f78fa4..3e42420 100644 --- a/third_party/WebKit/Source/modules/webusb/NavigatorUSB.h +++ b/third_party/WebKit/Source/modules/webusb/NavigatorUSB.h
@@ -5,6 +5,7 @@ #ifndef NavigatorUSB_h #define NavigatorUSB_h +#include "core/frame/Navigator.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/platform/Supplementable.h b/third_party/WebKit/Source/platform/Supplementable.h index c9ff4c197..c2b90df0 100644 --- a/third_party/WebKit/Source/platform/Supplementable.h +++ b/third_party/WebKit/Source/platform/Supplementable.h
@@ -95,6 +95,12 @@ template <typename T> class Supplement : public GarbageCollectedMixin { public: + // TODO(haraken): Remove the default constructor. + // All Supplement objects should be instantiated with m_host. + Supplement() {} + explicit Supplement(T& host) : m_host(&host) {} + T* host() const { return m_host; } + static void provideTo(Supplementable<T>& host, const char* key, Supplement<T>* supplement) { @@ -109,7 +115,10 @@ return host ? host->requireSupplement(key) : 0; } - DEFINE_INLINE_VIRTUAL_TRACE() {} + DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_host); } + + private: + Member<T> m_host; }; // Supplementable<T> inherits from GarbageCollectedMixin virtually
diff --git a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp index 7a1414cd..1dbbfdf 100644 --- a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp +++ b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp
@@ -30,9 +30,6 @@ #include "web/SharedWorkerRepositoryClientImpl.h" -#include "bindings/core/v8/ExceptionMessages.h" -#include "bindings/core/v8/ExceptionState.h" -#include "core/dom/ExceptionCode.h" #include "core/dom/ExecutionContext.h" #include "core/events/Event.h" #include "core/frame/UseCounter.h" @@ -114,8 +111,7 @@ SharedWorker* worker, WebMessagePortChannelUniquePtr port, const KURL& url, - const String& name, - ExceptionState& exceptionState) { + const String& name) { DCHECK(m_client); // No nested workers (for now) - connect() should only be called from document @@ -151,14 +147,6 @@ switch (creationError) { case WebWorkerCreationErrorNone: break; - case WebWorkerCreationErrorURLMismatch: - // Existing worker does not match this url, so return an error back to the - // caller. - exceptionState.throwDOMException( - URLMismatchError, "The location of the SharedWorker named '" + name + - "' does not exactly match the provided URL ('" + - url.elidedString() + "')."); - return; case WebWorkerCreationErrorSecureContextMismatch: UseCounter::Feature feature = isSecureContext
diff --git a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.h b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.h index 0509a223..2b9a8f7 100644 --- a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.h +++ b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.h
@@ -57,8 +57,7 @@ void connect(SharedWorker*, WebMessagePortChannelUniquePtr, const KURL&, - const String& name, - ExceptionState&) override; + const String& name) override; void documentDetached(Document*) override; private:
diff --git a/third_party/WebKit/public/web/WebSharedWorkerCreationErrors.h b/third_party/WebKit/public/web/WebSharedWorkerCreationErrors.h index 9d262fe..1e41881 100644 --- a/third_party/WebKit/public/web/WebSharedWorkerCreationErrors.h +++ b/third_party/WebKit/public/web/WebSharedWorkerCreationErrors.h
@@ -12,7 +12,6 @@ // Describes errors that can occur while creating a SharedWorker. enum WebWorkerCreationError { WebWorkerCreationErrorNone = 0, - WebWorkerCreationErrorURLMismatch, WebWorkerCreationErrorSecureContextMismatch, WebWorkerCreationErrorLast = WebWorkerCreationErrorSecureContextMismatch };
diff --git a/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h b/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h index b398de0..b139ce6 100644 --- a/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h +++ b/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h
@@ -49,7 +49,7 @@ // given process). using DocumentID = unsigned long long; - // Creates a new shared worker connector. This may return null. + // Creates a new shared worker connector. virtual std::unique_ptr<WebSharedWorkerConnector> createSharedWorkerConnector( const WebURL& url, const WebString& name,