| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // Not supported in SharedWorker. | 223 // Not supported in SharedWorker. |
| 224 } | 224 } |
| 225 | 225 |
| 226 void WebSharedWorkerImpl::postMessageToPageInspector(const String& message) | 226 void WebSharedWorkerImpl::postMessageToPageInspector(const String& message) |
| 227 { | 227 { |
| 228 m_mainFrame->frame()->document()->postInspectorTask(BLINK_FROM_HERE, createC
rossThreadTask(&WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread, thi
s, message)); | 228 m_mainFrame->frame()->document()->postInspectorTask(BLINK_FROM_HERE, createC
rossThreadTask(&WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread, thi
s, message)); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread(const String& m
essage) | 231 void WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread(const String& m
essage) |
| 232 { | 232 { |
| 233 m_workerInspectorProxy->dispatchMessageFromWorker(message); | 233 WorkerInspectorProxy::PageInspector* pageInspector = m_workerInspectorProxy-
>pageInspector(); |
| 234 if (!pageInspector) |
| 235 return; |
| 236 pageInspector->dispatchMessageFromWorker(message); |
| 237 |
| 234 } | 238 } |
| 235 | 239 |
| 236 void WebSharedWorkerImpl::workerGlobalScopeClosed() | 240 void WebSharedWorkerImpl::workerGlobalScopeClosed() |
| 237 { | 241 { |
| 238 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_H
ERE, threadSafeBind(&WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread, A
llowCrossThreadAccess(this))); | 242 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_H
ERE, threadSafeBind(&WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread, A
llowCrossThreadAccess(this))); |
| 239 } | 243 } |
| 240 | 244 |
| 241 void WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread() | 245 void WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread() |
| 242 { | 246 { |
| 243 m_client->workerContextClosed(); | 247 m_client->workerContextClosed(); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 if (devtoolsAgent) | 394 if (devtoolsAgent) |
| 391 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); | 395 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); |
| 392 } | 396 } |
| 393 | 397 |
| 394 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
| 395 { | 399 { |
| 396 return new WebSharedWorkerImpl(client); | 400 return new WebSharedWorkerImpl(client); |
| 397 } | 401 } |
| 398 | 402 |
| 399 } // namespace blink | 403 } // namespace blink |
| OLD | NEW |