Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp

Issue 2220543002: Make Resource::resourceBuffer() to return PassRefPtr<const SharedBuffer> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WTF_UseIsConvertibleInEnsure
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
index 9150adb383674ca56acf581f311229ff9e5d283c..4970982b6a331e831c2fffde1200f37c687dbfd1 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -156,7 +156,7 @@ static std::unique_ptr<TextResourceDecoder> createResourceTextDecoder(const Stri
return std::unique_ptr<TextResourceDecoder>();
}
-static void maybeEncodeTextContent(const String& textContent, PassRefPtr<SharedBuffer> buffer, String* result, bool* base64Encoded)
+static void maybeEncodeTextContent(const String& textContent, PassRefPtr<const SharedBuffer> buffer, String* result, bool* base64Encoded)
{
if (!textContent.isNull() && !textContent.utf8(WTF::StrictUTF8Conversion).isNull()) {
*result = textContent;
@@ -172,7 +172,7 @@ static void maybeEncodeTextContent(const String& textContent, PassRefPtr<SharedB
}
// static
-bool InspectorPageAgent::sharedBufferContent(PassRefPtr<SharedBuffer> buffer, const String& mimeType, const String& textEncodingName, String* result, bool* base64Encoded)
+bool InspectorPageAgent::sharedBufferContent(PassRefPtr<const SharedBuffer> buffer, const String& mimeType, const String& textEncodingName, String* result, bool* base64Encoded)
{
if (!buffer)
return false;
@@ -200,7 +200,7 @@ bool InspectorPageAgent::cachedResourceContent(Resource* cachedResource, String*
return false;
if (!hasTextContent(cachedResource)) {
- RefPtr<SharedBuffer> buffer = hasZeroSize ? SharedBuffer::create() : cachedResource->resourceBuffer();
+ RefPtr<const SharedBuffer> buffer = hasZeroSize ? SharedBuffer::create() : cachedResource->resourceBuffer();
if (!buffer)
return false;
*result = base64Encode(buffer->data(), buffer->size());

Powered by Google App Engine
This is Rietveld 408576698