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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/Microtask.h

Issue 1769273004: Remove V8RecrusionScope, cleanup call sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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
Index: third_party/WebKit/Source/bindings/core/v8/Microtask.h
diff --git a/third_party/WebKit/Source/core/dom/Microtask.h b/third_party/WebKit/Source/bindings/core/v8/Microtask.h
similarity index 69%
rename from third_party/WebKit/Source/core/dom/Microtask.h
rename to third_party/WebKit/Source/bindings/core/v8/Microtask.h
index 82ac7d1af40a8a1e8a64b926842e98a1d836dd8c..89ecd0f899ceee9cd7ffbbbd9e77cb0c5e1d0dc8 100644
--- a/third_party/WebKit/Source/core/dom/Microtask.h
+++ b/third_party/WebKit/Source/bindings/core/v8/Microtask.h
@@ -31,7 +31,6 @@
#ifndef Microtask_h
#define Microtask_h
-#include "bindings/core/v8/ScriptState.h"
#include "core/CoreExport.h"
#include "public/platform/WebTaskRunner.h"
#include "wtf/Allocator.h"
@@ -41,6 +40,25 @@
namespace blink {
+// C++ calls into script contexts which are "owned" by blink (created in a
+// process where WebKit.cpp initializes v8) must declare their type:
+//
+// 1. Calls into page/author script from a frame
+// 2. Calls into page/author script from a worker
+// 3. Calls into internal script (typically setup/teardown work)
+//
+// Debug-time checking of this is enforced via v8::MicrotasksScope.
+//
+// Calls of type (1) should generally go through ScriptController, as inspector
+// instrumentation is needed. ScriptController allocates V8RecursionScope for you.
+//
+// Calls of type (2) should always stack-allocate a v8::MicrotasksScope(kRunMicrtoasks)
+// in the same block as the call into script.
+//
+// Calls of type (3) should stack allocate a v8::MicrotasksScope(kDoNotRunMicrotasks) --
+// this skips work that is spec'd to happen at the end of the outer-most
+// script stack frame of calls into page script:
+// http://www.whatwg.org/specs/web-apps/current-work/#perform-a-microtask-checkpoint
class CORE_EXPORT Microtask {
STATIC_ONLY(Microtask);
public:

Powered by Google App Engine
This is Rietveld 408576698