Changeset 71254 in webkit
- Timestamp:
- Nov 3, 2010 11:38:18 AM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r71253 r71254 1 2010-11-03 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Simon Fraser. 4 5 Web Inspector: show proper image size for cached resources. 6 https://bugs.webkit.org/show_bug.cgi?id=48915 7 8 * inspector/front-end/ExtensionServer.js: 9 (WebInspector.ExtensionServer.prototype._onGetResourceContent): 10 * inspector/front-end/ImageView.js: 11 (WebInspector.ImageView.prototype.contentTabSelected.onImageLoad): 12 (WebInspector.ImageView.prototype.contentTabSelected): 13 (WebInspector.ImageView.prototype._base64ToSize): 14 * inspector/front-end/NetworkPanel.js: 15 (WebInspector.NetworkDataGridNode.prototype._refreshNameCell): 16 * inspector/front-end/Resource.js: 17 (WebInspector.Resource.prototype.set finished): 18 (WebInspector.Resource.prototype.get content): 19 (WebInspector.Resource.prototype.requestContent): 20 (WebInspector.Resource.prototype._innerRequestContent): 21 * inspector/front-end/ResourceManager.js: 22 (WebInspector.ResourceManager.requestContent): 23 * inspector/front-end/SourceView.js: 24 (WebInspector.SourceView.prototype.setupSourceFrameIfNeeded): 25 1 26 2010-11-03 Noam Rosenthal <noam.rosenthal@nokia.com> 2 27 -
trunk/WebCore/inspector/front-end/ExtensionServer.js
r71107 r71254 333 333 response.push(this._status.E_NOTFOUND(id)); 334 334 else 335 resource. getContent(onContentAvailable.bind(this, id));335 resource.requestContent(onContentAvailable.bind(this, id)); 336 336 } 337 337 if (response.length === ids.length) -
trunk/WebCore/inspector/front-end/ImageView.js
r71133 r71254 68 68 imagePreviewElement.setAttribute("src", this.resource.contentURL); 69 69 } 70 this.resource. getContent(onResourceContent.bind(this));70 this.resource.requestContent(onResourceContent.bind(this)); 71 71 72 72 73 73 function onImageLoad() 74 74 { 75 var content = this.resource.content; 76 if (content) 77 var resourceSize = this._base64ToSize(content); 78 else 79 var resourceSize = this.resource.resourceSize; 80 75 81 var imageProperties = [ 76 { name: WebInspector.UIString("Dimensions"), value: WebInspector.UIString("%d × %d", imagePreviewElement.naturalWidth, imagePreviewElement. height) },77 { name: WebInspector.UIString("File size"), value: Number.bytesToString( this.resource.resourceSize, WebInspector.UIString) },82 { name: WebInspector.UIString("Dimensions"), value: WebInspector.UIString("%d × %d", imagePreviewElement.naturalWidth, imagePreviewElement.naturalHeight) }, 83 { name: WebInspector.UIString("File size"), value: Number.bytesToString(resourceSize, WebInspector.UIString) }, 78 84 { name: WebInspector.UIString("MIME type"), value: this.resource.mimeType } 79 85 ]; … … 91 97 } 92 98 imagePreviewElement.addEventListener("load", onImageLoad.bind(this), false); 99 }, 100 101 _base64ToSize: function(content) 102 { 103 if (!content.length) 104 return 0; 105 var size = (content.length || 0) * 3 / 4; 106 if (content.length > 0 && content[content.length - 1] === "=") 107 size--; 108 if (content.length > 1 && content[content.length - 2] === "=") 109 size--; 110 return size; 93 111 } 94 112 } -
trunk/WebCore/inspector/front-end/NetworkPanel.js
r71109 r71254 1483 1483 } 1484 1484 if (Preferences.useDataURLForResourceImageIcons) 1485 this._resource. getContent(onResourceContent.bind(this));1485 this._resource.requestContent(onResourceContent.bind(this)); 1486 1486 else 1487 1487 previewImage.src = this._resource.url; -
trunk/WebCore/inspector/front-end/Resource.js
r71136 r71254 256 256 this.dispatchEventToListeners("finished"); 257 257 if (this._pendingContentCallbacks.length) 258 this._ requestContent();258 this._innerRequestContent(); 259 259 } 260 260 }, … … 617 617 }, 618 618 619 get content() 620 { 621 return this._content; 622 }, 623 619 624 set content(content) 620 625 { … … 622 627 }, 623 628 624 getContent: function(callback)629 requestContent: function(callback) 625 630 { 626 631 if (this._content) { … … 630 635 this._pendingContentCallbacks.push(callback); 631 636 if (this.finished) 632 this._ requestContent();637 this._innerRequestContent(); 633 638 }, 634 639 … … 643 648 }, 644 649 645 _ requestContent: function()650 _innerRequestContent: function() 646 651 { 647 652 if (this._contentRequested) … … 659 664 delete this._contentRequested; 660 665 } 661 WebInspector.ResourceManager. getContent(this, this._contentEncoded, onResourceContent.bind(this));666 WebInspector.ResourceManager.requestContent(this, this._contentEncoded, onResourceContent.bind(this)); 662 667 } 663 668 } -
trunk/WebCore/inspector/front-end/ResourceManager.js
r71144 r71254 470 470 } 471 471 472 WebInspector.ResourceManager. getContent = function(resource, base64Encode, callback)472 WebInspector.ResourceManager.requestContent = function(resource, base64Encode, callback) 473 473 { 474 474 InspectorBackend.resourceContent(resource.loader.frameId, resource.url, base64Encode, callback); -
trunk/WebCore/inspector/front-end/SourceView.js
r70529 r71254 85 85 86 86 delete this._frameNeedsSetup; 87 this.resource. getContent(this._contentLoaded.bind(this));87 this.resource.requestContent(this._contentLoaded.bind(this)); 88 88 }, 89 89
Note: See TracChangeset
for help on using the changeset viewer.