Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp

Issue 2804843005: Implement the infrastructure of creating WorkerFetchContext in worker global scope. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 22 matching lines...) Expand all
33 #include "bindings/core/v8/V8AbstractEventListener.h" 33 #include "bindings/core/v8/V8AbstractEventListener.h"
34 #include "core/dom/ContextLifecycleNotifier.h" 34 #include "core/dom/ContextLifecycleNotifier.h"
35 #include "core/dom/ExceptionCode.h" 35 #include "core/dom/ExceptionCode.h"
36 #include "core/dom/SuspendableObject.h" 36 #include "core/dom/SuspendableObject.h"
37 #include "core/events/ErrorEvent.h" 37 #include "core/events/ErrorEvent.h"
38 #include "core/events/Event.h" 38 #include "core/events/Event.h"
39 #include "core/frame/DOMTimerCoordinator.h" 39 #include "core/frame/DOMTimerCoordinator.h"
40 #include "core/inspector/ConsoleMessage.h" 40 #include "core/inspector/ConsoleMessage.h"
41 #include "core/inspector/ConsoleMessageStorage.h" 41 #include "core/inspector/ConsoleMessageStorage.h"
42 #include "core/inspector/WorkerThreadDebugger.h" 42 #include "core/inspector/WorkerThreadDebugger.h"
43 #include "core/loader/WorkerFetchContext.h"
43 #include "core/loader/WorkerThreadableLoader.h" 44 #include "core/loader/WorkerThreadableLoader.h"
44 #include "core/probe/CoreProbes.h" 45 #include "core/probe/CoreProbes.h"
45 #include "core/workers/WorkerClients.h" 46 #include "core/workers/WorkerClients.h"
46 #include "core/workers/WorkerLoaderProxy.h" 47 #include "core/workers/WorkerLoaderProxy.h"
47 #include "core/workers/WorkerLocation.h" 48 #include "core/workers/WorkerLocation.h"
48 #include "core/workers/WorkerNavigator.h" 49 #include "core/workers/WorkerNavigator.h"
49 #include "core/workers/WorkerReportingProxy.h" 50 #include "core/workers/WorkerReportingProxy.h"
50 #include "core/workers/WorkerScriptLoader.h" 51 #include "core/workers/WorkerScriptLoader.h"
51 #include "core/workers/WorkerThread.h" 52 #include "core/workers/WorkerThread.h"
52 #include "platform/CrossThreadFunctional.h" 53 #include "platform/CrossThreadFunctional.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 if (GetSecurityOrigin()->IsPotentiallyTrustworthy()) 294 if (GetSecurityOrigin()->IsPotentiallyTrustworthy())
294 return true; 295 return true;
295 error_message = GetSecurityOrigin()->IsPotentiallyTrustworthyErrorMessage(); 296 error_message = GetSecurityOrigin()->IsPotentiallyTrustworthyErrorMessage();
296 return false; 297 return false;
297 } 298 }
298 299
299 ExecutionContext* WorkerGlobalScope::GetExecutionContext() const { 300 ExecutionContext* WorkerGlobalScope::GetExecutionContext() const {
300 return const_cast<WorkerGlobalScope*>(this); 301 return const_cast<WorkerGlobalScope*>(this);
301 } 302 }
302 303
304 WorkerFetchContext* WorkerGlobalScope::FetchContext() {
nhiroki 2017/04/18 07:56:41 DCHECK(base::FeatureList::IsEnabled(kOffMainThread
horo 2017/04/18 12:53:34 Done.
305 if (fetch_context_)
306 return fetch_context_;
307 fetch_context_ = WorkerFetchContext::Create(*this);
308 return fetch_context_;
309 }
310
303 WorkerGlobalScope::WorkerGlobalScope( 311 WorkerGlobalScope::WorkerGlobalScope(
304 const KURL& url, 312 const KURL& url,
305 const String& user_agent, 313 const String& user_agent,
306 WorkerThread* thread, 314 WorkerThread* thread,
307 double time_origin, 315 double time_origin,
308 std::unique_ptr<SecurityOrigin::PrivilegeData> 316 std::unique_ptr<SecurityOrigin::PrivilegeData>
309 starter_origin_privilage_data, 317 starter_origin_privilage_data,
310 WorkerClients* worker_clients) 318 WorkerClients* worker_clients)
311 : url_(url), 319 : url_(url),
312 user_agent_(user_agent), 320 user_agent_(user_agent),
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } 377 }
370 378
371 DEFINE_TRACE(WorkerGlobalScope) { 379 DEFINE_TRACE(WorkerGlobalScope) {
372 visitor->Trace(location_); 380 visitor->Trace(location_);
373 visitor->Trace(navigator_); 381 visitor->Trace(navigator_);
374 visitor->Trace(script_controller_); 382 visitor->Trace(script_controller_);
375 visitor->Trace(event_queue_); 383 visitor->Trace(event_queue_);
376 visitor->Trace(timers_); 384 visitor->Trace(timers_);
377 visitor->Trace(event_listeners_); 385 visitor->Trace(event_listeners_);
378 visitor->Trace(pending_error_events_); 386 visitor->Trace(pending_error_events_);
387 visitor->Trace(fetch_context_);
379 ExecutionContext::Trace(visitor); 388 ExecutionContext::Trace(visitor);
380 EventTargetWithInlineData::Trace(visitor); 389 EventTargetWithInlineData::Trace(visitor);
381 SecurityContext::Trace(visitor); 390 SecurityContext::Trace(visitor);
382 Supplementable<WorkerGlobalScope>::Trace(visitor); 391 Supplementable<WorkerGlobalScope>::Trace(visitor);
383 } 392 }
384 393
385 } // namespace blink 394 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698