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: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 1659053002: Remove custom counts histogram from the blink API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a few thread_safe_static_local -> static_local as per feedback in reviews Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "core/inspector/ConsoleMessage.h" 61 #include "core/inspector/ConsoleMessage.h"
62 #include "core/inspector/InspectorInstrumentation.h" 62 #include "core/inspector/InspectorInstrumentation.h"
63 #include "core/inspector/InspectorTraceEvents.h" 63 #include "core/inspector/InspectorTraceEvents.h"
64 #include "core/inspector/v8/V8StackTrace.h" 64 #include "core/inspector/v8/V8StackTrace.h"
65 #include "core/loader/DocumentLoader.h" 65 #include "core/loader/DocumentLoader.h"
66 #include "core/loader/FrameLoader.h" 66 #include "core/loader/FrameLoader.h"
67 #include "core/loader/FrameLoaderClient.h" 67 #include "core/loader/FrameLoaderClient.h"
68 #include "core/loader/NavigationScheduler.h" 68 #include "core/loader/NavigationScheduler.h"
69 #include "core/loader/ProgressTracker.h" 69 #include "core/loader/ProgressTracker.h"
70 #include "core/plugins/PluginView.h" 70 #include "core/plugins/PluginView.h"
71 #include "platform/Histogram.h"
71 #include "platform/NotImplemented.h" 72 #include "platform/NotImplemented.h"
72 #include "platform/TraceEvent.h" 73 #include "platform/TraceEvent.h"
73 #include "platform/UserGestureIndicator.h" 74 #include "platform/UserGestureIndicator.h"
74 #include "platform/Widget.h" 75 #include "platform/Widget.h"
75 #include "platform/weborigin/SecurityOrigin.h" 76 #include "platform/weborigin/SecurityOrigin.h"
76 #include "public/platform/Platform.h" 77 #include "public/platform/Platform.h"
77 #include "wtf/CurrentTime.h" 78 #include "wtf/CurrentTime.h"
78 #include "wtf/StdLibExtras.h" 79 #include "wtf/StdLibExtras.h"
79 #include "wtf/StringExtras.h" 80 #include "wtf/StringExtras.h"
80 #include "wtf/text/CString.h" 81 #include "wtf/text/CString.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 disposeUnderlyingV8Object(isolate(), m_windowScriptNPObject); 128 disposeUnderlyingV8Object(isolate(), m_windowScriptNPObject);
128 _NPN_ReleaseObject(m_windowScriptNPObject); 129 _NPN_ReleaseObject(m_windowScriptNPObject);
129 m_windowScriptNPObject = 0; 130 m_windowScriptNPObject = 0;
130 } 131 }
131 } 132 }
132 133
133 void ScriptController::clearForClose() 134 void ScriptController::clearForClose()
134 { 135 {
135 double start = currentTime(); 136 double start = currentTime();
136 m_windowProxyManager->clearForClose(); 137 m_windowProxyManager->clearForClose();
137 Platform::current()->histogramCustomCounts("WebCore.ScriptController.clearFo rClose", (currentTime() - start) * 1000, 0, 10000, 50); 138 double end = currentTime();
139 DEFINE_STATIC_LOCAL(CustomCountHistogram, clearForCloseHistogram, ("WebCore. ScriptController.clearForClose", 0, 10000, 50));
140 clearForCloseHistogram.count((end - start) * 1000);
138 } 141 }
139 142
140 void ScriptController::updateSecurityOrigin(SecurityOrigin* origin) 143 void ScriptController::updateSecurityOrigin(SecurityOrigin* origin)
141 { 144 {
142 m_windowProxyManager->mainWorldProxy()->updateSecurityOrigin(origin); 145 m_windowProxyManager->mainWorldProxy()->updateSecurityOrigin(origin);
143 Vector<std::pair<ScriptState*, SecurityOrigin*>> isolatedContexts; 146 Vector<std::pair<ScriptState*, SecurityOrigin*>> isolatedContexts;
144 m_windowProxyManager->collectIsolatedContexts(isolatedContexts); 147 m_windowProxyManager->collectIsolatedContexts(isolatedContexts);
145 for (auto isolatedContext : isolatedContexts) 148 for (auto isolatedContext : isolatedContexts)
146 m_windowProxyManager->windowProxy(isolatedContext.first->world())->updat eSecurityOrigin(isolatedContext.second); 149 m_windowProxyManager->windowProxy(isolatedContext.first->world())->updat eSecurityOrigin(isolatedContext.second);
147 } 150 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 { 406 {
404 // V8 binding expects ScriptController::clearWindowProxy only be called 407 // V8 binding expects ScriptController::clearWindowProxy only be called
405 // when a frame is loading a new page. This creates a new context for the ne w page. 408 // when a frame is loading a new page. This creates a new context for the ne w page.
406 409
407 double start = currentTime(); 410 double start = currentTime();
408 // The V8 context must be available for |clearScriptObjects()|. 411 // The V8 context must be available for |clearScriptObjects()|.
409 // The below call must be before |clearForNavigation()| which disposes the V 8 context. 412 // The below call must be before |clearForNavigation()| which disposes the V 8 context.
410 clearScriptObjects(); 413 clearScriptObjects();
411 414
412 m_windowProxyManager->clearForNavigation(); 415 m_windowProxyManager->clearForNavigation();
413 Platform::current()->histogramCustomCounts("WebCore.ScriptController.clearWi ndowProxy", (currentTime() - start) * 1000, 0, 10000, 50); 416 double end = currentTime();
417 DEFINE_STATIC_LOCAL(CustomCountHistogram, clearWindowProxyHistogram, ("WebCo re.ScriptController.clearWindowProxy", 0, 10000, 50));
418 clearWindowProxyHistogram.count((end - start) * 1000);
414 } 419 }
415 420
416 void ScriptController::setCaptureCallStackForUncaughtExceptions(v8::Isolate* iso late, bool value) 421 void ScriptController::setCaptureCallStackForUncaughtExceptions(v8::Isolate* iso late, bool value)
417 { 422 {
418 isolate->SetCaptureStackTraceForUncaughtExceptions(value, V8StackTrace::maxC allStackSizeToCapture, stackTraceOptions); 423 isolate->SetCaptureStackTraceForUncaughtExceptions(value, V8StackTrace::maxC allStackSizeToCapture, stackTraceOptions);
419 } 424 }
420 425
421 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*>>& result) 426 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*>>& result)
422 { 427 {
423 m_windowProxyManager->collectIsolatedContexts(result); 428 m_windowProxyManager->collectIsolatedContexts(result);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 for (size_t i = 0; i < resultArray->Length(); ++i) { 602 for (size_t i = 0; i < resultArray->Length(); ++i) {
598 v8::Local<v8::Value> value; 603 v8::Local<v8::Value> value;
599 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 604 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
600 return; 605 return;
601 results->append(value); 606 results->append(value);
602 } 607 }
603 } 608 }
604 } 609 }
605 610
606 } // namespace blink 611 } // namespace blink
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.cc ('k') | third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698