Bug 93271 - Web Inspector: Use and process the actual ScriptId in the protocol EventListener object
Summary: Web Inspector: Use and process the actual ScriptId in the protocol EventListe...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
Depends on:
Reported: 2012-08-06 07:46 PDT by Alexander Pavlov (apavlov)
Modified: 2012-09-20 01:39 PDT (History)
14 users (show)

See Also:

Patch (22.42 KB, patch)
2012-09-18 09:02 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
Patch (15.02 KB, patch)
2012-09-20 00:50 PDT, Alexander Pavlov (apavlov)
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2012-08-06 07:46:39 PDT
Currently, EventListener object's "location" field transferred through the protocol contains the script URL, not the script id.
Comment 1 Alexander Pavlov (apavlov) 2012-08-06 09:44:13 PDT
Currently, it is impossible to rely on scriptId's rather than source URLs, as scripts are not registered with the frontend until the debugger is explicitly enabled by the user.
Comment 2 Alexander Pavlov (apavlov) 2012-09-18 09:02:25 PDT
Created attachment 164569 [details]
Comment 3 Vsevolod Vlasov 2012-09-20 00:20:00 PDT
Comment on attachment 164569 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=164569&action=review

> Source/WebCore/bindings/js/ScriptEventListener.cpp:109
> +bool eventListenerHandlerLocation(Document* document, EventListener* eventListener, String& sourceName, String& sourceId, int& lineNumber)


> Source/WebCore/bindings/v8/ScriptEventListener.cpp:121
> +    v8::Handle<v8::Value> scriptIdValue = function->GetScriptId();

scriptId is always available in v8.

> Source/WebCore/inspector/front-end/EventListenersSidebarPane.js:208
> +                if (this.eventListener.location.scriptId)

I don't think scriptId is valuable for user.
Comment 4 Alexander Pavlov (apavlov) 2012-09-20 00:50:58 PDT
Created attachment 164854 [details]
Comment 5 Yury Semikhatsky 2012-09-20 01:12:57 PDT
Comment on attachment 164854 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=164854&action=review

> Source/WebCore/bindings/js/ScriptEventListener.cpp:127
> +    scriptId = funcSourceId == SourceProvider::nullID ? "" : String::number(funcSourceId);

I wonder when (funcSourceId == SourceProvider::nullID) can happen.
Comment 6 Alexander Pavlov (apavlov) 2012-09-20 01:33:41 PDT
Committed r129105: <http://trac.webkit.org/changeset/129105>
Comment 7 Alexander Pavlov (apavlov) 2012-09-20 01:39:02 PDT
Chromium issue: http://code.google.com/p/chromium/issues/detail?id=140375