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

Side by Side Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp

Issue 2685543002: Support data URLs in worker constructors (Closed)
Patch Set: Added external tests for data: SharedWorkers 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) { 172 void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) {
173 DCHECK(!m_loadingDocument); 173 DCHECK(!m_loadingDocument);
174 DCHECK(!m_mainScriptLoader); 174 DCHECK(!m_mainScriptLoader);
175 m_networkProvider = WTF::wrapUnique( 175 m_networkProvider = WTF::wrapUnique(
176 m_client->createServiceWorkerNetworkProvider(frame->dataSource())); 176 m_client->createServiceWorkerNetworkProvider(frame->dataSource()));
177 m_mainScriptLoader = WorkerScriptLoader::create(); 177 m_mainScriptLoader = WorkerScriptLoader::create();
178 m_mainScriptLoader->setRequestContext( 178 m_mainScriptLoader->setRequestContext(
179 WebURLRequest::RequestContextSharedWorker); 179 WebURLRequest::RequestContextSharedWorker);
180 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); 180 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document();
181
182 CrossOriginRequestPolicy crossOriginRequestPolicy =
183 ((KURL)m_url).protocolIsData() ? AllowCrossOriginRequests
jochen (gone - plz use gerrit) 2017/02/10 09:57:37 please use c++ style cases (static_cast<KURL>) - s
andypaicu2 2017/02/13 11:38:45 Done
184 : DenyCrossOriginRequests;
185
181 m_mainScriptLoader->loadAsynchronously( 186 m_mainScriptLoader->loadAsynchronously(
182 *m_loadingDocument.get(), m_url, DenyCrossOriginRequests, 187 *m_loadingDocument.get(), m_url, crossOriginRequestPolicy,
183 m_creationAddressSpace, 188 m_creationAddressSpace,
184 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, 189 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse,
185 WTF::unretained(this)), 190 WTF::unretained(this)),
186 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, 191 bind(&WebSharedWorkerImpl::onScriptLoaderFinished,
187 WTF::unretained(this))); 192 WTF::unretained(this)));
188 // Do nothing here since onScriptLoaderFinished() might have been already 193 // Do nothing here since onScriptLoaderFinished() might have been already
189 // invoked and |this| might have been deleted at this point. 194 // invoked and |this| might have been deleted at this point.
190 } 195 }
191 196
192 bool WebSharedWorkerImpl::isControlledByServiceWorker( 197 bool WebSharedWorkerImpl::isControlledByServiceWorker(
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 if (devtoolsAgent) 466 if (devtoolsAgent)
462 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, 467 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method,
463 message); 468 message);
464 } 469 }
465 470
466 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { 471 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) {
467 return new WebSharedWorkerImpl(client); 472 return new WebSharedWorkerImpl(client);
468 } 473 }
469 474
470 } // namespace blink 475 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698