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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "core/workers/WorkerInspectorProxy.h" | 43 #include "core/workers/WorkerInspectorProxy.h" |
44 #include "core/workers/WorkerLoaderProxy.h" | 44 #include "core/workers/WorkerLoaderProxy.h" |
45 #include "core/workers/WorkerScriptLoader.h" | 45 #include "core/workers/WorkerScriptLoader.h" |
46 #include "core/workers/WorkerScriptLoaderClient.h" | 46 #include "core/workers/WorkerScriptLoaderClient.h" |
47 #include "core/workers/WorkerThreadStartupData.h" | 47 #include "core/workers/WorkerThreadStartupData.h" |
48 #include "modules/serviceworkers/ServiceWorkerThread.h" | 48 #include "modules/serviceworkers/ServiceWorkerThread.h" |
49 #include "platform/NotImplemented.h" | 49 #include "platform/NotImplemented.h" |
50 #include "platform/SharedBuffer.h" | 50 #include "platform/SharedBuffer.h" |
51 #include "platform/heap/Handle.h" | 51 #include "platform/heap/Handle.h" |
52 #include "platform/network/ContentSecurityPolicyParsers.h" | 52 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 53 #include "public/platform/Platform.h" |
53 #include "public/platform/WebURLRequest.h" | 54 #include "public/platform/WebURLRequest.h" |
54 #include "public/web/WebDevToolsAgent.h" | 55 #include "public/web/WebDevToolsAgent.h" |
55 #include "public/web/WebServiceWorkerContextClient.h" | 56 #include "public/web/WebServiceWorkerContextClient.h" |
56 #include "public/web/WebServiceWorkerNetworkProvider.h" | 57 #include "public/web/WebServiceWorkerNetworkProvider.h" |
57 #include "public/web/WebSettings.h" | 58 #include "public/web/WebSettings.h" |
58 #include "public/web/WebView.h" | 59 #include "public/web/WebView.h" |
59 #include "public/web/WebWorkerPermissionClientProxy.h" | 60 #include "public/web/WebWorkerPermissionClientProxy.h" |
60 #include "web/ServiceWorkerGlobalScopeClientImpl.h" | 61 #include "web/ServiceWorkerGlobalScopeClientImpl.h" |
61 #include "web/ServiceWorkerGlobalScopeProxy.h" | 62 #include "web/ServiceWorkerGlobalScopeProxy.h" |
62 #include "web/WebDataSourceImpl.h" | 63 #include "web/WebDataSourceImpl.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 if (m_askedToTerminate) | 374 if (m_askedToTerminate) |
374 return; | 375 return; |
375 | 376 |
376 if (m_mainScriptLoader->failed()) { | 377 if (m_mainScriptLoader->failed()) { |
377 m_mainScriptLoader.clear(); | 378 m_mainScriptLoader.clear(); |
378 // This may delete 'this'. | 379 // This may delete 'this'. |
379 m_workerContextClient->workerContextFailedToStart(); | 380 m_workerContextClient->workerContextFailedToStart(); |
380 return; | 381 return; |
381 } | 382 } |
382 | 383 |
| 384 Platform::current()->histogramCustomCounts("ServiceWorker.ScriptSize", m_mai
nScriptLoader->script().length(), 1000, 5000000, 50); |
| 385 |
383 if (m_pauseAfterDownloadState == DoPauseAfterDownload) { | 386 if (m_pauseAfterDownloadState == DoPauseAfterDownload) { |
384 m_pauseAfterDownloadState = IsPausedAfterDownload; | 387 m_pauseAfterDownloadState = IsPausedAfterDownload; |
385 m_workerContextClient->didPauseAfterDownload(); | 388 m_workerContextClient->didPauseAfterDownload(); |
386 return; | 389 return; |
387 } | 390 } |
388 startWorkerThread(); | 391 startWorkerThread(); |
389 } | 392 } |
390 | 393 |
391 void WebEmbeddedWorkerImpl::startWorkerThread() | 394 void WebEmbeddedWorkerImpl::startWorkerThread() |
392 { | 395 { |
(...skipping 25 matching lines...) Expand all Loading... |
418 m_mainScriptLoader.clear(); | 421 m_mainScriptLoader.clear(); |
419 | 422 |
420 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 423 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
421 m_loaderProxy = LoaderProxy::create(*this); | 424 m_loaderProxy = LoaderProxy::create(*this); |
422 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); | 425 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); |
423 m_workerThread->start(); | 426 m_workerThread->start(); |
424 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 427 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
425 } | 428 } |
426 | 429 |
427 } // namespace blink | 430 } // namespace blink |
OLD | NEW |