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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 405 |
406 // SharedWorker can sometimes run tasks that are initiated by/associated with | 406 // SharedWorker can sometimes run tasks that are initiated by/associated with |
407 // a document's frame but these documents can be from a different process. So | 407 // a document's frame but these documents can be from a different process. So |
408 // we intentionally populate the task runners with null document in order to | 408 // we intentionally populate the task runners with null document in order to |
409 // use the thread's default task runner. Note that |m_document| should not be | 409 // use the thread's default task runner. Note that |m_document| should not be |
410 // used as it's a dummy document for loading that doesn't represent the frame | 410 // used as it's a dummy document for loading that doesn't represent the frame |
411 // of any associated document. | 411 // of any associated document. |
412 m_parentFrameTaskRunners = ParentFrameTaskRunners::create(nullptr); | 412 m_parentFrameTaskRunners = ParentFrameTaskRunners::create(nullptr); |
413 | 413 |
414 m_loaderProxy = WorkerLoaderProxy::create(this); | 414 m_loaderProxy = WorkerLoaderProxy::create(this); |
415 m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this, | 415 m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this); |
416 m_parentFrameTaskRunners.get()); | |
417 InspectorInstrumentation::scriptImported(m_loadingDocument, | 416 InspectorInstrumentation::scriptImported(m_loadingDocument, |
418 m_mainScriptLoader->identifier(), | 417 m_mainScriptLoader->identifier(), |
419 m_mainScriptLoader->script()); | 418 m_mainScriptLoader->script()); |
420 m_mainScriptLoader.clear(); | 419 m_mainScriptLoader.clear(); |
421 | 420 |
422 workerThread()->start(std::move(startupData)); | 421 workerThread()->start(std::move(startupData), m_parentFrameTaskRunners.get()); |
423 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument), | 422 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument), |
424 workerThread(), m_url); | 423 workerThread(), m_url); |
425 m_client->workerScriptLoaded(); | 424 m_client->workerScriptLoaded(); |
426 } | 425 } |
427 | 426 |
428 void WebSharedWorkerImpl::terminateWorkerContext() { | 427 void WebSharedWorkerImpl::terminateWorkerContext() { |
429 terminateWorkerThread(); | 428 terminateWorkerThread(); |
430 } | 429 } |
431 | 430 |
432 void WebSharedWorkerImpl::pauseWorkerContextOnStart() { | 431 void WebSharedWorkerImpl::pauseWorkerContextOnStart() { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 if (devtoolsAgent) | 464 if (devtoolsAgent) |
466 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, | 465 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, |
467 message); | 466 message); |
468 } | 467 } |
469 | 468 |
470 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { | 469 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { |
471 return new WebSharedWorkerImpl(client); | 470 return new WebSharedWorkerImpl(client); |
472 } | 471 } |
473 | 472 |
474 } // namespace blink | 473 } // namespace blink |
OLD | NEW |