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

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

Issue 2685543002: Support data URLs in worker constructors (Closed)
Patch Set: Changes to allow data URL workers 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..3a96c18a0a1dcde5aafb909c336c1e73d4ce4e1d 100644
--- a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
+++ b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
@@ -50,9 +50,14 @@ bool InProcessWorkerBase::initialize(ExecutionContext* context,
if (scriptURL.isEmpty())
return false;
+ CrossOriginRequestPolicy crossOriginRequestPolicy = DenyCrossOriginRequests;
+ if (scriptURL.protocolIsData()) {
+ crossOriginRequestPolicy = AllowCrossOriginRequests;
+ }
Mike West 2017/02/08 13:15:44 I'd prefer to spell this with a ternary-if since i
andypaicu2 2017/02/10 10:25:37 Done
+
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