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/WebServiceWorkerContextClient.h" | 55 #include "public/web/WebServiceWorkerContextClient.h" |
55 #include "public/web/WebServiceWorkerNetworkProvider.h" | 56 #include "public/web/WebServiceWorkerNetworkProvider.h" |
56 #include "public/web/WebSettings.h" | 57 #include "public/web/WebSettings.h" |
57 #include "public/web/WebView.h" | 58 #include "public/web/WebView.h" |
58 #include "public/web/WebWorkerPermissionClientProxy.h" | 59 #include "public/web/WebWorkerPermissionClientProxy.h" |
59 #include "web/ServiceWorkerGlobalScopeClientImpl.h" | 60 #include "web/ServiceWorkerGlobalScopeClientImpl.h" |
60 #include "web/ServiceWorkerGlobalScopeProxy.h" | 61 #include "web/ServiceWorkerGlobalScopeProxy.h" |
61 #include "web/WebDataSourceImpl.h" | 62 #include "web/WebDataSourceImpl.h" |
62 #include "web/WebLocalFrameImpl.h" | 63 #include "web/WebLocalFrameImpl.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 if (m_askedToTerminate) | 356 if (m_askedToTerminate) |
356 return; | 357 return; |
357 | 358 |
358 if (m_mainScriptLoader->failed()) { | 359 if (m_mainScriptLoader->failed()) { |
359 m_mainScriptLoader.clear(); | 360 m_mainScriptLoader.clear(); |
360 // This may delete 'this'. | 361 // This may delete 'this'. |
361 m_workerContextClient->workerContextFailedToStart(); | 362 m_workerContextClient->workerContextFailedToStart(); |
362 return; | 363 return; |
363 } | 364 } |
364 | 365 |
366 Platform::current()->histogramCustomCounts("ServiceWorker.ScriptSizeInKB", m _mainScriptLoader->script().length() / 1024, 0, 10 * 1024, 50); | |
jochen (gone - plz use gerrit)
2014/09/02 07:59:07
for KB histograms, we usually use 1000, 500000, 50
Kunihiko Sakamoto
2014/09/02 08:51:48
Thanks for pointing it out.
Changed to (1000, 5000
| |
367 | |
365 if (m_pauseAfterDownloadState == DoPauseAfterDownload) { | 368 if (m_pauseAfterDownloadState == DoPauseAfterDownload) { |
366 m_pauseAfterDownloadState = IsPausedAfterDownload; | 369 m_pauseAfterDownloadState = IsPausedAfterDownload; |
367 m_workerContextClient->didPauseAfterDownload(); | 370 m_workerContextClient->didPauseAfterDownload(); |
368 return; | 371 return; |
369 } | 372 } |
370 startWorkerThread(); | 373 startWorkerThread(); |
371 } | 374 } |
372 | 375 |
373 void WebEmbeddedWorkerImpl::startWorkerThread() | 376 void WebEmbeddedWorkerImpl::startWorkerThread() |
374 { | 377 { |
(...skipping 25 matching lines...) Expand all Loading... | |
400 Document* document = toWebLocalFrameImpl(m_mainFrame)->frame()->document(); | 403 Document* document = toWebLocalFrameImpl(m_mainFrame)->frame()->document(); |
401 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); | 404 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); |
402 m_loaderProxy = LoaderProxy::create(*this); | 405 m_loaderProxy = LoaderProxy::create(*this); |
403 | 406 |
404 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); | 407 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); |
405 m_workerThread->start(); | 408 m_workerThread->start(); |
406 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); | 409 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); |
407 } | 410 } |
408 | 411 |
409 } // namespace blink | 412 } // namespace blink |
OLD | NEW |