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

Unified Diff: third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp

Issue 2685543002: Support data URLs in worker constructors (Closed)
Patch Set: Added additional test for invalid javascript data: worker Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
index c6e64dff110ae55686643307996126b5b8dbe073..89d1a73a0c318deabd766ae357d4b5298ae553ad 100644
--- a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
+++ b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
@@ -50,9 +50,13 @@ bool InProcessWorkerBase::initialize(ExecutionContext* context,
if (scriptURL.isEmpty())
return false;
+ CrossOriginRequestPolicy crossOriginRequestPolicy =
+ scriptURL.protocolIsData() ? AllowCrossOriginRequests
+ : DenyCrossOriginRequests;
+
m_scriptLoader = WorkerScriptLoader::create();
m_scriptLoader->loadAsynchronously(
- *context, scriptURL, DenyCrossOriginRequests,
+ *context, scriptURL, crossOriginRequestPolicy,
context->securityContext().addressSpace(),
WTF::bind(&InProcessWorkerBase::onResponse, wrapPersistent(this)),
WTF::bind(&InProcessWorkerBase::onFinished, wrapPersistent(this)));

Powered by Google App Engine
This is Rietveld 408576698