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

Unified 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: rebase Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/v8/ScriptController.h
diff --git a/Source/bindings/v8/ScriptController.h b/Source/bindings/v8/ScriptController.h
index e4076667a027becd84500cbb37c74e2e8a3352a3..8437070bbaafa2b9da7acc18b062ca459b346f08 100644
--- a/Source/bindings/v8/ScriptController.h
+++ b/Source/bindings/v8/ScriptController.h
@@ -64,6 +64,10 @@ enum ReasonForCallingCanExecuteScripts {
NotAboutToExecuteScript
};
+enum InternalIsoloatedWorldIds {
+ ScriptPreprocessorIsolatedWorldId = 10001,
abarth-chromium 2013/07/08 23:57:08 Why is it safe to steal this world ID? It's valid
johnjbarton 2013/07/09 22:44:54 It is not absolutely safe, only relatively safe gi
+};
+
class ScriptController {
public:
ScriptController(Frame*);
@@ -157,6 +161,13 @@ public:
static void registerExtensionIfNeeded(v8::Extension*);
static V8Extensions& registeredExtensions();
+ // Empty string disables preprocessing.
abarth-chromium 2013/07/08 23:57:08 Rather than using in-band signaling, I'd recommend
johnjbarton 2013/07/09 22:44:54 Done.
+ void setScriptPreprocessor(const String& preprocessorSource);
+ // Source to Source processing iff debugger enabled and preprocessor loaded.
+ String preprocess(const String& scriptSource, const String& scriptName);
+ bool hasScriptPreprocessor();
+ bool isScriptPreprocessing();
abarth-chromium 2013/07/08 23:57:08 isPreprocessingScript
johnjbarton 2013/07/09 22:44:54 Done.
+
bool setContextDebugId(int);
static int contextDebugId(v8::Handle<v8::Context>);
@@ -180,6 +191,10 @@ private:
typedef HashSet<NPP> PluginInstances;
PluginInstances m_pluginNPPs;
+
+ class ScriptPreprocessor;
+ String m_preprocessorSource;
+ OwnPtr<ScriptPreprocessor> m_scriptPreprocessor;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698