| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Content ------------------------------------------------------------ | 121 // Content ------------------------------------------------------------ |
| 122 | 122 |
| 123 virtual WebDocument document() const = 0; | 123 virtual WebDocument document() const = 0; |
| 124 | 124 |
| 125 | 125 |
| 126 // Closing ------------------------------------------------------------- | 126 // Closing ------------------------------------------------------------- |
| 127 | 127 |
| 128 // Executes script in the context of the current page. | 128 // Executes script in the context of the current page. |
| 129 virtual void executeScript(const WebScriptSource&) = 0; | 129 virtual void executeScript(const WebScriptSource&) = 0; |
| 130 | 130 |
| 131 // Executes JavaScript in a new world associated with the web frame. | |
| 132 // The script gets its own global scope and its own prototypes for | |
| 133 // intrinsic JavaScript objects (String, Array, and so-on). It also | |
| 134 // gets its own wrappers for all DOM nodes and DOM constructors. | |
| 135 // extensionGroup is an embedder-provided specifier that controls which | |
| 136 // v8 extensions are loaded into the new context - see | |
| 137 // blink::registerExtension for the corresponding specifier. | |
| 138 // | |
| 139 // worldID must be > 0 (as 0 represents the main world). | |
| 140 // worldID must be < EmbedderWorldIdLimit, high number used internally. | |
| 141 virtual void executeScriptInIsolatedWorld( | |
| 142 int worldID, const WebScriptSource* sources, unsigned numSources, | |
| 143 int extensionGroup) = 0; | |
| 144 | |
| 145 // Associates an isolated world with human-readable name which is useful for | |
| 146 // extension debugging. | |
| 147 virtual void setIsolatedWorldHumanReadableName( | |
| 148 int worldID, const WebString&) = 0; | |
| 149 | |
| 150 // Logs to the console associated with this frame. | 131 // Logs to the console associated with this frame. |
| 151 virtual void addMessageToConsole(const WebConsoleMessage&) = 0; | 132 virtual void addMessageToConsole(const WebConsoleMessage&) = 0; |
| 152 | 133 |
| 153 // Calls window.gc() if it is defined. | 134 // Calls window.gc() if it is defined. |
| 154 virtual void collectGarbage() = 0; | 135 virtual void collectGarbage() = 0; |
| 155 | 136 |
| 156 // Executes script in the context of the current page and returns the value | 137 // Executes script in the context of the current page and returns the value |
| 157 // that the script evaluated to. | 138 // that the script evaluated to. |
| 158 virtual v8::Handle<v8::Value> executeScriptAndReturnValue( | 139 virtual v8::Handle<v8::Value> executeScriptAndReturnValue( |
| 159 const WebScriptSource&) = 0; | 140 const WebScriptSource&) = 0; |
| 160 | 141 |
| 161 // ONLY FOR TESTS: Same as above but sets a fake UserGestureIndicator before | 142 // ONLY FOR TESTS: Same as above but sets a fake UserGestureIndicator before |
| 162 // execution. | 143 // execution. |
| 163 virtual v8::Handle<v8::Value> executeScriptAndReturnValueForTests( | 144 virtual v8::Handle<v8::Value> executeScriptAndReturnValueForTests( |
| 164 const WebScriptSource&); | 145 const WebScriptSource&); |
| 165 | 146 |
| 166 // worldID must be > 0 (as 0 represents the main world). | |
| 167 // worldID must be < EmbedderWorldIdLimit, high number used internally. | |
| 168 virtual void executeScriptInIsolatedWorld( | |
| 169 int worldID, const WebScriptSource* sourcesIn, unsigned numSources, | |
| 170 int extensionGroup, WebVector<v8::Local<v8::Value> >* results) = 0; | |
| 171 | |
| 172 // Call the function with the given receiver and arguments, bypassing | 147 // Call the function with the given receiver and arguments, bypassing |
| 173 // canExecute(). | 148 // canExecute(). |
| 174 virtual v8::Handle<v8::Value> callFunctionEvenIfScriptDisabled( | 149 virtual v8::Handle<v8::Value> callFunctionEvenIfScriptDisabled( |
| 175 v8::Handle<v8::Function>, | 150 v8::Handle<v8::Function>, |
| 176 v8::Handle<v8::Value>, | 151 v8::Handle<v8::Value>, |
| 177 int argc, | 152 int argc, |
| 178 v8::Handle<v8::Value> argv[]) = 0; | 153 v8::Handle<v8::Value> argv[]) = 0; |
| 179 | 154 |
| 180 // Returns the V8 context for associated with the main world and this | 155 // Returns the V8 context for associated with the main world and this |
| 181 // frame. There can be many V8 contexts associated with this frame, one for | 156 // frame. There can be many V8 contexts associated with this frame, one for |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 private: | 272 private: |
| 298 }; | 273 }; |
| 299 | 274 |
| 300 #if BLINK_IMPLEMENTATION | 275 #if BLINK_IMPLEMENTATION |
| 301 Frame* toCoreFrame(const WebFrame*); | 276 Frame* toCoreFrame(const WebFrame*); |
| 302 #endif | 277 #endif |
| 303 | 278 |
| 304 } // namespace blink | 279 } // namespace blink |
| 305 | 280 |
| 306 #endif // SKY_ENGINE_PUBLIC_WEB_WEBFRAME_H_ | 281 #endif // SKY_ENGINE_PUBLIC_WEB_WEBFRAME_H_ |
| OLD | NEW |