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

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

Issue 1317933003: bluetooth-advertising: Fix wrong assignment and append of wrong type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-origin
Patch Set: Address armansito's comments Created 5 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/BUILD.gn » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_le_advertisement_service_provider.h" 5 #include "chromeos/dbus/bluetooth_le_advertisement_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/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 348
349 void AppendServiceDataVariant(dbus::MessageWriter* writer) { 349 void AppendServiceDataVariant(dbus::MessageWriter* writer) {
350 DCHECK(service_data_); 350 DCHECK(service_data_);
351 dbus::MessageWriter array_writer(NULL); 351 dbus::MessageWriter array_writer(NULL);
352 writer->OpenArray("{say}", &array_writer); 352 writer->OpenArray("{say}", &array_writer);
353 for (const auto& m : *service_data_) { 353 for (const auto& m : *service_data_) {
354 dbus::MessageWriter entry_writer(NULL); 354 dbus::MessageWriter entry_writer(NULL);
355 355
356 array_writer.OpenDictEntry(&entry_writer); 356 array_writer.OpenDictEntry(&entry_writer);
357 357
358 entry_writer.AppendVariantOfString(m.first); 358 entry_writer.AppendString(m.first);
359 entry_writer.AppendArrayOfBytes(vector_as_array(&m.second), 359 entry_writer.AppendArrayOfBytes(vector_as_array(&m.second),
360 m.second.size()); 360 m.second.size());
361 361
362 array_writer.CloseContainer(&entry_writer); 362 array_writer.CloseContainer(&entry_writer);
363 } 363 }
364 writer->CloseContainer(&array_writer); 364 writer->CloseContainer(&array_writer);
365 } 365 }
366 366
367 // Origin thread (i.e. the UI thread in production). 367 // Origin thread (i.e. the UI thread in production).
368 base::PlatformThreadId origin_thread_id_; 368 base::PlatformThreadId origin_thread_id_;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 return make_scoped_ptr(new BluetoothAdvertisementServiceProviderImpl( 419 return make_scoped_ptr(new BluetoothAdvertisementServiceProviderImpl(
420 bus, object_path, delegate, type, service_uuids.Pass(), 420 bus, object_path, delegate, type, service_uuids.Pass(),
421 manufacturer_data.Pass(), solicit_uuids.Pass(), service_data.Pass())); 421 manufacturer_data.Pass(), solicit_uuids.Pass(), service_data.Pass()));
422 } else { 422 } else {
423 return make_scoped_ptr( 423 return make_scoped_ptr(
424 new FakeBluetoothLEAdvertisementServiceProvider(object_path, delegate)); 424 new FakeBluetoothLEAdvertisementServiceProvider(object_path, delegate));
425 } 425 }
426 } 426 }
427 427
428 } // namespace chromeos 428 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | device/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698