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

Side by Side Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection.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: Rebase and fix header 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/easy_unlock_private/easy_unlock_private_ connection.h" 5 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_ connection.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "components/proximity_auth/connection.h" 8 #include "components/proximity_auth/connection.h"
9 9
10 namespace extensions { 10 namespace extensions {
11 11
12 static base::LazyInstance<BrowserContextKeyedAPIFactory< 12 static base::LazyInstance<BrowserContextKeyedAPIFactory<
13 ApiResourceManager<EasyUnlockPrivateConnection>>> g_factory = 13 ApiResourceManager<EasyUnlockPrivateConnection>>> g_factory =
14 LAZY_INSTANCE_INITIALIZER; 14 LAZY_INSTANCE_INITIALIZER;
15 15
16 template <> 16 template <>
17 BrowserContextKeyedAPIFactory<ApiResourceManager<EasyUnlockPrivateConnection>>* 17 BrowserContextKeyedAPIFactory<ApiResourceManager<EasyUnlockPrivateConnection>>*
18 ApiResourceManager<EasyUnlockPrivateConnection>::GetFactoryInstance() { 18 ApiResourceManager<EasyUnlockPrivateConnection>::GetFactoryInstance() {
19 return g_factory.Pointer(); 19 return g_factory.Pointer();
20 } 20 }
21 21
22 EasyUnlockPrivateConnection::EasyUnlockPrivateConnection( 22 EasyUnlockPrivateConnection::EasyUnlockPrivateConnection(
23 bool persistent, 23 bool persistent,
24 const std::string& owner_extension_id, 24 const std::string& owner_extension_id,
25 scoped_ptr<proximity_auth::Connection> connection) 25 std::unique_ptr<proximity_auth::Connection> connection)
26 : ApiResource(owner_extension_id), 26 : ApiResource(owner_extension_id),
27 persistent_(persistent), 27 persistent_(persistent),
28 connection_(connection.release()) {} 28 connection_(connection.release()) {}
29 29
30 EasyUnlockPrivateConnection::~EasyUnlockPrivateConnection() {} 30 EasyUnlockPrivateConnection::~EasyUnlockPrivateConnection() {}
31 31
32 proximity_auth::Connection* EasyUnlockPrivateConnection::GetConnection() const { 32 proximity_auth::Connection* EasyUnlockPrivateConnection::GetConnection() const {
33 return connection_.get(); 33 return connection_.get();
34 } 34 }
35 35
36 bool EasyUnlockPrivateConnection::IsPersistent() const { 36 bool EasyUnlockPrivateConnection::IsPersistent() const {
37 return persistent_; 37 return persistent_;
38 } 38 }
39 39
40 } // namespace extensions 40 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698