OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 networkRequest.connectionReused = response.connectionReused; | 201 networkRequest.connectionReused = response.connectionReused; |
202 networkRequest.connectionId = String(response.connectionId); | 202 networkRequest.connectionId = String(response.connectionId); |
203 if (response.remoteIPAddress) | 203 if (response.remoteIPAddress) |
204 networkRequest.setRemoteAddress(response.remoteIPAddress, response.r
emotePort || -1); | 204 networkRequest.setRemoteAddress(response.remoteIPAddress, response.r
emotePort || -1); |
205 | 205 |
206 if (response.fromServiceWorker) | 206 if (response.fromServiceWorker) |
207 networkRequest.fetchedViaServiceWorker = true; | 207 networkRequest.fetchedViaServiceWorker = true; |
208 | 208 |
209 if (response.fromDiskCache) | 209 if (response.fromDiskCache) |
210 networkRequest.cached = true; | 210 networkRequest.setFromDiskCache(); |
211 else | 211 networkRequest.timing = response.timing; |
212 networkRequest.timing = response.timing; | |
213 | 212 |
214 if (!this._mimeTypeIsConsistentWithType(networkRequest)) { | 213 if (!this._mimeTypeIsConsistentWithType(networkRequest)) { |
215 var consoleModel = this._manager._target.consoleModel; | 214 var consoleModel = this._manager._target.consoleModel; |
216 consoleModel.addMessage(new WebInspector.ConsoleMessage(consoleModel
.target(), WebInspector.ConsoleMessage.MessageSource.Network, | 215 consoleModel.addMessage(new WebInspector.ConsoleMessage(consoleModel
.target(), WebInspector.ConsoleMessage.MessageSource.Network, |
217 WebInspector.ConsoleMessage.MessageLevel.Log, | 216 WebInspector.ConsoleMessage.MessageLevel.Log, |
218 WebInspector.UIString("Resource interpreted as %s but transferre
d with MIME type %s: \"%s\".", networkRequest.type.title(), networkRequest.mimeT
ype, networkRequest.url), | 217 WebInspector.UIString("Resource interpreted as %s but transferre
d with MIME type %s: \"%s\".", networkRequest.type.title(), networkRequest.mimeT
ype, networkRequest.url), |
219 WebInspector.ConsoleMessage.MessageType.Log, | 218 WebInspector.ConsoleMessage.MessageType.Log, |
220 "", | 219 "", |
221 0, | 220 0, |
222 0, | 221 0, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 284 |
286 /** | 285 /** |
287 * @param {!NetworkAgent.RequestId} requestId | 286 * @param {!NetworkAgent.RequestId} requestId |
288 */ | 287 */ |
289 requestServedFromCache: function(requestId) | 288 requestServedFromCache: function(requestId) |
290 { | 289 { |
291 var networkRequest = this._inflightRequestsById[requestId]; | 290 var networkRequest = this._inflightRequestsById[requestId]; |
292 if (!networkRequest) | 291 if (!networkRequest) |
293 return; | 292 return; |
294 | 293 |
295 networkRequest.cached = true; | 294 networkRequest.setFromMemoryCache(); |
296 }, | 295 }, |
297 | 296 |
298 /** | 297 /** |
299 * @param {!NetworkAgent.RequestId} requestId | 298 * @param {!NetworkAgent.RequestId} requestId |
300 * @param {!PageAgent.FrameId} frameId | 299 * @param {!PageAgent.FrameId} frameId |
301 * @param {!NetworkAgent.LoaderId} loaderId | 300 * @param {!NetworkAgent.LoaderId} loaderId |
302 * @param {!NetworkAgent.Timestamp} time | 301 * @param {!NetworkAgent.Timestamp} time |
303 * @param {!PageAgent.ResourceType} resourceType | 302 * @param {!PageAgent.ResourceType} resourceType |
304 * @param {!NetworkAgent.Response} response | 303 * @param {!NetworkAgent.Response} response |
305 */ | 304 */ |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 * @param {!NetworkAgent.LoaderId} loaderId | 565 * @param {!NetworkAgent.LoaderId} loaderId |
567 * @param {string} url | 566 * @param {string} url |
568 * @param {string} documentURL | 567 * @param {string} documentURL |
569 * @param {?NetworkAgent.Initiator} initiator | 568 * @param {?NetworkAgent.Initiator} initiator |
570 */ | 569 */ |
571 _createNetworkRequest: function(requestId, frameId, loaderId, url, documentU
RL, initiator) | 570 _createNetworkRequest: function(requestId, frameId, loaderId, url, documentU
RL, initiator) |
572 { | 571 { |
573 return new WebInspector.NetworkRequest(this._manager._target, requestId,
url, documentURL, frameId, loaderId, initiator); | 572 return new WebInspector.NetworkRequest(this._manager._target, requestId,
url, documentURL, frameId, loaderId, initiator); |
574 } | 573 } |
575 } | 574 } |
OLD | NEW |