| 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 20 matching lines...) Expand all Loading... |
| 31 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.RequestContentView} | 33 * @extends {WebInspector.RequestContentView} |
| 34 * @param {!WebInspector.NetworkRequest} request | 34 * @param {!WebInspector.NetworkRequest} request |
| 35 */ | 35 */ |
| 36 WebInspector.RequestResponseView = function(request) | 36 WebInspector.RequestResponseView = function(request) |
| 37 { | 37 { |
| 38 WebInspector.RequestContentView.call(this, request); | 38 WebInspector.RequestContentView.call(this, request); |
| 39 } | 39 } |
| 40 | 40 |
| 41 WebInspector.RequestResponseView._maxFormattedResourceSize = 100000; | |
| 42 | |
| 43 WebInspector.RequestResponseView.prototype = { | 41 WebInspector.RequestResponseView.prototype = { |
| 44 get sourceView() | 42 get sourceView() |
| 45 { | 43 { |
| 46 if (this._sourceView || !WebInspector.RequestView.hasTextContent(this.re
quest)) | 44 if (this._sourceView || !WebInspector.RequestView.hasTextContent(this.re
quest)) |
| 47 return this._sourceView; | 45 return this._sourceView; |
| 48 | 46 |
| 49 var contentProvider = new WebInspector.RequestResponseView.ContentProvid
er(this.request); | 47 var contentProvider = new WebInspector.RequestResponseView.ContentProvid
er(this.request); |
| 50 if (this.request.resourceSize >= WebInspector.RequestResponseView._maxFo
rmattedResourceSize) { | |
| 51 this._sourceView = new WebInspector.ResourceSourceFrameFallback(cont
entProvider); | |
| 52 return this._sourceView; | |
| 53 } | |
| 54 | |
| 55 var sourceFrame = new WebInspector.ResourceSourceFrame(contentProvider); | 48 var sourceFrame = new WebInspector.ResourceSourceFrame(contentProvider); |
| 56 sourceFrame.setHighlighterType(this.request.resourceType().canonicalMime
Type() || this.request.mimeType); | 49 sourceFrame.setHighlighterType(this.request.resourceType().canonicalMime
Type() || this.request.mimeType); |
| 57 this._sourceView = sourceFrame; | 50 this._sourceView = sourceFrame; |
| 58 return this._sourceView; | 51 return this._sourceView; |
| 59 }, | 52 }, |
| 60 | 53 |
| 61 /** | 54 /** |
| 62 * @param {string} message | 55 * @param {string} message |
| 63 * @return {!WebInspector.EmptyWidget} | 56 * @return {!WebInspector.EmptyWidget} |
| 64 */ | 57 */ |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 * @param {string} query | 140 * @param {string} query |
| 148 * @param {boolean} caseSensitive | 141 * @param {boolean} caseSensitive |
| 149 * @param {boolean} isRegex | 142 * @param {boolean} isRegex |
| 150 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal
lback | 143 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal
lback |
| 151 */ | 144 */ |
| 152 searchInContent: function(query, caseSensitive, isRegex, callback) | 145 searchInContent: function(query, caseSensitive, isRegex, callback) |
| 153 { | 146 { |
| 154 this._request.searchInContent(query, caseSensitive, isRegex, callback); | 147 this._request.searchInContent(query, caseSensitive, isRegex, callback); |
| 155 } | 148 } |
| 156 } | 149 } |
| OLD | NEW |