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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 m_networkProvider = adoptPtr(m_client->createServiceWorkerNetworkProvider(fr
ame->dataSource())); | 193 m_networkProvider = adoptPtr(m_client->createServiceWorkerNetworkProvider(fr
ame->dataSource())); |
194 m_mainScriptLoader = adoptPtr(new WorkerScriptLoader()); | 194 m_mainScriptLoader = adoptPtr(new WorkerScriptLoader()); |
195 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWor
ker); | 195 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWor
ker); |
196 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); | 196 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); |
197 m_mainScriptLoader->loadAsynchronously( | 197 m_mainScriptLoader->loadAsynchronously( |
198 *m_loadingDocument.get(), | 198 *m_loadingDocument.get(), |
199 m_url, | 199 m_url, |
200 DenyCrossOriginRequests, | 200 DenyCrossOriginRequests, |
201 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this), | 201 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this), |
202 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); | 202 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); |
| 203 // Do nothing here since onScriptLoaderFinished() might have been already |
| 204 // invoked and |this| might have been deleted at this point. |
203 } | 205 } |
204 | 206 |
205 bool WebSharedWorkerImpl::isControlledByServiceWorker(WebDataSource& dataSource) | 207 bool WebSharedWorkerImpl::isControlledByServiceWorker(WebDataSource& dataSource) |
206 { | 208 { |
207 return m_networkProvider && m_networkProvider->isControlledByServiceWorker(d
ataSource); | 209 return m_networkProvider && m_networkProvider->isControlledByServiceWorker(d
ataSource); |
208 } | 210 } |
209 | 211 |
210 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) | 212 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) |
211 { | 213 { |
212 if (!m_networkProvider) | 214 if (!m_networkProvider) |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 if (devtoolsAgent) | 413 if (devtoolsAgent) |
412 devtoolsAgent->dispatchOnInspectorBackend(message); | 414 devtoolsAgent->dispatchOnInspectorBackend(message); |
413 } | 415 } |
414 | 416 |
415 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 417 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
416 { | 418 { |
417 return new WebSharedWorkerImpl(client); | 419 return new WebSharedWorkerImpl(client); |
418 } | 420 } |
419 | 421 |
420 } // namespace blink | 422 } // namespace blink |
OLD | NEW |