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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 { | 247 { |
248 client().reportConsoleMessage(source, level, message, location->lineNumber()
, location->url()); | 248 client().reportConsoleMessage(source, level, message, location->lineNumber()
, location->url()); |
249 } | 249 } |
250 | 250 |
251 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) | 251 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) |
252 { | 252 { |
253 DCHECK(m_embeddedWorker); | 253 DCHECK(m_embeddedWorker); |
254 document().postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbe
ddedWorkerImpl::postMessageToPageInspector, crossThreadUnretained(m_embeddedWork
er), message)); | 254 document().postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbe
ddedWorkerImpl::postMessageToPageInspector, crossThreadUnretained(m_embeddedWork
er), message)); |
255 } | 255 } |
256 | 256 |
257 void ServiceWorkerGlobalScopeProxy::didLoadWorkerScript(size_t scriptSize, size_
t cachedMetadataSize) | |
258 { | |
259 DCHECK(m_workerGlobalScope); | |
260 m_workerGlobalScope->didLoadWorkerScript(scriptSize, cachedMetadataSize); | |
261 } | |
262 | |
263 void ServiceWorkerGlobalScopeProxy::didCreateWorkerGlobalScope(WorkerOrWorkletGl
obalScope* workerGlobalScope) | 257 void ServiceWorkerGlobalScopeProxy::didCreateWorkerGlobalScope(WorkerOrWorkletGl
obalScope* workerGlobalScope) |
264 { | 258 { |
265 DCHECK(!m_workerGlobalScope); | 259 DCHECK(!m_workerGlobalScope); |
266 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco
pe); | 260 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco
pe); |
267 client().workerContextStarted(this); | 261 client().workerContextStarted(this); |
268 } | 262 } |
269 | 263 |
270 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() | 264 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() |
271 { | 265 { |
272 ScriptState::Scope scope(workerGlobalScope()->scriptController()->getScriptS
tate()); | 266 ScriptState::Scope scope(workerGlobalScope()->scriptController()->getScriptS
tate()); |
273 client().didInitializeWorkerContext(workerGlobalScope()->scriptController()-
>context()); | 267 client().didInitializeWorkerContext(workerGlobalScope()->scriptController()-
>context()); |
274 } | 268 } |
275 | 269 |
| 270 void ServiceWorkerGlobalScopeProxy::willEvaluateWorkerScript(size_t scriptSize,
size_t cachedMetadataSize) |
| 271 { |
| 272 DCHECK(m_workerGlobalScope); |
| 273 m_workerGlobalScope->countScript(scriptSize, cachedMetadataSize); |
| 274 } |
| 275 |
| 276 void ServiceWorkerGlobalScopeProxy::willEvaluateImportedScript(size_t scriptSize
, size_t cachedMetadataSize) |
| 277 { |
| 278 DCHECK(m_workerGlobalScope); |
| 279 m_workerGlobalScope->countScript(scriptSize, cachedMetadataSize); |
| 280 } |
| 281 |
276 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) | 282 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) |
277 { | 283 { |
278 DCHECK(m_workerGlobalScope); | 284 DCHECK(m_workerGlobalScope); |
279 m_workerGlobalScope->didEvaluateWorkerScript(); | 285 m_workerGlobalScope->didEvaluateWorkerScript(); |
280 client().didEvaluateWorkerScript(success); | 286 client().didEvaluateWorkerScript(success); |
281 } | 287 } |
282 | 288 |
283 void ServiceWorkerGlobalScopeProxy::didCloseWorkerGlobalScope() | 289 void ServiceWorkerGlobalScopeProxy::didCloseWorkerGlobalScope() |
284 { | 290 { |
285 // This should never be called because close() is not defined in | 291 // This should never be called because close() is not defined in |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 return *m_document; | 333 return *m_document; |
328 } | 334 } |
329 | 335 |
330 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con
st | 336 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con
st |
331 { | 337 { |
332 DCHECK(m_workerGlobalScope); | 338 DCHECK(m_workerGlobalScope); |
333 return m_workerGlobalScope; | 339 return m_workerGlobalScope; |
334 } | 340 } |
335 | 341 |
336 } // namespace blink | 342 } // namespace blink |
OLD | NEW |