Commit edd1fbf8 authored by Hiroki Nakagawa's avatar Hiroki Nakagawa Committed by Commit Bot

Worker: Stop using WebLocalFrameImpl in core/workers

Using WebLocalFrameImpl in core/ is disallowed by core/DEPS.

Bug: n/a
Change-Id: Ie3f28322332132040850d89e9aaaf2d7a30a4fb9
Reviewed-on: https://chromium-review.googlesource.com/c/1257467Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596135}
parent 7dd9a1af
......@@ -11,14 +11,14 @@
#include "third_party/blink/public/platform/dedicated_worker_factory.mojom-blink.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h"
#include "third_party/blink/public/web/web_local_frame_client.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/post_message_helper.h"
#include "third_party/blink/renderer/core/core_initializer.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/events/message_event.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/frame/use_counter.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/inspector/main_thread_debugger.h"
#include "third_party/blink/renderer/core/messaging/post_message_options.h"
#include "third_party/blink/renderer/core/origin_trials/origin_trial_context.h"
......@@ -257,9 +257,8 @@ WorkerClients* DedicatedWorker::CreateWorkerClients() {
std::unique_ptr<WebContentSettingsClient> client;
if (GetExecutionContext()->IsDocument()) {
WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(
ToDocument(GetExecutionContext())->GetFrame());
client = web_frame->Client()->CreateWorkerContentSettingsClient();
LocalFrame* frame = ToDocument(GetExecutionContext())->GetFrame();
client = frame->Client()->CreateWorkerContentSettingsClient();
} else if (GetExecutionContext()->IsWorkerGlobalScope()) {
WebContentSettingsClient* web_worker_content_settings_client =
WorkerContentSettingsClient::From(*GetExecutionContext())
......
......@@ -7,11 +7,11 @@
#include "base/synchronization/waitable_event.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/public/platform/web_worker_fetch_context.h"
#include "third_party/blink/public/web/web_local_frame_client.h"
#include "third_party/blink/renderer/bindings/core/v8/source_location.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/deprecation.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/core/loader/worker_fetch_context.h"
#include "third_party/blink/renderer/core/workers/global_scope_creation_params.h"
......@@ -65,15 +65,13 @@ void ThreadedMessagingProxyBase::InitializeWorkerThread(
std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context;
if (execution_context_->IsDocument()) {
// |web_frame| is null in some unit tests.
if (WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(
ToDocument(GetExecutionContext())->GetFrame())) {
web_worker_fetch_context =
web_frame->Client()->CreateWorkerFetchContext();
DCHECK(web_worker_fetch_context);
LocalFrame* frame = ToDocument(GetExecutionContext())->GetFrame();
web_worker_fetch_context = frame->Client()->CreateWorkerFetchContext();
// |web_worker_fetch_context| is null in some unit tests.
if (web_worker_fetch_context) {
web_worker_fetch_context->SetApplicationCacheHostID(
GetExecutionContext()->Fetcher()->Context().ApplicationCacheHostID());
web_worker_fetch_context->SetIsOnSubframe(web_frame != web_frame->Top());
web_worker_fetch_context->SetIsOnSubframe(!frame->IsMainFrame());
}
} else if (execution_context_->IsWorkerGlobalScope()) {
web_worker_fetch_context =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment