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

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

Issue 1564113003: DevTools: merge uisourcecode's url-alike members. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 WebInspector.ContentProviderBasedProject.prototype = { 48 WebInspector.ContentProviderBasedProject.prototype = {
49 /** 49 /**
50 * @override 50 * @override
51 * @param {!WebInspector.UISourceCode} uiSourceCode 51 * @param {!WebInspector.UISourceCode} uiSourceCode
52 * @param {function(?string)} callback 52 * @param {function(?string)} callback
53 */ 53 */
54 requestFileContent: function(uiSourceCode, callback) 54 requestFileContent: function(uiSourceCode, callback)
55 { 55 {
56 var contentProvider = this._contentProviders[uiSourceCode.path()]; 56 var contentProvider = this._contentProviders[uiSourceCode.url()];
57 contentProvider.requestContent(callback); 57 contentProvider.requestContent(callback);
58 58
59 /** 59 /**
60 * @param {?string} content 60 * @param {?string} content
61 * @param {boolean} encoded 61 * @param {boolean} encoded
62 * @param {string} mimeType 62 * @param {string} mimeType
63 */ 63 */
64 function innerCallback(content, encoded, mimeType) 64 function innerCallback(content, encoded, mimeType)
65 { 65 {
66 callback(content); 66 callback(content);
(...skipping 30 matching lines...) Expand all
97 }, 97 },
98 98
99 /** 99 /**
100 * @override 100 * @override
101 * @param {!WebInspector.UISourceCode} uiSourceCode 101 * @param {!WebInspector.UISourceCode} uiSourceCode
102 * @param {string} newName 102 * @param {string} newName
103 * @param {function(boolean, string=, string=, !WebInspector.ResourceType=)} callback 103 * @param {function(boolean, string=, string=, !WebInspector.ResourceType=)} callback
104 */ 104 */
105 rename: function(uiSourceCode, newName, callback) 105 rename: function(uiSourceCode, newName, callback)
106 { 106 {
107 var path = uiSourceCode.path(); 107 var path = uiSourceCode.url();
108 this.performRename(path, newName, innerCallback.bind(this)); 108 this.performRename(path, newName, innerCallback.bind(this));
109 109
110 /** 110 /**
111 * @param {boolean} success 111 * @param {boolean} success
112 * @param {string=} newName 112 * @param {string=} newName
113 * @this {WebInspector.ContentProviderBasedProject} 113 * @this {WebInspector.ContentProviderBasedProject}
114 */ 114 */
115 function innerCallback(success, newName) 115 function innerCallback(success, newName)
116 { 116 {
117 if (success && newName) { 117 if (success && newName) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 /** 184 /**
185 * @override 185 * @override
186 * @param {!WebInspector.UISourceCode} uiSourceCode 186 * @param {!WebInspector.UISourceCode} uiSourceCode
187 * @param {string} query 187 * @param {string} query
188 * @param {boolean} caseSensitive 188 * @param {boolean} caseSensitive
189 * @param {boolean} isRegex 189 * @param {boolean} isRegex
190 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal lback 190 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal lback
191 */ 191 */
192 searchInFileContent: function(uiSourceCode, query, caseSensitive, isRegex, c allback) 192 searchInFileContent: function(uiSourceCode, query, caseSensitive, isRegex, c allback)
193 { 193 {
194 var contentProvider = this._contentProviders[uiSourceCode.path()]; 194 var contentProvider = this._contentProviders[uiSourceCode.url()];
195 contentProvider.searchInContent(query, caseSensitive, isRegex, callback) ; 195 contentProvider.searchInContent(query, caseSensitive, isRegex, callback) ;
196 }, 196 },
197 197
198 /** 198 /**
199 * @override 199 * @override
200 * @param {!WebInspector.ProjectSearchConfig} searchConfig 200 * @param {!WebInspector.ProjectSearchConfig} searchConfig
201 * @param {!Array.<string>} filesMathingFileQuery 201 * @param {!Array.<string>} filesMathingFileQuery
202 * @param {!WebInspector.Progress} progress 202 * @param {!WebInspector.Progress} progress
203 * @param {function(!Array.<string>)} callback 203 * @param {function(!Array.<string>)} callback
204 */ 204 */
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 { 282 {
283 setImmediate(progress.done.bind(progress)); 283 setImmediate(progress.done.bind(progress));
284 }, 284 },
285 285
286 /** 286 /**
287 * @param {!WebInspector.UISourceCode} uiSourceCode 287 * @param {!WebInspector.UISourceCode} uiSourceCode
288 * @param {!WebInspector.ContentProvider} contentProvider 288 * @param {!WebInspector.ContentProvider} contentProvider
289 */ 289 */
290 addUISourceCodeWithProvider: function(uiSourceCode, contentProvider) 290 addUISourceCodeWithProvider: function(uiSourceCode, contentProvider)
291 { 291 {
292 this._contentProviders[uiSourceCode.path()] = contentProvider; 292 this._contentProviders[uiSourceCode.url()] = contentProvider;
293 this.addUISourceCode(uiSourceCode, true); 293 this.addUISourceCode(uiSourceCode, true);
294 }, 294 },
295 295
296 /** 296 /**
297 * @param {string} url 297 * @param {string} url
298 * @param {!WebInspector.ContentProvider} contentProvider 298 * @param {!WebInspector.ContentProvider} contentProvider
299 * @return {!WebInspector.UISourceCode} 299 * @return {!WebInspector.UISourceCode}
300 */ 300 */
301 addContentProvider: function(url, contentProvider) 301 addContentProvider: function(url, contentProvider)
302 { 302 {
(...skipping 19 matching lines...) Expand all
322 }, 322 },
323 323
324 dispose: function() 324 dispose: function()
325 { 325 {
326 this._contentProviders = {}; 326 this._contentProviders = {};
327 this.removeProject(); 327 this.removeProject();
328 }, 328 },
329 329
330 __proto__: WebInspector.ProjectStore.prototype 330 __proto__: WebInspector.ProjectStore.prototype
331 } 331 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698