| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 void WebEmbeddedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> ta
sk) | 268 void WebEmbeddedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> ta
sk) |
| 269 { | 269 { |
| 270 toWebLocalFrameImpl(m_mainFrame)->frame()->document()->postTask(FROM_HERE, t
ask); | 270 toWebLocalFrameImpl(m_mainFrame)->frame()->document()->postTask(FROM_HERE, t
ask); |
| 271 } | 271 } |
| 272 | 272 |
| 273 bool WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionCont
extTask> task) | 273 bool WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionCont
extTask> task) |
| 274 { | 274 { |
| 275 if (m_askedToTerminate || !m_workerThread) | 275 if (m_askedToTerminate || !m_workerThread) |
| 276 return false; | 276 return false; |
| 277 | 277 |
| 278 m_workerThread->postTask(FROM_HERE, task); | 278 m_workerThread->postTask(task); |
| 279 return !m_workerThread->terminated(); | 279 return !m_workerThread->terminated(); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() | 282 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() |
| 283 { | 283 { |
| 284 // Create 'shadow page', which is never displayed and is used mainly to | 284 // Create 'shadow page', which is never displayed and is used mainly to |
| 285 // provide a context for loading on the main thread. | 285 // provide a context for loading on the main thread. |
| 286 // | 286 // |
| 287 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. | 287 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. |
| 288 // This code, and probably most of the code in this class should be shared | 288 // This code, and probably most of the code in this class should be shared |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 m_mainScriptLoader.clear(); | 429 m_mainScriptLoader.clear(); |
| 430 | 430 |
| 431 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 431 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
| 432 m_loaderProxy = WorkerLoaderProxy::create(this); | 432 m_loaderProxy = WorkerLoaderProxy::create(this); |
| 433 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy, startupData.release()); | 433 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy, startupData.release()); |
| 434 m_workerThread->start(); | 434 m_workerThread->start(); |
| 435 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 435 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace blink | 438 } // namespace blink |
| OLD | NEW |