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

Unified Diff: remoting/test/refresh_token_store.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU 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
« no previous file with comments | « remoting/test/refresh_token_store.h ('k') | remoting/test/remote_host_info_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/refresh_token_store.cc
diff --git a/remoting/test/refresh_token_store.cc b/remoting/test/refresh_token_store.cc
index dfe3964b966a4c0e62fe9a0e4df6050fa0544ab7..d67e6a10048a3398016aca28174611c8fbc9ede7 100644
--- a/remoting/test/refresh_token_store.cc
+++ b/remoting/test/refresh_token_store.cc
@@ -10,6 +10,7 @@
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
namespace {
@@ -71,7 +72,8 @@ std::string RefreshTokenStoreOnDisk::FetchRefreshToken() {
return std::string();
}
- scoped_ptr<base::Value> token_data(base::JSONReader::Read(file_contents));
+ std::unique_ptr<base::Value> token_data(
+ base::JSONReader::Read(file_contents));
base::DictionaryValue* tokens = nullptr;
if (!token_data || !token_data->GetAsDictionary(&tokens)) {
LOG(ERROR) << "Refresh token file contents were not valid JSON, "
@@ -113,7 +115,8 @@ bool RefreshTokenStoreOnDisk::StoreRefreshToken(
}
}
- scoped_ptr<base::Value> token_data(base::JSONReader::Read(file_contents));
+ std::unique_ptr<base::Value> token_data(
+ base::JSONReader::Read(file_contents));
base::DictionaryValue* tokens = nullptr;
if (!token_data || !token_data->GetAsDictionary(&tokens)) {
LOG(ERROR) << "Invalid refresh token file format, could not store token.";
@@ -158,10 +161,10 @@ base::FilePath RefreshTokenStoreOnDisk::GetPathForRefreshTokenFile() {
return refresh_token_file_path;
}
-scoped_ptr<RefreshTokenStore> RefreshTokenStore::OnDisk(
+std::unique_ptr<RefreshTokenStore> RefreshTokenStore::OnDisk(
const std::string& user_name,
const base::FilePath& refresh_token_file_path) {
- return make_scoped_ptr<RefreshTokenStore>(
+ return base::WrapUnique<RefreshTokenStore>(
new RefreshTokenStoreOnDisk(user_name, refresh_token_file_path));
}
« no previous file with comments | « remoting/test/refresh_token_store.h ('k') | remoting/test/remote_host_info_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698