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

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

Issue 74493002: Removed refcounting from TextResourceDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_step2
Patch Set: Compile fix Created 7 years, 1 month 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: Source/core/inspector/InspectorPageAgent.cpp
diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
index f5b95862d18c37b3331cb3e0aa79849f8f6f3a2a..b6f40349e9065ee0a75f6a1567a087010154a310 100644
--- a/Source/core/inspector/InspectorPageAgent.cpp
+++ b/Source/core/inspector/InspectorPageAgent.cpp
@@ -158,14 +158,14 @@ static bool hasTextContent(Resource* cachedResource)
return type == InspectorPageAgent::DocumentResource || type == InspectorPageAgent::StylesheetResource || type == InspectorPageAgent::ScriptResource || type == InspectorPageAgent::XHRResource;
}
-static PassRefPtr<TextResourceDecoder> createXHRTextDecoder(const String& mimeType, const String& textEncodingName)
+static PassOwnPtr<TextResourceDecoder> createXHRTextDecoder(const String& mimeType, const String& textEncodingName)
{
if (!textEncodingName.isEmpty())
return TextResourceDecoder::create("text/plain", textEncodingName);
if (DOMImplementation::isXMLMIMEType(mimeType.lower())) {
- RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
+ OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
decoder->useLenientXMLDecoding();
- return decoder;
+ return decoder.release();
}
if (equalIgnoringCase(mimeType, "text/html"))
return TextResourceDecoder::create("text/html", "UTF-8");
@@ -209,7 +209,7 @@ bool InspectorPageAgent::cachedResourceContent(Resource* cachedResource, String*
SharedBuffer* buffer = cachedResource->resourceBuffer();
if (!buffer)
return false;
- RefPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedResource->response().mimeType(), cachedResource->response().textEncodingName());
+ OwnPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedResource->response().mimeType(), cachedResource->response().textEncodingName());
String content = decoder->decode(buffer->data(), buffer->size());
*result = content + decoder->flush();
return true;
« no previous file with comments | « Source/core/inspector/InspectorFileSystemAgent.cpp ('k') | Source/core/inspector/InspectorResourceAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698