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

Unified Diff: chrome/browser/sync/profile_sync_service_android.cc

Issue 1882243004: Convert //chrome/browser/sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback 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: chrome/browser/sync/profile_sync_service_android.cc
diff --git a/chrome/browser/sync/profile_sync_service_android.cc b/chrome/browser/sync/profile_sync_service_android.cc
index cb7b4a2c9ce1250b5c8c142b5b11c0b6c610ea5e..81d83b85dd04e9ef2d31a016686756ba7a13bb5d 100644
--- a/chrome/browser/sync/profile_sync_service_android.cc
+++ b/chrome/browser/sync/profile_sync_service_android.cc
@@ -7,6 +7,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/android/jni_android.h"
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
@@ -14,7 +16,7 @@
#include "base/i18n/time_formatting.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
@@ -54,7 +56,7 @@ namespace {
// results are sent to the Java callback.
void NativeGetAllNodesCallback(
const base::android::ScopedJavaGlobalRef<jobject>& callback,
- scoped_ptr<base::ListValue> result) {
+ std::unique_ptr<base::ListValue> result) {
JNIEnv* env = base::android::AttachCurrentThread();
std::string json_string;
if (!result.get() || !base::JSONWriter::Write(*result, &json_string)) {
@@ -344,7 +346,7 @@ void ProfileSyncServiceAndroid::GetAllNodes(
base::android::ScopedJavaGlobalRef<jobject> java_callback;
java_callback.Reset(env, callback);
- base::Callback<void(scoped_ptr<base::ListValue>)> native_callback =
+ base::Callback<void(std::unique_ptr<base::ListValue>)> native_callback =
base::Bind(&NativeGetAllNodesCallback, java_callback);
sync_service_->GetAllNodes(native_callback);
}
@@ -454,7 +456,7 @@ ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::GetAboutInfoForTest(
const JavaParamRef<jobject>&) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- scoped_ptr<base::DictionaryValue> about_info =
+ std::unique_ptr<base::DictionaryValue> about_info =
sync_driver::sync_ui_util::ConstructAboutInformation(
sync_service_, sync_service_->signin(), chrome::GetChannel());
std::string about_info_json;
@@ -480,7 +482,7 @@ void ProfileSyncServiceAndroid::OverrideNetworkResourcesForTest(
syncer::NetworkResources* resources =
reinterpret_cast<syncer::NetworkResources*>(network_resources);
sync_service_->OverrideNetworkResourcesForTest(
- make_scoped_ptr<syncer::NetworkResources>(resources));
+ base::WrapUnique<syncer::NetworkResources>(resources));
}
// static
« no previous file with comments | « chrome/browser/sync/profile_sync_service_android.h ('k') | chrome/browser/sync/profile_sync_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698