| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*); | 149 NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*); |
| 150 NPObject* windowScriptNPObject(); | 150 NPObject* windowScriptNPObject(); |
| 151 | 151 |
| 152 // Registers a v8 extension to be available on webpages. Will only | 152 // Registers a v8 extension to be available on webpages. Will only |
| 153 // affect v8 contexts initialized after this call. Takes ownership of | 153 // affect v8 contexts initialized after this call. Takes ownership of |
| 154 // the v8::Extension object passed. | 154 // the v8::Extension object passed. |
| 155 static void registerExtensionIfNeeded(v8::Extension*); | 155 static void registerExtensionIfNeeded(v8::Extension*); |
| 156 static V8Extensions& registeredExtensions(); | 156 static V8Extensions& registeredExtensions(); |
| 157 | 157 |
| 158 // Empty string disables preprocessing. |
| 159 void setScriptPreprocessor(const String& preprocessorSource); |
| 160 // Source to Source processing iff debugger enabled and preprocess loaded. |
| 161 String preprocess(const String& scriptSource, const String& scriptName); |
| 162 |
| 158 bool setContextDebugId(int); | 163 bool setContextDebugId(int); |
| 159 static int contextDebugId(v8::Handle<v8::Context>); | 164 static int contextDebugId(v8::Handle<v8::Context>); |
| 160 | 165 |
| 161 private: | 166 private: |
| 162 typedef HashMap<int, OwnPtr<V8DOMWindowShell> > IsolatedWorldMap; | 167 typedef HashMap<int, OwnPtr<V8DOMWindowShell> > IsolatedWorldMap; |
| 163 | 168 |
| 164 void clearForClose(bool destroyGlobal); | 169 void clearForClose(bool destroyGlobal); |
| 165 | 170 |
| 166 Frame* m_frame; | 171 Frame* m_frame; |
| 167 const String* m_sourceURL; | 172 const String* m_sourceURL; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 180 // The frame keeps a NPObject reference for each item on the list. | 185 // The frame keeps a NPObject reference for each item on the list. |
| 181 PluginObjectMap m_pluginObjects; | 186 PluginObjectMap m_pluginObjects; |
| 182 // The window script object can get destroyed while there are outstanding | 187 // The window script object can get destroyed while there are outstanding |
| 183 // references to it. Please refer to ScriptController::clearScriptObjects | 188 // references to it. Please refer to ScriptController::clearScriptObjects |
| 184 // for more information as to why this is necessary. To avoid crashes due | 189 // for more information as to why this is necessary. To avoid crashes due |
| 185 // to calls on the destroyed window object, we return a proxy NPObject | 190 // to calls on the destroyed window object, we return a proxy NPObject |
| 186 // which wraps the underlying window object. The wrapped window object | 191 // which wraps the underlying window object. The wrapped window object |
| 187 // pointer in this object is cleared out when the window object is | 192 // pointer in this object is cleared out when the window object is |
| 188 // destroyed. | 193 // destroyed. |
| 189 NPObject* m_wrappedWindowScriptNPObject; | 194 NPObject* m_wrappedWindowScriptNPObject; |
| 195 |
| 196 class ScriptPreprocessor; |
| 197 String m_preprocessorSource; |
| 198 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; |
| 190 }; | 199 }; |
| 191 | 200 |
| 192 } // namespace WebCore | 201 } // namespace WebCore |
| 193 | 202 |
| 194 #endif // ScriptController_h | 203 #endif // ScriptController_h |
| OLD | NEW |