| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 DCHECK(!m_mainScriptLoader); | 174 DCHECK(!m_mainScriptLoader); |
| 175 m_networkProvider = wrapUnique(m_client->createServiceWorkerNetworkProvider(
frame->dataSource())); | 175 m_networkProvider = wrapUnique(m_client->createServiceWorkerNetworkProvider(
frame->dataSource())); |
| 176 m_mainScriptLoader = WorkerScriptLoader::create(); | 176 m_mainScriptLoader = WorkerScriptLoader::create(); |
| 177 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWor
ker); | 177 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWor
ker); |
| 178 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); | 178 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); |
| 179 m_mainScriptLoader->loadAsynchronously( | 179 m_mainScriptLoader->loadAsynchronously( |
| 180 *m_loadingDocument.get(), | 180 *m_loadingDocument.get(), |
| 181 m_url, | 181 m_url, |
| 182 DenyCrossOriginRequests, | 182 DenyCrossOriginRequests, |
| 183 m_creationAddressSpace, | 183 m_creationAddressSpace, |
| 184 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this), | 184 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, WTF::unretain
ed(this)), |
| 185 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); | 185 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, WTF::unretained(this)
)); |
| 186 // Do nothing here since onScriptLoaderFinished() might have been already | 186 // Do nothing here since onScriptLoaderFinished() might have been already |
| 187 // invoked and |this| might have been deleted at this point. | 187 // invoked and |this| might have been deleted at this point. |
| 188 } | 188 } |
| 189 | 189 |
| 190 bool WebSharedWorkerImpl::isControlledByServiceWorker(WebDataSource& dataSource) | 190 bool WebSharedWorkerImpl::isControlledByServiceWorker(WebDataSource& dataSource) |
| 191 { | 191 { |
| 192 return m_networkProvider && m_networkProvider->isControlledByServiceWorker(d
ataSource); | 192 return m_networkProvider && m_networkProvider->isControlledByServiceWorker(d
ataSource); |
| 193 } | 193 } |
| 194 | 194 |
| 195 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) | 195 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 if (devtoolsAgent) | 398 if (devtoolsAgent) |
| 399 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, mes
sage); | 399 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, mes
sage); |
| 400 } | 400 } |
| 401 | 401 |
| 402 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 402 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
| 403 { | 403 { |
| 404 return new WebSharedWorkerImpl(client); | 404 return new WebSharedWorkerImpl(client); |
| 405 } | 405 } |
| 406 | 406 |
| 407 } // namespace blink | 407 } // namespace blink |
| OLD | NEW |