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

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

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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(base::StartsWithASCII(object_path_.value(), 55 DCHECK(base::StartsWith(object_path_.value(),
56 service_path_.value() + "/", true)); 56 service_path_.value() + "/",
57 base::CompareCase::SENSITIVE));
57 58
58 exported_object_ = bus_->GetExportedObject(object_path_); 59 exported_object_ = bus_->GetExportedObject(object_path_);
59 60
60 exported_object_->ExportMethod( 61 exported_object_->ExportMethod(
61 dbus::kDBusPropertiesInterface, 62 dbus::kDBusPropertiesInterface,
62 dbus::kDBusPropertiesGet, 63 dbus::kDBusPropertiesGet,
63 base::Bind(&BluetoothGattCharacteristicServiceProviderImpl::Get, 64 base::Bind(&BluetoothGattCharacteristicServiceProviderImpl::Get,
64 weak_ptr_factory_.GetWeakPtr()), 65 weak_ptr_factory_.GetWeakPtr()),
65 base::Bind(&BluetoothGattCharacteristicServiceProviderImpl::OnExported, 66 base::Bind(&BluetoothGattCharacteristicServiceProviderImpl::OnExported,
66 weak_ptr_factory_.GetWeakPtr())); 67 weak_ptr_factory_.GetWeakPtr()));
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 const dbus::ObjectPath& service_path) { 467 const dbus::ObjectPath& service_path) {
467 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) { 468 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) {
468 return new BluetoothGattCharacteristicServiceProviderImpl( 469 return new BluetoothGattCharacteristicServiceProviderImpl(
469 bus, object_path, delegate, uuid, flags, permissions, service_path); 470 bus, object_path, delegate, uuid, flags, permissions, service_path);
470 } 471 }
471 return new FakeBluetoothGattCharacteristicServiceProvider( 472 return new FakeBluetoothGattCharacteristicServiceProvider(
472 object_path, delegate, uuid, flags, permissions, service_path); 473 object_path, delegate, uuid, flags, permissions, service_path);
473 } 474 }
474 475
475 } // namespace chromeos 476 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/interstitials/interstitial_ui.cc ('k') | chromeos/dbus/bluetooth_gatt_descriptor_service_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698