summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/script_injection_callback.cc
diff options
context:
space:
mode:
authorkozyatinskiy <kozyatinskiy@chromium.org>2015-03-06 01:33:41 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-06 09:34:31 +0000
commitc8bc9a58dc08a98fe889c269b680ead30558d372 (patch)
treee1a2559489dc4074b40ef96277197351d3e83d3c /extensions/renderer/script_injection_callback.cc
parentb91865cd50cb2c4be042178ca6c6a6448dde206b (diff)
downloadchromium_src-c8bc9a58dc08a98fe889c269b680ead30558d372.zip
chromium_src-c8bc9a58dc08a98fe889c269b680ead30558d372.tar.gz
chromium_src-c8bc9a58dc08a98fe889c269b680ead30558d372.tar.bz2
Extensions: suspend extension's scripts when V8 is paused
This CL replaced sync script execution API with async. Async API suspends extension's scripts when V8 is paused at breakpoint or when nested event loop is running for modal dialogs otherwise scripts are executed synchronously. API provides guarantees of execution order (first in - first execute, per frame). BUG=410289 R=vsevik@chromium.org Review URL: https://codereview.chromium.org/878513005 Cr-Commit-Position: refs/heads/master@{#319425}
Diffstat (limited to 'extensions/renderer/script_injection_callback.cc')
-rw-r--r--extensions/renderer/script_injection_callback.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/extensions/renderer/script_injection_callback.cc b/extensions/renderer/script_injection_callback.cc
new file mode 100644
index 0000000..45d3b0d
--- /dev/null
+++ b/extensions/renderer/script_injection_callback.cc
@@ -0,0 +1,27 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "extensions/renderer/script_injection_callback.h"
+
+#include "extensions/renderer/script_injection.h"
+
+namespace extensions {
+
+ScriptInjectionCallback::ScriptInjectionCallback(
+ ScriptInjection* injection,
+ blink::WebLocalFrame* web_frame)
+ : injection_(injection),
+ web_frame_(web_frame) {
+}
+
+ScriptInjectionCallback::~ScriptInjectionCallback() {
+}
+
+void ScriptInjectionCallback::completed(
+ const blink::WebVector<v8::Local<v8::Value> >& result) {
+ injection_->OnJsInjectionCompleted(web_frame_, result);
+ delete this;
+}
+
+} // namespace extensions