| Index: third_party/WebKit/Source/devtools/front_end/sdk/Resource.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js b/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js
|
| index 4db1ddc2a7f1040b27a84ea5231ff156ec6ea993..bc515f9acd80c5856d3b3fb23f6466d2a27d66bd 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js
|
| @@ -38,8 +38,10 @@
|
| * @param {!NetworkAgent.LoaderId} loaderId
|
| * @param {!WebInspector.ResourceType} type
|
| * @param {string} mimeType
|
| + * @param {?Date} lastModified
|
| + * @param {?number} contentSize
|
| */
|
| -WebInspector.Resource = function(target, request, url, documentURL, frameId, loaderId, type, mimeType)
|
| +WebInspector.Resource = function(target, request, url, documentURL, frameId, loaderId, type, mimeType, lastModified, contentSize)
|
| {
|
| WebInspector.SDKObject.call(this, target);
|
| this._request = request;
|
| @@ -50,6 +52,9 @@ WebInspector.Resource = function(target, request, url, documentURL, frameId, loa
|
| this._type = type || WebInspector.resourceTypes.Other;
|
| this._mimeType = mimeType;
|
|
|
| + this._lastModified = lastModified && lastModified.isValid() ? lastModified : null;
|
| + this._contentSize = contentSize;
|
| +
|
| /** @type {?string} */ this._content;
|
| /** @type {boolean} */ this._contentEncoded;
|
| this._pendingContentCallbacks = [];
|
| @@ -59,6 +64,29 @@ WebInspector.Resource = function(target, request, url, documentURL, frameId, loa
|
|
|
| WebInspector.Resource.prototype = {
|
| /**
|
| + * @return {?Date}
|
| + */
|
| + lastModified: function()
|
| + {
|
| + if (this._lastModified || !this._request)
|
| + return this._lastModified;
|
| + var lastModifiedHeader = this._request.responseLastModified();
|
| + var date = lastModifiedHeader ? new Date(lastModifiedHeader) : null;
|
| + this._lastModified = date && date.isValid() ? date : null;
|
| + return this._lastModified;
|
| + },
|
| +
|
| + /**
|
| + * @return {?number}
|
| + */
|
| + contentSize: function()
|
| + {
|
| + if (typeof this._contentSize === "number" || !this._request)
|
| + return this._contentSize;
|
| + return this._request.resourceSize;
|
| + },
|
| +
|
| + /**
|
| * @return {?WebInspector.NetworkRequest}
|
| */
|
| get request()
|
|
|