Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: Source/core/workers/WorkerGlobalScope.cpp

Issue 1059193002: Add UMA to understand the typical total size of ServiceWorker script [1/2 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: check Platform::current() Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 scriptLoader->setRequestContext(blink::WebURLRequest::RequestContextScri pt); 261 scriptLoader->setRequestContext(blink::WebURLRequest::RequestContextScri pt);
262 scriptLoader->loadSynchronously(executionContext, completeURL, AllowCros sOriginRequests); 262 scriptLoader->loadSynchronously(executionContext, completeURL, AllowCros sOriginRequests);
263 263
264 // If the fetching attempt failed, throw a NetworkError exception and ab ort all these steps. 264 // If the fetching attempt failed, throw a NetworkError exception and ab ort all these steps.
265 if (scriptLoader->failed()) { 265 if (scriptLoader->failed()) {
266 exceptionState.throwDOMException(NetworkError, "The script at '" + c ompleteURL.elidedString() + "' failed to load."); 266 exceptionState.throwDOMException(NetworkError, "The script at '" + c ompleteURL.elidedString() + "' failed to load.");
267 return; 267 return;
268 } 268 }
269 269
270 InspectorInstrumentation::scriptImported(&executionContext, scriptLoader ->identifier(), scriptLoader->script()); 270 InspectorInstrumentation::scriptImported(&executionContext, scriptLoader ->identifier(), scriptLoader->script());
271 scriptLoaded(scriptLoader->script().length(), scriptLoader->cachedMetada ta() ? scriptLoader->cachedMetadata()->size() : 0);
271 272
272 RefPtrWillBeRawPtr<ErrorEvent> errorEvent = nullptr; 273 RefPtrWillBeRawPtr<ErrorEvent> errorEvent = nullptr;
273 OwnPtr<Vector<char>> cachedMetaData(scriptLoader->releaseCachedMetadata( )); 274 OwnPtr<Vector<char>> cachedMetaData(scriptLoader->releaseCachedMetadata( ));
274 OwnPtr<CachedMetadataHandler> handler(createWorkerScriptCachedMetadataHa ndler(completeURL, cachedMetaData.get())); 275 OwnPtr<CachedMetadataHandler> handler(createWorkerScriptCachedMetadataHa ndler(completeURL, cachedMetaData.get()));
275 m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader ->responseURL()), &errorEvent, handler.get(), m_v8CacheOptions); 276 m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader ->responseURL()), &errorEvent, handler.get(), m_v8CacheOptions);
276 if (errorEvent) { 277 if (errorEvent) {
277 m_script->rethrowExceptionFromImportedScript(errorEvent.release(), e xceptionState); 278 m_script->rethrowExceptionFromImportedScript(errorEvent.release(), e xceptionState);
278 return; 279 return;
279 } 280 }
280 } 281 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 visitor->trace(m_timers); 386 visitor->trace(m_timers);
386 visitor->trace(m_messageStorage); 387 visitor->trace(m_messageStorage);
387 visitor->trace(m_pendingMessages); 388 visitor->trace(m_pendingMessages);
388 HeapSupplementable<WorkerGlobalScope>::trace(visitor); 389 HeapSupplementable<WorkerGlobalScope>::trace(visitor);
389 #endif 390 #endif
390 ExecutionContext::trace(visitor); 391 ExecutionContext::trace(visitor);
391 EventTargetWithInlineData::trace(visitor); 392 EventTargetWithInlineData::trace(visitor);
392 } 393 }
393 394
394 } // namespace blink 395 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698