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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 } | 241 } |
242 | 242 |
243 if (cachedResource) { | 243 if (cachedResource) { |
244 switch (cachedResource->type()) { | 244 switch (cachedResource->type()) { |
245 case Resource::CSSStyleSheet: | 245 case Resource::CSSStyleSheet: |
246 *result = toCSSStyleSheetResource(cachedResource)->sheetText(false); | 246 *result = toCSSStyleSheetResource(cachedResource)->sheetText(false); |
247 return true; | 247 return true; |
248 case Resource::Script: | 248 case Resource::Script: |
249 *result = toScriptResource(cachedResource)->script(); | 249 *result = toScriptResource(cachedResource)->script(); |
250 return true; | 250 return true; |
251 case Resource::MainResource: | |
252 return false; | |
253 case Resource::Raw: { | 251 case Resource::Raw: { |
254 SharedBuffer* buffer = cachedResource->resourceBuffer(); | 252 SharedBuffer* buffer = cachedResource->resourceBuffer(); |
255 if (!buffer) | 253 if (!buffer) |
256 return false; | 254 return false; |
257 OwnPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedRes
ource->response().mimeType(), cachedResource->response().textEncodingName()); | 255 OwnPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedRes
ource->response().mimeType(), cachedResource->response().textEncodingName()); |
258 String content = decoder->decode(buffer->data(), buffer->size()); | 256 String content = decoder->decode(buffer->data(), buffer->size()); |
259 *result = content + decoder->flush(); | 257 *result = content + decoder->flush(); |
260 return true; | 258 return true; |
261 } | 259 } |
262 default: | 260 default: |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con
tent) | 1385 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con
tent) |
1388 { | 1386 { |
1389 if (!m_editedResourceContent.contains(url)) | 1387 if (!m_editedResourceContent.contains(url)) |
1390 return false; | 1388 return false; |
1391 *content = m_editedResourceContent.get(url); | 1389 *content = m_editedResourceContent.get(url); |
1392 return true; | 1390 return true; |
1393 } | 1391 } |
1394 | 1392 |
1395 } // namespace WebCore | 1393 } // namespace WebCore |
1396 | 1394 |
OLD | NEW |