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

Unified Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.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/web/WebSharedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index 04764e4f21eabb11fce26ed234387d0050fec89a..dfc21de6f498c90ef51048b6a6e16ff80f800a86 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -178,8 +178,13 @@ void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) {
m_mainScriptLoader->setRequestContext(
WebURLRequest::RequestContextSharedWorker);
m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document();
+
+ CrossOriginRequestPolicy crossOriginRequestPolicy =
+ (static_cast<KURL>(m_url)).protocolIsData() ? AllowCrossOriginRequests
+ : DenyCrossOriginRequests;
+
m_mainScriptLoader->loadAsynchronously(
- *m_loadingDocument.get(), m_url, DenyCrossOriginRequests,
+ *m_loadingDocument.get(), m_url, crossOriginRequestPolicy,
m_creationAddressSpace,
bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse,
WTF::unretained(this)),

Powered by Google App Engine
This is Rietveld 408576698