Skip to content

Commit

Permalink
Update uses of Value in chromeos/, cloud_print/, components/, content…
Browse files Browse the repository at this point in the history
…/ to use the base:: namespace.

BUG=88666
TEST=no change
TBR=ben@chromium.org

Review URL: https://codereview.chromium.org/108603005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242409 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
avi@chromium.org committed Dec 23, 2013
1 parent e53a7f2 commit 85ecd7e
Show file tree
Hide file tree
Showing 70 changed files with 328 additions and 308 deletions.
2 changes: 1 addition & 1 deletion chromeos/dbus/nfc_device_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class NfcDeviceClientImpl : public NfcDeviceClient,
dbus::MessageWriter array_writer(NULL);
dbus::MessageWriter dict_entry_writer(NULL);
writer.OpenArray("{sv}", &array_writer);
for (DictionaryValue::Iterator iter(attributes);
for (base::DictionaryValue::Iterator iter(attributes);
!iter.IsAtEnd(); iter.Advance()) {
array_writer.OpenDictEntry(&dict_entry_writer);
dict_entry_writer.AppendString(iter.key());
Expand Down
2 changes: 1 addition & 1 deletion chromeos/dbus/nfc_tag_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class NfcTagClientImpl : public NfcTagClient,
dbus::MessageWriter array_writer(NULL);
dbus::MessageWriter dict_entry_writer(NULL);
writer.OpenArray("{sv}", &array_writer);
for (DictionaryValue::Iterator iter(attributes);
for (base::DictionaryValue::Iterator iter(attributes);
!iter.IsAtEnd(); iter.Advance()) {
array_writer.OpenDictEntry(&dict_entry_writer);
dict_entry_writer.AppendString(iter.key());
Expand Down
4 changes: 2 additions & 2 deletions chromeos/network/device_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CHROMEOS_EXPORT DeviceState : public ManagedState {
const std::string& iccid() const { return iccid_; }
const std::string& mdn() const { return mdn_; }
const CellularScanResults& scan_results() const { return scan_results_; }
const DictionaryValue& properties() const { return properties_; }
const base::DictionaryValue& properties() const { return properties_; }

// Ethernet specific accessors
bool eap_authentication_completed() const {
Expand Down Expand Up @@ -83,7 +83,7 @@ class CHROMEOS_EXPORT DeviceState : public ManagedState {

// Keep all Device properties in a dictionary. Devices are limited and should
// change rarely if ever, so the overhead for this is small.
DictionaryValue properties_;
base::DictionaryValue properties_;

DISALLOW_COPY_AND_ASSIGN(DeviceState);
};
Expand Down
2 changes: 1 addition & 1 deletion chromeos/network/network_configuration_handler_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class NetworkConfigurationHandlerStubTest : public testing::Test {
base::MessageLoopForUI message_loop_;
std::string success_callback_name_;
std::string get_properties_path_;
scoped_ptr<DictionaryValue> get_properties_;
scoped_ptr<base::DictionaryValue> get_properties_;
std::string create_service_path_;
};

Expand Down
2 changes: 1 addition & 1 deletion chromeos/network/network_device_handler_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void RefreshIPConfigsCallback(
const network_handler::ErrorCallback& error_callback,
const std::string& device_path,
const base::DictionaryValue& properties) {
const ListValue* ip_configs;
const base::ListValue* ip_configs;
if (!properties.GetListWithoutPathExpansion(
shill::kIPConfigsProperty, &ip_configs)) {
NET_LOG_ERROR("RequestRefreshIPConfigs Failed", device_path);
Expand Down
2 changes: 1 addition & 1 deletion chromeos/network/network_state_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TestStringValue : public base::Value {
return new TestStringValue(value_);
}

virtual bool Equals(const Value* other) const OVERRIDE {
virtual bool Equals(const base::Value* other) const OVERRIDE {
if (other->GetType() != GetType())
return false;
std::string lhs, rhs;
Expand Down
10 changes: 6 additions & 4 deletions chromeos/network/network_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,17 @@ int32 NetmaskToPrefixLength(const std::string& netmask) {
return prefix_length;
}

bool ParseCellularScanResults(
const ListValue& list, std::vector<CellularScanResult>* scan_results) {
bool ParseCellularScanResults(const base::ListValue& list,
std::vector<CellularScanResult>* scan_results) {
scan_results->clear();
scan_results->reserve(list.GetSize());
for (ListValue::const_iterator it = list.begin(); it != list.end(); ++it) {
for (base::ListValue::const_iterator it = list.begin();
it != list.end(); ++it) {
if (!(*it)->IsType(base::Value::TYPE_DICTIONARY))
return false;
CellularScanResult scan_result;
const DictionaryValue* dict = static_cast<const DictionaryValue*>(*it);
const base::DictionaryValue* dict =
static_cast<const base::DictionaryValue*>(*it);
// If the network id property is not present then this network cannot be
// connected to so don't include it in the results.
if (!dict->GetStringWithoutPathExpansion(shill::kNetworkIdProperty,
Expand Down
2 changes: 1 addition & 1 deletion chromeos/network/network_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ CHROMEOS_EXPORT int32 NetmaskToPrefixLength(const std::string& netmask);
// CellularScanResult in |scan_results|. Returns false if parsing fails,
// in which case the contents of |scan_results| will be undefined.
CHROMEOS_EXPORT bool ParseCellularScanResults(
const ListValue& list, std::vector<CellularScanResult>* scan_results);
const base::ListValue& list, std::vector<CellularScanResult>* scan_results);

} // namespace network_util
} // namespace chromeos
Expand Down
8 changes: 4 additions & 4 deletions chromeos/network/network_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ TEST_F(NetworkUtilTest, PrefixLengthToNetmask) {
}

TEST_F(NetworkUtilTest, ParseScanResults) {
ListValue list;
base::ListValue list;
std::vector<CellularScanResult> scan_results;

// Empty list value.
Expand All @@ -116,20 +116,20 @@ TEST_F(NetworkUtilTest, ParseScanResults) {

// Scan result has no network id.
list.Clear();
DictionaryValue* dict_value = new DictionaryValue();
base::DictionaryValue* dict_value = new base::DictionaryValue();
dict_value->SetString(shill::kStatusProperty, "available");
list.Append(dict_value);
EXPECT_TRUE(ParseCellularScanResults(list, &scan_results));
EXPECT_TRUE(scan_results.empty());

// Mixed parse results.
dict_value = new DictionaryValue();
dict_value = new base::DictionaryValue();
dict_value->SetString(shill::kNetworkIdProperty, "000001");
dict_value->SetString(shill::kStatusProperty, "unknown");
dict_value->SetString(shill::kTechnologyProperty, "GSM");
list.Append(dict_value);

dict_value = new DictionaryValue();
dict_value = new base::DictionaryValue();
dict_value->SetString(shill::kNetworkIdProperty, "000002");
dict_value->SetString(shill::kStatusProperty, "available");
dict_value->SetString(shill::kLongNameProperty, "Long Name");
Expand Down
69 changes: 35 additions & 34 deletions chromeos/network/onc/onc_signature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ namespace onc {
namespace {

const OncValueSignature kBoolSignature = {
Value::TYPE_BOOLEAN, NULL
base::Value::TYPE_BOOLEAN, NULL
};
const OncValueSignature kStringSignature = {
Value::TYPE_STRING, NULL
base::Value::TYPE_STRING, NULL
};
const OncValueSignature kIntegerSignature = {
Value::TYPE_INTEGER, NULL
base::Value::TYPE_INTEGER, NULL
};
const OncValueSignature kStringListSignature = {
Value::TYPE_LIST, NULL, &kStringSignature
base::Value::TYPE_LIST, NULL, &kStringSignature
};
const OncValueSignature kIntegerListSignature = {
Value::TYPE_LIST, NULL, &kIntegerSignature
base::Value::TYPE_LIST, NULL, &kIntegerSignature
};
const OncValueSignature kIPConfigListSignature = {
Value::TYPE_LIST, NULL, &kIPConfigSignature
base::Value::TYPE_LIST, NULL, &kIPConfigSignature
};
const OncValueSignature kCellularApnListSignature = {
Value::TYPE_LIST, NULL, &kCellularApnSignature
base::Value::TYPE_LIST, NULL, &kCellularApnSignature
};

const OncFieldSignature issuer_subject_pattern_fields[] = {
Expand Down Expand Up @@ -310,88 +310,89 @@ const OncFieldSignature toplevel_configuration_fields[] = {
} // namespace

const OncValueSignature kRecommendedSignature = {
Value::TYPE_LIST, NULL, &kStringSignature
base::Value::TYPE_LIST, NULL, &kStringSignature
};
const OncValueSignature kEAPSignature = {
Value::TYPE_DICTIONARY, eap_fields, NULL
base::Value::TYPE_DICTIONARY, eap_fields, NULL
};
const OncValueSignature kIssuerSubjectPatternSignature = {
Value::TYPE_DICTIONARY, issuer_subject_pattern_fields, NULL
base::Value::TYPE_DICTIONARY, issuer_subject_pattern_fields, NULL
};
const OncValueSignature kCertificatePatternSignature = {
Value::TYPE_DICTIONARY, certificate_pattern_fields, NULL
base::Value::TYPE_DICTIONARY, certificate_pattern_fields, NULL
};
const OncValueSignature kIPsecSignature = {
Value::TYPE_DICTIONARY, ipsec_fields, NULL
base::Value::TYPE_DICTIONARY, ipsec_fields, NULL
};
const OncValueSignature kL2TPSignature = {
Value::TYPE_DICTIONARY, l2tp_fields, NULL
base::Value::TYPE_DICTIONARY, l2tp_fields, NULL
};
const OncValueSignature kOpenVPNSignature = {
Value::TYPE_DICTIONARY, openvpn_fields, NULL
base::Value::TYPE_DICTIONARY, openvpn_fields, NULL
};
const OncValueSignature kVerifyX509Signature = {
Value::TYPE_DICTIONARY, verify_x509_fields, NULL
base::Value::TYPE_DICTIONARY, verify_x509_fields, NULL
};
const OncValueSignature kVPNSignature = {
Value::TYPE_DICTIONARY, vpn_fields, NULL
base::Value::TYPE_DICTIONARY, vpn_fields, NULL
};
const OncValueSignature kEthernetSignature = {
Value::TYPE_DICTIONARY, ethernet_fields, NULL
base::Value::TYPE_DICTIONARY, ethernet_fields, NULL
};
const OncValueSignature kIPConfigSignature = {
Value::TYPE_DICTIONARY, ipconfig_fields, NULL
base::Value::TYPE_DICTIONARY, ipconfig_fields, NULL
};
const OncValueSignature kProxyLocationSignature = {
Value::TYPE_DICTIONARY, proxy_location_fields, NULL
base::Value::TYPE_DICTIONARY, proxy_location_fields, NULL
};
const OncValueSignature kProxyManualSignature = {
Value::TYPE_DICTIONARY, proxy_manual_fields, NULL
base::Value::TYPE_DICTIONARY, proxy_manual_fields, NULL
};
const OncValueSignature kProxySettingsSignature = {
Value::TYPE_DICTIONARY, proxy_settings_fields, NULL
base::Value::TYPE_DICTIONARY, proxy_settings_fields, NULL
};
const OncValueSignature kWiFiSignature = {
Value::TYPE_DICTIONARY, wifi_fields, NULL
base::Value::TYPE_DICTIONARY, wifi_fields, NULL
};
const OncValueSignature kCertificateSignature = {
Value::TYPE_DICTIONARY, certificate_fields, NULL
base::Value::TYPE_DICTIONARY, certificate_fields, NULL
};
const OncValueSignature kNetworkConfigurationSignature = {
Value::TYPE_DICTIONARY, network_configuration_fields, NULL
base::Value::TYPE_DICTIONARY, network_configuration_fields, NULL
};
const OncValueSignature kGlobalNetworkConfigurationSignature = {
Value::TYPE_DICTIONARY, global_network_configuration_fields, NULL
base::Value::TYPE_DICTIONARY, global_network_configuration_fields, NULL
};
const OncValueSignature kCertificateListSignature = {
Value::TYPE_LIST, NULL, &kCertificateSignature
base::Value::TYPE_LIST, NULL, &kCertificateSignature
};
const OncValueSignature kNetworkConfigurationListSignature = {
Value::TYPE_LIST, NULL, &kNetworkConfigurationSignature
base::Value::TYPE_LIST, NULL, &kNetworkConfigurationSignature
};
const OncValueSignature kToplevelConfigurationSignature = {
Value::TYPE_DICTIONARY, toplevel_configuration_fields, NULL
base::Value::TYPE_DICTIONARY, toplevel_configuration_fields, NULL
};

// Derived "ONC with State" signatures.
const OncValueSignature kNetworkWithStateSignature = {
Value::TYPE_DICTIONARY, network_with_state_fields, NULL,
base::Value::TYPE_DICTIONARY, network_with_state_fields, NULL,
&kNetworkConfigurationSignature
};
const OncValueSignature kWiFiWithStateSignature = {
Value::TYPE_DICTIONARY, wifi_with_state_fields, NULL, &kWiFiSignature
base::Value::TYPE_DICTIONARY, wifi_with_state_fields, NULL, &kWiFiSignature
};
const OncValueSignature kCellularSignature = {
Value::TYPE_DICTIONARY, cellular_fields, NULL
base::Value::TYPE_DICTIONARY, cellular_fields, NULL
};
const OncValueSignature kCellularWithStateSignature = {
Value::TYPE_DICTIONARY, cellular_with_state_fields, NULL, &kCellularSignature
base::Value::TYPE_DICTIONARY, cellular_with_state_fields, NULL,
&kCellularSignature
};
const OncValueSignature kCellularProviderSignature = {
Value::TYPE_DICTIONARY, cellular_provider_fields, NULL
base::Value::TYPE_DICTIONARY, cellular_provider_fields, NULL
};
const OncValueSignature kCellularApnSignature = {
Value::TYPE_DICTIONARY, cellular_apn_fields, NULL
base::Value::TYPE_DICTIONARY, cellular_apn_fields, NULL
};

const OncFieldSignature* GetFieldSignature(const OncValueSignature& signature,
Expand Down
2 changes: 1 addition & 1 deletion chromeos/network/onc/onc_translator_shill_to_onc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void ShillToONCTranslator::TranslateAndAddListOfObjects(
const base::ListValue& list) {
const OncFieldSignature* field_signature =
GetFieldSignature(*onc_signature_, onc_field_name);
if (field_signature->value_signature->onc_type != Value::TYPE_LIST) {
if (field_signature->value_signature->onc_type != base::Value::TYPE_LIST) {
LOG(ERROR) << "ONC Field name: '" << onc_field_name << "' has type '"
<< field_signature->value_signature->onc_type
<< "', expected: base::Value::TYPE_LIST.";
Expand Down
2 changes: 1 addition & 1 deletion chromeos/network/shill_property_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void ShillPropertyHandler::ManagerPropertyChanged(const std::string& key,
UpdateObserved(ManagedState::MANAGED_TYPE_NETWORK, *vlist);
}
} else if (key == shill::kServiceCompleteListProperty) {
const ListValue* vlist = GetListValue(key, value);
const base::ListValue* vlist = GetListValue(key, value);
if (vlist) {
listener_->UpdateManagedList(ManagedState::MANAGED_TYPE_FAVORITE, *vlist);
UpdateProperties(ManagedState::MANAGED_TYPE_FAVORITE, *vlist);
Expand Down
2 changes: 1 addition & 1 deletion cloud_print/gcp20/prototype/cloud_print_requester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ GURL CreateUpdateUrl(const std::string& device_id) {

std::string LocalSettingsToJson(const LocalSettings& settings) {
base::DictionaryValue dictionary;
scoped_ptr<base::DictionaryValue> current(new DictionaryValue);
scoped_ptr<base::DictionaryValue> current(new base::DictionaryValue);

// TODO(maksymb): Formalize text as constants.
current->SetBoolean("local_discovery", settings.local_discovery);
Expand Down
6 changes: 3 additions & 3 deletions cloud_print/gcp20/prototype/privet_http_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessCreateJob(
*status_code = net::HTTP_OK;
switch (result) {
case LocalPrintJob::CREATE_SUCCESS:
response.reset(new DictionaryValue);
response.reset(new base::DictionaryValue);
response->SetString("job_id", job_id);
response->SetInteger("expires_in", expires_in);
return response.Pass();
Expand Down Expand Up @@ -354,7 +354,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessSubmitDoc(

// Create response
*status_code = net::HTTP_OK;
scoped_ptr<base::DictionaryValue> response(new DictionaryValue);
scoped_ptr<base::DictionaryValue> response(new base::DictionaryValue);
switch (status) {
case LocalPrintJob::SAVE_SUCCESS:
response->SetString("job_id", job_id);
Expand Down Expand Up @@ -422,7 +422,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessRegister(
!user.empty();

RegistrationErrorStatus status = REG_ERROR_INVALID_PARAMS;
scoped_ptr<base::DictionaryValue> response(new DictionaryValue);
scoped_ptr<base::DictionaryValue> response(new base::DictionaryValue);

if (params_present) {
response->SetString("action", action);
Expand Down
4 changes: 2 additions & 2 deletions cloud_print/service/service_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ bool ServiceState::IsValid() const {
}

std::string ServiceState::ToString() {
scoped_ptr<base::DictionaryValue> services(new DictionaryValue());
scoped_ptr<base::DictionaryValue> services(new base::DictionaryValue());

scoped_ptr<base::DictionaryValue> cloud_print(new DictionaryValue());
scoped_ptr<base::DictionaryValue> cloud_print(new base::DictionaryValue());
cloud_print->SetBoolean(kEnabledOptionName, true);

SetNotEmptyJsonString(cloud_print.get(), kEmailOptionName, email_);
Expand Down
8 changes: 4 additions & 4 deletions components/autofill/content/browser/wallet/full_wallet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ FullWallet::~FullWallet() {}

// static
scoped_ptr<FullWallet>
FullWallet::CreateFullWallet(const DictionaryValue& dictionary) {
const ListValue* required_actions_list;
FullWallet::CreateFullWallet(const base::DictionaryValue& dictionary) {
const base::ListValue* required_actions_list;
std::vector<RequiredAction> required_actions;
if (dictionary.GetList("required_action", &required_actions_list)) {
for (size_t i = 0; i < required_actions_list->GetSize(); ++i) {
Expand Down Expand Up @@ -97,7 +97,7 @@ scoped_ptr<FullWallet>
return scoped_ptr<FullWallet>();
}

const DictionaryValue* billing_address_dict;
const base::DictionaryValue* billing_address_dict;
if (!dictionary.GetDictionary("billing_address", &billing_address_dict)) {
DLOG(ERROR) << "Response from Google wallet missing billing address";
return scoped_ptr<FullWallet>();
Expand All @@ -110,7 +110,7 @@ scoped_ptr<FullWallet>
return scoped_ptr<FullWallet>();
}

const DictionaryValue* shipping_address_dict;
const base::DictionaryValue* shipping_address_dict;
scoped_ptr<Address> shipping_address;
if (dictionary.GetDictionary("shipping_address", &shipping_address_dict)) {
shipping_address =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@ class FullWalletTest : public testing::Test {
FullWalletTest() {}
protected:
void SetUpDictionary(const std::string& json) {
scoped_ptr<Value> value(base::JSONReader::Read(json));
scoped_ptr<base::Value> value(base::JSONReader::Read(json));
ASSERT_TRUE(value.get());
ASSERT_TRUE(value->IsType(Value::TYPE_DICTIONARY));
dict.reset(static_cast<DictionaryValue*>(value.release()));
ASSERT_TRUE(value->IsType(base::Value::TYPE_DICTIONARY));
dict.reset(static_cast<base::DictionaryValue*>(value.release()));
}
scoped_ptr<DictionaryValue> dict;
scoped_ptr<base::DictionaryValue> dict;
};

TEST_F(FullWalletTest, CreateFullWalletMissingExpirationMonth) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Address* CreateAddressInternal(const base::DictionaryValue& dictionary,

base::string16 address_line_1;
base::string16 address_line_2;
const ListValue* address_line_list;
const base::ListValue* address_line_list;
if (dictionary.GetList("postal_address.address_line", &address_line_list)) {
if (!address_line_list->GetString(0, &address_line_1))
DVLOG(1) << "Response from Google Wallet missing address line 1";
Expand Down
Loading

0 comments on commit 85ecd7e

Please sign in to comment.