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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 return content; | 179 return content; |
180 }, | 180 }, |
181 | 181 |
182 __proto__: WebInspector.ContentProvider.prototype | 182 __proto__: WebInspector.ContentProvider.prototype |
183 } | 183 } |
184 | 184 |
185 /** | 185 /** |
186 * @constructor | 186 * @constructor |
187 * @param {string} sourceURL | 187 * @param {string} sourceURL |
| 188 * @param {WebInspector.ResourceType} contentType |
| 189 * @param {string} mimeType |
188 * @implements {WebInspector.ContentProvider} | 190 * @implements {WebInspector.ContentProvider} |
189 */ | 191 */ |
190 WebInspector.CompilerSourceMappingContentProvider = function(sourceURL, contentT
ype, mimeType) | 192 WebInspector.CompilerSourceMappingContentProvider = function(sourceURL, contentT
ype, mimeType) |
191 { | 193 { |
192 this._sourceURL = sourceURL; | 194 this._sourceURL = sourceURL; |
193 this._contentType = contentType; | 195 this._contentType = contentType; |
194 this._mimeType = mimeType; | 196 this._mimeType = mimeType; |
195 } | 197 } |
196 | 198 |
197 WebInspector.CompilerSourceMappingContentProvider.prototype = { | 199 WebInspector.CompilerSourceMappingContentProvider.prototype = { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 { | 318 { |
317 callback(WebInspector.ContentProvider.performSearchInContent(this._c
ontent, query, caseSensitive, isRegex)); | 319 callback(WebInspector.ContentProvider.performSearchInContent(this._c
ontent, query, caseSensitive, isRegex)); |
318 } | 320 } |
319 | 321 |
320 // searchInContent should call back later. | 322 // searchInContent should call back later. |
321 window.setTimeout(performSearch.bind(this), 0); | 323 window.setTimeout(performSearch.bind(this), 0); |
322 }, | 324 }, |
323 | 325 |
324 __proto__: WebInspector.ContentProvider.prototype | 326 __proto__: WebInspector.ContentProvider.prototype |
325 } | 327 } |
| 328 |
| 329 /** |
| 330 * @constructor |
| 331 * @implements {WebInspector.ContentProvider} |
| 332 * @param {WebInspector.ContentProvider} contentProvider |
| 333 * @param {string} mimeType |
| 334 */ |
| 335 WebInspector.ContentProviderOverridingMimeType = function(contentProvider, mimeT
ype) |
| 336 { |
| 337 this._contentProvider = contentProvider; |
| 338 this._mimeType = mimeType; |
| 339 } |
| 340 |
| 341 WebInspector.ContentProviderOverridingMimeType.prototype = { |
| 342 /** |
| 343 * @return {string} |
| 344 */ |
| 345 contentURL: function() |
| 346 { |
| 347 return this._contentProvider.contentURL(); |
| 348 }, |
| 349 |
| 350 /** |
| 351 * @return {WebInspector.ResourceType} |
| 352 */ |
| 353 contentType: function() |
| 354 { |
| 355 return this._contentProvider.contentType(); |
| 356 }, |
| 357 |
| 358 /** |
| 359 * @param {function(?string,boolean,string)} callback |
| 360 */ |
| 361 requestContent: function(callback) |
| 362 { |
| 363 this._contentProvider.requestContent(innerCallback.bind(this)); |
| 364 |
| 365 function innerCallback(content, contentEncoded, mimeType) |
| 366 { |
| 367 callback(content, contentEncoded, this._mimeType); |
| 368 } |
| 369 }, |
| 370 |
| 371 /** |
| 372 * @param {string} query |
| 373 * @param {boolean} caseSensitive |
| 374 * @param {boolean} isRegex |
| 375 * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callb
ack |
| 376 */ |
| 377 searchInContent: function(query, caseSensitive, isRegex, callback) |
| 378 { |
| 379 this._contentProvider.searchInContent(query, caseSensitive, isRegex, cal
lback); |
| 380 }, |
| 381 |
| 382 __proto__: WebInspector.ContentProvider.prototype |
| 383 } |
OLD | NEW |