| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL); | 191 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(PassRefPtrWillBeRawPtr<
ConsoleMessage> consoleMessage) | 194 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(PassRefPtrWillBeRawPtr<
ConsoleMessage> consoleMessage) |
| 195 { | 195 { |
| 196 m_client.reportConsoleMessage(consoleMessage->source(), consoleMessage->leve
l(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->ur
l()); | 196 m_client.reportConsoleMessage(consoleMessage->source(), consoleMessage->leve
l(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->ur
l()); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) | 199 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) |
| 200 { | 200 { |
| 201 m_document.postInspectorTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWo
rkerImpl::postMessageToPageInspector, &m_embeddedWorker, message)); | 201 m_document.postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbe
ddedWorkerImpl::postMessageToPageInspector, &m_embeddedWorker, message)); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) | 204 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) |
| 205 { | 205 { |
| 206 m_client.didEvaluateWorkerScript(success); | 206 m_client.didEvaluateWorkerScript(success); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() | 209 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() |
| 210 { | 210 { |
| 211 ASSERT(m_workerGlobalScope); | 211 ASSERT(m_workerGlobalScope); |
| 212 ScriptState::Scope scope(m_workerGlobalScope->script()->scriptState()); | 212 ScriptState::Scope scope(m_workerGlobalScope->script()->scriptState()); |
| 213 m_client.didInitializeWorkerContext(m_workerGlobalScope->script()->context()
, WebURL(m_documentURL)); | 213 m_client.didInitializeWorkerContext(m_workerGlobalScope->script()->context()
, WebURL(m_documentURL)); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope*
workerGlobalScope) | 216 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope*
workerGlobalScope) |
| 217 { | 217 { |
| 218 ASSERT(!m_workerGlobalScope); | 218 ASSERT(!m_workerGlobalScope); |
| 219 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco
pe); | 219 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco
pe); |
| 220 m_client.workerContextStarted(this); | 220 m_client.workerContextStarted(this); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() | 223 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() |
| 224 { | 224 { |
| 225 m_document.postTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl:
:terminateWorkerContext, &m_embeddedWorker)); | 225 m_document.postTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbeddedWorke
rImpl::terminateWorkerContext, &m_embeddedWorker)); |
| 226 } | 226 } |
| 227 | 227 |
| 228 void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope() | 228 void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope() |
| 229 { | 229 { |
| 230 v8::HandleScope handleScope(m_workerGlobalScope->thread()->isolate()); | 230 v8::HandleScope handleScope(m_workerGlobalScope->thread()->isolate()); |
| 231 m_client.willDestroyWorkerContext(m_workerGlobalScope->script()->context()); | 231 m_client.willDestroyWorkerContext(m_workerGlobalScope->script()->context()); |
| 232 m_workerGlobalScope = nullptr; | 232 m_workerGlobalScope = nullptr; |
| 233 } | 233 } |
| 234 | 234 |
| 235 void ServiceWorkerGlobalScopeProxy::workerThreadTerminated() | 235 void ServiceWorkerGlobalScopeProxy::workerThreadTerminated() |
| 236 { | 236 { |
| 237 m_client.workerContextDestroyed(); | 237 m_client.workerContextDestroyed(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 240 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
| 241 : m_embeddedWorker(embeddedWorker) | 241 : m_embeddedWorker(embeddedWorker) |
| 242 , m_document(document) | 242 , m_document(document) |
| 243 , m_documentURL(document.url().copy()) | 243 , m_documentURL(document.url().copy()) |
| 244 , m_client(client) | 244 , m_client(client) |
| 245 , m_workerGlobalScope(nullptr) | 245 , m_workerGlobalScope(nullptr) |
| 246 { | 246 { |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace blink | 249 } // namespace blink |
| OLD | NEW |