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

Side by Side Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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/easy_unlock_private/easy_unlock_private_ api.h" 5 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_ api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 // |params->setup_service_uuid|. 1070 // |params->setup_service_uuid|.
1071 connection_finder_.reset( 1071 connection_finder_.reset(
1072 new proximity_auth::BluetoothLowEnergyConnectionFinder( 1072 new proximity_auth::BluetoothLowEnergyConnectionFinder(
1073 proximity_auth::RemoteDevice(), params->setup_service_uuid, 1073 proximity_auth::RemoteDevice(), params->setup_service_uuid,
1074 proximity_auth::BluetoothLowEnergyConnectionFinder::FIND_ANY_DEVICE, 1074 proximity_auth::BluetoothLowEnergyConnectionFinder::FIND_ANY_DEVICE,
1075 nullptr, bluetooth_throttler_.get(), 3)); 1075 nullptr, bluetooth_throttler_.get(), 3));
1076 1076
1077 connection_finder_->Find(base::Bind( 1077 connection_finder_->Find(base::Bind(
1078 &EasyUnlockPrivateFindSetupConnectionFunction::OnConnectionFound, this)); 1078 &EasyUnlockPrivateFindSetupConnectionFunction::OnConnectionFound, this));
1079 1079
1080 timer_.reset( 1080 timer_.reset(new base::OneShotTimer());
1081 new base::OneShotTimer<EasyUnlockPrivateFindSetupConnectionFunction>());
1082 timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(params->time_out), 1081 timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(params->time_out),
1083 base::Bind(&EasyUnlockPrivateFindSetupConnectionFunction:: 1082 base::Bind(&EasyUnlockPrivateFindSetupConnectionFunction::
1084 OnConnectionFinderTimedOut, 1083 OnConnectionFinderTimedOut,
1085 this)); 1084 this));
1086 1085
1087 return true; 1086 return true;
1088 } 1087 }
1089 1088
1090 EasyUnlockPrivateSetupConnectionStatusFunction:: 1089 EasyUnlockPrivateSetupConnectionStatusFunction::
1091 EasyUnlockPrivateSetupConnectionStatusFunction() {} 1090 EasyUnlockPrivateSetupConnectionStatusFunction() {}
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 EXTENSION_FUNCTION_VALIDATE(params); 1135 EXTENSION_FUNCTION_VALIDATE(params);
1137 std::string payload(params->data.begin(), params->data.end()); 1136 std::string payload(params->data.begin(), params->data.end());
1138 bool success = GetConnectionManager(browser_context()) 1137 bool success = GetConnectionManager(browser_context())
1139 ->SendMessage(extension(), params->connection_id, payload); 1138 ->SendMessage(extension(), params->connection_id, payload);
1140 if (!success) 1139 if (!success)
1141 SetError("Invalid connectionId."); 1140 SetError("Invalid connectionId.");
1142 return true; 1141 return true;
1143 } 1142 }
1144 1143
1145 } // namespace extensions 1144 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/dial/dial_service.h ('k') | chrome/browser/extensions/updater/extension_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698