New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 670180 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit 29 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 649837
issue 685374
issue 685552



Sign in to add a comment

DevTools: one UISourceCode per url

Project Member Reported by dgozman@chromium.org, Dec 1 2016

Issue description

We currently can have multiple UISourceCode instances with the same url, e.g. coming from multiple frames or targets.

This makes it harder for the user (since they can open multiple editors with same content) and for us, since we have to think about synchronizing (or not) some of the properties like breakpoints.

Roadmap:
- switch many of current Workspace clients to NetworkProject instead;
- support multiple entries per UISourceCode in navigator;
- make NetworkProject handle multiple ContentProviders per single UISourceCode and ensure single url policy.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f

commit 1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f
Author: dgozman <dgozman@chromium.org>
Date: Fri Dec 02 04:28:30 2016

[DevTools] Remove unnecessary checks for project types.

This moves us closer to separating users of file system projects from network ones,
and just makes code cleaner.

Eventual goal is to remove project types completely.

BUG=670180

Review-Url: https://codereview.chromium.org/2546473005
Cr-Commit-Position: refs/heads/master@{#435856}

[modify] https://crrev.com/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
[modify] https://crrev.com/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
[modify] https://crrev.com/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
[modify] https://crrev.com/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f/third_party/WebKit/Source/devtools/front_end/sources/InplaceFormatterEditorAction.js
[modify] https://crrev.com/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
[modify] https://crrev.com/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js
[modify] https://crrev.com/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
[modify] https://crrev.com/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
[modify] https://crrev.com/1ac525d4bdbec3318eae77ded7a1ff83f52f1b5f/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js

Blocking: 685552
Blocking: 685374
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0

commit f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0
Author: lushnikov <lushnikov@chromium.org>
Date: Wed Mar 08 20:38:13 2017

DevTools: add tests to fixate bindings behavior

This patch adds a bunch of tests to fixate bindings behavior:
- bindings-* tests ensure that workspace is populated correctly
- navigator-* tests ensure that navigator is populated correctly

The binding-* and navigator-* tests are very similar, but since
navigator might rely less on workspace in future, they're kept separate.

These tests will help to evaluate changes which will happen to bindings
and navigator during bindings refactoring.

BUG=670180
R=dgozman

Review-Url: https://codereview.chromium.org/2735933002
Cr-Commit-Position: refs/heads/master@{#455531}

[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-frame-attach-detach-expected.txt
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-frame-attach-detach.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-frame-navigate-expected.txt
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-frame-navigate.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-main-frame-navigated-expected.txt
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-main-frame-navigated.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-multiple-frames-expected.txt
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-multiple-frames.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-frame-attach-detach-expected.txt
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-frame-attach-detach.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-frame-navigate-expected.txt
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-frame-navigate.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-main-frame-navigated-expected.txt
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-main-frame-navigated.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-multiple-frames-expected.txt
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-multiple-frames.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/empty-frame.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/empty-page.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/magic-frame.html
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/magic-script.js
[add] https://crrev.com/f4fbdf6154d37fcb940bfd37b15b2c2bb0e5ada0/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/magic-style.css

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/95ff5bc751ba619a7c37155eec85c1adcadb01bc

commit 95ff5bc751ba619a7c37155eec85c1adcadb01bc
Author: lushnikov <lushnikov@chromium.org>
Date: Wed Mar 08 21:40:02 2017

DevTools: add tests to fixate sourcemap bindings behavior

These tests fixate how source map bindings, such as
CompilerScriptMapping and SASSSourceMapping, produce sources
correctly for frames.

As these tests reveal, CompilerScriptMapping currently doesn't
attach sources for all frames.

BUG=670180, 685552 
R=dgozman

Review-Url: https://codereview.chromium.org/2731403009
Cr-Commit-Position: refs/heads/master@{#455547}

[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-main-frame-navigated-expected.txt
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-main-frame-navigated.html
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-main-frame-navigated-expected.txt
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-main-frame-navigated.html
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-frame.html
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-sass.scss
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-script.js
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-script.js.map
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-style.css
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-style.css.map
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-typescript.ts
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames-expected.txt
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames.html
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-navigator-multiple-frames-expected.txt
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-navigator-multiple-frames.html
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js

Project Member

Comment 7 by bugdroid1@chromium.org, Mar 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a7852b75fa1cd5e90d2aed4cf612e4058e4604e6

commit a7852b75fa1cd5e90d2aed4cf612e4058e4604e6
Author: lushnikov <lushnikov@chromium.org>
Date: Wed Mar 08 23:15:49 2017

DevTools: [Bindings] add resources to every frame.

This patch starts adding UISourceCodes for every frame, which aligns
with our behavior for stylesheets and scripts.

BUG=670180
R=dgozman

Review-Url: https://codereview.chromium.org/2738773002
Cr-Commit-Position: refs/heads/master@{#455585}

[modify] https://crrev.com/a7852b75fa1cd5e90d2aed4cf612e4058e4604e6/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-frame-attach-detach-expected.txt
[modify] https://crrev.com/a7852b75fa1cd5e90d2aed4cf612e4058e4604e6/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-multiple-frames-expected.txt
[modify] https://crrev.com/a7852b75fa1cd5e90d2aed4cf612e4058e4604e6/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-multiple-frames-expected.txt
[modify] https://crrev.com/a7852b75fa1cd5e90d2aed4cf612e4058e4604e6/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames-expected.txt
[modify] https://crrev.com/a7852b75fa1cd5e90d2aed4cf612e4058e4604e6/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-navigator-multiple-frames-expected.txt
[modify] https://crrev.com/a7852b75fa1cd5e90d2aed4cf612e4058e4604e6/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/pause-in-removed-frame-expected.txt
[modify] https://crrev.com/a7852b75fa1cd5e90d2aed4cf612e4058e4604e6/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js

Project Member

Comment 8 by bugdroid1@chromium.org, Mar 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/074f0c4a4ad0b9cf594780b34bde720f57a177b8

commit 074f0c4a4ad0b9cf594780b34bde720f57a177b8
Author: lushnikov <lushnikov@chromium.org>
Date: Fri Mar 10 03:06:28 2017

DevTools: add more tests to fixate bindings behavior

NetworkProject's cleanup logic currently relies on resources in
resourceTreeFrame. This patch adds tests with scripts and
stylesheets which don't have underlying resource:
- contentscript-* tests validate bindings creating and removing
  UISourceCodes for content scripts
- dynamic-* tests validate bindings creating and removing
  UISourceCodes for dynamically-created styles

As a drive-by, the patch improves the InspectorTest.dumpWorkspace()
method to also produce a diff with the previous workspace dump.
This helps to read expectations a lot.

R=dgozman
BUG=670180

Review-Url: https://codereview.chromium.org/2738033002
Cr-Commit-Position: refs/heads/master@{#455973}

[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-frame-attach-detach-expected.txt
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-frame-attach-detach.html
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-frame-navigate-expected.txt
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-frame-navigate.html
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-main-frame-navigated-expected.txt
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-main-frame-navigated.html
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-multiple-frames-expected.txt
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-multiple-frames.html
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/contentscripts-bindings-multiple-frames-expected.txt
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/contentscripts-bindings-multiple-frames.html
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/contentscripts-navigator-multiple-frames-expected.txt
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/contentscripts-navigator-multiple-frames.html
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/dynamic-bindings-frame-attach-detach-expected.txt
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/dynamic-bindings-frame-attach-detach.html
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/dynamic-navigator-frame-attach-detach-expected.txt
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/dynamic-navigator-frame-attach-detach.html
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/contentscript-frame.html
[add] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/dynamic-frame.html
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames-expected.txt
[modify] https://crrev.com/074f0c4a4ad0b9cf594780b34bde720f57a177b8/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames.html

Project Member

Comment 9 by bugdroid1@chromium.org, Mar 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b83c90c397eb27791292f11782fdf4bae5c861d1

commit b83c90c397eb27791292f11782fdf4bae5c861d1
Author: lushnikov <lushnikov@chromium.org>
Date: Tue Mar 14 03:11:51 2017

DevTools: remove dead code from breakpoint-manager.js test

BUG=670180
TBR=dgozman

Review-Url: https://codereview.chromium.org/2748933002
Cr-Commit-Position: refs/heads/master@{#456606}

[modify] https://crrev.com/b83c90c397eb27791292f11782fdf4bae5c861d1/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js

Project Member

Comment 10 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e9ffec31f17a567b537b260f772d649a8f437154

commit e9ffec31f17a567b537b260f772d649a8f437154
Author: lushnikov <lushnikov@chromium.org>
Date: Thu Mar 16 23:19:03 2017

DevTools: clean up tests to not depend on NetworkProject.addFile method

The NetworkProject.addFile method is adding a UISourceCode
for SourceMap source. However, multiple tests abuse the method for their
needs. This is unfortunate, since we plan to re-work bindings and
eliminate the public "NetworkProject.addFile" method altogether.

This patch migrates tests to other methods of adding UISourceCodes:
- a InspectorTest.addScriptUISourceCode method is introduced which
  adds scripts/contentScripts with proper urls in the main target.
- a InspectorTest.PageMock is introduced to add scripts in a multi-target
  tests

This implementation of pagemock supports only two methods:
- addScript, which adds a script to the mock page and reports it via
  Debugger.scriptParsed protocol event.
- reload(), which "reloads" page, killing all the added scripts

Since PageMock's speaks over a very stable devtools protocol,
little effort will be needed to maintain it. This is unlike the
current solution where tests abuse different public/private binding
APIs.

R=dgozman
BUG=670180

Review-Url: https://codereview.chromium.org/2747863007
Cr-Commit-Position: refs/heads/master@{#457601}

[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
[add] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/http/tests/inspector/sources/navigator-view-content-scripts.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-panel-expected.txt
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-panel.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/debugger/navigator-view-expected.txt
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/debugger/navigator-view.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/LayoutTests/inspector/sources/sources-panel-extension-names.html
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[modify] https://crrev.com/e9ffec31f17a567b537b260f772d649a8f437154/third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js

Project Member

Comment 11 by bugdroid1@chromium.org, Mar 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/df3c60756d51e4db3b19133b7972c866ca49d027

commit df3c60756d51e4db3b19133b7972c866ca49d027
Author: lushnikov <lushnikov@chromium.org>
Date: Sat Mar 18 02:26:06 2017

DevTools: remove SDK.ResourceTreeFrame.fromXXX methods

This patch makes NetworkProject to operate frameIds instead of
frame objects. Today, we query ResourceTreeModel every time we want to
add/remove UISourceCode. Sometimes resourceTreeModel removes frames
before NetworkProject removes associated resources (e.g. during
MainFrameNavigated), and our query fails.

Relying on frameId's instead of frames removes NetworkProject dependency
on ResourceTreeModel and its frame lifecycle.

As a result, all the SDK.ResourceTreeFrame.fromXXX methods are
not needed any more.

BUG=670180
R=dgozman

Review-Url: https://codereview.chromium.org/2756103002
Cr-Commit-Position: refs/heads/master@{#457931}

[modify] https://crrev.com/df3c60756d51e4db3b19133b7972c866ca49d027/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
[modify] https://crrev.com/df3c60756d51e4db3b19133b7972c866ca49d027/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[modify] https://crrev.com/df3c60756d51e4db3b19133b7972c866ca49d027/third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js
[modify] https://crrev.com/df3c60756d51e4db3b19133b7972c866ca49d027/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js

Project Member

Comment 12 by bugdroid1@chromium.org, Mar 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/051c8e924b31fc3939604392284bfe2ff8e15361

commit 051c8e924b31fc3939604392284bfe2ff8e15361
Author: lushnikov <lushnikov@chromium.org>
Date: Mon Mar 27 21:23:03 2017

DevTools: add bindings tests to fixate shadowDOM behavior.

This patch adds two tests to fixate our handling of ShadowDOM
in bindings and navigator.
- shadowdom-bindings.html - illustrates shadowDOM handling by
  varioius bindings
- shadowdom-navigator.html - illustrates navigator behavior

The shadowdom-bindings.html shows the root cause of the problem
which we have in  crbug.com/671867 .

BUG= 671867 ,670180
R=dgozman

Review-Url: https://codereview.chromium.org/2777633002
Cr-Commit-Position: refs/heads/master@{#459883}

[modify] https://crrev.com/051c8e924b31fc3939604392284bfe2ff8e15361/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
[add] https://crrev.com/051c8e924b31fc3939604392284bfe2ff8e15361/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-bindings-expected.txt
[add] https://crrev.com/051c8e924b31fc3939604392284bfe2ff8e15361/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-bindings.html
[add] https://crrev.com/051c8e924b31fc3939604392284bfe2ff8e15361/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-navigator-expected.txt
[add] https://crrev.com/051c8e924b31fc3939604392284bfe2ff8e15361/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-navigator.html

Project Member

Comment 13 by bugdroid1@chromium.org, Apr 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/625244e25254fb6479b3122d92145c596616a196

commit 625244e25254fb6479b3122d92145c596616a196
Author: lushnikov <lushnikov@chromium.org>
Date: Sat Apr 01 01:37:52 2017

DevTools: carefully cleanup javascript sourcemaps

This patch starts to detach JavaScript sourcemaps as the
associated scripts go away (e.g. parent frame got detached).

This patch makes javascript sourcemap management similar to
CSS domain:
- debuggerModel now has sourceMapManager
- CompilerScriptMapping listens only to SourceMapManager events

A few key differences arose:
- We make sure that there's only one sourceMap per
  (executionContext, script.sourceURL, script.sourceMapURL).
  This is to support "browsersync" scenario and "hot script reload".
- Since CompilerScriptMapping has a need for stubProjects,
  SourceMapManager is taught to send SourceMapWillAttach and
  SourceMapFailedToAttach events.

BUG=670180,  685552 
R=dgozman

Review-Url: https://codereview.chromium.org/2784413003
Cr-Commit-Position: refs/heads/master@{#461303}

[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames-expected.txt
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-navigator-multiple-frames-expected.txt
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/worker-debugging-script-mapping.html
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/js-sourcemaps-toggle-enabled-expected.txt
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/js-sourcemaps-toggle-enabled.html
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/resources/sourcemap-script.js
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/resources/sourcemap-script.js.map
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/resources/sourcemap-typescript.ts
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/platform/utilities.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js

Project Member

Comment 14 by bugdroid1@chromium.org, Apr 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/96fe1d78f2701bb68c721282a5831026243e3a3d

commit 96fe1d78f2701bb68c721282a5831026243e3a3d
Author: lushnikov <lushnikov@chromium.org>
Date: Thu Apr 06 22:16:18 2017

DevTools: carefully cleanup script UISourceCodes

This patch starts removing script UISourceCodes when the parent
execution context gets destroyed.

Note: this patch removes only script-related UISourceCodes in
NetworkProject. The "debugger://" UISourceCodes, created by
DefaultScriptMapping, are kept intact. They come handy to reveal
location in old stacktrace/messages.

With this patch, all UISourceCodes created by networkProject have
a lifetime, defined by their parent model:
- DebuggerModel defines life-time for Script-related UISourceCodes
- CSSModel defines life time for CSS-related UISourceCodes
- SASSSourceMapping/CompilerScriptMapping define life-time of SourceMap
  Sources
- ResourceModel defines life-time for document/font/images
  UISourceCodes

For this reason, the NavigatorView no longer needs to listen to
FrameDetached/FrameNavigated events.

Drive-By: move DebuggerModel.scripts to the native Map.

R=dgozman
BUG=670180

Review-Url: https://codereview.chromium.org/2795193003
Cr-Commit-Position: refs/heads/master@{#462645}

[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/dynamic-bindings-frame-attach-detach-expected.txt
[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html
[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js
[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier.html
[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/LayoutTests/inspector/components/linkifier.html
[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-url-comment.html
[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js
[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
[modify] https://crrev.com/96fe1d78f2701bb68c721282a5831026243e3a3d/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js

This is almost there!
Cc: -lushnikov@chromium.org dgozman@chromium.org
Owner: lushnikov@chromium.org
Project Member

Comment 17 by bugdroid1@chromium.org, Apr 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8d63b4e145b185c53bd013b592c6c80b4e6365c4

commit 8d63b4e145b185c53bd013b592c6c80b4e6365c4
Author: lushnikov <lushnikov@chromium.org>
Date: Fri Apr 21 23:36:59 2017

DevTools: prepare Navigator and Network Project for merging uiSourceCodes

The crrev.com/2714053002/, which implemented UISourceCode merging, didn't handle
removal of source map source files (they were never removed back in the days).

Since now we do all the bookkeeping properly, that CL should be
complicated further, which makes it uncomfortably large.

This patch extracts a few important bits from that CL, making future
patches simpler.

This patch:
- introduces NewtorkProject.frameAttribution method which returns frameIds
  for the UISourceCode.
- implements shortcuts in NavigatorView, using NetworkProject.frameAttribution
- improves NetworkProject to fetch resource metadatas efficiently

BUG=670180
R=dgozman

Review-Url: https://codereview.chromium.org/2826173003
Cr-Commit-Position: refs/heads/master@{#466492}

[modify] https://crrev.com/8d63b4e145b185c53bd013b592c6c80b4e6365c4/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
[modify] https://crrev.com/8d63b4e145b185c53bd013b592c6c80b4e6365c4/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[modify] https://crrev.com/8d63b4e145b185c53bd013b592c6c80b4e6365c4/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
[modify] https://crrev.com/8d63b4e145b185c53bd013b592c6c80b4e6365c4/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js

Project Member

Comment 18 by bugdroid1@chromium.org, May 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/50d089bc61f3dd1546a1a6f6267f097db24fb541

commit 50d089bc61f3dd1546a1a6f6267f097db24fb541
Author: lushnikov <lushnikov@chromium.org>
Date: Fri May 05 22:57:20 2017

DevTools: properly handle target suspension/resuming in NetworkProject

NetworkProject adds UISourceCode in response to DebuggerModel.scriptParsed
event and removes UISourceCode in response to RuntimeModel.executionContextDestroyed.

In case of target suspension, the runtimeModel is not getting suspended and
does not destroy execution contexts. But DebuggerModel does get suspended and
later gets resumed, which results in duplicate scriptParsed events.

This patch starts listening to globalObjectCleared event in NetworkProject
to clean up scripts on target suspension.

Drive-by: promisify targetManager.suspendAllTargets(), make methods to
enable/disable debugger private.

R=dgozman
BUG=670180

Review-Url: https://codereview.chromium.org/2832943002
Cr-Commit-Position: refs/heads/master@{#469791}

[modify] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-script.js
[modify] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-typescript.ts
[add] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-bindings-expected.txt
[add] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-bindings.html
[add] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-navigator-expected.txt
[add] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-navigator.html
[modify] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/LayoutTests/inspector/profiler/agents-disabled-check.html
[modify] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-disable-add-breakpoint.html
[modify] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[modify] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
[modify] https://crrev.com/50d089bc61f3dd1546a1a6f6267f097db24fb541/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js

Project Member

Comment 19 by bugdroid1@chromium.org, May 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/07cf0b557a5fdf69dd0cd0bf95909a9d4c762e25

commit 07cf0b557a5fdf69dd0cd0bf95909a9d4c762e25
Author: lushnikov <lushnikov@chromium.org>
Date: Fri May 05 23:55:30 2017

DevTools: proper management of ResourceTreeModel in NetworkProject

This patch cleans up NetworkProject handling of ResourceTreeModel.

This patch:
- stops NetworkProject from listening to MainFrameNavigated event.
  Listening to frameDetached and frameWillNavigate is enough
- cleans up only those UISourceCodes which were created by
  resourceTreeModel (via _acceptsResource method).
- stops listening to suspendedStateChanged method. This is not needed
  anymore because cssmodel / debuggermodel / sourcemaps are properly
  added and removed in case of target suspension/resume.

This patch also fixes a bug: calling method removeUISourceCode on
ContentProviderBasedProject is incorrect.

Drive-By: un-unrestrict ResourceTreeModel.

R=dgozman
BUG=670180

Review-Url: https://codereview.chromium.org/2833583003
Cr-Commit-Position: refs/heads/master@{#469815}

[modify] https://crrev.com/07cf0b557a5fdf69dd0cd0bf95909a9d4c762e25/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-bindings-expected.txt
[modify] https://crrev.com/07cf0b557a5fdf69dd0cd0bf95909a9d4c762e25/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-bindings.html
[modify] https://crrev.com/07cf0b557a5fdf69dd0cd0bf95909a9d4c762e25/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-navigator-expected.txt
[modify] https://crrev.com/07cf0b557a5fdf69dd0cd0bf95909a9d4c762e25/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-navigator.html
[modify] https://crrev.com/07cf0b557a5fdf69dd0cd0bf95909a9d4c762e25/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[modify] https://crrev.com/07cf0b557a5fdf69dd0cd0bf95909a9d4c762e25/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js

Project Member

Comment 20 by bugdroid1@chromium.org, May 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/abb90a5c3d4a074c35fb3b60fdeddda93aaef865

commit abb90a5c3d4a074c35fb3b60fdeddda93aaef865
Author: lushnikov <lushnikov@chromium.org>
Date: Tue May 16 00:49:18 2017

DevTools: make CompilerScriptMapping / SASSSourceMapping manage UISourceCodes

This patch:
- introduce frame attribution methods in NetworkProject
- change CompilerScriptMapping / SASSSourceMapping to fully manage related
  UISourceCodes by themselves. They create a single UISourceCode per target
  instead of UISourceCode-per-frame approach.

R=dgozman
BUG=670180

Review-Url: https://codereview.chromium.org/2869293002
Cr-Commit-Position: refs/heads/master@{#471960}

[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames-expected.txt
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-bindings-expected.txt
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/Source/devtools/front_end/main/Main.js
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/Source/devtools/front_end/platform/utilities.js
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
[modify] https://crrev.com/abb90a5c3d4a074c35fb3b60fdeddda93aaef865/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js

Project Member

Comment 21 by bugdroid1@chromium.org, May 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad816ae2af03119667c954d52cfcac88d084cf1a

commit ad816ae2af03119667c954d52cfcac88d084cf1a
Author: lushnikov <lushnikov@chromium.org>
Date: Fri May 19 20:54:23 2017

DevTools: ResourceTreeModel should not report resources twice

Today, if one loads the page 'http://example.com', devtools will
lack the main resource and thus will create one out of frame pyaload.

However, in case of loading 'http://example.com/index.html', this is
not necessary and results in reporting main resource twice.

This patch fixes the issue, creating a fake resource only if it
is not reported among frame resources.

R=dgozman
BUG=670180

Review-Url: https://codereview.chromium.org/2897713002
Cr-Commit-Position: refs/heads/master@{#473307}

[add] https://crrev.com/ad816ae2af03119667c954d52cfcac88d084cf1a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/iframe-main-resource-expected.txt
[add] https://crrev.com/ad816ae2af03119667c954d52cfcac88d084cf1a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/iframe-main-resource.html
[modify] https://crrev.com/ad816ae2af03119667c954d52cfcac88d084cf1a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js

Project Member

Comment 22 by bugdroid1@chromium.org, May 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1c17c7939f415f28bedd6c6729d2c5e704885268

commit 1c17c7939f415f28bedd6c6729d2c5e704885268
Author: lushnikov <lushnikov@chromium.org>
Date: Fri May 19 21:46:40 2017

DevTools: do not use Bindings.NetworkProject.styleHeaderForUISourceCode in SourceFormatter

This patch eliminates usage of styleHeaderForUISourceCode method in
SourceFormatter.

This is a pre-step before removing the styleHeaderForUISourceCode method
from NetworkManager, which, in turn, is a pre-step before moving styles
UISourceCode management into StylesSourcemapping.

BUG=670180
R=caseq, dgozman

Review-Url: https://codereview.chromium.org/2886053002
Cr-Commit-Position: refs/heads/master@{#473340}

[modify] https://crrev.com/1c17c7939f415f28bedd6c6729d2c5e704885268/third_party/WebKit/LayoutTests/inspector/sources/formatter-css.html
[modify] https://crrev.com/1c17c7939f415f28bedd6c6729d2c5e704885268/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js

Project Member

Comment 23 by bugdroid1@chromium.org, Jun 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/96693ab93867d6a24f3262d9cbb0df5cf102202b

commit 96693ab93867d6a24f3262d9cbb0df5cf102202b
Author: lushnikov <lushnikov@chromium.org>
Date: Fri Jun 09 00:55:58 2017

DevTools: kill DebuggerWorkspaceBinding.{push,pop,set}SourceMapping

Today, there are three methods to manage mapping between scripts and uiSourceCodes:
- pushSourceMapping: adds a raw to ui mapping for the scripts
- popSourceMapping: removes a raw to ui mapping from the script
- setSourceMapping: establishes a ui to raw mapping from uiSourceCode to script

These methods have a few disadvantages:
- adding mapping per-script is a memory-consuming approach, given how many scripts DevTools
  occasionally has
- the push/pop API is invalid and does not allow to remove mapping. For this reason, the
  popSourceMapping is almost never used.
- existence of a separate setSourceMapping method to setup a backward mapping means
  that there's no guarantee that:
     rawLocation == ui2raw(raw2ui(rawLocation))

This patch kills the {push,pop,set}SourceMapping methods in favor of a simplistic approach, already
implemented in CSSWorkspaceBindings:
1. external mappings (Such as snippets and SourceFormatter) are registered via the
  DebuggerWorkspaceBidning.addSourceMapping method
2. the raw to ui mapping is:
   - querying external mappings first
   - queries CompilerScriptMapping (sourceMaps)
   - queries ResourceScriptMapping (regular mapping)
   - queries DefaultScriptMapping (VM UISourceCodes)
3. the ui to raw mapping queries mappings in the same order as raw to ui.

Additionally, with the new persistence, mappings are never actually change: there's
*ALWAYS ONLY ONE* mapping which controls both lifetime and mapping of each UISourceCode.
This means that the DebuggerWorkspace.SourceMappingChanged event is not needed.

To sum up, this patch:
- kills push/pop/set methods in favor of a simplistic approach, already implemented in
  CSSWorkspaceBinding.
- gets rid of DebuggerWorkspaceBinding.SourceMappingChanged event. It's not needed since mappings
  never actually change
- cleans up the DebuggerSourceMapping interface: there's no more need for the isIdentity and
  uiLineHasMapping methods.

R=dgozman
BUG=670180

Review-Url: https://codereview.chromium.org/2931773002
Cr-Commit-Position: refs/heads/master@{#478142}

[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-expected.txt
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
[modify] https://crrev.com/96693ab93867d6a24f3262d9cbb0df5cf102202b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js

Project Member

Comment 24 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31

commit 19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31
Author: lushnikov <lushnikov@chromium.org>
Date: Tue Jun 13 03:37:03 2017

DevTools: introduce ResourceMapping

This patch splits out ResourceMapping from NetworkProject.
ResourceMapping creates UISourceCodes for resources which are not
handled by CSS Mappings and JS Mappings, such as images, fonts and html
documents.

ResourceMapping is structured like this:
- class ResourceMapping provides uiLocation to rawLocation mapping
  for both CSSWorkspaceBinding and DebuggerWorkspaceBinding. ResourceMapping observes
  resourceTreeModels and creates ModelInfo for each.
- class ResourceMaping.ModelInfo is created per resourceTreeModel to
  manage model-associated UISourceCodes
- class ResourceMapping.Binding binds UISourceCode to multiple
  identical resources

IMPORTANT: The new ResourceMapping also merges UISourceCodes across
frames.

NOTE: Because there are inline scripts and inline styles, HTML UISourceCodes are
needed by both CSSWorkspaceBinding and DebuggerWorkspaceBinding to
implement rawLocationToUILocation / uiLocationToRawLocation methods. Both
CSSWorkspaceBinding and DebuggerWorkspaceBinding refer to ResourceMapping
for this reason.

R=dgozman
BUG=670180

Review-Url: https://codereview.chromium.org/2893073002
Cr-Commit-Position: refs/heads/master@{#478891}

[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-multiple-frames-expected.txt
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/contentscripts-bindings-multiple-frames-expected.txt
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames-expected.txt
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-bindings-expected.txt
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-navigate.html
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resources/resource-tree-frame-navigate-iframe-before.html
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/pause-in-removed-frame.html
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-panel.html
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/LayoutTests/inspector/sources/debugger/navigator-view.html
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/Source/devtools/BUILD.gn
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[add] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/Source/devtools/front_end/bindings/ResourceMapping.js
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/Source/devtools/front_end/bindings/module.json
[modify] https://crrev.com/19a7ba263cc0eff46ac4752bbd04e12bb4f3dc31/third_party/WebKit/Source/devtools/front_end/main/Main.js

Project Member

Comment 25 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c5b8d597dda99a31ae014519984d51c994f3f55d

commit c5b8d597dda99a31ae014519984d51c994f3f55d
Author: lushnikov <lushnikov@chromium.org>
Date: Tue Jun 13 21:57:29 2017

DevTools: make StyleSourceMapping in charge of managing UISourceCodes

This patch:
- move style-related UISourceCode management from NetworkProject into
  StylesSourceMapping
- create only a single UISourceCode per target for css header

As a result, all the headers are synced perfectly across shadow roots
and frames.

BUG= 671867 ,670180
R=dgozman

Review-Url: https://codereview.chromium.org/2893523002
Cr-Commit-Position: refs/heads/master@{#479168}

[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-multiple-frames-expected.txt
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-bindings-expected.txt
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-navigator-expected.txt
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames-expected.txt
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/suspendtarget-bindings-expected.txt
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-do-not-overwrite-css.html
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-resource-referred-by-multiple-styletags-expected.txt
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-resource-referred-by-multiple-styletags.html
[add] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/inspector/elements/styles-1/resources/frame.html
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-history.html
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
[modify] https://crrev.com/c5b8d597dda99a31ae014519984d51c994f3f55d/third_party/WebKit/Source/devtools/front_end/bindings/StylesSourceMapping.js

Project Member

Comment 27 by bugdroid1@chromium.org, Feb 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a6d24617851cac672cf1730c678fa0c27daf1122

commit a6d24617851cac672cf1730c678fa0c27daf1122
Author: Andrey Lushnikov <lushnikov@chromium.org>
Date: Tue Feb 13 08:20:22 2018

DevTools: move bindings logic from NetworkProject

This patch moves UISourceCode managements from NetworkProject
into ResourceScriptMapping.

This patch DOES NOT merge UISourceCodes between frames: this will
require more work to support LiveEdit in JSSF and BreakpointManager.

BUG=670180
R=dgozman

Change-Id: I5d1f1329a3f7aca0ed8f68d4d94a2519200db727
Reviewed-on: https://chromium-review.googlesource.com/910188
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536289}
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/LayoutTests/http/tests/devtools/extensions/extensions-resources.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/scripts-panel.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/scripts-sorting.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/scripts-with-same-source-url-expected.txt
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger/navigator-view.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger/network-uisourcecode-provider.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/Source/devtools/front_end/bindings/ContentProviderBasedProject.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/Source/devtools/front_end/main/Main.js
[modify] https://crrev.com/a6d24617851cac672cf1730c678fa0c27daf1122/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js

Sign in to add a comment