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

Side by Side Diff: components/password_manager/content/renderer/credential_manager_client.cc

Issue 2259813002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 "components/password_manager/content/renderer/credential_manager_client .h" 5 #include "components/password_manager/content/renderer/credential_manager_client .h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 30 matching lines...) Expand all
41 out->federation = 41 out->federation =
42 static_cast<const blink::WebFederatedCredential&>(credential) 42 static_cast<const blink::WebFederatedCredential&>(credential)
43 .provider(); 43 .provider();
44 } 44 }
45 } 45 }
46 46
47 std::unique_ptr<blink::WebCredential> CredentialInfoToWebCredential( 47 std::unique_ptr<blink::WebCredential> CredentialInfoToWebCredential(
48 const CredentialInfo& info) { 48 const CredentialInfo& info) {
49 switch (info.type) { 49 switch (info.type) {
50 case CredentialType::CREDENTIAL_TYPE_FEDERATED: 50 case CredentialType::CREDENTIAL_TYPE_FEDERATED:
51 return base::WrapUnique(new blink::WebFederatedCredential( 51 return base::MakeUnique<blink::WebFederatedCredential>(
52 info.id, info.federation, info.name, info.icon)); 52 info.id, info.federation, info.name, info.icon);
53 case CredentialType::CREDENTIAL_TYPE_PASSWORD: 53 case CredentialType::CREDENTIAL_TYPE_PASSWORD:
54 return base::WrapUnique(new blink::WebPasswordCredential( 54 return base::MakeUnique<blink::WebPasswordCredential>(
55 info.id, info.password, info.name, info.icon)); 55 info.id, info.password, info.name, info.icon);
56 case CredentialType::CREDENTIAL_TYPE_EMPTY: 56 case CredentialType::CREDENTIAL_TYPE_EMPTY:
57 return nullptr; 57 return nullptr;
58 } 58 }
59 59
60 NOTREACHED(); 60 NOTREACHED();
61 return nullptr; 61 return nullptr;
62 } 62 }
63 63
64 blink::WebCredentialManagerError GetWebCredentialManagerErrorFromMojo( 64 blink::WebCredentialManagerError GetWebCredentialManagerErrorFromMojo(
65 mojom::CredentialManagerError error) { 65 mojom::CredentialManagerError error) {
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 content::RenderFrame* main_frame = render_view()->GetMainRenderFrame(); 246 content::RenderFrame* main_frame = render_view()->GetMainRenderFrame();
247 main_frame->GetRemoteInterfaces()->GetInterface(&mojo_cm_service_); 247 main_frame->GetRemoteInterfaces()->GetInterface(&mojo_cm_service_);
248 } 248 }
249 249
250 void CredentialManagerClient::OnDestruct() { 250 void CredentialManagerClient::OnDestruct() {
251 delete this; 251 delete this;
252 } 252 }
253 253
254 } // namespace password_manager 254 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698