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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) | 186 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) |
187 { | 187 { |
188 WorkerInspectorProxy::PageInspector* pageInspector = m_workerInspectorProxy-
>pageInspector(); | 188 WorkerInspectorProxy::PageInspector* pageInspector = m_workerInspectorProxy-
>pageInspector(); |
189 if (!pageInspector) | 189 if (!pageInspector) |
190 return; | 190 return; |
191 pageInspector->dispatchMessageFromWorker(message); | 191 pageInspector->dispatchMessageFromWorker(message); |
192 } | 192 } |
193 | 193 |
194 void WebEmbeddedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> ta
sk) | 194 void WebEmbeddedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> ta
sk) |
195 { | 195 { |
196 m_mainFrame->frame()->document()->postTask(FROM_HERE, task); | 196 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, task); |
197 } | 197 } |
198 | 198 |
199 bool WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionCont
extTask> task) | 199 bool WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionCont
extTask> task) |
200 { | 200 { |
201 if (m_askedToTerminate || !m_workerThread) | 201 if (m_askedToTerminate || !m_workerThread) |
202 return false; | 202 return false; |
203 | 203 |
204 m_workerThread->postTask(FROM_HERE, task); | 204 m_workerThread->postTask(BLINK_FROM_HERE, task); |
205 return !m_workerThread->terminated(); | 205 return !m_workerThread->terminated(); |
206 } | 206 } |
207 | 207 |
208 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() | 208 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() |
209 { | 209 { |
210 // Create 'shadow page', which is never displayed and is used mainly to | 210 // Create 'shadow page', which is never displayed and is used mainly to |
211 // provide a context for loading on the main thread. | 211 // provide a context for loading on the main thread. |
212 // | 212 // |
213 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. | 213 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. |
214 // This code, and probably most of the code in this class should be shared | 214 // This code, and probably most of the code in this class should be shared |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 m_mainScriptLoader.clear(); | 353 m_mainScriptLoader.clear(); |
354 | 354 |
355 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 355 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
356 m_loaderProxy = WorkerLoaderProxy::create(this); | 356 m_loaderProxy = WorkerLoaderProxy::create(this); |
357 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); | 357 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); |
358 m_workerThread->start(startupData.release()); | 358 m_workerThread->start(startupData.release()); |
359 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 359 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
360 } | 360 } |
361 | 361 |
362 } // namespace blink | 362 } // namespace blink |
OLD | NEW |