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

Side by Side Diff: chromeos/dbus/bluetooth_gatt_characteristic_service_provider.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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 "chromeos/dbus/bluetooth_gatt_characteristic_service_provider.h" 5 #include "chromeos/dbus/bluetooth_gatt_characteristic_service_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 object_path_(object_path), 45 object_path_(object_path),
46 service_path_(service_path), 46 service_path_(service_path),
47 weak_ptr_factory_(this) { 47 weak_ptr_factory_(this) {
48 VLOG(1) << "Created Bluetooth GATT characteristic: " << object_path.value() 48 VLOG(1) << "Created Bluetooth GATT characteristic: " << object_path.value()
49 << " UUID: " << uuid; 49 << " UUID: " << uuid;
50 DCHECK(bus_); 50 DCHECK(bus_);
51 DCHECK(delegate_); 51 DCHECK(delegate_);
52 DCHECK(!uuid_.empty()); 52 DCHECK(!uuid_.empty());
53 DCHECK(object_path_.IsValid()); 53 DCHECK(object_path_.IsValid());
54 DCHECK(service_path_.IsValid()); 54 DCHECK(service_path_.IsValid());
55 DCHECK(StartsWithASCII( 55 DCHECK(base::StartsWithASCII(object_path_.value(),
56 object_path_.value(), service_path_.value() + "/", true)); 56 service_path_.value() + "/", true));
57 57
58 exported_object_ = bus_->GetExportedObject(object_path_); 58 exported_object_ = bus_->GetExportedObject(object_path_);
59 59
60 exported_object_->ExportMethod( 60 exported_object_->ExportMethod(
61 dbus::kDBusPropertiesInterface, 61 dbus::kDBusPropertiesInterface,
62 dbus::kDBusPropertiesGet, 62 dbus::kDBusPropertiesGet,
63 base::Bind(&BluetoothGattCharacteristicServiceProviderImpl::Get, 63 base::Bind(&BluetoothGattCharacteristicServiceProviderImpl::Get,
64 weak_ptr_factory_.GetWeakPtr()), 64 weak_ptr_factory_.GetWeakPtr()),
65 base::Bind(&BluetoothGattCharacteristicServiceProviderImpl::OnExported, 65 base::Bind(&BluetoothGattCharacteristicServiceProviderImpl::OnExported,
66 weak_ptr_factory_.GetWeakPtr())); 66 weak_ptr_factory_.GetWeakPtr()));
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 const dbus::ObjectPath& service_path) { 466 const dbus::ObjectPath& service_path) {
467 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) { 467 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) {
468 return new BluetoothGattCharacteristicServiceProviderImpl( 468 return new BluetoothGattCharacteristicServiceProviderImpl(
469 bus, object_path, delegate, uuid, flags, permissions, service_path); 469 bus, object_path, delegate, uuid, flags, permissions, service_path);
470 } 470 }
471 return new FakeBluetoothGattCharacteristicServiceProvider( 471 return new FakeBluetoothGattCharacteristicServiceProvider(
472 object_path, delegate, uuid, flags, permissions, service_path); 472 object_path, delegate, uuid, flags, permissions, service_path);
473 } 473 }
474 474
475 } // namespace chromeos 475 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698