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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js

Issue 2501883002: DevTools: kill Bindings.NetworkMapping (Closed)
Patch Set: rebaseline Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 /**
5 * @unrestricted
6 */
7 Bindings.NetworkMapping = class {
8 /**
9 * @param {!Workspace.Workspace} workspace
10 */
11 constructor(workspace) {
12 this._workspace = workspace;
13 }
14
15 /**
16 * @param {!SDK.Target} target
17 * @param {?SDK.ResourceTreeFrame} frame
18 * @param {string} url
19 * @return {?Workspace.UISourceCode}
20 */
21 _networkUISourceCodeForURL(target, frame, url) {
22 return this._workspace.uiSourceCode(Bindings.NetworkProject.projectId(target , frame, false), url);
23 }
24
25 /**
26 * @param {!SDK.Target} target
27 * @param {?SDK.ResourceTreeFrame} frame
28 * @param {string} url
29 * @return {?Workspace.UISourceCode}
30 */
31 _contentScriptUISourceCodeForURL(target, frame, url) {
32 return this._workspace.uiSourceCode(Bindings.NetworkProject.projectId(target , frame, true), url);
33 }
34
35 /**
36 * @param {!SDK.Target} target
37 * @param {?SDK.ResourceTreeFrame} frame
38 * @param {string} url
39 * @return {?Workspace.UISourceCode}
40 */
41 _uiSourceCodeForURL(target, frame, url) {
42 return this._networkUISourceCodeForURL(target, frame, url) ||
43 this._contentScriptUISourceCodeForURL(target, frame, url);
44 }
45
46 /**
47 * @param {string} url
48 * @param {!SDK.Script} script
49 * @return {?Workspace.UISourceCode}
50 */
51 uiSourceCodeForScriptURL(url, script) {
52 var frame = SDK.ResourceTreeFrame.fromScript(script);
53 return this._uiSourceCodeForURL(script.target(), frame, url);
54 }
55
56 /**
57 * @param {string} url
58 * @param {!SDK.CSSStyleSheetHeader} header
59 * @return {?Workspace.UISourceCode}
60 */
61 uiSourceCodeForStyleURL(url, header) {
62 var frame = SDK.ResourceTreeFrame.fromStyleSheet(header);
63 return this._uiSourceCodeForURL(header.target(), frame, url);
64 }
65
66 /**
67 * @param {string} url
68 * @return {?Workspace.UISourceCode}
69 */
70 uiSourceCodeForURLForAnyTarget(url) {
71 return Workspace.workspace.uiSourceCodeForURL(url);
72 }
73 };
74
75 /**
76 * @type {!Bindings.NetworkMapping}
77 */
78 Bindings.networkMapping;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698