diff options
author | dgozman <dgozman@chromium.org> | 2016-03-10 23:50:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-11 07:53:09 +0000 |
commit | fdfd5d17ab08e528799125a242893f6f5dcbea43 (patch) | |
tree | eef0b94e34f93d482f3e8b11b0b0cb121f6a19f2 /extensions/renderer | |
parent | 119f7e1b215f82cf545565e9d83a80ca650c6e72 (diff) | |
download | chromium_src-fdfd5d17ab08e528799125a242893f6f5dcbea43.zip chromium_src-fdfd5d17ab08e528799125a242893f6f5dcbea43.tar.gz chromium_src-fdfd5d17ab08e528799125a242893f6f5dcbea43.tar.bz2 |
Use v8::MicrotasksScope internally in V8RecursionScope.
If this sticks we can just remove V8RecursionScope and WebScopedMicrotaskSuppression,
along with other cleanups.
Attempt #3.
First one broke GinJavaBridgeValueConverterTest.TypedArrays.
Second one broke FileManagerBrowserTest family on ChromeOS.
BUG=585949
Review URL: https://codereview.chromium.org/1743763004
Cr-Commit-Position: refs/heads/master@{#380570}
Diffstat (limited to 'extensions/renderer')
-rw-r--r-- | extensions/renderer/activity_log_converter_strategy_unittest.cc | 2 | ||||
-rw-r--r-- | extensions/renderer/api_test_base.cc | 2 | ||||
-rw-r--r-- | extensions/renderer/module_system_test.cc | 2 | ||||
-rw-r--r-- | extensions/renderer/safe_builtins.cc | 2 | ||||
-rw-r--r-- | extensions/renderer/v8_helpers.h | 2 |
5 files changed, 8 insertions, 2 deletions
diff --git a/extensions/renderer/activity_log_converter_strategy_unittest.cc b/extensions/renderer/activity_log_converter_strategy_unittest.cc index 9237cad..aa80447 100644 --- a/extensions/renderer/activity_log_converter_strategy_unittest.cc +++ b/extensions/renderer/activity_log_converter_strategy_unittest.cc @@ -6,6 +6,7 @@ #include "base/values.h" #include "extensions/renderer/activity_log_converter_strategy.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "v8/include/v8.h" using content::V8ValueConverter; @@ -122,6 +123,7 @@ TEST_F(ActivityLogConverterStrategyTest, ConversionTest) { "};" "})();"; + blink::WebScopedMicrotaskSuppression microtasks_scope; v8::Local<v8::Script> script( v8::Script::Compile(v8::String::NewFromUtf8(isolate_, source))); v8::Local<v8::Object> v8_object = script->Run().As<v8::Object>(); diff --git a/extensions/renderer/api_test_base.cc b/extensions/renderer/api_test_base.cc index abf868b..79f95e2 100644 --- a/extensions/renderer/api_test_base.cc +++ b/extensions/renderer/api_test_base.cc @@ -214,7 +214,7 @@ void ApiTestEnvironment::RunTestInner(const std::string& test_name, } void ApiTestEnvironment::RunPromisesAgain() { - env()->isolate()->RunMicrotasks(); + v8::MicrotasksScope::PerformCheckpoint(env()->isolate()); base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ApiTestEnvironment::RunPromisesAgain, base::Unretained(this))); diff --git a/extensions/renderer/module_system_test.cc b/extensions/renderer/module_system_test.cc index 68c4bd1..06a4d55 100644 --- a/extensions/renderer/module_system_test.cc +++ b/extensions/renderer/module_system_test.cc @@ -253,7 +253,7 @@ void ModuleSystemTest::ExpectNoAssertionsMade() { } void ModuleSystemTest::RunResolvedPromises() { - isolate_->RunMicrotasks(); + v8::MicrotasksScope::PerformCheckpoint(isolate_); } } // namespace extensions diff --git a/extensions/renderer/safe_builtins.cc b/extensions/renderer/safe_builtins.cc index 3bfa01a..3a66eaf 100644 --- a/extensions/renderer/safe_builtins.cc +++ b/extensions/renderer/safe_builtins.cc @@ -9,6 +9,7 @@ #include "base/strings/stringprintf.h" #include "extensions/renderer/script_context.h" #include "extensions/renderer/v8_helpers.h" +#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" namespace extensions { @@ -200,6 +201,7 @@ class ExtensionImpl : public v8::Extension { return; } + blink::WebScopedMicrotaskSuppression microtasks_scope; v8::Local<v8::Value> return_value; if (function->Call(context, recv, argc, argv.get()).ToLocal(&return_value)) info.GetReturnValue().Set(return_value); diff --git a/extensions/renderer/v8_helpers.h b/extensions/renderer/v8_helpers.h index 3017772..560beee 100644 --- a/extensions/renderer/v8_helpers.h +++ b/extensions/renderer/v8_helpers.h @@ -9,6 +9,7 @@ #include <string.h> #include "base/strings/string_number_conversions.h" +#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "v8/include/v8.h" namespace extensions { @@ -172,6 +173,7 @@ inline bool CallFunction(v8::Local<v8::Context> context, int argc, v8::Local<v8::Value> argv[], v8::Local<v8::Value>* out) { + blink::WebScopedMicrotaskSuppression microtasks_scope; return function->Call(context, recv, argc, argv).ToLocal(out); } |