Use case: "provisional breakpoints" In IDE user opens source file foo.js from disk. He sets a breakpoint in the file. Then he attaches to Chrome. At this moment Chrome must learn about the user breakpoints, but exact URL or script id is needed. If script hasn't been loaded yet the breakpoint cannot be set without knowing exact URL. This makes it extremely hard to build an IDE with provisional breakpoints, event harder is to build user-friendly IDE. Scenario that is to be implemented: IDE from a short name of the file foo.js (and possibly some additional mark-up) specifies a URL predicated, either in form of a URL substring, RegExp or path component list (the latter is nice because the reverse map URL -> matching breakpoints can be built). When Chrome compiles a new script, it checks predicates of all provisional breakpoints and set matching ones in the new script. I propose this feature first implemented and added to protocol in experimental mode because the optimal type of predicate seems unclear now.
This probably should reproduce V8's debug protocol feature: RegExp on the script name. You can set a breakpoint specifying a RegExp pattern for the script name (in place of script URL or source ID). Unlimited number of scripts could be matched.
Created attachment 101576 [details] Patch
Attachment 101576 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/insp..." exit_code: 1 Source/WebCore/inspector/InspectorDebuggerAgent.cpp:184: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Source/WebCore/inspector/InspectorDebuggerAgent.h:85: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 101576 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=101576&action=review > LayoutTests/inspector/debugger/debugger-set-breakpoint-regex.html:45 > +Tests Debugger.setBreakpointByUrl with isRegex set to true. Link to the bug is missing.
Committed r91461: <http://trac.webkit.org/changeset/91461>