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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
index 9473fd758c0e146e17e297cc85954d3df6e1c699..8752c97c417bd3cd9ffc2b9869719f680b1b545a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
@@ -53,6 +53,7 @@
#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
+#include "platform/Histogram.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/ScriptForbiddenScope.h"
#include "platform/TraceEvent.h"
@@ -334,10 +335,13 @@ void WindowProxy::createContext()
m_scriptState = ScriptState::create(context, m_world);
double contextCreationDurationInMilliseconds = (currentTime() - contextCreationStartInSeconds) * 1000;
- const char* histogramName = "WebCore.WindowProxy.createContext.MainWorld";
- if (!m_world->isMainWorld())
- histogramName = "WebCore.WindowProxy.createContext.IsolatedWorld";
- Platform::current()->histogramCustomCounts(histogramName, contextCreationDurationInMilliseconds, 0, 10000, 50);
+ if (!m_world->isMainWorld()) {
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, isolatedWorldHistogram, ("WebCore.WindowProxy.createContext.IsolatedWorld", 0, 10000, 50));
+ isolatedWorldHistogram.count(contextCreationDurationInMilliseconds);
+ } else {
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, mainWorldHistogram, ("WebCore.WindowProxy.createContext.MainWorld", 0, 10000, 50));
+ mainWorldHistogram.count(contextCreationDurationInMilliseconds);
+ }
}
static v8::Local<v8::Object> toInnerGlobalObject(v8::Local<v8::Context> context)
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp ('k') | third_party/WebKit/Source/core/css/FontFaceSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698