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

Side by Side Diff: device/bluetooth/bluetooth_socket_mac.mm

Issue 584083002: Remove implicit conversions from scoped_refptr to T* in device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | device/hid/hid_service_mac.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_socket_mac.h" 5 #include "device/bluetooth/bluetooth_socket_mac.h"
6 6
7 #import <IOBluetooth/IOBluetooth.h> 7 #import <IOBluetooth/IOBluetooth.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <sstream> 10 #include <sstream>
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 linked_ptr<SendRequest> request(new SendRequest()); 755 linked_ptr<SendRequest> request(new SendRequest());
756 request->buffer_size = buffer_size; 756 request->buffer_size = buffer_size;
757 request->success_callback = success_callback; 757 request->success_callback = success_callback;
758 request->error_callback = error_callback; 758 request->error_callback = error_callback;
759 send_queue_.push(request); 759 send_queue_.push(request);
760 760
761 // |writeAsync| accepts buffers of max. mtu bytes per call, so we need to emit 761 // |writeAsync| accepts buffers of max. mtu bytes per call, so we need to emit
762 // multiple write operations if buffer_size > mtu. 762 // multiple write operations if buffer_size > mtu.
763 uint16_t mtu = channel_->GetOutgoingMTU(); 763 uint16_t mtu = channel_->GetOutgoingMTU();
764 scoped_refptr<net::DrainableIOBuffer> send_buffer( 764 scoped_refptr<net::DrainableIOBuffer> send_buffer(
765 new net::DrainableIOBuffer(buffer, buffer_size)); 765 new net::DrainableIOBuffer(buffer.get(), buffer_size));
766 while (send_buffer->BytesRemaining() > 0) { 766 while (send_buffer->BytesRemaining() > 0) {
767 int byte_count = send_buffer->BytesRemaining(); 767 int byte_count = send_buffer->BytesRemaining();
768 if (byte_count > mtu) 768 if (byte_count > mtu)
769 byte_count = mtu; 769 byte_count = mtu;
770 IOReturn status = 770 IOReturn status =
771 channel_->WriteAsync(send_buffer->data(), byte_count, request.get()); 771 channel_->WriteAsync(send_buffer->data(), byte_count, request.get());
772 772
773 if (status != kIOReturnSuccess) { 773 if (status != kIOReturnSuccess) {
774 std::stringstream error; 774 std::stringstream error;
775 error << "Failed to connect bluetooth socket (" 775 error << "Failed to connect bluetooth socket ("
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 rfcomm_connection_listener_.reset(); 943 rfcomm_connection_listener_.reset();
944 l2cap_connection_listener_.reset(); 944 l2cap_connection_listener_.reset();
945 945
946 // Destroying the listener above prevents the callback delegate from being 946 // Destroying the listener above prevents the callback delegate from being
947 // called so it is now safe to release all callback state. 947 // called so it is now safe to release all callback state.
948 accept_request_.reset(); 948 accept_request_.reset();
949 empty_queue(accept_queue_); 949 empty_queue(accept_queue_);
950 } 950 }
951 951
952 } // namespace device 952 } // namespace device
OLDNEW
« no previous file with comments | « no previous file | device/hid/hid_service_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698