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(); | |
120 void DisableEval(const String& error_message); | 119 void DisableEval(const String& error_message); |
121 | 120 |
122 TextPosition EventHandlerPosition() const; | 121 TextPosition EventHandlerPosition() const; |
123 | 122 |
124 void ClearWindowProxy(); | 123 void ClearWindowProxy(); |
125 void UpdateDocument(); | 124 void UpdateDocument(); |
126 | 125 |
127 void UpdateSecurityOrigin(SecurityOrigin*); | 126 void UpdateSecurityOrigin(SecurityOrigin*); |
128 | 127 |
129 void ClearForClose(); | 128 void ClearForClose(); |
130 | 129 |
131 // Registers a v8 extension to be available on webpages. Will only | 130 // Registers a v8 extension to be available on webpages. Will only |
132 // affect v8 contexts initialized after this call. Takes ownership of | 131 // affect v8 contexts initialized after this call. Takes ownership of |
133 // the v8::Extension object passed. | 132 // the v8::Extension object passed. |
134 static void RegisterExtensionIfNeeded(v8::Extension*); | 133 static void RegisterExtensionIfNeeded(v8::Extension*); |
135 static V8Extensions& RegisteredExtensions(); | 134 static V8Extensions& RegisteredExtensions(); |
136 | 135 |
137 private: | 136 private: |
138 ScriptController(LocalFrame& frame, | 137 ScriptController(LocalFrame& frame, |
139 LocalWindowProxyManager& window_proxy_manager) | 138 LocalWindowProxyManager& window_proxy_manager) |
140 : frame_(&frame), window_proxy_manager_(&window_proxy_manager) {} | 139 : frame_(&frame), window_proxy_manager_(&window_proxy_manager) {} |
141 | 140 |
142 LocalFrame* GetFrame() const { return frame_; } | 141 LocalFrame* GetFrame() const { return frame_; } |
143 v8::Isolate* GetIsolate() const { | 142 v8::Isolate* GetIsolate() const { |
144 return window_proxy_manager_->GetIsolate(); | 143 return window_proxy_manager_->GetIsolate(); |
145 } | 144 } |
| 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 |