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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 *result = ""; | 272 *result = ""; |
273 return true; | 273 return true; |
274 } | 274 } |
275 | 275 |
276 if (cachedResource) { | 276 if (cachedResource) { |
277 switch (cachedResource->type()) { | 277 switch (cachedResource->type()) { |
278 case Resource::CSSStyleSheet: | 278 case Resource::CSSStyleSheet: |
279 *result = toCSSStyleSheetResource(cachedResource)->sheetText(false); | 279 *result = toCSSStyleSheetResource(cachedResource)->sheetText(false); |
280 return true; | 280 return true; |
281 case Resource::Script: | 281 case Resource::Script: |
282 *result = toScriptResource(cachedResource)->script(); | 282 *result = cachedResource->resourceBuffer() ? toScriptResource(cached
Resource)->decodedText() : toScriptResource(cachedResource)->script(); |
283 return true; | 283 return true; |
284 case Resource::Raw: { | 284 case Resource::Raw: { |
285 SharedBuffer* buffer = cachedResource->resourceBuffer(); | 285 SharedBuffer* buffer = cachedResource->resourceBuffer(); |
286 if (!buffer) | 286 if (!buffer) |
287 return false; | 287 return false; |
288 OwnPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedRes
ource->response().mimeType(), cachedResource->response().textEncodingName()); | 288 OwnPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedRes
ource->response().mimeType(), cachedResource->response().textEncodingName()); |
289 String content = decoder->decode(buffer->data(), buffer->size()); | 289 String content = decoder->decode(buffer->data(), buffer->size()); |
290 *result = content + decoder->flush(); | 290 *result = content + decoder->flush(); |
291 return true; | 291 return true; |
292 } | 292 } |
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 void InspectorPageAgent::trace(Visitor* visitor) | 1486 void InspectorPageAgent::trace(Visitor* visitor) |
1487 { | 1487 { |
1488 visitor->trace(m_page); | 1488 visitor->trace(m_page); |
1489 visitor->trace(m_injectedScriptManager); | 1489 visitor->trace(m_injectedScriptManager); |
1490 visitor->trace(m_inspectorResourceContentLoader); | 1490 visitor->trace(m_inspectorResourceContentLoader); |
1491 InspectorBaseAgent::trace(visitor); | 1491 InspectorBaseAgent::trace(visitor); |
1492 } | 1492 } |
1493 | 1493 |
1494 } // namespace blink | 1494 } // namespace blink |
1495 | 1495 |
OLD | NEW |