| OLD | NEW |
| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 case WebInspector.Resource.Type.XHR: | 334 case WebInspector.Resource.Type.XHR: |
| 335 this.category = WebInspector.resourceCategories.xhr; | 335 this.category = WebInspector.resourceCategories.xhr; |
| 336 break; | 336 break; |
| 337 case WebInspector.Resource.Type.Other: | 337 case WebInspector.Resource.Type.Other: |
| 338 default: | 338 default: |
| 339 this.category = WebInspector.resourceCategories.other; | 339 this.category = WebInspector.resourceCategories.other; |
| 340 break; | 340 break; |
| 341 } | 341 } |
| 342 }, | 342 }, |
| 343 | 343 |
| 344 get documentNode() { | |
| 345 if ("identifier" in this) | |
| 346 return InspectorController.getResourceDocumentNode(this.identifier); | |
| 347 return null; | |
| 348 }, | |
| 349 | |
| 350 get requestHeaders() | 344 get requestHeaders() |
| 351 { | 345 { |
| 352 if (this._requestHeaders === undefined) | 346 if (this._requestHeaders === undefined) |
| 353 this._requestHeaders = {}; | 347 this._requestHeaders = {}; |
| 354 return this._requestHeaders; | 348 return this._requestHeaders; |
| 355 }, | 349 }, |
| 356 | 350 |
| 357 set requestHeaders(x) | 351 set requestHeaders(x) |
| 358 { | 352 { |
| 359 if (this._requestHeaders === x) | 353 if (this._requestHeaders === x) |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 { | 476 { |
| 483 if (tip.id in this.tips) | 477 if (tip.id in this.tips) |
| 484 return; | 478 return; |
| 485 | 479 |
| 486 this.tips[tip.id] = tip; | 480 this.tips[tip.id] = tip; |
| 487 | 481 |
| 488 // FIXME: Re-enable this code once we have a scope bar in the Console. | 482 // FIXME: Re-enable this code once we have a scope bar in the Console. |
| 489 // Otherwise, we flood the Console with too many tips. | 483 // Otherwise, we flood the Console with too many tips. |
| 490 /* | 484 /* |
| 491 var msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.Me
ssageSource.Other, | 485 var msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.Me
ssageSource.Other, |
| 492 WebInspector.ConsoleMessage.MessageLevel.Tip, -1, this.url, null, 1,
tip.message); | 486 WebInspector.ConsoleMessage.MessageType.Log, WebInspector.ConsoleMes
sage.MessageLevel.Tip, |
| 487 -1, this.url, null, 1, tip.message); |
| 493 WebInspector.console.addMessage(msg); | 488 WebInspector.console.addMessage(msg); |
| 494 */ | 489 */ |
| 495 }, | 490 }, |
| 496 | 491 |
| 497 _checkTips: function() | 492 _checkTips: function() |
| 498 { | 493 { |
| 499 for (var tip in WebInspector.Tips) | 494 for (var tip in WebInspector.Tips) |
| 500 this._checkTip(WebInspector.Tips[tip]); | 495 this._checkTip(WebInspector.Tips[tip]); |
| 501 }, | 496 }, |
| 502 | 497 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 }, | 531 }, |
| 537 | 532 |
| 538 _checkWarnings: function() | 533 _checkWarnings: function() |
| 539 { | 534 { |
| 540 for (var warning in WebInspector.Warnings) | 535 for (var warning in WebInspector.Warnings) |
| 541 this._checkWarning(WebInspector.Warnings[warning]); | 536 this._checkWarning(WebInspector.Warnings[warning]); |
| 542 }, | 537 }, |
| 543 | 538 |
| 544 _checkWarning: function(warning) | 539 _checkWarning: function(warning) |
| 545 { | 540 { |
| 546 var addWarning = false; | |
| 547 var msg; | 541 var msg; |
| 548 switch (warning.id) { | 542 switch (warning.id) { |
| 549 case WebInspector.Warnings.IncorrectMIMEType.id: | 543 case WebInspector.Warnings.IncorrectMIMEType.id: |
| 550 if (!this._mimeTypeIsConsistentWithType()) | 544 if (!this._mimeTypeIsConsistentWithType()) |
| 551 msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMe
ssage.MessageSource.Other, | 545 msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMe
ssage.MessageSource.Other, |
| 546 WebInspector.ConsoleMessage.MessageType.Log, |
| 552 WebInspector.ConsoleMessage.MessageLevel.Warning, -1, th
is.url, null, 1, | 547 WebInspector.ConsoleMessage.MessageLevel.Warning, -1, th
is.url, null, 1, |
| 553 String.sprintf(WebInspector.Warnings.IncorrectMIMEType.m
essage, | 548 String.sprintf(WebInspector.Warnings.IncorrectMIMEType.m
essage, |
| 554 WebInspector.Resource.Type.toString(this.type), this.mim
eType)); | 549 WebInspector.Resource.Type.toString(this.type), this.mim
eType)); |
| 555 break; | 550 break; |
| 556 } | 551 } |
| 557 | 552 |
| 558 if (msg) | 553 if (msg) |
| 559 WebInspector.console.addMessage(msg); | 554 WebInspector.console.addMessage(msg); |
| 560 } | 555 } |
| 561 } | 556 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 } | 611 } |
| 617 | 612 |
| 618 WebInspector.Resource.CompareBySize = function(a, b) | 613 WebInspector.Resource.CompareBySize = function(a, b) |
| 619 { | 614 { |
| 620 if (a.contentLength < b.contentLength) | 615 if (a.contentLength < b.contentLength) |
| 621 return -1; | 616 return -1; |
| 622 if (a.contentLength > b.contentLength) | 617 if (a.contentLength > b.contentLength) |
| 623 return 1; | 618 return 1; |
| 624 return 0; | 619 return 0; |
| 625 } | 620 } |
| OLD | NEW |