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

Issue 19284011: Apply ScriptPreprocessor to Web page scripts only. (Closed)

Created:
7 years, 5 months ago by johnjbarton
Modified:
7 years, 5 months ago
CC:
blink-reviews, Nils Barth (inactive), marja+watch_chromium.org, caseq+blink_chromium.org, Nate Chapin, loislo+blink_chromium.org, jsbell+bindings_chromium.org, eustas+blink_chromium.org, alph+blink_chromium.org, eae+blinkwatch, yurys+blink_chromium.org, lushnikov+blink_chromium.org, abarth-chromium, vsevik+blink_chromium.org, pfeldman+blink_chromium.org, dglazkov+blink, paulirish+reviews_chromium.org, apavlov+blink_chromium.org, adamk+blink_chromium.org, aandrey+blink_chromium.org, do-not-use
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Apply ScriptPreprocessor to Web page scripts only. Move ScriptPreprocessor from ScriptDebugServer to ScriptController. Evaluate preprocessor in isolatedWorld. Preprocess event listeners and <script> elements before entering V8. Preprocess eval source in V8 beforeCompile event. Add Debugger.getScriptCompilationTypeInfo() to extract the V8 compilation script info, to seperate eval scripts from e.g. devtools command line evaluations. Report exceptions in the ScriptPreprocessor compilation. Add new test-cases for these error paths. BUG=226293 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=154410

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : rebase, fix Mac compiler issue #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+396 lines, -124 lines) Patch
M LayoutTests/inspector/debugger/debugger-script-preprocessor.html View 3 chunks +44 lines, -11 lines 0 comments Download
M LayoutTests/inspector/debugger/debugger-script-preprocessor-expected.txt View 1 chunk +24 lines, -6 lines 0 comments Download
M Source/bindings/bindings.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/v8/DOMWrapperWorld.h View 2 chunks +6 lines, -1 line 0 comments Download
M Source/bindings/v8/DebuggerScript.js View 1 1 chunk +43 lines, -0 lines 3 comments Download
M Source/bindings/v8/PageScriptDebugServer.h View 2 chunks +3 lines, -1 line 0 comments Download
M Source/bindings/v8/PageScriptDebugServer.cpp View 1 2 2 chunks +9 lines, -1 line 0 comments Download
M Source/bindings/v8/ScriptController.h View 4 chunks +13 lines, -4 lines 0 comments Download
M Source/bindings/v8/ScriptController.cpp View 5 chunks +42 lines, -2 lines 0 comments Download
M Source/bindings/v8/ScriptDebugServer.h View 1 5 chunks +3 lines, -12 lines 0 comments Download
M Source/bindings/v8/ScriptDebugServer.cpp View 1 2 5 chunks +6 lines, -84 lines 0 comments Download
A Source/bindings/v8/ScriptPreprocessor.h View 1 1 chunk +63 lines, -0 lines 0 comments Download
A Source/bindings/v8/ScriptPreprocessor.cpp View 1 chunk +130 lines, -0 lines 1 comment Download
M Source/bindings/v8/V8LazyEventListener.cpp View 2 chunks +2 lines, -1 line 3 comments Download
M Source/core/inspector/PageDebuggerAgent.cpp View 2 chunks +6 lines, -1 line 3 comments Download

Messages

Total messages: 12 (0 generated)
johnjbarton
This patch is the same as https://codereview.chromium.org/13575004/#ps128001 which has LGTM but CQ will not process ...
7 years, 5 months ago (2013-07-16 17:19:12 UTC) #1
abarth-chromium
lgtm
7 years, 5 months ago (2013-07-16 22:30:28 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/johnjbarton@chromium.org/19284011/1
7 years, 5 months ago (2013-07-16 22:35:04 UTC) #3
commit-bot: I haz the power
Failed to apply patch for Source/bindings/v8/ScriptDebugServer.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 5 months ago (2013-07-16 22:35:09 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/johnjbarton@chromium.org/19284011/6001
7 years, 5 months ago (2013-07-16 22:51:50 UTC) #5
haraken
LGTM
7 years, 5 months ago (2013-07-16 23:31:36 UTC) #6
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 5 months ago (2013-07-17 00:56:30 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/johnjbarton@chromium.org/19284011/21001
7 years, 5 months ago (2013-07-17 16:12:03 UTC) #8
commit-bot: I haz the power
Change committed as 154410
7 years, 5 months ago (2013-07-17 18:47:35 UTC) #9
pfeldman
https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/bindings/v8/DebuggerScript.js File Source/bindings/v8/DebuggerScript.js (right): https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/bindings/v8/DebuggerScript.js#newcode312 Source/bindings/v8/DebuggerScript.js:312: DebuggerScript._getScriptCompilationTypeInfo = function(script) no _get prefixes in Blink https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/bindings/v8/DebuggerScript.js#newcode317 ...
7 years, 5 months ago (2013-07-22 18:33:05 UTC) #10
johnjbarton
Pavel, I need a couple of hints: https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/bindings/v8/V8LazyEventListener.cpp File Source/bindings/v8/V8LazyEventListener.cpp (right): https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/bindings/v8/V8LazyEventListener.cpp#newcode138 Source/bindings/v8/V8LazyEventListener.cpp:138: String listenerSource ...
7 years, 5 months ago (2013-07-22 18:45:33 UTC) #11
pfeldman
7 years, 5 months ago (2013-07-23 07:51:05 UTC) #12
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/bindings/v8...
File Source/bindings/v8/ScriptPreprocessor.cpp (right):

https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/bindings/v8...
Source/bindings/v8/ScriptPreprocessor.cpp:120: String scriptName =
toWebCoreStringWithUndefinedOrNullCheck(debugServer->callDebuggerMethod("getScriptName",
WTF_ARRAY_LENGTH(argvEventData), argvEventData));
You should only talk to DebuggerScript from within ScriptDebugServer.

https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/bindings/v8...
File Source/bindings/v8/V8LazyEventListener.cpp (right):

https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/bindings/v8...
Source/bindings/v8/V8LazyEventListener.cpp:138: String listenerSource =
frame->script()->preprocess(m_code, m_functionName);
Sure. You should not have extracted preprocessor and made it accessible through
the ScriptController - that's not how inspector gets into things. You put here:

InspectorInstrumentation::prepareEventListenerObject(frame, m_code,
m_functionName, &listenerSource);

Then you introduce corresponding instrumentation in InspectorInstrumentation.idl
and route it to the InspectorDebuggerAgent. From there, you call
ScriptDebugServer. It bails out in case debugger agent is not engaged and I
think that's how you save 3-4% time that has regressed.

https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/core/inspec...
File Source/core/inspector/PageDebuggerAgent.cpp (right):

https://chromiumcodereview.appspot.com/19284011/diff/21001/Source/core/inspec...
Source/core/inspector/PageDebuggerAgent.cpp:144:
frame->script()->setScriptPreprocessor(m_pageAgent->scriptPreprocessor());
Here you simply go into ScriptDebugServer.

Powered by Google App Engine
This is Rietveld 408576698