| 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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 { | 707 { |
| 708 String content; | 708 String content; |
| 709 if (getEditedResourceContent(url, &content)) { | 709 if (getEditedResourceContent(url, &content)) { |
| 710 callback->sendSuccess(content, false); | 710 callback->sendSuccess(content, false); |
| 711 return; | 711 return; |
| 712 } | 712 } |
| 713 if (!m_inspectorResourceContentLoader) { | 713 if (!m_inspectorResourceContentLoader) { |
| 714 callback->sendFailure("Agent is not enabled."); | 714 callback->sendFailure("Agent is not enabled."); |
| 715 return; | 715 return; |
| 716 } | 716 } |
| 717 m_inspectorResourceContentLoader->addListener(adoptPtr(new GetResourceConten
tLoadListener(this, frameId, url, callback))); | 717 m_inspectorResourceContentLoader->ensureResourcesContentLoaded(adoptPtr(new
GetResourceContentLoadListener(this, frameId, url, callback))); |
| 718 } | 718 } |
| 719 | 719 |
| 720 static bool textContentForResource(Resource* cachedResource, String* result) | 720 static bool textContentForResource(Resource* cachedResource, String* result) |
| 721 { | 721 { |
| 722 if (hasTextContent(cachedResource)) { | 722 if (hasTextContent(cachedResource)) { |
| 723 String content; | 723 String content; |
| 724 bool base64Encoded; | 724 bool base64Encoded; |
| 725 if (InspectorPageAgent::cachedResourceContent(cachedResource, result, &b
ase64Encoded)) { | 725 if (InspectorPageAgent::cachedResourceContent(cachedResource, result, &b
ase64Encoded)) { |
| 726 ASSERT(!base64Encoded); | 726 ASSERT(!base64Encoded); |
| 727 return true; | 727 return true; |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con
tent) | 1427 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con
tent) |
| 1428 { | 1428 { |
| 1429 if (!m_editedResourceContent.contains(url)) | 1429 if (!m_editedResourceContent.contains(url)) |
| 1430 return false; | 1430 return false; |
| 1431 *content = m_editedResourceContent.get(url); | 1431 *content = m_editedResourceContent.get(url); |
| 1432 return true; | 1432 return true; |
| 1433 } | 1433 } |
| 1434 | 1434 |
| 1435 } // namespace WebCore | 1435 } // namespace WebCore |
| 1436 | 1436 |
| OLD | NEW |