| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 { | 197 { |
| 198 if (m_askedToTerminate) | 198 if (m_askedToTerminate) |
| 199 return; | 199 return; |
| 200 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); | 200 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); |
| 201 if (devtoolsAgent) | 201 if (devtoolsAgent) |
| 202 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); | 202 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) | 205 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) |
| 206 { | 206 { |
| 207 WorkerInspectorProxy::PageInspector* pageInspector = m_workerInspectorProxy-
>pageInspector(); | 207 m_workerInspectorProxy->dispatchMessageFromWorker(message); |
| 208 if (!pageInspector) | |
| 209 return; | |
| 210 pageInspector->dispatchMessageFromWorker(message); | |
| 211 } | 208 } |
| 212 | 209 |
| 213 void WebEmbeddedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> ta
sk) | 210 void WebEmbeddedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> ta
sk) |
| 214 { | 211 { |
| 215 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, task); | 212 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, task); |
| 216 } | 213 } |
| 217 | 214 |
| 218 bool WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionCont
extTask> task) | 215 bool WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionCont
extTask> task) |
| 219 { | 216 { |
| 220 if (m_askedToTerminate || !m_workerThread) | 217 if (m_askedToTerminate || !m_workerThread) |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 m_mainScriptLoader.clear(); | 373 m_mainScriptLoader.clear(); |
| 377 | 374 |
| 378 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 375 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
| 379 m_loaderProxy = WorkerLoaderProxy::create(this); | 376 m_loaderProxy = WorkerLoaderProxy::create(this); |
| 380 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); | 377 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); |
| 381 m_workerThread->start(startupData.release()); | 378 m_workerThread->start(startupData.release()); |
| 382 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 379 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
| 383 } | 380 } |
| 384 | 381 |
| 385 } // namespace blink | 382 } // namespace blink |
| OLD | NEW |