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

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: move clearScriptPreprocessor() to ScriptController::clearWindowShell 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 8a9eba883eb9107c5f41c04fbb9d15b2026fdcf5..c3c54bd7d7faed32999661303d6201c0a055a05c 100644
--- a/Source/bindings/v8/ScriptController.h
+++ b/Source/bindings/v8/ScriptController.h
@@ -51,6 +51,7 @@ class Frame;
class HTMLDocument;
class HTMLPlugInElement;
class KURL;
+class ScriptPreprocessor;
class ScriptSourceCode;
class ScriptState;
class SecurityOrigin;
@@ -65,7 +66,8 @@ enum ReasonForCallingCanExecuteScripts {
};
enum IsolatedWorldConstants {
haraken 2013/07/11 01:13:59 Shall we move this to ScriptPreprocessor.h?
johnjbarton 2013/07/11 19:14:42 The most logical place would be DOMWrapperWorld.h.
- EmbedderWorldIdLimit = (1 << 29)
+ EmbedderWorldIdLimit = (1 << 29),
+ ScriptPreprocessorIsolatedWorldId
};
class ScriptController {
@@ -159,6 +161,13 @@ public:
static void registerExtensionIfNeeded(v8::Extension*);
static V8Extensions& registeredExtensions();
+ void setScriptPreprocessor(const String& preprocessorSource);
+ bool hasScriptPreprocessor();
+ void clearScriptPreprocessor();
+ // Source to Source processing iff debugger enabled and preprocessor loaded.
+ String preprocess(const String& scriptSource, const String& scriptName);
+ bool isPreprocessingScript();
+
bool setContextDebugId(int);
static int contextDebugId(v8::Handle<v8::Context>);
@@ -179,6 +188,9 @@ private:
NPObject* m_windowScriptNPObject;
OwnPtr<NPP_t> m_frameNPP;
+
+ String m_preprocessorSource;
+ OwnPtr<ScriptPreprocessor> m_scriptPreprocessor;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698