| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 WebAddressSpace creationAddressSpace) { | 315 WebAddressSpace creationAddressSpace) { |
| 316 DCHECK(isMainThread()); | 316 DCHECK(isMainThread()); |
| 317 m_url = url; | 317 m_url = url; |
| 318 m_name = name; | 318 m_name = name; |
| 319 m_creationAddressSpace = creationAddressSpace; | 319 m_creationAddressSpace = creationAddressSpace; |
| 320 initializeLoader(); | 320 initializeLoader(); |
| 321 } | 321 } |
| 322 | 322 |
| 323 void WebSharedWorkerImpl::didReceiveScriptLoaderResponse() { | 323 void WebSharedWorkerImpl::didReceiveScriptLoaderResponse() { |
| 324 DCHECK(isMainThread()); | 324 DCHECK(isMainThread()); |
| 325 InspectorInstrumentation::didReceiveScriptResponse( | 325 probe::didReceiveScriptResponse(m_loadingDocument, |
| 326 m_loadingDocument, m_mainScriptLoader->identifier()); | 326 m_mainScriptLoader->identifier()); |
| 327 m_client->selectAppCacheID(m_mainScriptLoader->appCacheID()); | 327 m_client->selectAppCacheID(m_mainScriptLoader->appCacheID()); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void WebSharedWorkerImpl::onScriptLoaderFinished() { | 330 void WebSharedWorkerImpl::onScriptLoaderFinished() { |
| 331 DCHECK(isMainThread()); | 331 DCHECK(isMainThread()); |
| 332 DCHECK(m_loadingDocument); | 332 DCHECK(m_loadingDocument); |
| 333 DCHECK(m_mainScriptLoader); | 333 DCHECK(m_mainScriptLoader); |
| 334 if (m_askedToTerminate) | 334 if (m_askedToTerminate) |
| 335 return; | 335 return; |
| 336 if (m_mainScriptLoader->failed()) { | 336 if (m_mainScriptLoader->failed()) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 // use the thread's default task runner. Note that |m_document| should not be | 381 // use the thread's default task runner. Note that |m_document| should not be |
| 382 // used as it's a dummy document for loading that doesn't represent the frame | 382 // used as it's a dummy document for loading that doesn't represent the frame |
| 383 // of any associated document. | 383 // of any associated document. |
| 384 m_parentFrameTaskRunners = ParentFrameTaskRunners::create(nullptr); | 384 m_parentFrameTaskRunners = ParentFrameTaskRunners::create(nullptr); |
| 385 | 385 |
| 386 m_loaderProxy = WorkerLoaderProxy::create(this); | 386 m_loaderProxy = WorkerLoaderProxy::create(this); |
| 387 m_reportingProxy = new WebSharedWorkerReportingProxyImpl( | 387 m_reportingProxy = new WebSharedWorkerReportingProxyImpl( |
| 388 this, m_parentFrameTaskRunners.get()); | 388 this, m_parentFrameTaskRunners.get()); |
| 389 m_workerThread = | 389 m_workerThread = |
| 390 SharedWorkerThread::create(m_name, m_loaderProxy, *m_reportingProxy); | 390 SharedWorkerThread::create(m_name, m_loaderProxy, *m_reportingProxy); |
| 391 InspectorInstrumentation::scriptImported(m_loadingDocument, | 391 probe::scriptImported(m_loadingDocument, m_mainScriptLoader->identifier(), |
| 392 m_mainScriptLoader->identifier(), | 392 m_mainScriptLoader->script()); |
| 393 m_mainScriptLoader->script()); | |
| 394 m_mainScriptLoader.clear(); | 393 m_mainScriptLoader.clear(); |
| 395 | 394 |
| 396 workerThread()->start(std::move(startupData), m_parentFrameTaskRunners.get()); | 395 workerThread()->start(std::move(startupData), m_parentFrameTaskRunners.get()); |
| 397 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument), | 396 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument), |
| 398 workerThread(), m_url); | 397 workerThread(), m_url); |
| 399 m_client->workerScriptLoaded(); | 398 m_client->workerScriptLoaded(); |
| 400 } | 399 } |
| 401 | 400 |
| 402 void WebSharedWorkerImpl::terminateWorkerContext() { | 401 void WebSharedWorkerImpl::terminateWorkerContext() { |
| 403 DCHECK(isMainThread()); | 402 DCHECK(isMainThread()); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 if (devtoolsAgent) | 439 if (devtoolsAgent) |
| 441 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, | 440 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, |
| 442 message); | 441 message); |
| 443 } | 442 } |
| 444 | 443 |
| 445 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { | 444 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { |
| 446 return new WebSharedWorkerImpl(client); | 445 return new WebSharedWorkerImpl(client); |
| 447 } | 446 } |
| 448 | 447 |
| 449 } // namespace blink | 448 } // namespace blink |
| OLD | NEW |