summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwellington <twellington@chromium.org>2015-05-04 11:57:25 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-04 18:58:14 +0000
commit376424add26233b8b305d52692dc90e5c0313bf8 (patch)
tree3cd4c6416d128fe12cd8250411328cc5b3b51142
parentcef8cfb15b65361aa256f9ec37029fd5f11bcaf8 (diff)
downloadchromium_src-376424add26233b8b305d52692dc90e5c0313bf8.zip
chromium_src-376424add26233b8b305d52692dc90e5c0313bf8.tar.gz
chromium_src-376424add26233b8b305d52692dc90e5c0313bf8.tar.bz2
Add support to execute JavaScript in an isolated world
Add the necessary plubming to render_frame_* to execute JavaScript in an isolated world. Change bookmark_image_service_android to execute its script in an isolated world. BUG=475070 Review URL: https://codereview.chromium.org/1101903002 Cr-Commit-Position: refs/heads/master@{#328161}
-rw-r--r--chrome/browser/enhanced_bookmarks/android/DEPS3
-rw-r--r--chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc6
-rw-r--r--chrome/chrome_renderer.gypi2
-rw-r--r--chrome/renderer/chrome_isolated_world_ids.h27
-rw-r--r--chrome/renderer/chrome_render_view_observer.cc5
-rw-r--r--chrome/renderer/extensions/chrome_extensions_renderer_client.cc2
-rw-r--r--chrome/renderer/isolated_world_ids.h24
-rw-r--r--chrome/renderer/translate/translate_helper_browsertest.cc5
-rw-r--r--content/browser/frame_host/DEPS1
-rw-r--r--content/browser/frame_host/render_frame_host_impl.cc24
-rw-r--r--content/browser/frame_host/render_frame_host_impl.h4
-rw-r--r--content/common/frame_messages.h8
-rw-r--r--content/public/browser/render_frame_host.h4
-rw-r--r--content/public/renderer/isolated_world_ids.h23
-rw-r--r--content/renderer/render_frame_impl.cc77
-rw-r--r--content/renderer/render_frame_impl.h29
-rw-r--r--extensions/renderer/extension_groups.h5
17 files changed, 209 insertions, 40 deletions
diff --git a/chrome/browser/enhanced_bookmarks/android/DEPS b/chrome/browser/enhanced_bookmarks/android/DEPS
new file mode 100644
index 0000000..5d93983
--- /dev/null
+++ b/chrome/browser/enhanced_bookmarks/android/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+chrome/renderer/chrome_isolated_world_ids.h",
+]
diff --git a/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc b/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc
index 1d8c566..4e53e5a 100644
--- a/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc
+++ b/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.h"
#include "chrome/browser/enhanced_bookmarks/enhanced_bookmark_model_factory.h"
#include "chrome/grit/browser_resources.h"
+#include "chrome/renderer/chrome_isolated_world_ids.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/enhanced_bookmarks/enhanced_bookmark_model.h"
#include "content/public/browser/browser_context.h"
@@ -115,11 +116,12 @@ void BookmarkImageServiceAndroid::RetrieveSalientImageFromContext(
.as_string());
}
- render_frame_host->ExecuteJavaScript(
+ render_frame_host->ExecuteJavaScriptInIsolatedWorld(
script_,
base::Bind(
&BookmarkImageServiceAndroid::RetrieveSalientImageFromContextCallback,
- base::Unretained(this), page_url, update_bookmark));
+ base::Unretained(this), page_url, update_bookmark),
+ chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL);
}
void BookmarkImageServiceAndroid::FinishSuccessfulPageLoadForTab(
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index 56bb402..1c81c6e 100644
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -21,7 +21,7 @@
'renderer/external_extension.cc',
'renderer/external_extension.h',
'renderer/instant_restricted_id_cache.h',
- 'renderer/isolated_world_ids.h',
+ 'renderer/chrome_isolated_world_ids.h',
'renderer/loadtimes_extension_bindings.cc',
'renderer/loadtimes_extension_bindings.h',
'renderer/media/chrome_key_systems.cc',
diff --git a/chrome/renderer/chrome_isolated_world_ids.h b/chrome/renderer/chrome_isolated_world_ids.h
new file mode 100644
index 0000000..a52450e
--- /dev/null
+++ b/chrome/renderer/chrome_isolated_world_ids.h
@@ -0,0 +1,27 @@
+// Copyright (c) 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.
+
+#ifndef CHROME_RENDERER_CHROME_ISOLATED_WORLD_IDS_H_
+#define CHROME_RENDERER_CHROME_ISOLATED_WORLD_IDS_H_
+
+#include "content/public/renderer/isolated_world_ids.h"
+
+namespace chrome {
+
+enum ChromeIsolatedWorldIDs {
+ // Isolated world ID for Chrome Translate.
+ ISOLATED_WORLD_ID_TRANSLATE = content::ISOLATED_WORLD_ID_CONTENT_END + 1,
+
+ // Isolated world ID for internal Chrome features.
+ ISOLATED_WORLD_ID_CHROME_INTERNAL,
+
+ // Numbers for isolated worlds for extensions are set in
+ // extensions/renderer/script_injection.cc, and are are greater than or equal
+ // to this number.
+ ISOLATED_WORLD_ID_EXTENSIONS
+};
+
+} // namespace chrome
+
+#endif // CHROME_RENDERER_CHROME_ISOLATED_WORLD_IDS_H_
diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc
index db99bde..a8559fa 100644
--- a/chrome/renderer/chrome_render_view_observer.cc
+++ b/chrome/renderer/chrome_render_view_observer.cc
@@ -17,7 +17,7 @@
#include "chrome/common/prerender_messages.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
-#include "chrome/renderer/isolated_world_ids.h"
+#include "chrome/renderer/chrome_isolated_world_ids.h"
#include "chrome/renderer/prerender/prerender_helper.h"
#include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h"
#include "chrome/renderer/web_apps.h"
@@ -29,7 +29,6 @@
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
#include "extensions/common/constants.h"
-#include "extensions/renderer/extension_groups.h"
#include "net/base/data_url.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/platform/WebCString.h"
@@ -163,7 +162,7 @@ ChromeRenderViewObserver::ChromeRenderViewObserver(
translate_helper_(new translate::TranslateHelper(
render_view,
chrome::ISOLATED_WORLD_ID_TRANSLATE,
- extensions::EXTENSION_GROUP_INTERNAL_TRANSLATE_SCRIPTS,
+ 0,
extensions::kExtensionScheme)),
phishing_classifier_(NULL),
capture_timer_(false, false) {
diff --git a/chrome/renderer/extensions/chrome_extensions_renderer_client.cc b/chrome/renderer/extensions/chrome_extensions_renderer_client.cc
index c3ef38d..2ff6224 100644
--- a/chrome/renderer/extensions/chrome_extensions_renderer_client.cc
+++ b/chrome/renderer/extensions/chrome_extensions_renderer_client.cc
@@ -5,8 +5,8 @@
#include "chrome/renderer/extensions/chrome_extensions_renderer_client.h"
#include "base/lazy_instance.h"
+#include "chrome/renderer/chrome_isolated_world_ids.h"
#include "chrome/renderer/chrome_render_process_observer.h"
-#include "chrome/renderer/isolated_world_ids.h"
ChromeExtensionsRendererClient::ChromeExtensionsRendererClient() {}
diff --git a/chrome/renderer/isolated_world_ids.h b/chrome/renderer/isolated_world_ids.h
deleted file mode 100644
index 552ac96..0000000
--- a/chrome/renderer/isolated_world_ids.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2013 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.
-
-#ifndef CHROME_RENDERER_ISOLATED_WORLD_IDS_H_
-#define CHROME_RENDERER_ISOLATED_WORLD_IDS_H_
-
-namespace chrome {
-
-enum IsolatedWorldIDs {
- // Chrome can not use ID 0 for isolated world.
- ISOLATED_WORLD_ID_GLOBAL = 0,
- // Isolated world ID for Chrome Translate.
- ISOLATED_WORLD_ID_TRANSLATE,
-
- // Numbers for isolated worlds for extensions are set in
- // extensions/renderer/script_injection.cc, and are are greater than or equal
- // to this number.
- ISOLATED_WORLD_ID_EXTENSIONS
-};
-
-} // namespace chrome
-
-#endif // CHROME_RENDERER_ISOLATED_WORLD_IDS_H_
diff --git a/chrome/renderer/translate/translate_helper_browsertest.cc b/chrome/renderer/translate/translate_helper_browsertest.cc
index 4c22f80..9c53490 100644
--- a/chrome/renderer/translate/translate_helper_browsertest.cc
+++ b/chrome/renderer/translate/translate_helper_browsertest.cc
@@ -3,14 +3,13 @@
// found in the LICENSE file.
#include "base/time/time.h"
-#include "chrome/renderer/isolated_world_ids.h"
+#include "chrome/renderer/chrome_isolated_world_ids.h"
#include "chrome/test/base/chrome_render_view_test.h"
#include "components/translate/content/common/translate_messages.h"
#include "components/translate/content/renderer/translate_helper.h"
#include "components/translate/core/common/translate_constants.h"
#include "content/public/renderer/render_view.h"
#include "extensions/common/constants.h"
-#include "extensions/renderer/extension_groups.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
@@ -25,7 +24,7 @@ class TestTranslateHelper : public translate::TranslateHelper {
: translate::TranslateHelper(
render_view,
chrome::ISOLATED_WORLD_ID_TRANSLATE,
- extensions::EXTENSION_GROUP_INTERNAL_TRANSLATE_SCRIPTS,
+ 0,
extensions::kExtensionScheme) {}
base::TimeDelta AdjustDelay(int delayInMs) override {
diff --git a/content/browser/frame_host/DEPS b/content/browser/frame_host/DEPS
index 09569cb..ebd27f0 100644
--- a/content/browser/frame_host/DEPS
+++ b/content/browser/frame_host/DEPS
@@ -1,4 +1,5 @@
include_rules = [
+ "+content/public/renderer/isolated_world_ids.h",
# The frame_host files should only call upwards in the layering via the
# delegate interfaces.
"-content/browser/web_contents",
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 6e8773c..aeb9aa4 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -63,6 +63,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/url_utils.h"
+#include "content/public/renderer/isolated_world_ids.h"
#include "ui/accessibility/ax_tree.h"
#include "ui/accessibility/ax_tree_update.h"
#include "url/gurl.h"
@@ -89,6 +90,9 @@ namespace {
// The next value to use for the accessibility reset token.
int g_next_accessibility_reset_token = 1;
+// The next value to use for the javascript callback id.
+int g_next_javascript_callback_id = 1;
+
// The (process id, routing id) pair that identifies one RenderFrame.
typedef std::pair<int32, int32> RenderFrameHostID;
typedef base::hash_map<RenderFrameHostID, RenderFrameHostImpl*>
@@ -272,8 +276,7 @@ void RenderFrameHostImpl::ExecuteJavaScript(
void RenderFrameHostImpl::ExecuteJavaScript(
const base::string16& javascript,
const JavaScriptResultCallback& callback) {
- static int next_id = 1;
- int key = next_id++;
+ int key = g_next_javascript_callback_id++;
Send(new FrameMsg_JavaScriptExecuteRequest(routing_id_,
javascript,
key, true));
@@ -287,6 +290,23 @@ void RenderFrameHostImpl::ExecuteJavaScriptWithUserGestureForTests(
0, false, true));
}
+void RenderFrameHostImpl::ExecuteJavaScriptInIsolatedWorld(
+ const base::string16& javascript,
+ const JavaScriptResultCallback& callback,
+ int world_id) {
+ if (world_id <= ISOLATED_WORLD_ID_GLOBAL ||
+ world_id > ISOLATED_WORLD_ID_MAX) {
+ // Return if the world_id is not valid.
+ NOTREACHED();
+ return;
+ }
+
+ int key = g_next_javascript_callback_id++;
+ Send(new FrameMsg_JavaScriptExecuteRequestInIsolatedWorld(
+ routing_id_, javascript, key, true, world_id));
+ javascript_callbacks_.insert(std::make_pair(key, callback));
+}
+
RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() {
return render_view_host_;
}
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index f7ae705..14b9937 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -137,6 +137,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
const JavaScriptResultCallback& callback) override;
void ExecuteJavaScriptWithUserGestureForTests(
const base::string16& javascript) override;
+ void ExecuteJavaScriptInIsolatedWorld(
+ const base::string16& javascript,
+ const JavaScriptResultCallback& callback,
+ int world_id) override;
void ActivateFindInPageResultForAccessibility(int request_id) override;
RenderViewHost* GetRenderViewHost() override;
ServiceRegistry* GetServiceRegistry() override;
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index 7ca24dc8..bc3851c 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -481,6 +481,14 @@ IPC_MESSAGE_ROUTED4(FrameMsg_JavaScriptExecuteRequestForTests,
bool, /* if true, a reply is requested */
bool /* if true, a user gesture indicator is created */)
+// Same as FrameMsg_JavaScriptExecuteRequest above except the script is
+// run in the isolated world specified by the fourth parameter.
+IPC_MESSAGE_ROUTED4(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld,
+ base::string16, /* javascript */
+ int, /* ID */
+ bool, /* if true, a reply is requested */
+ int /* world_id */)
+
// Selects between the given start and end offsets in the currently focused
// editable field.
IPC_MESSAGE_ROUTED2(FrameMsg_SetEditableSelectionOffsets,
diff --git a/content/public/browser/render_frame_host.h b/content/public/browser/render_frame_host.h
index 20aaa44..2b0c5dd 100644
--- a/content/public/browser/render_frame_host.h
+++ b/content/public/browser/render_frame_host.h
@@ -73,6 +73,10 @@ class CONTENT_EXPORT RenderFrameHost : public IPC::Listener,
virtual void ExecuteJavaScript(const base::string16& javascript) = 0;
virtual void ExecuteJavaScript(const base::string16& javascript,
const JavaScriptResultCallback& callback) = 0;
+ virtual void ExecuteJavaScriptInIsolatedWorld(
+ const base::string16& javascript,
+ const JavaScriptResultCallback& callback,
+ int world_id) = 0;
// ONLY FOR TESTS: Same as above but adds a fake UserGestureIndicator around
// execution. (crbug.com/408426)
diff --git a/content/public/renderer/isolated_world_ids.h b/content/public/renderer/isolated_world_ids.h
new file mode 100644
index 0000000..597211a
--- /dev/null
+++ b/content/public/renderer/isolated_world_ids.h
@@ -0,0 +1,23 @@
+// Copyright (c) 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.
+
+#ifndef CONTENT_PUBLIC_RENDERER_ISOLATED_WORLD_IDS_H_
+#define CONTENT_PUBLIC_RENDERER_ISOLATED_WORLD_IDS_H_
+
+namespace content {
+
+enum IsolatedWorldIDs {
+ // Chrome cannot use ID 0 for an isolated world because 0 represents the main
+ // world.
+ ISOLATED_WORLD_ID_GLOBAL = 0,
+ // Custom isolated world ids used by other embedders should start from here.
+ ISOLATED_WORLD_ID_CONTENT_END,
+ // If any embedder has more than 10 custom isolated worlds that will be run
+ // via RenderFrameImpl::OnJavaScriptExecuteRequestInIsolatedWorld update this.
+ ISOLATED_WORLD_ID_MAX = ISOLATED_WORLD_ID_CONTENT_END + 10,
+};
+
+} // namespace content
+
+#endif // COTENT_PUBLIC_RENDERER_ISOLATED_WORLD_IDS_H_
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 1674564..0bb3c0b 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -54,6 +54,7 @@
#include "content/public/renderer/content_renderer_client.h"
#include "content/public/renderer/context_menu_client.h"
#include "content/public/renderer/document_state.h"
+#include "content/public/renderer/isolated_world_ids.h"
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/renderer_ppapi_host.h"
@@ -1031,6 +1032,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
OnJavaScriptExecuteRequest)
IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests,
OnJavaScriptExecuteRequestForTests)
+ IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld,
+ OnJavaScriptExecuteRequestInIsolatedWorld)
IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest,
OnVisualStateRequest)
IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets,
@@ -1400,6 +1403,80 @@ void RenderFrameImpl::OnJavaScriptExecuteRequestForTests(
HandleJavascriptExecutionResult(jscript, id, notify_result, result);
}
+void RenderFrameImpl::OnJavaScriptExecuteRequestInIsolatedWorld(
+ const base::string16& jscript,
+ int id,
+ bool notify_result,
+ int world_id) {
+ TRACE_EVENT_INSTANT0("test_tracing",
+ "OnJavaScriptExecuteRequestInIsolatedWorld",
+ TRACE_EVENT_SCOPE_THREAD);
+
+ if (world_id <= ISOLATED_WORLD_ID_GLOBAL ||
+ world_id > ISOLATED_WORLD_ID_MAX) {
+ // Return if the world_id is not valid. world_id is passed as a plain int
+ // over IPC and needs to be verified here, in the IPC endpoint.
+ NOTREACHED();
+ return;
+ }
+
+ v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
+ WebScriptSource script = WebScriptSource(jscript);
+ JavaScriptIsolatedWorldRequest* request = new JavaScriptIsolatedWorldRequest(
+ id, notify_result, routing_id_, weak_factory_.GetWeakPtr());
+ frame_->requestExecuteScriptInIsolatedWorld(world_id, &script, 1, 0, false,
+ request);
+}
+
+RenderFrameImpl::JavaScriptIsolatedWorldRequest::JavaScriptIsolatedWorldRequest(
+ int id,
+ bool notify_result,
+ int routing_id,
+ base::WeakPtr<RenderFrameImpl> render_frame_impl)
+ : id_(id),
+ notify_result_(notify_result),
+ routing_id_(routing_id),
+ render_frame_impl_(render_frame_impl) {
+}
+
+RenderFrameImpl::JavaScriptIsolatedWorldRequest::
+ ~JavaScriptIsolatedWorldRequest() {
+}
+
+void RenderFrameImpl::JavaScriptIsolatedWorldRequest::completed(
+ const blink::WebVector<v8::Local<v8::Value>>& result) {
+ if (!render_frame_impl_.get()) {
+ return;
+ }
+
+ if (notify_result_) {
+ base::ListValue list;
+ if (!result.isEmpty()) {
+ // It's safe to always use the main world context when converting
+ // here. V8ValueConverterImpl shouldn't actually care about the
+ // context scope, and it switches to v8::Object's creation context
+ // when encountered. (from extensions/renderer/script_injection.cc)
+ v8::Local<v8::Context> context =
+ render_frame_impl_.get()->frame_->mainWorldScriptContext();
+ v8::Context::Scope context_scope(context);
+ V8ValueConverterImpl converter;
+ converter.SetDateAllowed(true);
+ converter.SetRegExpAllowed(true);
+ for (const auto& value : result) {
+ base::Value* result_value = converter.FromV8Value(value, context);
+ list.Append(result_value ? result_value
+ : base::Value::CreateNullValue());
+ }
+ } else {
+ list.Set(0, base::Value::CreateNullValue());
+ }
+ render_frame_impl_.get()->Send(
+ new FrameHostMsg_JavaScriptExecuteResponse(routing_id_, id_, list));
+ }
+
+ delete this;
+}
+
void RenderFrameImpl::HandleJavascriptExecutionResult(
const base::string16& jscript,
int id,
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 1309b40..d64a507 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -29,6 +29,7 @@
#include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebFrameClient.h"
#include "third_party/WebKit/public/web/WebHistoryCommitType.h"
+#include "third_party/WebKit/public/web/WebScriptExecutionCallback.h"
#include "third_party/WebKit/public/web/WebTransitionElementData.h"
#include "ui/gfx/range/range.h"
@@ -575,6 +576,30 @@ class CONTENT_EXPORT RenderFrameImpl
FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest,
AccessibilityMessagesQueueWhileSwappedOut);
+ // A wrapper class used as the callback for JavaScript executed
+ // in an isolated world.
+ class JavaScriptIsolatedWorldRequest
+ : public blink::WebScriptExecutionCallback {
+ public:
+ JavaScriptIsolatedWorldRequest(
+ int id,
+ bool notify_result,
+ int routing_id,
+ base::WeakPtr<RenderFrameImpl> render_frame_impl);
+ void completed(
+ const blink::WebVector<v8::Local<v8::Value>>& result) override;
+
+ private:
+ ~JavaScriptIsolatedWorldRequest();
+
+ int id_;
+ bool notify_result_;
+ int routing_id_;
+ base::WeakPtr<RenderFrameImpl> render_frame_impl_;
+
+ DISALLOW_COPY_AND_ASSIGN(JavaScriptIsolatedWorldRequest);
+ };
+
typedef std::map<GURL, double> HostZoomLevels;
// Functions to add and remove observers for this object.
@@ -619,6 +644,10 @@ class CONTENT_EXPORT RenderFrameImpl
int id,
bool notify_result,
bool has_user_gesture);
+ void OnJavaScriptExecuteRequestInIsolatedWorld(const base::string16& jscript,
+ int id,
+ bool notify_result,
+ int world_id);
void OnVisualStateRequest(uint64 key);
void OnSetEditableSelectionOffsets(int start, int end);
void OnSetCompositionFromExistingText(
diff --git a/extensions/renderer/extension_groups.h b/extensions/renderer/extension_groups.h
index 531bba8..9766fa4 100644
--- a/extensions/renderer/extension_groups.h
+++ b/extensions/renderer/extension_groups.h
@@ -10,13 +10,10 @@ namespace extensions {
// A set of extension groups for use with blink::registerExtension and
// WebFrame::ExecuteScriptInNewWorld to control which extensions get loaded
// into which contexts.
+// TODO(kalman): Remove this when https://crbug.com/481699 is fixed.
enum ExtensionGroups {
// Use this to mark extensions to be loaded into content scripts only.
EXTENSION_GROUP_CONTENT_SCRIPTS = 1,
-
- // Use this in an isolated world for internal Chrome Translate.
- // No extension APIs are available.
- EXTENSION_GROUP_INTERNAL_TRANSLATE_SCRIPTS = 2,
};
} // namespace extensions