| OLD | NEW |
| 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 Loading... |
| 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 (static_cast<KURL>(m_url)).protocolIsData() ? AllowCrossOriginRequests |
| 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 Loading... |
| 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 |
| OLD | NEW |