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

Side by Side Diff: chromeos/network/network_state_handler.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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 "chromeos/network/network_state_handler.h" 5 #include "chromeos/network/network_state_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 std::string GetLogName(const ManagedState* state) { 49 std::string GetLogName(const ManagedState* state) {
50 if (!state) 50 if (!state)
51 return "None"; 51 return "None";
52 return base::StringPrintf("%s (%s)", state->name().c_str(), 52 return base::StringPrintf("%s (%s)", state->name().c_str(),
53 state->path().c_str()); 53 state->path().c_str());
54 } 54 }
55 55
56 std::string ValueAsString(const base::Value& value) { 56 std::string ValueAsString(const base::Value& value) {
57 std::string vstr; 57 std::string vstr;
58 base::JSONWriter::WriteWithOptions( 58 base::JSONWriter::WriteWithOptions(
59 &value, base::JSONWriter::OPTIONS_OMIT_BINARY_VALUES, &vstr); 59 value, base::JSONWriter::OPTIONS_OMIT_BINARY_VALUES, &vstr);
60 return vstr.empty() ? "''" : vstr; 60 return vstr.empty() ? "''" : vstr;
61 } 61 }
62 62
63 } // namespace 63 } // namespace
64 64
65 const char NetworkStateHandler::kDefaultCheckPortalList[] = 65 const char NetworkStateHandler::kDefaultCheckPortalList[] =
66 "ethernet,wifi,cellular"; 66 "ethernet,wifi,cellular";
67 67
68 NetworkStateHandler::NetworkStateHandler() : network_list_sorted_(false) { 68 NetworkStateHandler::NetworkStateHandler() : network_list_sorted_(false) {
69 } 69 }
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 if (type.MatchesType(shill::kTypeBluetooth)) 984 if (type.MatchesType(shill::kTypeBluetooth))
985 technologies.push_back(new std::string(shill::kTypeBluetooth)); 985 technologies.push_back(new std::string(shill::kTypeBluetooth));
986 if (type.MatchesType(shill::kTypeVPN)) 986 if (type.MatchesType(shill::kTypeVPN))
987 technologies.push_back(new std::string(shill::kTypeVPN)); 987 technologies.push_back(new std::string(shill::kTypeVPN));
988 988
989 CHECK_GT(technologies.size(), 0ul); 989 CHECK_GT(technologies.size(), 0ul);
990 return technologies.Pass(); 990 return technologies.Pass();
991 } 991 }
992 992
993 } // namespace chromeos 993 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_configuration_handler_unittest.cc ('k') | chromeos/network/onc/onc_translator_onc_to_shill.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698