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

Side by Side Diff: device/bluetooth/bluetooth_task_manager_win.cc

Issue 71013004: Base: Remove Receive() from ScopedHandle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix delegate_execute for google_chrome_build Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « content/common/sandbox_win.cc ('k') | net/base/net_util_win.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "device/bluetooth/bluetooth_task_manager_win.h" 5 #include "device/bluetooth/bluetooth_task_manager_win.h"
6 6
7 #include <winsock2.h> 7 #include <winsock2.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 void BluetoothTaskManagerWin::PollAdapter() { 205 void BluetoothTaskManagerWin::PollAdapter() {
206 DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread()); 206 DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
207 207
208 // Skips updating the adapter info if the adapter is in discovery mode. 208 // Skips updating the adapter info if the adapter is in discovery mode.
209 if (!discovering_) { 209 if (!discovering_) {
210 const BLUETOOTH_FIND_RADIO_PARAMS adapter_param = 210 const BLUETOOTH_FIND_RADIO_PARAMS adapter_param =
211 { sizeof(BLUETOOTH_FIND_RADIO_PARAMS) }; 211 { sizeof(BLUETOOTH_FIND_RADIO_PARAMS) };
212 if (adapter_handle_) 212 if (adapter_handle_)
213 adapter_handle_.Close(); 213 adapter_handle_.Close();
214 HANDLE temp_adapter_handle;
214 HBLUETOOTH_RADIO_FIND handle = BluetoothFindFirstRadio( 215 HBLUETOOTH_RADIO_FIND handle = BluetoothFindFirstRadio(
215 &adapter_param, adapter_handle_.Receive()); 216 &adapter_param, &temp_adapter_handle);
216 217
217 if (handle) { 218 if (handle) {
219 adapter_handle_.Set(temp_adapter_handle);
218 GetKnownDevices(); 220 GetKnownDevices();
219 BluetoothFindRadioClose(handle); 221 BluetoothFindRadioClose(handle);
220 } 222 }
221 PostAdapterStateToUi(); 223 PostAdapterStateToUi();
222 } 224 }
223 225
224 // Re-poll. 226 // Re-poll.
225 bluetooth_task_runner_->PostDelayedTask( 227 bluetooth_task_runner_->PostDelayedTask(
226 FROM_HERE, 228 FROM_HERE,
227 base::Bind(&BluetoothTaskManagerWin::PollAdapter, 229 base::Bind(&BluetoothTaskManagerWin::PollAdapter,
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 service_record_state->sdp_bytes.push_back( 407 service_record_state->sdp_bytes.push_back(
406 sdp_result_data->lpBlob->pBlobData[i]); 408 sdp_result_data->lpBlob->pBlobData[i]);
407 } 409 }
408 service_record_states->push_back(service_record_state); 410 service_record_states->push_back(service_record_state);
409 } 411 }
410 WSALookupServiceEnd(sdp_handle); 412 WSALookupServiceEnd(sdp_handle);
411 } 413 }
412 } 414 }
413 415
414 } // namespace device 416 } // namespace device
OLDNEW
« no previous file with comments | « content/common/sandbox_win.cc ('k') | net/base/net_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698