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

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

Issue 1564113003: DevTools: merge uisourcecode's url-alike members. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {!WebInspector.TargetManager} targetManager 7 * @param {!WebInspector.TargetManager} targetManager
8 * @param {!WebInspector.Workspace} workspace 8 * @param {!WebInspector.Workspace} workspace
9 * @param {!WebInspector.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding 9 * @param {!WebInspector.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding
10 * @param {!WebInspector.FileSystemMapping} fileSystemMapping 10 * @param {!WebInspector.FileSystemMapping} fileSystemMapping
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 }, 70 },
71 71
72 /** 72 /**
73 * @param {!WebInspector.UISourceCode} uiSourceCode 73 * @param {!WebInspector.UISourceCode} uiSourceCode
74 * @return {string} 74 * @return {string}
75 */ 75 */
76 networkURL: function(uiSourceCode) 76 networkURL: function(uiSourceCode)
77 { 77 {
78 if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSyst em) { 78 if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSyst em) {
79 var fileSystemPath = this._fileSystemWorkspaceBinding.fileSystemPath (uiSourceCode.project().id()); 79 var fileSystemPath = this._fileSystemWorkspaceBinding.fileSystemPath (uiSourceCode.project().id());
80 return this._urlForPath(fileSystemPath, uiSourceCode.path()); 80 return this._urlForPath(fileSystemPath, uiSourceCode.url());
dgozman 2016/01/08 20:22:06 Calling urlForPath with url parameter is strange.
81 } 81 }
82 return uiSourceCode.originURL(); 82 return uiSourceCode.url();
83 }, 83 },
84 84
85 /** 85 /**
86 * @param {string} url 86 * @param {string} url
87 * @return {boolean} 87 * @return {boolean}
88 */ 88 */
89 hasMappingForURL: function(url) 89 hasMappingForURL: function(url)
dgozman 2016/01/08 20:22:06 What about renaming some methods here to include n
90 { 90 {
91 return this._fileSystemMapping.hasMappingForURL(url); 91 return this._fileSystemMapping.hasMappingForURL(url);
92 }, 92 },
93 93
94 /** 94 /**
95 * @param {!WebInspector.Target} target 95 * @param {!WebInspector.Target} target
96 * @param {?WebInspector.ResourceTreeFrame} frame 96 * @param {?WebInspector.ResourceTreeFrame} frame
97 * @param {string} url 97 * @param {string} url
98 * @return {?WebInspector.UISourceCode} 98 * @return {?WebInspector.UISourceCode}
99 */ 99 */
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 var frame = WebInspector.ResourceTreeFrame.fromStyleSheet(header); 162 var frame = WebInspector.ResourceTreeFrame.fromStyleSheet(header);
163 return this._uiSourceCodeForURL(header.target(), frame, url); 163 return this._uiSourceCodeForURL(header.target(), frame, url);
164 }, 164 },
165 165
166 /** 166 /**
167 * @param {string} url 167 * @param {string} url
168 * @return {?WebInspector.UISourceCode} 168 * @return {?WebInspector.UISourceCode}
169 */ 169 */
170 uiSourceCodeForURLForAnyTarget: function(url) 170 uiSourceCodeForURLForAnyTarget: function(url)
171 { 171 {
172 return this._fileSystemUISourceCodeForURL(url) || WebInspector.workspace .uiSourceCodeForOriginURL(url); 172 return this._fileSystemUISourceCodeForURL(url) || WebInspector.workspace .uiSourceCodeForURL(url);
173 }, 173 },
174 174
175 /** 175 /**
176 * @param {string} fileSystemPath 176 * @param {string} fileSystemPath
177 * @param {string} filePath 177 * @param {string} filePath
178 * @return {string} 178 * @return {string}
179 */ 179 */
180 _urlForPath: function(fileSystemPath, filePath) 180 _urlForPath: function(fileSystemPath, filePath)
181 { 181 {
182 return this._fileSystemMapping.urlForPath(fileSystemPath, filePath); 182 return this._fileSystemMapping.urlForPath(fileSystemPath, filePath);
183 }, 183 },
184 184
185 /** 185 /**
186 * @param {!WebInspector.UISourceCode} networkUISourceCode 186 * @param {!WebInspector.UISourceCode} networkUISourceCode
187 * @param {!WebInspector.UISourceCode} uiSourceCode 187 * @param {!WebInspector.UISourceCode} uiSourceCode
188 */ 188 */
189 addMapping: function(networkUISourceCode, uiSourceCode) 189 addMapping: function(networkUISourceCode, uiSourceCode)
190 { 190 {
191 var url = this.networkURL(networkUISourceCode); 191 var url = this.networkURL(networkUISourceCode);
192 var path = uiSourceCode.path(); 192 var path = uiSourceCode.url();
193 var fileSystemPath = this._fileSystemWorkspaceBinding.fileSystemPath(uiS ourceCode.project().id()); 193 var fileSystemPath = this._fileSystemWorkspaceBinding.fileSystemPath(uiS ourceCode.project().id());
194 this._fileSystemMapping.addMappingForResource(url, fileSystemPath, path) ; 194 this._fileSystemMapping.addMappingForResource(url, fileSystemPath, path) ;
195 }, 195 },
196 196
197 /** 197 /**
198 * @param {!WebInspector.UISourceCode} uiSourceCode 198 * @param {!WebInspector.UISourceCode} uiSourceCode
199 */ 199 */
200 removeMapping: function(uiSourceCode) 200 removeMapping: function(uiSourceCode)
201 { 201 {
202 var networkURL = this.networkURL(uiSourceCode); 202 var networkURL = this.networkURL(uiSourceCode);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 this._fileSystemWorkspaceBinding.fileSystemManager().removeEventListener (WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved, this._fileSyst emRemoved, this); 252 this._fileSystemWorkspaceBinding.fileSystemManager().removeEventListener (WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved, this._fileSyst emRemoved, this);
253 this._fileSystemMapping.removeEventListener(WebInspector.FileSystemMappi ng.Events.FileMappingAdded, this._fileSystemMappingChanged, this); 253 this._fileSystemMapping.removeEventListener(WebInspector.FileSystemMappi ng.Events.FileMappingAdded, this._fileSystemMappingChanged, this);
254 this._fileSystemMapping.removeEventListener(WebInspector.FileSystemMappi ng.Events.FileMappingRemoved, this._fileSystemMappingChanged, this); 254 this._fileSystemMapping.removeEventListener(WebInspector.FileSystemMappi ng.Events.FileMappingRemoved, this._fileSystemMappingChanged, this);
255 } 255 }
256 } 256 }
257 257
258 /** 258 /**
259 * @type {!WebInspector.NetworkMapping} 259 * @type {!WebInspector.NetworkMapping}
260 */ 260 */
261 WebInspector.networkMapping; 261 WebInspector.networkMapping;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698