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

Side by Side Diff: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc

Issue 22885002: c/b/extensions, json_schema_compiler: Do not use Value::Create*. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed C-style casts. Created 7 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
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 "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" 5 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h" 10 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h"
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 return; 498 return;
499 499
500 scoped_refptr<net::WrappedIOBuffer> wrapped_io_buffer( 500 scoped_refptr<net::WrappedIOBuffer> wrapped_io_buffer(
501 new net::WrappedIOBuffer(data_to_write_->GetBuffer())); 501 new net::WrappedIOBuffer(data_to_write_->GetBuffer()));
502 scoped_refptr<net::DrainableIOBuffer> drainable_io_buffer( 502 scoped_refptr<net::DrainableIOBuffer> drainable_io_buffer(
503 new net::DrainableIOBuffer(wrapped_io_buffer.get(), 503 new net::DrainableIOBuffer(wrapped_io_buffer.get(),
504 data_to_write_->GetSize())); 504 data_to_write_->GetSize()));
505 success_ = socket_->Send(drainable_io_buffer.get()); 505 success_ = socket_->Send(drainable_io_buffer.get());
506 if (success_) { 506 if (success_) {
507 if (drainable_io_buffer->BytesConsumed() > 0) 507 if (drainable_io_buffer->BytesConsumed() > 0)
508 SetResult(base::Value::CreateIntegerValue( 508 SetResult(new base::FundamentalValue(
509 drainable_io_buffer->BytesConsumed())); 509 drainable_io_buffer->BytesConsumed()));
510 else 510 else
511 results_.reset(); 511 results_.reset();
512 } else { 512 } else {
513 SetError(socket_->GetLastErrorMessage()); 513 SetError(socket_->GetLastErrorMessage());
514 } 514 }
515 } 515 }
516 516
517 bool BluetoothWriteFunction::Respond() { 517 bool BluetoothWriteFunction::Respond() {
518 return success_; 518 return success_;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 adapter->StopDiscovering( 664 adapter->StopDiscovering(
665 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), 665 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this),
666 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); 666 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this));
667 } 667 }
668 668
669 return true; 669 return true;
670 } 670 }
671 671
672 } // namespace api 672 } // namespace api
673 } // namespace extensions 673 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698