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

Side by Side Diff: extensions/renderer/v8_helpers.h

Issue 1743763004: Use v8::MicrotasksScope internally in V8RecursionScope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8rs-2-endofscope
Patch Set: v8_helpers 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 unified diff | Download patch
« no previous file with comments | « extensions/renderer/safe_builtins.cc ('k') | gin/run_microtasks_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_RENDERER_V8_HELPERS_H_ 5 #ifndef EXTENSIONS_RENDERER_V8_HELPERS_H_
6 #define EXTENSIONS_RENDERER_V8_HELPERS_H_ 6 #define EXTENSIONS_RENDERER_V8_HELPERS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 10
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
12 #include "v8/include/v8.h" 13 #include "v8/include/v8.h"
13 14
14 namespace extensions { 15 namespace extensions {
15 namespace v8_helpers { 16 namespace v8_helpers {
16 17
17 // Helper functions for V8 APIs. 18 // Helper functions for V8 APIs.
18 19
19 // Converts |str| to a V8 string. Returns true on success. 20 // Converts |str| to a V8 string. Returns true on success.
20 inline bool ToV8String(v8::Isolate* isolate, 21 inline bool ToV8String(v8::Isolate* isolate,
21 const char* str, 22 const char* str,
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 .ToLocalChecked(); 166 .ToLocalChecked();
166 } 167 }
167 168
168 // Wraps v8::Function::Call(). Returns true on success. 169 // Wraps v8::Function::Call(). Returns true on success.
169 inline bool CallFunction(v8::Local<v8::Context> context, 170 inline bool CallFunction(v8::Local<v8::Context> context,
170 v8::Local<v8::Function> function, 171 v8::Local<v8::Function> function,
171 v8::Local<v8::Value> recv, 172 v8::Local<v8::Value> recv,
172 int argc, 173 int argc,
173 v8::Local<v8::Value> argv[], 174 v8::Local<v8::Value> argv[],
174 v8::Local<v8::Value>* out) { 175 v8::Local<v8::Value>* out) {
176 blink::WebScopedMicrotaskSuppression microtasks_scope;
175 return function->Call(context, recv, argc, argv).ToLocal(out); 177 return function->Call(context, recv, argc, argv).ToLocal(out);
176 } 178 }
177 179
178 } // namespace v8_helpers 180 } // namespace v8_helpers
179 } // namespace extensions 181 } // namespace extensions
180 182
181 #endif // EXTENSIONS_RENDERER_V8_HELPERS_H_ 183 #endif // EXTENSIONS_RENDERER_V8_HELPERS_H_
OLDNEW
« no previous file with comments | « extensions/renderer/safe_builtins.cc ('k') | gin/run_microtasks_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698