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

Side by Side Diff: Source/devtools/front_end/sdk/Resource.js

Issue 356033002: DevTools: Get rid of WebInspector.debuggerModel in NetworkUISourceCodeProvider (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address vsevik's comments Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 10 matching lines...) Expand all
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 /** 29 /**
30 * @constructor 30 * @constructor
31 * @extends {WebInspector.Object} 31 * @extends {WebInspector.TargetAwareObject}
32 * @implements {WebInspector.ContentProvider} 32 * @implements {WebInspector.ContentProvider}
33 * @param {!WebInspector.Target} target
33 * @param {?WebInspector.NetworkRequest} request 34 * @param {?WebInspector.NetworkRequest} request
34 * @param {string} url 35 * @param {string} url
35 * @param {string} documentURL 36 * @param {string} documentURL
36 * @param {!PageAgent.FrameId} frameId 37 * @param {!PageAgent.FrameId} frameId
37 * @param {!NetworkAgent.LoaderId} loaderId 38 * @param {!NetworkAgent.LoaderId} loaderId
38 * @param {!WebInspector.ResourceType} type 39 * @param {!WebInspector.ResourceType} type
39 * @param {string} mimeType 40 * @param {string} mimeType
40 * @param {boolean=} isHidden 41 * @param {boolean=} isHidden
41 */ 42 */
42 WebInspector.Resource = function(request, url, documentURL, frameId, loaderId, t ype, mimeType, isHidden) 43 WebInspector.Resource = function(target, request, url, documentURL, frameId, loa derId, type, mimeType, isHidden)
43 { 44 {
45 WebInspector.TargetAwareObject.call(this, target);
44 this._request = request; 46 this._request = request;
45 this.url = url; 47 this.url = url;
46 this._documentURL = documentURL; 48 this._documentURL = documentURL;
47 this._frameId = frameId; 49 this._frameId = frameId;
48 this._loaderId = loaderId; 50 this._loaderId = loaderId;
49 this._type = type || WebInspector.resourceTypes.Other; 51 this._type = type || WebInspector.resourceTypes.Other;
50 this._mimeType = mimeType; 52 this._mimeType = mimeType;
51 this._isHidden = isHidden; 53 this._isHidden = isHidden;
52 54
53 /** @type {?string} */ this._content; 55 /** @type {?string} */ this._content;
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 { 267 {
266 callback(searchMatches || []); 268 callback(searchMatches || []);
267 } 269 }
268 270
269 if (this.type === WebInspector.resourceTypes.Document) { 271 if (this.type === WebInspector.resourceTypes.Document) {
270 callback([]); 272 callback([]);
271 return; 273 return;
272 } 274 }
273 275
274 if (this.frameId) 276 if (this.frameId)
275 PageAgent.searchInResource(this.frameId, this.url, query, caseSensit ive, isRegex, callbackWrapper); 277 this.target().pageAgent().searchInResource(this.frameId, this.url, q uery, caseSensitive, isRegex, callbackWrapper);
276 else 278 else
277 callback([]); 279 callback([]);
278 }, 280 },
279 281
280 /** 282 /**
281 * @param {!Element} image 283 * @param {!Element} image
282 */ 284 */
283 populateImageSource: function(image) 285 populateImageSource: function(image)
284 { 286 {
285 /** 287 /**
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 362
361 /** 363 /**
362 * @param {?string} content 364 * @param {?string} content
363 * @this {WebInspector.Resource} 365 * @this {WebInspector.Resource}
364 */ 366 */
365 function requestContentLoaded(content) 367 function requestContentLoaded(content)
366 { 368 {
367 contentLoaded.call(this, null, content, this.request.contentEncoded) ; 369 contentLoaded.call(this, null, content, this.request.contentEncoded) ;
368 } 370 }
369 371
370 PageAgent.getResourceContent(this.frameId, this.url, resourceContentLoad ed.bind(this)); 372 this.target().pageAgent().getResourceContent(this.frameId, this.url, res ourceContentLoaded.bind(this));
371 }, 373 },
372 374
373 /** 375 /**
374 * @return {boolean} 376 * @return {boolean}
375 */ 377 */
376 isHidden: function() 378 isHidden: function()
377 { 379 {
378 return !!this._isHidden; 380 return !!this._isHidden;
379 }, 381 },
380 382
381 __proto__: WebInspector.Object.prototype 383 __proto__: WebInspector.TargetAwareObject.prototype
382 } 384 }
383 385
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/NetworkUISourceCodeProvider.js ('k') | Source/devtools/front_end/sdk/ResourceTreeModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698