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

Side by Side Diff: chrome/browser/extensions/api/gcd_private/gcd_private_api.cc

Issue 2466523002: Remove some linked_ptr c/b/extension (Closed)
Patch Set: review 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/mdns/dns_sd_registry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gcd_private/gcd_private_api.h" 5 #include "chrome/browser/extensions/api/gcd_private/gcd_private_api.h"
6 6
7 #include <memory>
8
7 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/linked_ptr.h"
10 #include "base/threading/thread_task_runner_handle.h" 11 #include "base/threading/thread_task_runner_handle.h"
11 #include "chrome/browser/extensions/api/gcd_private/privet_v3_context_getter.h" 12 #include "chrome/browser/extensions/api/gcd_private/privet_v3_context_getter.h"
12 #include "chrome/browser/extensions/api/gcd_private/privet_v3_session.h" 13 #include "chrome/browser/extensions/api/gcd_private/privet_v3_session.h"
13 #include "chrome/browser/local_discovery/endpoint_resolver.h" 14 #include "chrome/browser/local_discovery/endpoint_resolver.h"
14 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" 15 #include "chrome/browser/local_discovery/service_discovery_shared_client.h"
15 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
16 #include "content/public/browser/browser_context.h" 17 #include "content/public/browser/browser_context.h"
17 #include "content/public/browser/storage_partition.h" 18 #include "content/public/browser/storage_partition.h"
18 #include "net/url_request/url_request_context_getter.h" 19 #include "net/url_request/url_request_context_getter.h"
19 20
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 const MessageResponseCallback& callback); 87 const MessageResponseCallback& callback);
87 88
88 void OnServiceResolved(int session_id, 89 void OnServiceResolved(int session_id,
89 const CreateSessionCallback& callback, 90 const CreateSessionCallback& callback,
90 const net::IPEndPoint& endpoint); 91 const net::IPEndPoint& endpoint);
91 92
92 scoped_refptr<local_discovery::ServiceDiscoverySharedClient> 93 scoped_refptr<local_discovery::ServiceDiscoverySharedClient>
93 service_discovery_client_; 94 service_discovery_client_;
94 95
95 struct SessionInfo { 96 struct SessionInfo {
96 linked_ptr<PrivetV3Session> session; 97 std::unique_ptr<PrivetV3Session> session;
97 linked_ptr<local_discovery::EndpointResolver> resolver; 98 std::unique_ptr<local_discovery::EndpointResolver> resolver;
98 }; 99 };
99 100
100 std::map<int, SessionInfo> sessions_; 101 std::map<int, SessionInfo> sessions_;
101 int last_session_id_ = 0; 102 int last_session_id_ = 0;
102 103
103 content::BrowserContext* const browser_context_; 104 content::BrowserContext* const browser_context_;
104 105
105 scoped_refptr<PrivetV3ContextGetter> context_getter_; 106 scoped_refptr<PrivetV3ContextGetter> context_getter_;
106 107
107 base::WeakPtrFactory<GcdPrivateAPIImpl> weak_ptr_factory_{this}; 108 base::WeakPtrFactory<GcdPrivateAPIImpl> weak_ptr_factory_{this};
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 438
438 GcdPrivateAPIImpl* gcd_api = GcdPrivateAPIImpl::Get(GetProfile()); 439 GcdPrivateAPIImpl* gcd_api = GcdPrivateAPIImpl::Get(GetProfile());
439 440
440 gcd_api->RemoveSession(params->session_id); 441 gcd_api->RemoveSession(params->session_id);
441 442
442 SendResponse(true); 443 SendResponse(true);
443 return true; 444 return true;
444 } 445 }
445 446
446 } // namespace extensions 447 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/mdns/dns_sd_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698