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

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

Issue 2540983003: CSP: Dedicated workers always inherit policy. (Closed)
Patch Set: Rebase. Created 3 years, 9 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 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 InProcessWorkerMessagingProxy::~InProcessWorkerMessagingProxy() { 78 InProcessWorkerMessagingProxy::~InProcessWorkerMessagingProxy() {
79 DCHECK(!m_workerObject); 79 DCHECK(!m_workerObject);
80 } 80 }
81 81
82 void InProcessWorkerMessagingProxy::startWorkerGlobalScope( 82 void InProcessWorkerMessagingProxy::startWorkerGlobalScope(
83 const KURL& scriptURL, 83 const KURL& scriptURL,
84 const String& userAgent, 84 const String& userAgent,
85 const String& sourceCode, 85 const String& sourceCode,
86 ContentSecurityPolicy* contentSecurityPolicy,
87 const String& referrerPolicy) { 86 const String& referrerPolicy) {
88 DCHECK(isParentContextThread()); 87 DCHECK(isParentContextThread());
89 if (askedToTerminate()) { 88 if (askedToTerminate()) {
90 // Worker.terminate() could be called from JS before the thread was 89 // Worker.terminate() could be called from JS before the thread was
91 // created. 90 // created.
92 return; 91 return;
93 } 92 }
94 93
95 Document* document = toDocument(getExecutionContext()); 94 Document* document = toDocument(getExecutionContext());
96 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); 95 SecurityOrigin* starterOrigin = document->getSecurityOrigin();
97 96
98 ContentSecurityPolicy* csp = contentSecurityPolicy 97 ContentSecurityPolicy* csp = document->contentSecurityPolicy();
99 ? contentSecurityPolicy
100 : document->contentSecurityPolicy();
101 DCHECK(csp); 98 DCHECK(csp);
102 99
103 WorkerThreadStartMode startMode = 100 WorkerThreadStartMode startMode =
104 workerInspectorProxy()->workerStartMode(document); 101 workerInspectorProxy()->workerStartMode(document);
105 std::unique_ptr<WorkerSettings> workerSettings = 102 std::unique_ptr<WorkerSettings> workerSettings =
106 WTF::wrapUnique(new WorkerSettings(document->settings())); 103 WTF::wrapUnique(new WorkerSettings(document->settings()));
107 WorkerV8Settings workerV8Settings(WorkerV8Settings::Default()); 104 WorkerV8Settings workerV8Settings(WorkerV8Settings::Default());
108 workerV8Settings.m_heapLimitMode = 105 workerV8Settings.m_heapLimitMode =
109 toIsolate(document)->IsHeapLimitIncreasedForDebugging() 106 toIsolate(document)->IsHeapLimitIncreasedForDebugging()
110 ? WorkerV8Settings::HeapLimitMode::IncreasedForDebugging 107 ? WorkerV8Settings::HeapLimitMode::IncreasedForDebugging
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 234 }
238 235
239 bool InProcessWorkerMessagingProxy::hasPendingActivity() const { 236 bool InProcessWorkerMessagingProxy::hasPendingActivity() const {
240 DCHECK(isParentContextThread()); 237 DCHECK(isParentContextThread());
241 if (askedToTerminate()) 238 if (askedToTerminate())
242 return false; 239 return false;
243 return m_workerGlobalScopeHasPendingActivity; 240 return m_workerGlobalScopeHasPendingActivity;
244 } 241 }
245 242
246 } // namespace blink 243 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698