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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 resource.connectionReused = response.connectionReused; | 131 resource.connectionReused = response.connectionReused; |
132 resource.connectionId = response.connectionId; | 132 resource.connectionId = response.connectionId; |
133 | 133 |
134 if (response.fromDiskCache) | 134 if (response.fromDiskCache) |
135 resource.cached = true; | 135 resource.cached = true; |
136 else | 136 else |
137 resource.timing = response.timing; | 137 resource.timing = response.timing; |
138 | 138 |
139 if (!this._mimeTypeIsConsistentWithType(resource)) { | 139 if (!this._mimeTypeIsConsistentWithType(resource)) { |
140 WebInspector.console.addMessage(WebInspector.ConsoleMessage.create(W
ebInspector.ConsoleMessage.MessageSource.Other, | 140 WebInspector.console.addMessage(WebInspector.ConsoleMessage.create(W
ebInspector.ConsoleMessage.MessageSource.Network, |
141 WebInspector.ConsoleMessage.MessageLevel.Warning, | 141 WebInspector.ConsoleMessage.MessageLevel.Warning, |
142 WebInspector.UIString("Resource interpreted as %s but transferre
d with MIME type %s.", WebInspector.Resource.Type.toUIString(this.type), this.mi
meType), | 142 WebInspector.UIString("Resource interpreted as %s but transferre
d with MIME type %s: \"%s\".", WebInspector.Resource.Type.toUIString(resource.ty
pe), resource.mimeType, resource.url), |
143 WebInspector.ConsoleMessage.MessageType.Log, | 143 WebInspector.ConsoleMessage.MessageType.Log, |
144 this.url)); | 144 "", |
| 145 0, |
| 146 1, |
| 147 [], |
| 148 null, |
| 149 resource)); |
145 } | 150 } |
146 }, | 151 }, |
147 | 152 |
148 _mimeTypeIsConsistentWithType: function(resource) | 153 _mimeTypeIsConsistentWithType: function(resource) |
149 { | 154 { |
150 // If status is an error, content is likely to be of an inconsistent typ
e, | 155 // If status is an error, content is likely to be of an inconsistent typ
e, |
151 // as it's going to be an error message. We do not want to emit a warnin
g | 156 // as it's going to be an error message. We do not want to emit a warnin
g |
152 // for this, though, as this will already be reported as resource loadin
g failure. | 157 // for this, though, as this will already be reported as resource loadin
g failure. |
153 // Also, if a URL like http://localhost/wiki/load.php?debug=true&lang=en
produces text/css and gets reloaded, | 158 // Also, if a URL like http://localhost/wiki/load.php?debug=true&lang=en
produces text/css and gets reloaded, |
154 // it is 304 Not Modified and its guessed mime-type is text/php, which i
s wrong. | 159 // it is 304 Not Modified and its guessed mime-type is text/php, which i
s wrong. |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 resource.initiator = initiator; | 388 resource.initiator = initiator; |
384 resource.stackTrace = stackTrace; | 389 resource.stackTrace = stackTrace; |
385 return resource; | 390 return resource; |
386 } | 391 } |
387 } | 392 } |
388 | 393 |
389 /** | 394 /** |
390 * @type {?WebInspector.NetworkManager} | 395 * @type {?WebInspector.NetworkManager} |
391 */ | 396 */ |
392 WebInspector.networkManager = null; | 397 WebInspector.networkManager = null; |
OLD | NEW |