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

Side by Side Diff: chrome/browser/extensions/api/networking_private/crypto_verify_impl.cc

Issue 1871713002: Convert //chrome/browser/extensions 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/networking_private/crypto_verify_impl.h" 5 #include "chrome/browser/extensions/api/networking_private/crypto_verify_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 std::string decoded_public_key; 130 std::string decoded_public_key;
131 if (!base::Base64Decode(credentials.public_key, &decoded_public_key)) { 131 if (!base::Base64Decode(credentials.public_key, &decoded_public_key)) {
132 LOG(ERROR) << "Failed to decode public key"; 132 LOG(ERROR) << "Failed to decode public key";
133 return false; 133 return false;
134 } 134 }
135 135
136 // Start getting credentials. CredentialsGetterCompleted will be called on 136 // Start getting credentials. CredentialsGetterCompleted will be called on
137 // completion. On Windows it will be called from a different thread after 137 // completion. On Windows it will be called from a different thread after
138 // |credentials_getter| is deleted. 138 // |credentials_getter| is deleted.
139 scoped_ptr<NetworkingPrivateCredentialsGetter> credentials_getter( 139 std::unique_ptr<NetworkingPrivateCredentialsGetter> credentials_getter(
140 NetworkingPrivateCredentialsGetter::Create()); 140 NetworkingPrivateCredentialsGetter::Create());
141 credentials_getter->Start(guid, decoded_public_key, 141 credentials_getter->Start(guid, decoded_public_key,
142 base::Bind(&CredentialsGetterCompleted, 142 base::Bind(&CredentialsGetterCompleted,
143 success_callback, failure_callback)); 143 success_callback, failure_callback));
144 return true; 144 return true;
145 } 145 }
146 146
147 void VerifyAndEncryptCredentialsCompleted( 147 void VerifyAndEncryptCredentialsCompleted(
148 const CryptoVerifyImpl::FailureCallback& failure_callback, 148 const CryptoVerifyImpl::FailureCallback& failure_callback,
149 bool succeeded) { 149 bool succeeded) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 230 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
231 Credentials credentials(verification_properties); 231 Credentials credentials(verification_properties);
232 base::PostTaskAndReplyWithResult( 232 base::PostTaskAndReplyWithResult(
233 blocking_pool_task_runner_.get(), FROM_HERE, 233 blocking_pool_task_runner_.get(), FROM_HERE,
234 base::Bind(&DoVerifyAndEncryptData, credentials, data), 234 base::Bind(&DoVerifyAndEncryptData, credentials, data),
235 base::Bind(&VerifyAndEncryptDataCompleted, success_callback, 235 base::Bind(&VerifyAndEncryptDataCompleted, success_callback,
236 failure_callback)); 236 failure_callback));
237 } 237 }
238 238
239 } // namespace extensions 239 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698