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

Side by Side Diff: chrome/browser/local_discovery/storage/privet_volume_lister.cc

Issue 502173004: Remove implicit conversions from scoped_refptr to T* in chrome/browser/local_discovery/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/local_discovery/service_discovery_client_utility.cc ('k') | no next file » | 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/local_discovery/storage/privet_volume_lister.h" 5 #include "chrome/browser/local_discovery/storage/privet_volume_lister.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/local_discovery/storage/privet_filesystem_constants.h" 10 #include "chrome/browser/local_discovery/storage/privet_filesystem_constants.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 PrivetVolumeLister::PrivetVolumeLister(const ResultCallback& callback) 62 PrivetVolumeLister::PrivetVolumeLister(const ResultCallback& callback)
63 : callback_(callback), weak_factory_(this) { 63 : callback_(callback), weak_factory_(this) {
64 } 64 }
65 65
66 PrivetVolumeLister::~PrivetVolumeLister() { 66 PrivetVolumeLister::~PrivetVolumeLister() {
67 } 67 }
68 68
69 void PrivetVolumeLister::Start() { 69 void PrivetVolumeLister::Start() {
70 #if defined(ENABLE_SERVICE_DISCOVERY) 70 #if defined(ENABLE_SERVICE_DISCOVERY)
71 service_discovery_client_ = ServiceDiscoverySharedClient::GetInstance(); 71 service_discovery_client_ = ServiceDiscoverySharedClient::GetInstance();
72 privet_lister_.reset(new PrivetDeviceListerImpl(service_discovery_client_, 72 privet_lister_.reset(
73 this)); 73 new PrivetDeviceListerImpl(service_discovery_client_.get(), this));
74 privet_lister_->Start(); 74 privet_lister_->Start();
75 privet_lister_->DiscoverNewDevices(false); 75 privet_lister_->DiscoverNewDevices(false);
76 base::MessageLoop::current()->PostDelayedTask( 76 base::MessageLoop::current()->PostDelayedTask(
77 FROM_HERE, 77 FROM_HERE,
78 base::Bind(&PrivetVolumeLister::FinishSearch, 78 base::Bind(&PrivetVolumeLister::FinishSearch,
79 weak_factory_.GetWeakPtr()), 79 weak_factory_.GetWeakPtr()),
80 base::TimeDelta::FromMilliseconds(kVolumeSearchDurationMs)); 80 base::TimeDelta::FromMilliseconds(kVolumeSearchDurationMs));
81 #else 81 #else
82 callback_.Run(std::vector<VolumeInfo>()); 82 callback_.Run(std::vector<VolumeInfo>());
83 #endif 83 #endif
(...skipping 30 matching lines...) Expand all
114 114
115 void PrivetVolumeLister::FinishSearch() { 115 void PrivetVolumeLister::FinishSearch() {
116 privet_lister_.reset(); 116 privet_lister_.reset();
117 service_discovery_client_ = NULL; 117 service_discovery_client_ = NULL;
118 available_volumes_.swap(canonical_volume_list_); 118 available_volumes_.swap(canonical_volume_list_);
119 callback_.Run(canonical_volume_list_); 119 callback_.Run(canonical_volume_list_);
120 } 120 }
121 #endif 121 #endif
122 122
123 } // namespace local_discovery 123 } // namespace local_discovery
OLDNEW
« no previous file with comments | « chrome/browser/local_discovery/service_discovery_client_utility.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698