Chromium Code Reviews| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 554 */ | 554 */ |
| 555 _getResourceContent: function(contentProvider, message, port) | 555 _getResourceContent: function(contentProvider, message, port) |
| 556 { | 556 { |
| 557 /** | 557 /** |
| 558 * @param {?string} content | 558 * @param {?string} content |
| 559 * @this {WebInspector.ExtensionServer} | 559 * @this {WebInspector.ExtensionServer} |
| 560 */ | 560 */ |
| 561 function onContentAvailable(content) | 561 function onContentAvailable(content) |
| 562 { | 562 { |
| 563 var response = { | 563 var response = { |
| 564 encoding: (content === null) || contentProvider.contentType().is TextType() ? "" : "base64", | 564 encoding: content && contentProvider.contentEncoded ? "base64" : "", |
| 565 content: content | 565 content: content |
| 566 }; | 566 }; |
| 567 this._dispatchCallback(message.requestId, port, response); | 567 this._dispatchCallback(message.requestId, port, response); |
| 568 } | 568 } |
| 569 | 569 |
| 570 contentProvider.requestContent(onContentAvailable.bind(this)); | 570 contentProvider.requestContent(onContentAvailable.bind(this)); |
|
vsevik
2014/10/24 05:58:19
Resource here could actually be a UISourceCode, so
eustas
2014/10/24 11:15:57
Done.
| |
| 571 }, | 571 }, |
| 572 | 572 |
| 573 _onGetRequestContent: function(message, port) | 573 _onGetRequestContent: function(message, port) |
| 574 { | 574 { |
| 575 var request = this._requestById(message.id); | 575 var request = this._requestById(message.id); |
| 576 if (!request) | 576 if (!request) |
| 577 return this._status.E_NOTFOUND(message.id); | 577 return this._status.E_NOTFOUND(message.id); |
| 578 this._getResourceContent(request, message, port); | 578 this._getResourceContent(request, message, port); |
| 579 }, | 579 }, |
| 580 | 580 |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1104 { | 1104 { |
| 1105 if (WebInspector.extensionServer._overridePlatformExtensionAPIForTest) | 1105 if (WebInspector.extensionServer._overridePlatformExtensionAPIForTest) |
| 1106 window.buildPlatformExtensionAPI = WebInspector.extensionServer._overrid ePlatformExtensionAPIForTest; | 1106 window.buildPlatformExtensionAPI = WebInspector.extensionServer._overrid ePlatformExtensionAPIForTest; |
| 1107 WebInspector.extensionServer._addExtensions(extensions); | 1107 WebInspector.extensionServer._addExtensions(extensions); |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 WebInspector.setInspectedTabId = function(tabId) | 1110 WebInspector.setInspectedTabId = function(tabId) |
| 1111 { | 1111 { |
| 1112 WebInspector._inspectedTabId = tabId; | 1112 WebInspector._inspectedTabId = tabId; |
| 1113 } | 1113 } |
| OLD | NEW |