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

Unified Diff: Source/bindings/v8/ScriptController.cpp

Issue 13575004: Apply script preprocessor to Web page scripts only. (Closed) Base URL: https://chromium.googlesource.com/external/WebKit_trimmed.git@master
Patch Set: Re-implment based on review Created 7 years, 8 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.cpp
diff --git a/Source/bindings/v8/ScriptController.cpp b/Source/bindings/v8/ScriptController.cpp
index b88a1da2e07c222dc91f3e451916ac80e0042b3d..2181bf4dc668a340effa6e9863957c7109b00316 100644
--- a/Source/bindings/v8/ScriptController.cpp
+++ b/Source/bindings/v8/ScriptController.cpp
@@ -299,6 +299,17 @@ ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode)
return ScriptValue(object);
}
+ScriptValue ScriptController::evaluateFromWebPage(const ScriptSourceCode& sourceCode)
+{
+ v8::HandleScope handleScope;
+ v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(m_frame);
+ if (v8Context.IsEmpty())
+ return ScriptValue();
+
+ V8PerContextDebugData::ScopedWebCompilation compileFromWeb(v8Context);
+ return evaluate(sourceCode);
+}
+
bool ScriptController::initializeMainWorld()
{
if (m_windowShell->isContextInitialized())

Powered by Google App Engine
This is Rietveld 408576698