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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Issue 1447563002: Implement frame attribution (FrameBlamer) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make sure blame context is initialized early enough Created 4 years, 9 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
« no previous file with comments | « content/test/fake_renderer_scheduler.cc ('k') | third_party/WebKit/Source/core/frame/FrameClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
index 389756e6f31c8b9fc6c3dfe3dbbadb506d87786e..4bc7a886d769ac8ced15cc7fb46175a110319d68 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
@@ -51,6 +51,8 @@
#include "core/svg/SVGElement.h"
#include "platform/Histogram.h"
#include "platform/TraceEvent.h"
+#include "public/platform/BlameContext.h"
+#include "public/platform/Platform.h"
#include "wtf/Partitions.h"
#include "wtf/Vector.h"
#include <algorithm>
@@ -269,6 +271,11 @@ void V8GCController::gcPrologue(v8::Isolate* isolate, v8::GCType type, v8::GCCal
if (isMainThread())
ScriptForbiddenScope::enter();
+ // Attribute garbage collection to the all frames instead of a specific
+ // frame.
+ if (BlameContext* blameContext = Platform::current()->topLevelBlameContext())
+ blameContext->Enter();
+
// TODO(haraken): A GC callback is not allowed to re-enter V8. This means
// that it's unsafe to run Oilpan's GC in the GC callback because it may
// run finalizers that call into V8. To avoid the risk, we should post
@@ -333,6 +340,9 @@ void V8GCController::gcEpilogue(v8::Isolate* isolate, v8::GCType type, v8::GCCal
if (isMainThread())
ScriptForbiddenScope::exit();
+ if (BlameContext* blameContext = Platform::current()->topLevelBlameContext())
+ blameContext->Leave();
+
// v8::kGCCallbackFlagForced forces a Blink heap garbage collection
// when a garbage collection was forced from V8. This is either used
// for tests that force GCs from JavaScript to verify that objects die
« no previous file with comments | « content/test/fake_renderer_scheduler.cc ('k') | third_party/WebKit/Source/core/frame/FrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698