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

Unified Diff: third_party/WebKit/public/web/WebLocalFrame.h

Issue 2922803003: Move most scripting-related methods from WebFrame to WebLocalFrame. (Closed)
Patch Set: Rebasing... Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/public/web/WebFrame.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/web/WebLocalFrame.h
diff --git a/third_party/WebKit/public/web/WebLocalFrame.h b/third_party/WebKit/public/web/WebLocalFrame.h
index 8c1ae2d170ea757bd1f5d4ee4e16bf5643cd89d8..7b2ecf306275221e803449257b6c772e77ad4ed4 100644
--- a/third_party/WebKit/public/web/WebLocalFrame.h
+++ b/third_party/WebKit/public/web/WebLocalFrame.h
@@ -50,6 +50,7 @@ struct WebContentSecurityPolicyViolation;
struct WebFindOptions;
struct WebFloatRect;
struct WebPrintPresetOptions;
+struct WebScriptSource;
struct WebSourceLocation;
// Interface for interacting with in process frames. This contains methods that
@@ -297,6 +298,59 @@ class WebLocalFrame : public WebFrame {
// Executes script in the context of the current page.
virtual void ExecuteScript(const WebScriptSource&) = 0;
+ // Executes JavaScript in a new world associated with the web frame.
+ // The script gets its own global scope and its own prototypes for
+ // intrinsic JavaScript objects (String, Array, and so-on). It also
+ // gets its own wrappers for all DOM nodes and DOM constructors.
+ //
+ // worldID must be > 0 (as 0 represents the main world).
+ // worldID must be < EmbedderWorldIdLimit, high number used internally.
+ virtual void ExecuteScriptInIsolatedWorld(int world_id,
+ const WebScriptSource* sources,
+ unsigned num_sources) = 0;
+
+ // worldID must be > 0 (as 0 represents the main world).
+ // worldID must be < EmbedderWorldIdLimit, high number used internally.
+ // DEPRECATED: Use WebLocalFrame::requestExecuteScriptInIsolatedWorld.
+ virtual void ExecuteScriptInIsolatedWorld(
+ int world_id,
+ const WebScriptSource* sources_in,
+ unsigned num_sources,
+ WebVector<v8::Local<v8::Value>>* results) = 0;
+
+ // Associates an isolated world (see above for description) with a security
+ // origin. XMLHttpRequest instances used in that world will be considered
+ // to come from that origin, not the frame's.
+ virtual void SetIsolatedWorldSecurityOrigin(int world_id,
+ const WebSecurityOrigin&) = 0;
+
+ // Associates a content security policy with an isolated world. This policy
+ // should be used when evaluating script in the isolated world, and should
+ // also replace a protected resource's CSP when evaluating resources
+ // injected into the DOM.
+ //
+ // FIXME: Setting this simply bypasses the protected resource's CSP. It
+ // doesn't yet restrict the isolated world to the provided policy.
+ virtual void SetIsolatedWorldContentSecurityPolicy(int world_id,
+ const WebString&) = 0;
+
+ // Calls window.gc() if it is defined.
+ virtual void CollectGarbage() = 0;
+
+ // Executes script in the context of the current page and returns the value
+ // that the script evaluated to.
+ // DEPRECATED: Use WebLocalFrame::requestExecuteScriptAndReturnValue.
+ virtual v8::Local<v8::Value> ExecuteScriptAndReturnValue(
+ const WebScriptSource&) = 0;
+
+ // Call the function with the given receiver and arguments, bypassing
+ // canExecute().
+ virtual v8::Local<v8::Value> CallFunctionEvenIfScriptDisabled(
+ v8::Local<v8::Function>,
+ v8::Local<v8::Value>,
+ int argc,
+ v8::Local<v8::Value> argv[]) = 0;
+
// Returns the V8 context for associated with the main world and this
// frame. There can be many V8 contexts associated with this frame, one for
// each isolated world and one for the main world. If you don't know what
« no previous file with comments | « third_party/WebKit/public/web/WebFrame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698