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

Side by Side Diff: Source/bindings/v8/ScriptController.h

Issue 13575004: Apply script preprocessor to Web page scripts only. (Closed) Base URL: https://chromium.googlesource.com/external/WebKit_trimmed.git@master
Patch Set: Oops, no JS-builts Created 7 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698