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

Unified Diff: components/gcm_driver/instance_id/instance_id_android.cc

Issue 2480293004: Mandate unique_ptr for base::IDMap in IDMapOwnPointer mode. (Closed)
Patch Set: Make changes requested by danakj, fix a few more headers Created 4 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
« no previous file with comments | « components/drive/job_scheduler.cc ('k') | components/test_runner/mock_screen_orientation_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/instance_id/instance_id_android.cc
diff --git a/components/gcm_driver/instance_id/instance_id_android.cc b/components/gcm_driver/instance_id/instance_id_android.cc
index 395515f5ea14d3bb6666691a0b54cb2825ef7898..7300a8ceaaa5734f66a7942effc45800704c2e0f 100644
--- a/components/gcm_driver/instance_id/instance_id_android.cc
+++ b/components/gcm_driver/instance_id/instance_id_android.cc
@@ -79,7 +79,8 @@ InstanceIDAndroid::~InstanceIDAndroid() {
void InstanceIDAndroid::GetID(const GetIDCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
- int32_t request_id = get_id_callbacks_.Add(new GetIDCallback(callback));
+ int32_t request_id =
+ get_id_callbacks_.Add(base::MakeUnique<GetIDCallback>(callback));
JNIEnv* env = AttachCurrentThread();
Java_InstanceIDBridge_getId(env, java_ref_, request_id);
@@ -89,8 +90,8 @@ void InstanceIDAndroid::GetCreationTime(
const GetCreationTimeCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
- int32_t request_id =
- get_creation_time_callbacks_.Add(new GetCreationTimeCallback(callback));
+ int32_t request_id = get_creation_time_callbacks_.Add(
+ base::MakeUnique<GetCreationTimeCallback>(callback));
JNIEnv* env = AttachCurrentThread();
Java_InstanceIDBridge_getCreationTime(env, java_ref_, request_id);
@@ -103,7 +104,8 @@ void InstanceIDAndroid::GetToken(
const GetTokenCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
- int32_t request_id = get_token_callbacks_.Add(new GetTokenCallback(callback));
+ int32_t request_id =
+ get_token_callbacks_.Add(base::MakeUnique<GetTokenCallback>(callback));
std::vector<std::string> options_strings;
for (const auto& entry : options) {
@@ -124,8 +126,8 @@ void InstanceIDAndroid::DeleteTokenImpl(const std::string& authorized_entity,
const DeleteTokenCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
- int32_t request_id =
- delete_token_callbacks_.Add(new DeleteTokenCallback(callback));
+ int32_t request_id = delete_token_callbacks_.Add(
+ base::MakeUnique<DeleteTokenCallback>(callback));
JNIEnv* env = AttachCurrentThread();
Java_InstanceIDBridge_deleteToken(
@@ -137,7 +139,8 @@ void InstanceIDAndroid::DeleteTokenImpl(const std::string& authorized_entity,
void InstanceIDAndroid::DeleteIDImpl(const DeleteIDCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
- int32_t request_id = delete_id_callbacks_.Add(new DeleteIDCallback(callback));
+ int32_t request_id = delete_id_callbacks_.Add(
+ base::MakeUnique<DeleteIDCallback>(DeleteIDCallback(callback)));
JNIEnv* env = AttachCurrentThread();
Java_InstanceIDBridge_deleteInstanceID(env, java_ref_, request_id);
« no previous file with comments | « components/drive/job_scheduler.cc ('k') | components/test_runner/mock_screen_orientation_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698