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

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

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 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 | « chromeos/dbus/fake_shill_manager_client.cc ('k') | chromeos/dbus/shill_ipconfig_client.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 (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 "chromeos/dbus/shill_client_helper.h" 5 #include "chromeos/dbus/shill_client_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 case base::Value::Type::LIST: { 459 case base::Value::Type::LIST: {
460 const base::ListValue* list = NULL; 460 const base::ListValue* list = NULL;
461 value.GetAsList(&list); 461 value.GetAsList(&list);
462 dbus::MessageWriter variant_writer(NULL); 462 dbus::MessageWriter variant_writer(NULL);
463 writer->OpenVariant("as", &variant_writer); 463 writer->OpenVariant("as", &variant_writer);
464 dbus::MessageWriter array_writer(NULL); 464 dbus::MessageWriter array_writer(NULL);
465 variant_writer.OpenArray("s", &array_writer); 465 variant_writer.OpenArray("s", &array_writer);
466 for (base::ListValue::const_iterator it = list->begin(); 466 for (base::ListValue::const_iterator it = list->begin();
467 it != list->end(); ++it) { 467 it != list->end(); ++it) {
468 const base::Value& value = *it; 468 const base::Value& value = **it;
469 std::string value_string; 469 std::string value_string;
470 if (!value.GetAsString(&value_string)) 470 if (!value.GetAsString(&value_string))
471 NET_LOG(ERROR) << "List value not a string: " << value; 471 NET_LOG(ERROR) << "List value not a string: " << value;
472 array_writer.AppendString(value_string); 472 array_writer.AppendString(value_string);
473 } 473 }
474 variant_writer.CloseContainer(&array_writer); 474 variant_writer.CloseContainer(&array_writer);
475 writer->CloseContainer(&variant_writer); 475 writer->CloseContainer(&variant_writer);
476 break; 476 break;
477 } 477 }
478 case base::Value::Type::BOOLEAN: 478 case base::Value::Type::BOOLEAN:
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 return; 545 return;
546 std::unique_ptr<base::Value> value(dbus::PopDataAsValue(&reader)); 546 std::unique_ptr<base::Value> value(dbus::PopDataAsValue(&reader));
547 if (!value.get()) 547 if (!value.get())
548 return; 548 return;
549 549
550 for (auto& observer : observer_list_) 550 for (auto& observer : observer_list_)
551 observer.OnPropertyChanged(name, *value); 551 observer.OnPropertyChanged(name, *value);
552 } 552 }
553 553
554 } // namespace chromeos 554 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_shill_manager_client.cc ('k') | chromeos/dbus/shill_ipconfig_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698