| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 Vector<v8::Local<v8::Value>>* results); | 109 Vector<v8::Local<v8::Value>>* results); |
| 110 | 110 |
| 111 // Returns true if argument is a JavaScript URL. | 111 // Returns true if argument is a JavaScript URL. |
| 112 bool ExecuteScriptIfJavaScriptURL(const KURL&, Element*); | 112 bool ExecuteScriptIfJavaScriptURL(const KURL&, Element*); |
| 113 | 113 |
| 114 // Returns true if the current world is isolated, and has its own Content | 114 // Returns true if the current world is isolated, and has its own Content |
| 115 // Security Policy. In this case, the policy of the main world should be | 115 // Security Policy. In this case, the policy of the main world should be |
| 116 // ignored when evaluating resources injected into the DOM. | 116 // ignored when evaluating resources injected into the DOM. |
| 117 bool ShouldBypassMainWorldCSP(); | 117 bool ShouldBypassMainWorldCSP(); |
| 118 | 118 |
| 119 void EnableEval(); |
| 119 void DisableEval(const String& error_message); | 120 void DisableEval(const String& error_message); |
| 120 | 121 |
| 121 TextPosition EventHandlerPosition() const; | 122 TextPosition EventHandlerPosition() const; |
| 122 | 123 |
| 123 void ClearWindowProxy(); | 124 void ClearWindowProxy(); |
| 124 void UpdateDocument(); | 125 void UpdateDocument(); |
| 125 | 126 |
| 126 void UpdateSecurityOrigin(SecurityOrigin*); | 127 void UpdateSecurityOrigin(SecurityOrigin*); |
| 127 | 128 |
| 128 void ClearForClose(); | 129 void ClearForClose(); |
| 129 | 130 |
| 130 // Registers a v8 extension to be available on webpages. Will only | 131 // Registers a v8 extension to be available on webpages. Will only |
| 131 // affect v8 contexts initialized after this call. Takes ownership of | 132 // affect v8 contexts initialized after this call. Takes ownership of |
| 132 // the v8::Extension object passed. | 133 // the v8::Extension object passed. |
| 133 static void RegisterExtensionIfNeeded(v8::Extension*); | 134 static void RegisterExtensionIfNeeded(v8::Extension*); |
| 134 static V8Extensions& RegisteredExtensions(); | 135 static V8Extensions& RegisteredExtensions(); |
| 135 | 136 |
| 136 private: | 137 private: |
| 137 ScriptController(LocalFrame& frame, | 138 ScriptController(LocalFrame& frame, |
| 138 LocalWindowProxyManager& window_proxy_manager) | 139 LocalWindowProxyManager& window_proxy_manager) |
| 139 : frame_(&frame), window_proxy_manager_(&window_proxy_manager) {} | 140 : frame_(&frame), window_proxy_manager_(&window_proxy_manager) {} |
| 140 | 141 |
| 141 LocalFrame* GetFrame() const { return frame_; } | 142 LocalFrame* GetFrame() const { return frame_; } |
| 142 v8::Isolate* GetIsolate() const { | 143 v8::Isolate* GetIsolate() const { |
| 143 return window_proxy_manager_->GetIsolate(); | 144 return window_proxy_manager_->GetIsolate(); |
| 144 } | 145 } |
| 145 void EnableEval(); | |
| 146 | 146 |
| 147 v8::Local<v8::Value> EvaluateScriptInMainWorld(const ScriptSourceCode&, | 147 v8::Local<v8::Value> EvaluateScriptInMainWorld(const ScriptSourceCode&, |
| 148 AccessControlStatus, | 148 AccessControlStatus, |
| 149 ExecuteScriptPolicy); | 149 ExecuteScriptPolicy); |
| 150 | 150 |
| 151 const Member<LocalFrame> frame_; | 151 const Member<LocalFrame> frame_; |
| 152 const Member<LocalWindowProxyManager> window_proxy_manager_; | 152 const Member<LocalWindowProxyManager> window_proxy_manager_; |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace blink | 155 } // namespace blink |
| 156 | 156 |
| 157 #endif // ScriptController_h | 157 #endif // ScriptController_h |
| OLD | NEW |