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

Unified Diff: components/web_resource/web_resource_service.cc

Issue 1917673002: Convert //components/[u-z]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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: components/web_resource/web_resource_service.cc
diff --git a/components/web_resource/web_resource_service.cc b/components/web_resource/web_resource_service.cc
index 18f97a926684aa4f9945b99fd2aeab41f2deca09..d5c4bcab6ce574f9824a1537e1b65378f49ef90b 100644
--- a/components/web_resource/web_resource_service.cc
+++ b/components/web_resource/web_resource_service.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -67,7 +68,7 @@ WebResourceService::~WebResourceService() {
void WebResourceService::OnURLFetchComplete(const net::URLFetcher* source) {
// Delete the URLFetcher when this function exits.
- scoped_ptr<net::URLFetcher> clean_up_fetcher(url_fetcher_.release());
+ std::unique_ptr<net::URLFetcher> clean_up_fetcher(url_fetcher_.release());
if (source->GetStatus().is_success() && source->GetResponseCode() == 200) {
std::string data;
@@ -78,7 +79,7 @@ void WebResourceService::OnURLFetchComplete(const net::URLFetcher* source) {
// (on Android in particular) we short-cut the full parsing in the case of
// trivially "empty" JSONs.
if (data.empty() || data == "{}") {
- OnUnpackFinished(make_scoped_ptr(new base::DictionaryValue()));
+ OnUnpackFinished(base::WrapUnique(new base::DictionaryValue()));
} else {
parse_json_callback_.Run(data,
base::Bind(&WebResourceService::OnUnpackFinished,
@@ -141,7 +142,7 @@ void WebResourceService::EndFetch() {
in_fetch_ = false;
}
-void WebResourceService::OnUnpackFinished(scoped_ptr<base::Value> value) {
+void WebResourceService::OnUnpackFinished(std::unique_ptr<base::Value> value) {
if (!value) {
// Page information not properly read, or corrupted.
OnUnpackError(kInvalidDataTypeError);
« no previous file with comments | « components/web_resource/web_resource_service.h ('k') | components/webdata/common/web_data_request_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698