diff options
author | DHNishi@gmail.com <DHNishi@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-14 02:13:58 +0000 |
---|---|---|
committer | DHNishi@gmail.com <DHNishi@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-14 02:13:58 +0000 |
commit | aa15e2e3f63bfe8357e7adbf8672a71e1db75e04 (patch) | |
tree | fdb42cbbd835d773b6fd72cf67c88a857f4bab22 /chrome/browser/extensions | |
parent | 375dd7d25b9007806f195f391e24b01fb069ba32 (diff) | |
download | chromium_src-aa15e2e3f63bfe8357e7adbf8672a71e1db75e04.zip chromium_src-aa15e2e3f63bfe8357e7adbf8672a71e1db75e04.tar.gz chromium_src-aa15e2e3f63bfe8357e7adbf8672a71e1db75e04.tar.bz2 |
c/b/extensions: Do not use Value::Create*.
src/tools/json_schema_compiler: Do not use Value::Create*.
BUG=160586
Review URL: https://chromiumcodereview.appspot.com/22885002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217444 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
73 files changed, 369 insertions, 360 deletions
diff --git a/chrome/browser/extensions/admin_policy_unittest.cc b/chrome/browser/extensions/admin_policy_unittest.cc index 3818cc6..4c41f02 100644 --- a/chrome/browser/extensions/admin_policy_unittest.cc +++ b/chrome/browser/extensions/admin_policy_unittest.cc @@ -50,13 +50,13 @@ TEST_F(ExtensionAdminPolicyTest, BlacklistedByDefault) { EXPECT_FALSE(ap::BlacklistedByDefault(NULL)); base::ListValue blacklist; - blacklist.Append(Value::CreateStringValue("http://www.google.com")); + blacklist.Append(new base::StringValue("http://www.google.com")); EXPECT_FALSE(ap::BlacklistedByDefault(&blacklist)); - blacklist.Append(Value::CreateStringValue("*")); + blacklist.Append(new base::StringValue("*")); EXPECT_TRUE(ap::BlacklistedByDefault(&blacklist)); blacklist.Clear(); - blacklist.Append(Value::CreateStringValue("*")); + blacklist.Append(new base::StringValue("*")); EXPECT_TRUE(ap::BlacklistedByDefault(&blacklist)); } @@ -71,11 +71,11 @@ TEST_F(ExtensionAdminPolicyTest, UserMayLoadRequired) { // Required extensions may load even if they're on the blacklist. base::ListValue blacklist; - blacklist.Append(Value::CreateStringValue(extension_->id())); + blacklist.Append(new base::StringValue(extension_->id())); EXPECT_TRUE(ap::UserMayLoad(&blacklist, NULL, NULL, NULL, extension_.get(), NULL)); - blacklist.Append(Value::CreateStringValue("*")); + blacklist.Append(new base::StringValue("*")); EXPECT_TRUE(ap::UserMayLoad(&blacklist, NULL, NULL, NULL, extension_.get(), NULL)); } @@ -98,12 +98,12 @@ TEST_F(ExtensionAdminPolicyTest, UserMayLoadWhitelisted) { CreateExtension(Manifest::INTERNAL); base::ListValue whitelist; - whitelist.Append(Value::CreateStringValue(extension_->id())); + whitelist.Append(new base::StringValue(extension_->id())); EXPECT_TRUE(ap::UserMayLoad(NULL, &whitelist, NULL, NULL, extension_.get(), NULL)); base::ListValue blacklist; - blacklist.Append(Value::CreateStringValue(extension_->id())); + blacklist.Append(new base::StringValue(extension_->id())); EXPECT_TRUE(ap::UserMayLoad(NULL, &whitelist, NULL, NULL, extension_.get(), NULL)); string16 error; @@ -118,7 +118,7 @@ TEST_F(ExtensionAdminPolicyTest, UserMayLoadBlacklisted) { // Blacklisted by default. base::ListValue blacklist; - blacklist.Append(Value::CreateStringValue("*")); + blacklist.Append(new base::StringValue("*")); EXPECT_FALSE(ap::UserMayLoad(&blacklist, NULL, NULL, NULL, extension_.get(), NULL)); string16 error; @@ -127,21 +127,21 @@ TEST_F(ExtensionAdminPolicyTest, UserMayLoadBlacklisted) { EXPECT_FALSE(error.empty()); // Extension on the blacklist, with and without wildcard. - blacklist.Append(Value::CreateStringValue(extension_->id())); + blacklist.Append(new base::StringValue(extension_->id())); EXPECT_FALSE(ap::UserMayLoad(&blacklist, NULL, NULL, NULL, extension_.get(), NULL)); blacklist.Clear(); - blacklist.Append(Value::CreateStringValue(extension_->id())); + blacklist.Append(new base::StringValue(extension_->id())); EXPECT_FALSE(ap::UserMayLoad(&blacklist, NULL, NULL, NULL, extension_.get(), NULL)); // With a whitelist. There's no such thing as a whitelist wildcard. base::ListValue whitelist; whitelist.Append( - Value::CreateStringValue("behllobkkfkfnphdnhnkndlbkcpglgmj")); + new base::StringValue("behllobkkfkfnphdnhnkndlbkcpglgmj")); EXPECT_FALSE(ap::UserMayLoad(&blacklist, &whitelist, NULL, NULL, extension_.get(), NULL)); - whitelist.Append(Value::CreateStringValue("*")); + whitelist.Append(new base::StringValue("*")); EXPECT_FALSE(ap::UserMayLoad(&blacklist, &whitelist, NULL, NULL, extension_.get(), NULL)); } diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc index 7fa2492..97b52f2 100644 --- a/chrome/browser/extensions/api/app_window/app_window_api.cc +++ b/chrome/browser/extensions/api/app_window/app_window_api.cc @@ -164,7 +164,7 @@ bool AppWindowCreateFunction::RunImpl() { window->GetBaseWindow()->Show(); base::DictionaryValue* result = new base::DictionaryValue; - result->Set("viewId", base::Value::CreateIntegerValue(view_id)); + result->Set("viewId", new base::FundamentalValue(view_id)); SetCreateResultFromShellWindow(window, result); result->SetBoolean("existingWindow", true); result->SetBoolean("injectTitlebar", false); @@ -311,10 +311,10 @@ bool AppWindowCreateFunction::RunImpl() { view_id = created_view->GetRoutingID(); base::DictionaryValue* result = new base::DictionaryValue; - result->Set("viewId", base::Value::CreateIntegerValue(view_id)); + result->Set("viewId", new base::FundamentalValue(view_id)); result->Set("injectTitlebar", - base::Value::CreateBooleanValue(inject_html_titlebar)); - result->Set("id", base::Value::CreateStringValue(shell_window->window_key())); + new base::FundamentalValue(inject_html_titlebar)); + result->Set("id", new base::StringValue(shell_window->window_key())); SetCreateResultFromShellWindow(shell_window, result); SetResult(result); diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc index 0055d9b0..1d71950 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc @@ -505,7 +505,7 @@ void BluetoothWriteFunction::Work() { success_ = socket_->Send(drainable_io_buffer.get()); if (success_) { if (drainable_io_buffer->BytesConsumed() > 0) - SetResult(base::Value::CreateIntegerValue( + SetResult(new base::FundamentalValue( drainable_io_buffer->BytesConsumed())); else results_.reset(); diff --git a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc index f4025f2..e44a17d 100644 --- a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc +++ b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc @@ -71,7 +71,7 @@ CloudPrintPrivateGetHostNameFunction::~CloudPrintPrivateGetHostNameFunction() { } bool CloudPrintPrivateGetHostNameFunction::RunImpl() { - SetResult(Value::CreateStringValue( + SetResult(new base::StringValue( CloudPrintTestsDelegate::instance() ? CloudPrintTestsDelegate::instance()->GetHostName() : net::GetHostName())); @@ -115,7 +115,7 @@ CloudPrintPrivateGetClientIdFunction::~CloudPrintPrivateGetClientIdFunction() { } bool CloudPrintPrivateGetClientIdFunction::RunImpl() { - SetResult(Value::CreateStringValue( + SetResult(new base::StringValue( CloudPrintTestsDelegate::instance() ? CloudPrintTestsDelegate::instance()->GetClientId() : google_apis::GetOAuth2ClientID(google_apis::CLIENT_CLOUD_PRINT))); diff --git a/chrome/browser/extensions/api/commands/command_service.cc b/chrome/browser/extensions/api/commands/command_service.cc index 13c70e1..2978a1f 100644 --- a/chrome/browser/extensions/api/commands/command_service.cc +++ b/chrome/browser/extensions/api/commands/command_service.cc @@ -43,7 +43,7 @@ std::string GetPlatformKeybindingKeyForAccelerator( void SetInitialBindingsHaveBeenAssigned( ExtensionPrefs* prefs, const std::string& extension_id) { prefs->UpdateExtensionPref(extension_id, kInitialBindingsHaveBeenAssigned, - base::Value::CreateBooleanValue(true)); + new base::FundamentalValue(true)); } bool InitialBindingsHaveBeenAssigned( diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store.cc b/chrome/browser/extensions/api/content_settings/content_settings_store.cc index ff58296..3b0c008 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_store.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_store.cc @@ -105,7 +105,7 @@ void ContentSettingsStore::SetExtensionContentSetting( map->DeleteValue(primary_pattern, secondary_pattern, type, identifier); } else { map->SetValue(primary_pattern, secondary_pattern, type, identifier, - base::Value::CreateIntegerValue(setting)); + new base::FundamentalValue(setting)); } } diff --git a/chrome/browser/extensions/api/cookies/cookies_helpers.cc b/chrome/browser/extensions/api/cookies/cookies_helpers.cc index fc578e8..b68146b 100644 --- a/chrome/browser/extensions/api/cookies/cookies_helpers.cc +++ b/chrome/browser/extensions/api/cookies/cookies_helpers.cc @@ -151,7 +151,7 @@ void AppendToTabIdList(Browser* browser, base::ListValue* tab_ids) { DCHECK(tab_ids); TabStripModel* tab_strip = browser->tab_strip_model(); for (int i = 0; i < tab_strip->count(); ++i) { - tab_ids->Append(Value::CreateIntegerValue( + tab_ids->Append(new base::FundamentalValue( ExtensionTabUtil::GetTabId(tab_strip->GetWebContentsAt(i)))); } } @@ -206,4 +206,4 @@ bool MatchFilter::MatchesDomain(const std::string& domain) { } } // namespace cookies_helpers -} // namespace extension +} // namespace extensions diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc index 68123b9..07c1b1b 100644 --- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc +++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc @@ -37,7 +37,7 @@ TEST(WebRequestConditionAttributeTest, CreateConditionAttribute) { scoped_refptr<const WebRequestConditionAttribute> result; StringValue string_value("main_frame"); ListValue resource_types; - resource_types.Append(Value::CreateStringValue("main_frame")); + resource_types.Append(new base::StringValue("main_frame")); // Test wrong condition name passed. error.clear(); @@ -78,7 +78,7 @@ TEST(WebRequestConditionAttributeTest, ResourceType) { ListValue resource_types; // The 'sub_frame' value is chosen arbitrarily, so as the corresponding // ResourceType::Type is not 0, the default value. - resource_types.Append(Value::CreateStringValue("sub_frame")); + resource_types.Append(new base::StringValue("sub_frame")); scoped_refptr<const WebRequestConditionAttribute> attribute = WebRequestConditionAttribute::Create( @@ -125,7 +125,7 @@ TEST(WebRequestConditionAttributeTest, ContentType) { base::MessageLoop::current()->Run(); ListValue content_types; - content_types.Append(Value::CreateStringValue("text/plain")); + content_types.Append(new base::StringValue("text/plain")); scoped_refptr<const WebRequestConditionAttribute> attribute_include = WebRequestConditionAttribute::Create( keys::kContentTypeKey, &content_types, &error); @@ -149,7 +149,7 @@ TEST(WebRequestConditionAttributeTest, ContentType) { url_request.response_headers()))); content_types.Clear(); - content_types.Append(Value::CreateStringValue("something/invalid")); + content_types.Append(new base::StringValue("something/invalid")); scoped_refptr<const WebRequestConditionAttribute> attribute_unincluded = WebRequestConditionAttribute::Create( keys::kContentTypeKey, &content_types, &error); @@ -358,12 +358,12 @@ scoped_ptr<DictionaryValue> GetDictionaryFromArray( // Ignoring return value, we already verified the entry is there. dictionary->RemoveWithoutPathExpansion(*name, &entry_owned); list->Append(entry_owned.release()); - list->Append(Value::CreateStringValue(*value)); + list->Append(new base::StringValue(*value)); dictionary->SetWithoutPathExpansion(*name, list); break; case Value::TYPE_LIST: // Just append to the list. CHECK(entry->GetAsList(&list)); - list->Append(Value::CreateStringValue(*value)); + list->Append(new base::StringValue(*value)); break; default: NOTREACHED(); // We never put other Values here. diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc index aa9bf22..2b34514 100644 --- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc +++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc @@ -95,7 +95,7 @@ class WebRequestRulesRegistryTest : public testing::Test { // https://www.example.com and cancels it linked_ptr<RulesRegistry::Rule> CreateRule1() { base::ListValue* scheme_http = new base::ListValue(); - scheme_http->Append(Value::CreateStringValue("http")); + scheme_http->Append(new base::StringValue("http")); base::DictionaryValue* http_condition_dict = new base::DictionaryValue(); http_condition_dict->Set(keys2::kSchemesKey, scheme_http); http_condition_dict->SetString(keys2::kHostSuffixKey, "example.com"); @@ -105,7 +105,7 @@ class WebRequestRulesRegistryTest : public testing::Test { keys::kRequestMatcherType); base::ListValue* scheme_https = new base::ListValue(); - scheme_http->Append(Value::CreateStringValue("https")); + scheme_http->Append(new base::StringValue("https")); base::DictionaryValue* https_condition_dict = new base::DictionaryValue(); https_condition_dict->Set(keys2::kSchemesKey, scheme_https); https_condition_dict->SetString(keys2::kHostSuffixKey, "example.com"); diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index a7d8732..b12a16c 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -250,7 +250,7 @@ bool DeveloperPrivateAutoUpdateFunction::RunImpl() { ExtensionUpdater* updater = GetExtensionUpdater(profile()); if (updater) updater->CheckNow(ExtensionUpdater::CheckParams()); - SetResult(Value::CreateBooleanValue(true)); + SetResult(new base::FundamentalValue(true)); return true; } @@ -1095,7 +1095,7 @@ void DeveloperPrivateLoadProjectFunction::GetUnpackedExtension( const Extension* extension = GetExtensionByPath(extensions, path); bool success = true; if (extension) { - SetResult(base::Value::CreateStringValue(extension->id())); + SetResult(new base::StringValue(extension->id())); } else { SetError("unable to load the project"); success = false; @@ -1154,7 +1154,7 @@ bool DeveloperPrivateChoosePathFunction::RunImpl() { void DeveloperPrivateChoosePathFunction::FileSelected( const base::FilePath& path) { - SetResult(base::Value::CreateStringValue( + SetResult(new base::StringValue( UTF16ToUTF8(path.LossyDisplayName()))); SendResponse(true); Release(); diff --git a/chrome/browser/extensions/api/dial/dial_api.cc b/chrome/browser/extensions/api/dial/dial_api.cc index 2a30d9a..02f6d82 100644 --- a/chrome/browser/extensions/api/dial/dial_api.cc +++ b/chrome/browser/extensions/api/dial/dial_api.cc @@ -167,7 +167,7 @@ bool DialDiscoverNowFunction::Respond() { if (!result_) error_ = kDialServiceError; - SetResult(base::Value::CreateBooleanValue(result_)); + SetResult(new base::FundamentalValue(result_)); return true; } diff --git a/chrome/browser/extensions/api/discovery/discovery_api_unittest.cc b/chrome/browser/extensions/api/discovery/discovery_api_unittest.cc index 223bc16..c01a226 100644 --- a/chrome/browser/extensions/api/discovery/discovery_api_unittest.cc +++ b/chrome/browser/extensions/api/discovery/discovery_api_unittest.cc @@ -58,7 +58,7 @@ std::string SuggestParamsToJSON(const std::string& link_url, std::string RemoveSuggestionParamsToJSON(const std::string& link_url) { std::string result; base::ListValue params; - params.Append(base::Value::CreateStringValue(link_url)); + params.Append(new base::StringValue(link_url)); base::JSONWriter::Write(¶ms, &result); return result; } diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc index 9f7dc63..7cc8a48 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api.cc @@ -1043,7 +1043,7 @@ void DownloadsDownloadFunction::OnStarted( VLOG(1) << __FUNCTION__ << " " << item << " " << error; if (item) { DCHECK_EQ(net::OK, error); - SetResult(base::Value::CreateIntegerValue(item->GetId())); + SetResult(new base::FundamentalValue(static_cast<int>(item->GetId()))); if (!creator_suggested_filename.empty()) { ExtensionDownloadsEventRouterData* data = ExtensionDownloadsEventRouterData::Get(item); @@ -1187,7 +1187,8 @@ bool DownloadsEraseFunction::RunImpl() { base::ListValue* json_results = new base::ListValue(); for (DownloadManager::DownloadVector::const_iterator it = results.begin(); it != results.end(); ++it) { - json_results->Append(base::Value::CreateIntegerValue((*it)->GetId())); + json_results->Append( + new base::FundamentalValue(static_cast<int>((*it)->GetId()))); (*it)->Remove(); } SetResult(json_results); @@ -1479,7 +1480,7 @@ void DownloadsGetFileIconFunction::OnIconURLExtracted(const std::string& url) { return; } RecordApiFunctions(DOWNLOADS_FUNCTION_GET_FILE_ICON); - SetResult(base::Value::CreateStringValue(url)); + SetResult(new base::StringValue(url)); SendResponse(true); } @@ -1819,7 +1820,8 @@ void ExtensionDownloadsEventRouter::OnDownloadRemoved( DispatchEvent(events::kOnDownloadErased, true, extensions::Event::WillDispatchCallback(), - base::Value::CreateIntegerValue(download_item->GetId())); + new base::FundamentalValue( + static_cast<int>(download_item->GetId()))); } void ExtensionDownloadsEventRouter::DispatchEvent( diff --git a/chrome/browser/extensions/api/extension_action/extension_action_api.cc b/chrome/browser/extensions/api/extension_action/extension_action_api.cc index a4c5a2c..e528f9b 100644 --- a/chrome/browser/extensions/api/extension_action/extension_action_api.cc +++ b/chrome/browser/extensions/api/extension_action/extension_action_api.cc @@ -253,7 +253,7 @@ void ExtensionActionAPI::SetBrowserActionVisibility( prefs->UpdateExtensionPref(extension_id, kBrowserActionVisible, - Value::CreateBooleanValue(visible)); + new base::FundamentalValue(visible)); content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED, content::Source<ExtensionPrefs>(prefs), @@ -655,28 +655,32 @@ bool ExtensionActionSetBadgeBackgroundColorFunction::RunExtensionAction() { } bool ExtensionActionGetTitleFunction::RunExtensionAction() { - SetResult(Value::CreateStringValue(extension_action_->GetTitle(tab_id_))); + SetResult(new base::StringValue(extension_action_->GetTitle(tab_id_))); return true; } bool ExtensionActionGetPopupFunction::RunExtensionAction() { SetResult( - Value::CreateStringValue(extension_action_->GetPopupUrl(tab_id_).spec())); + new base::StringValue(extension_action_->GetPopupUrl(tab_id_).spec())); return true; } bool ExtensionActionGetBadgeTextFunction::RunExtensionAction() { - SetResult(Value::CreateStringValue(extension_action_->GetBadgeText(tab_id_))); + SetResult(new base::StringValue(extension_action_->GetBadgeText(tab_id_))); return true; } bool ExtensionActionGetBadgeBackgroundColorFunction::RunExtensionAction() { base::ListValue* list = new base::ListValue(); SkColor color = extension_action_->GetBadgeBackgroundColor(tab_id_); - list->Append(Value::CreateIntegerValue(SkColorGetR(color))); - list->Append(Value::CreateIntegerValue(SkColorGetG(color))); - list->Append(Value::CreateIntegerValue(SkColorGetB(color))); - list->Append(Value::CreateIntegerValue(SkColorGetA(color))); + list->Append( + new base::FundamentalValue(static_cast<int>(SkColorGetR(color)))); + list->Append( + new base::FundamentalValue(static_cast<int>(SkColorGetG(color)))); + list->Append( + new base::FundamentalValue(static_cast<int>(SkColorGetB(color)))); + list->Append( + new base::FundamentalValue(static_cast<int>(SkColorGetA(color)))); SetResult(list); return true; } diff --git a/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc b/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc index d9db466..dc3b493 100644 --- a/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc +++ b/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc @@ -71,7 +71,7 @@ bool FeedbackPrivateGetUserEmailFunction::RunImpl() { FeedbackPrivateAPI::GetFactoryInstance()->GetForProfile( profile())->GetService(); DCHECK(service); - SetResult(base::Value::CreateStringValue(service->GetUserEmail())); + SetResult(new base::StringValue(service->GetUserEmail())); return true; } diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc index 7ebf9e2..99e761d 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api.cc @@ -490,7 +490,7 @@ bool FileSystemGetDisplayPathFunction::RunImpl() { return false; file_path = PrettifyPath(file_path); - SetResult(base::Value::CreateStringValue(file_path.value())); + SetResult(new base::StringValue(file_path.value())); return true; } @@ -613,7 +613,7 @@ bool FileSystemIsWritableEntryFunction::RunImpl() { bool is_writable = policy->CanReadWriteFileSystem(renderer_id, filesystem_id); - SetResult(base::Value::CreateBooleanValue(is_writable)); + SetResult(new base::FundamentalValue(is_writable)); return true; } diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.cc b/chrome/browser/extensions/api/font_settings/font_settings_api.cc index b5498a1..476adcb 100644 --- a/chrome/browser/extensions/api/font_settings/font_settings_api.cc +++ b/chrome/browser/extensions/api/font_settings/font_settings_api.cc @@ -303,7 +303,7 @@ bool FontSettingsSetFontFunction::RunImpl() { extension_id(), pref_path.c_str(), kExtensionPrefsScopeRegular, - Value::CreateStringValue(params->details.font_id)); + new base::StringValue(params->details.font_id)); return true; } @@ -343,8 +343,8 @@ bool FontSettingsGetFontListFunction::CopyFontsToResult( } base::DictionaryValue* font_name = new base::DictionaryValue(); - font_name->Set(kFontIdKey, Value::CreateStringValue(name)); - font_name->Set(kDisplayNameKey, Value::CreateStringValue(localized_name)); + font_name->Set(kFontIdKey, new base::StringValue(name)); + font_name->Set(kDisplayNameKey, new base::StringValue(localized_name)); result->Append(font_name); } diff --git a/chrome/browser/extensions/api/identity/experimental_identity_api.cc b/chrome/browser/extensions/api/identity/experimental_identity_api.cc index 2e01c4e..11e2408 100644 --- a/chrome/browser/extensions/api/identity/experimental_identity_api.cc +++ b/chrome/browser/extensions/api/identity/experimental_identity_api.cc @@ -102,7 +102,7 @@ bool ExperimentalIdentityGetAuthTokenFunction::RunImpl() { void ExperimentalIdentityGetAuthTokenFunction::CompleteFunctionWithResult( const std::string& access_token) { - SetResult(Value::CreateStringValue(access_token)); + SetResult(new base::StringValue(access_token)); SendResponse(true); Release(); // Balanced in RunImpl. } @@ -385,7 +385,7 @@ void ExperimentalIdentityLaunchWebAuthFlowFunction::OnAuthFlowFailure( void ExperimentalIdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( const GURL& redirect_url) { if (IsFinalRedirectURL(redirect_url)) { - SetResult(Value::CreateStringValue(redirect_url.spec())); + SetResult(new base::StringValue(redirect_url.spec())); SendResponse(true); Release(); // Balanced in RunImpl. } diff --git a/chrome/browser/extensions/api/identity/identity_api.cc b/chrome/browser/extensions/api/identity/identity_api.cc index 6a8beb7..128fb6e 100644 --- a/chrome/browser/extensions/api/identity/identity_api.cc +++ b/chrome/browser/extensions/api/identity/identity_api.cc @@ -129,7 +129,7 @@ bool IdentityGetAuthTokenFunction::RunImpl() { void IdentityGetAuthTokenFunction::CompleteFunctionWithResult( const std::string& access_token) { - SetResult(Value::CreateStringValue(access_token)); + SetResult(new base::StringValue(access_token)); SendResponse(true); Release(); // Balanced in RunImpl. } @@ -599,7 +599,7 @@ void IdentityLaunchWebAuthFlowFunction::OnAuthFlowFailure( void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( const GURL& redirect_url) { if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { - SetResult(Value::CreateStringValue(redirect_url.spec())); + SetResult(new base::StringValue(redirect_url.spec())); SendResponse(true); Release(); // Balanced in RunImpl. } diff --git a/chrome/browser/extensions/api/idltest/idltest_api.cc b/chrome/browser/extensions/api/idltest/idltest_api.cc index 98ef9b3..63e1efe 100644 --- a/chrome/browser/extensions/api/idltest/idltest_api.cc +++ b/chrome/browser/extensions/api/idltest/idltest_api.cc @@ -14,12 +14,12 @@ base::ListValue* CopyBinaryValueToIntegerList(const BinaryValue* input) { base::ListValue* output = new base::ListValue(); const char* input_buffer = input->GetBuffer(); for (size_t i = 0; i < input->GetSize(); i++) { - output->Append(Value::CreateIntegerValue(input_buffer[i])); + output->Append(new base::FundamentalValue(input_buffer[i])); } return output; } -} +} // namespace bool IdltestSendArrayBufferFunction::RunImpl() { BinaryValue* input = NULL; diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chrome/browser/extensions/api/input_ime/input_ime_api.cc index e14c620..20d89e6 100644 --- a/chrome/browser/extensions/api/input_ime/input_ime_api.cc +++ b/chrome/browser/extensions/api/input_ime/input_ime_api.cc @@ -111,7 +111,7 @@ class ImeObserver : public chromeos::InputMethodEngine::Observer { return; scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateStringValue(engine_id)); + args->Append(new base::StringValue(engine_id)); DispatchEventToExtension(profile_, extension_id_, events::kOnActivate, args.Pass()); @@ -122,7 +122,7 @@ class ImeObserver : public chromeos::InputMethodEngine::Observer { return; scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateStringValue(engine_id)); + args->Append(new base::StringValue(engine_id)); DispatchEventToExtension(profile_, extension_id_, events::kOnDeactivated, args.Pass()); @@ -149,7 +149,7 @@ class ImeObserver : public chromeos::InputMethodEngine::Observer { return; scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateIntegerValue(context_id)); + args->Append(new base::FundamentalValue(context_id)); DispatchEventToExtension(profile_, extension_id_, events::kOnBlur, args.Pass()); @@ -193,7 +193,7 @@ class ImeObserver : public chromeos::InputMethodEngine::Observer { dict->SetBoolean("capsLock", event.caps_lock); scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateStringValue(engine_id)); + args->Append(new base::StringValue(engine_id)); args->Append(dict); DispatchEventToExtension(profile_, extension_id_, @@ -208,21 +208,21 @@ class ImeObserver : public chromeos::InputMethodEngine::Observer { return; scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateStringValue(engine_id)); - args->Append(Value::CreateIntegerValue(candidate_id)); + args->Append(new base::StringValue(engine_id)); + args->Append(new base::FundamentalValue(candidate_id)); switch (button) { case chromeos::InputMethodEngine::MOUSE_BUTTON_MIDDLE: - args->Append(Value::CreateStringValue("middle")); + args->Append(new base::StringValue("middle")); break; case chromeos::InputMethodEngine::MOUSE_BUTTON_RIGHT: - args->Append(Value::CreateStringValue("right")); + args->Append(new base::StringValue("right")); break; case chromeos::InputMethodEngine::MOUSE_BUTTON_LEFT: // Default to left. default: - args->Append(Value::CreateStringValue("left")); + args->Append(new base::StringValue("left")); break; } @@ -236,8 +236,8 @@ class ImeObserver : public chromeos::InputMethodEngine::Observer { return; scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateStringValue(engine_id)); - args->Append(Value::CreateStringValue(menu_id)); + args->Append(new base::StringValue(engine_id)); + args->Append(new base::StringValue(menu_id)); DispatchEventToExtension(profile_, extension_id_, events::kOnMenuItemActivated, args.Pass()); @@ -255,7 +255,7 @@ class ImeObserver : public chromeos::InputMethodEngine::Observer { dict->SetInteger("anchor", anchor_pos); scoped_ptr<ListValue> args(new base::ListValue); - args->Append(Value::CreateStringValue(engine_id)); + args->Append(new base::StringValue(engine_id)); args->Append(dict); DispatchEventToExtension(profile_, extension_id_, @@ -266,7 +266,7 @@ class ImeObserver : public chromeos::InputMethodEngine::Observer { if (profile_ == NULL || extension_id_.empty()) return; scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateStringValue(engine_id)); + args->Append(new base::StringValue(engine_id)); DispatchEventToExtension(profile_, extension_id_, events::kOnReset, args.Pass()); @@ -436,7 +436,7 @@ bool InputImeSetCompositionFunction::RunImpl() { chromeos::InputMethodEngine* engine = InputImeEventRouter::GetInstance()->GetActiveEngine(extension_id()); if (!engine) { - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); return true; } @@ -471,7 +471,7 @@ bool InputImeSetCompositionFunction::RunImpl() { int selection_end = params.selection_end ? *params.selection_end : params.cursor; - SetResult(Value::CreateBooleanValue( + SetResult(new base::FundamentalValue( engine->SetComposition(params.context_id, params.text.c_str(), selection_start, selection_end, params.cursor, segments, &error_))); @@ -482,7 +482,7 @@ bool InputImeClearCompositionFunction::RunImpl() { chromeos::InputMethodEngine* engine = InputImeEventRouter::GetInstance()->GetActiveEngine(extension_id()); if (!engine) { - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); return true; } @@ -491,7 +491,7 @@ bool InputImeClearCompositionFunction::RunImpl() { const ClearComposition::Params::Parameters& params = parent_params->parameters; - SetResult(Value::CreateBooleanValue( + SetResult(new base::FundamentalValue( engine->ClearComposition(params.context_id, &error_))); return true; } @@ -501,7 +501,7 @@ bool InputImeCommitTextFunction::RunImpl() { chromeos::InputMethodEngine* engine = InputImeEventRouter::GetInstance()->GetActiveEngine(extension_id()); if (!engine) { - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); return true; } @@ -510,7 +510,7 @@ bool InputImeCommitTextFunction::RunImpl() { const CommitText::Params::Parameters& params = parent_params->parameters; - SetResult(Value::CreateBooleanValue( + SetResult(new base::FundamentalValue( engine->CommitText(params.context_id, params.text.c_str(), &error_))); return true; } @@ -526,7 +526,7 @@ bool InputImeSetCandidateWindowPropertiesFunction::RunImpl() { params.engine_id); if (!engine) { - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); return true; } @@ -535,7 +535,7 @@ bool InputImeSetCandidateWindowPropertiesFunction::RunImpl() { if (properties.visible && !engine->SetCandidateWindowVisible(*properties.visible, &error_)) { - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); return true; } @@ -568,7 +568,7 @@ bool InputImeSetCandidateWindowPropertiesFunction::RunImpl() { chromeos::InputMethodEngine::WINDOW_POS_CURSOR); } - SetResult(Value::CreateBooleanValue(true)); + SetResult(new base::FundamentalValue(true)); return true; } @@ -578,7 +578,7 @@ bool InputImeSetCandidatesFunction::RunImpl() { chromeos::InputMethodEngine* engine = InputImeEventRouter::GetInstance()->GetActiveEngine(extension_id()); if (!engine) { - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); return true; } @@ -605,7 +605,7 @@ bool InputImeSetCandidatesFunction::RunImpl() { } } - SetResult(Value::CreateBooleanValue( + SetResult(new base::FundamentalValue( engine->SetCandidates(params.context_id, candidates_out, &error_))); return true; } @@ -614,7 +614,7 @@ bool InputImeSetCursorPositionFunction::RunImpl() { chromeos::InputMethodEngine* engine = InputImeEventRouter::GetInstance()->GetActiveEngine(extension_id()); if (!engine) { - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); return true; } @@ -623,7 +623,7 @@ bool InputImeSetCursorPositionFunction::RunImpl() { const SetCursorPosition::Params::Parameters& params = parent_params->parameters; - SetResult(Value::CreateBooleanValue( + SetResult(new base::FundamentalValue( engine->SetCursorPosition(params.context_id, params.candidate_id, &error_))); return true; diff --git a/chrome/browser/extensions/api/management/management_api.cc b/chrome/browser/extensions/api/management/management_api.cc index 3e6b19e..b322cb6 100644 --- a/chrome/browser/extensions/api/management/management_api.cc +++ b/chrome/browser/extensions/api/management/management_api.cc @@ -678,7 +678,7 @@ void ManagementEventRouter::Observe( scoped_ptr<base::ListValue> args(new base::ListValue()); if (event_name == events::kOnExtensionUninstalled) { - args->Append(Value::CreateStringValue(extension->id())); + args->Append(new base::StringValue(extension->id())); } else { scoped_ptr<management::ExtensionInfo> info = CreateExtensionInfo( *extension, ExtensionSystem::Get(profile)); diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc index e3e974d..7e8436cc 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc @@ -414,7 +414,7 @@ void MediaGalleriesPrivateEjectDeviceFunction::HandleResponse( if (status == chrome::StorageMonitor::EJECT_NO_SUCH_DEVICE) result = EJECT_DEVICE_RESULT_CODE_NO_SUCH_DEVICE; - SetResult(base::StringValue::CreateStringValue( + SetResult(new base::StringValue( api::media_galleries_private::ToString(result))); SendResponse(true); } diff --git a/chrome/browser/extensions/api/module/module.cc b/chrome/browser/extensions/api/module/module.cc index d9c11b7..b1295d1 100644 --- a/chrome/browser/extensions/api/module/module.cc +++ b/chrome/browser/extensions/api/module/module.cc @@ -41,7 +41,7 @@ bool ExtensionSetUpdateUrlDataFunction::RunImpl() { ExtensionPrefs::Get(profile())->UpdateExtensionPref( extension_id(), extension::kUpdateURLData, - base::Value::CreateStringValue(data)); + new base::StringValue(data)); return true; } @@ -50,7 +50,7 @@ bool ExtensionIsAllowedIncognitoAccessFunction::RunImpl() { ExtensionSystem::Get(profile())->extension_service(); const Extension* extension = GetExtension(); - SetResult(Value::CreateBooleanValue( + SetResult(new base::FundamentalValue( ext_service->IsIncognitoEnabled(extension->id()))); return true; } @@ -60,7 +60,7 @@ bool ExtensionIsAllowedFileSchemeAccessFunction::RunImpl() { ExtensionSystem::Get(profile())->extension_service(); const Extension* extension = GetExtension(); - SetResult(Value::CreateBooleanValue( + SetResult(new base::FundamentalValue( ext_service->AllowFileAccess(extension))); return true; } diff --git a/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc b/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc index 26d989c..5cca660 100644 --- a/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc +++ b/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc @@ -44,7 +44,7 @@ void MusicManagerPrivateGetDeviceIdFunction::DeviceIdCallback( SetError(kDeviceIdNotSupported); response = false; } else { - SetResult(Value::CreateStringValue(device_id)); + SetResult(new base::StringValue(device_id)); response = true; } diff --git a/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc index 3971278..ff5fe1a 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc @@ -324,7 +324,7 @@ IN_PROC_BROWSER_TEST_P(ExtensionNetworkingPrivateApiTest, policy.Set(policy::key::kOpenNetworkConfiguration, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, - Value::CreateStringValue(user_policy_blob), + new base::StringValue(user_policy_blob), NULL); provider_.UpdateChromePolicy(policy); diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc index 257eb1a..962e162 100644 --- a/chrome/browser/extensions/api/notifications/notifications_api.cc +++ b/chrome/browser/extensions/api/notifications/notifications_api.cc @@ -149,7 +149,7 @@ class NotificationsApiDelegate : public NotificationDelegate { virtual void Close(bool by_user) OVERRIDE { scoped_ptr<base::ListValue> args(CreateBaseEventArgs()); - args->Append(Value::CreateBooleanValue(by_user)); + args->Append(new base::FundamentalValue(by_user)); SendEvent(event_names::kOnNotificationClosed, args.Pass()); } @@ -165,7 +165,7 @@ class NotificationsApiDelegate : public NotificationDelegate { virtual void ButtonClick(int index) OVERRIDE { scoped_ptr<base::ListValue> args(CreateBaseEventArgs()); - args->Append(Value::CreateIntegerValue(index)); + args->Append(new base::FundamentalValue(index)); SendEvent(event_names::kOnNotificationButtonClicked, args.Pass()); } @@ -202,7 +202,7 @@ class NotificationsApiDelegate : public NotificationDelegate { scoped_ptr<base::ListValue> CreateBaseEventArgs() { scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateStringValue(id_)); + args->Append(new base::StringValue(id_)); return args.Pass(); } @@ -491,7 +491,7 @@ bool NotificationsCreateFunction::RunNotificationsApi() { else notification_id = kNotificationPrefix + base::Uint64ToString(next_id_++); - SetResult(Value::CreateStringValue(notification_id)); + SetResult(new base::StringValue(notification_id)); // TODO(dewittj): Add more human-readable error strings if this fails. if (!CreateNotification(notification_id, ¶ms_->options)) @@ -518,7 +518,7 @@ bool NotificationsUpdateFunction::RunNotificationsApi() { g_browser_process->notification_ui_manager()->FindById( CreateScopedIdentifier(extension_->id(), params_->notification_id)); if (!matched_notification) { - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); SendResponse(true); return true; } @@ -530,7 +530,7 @@ bool NotificationsUpdateFunction::RunNotificationsApi() { Notification notification = *matched_notification; bool could_update_notification = UpdateNotification( params_->notification_id, ¶ms_->options, ¬ification); - SetResult(Value::CreateBooleanValue(could_update_notification)); + SetResult(new base::FundamentalValue(could_update_notification)); if (!could_update_notification) return false; @@ -553,7 +553,7 @@ bool NotificationsClearFunction::RunNotificationsApi() { bool cancel_result = g_browser_process->notification_ui_manager()->CancelById( CreateScopedIdentifier(extension_->id(), params_->notification_id)); - SetResult(Value::CreateBooleanValue(cancel_result)); + SetResult(new base::FundamentalValue(cancel_result)); SendResponse(true); return true; diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc index 06db5b8..18250ad 100644 --- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc +++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc @@ -127,8 +127,8 @@ bool ExtensionOmniboxEventRouter::OnInputChanged( return false; scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Set(0, Value::CreateStringValue(input)); - args->Set(1, Value::CreateIntegerValue(suggest_id)); + args->Set(0, new base::StringValue(input)); + args->Set(1, new base::FundamentalValue(suggest_id)); scoped_ptr<Event> event(new Event(events::kOnInputChanged, args.Pass())); event->restrict_to_profile = profile; @@ -154,13 +154,13 @@ void ExtensionOmniboxEventRouter::OnInputEntered( active_tab_permission_granter()->GrantIfRequested(extension); scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Set(0, Value::CreateStringValue(input)); + args->Set(0, new base::StringValue(input)); if (disposition == NEW_FOREGROUND_TAB) - args->Set(1, Value::CreateStringValue(kForegroundTabDisposition)); + args->Set(1, new base::StringValue(kForegroundTabDisposition)); else if (disposition == NEW_BACKGROUND_TAB) - args->Set(1, Value::CreateStringValue(kBackgroundTabDisposition)); + args->Set(1, new base::StringValue(kBackgroundTabDisposition)); else - args->Set(1, Value::CreateStringValue(kCurrentTabDisposition)); + args->Set(1, new base::StringValue(kCurrentTabDisposition)); scoped_ptr<Event> event(new Event(events::kOnInputEntered, args.Pass())); event->restrict_to_profile = profile; diff --git a/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc b/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc index 22e2015..b327840 100644 --- a/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc +++ b/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc @@ -52,13 +52,13 @@ TEST(ExtensionPermissionsAPIHelpers, Pack) { std::string expected_apis[] = { "tabs", "webRequest" }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(expected_apis); ++i) { - scoped_ptr<Value> value(Value::CreateStringValue(expected_apis[i])); + scoped_ptr<Value> value(new base::StringValue(expected_apis[i])); EXPECT_NE(api_list->end(), api_list->Find(*value)); } std::string expected_origins[] = { "http://a.com/*", "http://b.com/*" }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(expected_origins); ++i) { - scoped_ptr<Value> value(Value::CreateStringValue(expected_origins[i])); + scoped_ptr<Value> value(new base::StringValue(expected_origins[i])); EXPECT_NE(origin_list->end(), origin_list->Find(*value)); } @@ -78,9 +78,9 @@ TEST(ExtensionPermissionsAPIHelpers, Pack) { // into PermissionSets. TEST(ExtensionPermissionsAPIHelpers, Unpack) { scoped_ptr<base::ListValue> apis(new base::ListValue()); - apis->Append(Value::CreateStringValue("tabs")); + apis->Append(new base::StringValue("tabs")); scoped_ptr<base::ListValue> origins(new base::ListValue()); - origins->Append(Value::CreateStringValue("http://a.com/*")); + origins->Append(new base::StringValue("http://a.com/*")); scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); scoped_refptr<PermissionSet> permissions; @@ -114,7 +114,7 @@ TEST(ExtensionPermissionsAPIHelpers, Unpack) { Permissions permissions_object; value->Clear(); scoped_ptr<base::ListValue> invalid_apis(apis->DeepCopy()); - invalid_apis->Append(Value::CreateIntegerValue(3)); + invalid_apis->Append(new base::FundamentalValue(3)); value->Set("permissions", invalid_apis->DeepCopy()); EXPECT_FALSE(Permissions::Populate(*value, &permissions_object)); } @@ -124,7 +124,7 @@ TEST(ExtensionPermissionsAPIHelpers, Unpack) { Permissions permissions_object; value->Clear(); scoped_ptr<base::ListValue> invalid_origins(origins->DeepCopy()); - invalid_origins->Append(Value::CreateIntegerValue(3)); + invalid_origins->Append(new base::FundamentalValue(3)); value->Set("origins", invalid_origins->DeepCopy()); EXPECT_FALSE(Permissions::Populate(*value, &permissions_object)); } @@ -133,14 +133,14 @@ TEST(ExtensionPermissionsAPIHelpers, Unpack) { { Permissions permissions_object; value->Clear(); - value->Set("origins", Value::CreateIntegerValue(2)); + value->Set("origins", new base::FundamentalValue(2)); EXPECT_FALSE(Permissions::Populate(*value, &permissions_object)); } { Permissions permissions_object; value->Clear(); - value->Set("permissions", Value::CreateIntegerValue(2)); + value->Set("permissions", new base::FundamentalValue(2)); EXPECT_FALSE(Permissions::Populate(*value, &permissions_object)); } @@ -149,7 +149,7 @@ TEST(ExtensionPermissionsAPIHelpers, Unpack) { Permissions permissions_object; value->Clear(); value->Set("origins", origins->DeepCopy()); - value->Set("random", Value::CreateIntegerValue(3)); + value->Set("random", new base::FundamentalValue(3)); EXPECT_TRUE(Permissions::Populate(*value, &permissions_object)); permissions = UnpackPermissionSet(permissions_object, true, &error); EXPECT_TRUE(permissions.get()); @@ -162,7 +162,7 @@ TEST(ExtensionPermissionsAPIHelpers, Unpack) { Permissions permissions_object; value->Clear(); scoped_ptr<base::ListValue> invalid_apis(apis->DeepCopy()); - invalid_apis->Append(Value::CreateStringValue("unknown_permission")); + invalid_apis->Append(new base::StringValue("unknown_permission")); value->Set("permissions", invalid_apis->DeepCopy()); EXPECT_TRUE(Permissions::Populate(*value, &permissions_object)); permissions = UnpackPermissionSet(permissions_object, true, &error); diff --git a/chrome/browser/extensions/api/preference/preference_api.cc b/chrome/browser/extensions/api/preference/preference_api.cc index b792fd4..f5cc200 100644 --- a/chrome/browser/extensions/api/preference/preference_api.cc +++ b/chrome/browser/extensions/api/preference/preference_api.cc @@ -139,7 +139,7 @@ class InvertBooleanTransformer : public PrefTransformerInterface { bool bool_value = false; bool result = value->GetAsBoolean(&bool_value); DCHECK(result); - return Value::CreateBooleanValue(!bool_value); + return new base::FundamentalValue(!bool_value); } }; diff --git a/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc b/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc index 8a69ab3..e187224 100644 --- a/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc +++ b/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc @@ -182,7 +182,7 @@ class ControlledPrefsInstallOneExtension virtual void Initialize() OVERRIDE { InstallExtensionControlledPref(extension1(), kPref1, - Value::CreateStringValue("val1")); + new base::StringValue("val1")); } virtual void Verify() OVERRIDE { std::string actual = prefs()->pref_service()->GetString(kPref1); @@ -198,9 +198,9 @@ class ControlledPrefsInstallIncognitoPersistent public: virtual void Initialize() OVERRIDE { InstallExtensionControlledPref( - extension1(), kPref1, Value::CreateStringValue("val1")); + extension1(), kPref1, new base::StringValue("val1")); InstallExtensionControlledPrefIncognito( - extension1(), kPref1, Value::CreateStringValue("val2")); + extension1(), kPref1, new base::StringValue("val2")); scoped_ptr<PrefService> incog_prefs(prefs_.CreateIncognitoPrefService()); std::string actual = incog_prefs->GetString(kPref1); EXPECT_EQ("val2", actual); @@ -227,9 +227,9 @@ class ControlledPrefsInstallIncognitoSessionOnly virtual void Initialize() OVERRIDE { InstallExtensionControlledPref( - extension1(), kPref1, Value::CreateStringValue("val1")); + extension1(), kPref1, new base::StringValue("val1")); InstallExtensionControlledPrefIncognitoSessionOnly( - extension1(), kPref1, Value::CreateStringValue("val2")); + extension1(), kPref1, new base::StringValue("val2")); scoped_ptr<PrefService> incog_prefs(prefs_.CreateIncognitoPrefService()); std::string actual = incog_prefs->GetString(kPref1); EXPECT_EQ("val2", actual); @@ -258,9 +258,9 @@ TEST_F(ControlledPrefsInstallIncognitoSessionOnly, class ControlledPrefsUninstallExtension : public ExtensionControlledPrefsTest { virtual void Initialize() OVERRIDE { InstallExtensionControlledPref( - extension1(), kPref1, Value::CreateStringValue("val1")); + extension1(), kPref1, new base::StringValue("val1")); InstallExtensionControlledPref( - extension1(), kPref2, Value::CreateStringValue("val2")); + extension1(), kPref2, new base::StringValue("val2")); ContentSettingsStore* store = prefs()->content_settings_store(); ContentSettingsPattern pattern = ContentSettingsPattern::FromString("http://[*.]example.com"); @@ -308,7 +308,7 @@ class ControlledPrefsNotifyWhenNeeded : public ExtensionControlledPrefsTest { EXPECT_CALL(observer, OnPreferenceChanged(_)); EXPECT_CALL(incognito_observer, OnPreferenceChanged(_)); InstallExtensionControlledPref(extension1(), kPref1, - Value::CreateStringValue("https://www.chromium.org")); + new base::StringValue("https://www.chromium.org")); Mock::VerifyAndClearExpectations(&observer); Mock::VerifyAndClearExpectations(&incognito_observer); @@ -316,7 +316,7 @@ class ControlledPrefsNotifyWhenNeeded : public ExtensionControlledPrefsTest { EXPECT_CALL(observer, OnPreferenceChanged(_)).Times(0); EXPECT_CALL(incognito_observer, OnPreferenceChanged(_)).Times(0); InstallExtensionControlledPref(extension1(), kPref1, - Value::CreateStringValue("https://www.chromium.org")); + new base::StringValue("https://www.chromium.org")); Mock::VerifyAndClearExpectations(&observer); Mock::VerifyAndClearExpectations(&incognito_observer); @@ -324,14 +324,14 @@ class ControlledPrefsNotifyWhenNeeded : public ExtensionControlledPrefsTest { EXPECT_CALL(observer, OnPreferenceChanged(_)); EXPECT_CALL(incognito_observer, OnPreferenceChanged(_)); InstallExtensionControlledPref(extension1(), kPref1, - Value::CreateStringValue("chrome://newtab")); + new base::StringValue("chrome://newtab")); Mock::VerifyAndClearExpectations(&observer); Mock::VerifyAndClearExpectations(&incognito_observer); // Change only incognito persistent value. EXPECT_CALL(observer, OnPreferenceChanged(_)).Times(0); EXPECT_CALL(incognito_observer, OnPreferenceChanged(_)); InstallExtensionControlledPrefIncognito(extension1(), kPref1, - Value::CreateStringValue("chrome://newtab2")); + new base::StringValue("chrome://newtab2")); Mock::VerifyAndClearExpectations(&observer); Mock::VerifyAndClearExpectations(&incognito_observer); @@ -339,7 +339,7 @@ class ControlledPrefsNotifyWhenNeeded : public ExtensionControlledPrefsTest { EXPECT_CALL(observer, OnPreferenceChanged(_)).Times(0); EXPECT_CALL(incognito_observer, OnPreferenceChanged(_)); InstallExtensionControlledPrefIncognito(extension1(), kPref1, - Value::CreateStringValue("chrome://newtab3")); + new base::StringValue("chrome://newtab3")); Mock::VerifyAndClearExpectations(&observer); Mock::VerifyAndClearExpectations(&incognito_observer); @@ -365,7 +365,7 @@ TEST_F(ControlledPrefsNotifyWhenNeeded, class ControlledPrefsDisableExtension : public ExtensionControlledPrefsTest { virtual void Initialize() OVERRIDE { InstallExtensionControlledPref( - extension1(), kPref1, Value::CreateStringValue("val1")); + extension1(), kPref1, new base::StringValue("val1")); std::string actual = prefs()->pref_service()->GetString(kPref1); EXPECT_EQ("val1", actual); prefs()->SetExtensionState(extension1()->id(), Extension::DISABLED); @@ -381,7 +381,7 @@ TEST_F(ControlledPrefsDisableExtension, ControlledPrefsDisableExtension) { } class ControlledPrefsReenableExtension : public ExtensionControlledPrefsTest { virtual void Initialize() OVERRIDE { InstallExtensionControlledPref( - extension1(), kPref1, Value::CreateStringValue("val1")); + extension1(), kPref1, new base::StringValue("val1")); prefs()->SetExtensionState(extension1()->id(), Extension::DISABLED); prefs()->SetExtensionState(extension1()->id(), Extension::ENABLED); } @@ -448,7 +448,7 @@ class ControlledPrefsDisableExtensions : public ExtensionControlledPrefsTest { virtual ~ControlledPrefsDisableExtensions() {} virtual void Initialize() OVERRIDE { InstallExtensionControlledPref( - extension1(), kPref1, Value::CreateStringValue("val1")); + extension1(), kPref1, new base::StringValue("val1")); // This becomes only active in the second verification phase. prefs_.set_extensions_disabled(true); } diff --git a/chrome/browser/extensions/api/processes/processes_api.cc b/chrome/browser/extensions/api/processes/processes_api.cc index e1ab2a4..f8c583e 100644 --- a/chrome/browser/extensions/api/processes/processes_api.cc +++ b/chrome/browser/extensions/api/processes/processes_api.cc @@ -125,7 +125,7 @@ base::ListValue* GetTabsForProcess(int process_id) { if (contents) { tab_id = ExtensionTabUtil::GetTabId(contents); if (tab_id != -1) - tabs_list->Append(Value::CreateIntegerValue(tab_id)); + tabs_list->Append(new base::FundamentalValue(tab_id)); } } @@ -401,14 +401,14 @@ void ProcessesEventRouter::OnItemsToBeRemoved(int start, int length) { scoped_ptr<base::ListValue> args(new base::ListValue()); // First arg: The id of the process that was closed. - args->Append(Value::CreateIntegerValue( + args->Append(new base::FundamentalValue( model_->GetUniqueChildProcessId(start))); // Second arg: The exit type for the process. - args->Append(Value::CreateIntegerValue(0)); + args->Append(new base::FundamentalValue(0)); // Third arg: The exit code for the process. - args->Append(Value::CreateIntegerValue(0)); + args->Append(new base::FundamentalValue(0)); DispatchEvent(keys::kOnExited, args.Pass()); #endif // defined(ENABLE_TASK_MANAGER) @@ -452,13 +452,13 @@ void ProcessesEventRouter::ProcessClosedEvent( scoped_ptr<base::ListValue> args(new base::ListValue()); // First arg: The id of the process that was closed. - args->Append(Value::CreateIntegerValue(rph->GetID())); + args->Append(new base::FundamentalValue(rph->GetID())); // Second arg: The exit type for the process. - args->Append(Value::CreateIntegerValue(details->status)); + args->Append(new base::FundamentalValue(details->status)); // Third arg: The exit code for the process. - args->Append(Value::CreateIntegerValue(details->exit_code)); + args->Append(new base::FundamentalValue(details->exit_code)); DispatchEvent(keys::kOnExited, args.Pass()); #endif // defined(ENABLE_TASK_MANAGER) @@ -585,11 +585,11 @@ void GetProcessIdForTabFunction::GetProcessIdForTab() { error_ = ErrorUtils::FormatErrorMessage( extensions::tabs_constants::kTabNotFoundError, base::IntToString(tab_id_)); - SetResult(Value::CreateIntegerValue(-1)); + SetResult(new base::FundamentalValue(-1)); SendResponse(false); } else { int process_id = contents->GetRenderProcessHost()->GetID(); - SetResult(Value::CreateIntegerValue(process_id)); + SetResult(new base::FundamentalValue(process_id)); SendResponse(true); } @@ -664,7 +664,7 @@ void TerminateFunction::TerminateProcess() { base::IntToString(process_id_)); SendResponse(false); } else { - SetResult(Value::CreateBooleanValue(killed)); + SetResult(new base::FundamentalValue(killed)); SendResponse(true); } diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc index f0fc389..1c0d693 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc @@ -490,7 +490,7 @@ base::ListValue* TokenizeToStringList(const std::string& in, base::ListValue* out = new base::ListValue; base::StringTokenizer entries(in, delims); while (entries.GetNext()) - out->Append(Value::CreateStringValue(entries.token())); + out->Append(new base::StringValue(entries.token())); return out; } diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc index f830710..7a92fa4 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc @@ -204,8 +204,8 @@ TEST(ExtensionProxyApiHelpers, GetBypassListFromExtensionPref) { EXPECT_FALSE(bad_message); base::ListValue* bypass_list = new base::ListValue; - bypass_list->Append(Value::CreateStringValue("host1")); - bypass_list->Append(Value::CreateStringValue("host2")); + bypass_list->Append(new base::StringValue("host1")); + bypass_list->Append(new base::StringValue("host2")); base::DictionaryValue* proxy_rules = new base::DictionaryValue; proxy_rules->Set(keys::kProxyConfigBypassList, bypass_list); proxy_config.Set(keys::kProxyConfigRules, proxy_rules); @@ -323,9 +323,9 @@ TEST(ExtensionProxyApiHelpers, GetProxyServer) { TEST(ExtensionProxyApiHelpers, JoinUrlList) { bool bad_message = false; base::ListValue list; - list.Append(Value::CreateStringValue("s1")); - list.Append(Value::CreateStringValue("s2")); - list.Append(Value::CreateStringValue("s3")); + list.Append(new base::StringValue("s1")); + list.Append(new base::StringValue("s2")); + list.Append(new base::StringValue("s3")); std::string out; std::string error; @@ -355,7 +355,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyRulesDict) { expected->Set("fallbackProxy", CreateTestProxyServerDict("socks4", "proxy4", 80)); base::ListValue* bypass_list = new base::ListValue; - bypass_list->Append(Value::CreateStringValue("localhost")); + bypass_list->Append(new base::StringValue("localhost")); expected->Set(keys::kProxyConfigBypassList, bypass_list); EXPECT_TRUE(Value::Equals(expected.get(), extension_pref.get())); @@ -383,7 +383,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyRulesDictMultipleProxies) { expected->Set("fallbackProxy", CreateTestProxyServerDict("socks4", "proxy4", 80)); base::ListValue* bypass_list = new base::ListValue; - bypass_list->Append(Value::CreateStringValue("localhost")); + bypass_list->Append(new base::StringValue("localhost")); expected->Set(keys::kProxyConfigBypassList, bypass_list); EXPECT_TRUE(Value::Equals(expected.get(), extension_pref.get())); @@ -421,9 +421,9 @@ TEST(ExtensionProxyApiHelpers, CreatePacScriptDictWidthData) { TEST(ExtensionProxyApiHelpers, TokenizeToStringList) { base::ListValue expected; - expected.Append(Value::CreateStringValue("s1")); - expected.Append(Value::CreateStringValue("s2")); - expected.Append(Value::CreateStringValue("s3")); + expected.Append(new base::StringValue("s1")); + expected.Append(new base::StringValue("s2")); + expected.Append(new base::StringValue("s3")); scoped_ptr<base::ListValue> out(TokenizeToStringList("s1;s2;s3", ";")); EXPECT_TRUE(Value::Equals(&expected, out.get())); diff --git a/chrome/browser/extensions/api/rtc_private/rtc_private_api.cc b/chrome/browser/extensions/api/rtc_private/rtc_private_api.cc index 642a30a..ac1fe83 100644 --- a/chrome/browser/extensions/api/rtc_private/rtc_private_api.cc +++ b/chrome/browser/extensions/api/rtc_private/rtc_private_api.cc @@ -67,7 +67,7 @@ void GetContactIntentData(const Contact& contact, dict->Set(kPhoneIntentField, phone_list); for (int i = 0; i < contact.phone_numbers_size(); i++) { const Contact_PhoneNumber& phone_number = contact.phone_numbers(i); - StringValue* value = Value::CreateStringValue(phone_number.number()); + StringValue* value = new base::StringValue(phone_number.number()); if (phone_number.primary()) CHECK(phone_list->Insert(0, value)); else @@ -78,7 +78,7 @@ void GetContactIntentData(const Contact& contact, dict->Set(kEmailIntentField, email_list); for (int i = 0; i < contact.email_addresses_size(); i++) { const Contact_EmailAddress& email_address = contact.email_addresses(i); - StringValue* value = Value::CreateStringValue(email_address.address()); + StringValue* value = new base::StringValue(email_address.address()); if (email_address.primary()) CHECK(email_list->Insert(0, value)); else diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc index 6143f15..e54664e 100644 --- a/chrome/browser/extensions/api/runtime/runtime_api.cc +++ b/chrome/browser/extensions/api/runtime/runtime_api.cc @@ -114,7 +114,7 @@ void SetUninstallUrl(ExtensionPrefs* prefs, const std::string& url_string) { prefs->UpdateExtensionPref(extension_id, kUninstallUrl, - base::Value::CreateStringValue(url_string)); + new base::StringValue(url_string)); } std::string GetUninstallUrl(ExtensionPrefs* prefs, diff --git a/chrome/browser/extensions/api/serial/serial_api.cc b/chrome/browser/extensions/api/serial/serial_api.cc index b0e7925..b958944 100644 --- a/chrome/browser/extensions/api/serial/serial_api.cc +++ b/chrome/browser/extensions/api/serial/serial_api.cc @@ -65,7 +65,7 @@ void SerialGetPortsFunction::Work() { SerialPortEnumerator::GenerateValidSerialPortNames(); SerialPortEnumerator::StringSet::const_iterator i = port_names.begin(); while (i != port_names.end()) { - ports->Append(Value::CreateStringValue(*i++)); + ports->Append(new base::StringValue(*i++)); } SetResult(ports); @@ -182,7 +182,7 @@ void SerialCloseFunction::Work() { close_result = true; } - SetResult(Value::CreateBooleanValue(close_result)); + SetResult(new base::FundamentalValue(close_result)); } bool SerialCloseFunction::Respond() { @@ -294,7 +294,7 @@ void SerialFlushFunction::Work() { flush_result = true; } - SetResult(Value::CreateBooleanValue(flush_result)); + SetResult(new base::FundamentalValue(flush_result)); } bool SerialFlushFunction::Respond() { @@ -369,14 +369,14 @@ void SerialSetControlSignalsFunction::Work() { if (control_signals.should_set_rts) control_signals.rts = *(params_->options.rts); if (serial_connection->SetControlSignals(control_signals)) { - SetResult(Value::CreateBooleanValue(true)); + SetResult(new base::FundamentalValue(true)); } else { error_ = kErrorSetControlSignalsFailed; - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); } } else { error_ = kSerialConnectionNotFoundError; - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); } } diff --git a/chrome/browser/extensions/api/socket/socket_api.cc b/chrome/browser/extensions/api/socket/socket_api.cc index 6a43ce7..83f1e4e 100644 --- a/chrome/browser/extensions/api/socket/socket_api.cc +++ b/chrome/browser/extensions/api/socket/socket_api.cc @@ -186,7 +186,7 @@ void SocketConnectFunction::AsyncWorkStart() { socket_ = GetSocket(socket_id_); if (!socket_) { error_ = kSocketNotFoundError; - SetResult(Value::CreateIntegerValue(-1)); + SetResult(new base::FundamentalValue(-1)); AsyncWorkCompleted(); return; } @@ -209,7 +209,7 @@ void SocketConnectFunction::AsyncWorkStart() { if (!PermissionsData::CheckAPIPermissionWithParam( GetExtension(), APIPermission::kSocket, ¶m)) { error_ = kPermissionError; - SetResult(Value::CreateIntegerValue(-1)); + SetResult(new base::FundamentalValue(-1)); AsyncWorkCompleted(); return; } @@ -221,7 +221,7 @@ void SocketConnectFunction::AfterDnsLookup(int lookup_result) { if (lookup_result == net::OK) { StartConnect(); } else { - SetResult(Value::CreateIntegerValue(lookup_result)); + SetResult(new base::FundamentalValue(lookup_result)); AsyncWorkCompleted(); } } @@ -232,7 +232,7 @@ void SocketConnectFunction::StartConnect() { } void SocketConnectFunction::OnConnect(int result) { - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); AsyncWorkCompleted(); } @@ -263,7 +263,7 @@ void SocketBindFunction::Work() { if (!socket) { error_ = kSocketNotFoundError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } @@ -275,17 +275,17 @@ void SocketBindFunction::Work() { APIPermission::kSocket, ¶m)) { error_ = kPermissionError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } } else if (socket->GetSocketType() == Socket::TYPE_TCP) { error_ = kTCPSocketBindError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } result = socket->Bind(address_, port_); - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); } SocketListenFunction::SocketListenFunction() {} @@ -310,7 +310,7 @@ void SocketListenFunction::Work() { APIPermission::kSocket, ¶m)) { error_ = kPermissionError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } @@ -323,7 +323,7 @@ void SocketListenFunction::Work() { error_ = kSocketNotFoundError; } - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); } SocketAcceptFunction::SocketAcceptFunction() {} @@ -504,7 +504,7 @@ void SocketSendToFunction::AsyncWorkStart() { socket_ = GetSocket(socket_id_); if (!socket_) { error_ = kSocketNotFoundError; - SetResult(Value::CreateIntegerValue(-1)); + SetResult(new base::FundamentalValue(-1)); AsyncWorkCompleted(); return; } @@ -517,7 +517,7 @@ void SocketSendToFunction::AsyncWorkStart() { APIPermission::kSocket, ¶m)) { error_ = kPermissionError; - SetResult(Value::CreateIntegerValue(-1)); + SetResult(new base::FundamentalValue(-1)); AsyncWorkCompleted(); return; } @@ -530,7 +530,7 @@ void SocketSendToFunction::AfterDnsLookup(int lookup_result) { if (lookup_result == net::OK) { StartSendTo(); } else { - SetResult(Value::CreateIntegerValue(lookup_result)); + SetResult(new base::FundamentalValue(lookup_result)); AsyncWorkCompleted(); } } @@ -569,7 +569,7 @@ void SocketSetKeepAliveFunction::Work() { } else { error_ = kSocketNotFoundError; } - SetResult(Value::CreateBooleanValue(result)); + SetResult(new base::FundamentalValue(result)); } SocketSetNoDelayFunction::SocketSetNoDelayFunction() {} @@ -589,7 +589,7 @@ void SocketSetNoDelayFunction::Work() { result = socket->SetNoDelay(params_->no_delay); else error_ = kSocketNotFoundError; - SetResult(Value::CreateBooleanValue(result)); + SetResult(new base::FundamentalValue(result)); } SocketGetInfoFunction::SocketGetInfoFunction() {} @@ -701,13 +701,13 @@ void SocketJoinGroupFunction::Work() { Socket* socket = GetSocket(params_->socket_id); if (!socket) { error_ = kSocketNotFoundError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } if (socket->GetSocketType() != Socket::TYPE_UDP) { error_ = kMulticastSocketTypeError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } @@ -719,7 +719,7 @@ void SocketJoinGroupFunction::Work() { if (!PermissionsData::CheckAPIPermissionWithParam( GetExtension(), APIPermission::kSocket, ¶m)) { error_ = kPermissionError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } @@ -727,7 +727,7 @@ void SocketJoinGroupFunction::Work() { if (result != 0) { error_ = net::ErrorToString(result); } - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); } SocketLeaveGroupFunction::SocketLeaveGroupFunction() {} @@ -746,13 +746,13 @@ void SocketLeaveGroupFunction::Work() { if (!socket) { error_ = kSocketNotFoundError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } if (socket->GetSocketType() != Socket::TYPE_UDP) { error_ = kMulticastSocketTypeError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } @@ -764,14 +764,14 @@ void SocketLeaveGroupFunction::Work() { APIPermission::kSocket, ¶m)) { error_ = kPermissionError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } result = static_cast<UDPSocket*>(socket)->LeaveGroup(params_->address); if (result != 0) error_ = net::ErrorToString(result); - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); } SocketSetMulticastTimeToLiveFunction::SocketSetMulticastTimeToLiveFunction() {} @@ -788,13 +788,13 @@ void SocketSetMulticastTimeToLiveFunction::Work() { Socket* socket = GetSocket(params_->socket_id); if (!socket) { error_ = kSocketNotFoundError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } if (socket->GetSocketType() != Socket::TYPE_UDP) { error_ = kMulticastSocketTypeError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } @@ -802,7 +802,7 @@ void SocketSetMulticastTimeToLiveFunction::Work() { params_->ttl); if (result != 0) error_ = net::ErrorToString(result); - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); } SocketSetMulticastLoopbackModeFunction:: @@ -822,13 +822,13 @@ void SocketSetMulticastLoopbackModeFunction::Work() { Socket* socket = GetSocket(params_->socket_id); if (!socket) { error_ = kSocketNotFoundError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } if (socket->GetSocketType() != Socket::TYPE_UDP) { error_ = kMulticastSocketTypeError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } @@ -836,7 +836,7 @@ void SocketSetMulticastLoopbackModeFunction::Work() { SetMulticastLoopbackMode(params_->enabled); if (result != 0) error_ = net::ErrorToString(result); - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); } SocketGetJoinedGroupsFunction::SocketGetJoinedGroupsFunction() {} @@ -854,13 +854,13 @@ void SocketGetJoinedGroupsFunction::Work() { Socket* socket = GetSocket(params_->socket_id); if (!socket) { error_ = kSocketNotFoundError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } if (socket->GetSocketType() != Socket::TYPE_UDP) { error_ = kMulticastSocketTypeError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } @@ -873,7 +873,7 @@ void SocketGetJoinedGroupsFunction::Work() { APIPermission::kSocket, ¶m)) { error_ = kPermissionError; - SetResult(Value::CreateIntegerValue(result)); + SetResult(new base::FundamentalValue(result)); return; } diff --git a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc index 56f473e..e554b32 100644 --- a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc +++ b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc @@ -124,7 +124,7 @@ TEST_F(PolicyValueStoreTest, DontProvideRecommendedPolicies) { policy::POLICY_SCOPE_USER, expected.DeepCopy(), NULL); policies.Set("may", policy::POLICY_LEVEL_RECOMMENDED, policy::POLICY_SCOPE_USER, - base::Value::CreateIntegerValue(456), NULL); + new base::FundamentalValue(456), NULL); store_->SetCurrentPolicy(policies, false); ValueStore::ReadResult result = store_->Get(); ASSERT_FALSE(result->HasError()); @@ -155,7 +155,7 @@ TEST_F(PolicyValueStoreTest, ReadOnly) { TEST_F(PolicyValueStoreTest, NotifyOnChanges) { policy::PolicyMap policies; policies.Set("aaa", policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, - base::Value::CreateStringValue("111"), NULL); + new base::StringValue("111"), NULL); EXPECT_CALL(observer_, OnSettingsChanged(_, _, _)).Times(0); // No notification when setting the initial policy. store_->SetCurrentPolicy(policies, false); @@ -164,9 +164,9 @@ TEST_F(PolicyValueStoreTest, NotifyOnChanges) { // And no notifications on changes when not asked for. policies.Set("aaa", policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, - base::Value::CreateStringValue("222"), NULL); + new base::StringValue("222"), NULL); policies.Set("bbb", policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, - base::Value::CreateStringValue("223"), NULL); + new base::StringValue("223"), NULL); EXPECT_CALL(observer_, OnSettingsChanged(_, _, _)).Times(0); store_->SetCurrentPolicy(policies, false); loop_.RunUntilIdle(); diff --git a/chrome/browser/extensions/api/storage/settings_frontend.cc b/chrome/browser/extensions/api/storage/settings_frontend.cc index a14ed69..05dc82d 100644 --- a/chrome/browser/extensions/api/storage/settings_frontend.cc +++ b/chrome/browser/extensions/api/storage/settings_frontend.cc @@ -46,7 +46,7 @@ class DefaultObserver : public SettingsObserver { // string-based event payloads is removed. http://crbug.com/136045 scoped_ptr<base::ListValue> args(new base::ListValue()); args->Append(base::JSONReader::Read(change_json)); - args->Append(Value::CreateStringValue(settings_namespace::ToString( + args->Append(new base::StringValue(settings_namespace::ToString( settings_namespace))); scoped_ptr<Event> event(new Event( event_names::kOnSettingsChanged, args.Pass())); diff --git a/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc b/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc index 55bbaeb..9eb8e45 100644 --- a/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc @@ -35,7 +35,7 @@ scoped_ptr<Value> CreateKilobyte() { for (int i = 0; i < 1024; ++i) { kilobyte_string += "a"; } - return scoped_ptr<Value>(Value::CreateStringValue(kilobyte_string)); + return scoped_ptr<Value>(new base::StringValue(kilobyte_string)); } // Creates a megabyte of data. @@ -47,7 +47,7 @@ scoped_ptr<Value> CreateMegabyte() { return scoped_ptr<Value>(megabyte); } -} +} // namespace class ExtensionSettingsFrontendTest : public testing::Test { public: diff --git a/chrome/browser/extensions/api/storage/settings_quota_unittest.cc b/chrome/browser/extensions/api/storage/settings_quota_unittest.cc index 0e4ea79..d64c42c 100644 --- a/chrome/browser/extensions/api/storage/settings_quota_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_quota_unittest.cc @@ -25,12 +25,12 @@ const ValueStore::WriteOptions IGNORE_QUOTA = class ExtensionSettingsQuotaTest : public testing::Test { public: ExtensionSettingsQuotaTest() - : byte_value_1_(Value::CreateIntegerValue(1)), - byte_value_16_(Value::CreateStringValue("sixteen bytes.")), + : byte_value_1_(new base::FundamentalValue(1)), + byte_value_16_(new base::StringValue("sixteen bytes.")), byte_value_256_(new ListValue()), delegate_(new TestingValueStore()) { for (int i = 1; i < 89; ++i) { - byte_value_256_->Append(Value::CreateIntegerValue(i)); + byte_value_256_->Append(new base::FundamentalValue(i)); } ValidateByteValues(); } diff --git a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc index 9d55bdb..903ede8 100644 --- a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc @@ -307,7 +307,7 @@ TEST_F(ExtensionSettingsSyncTest, InSyncDataDoesNotInvokeSync) { StringValue value1("fooValue"); ListValue value2; - value2.Append(StringValue::CreateStringValue("barValue")); + value2.Append(new base::StringValue("barValue")); ValueStore* storage1 = AddExtensionAndGetStorage("s1", type); ValueStore* storage2 = AddExtensionAndGetStorage("s2", type); @@ -357,7 +357,7 @@ TEST_F(ExtensionSettingsSyncTest, LocalDataWithNoSyncDataIsPushedToSync) { StringValue value1("fooValue"); ListValue value2; - value2.Append(StringValue::CreateStringValue("barValue")); + value2.Append(new base::StringValue("barValue")); ValueStore* storage1 = AddExtensionAndGetStorage("s1", type); ValueStore* storage2 = AddExtensionAndGetStorage("s2", type); @@ -389,7 +389,7 @@ TEST_F(ExtensionSettingsSyncTest, AnySyncDataOverwritesLocalData) { StringValue value1("fooValue"); ListValue value2; - value2.Append(StringValue::CreateStringValue("barValue")); + value2.Append(new base::StringValue("barValue")); // Maintain dictionaries mirrored to the expected values of the settings in // each storage area. @@ -429,7 +429,7 @@ TEST_F(ExtensionSettingsSyncTest, ProcessSyncChanges) { StringValue value1("fooValue"); ListValue value2; - value2.Append(StringValue::CreateStringValue("barValue")); + value2.Append(new base::StringValue("barValue")); // Maintain dictionaries mirrored to the expected values of the settings in // each storage area. @@ -502,7 +502,7 @@ TEST_F(ExtensionSettingsSyncTest, PushToSync) { StringValue value1("fooValue"); ListValue value2; - value2.Append(StringValue::CreateStringValue("barValue")); + value2.Append(new base::StringValue("barValue")); // Make storage1/2 initialised from local data, storage3/4 initialised from // sync. @@ -641,7 +641,7 @@ TEST_F(ExtensionSettingsSyncTest, PushToSync) { TEST_F(ExtensionSettingsSyncTest, ExtensionAndAppSettingsSyncSeparately) { StringValue value1("fooValue"); ListValue value2; - value2.Append(StringValue::CreateStringValue("barValue")); + value2.Append(new base::StringValue("barValue")); // storage1 is an extension, storage2 is an app. ValueStore* storage1 = AddExtensionAndGetStorage( @@ -1390,7 +1390,7 @@ TEST_F(ExtensionSettingsSyncTest, Dots) { { syncer::SyncDataList sync_data_list; - scoped_ptr<Value> string_value(Value::CreateStringValue("value")); + scoped_ptr<Value> string_value(new base::StringValue("value")); sync_data_list.push_back(settings_sync_util::CreateData( "ext", "key.with.dot", *string_value, model_type)); @@ -1410,13 +1410,13 @@ TEST_F(ExtensionSettingsSyncTest, Dots) { DictionaryValue expected_data; expected_data.SetWithoutPathExpansion( "key.with.dot", - Value::CreateStringValue("value")); + new base::StringValue("value")); EXPECT_TRUE(Value::Equals(&expected_data, data->settings().get())); } // Test dots in keys going to sync. { - scoped_ptr<Value> string_value(Value::CreateStringValue("spot")); + scoped_ptr<Value> string_value(new base::StringValue("spot")); storage->Set(DEFAULTS, "key.with.spot", *string_value); ASSERT_EQ(1u, sync_processor_->changes().size()); diff --git a/chrome/browser/extensions/api/storage/settings_test_util.cc b/chrome/browser/extensions/api/storage/settings_test_util.cc index 07b635e..82c1845 100644 --- a/chrome/browser/extensions/api/storage/settings_test_util.cc +++ b/chrome/browser/extensions/api/storage/settings_test_util.cc @@ -68,7 +68,7 @@ void MockExtensionService::AddExtensionWithIdAndPermissions( scoped_ptr<base::ListValue> permissions(new base::ListValue()); for (std::set<std::string>::const_iterator it = permissions_set.begin(); it != permissions_set.end(); ++it) { - permissions->Append(Value::CreateStringValue(*it)); + permissions->Append(new base::StringValue(*it)); } manifest.Set("permissions", permissions.release()); diff --git a/chrome/browser/extensions/api/storage/storage_api.cc b/chrome/browser/extensions/api/storage/storage_api.cc index d86b763..f9c6831 100644 --- a/chrome/browser/extensions/api/storage/storage_api.cc +++ b/chrome/browser/extensions/api/storage/storage_api.cc @@ -235,7 +235,7 @@ bool StorageStorageAreaGetBytesInUseFunction::RunWithStorage( return false; } - SetResult(base::Value::CreateIntegerValue(bytes_in_use)); + SetResult(new base::FundamentalValue(static_cast<int>(bytes_in_use))); return true; } diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc index f318596..a400971 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc @@ -99,12 +99,12 @@ void SyncFileSystemDeleteFileSystemFunction::DidDeleteFileSystem( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (error != base::PLATFORM_FILE_OK) { error_ = base::StringPrintf(kFileError, static_cast<int>(error)); - SetResult(base::Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); SendResponse(false); return; } - SetResult(base::Value::CreateBooleanValue(true)); + SetResult(new base::FundamentalValue(true)); SendResponse(true); } @@ -380,7 +380,7 @@ bool SyncFileSystemGetConflictResolutionPolicyFunction::RunImpl() { api::sync_file_system::ConflictResolutionPolicy policy = ConflictResolutionPolicyToExtensionEnum( service->GetConflictResolutionPolicy()); - SetResult(Value::CreateStringValue( + SetResult(new base::StringValue( api::sync_file_system::ToString(policy))); return true; } diff --git a/chrome/browser/extensions/api/system_private/system_private_api.cc b/chrome/browser/extensions/api/system_private/system_private_api.cc index 55296e3..758f6b7 100644 --- a/chrome/browser/extensions/api/system_private/system_private_api.cc +++ b/chrome/browser/extensions/api/system_private/system_private_api.cc @@ -67,7 +67,7 @@ bool SystemPrivateGetIncognitoModeAvailabilityFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE( value >= 0 && value < static_cast<int>(arraysize(kIncognitoModeAvailabilityStrings))); - SetResult(Value::CreateStringValue(kIncognitoModeAvailabilityStrings[value])); + SetResult(new base::StringValue(kIncognitoModeAvailabilityStrings[value])); return true; } diff --git a/chrome/browser/extensions/api/system_storage/system_storage_api.cc b/chrome/browser/extensions/api/system_storage/system_storage_api.cc index cf640ab..4c2301e 100644 --- a/chrome/browser/extensions/api/system_storage/system_storage_api.cc +++ b/chrome/browser/extensions/api/system_storage/system_storage_api.cc @@ -87,7 +87,7 @@ void SystemStorageEjectDeviceFunction::HandleResponse( result = api::system_storage::EJECT_DEVICE_RESULT_CODE_FAILURE; } - SetResult(base::StringValue::CreateStringValue( + SetResult(new base::StringValue( api::system_storage::ToString(result))); SendResponse(true); } diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index d574db9..09f86ab 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -1951,7 +1951,7 @@ void TabsDetectLanguageFunction::Observe( } void TabsDetectLanguageFunction::GotLanguage(const std::string& language) { - SetResult(Value::CreateStringValue(language.c_str())); + SetResult(new base::StringValue(language.c_str())); SendResponse(true); Release(); // Balanced in Run() diff --git a/chrome/browser/extensions/api/tabs/windows_event_router.cc b/chrome/browser/extensions/api/tabs/windows_event_router.cc index 1138a73..e6a8a57 100644 --- a/chrome/browser/extensions/api/tabs/windows_event_router.cc +++ b/chrome/browser/extensions/api/tabs/windows_event_router.cc @@ -72,7 +72,7 @@ void WindowsEventRouter::OnWindowControllerRemoved( int window_id = window_controller->GetWindowId(); scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateIntegerValue(window_id)); + args->Append(new base::FundamentalValue(window_id)); DispatchEvent(event_names::kOnWindowRemoved, window_controller->profile(), args.Pass()); } @@ -117,11 +117,11 @@ static void WillDispatchWindowFocusedEvent(Profile* new_active_profile, !extensions::ExtensionSystem::Get(profile)->extension_service()-> CanCrossIncognito(extension)) { event_args->Clear(); - event_args->Append(Value::CreateIntegerValue( + event_args->Append(new base::FundamentalValue( extension_misc::kUnknownWindowId)); } else { event_args->Clear(); - event_args->Append(Value::CreateIntegerValue(window_id)); + event_args->Append(new base::FundamentalValue(window_id)); } } diff --git a/chrome/browser/extensions/api/test/test_api.cc b/chrome/browser/extensions/api/test/test_api.cc index cd55a58..5cf8051 100644 --- a/chrome/browser/extensions/api/test/test_api.cc +++ b/chrome/browser/extensions/api/test/test_api.cc @@ -117,7 +117,7 @@ bool TestSendMessageFunction::RunImpl() { TestSendMessageFunction::~TestSendMessageFunction() {} void TestSendMessageFunction::Reply(const std::string& message) { - SetResult(Value::CreateStringValue(message)); + SetResult(new base::StringValue(message)); SendResponse(true); Release(); // balanced in RunImpl } diff --git a/chrome/browser/extensions/api/usb/usb_api.cc b/chrome/browser/extensions/api/usb/usb_api.cc index 878e362..6fa3aa2 100644 --- a/chrome/browser/extensions/api/usb/usb_api.cc +++ b/chrome/browser/extensions/api/usb/usb_api.cc @@ -65,7 +65,7 @@ static const char kErrorCannotClaimInterface[] = "Error claiming interface."; static const char kErrorCannotReleaseInterface[] = "Error releasing interface."; static const char kErrorCannotSetInterfaceAlternateSetting[] = "Error setting alternate interface setting."; -static const char kErrorConvertDirection[] = "Invalid transfer direction."; +static const char kErrorConvertDirection[] = "Invalid transsfer direction."; static const char kErrorConvertRecipient[] = "Invalid transfer recipient."; static const char kErrorConvertRequestType[] = "Invalid request type."; static const char kErrorConvertSynchronizationType[] = @@ -1041,14 +1041,14 @@ void UsbResetDeviceFunction::OnCompleted(bool success) { base::Bind(&UsbResetDeviceFunction::OnError, this)); return; } - SetResult(Value::CreateBooleanValue(true)); + SetResult(new base::FundamentalValue(true)); AsyncWorkCompleted(); } void UsbResetDeviceFunction::OnError() { RemoveUsbDeviceResource(parameters_->device.handle); SetError(kErrorResetDevice); - SetResult(Value::CreateBooleanValue(false)); + SetResult(new base::FundamentalValue(false)); AsyncWorkCompleted(); } diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc index 86213ee..b684650 100644 --- a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc @@ -102,13 +102,13 @@ void DispatchOnCommitted(const char* event_name, content::PageTransitionGetCoreTransitionString(transition_type)); base::ListValue* qualifiers = new base::ListValue(); if (transition_type & content::PAGE_TRANSITION_CLIENT_REDIRECT) - qualifiers->Append(Value::CreateStringValue("client_redirect")); + qualifiers->Append(new base::StringValue("client_redirect")); if (transition_type & content::PAGE_TRANSITION_SERVER_REDIRECT) - qualifiers->Append(Value::CreateStringValue("server_redirect")); + qualifiers->Append(new base::StringValue("server_redirect")); if (transition_type & content::PAGE_TRANSITION_FORWARD_BACK) - qualifiers->Append(Value::CreateStringValue("forward_back")); + qualifiers->Append(new base::StringValue("forward_back")); if (transition_type & content::PAGE_TRANSITION_FROM_ADDRESS_BAR) - qualifiers->Append(Value::CreateStringValue("from_address_bar")); + qualifiers->Append(new base::StringValue("from_address_bar")); dict->Set(keys::kTransitionQualifiersKey, qualifiers); dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now())); args->Append(dict); diff --git a/chrome/browser/extensions/api/web_request/upload_data_presenter.cc b/chrome/browser/extensions/api/web_request/upload_data_presenter.cc index 8b34012..2870bc6 100644 --- a/chrome/browser/extensions/api/web_request/upload_data_presenter.cc +++ b/chrome/browser/extensions/api/web_request/upload_data_presenter.cc @@ -97,7 +97,7 @@ void RawDataPresenter::FeedNextBytes(const char* bytes, size_t size) { void RawDataPresenter::FeedNextFile(const std::string& filename) { // Insert the file path instead of the contents, which may be too large. subtle::AppendKeyValuePair(keys::kRequestBodyRawFileKey, - Value::CreateStringValue(filename), + new base::StringValue(filename), list_.get()); } diff --git a/chrome/browser/extensions/api/web_request/upload_data_presenter_unittest.cc b/chrome/browser/extensions/api/web_request/upload_data_presenter_unittest.cc index c445982..2309d1a 100644 --- a/chrome/browser/extensions/api/web_request/upload_data_presenter_unittest.cc +++ b/chrome/browser/extensions/api/web_request/upload_data_presenter_unittest.cc @@ -23,7 +23,7 @@ TEST(WebRequestUploadDataPresenterTest, ParsedData) { // Expected output. scoped_ptr<base::ListValue> values(new base::ListValue); - values->Append(base::Value::CreateStringValue("value")); + values->Append(new base::StringValue("value")); base::DictionaryValue expected_form; expected_form.SetWithoutPathExpansion("key.with.dots", values.release()); @@ -52,7 +52,7 @@ TEST(WebRequestUploadDataPresenterTest, RawData) { base::BinaryValue::CreateWithCopiedBuffer(block1, block1_size)); ASSERT_TRUE(expected_a.get() != NULL); scoped_ptr<base::StringValue> expected_b( - base::Value::CreateStringValue(kFilename)); + new base::StringValue(kFilename)); ASSERT_TRUE(expected_b.get() != NULL); scoped_ptr<base::BinaryValue> expected_c( base::BinaryValue::CreateWithCopiedBuffer(block2, block2_size)); diff --git a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc index 5c10c8d..19638b7 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc @@ -224,7 +224,7 @@ Value* NetLogModificationCallback( delta->modified_request_headers); while (modification.GetNext()) { std::string line = modification.name() + ": " + modification.value(); - modified_headers->Append(Value::CreateStringValue(line)); + modified_headers->Append(new base::StringValue(line)); } dict->Set("modified_headers", modified_headers); @@ -233,7 +233,7 @@ Value* NetLogModificationCallback( delta->deleted_request_headers.begin(); key != delta->deleted_request_headers.end(); ++key) { - deleted_headers->Append(Value::CreateStringValue(*key)); + deleted_headers->Append(new base::StringValue(*key)); } dict->Set("deleted_headers", deleted_headers); return dict; @@ -249,7 +249,7 @@ base::ListValue* StringToCharList(const std::string& s) { base::ListValue* result = new base::ListValue; for (size_t i = 0, n = s.size(); i < n; ++i) { result->Append( - Value::CreateIntegerValue( + new base::FundamentalValue( *reinterpret_cast<const unsigned char*>(&s[i]))); } return result; diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc index 6648611..1a71294 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc @@ -584,7 +584,7 @@ TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) { &raw); extensions::subtle::AppendKeyValuePair( keys::kRequestBodyRawFileKey, - Value::CreateStringValue(std::string()), + new base::StringValue(std::string()), &raw); extensions::subtle::AppendKeyValuePair( keys::kRequestBodyRawBytesKey, @@ -1165,11 +1165,11 @@ TEST(ExtensionWebRequestHelpersTest, TEST(ExtensionWebRequestHelpersTest, TestStringToCharList) { ListValue list_value; - list_value.Append(Value::CreateIntegerValue('1')); - list_value.Append(Value::CreateIntegerValue('2')); - list_value.Append(Value::CreateIntegerValue('3')); - list_value.Append(Value::CreateIntegerValue(0xFE)); - list_value.Append(Value::CreateIntegerValue(0xD1)); + list_value.Append(new base::FundamentalValue('1')); + list_value.Append(new base::FundamentalValue('2')); + list_value.Append(new base::FundamentalValue('3')); + list_value.Append(new base::FundamentalValue(0xFE)); + list_value.Append(new base::FundamentalValue(0xD1)); unsigned char char_value[] = {'1', '2', '3', 0xFE, 0xD1}; std::string string_value(reinterpret_cast<char *>(char_value), 5); diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc index 07cc111..565053e 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc @@ -357,34 +357,34 @@ void WebstorePrivateBeginInstallWithManifest3Function::SetResultCode( ResultCode code) { switch (code) { case ERROR_NONE: - SetResult(Value::CreateStringValue(std::string())); + SetResult(new base::StringValue(std::string())); break; case UNKNOWN_ERROR: - SetResult(Value::CreateStringValue("unknown_error")); + SetResult(new base::StringValue("unknown_error")); break; case USER_CANCELLED: - SetResult(Value::CreateStringValue("user_cancelled")); + SetResult(new base::StringValue("user_cancelled")); break; case MANIFEST_ERROR: - SetResult(Value::CreateStringValue("manifest_error")); + SetResult(new base::StringValue("manifest_error")); break; case ICON_ERROR: - SetResult(Value::CreateStringValue("icon_error")); + SetResult(new base::StringValue("icon_error")); break; case INVALID_ID: - SetResult(Value::CreateStringValue("invalid_id")); + SetResult(new base::StringValue("invalid_id")); break; case PERMISSION_DENIED: - SetResult(Value::CreateStringValue("permission_denied")); + SetResult(new base::StringValue("permission_denied")); break; case INVALID_ICON_URL: - SetResult(Value::CreateStringValue("invalid_icon_url")); + SetResult(new base::StringValue("invalid_icon_url")); break; case SIGNIN_FAILED: - SetResult(Value::CreateStringValue("signin_failed")); + SetResult(new base::StringValue("signin_failed")); break; case ALREADY_INSTALLED: - SetResult(Value::CreateStringValue("already_installed")); + SetResult(new base::StringValue("already_installed")); break; default: CHECK(false); @@ -640,7 +640,7 @@ bool WebstorePrivateGetBrowserLoginFunction::RunImpl() { } bool WebstorePrivateGetStoreLoginFunction::RunImpl() { - SetResult(Value::CreateStringValue(GetWebstoreLogin(profile_))); + SetResult(new base::StringValue(GetWebstoreLogin(profile_))); return true; } @@ -662,7 +662,7 @@ WebstorePrivateGetWebGLStatusFunction:: ~WebstorePrivateGetWebGLStatusFunction() {} void WebstorePrivateGetWebGLStatusFunction::CreateResult(bool webgl_allowed) { - SetResult(Value::CreateStringValue( + SetResult(new base::StringValue( webgl_allowed ? "webgl_allowed" : "webgl_blocked")); } @@ -678,14 +678,14 @@ void WebstorePrivateGetWebGLStatusFunction:: } bool WebstorePrivateGetIsLauncherEnabledFunction::RunImpl() { - SetResult(Value::CreateBooleanValue(apps::IsAppLauncherEnabled())); + SetResult(new base::FundamentalValue(apps::IsAppLauncherEnabled())); SendResponse(true); return true; } bool WebstorePrivateIsInIncognitoModeFunction::RunImpl() { SetResult( - Value::CreateBooleanValue(profile_ != profile_->GetOriginalProfile())); + new base::FundamentalValue(profile_ != profile_->GetOriginalProfile())); SendResponse(true); return true; } diff --git a/chrome/browser/extensions/browser_event_router.cc b/chrome/browser/extensions/browser_event_router.cc index ebbb8d0..db82d6b 100644 --- a/chrome/browser/extensions/browser_event_router.cc +++ b/chrome/browser/extensions/browser_event_router.cc @@ -201,12 +201,12 @@ void BrowserEventRouter::TabInsertedAt(WebContents* contents, } scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateIntegerValue(tab_id)); + args->Append(new base::FundamentalValue(tab_id)); DictionaryValue* object_args = new DictionaryValue(); - object_args->Set(tab_keys::kNewWindowIdKey, Value::CreateIntegerValue( + object_args->Set(tab_keys::kNewWindowIdKey, new base::FundamentalValue( ExtensionTabUtil::GetWindowIdOfTab(contents))); - object_args->Set(tab_keys::kNewPositionKey, Value::CreateIntegerValue( + object_args->Set(tab_keys::kNewPositionKey, new base::FundamentalValue( index)); args->Append(object_args); @@ -222,12 +222,13 @@ void BrowserEventRouter::TabDetachedAt(WebContents* contents, int index) { } scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateIntegerValue(ExtensionTabUtil::GetTabId(contents))); + args->Append( + new base::FundamentalValue(ExtensionTabUtil::GetTabId(contents))); DictionaryValue* object_args = new DictionaryValue(); - object_args->Set(tab_keys::kOldWindowIdKey, Value::CreateIntegerValue( + object_args->Set(tab_keys::kOldWindowIdKey, new base::FundamentalValue( ExtensionTabUtil::GetWindowIdOfTab(contents))); - object_args->Set(tab_keys::kOldPositionKey, Value::CreateIntegerValue( + object_args->Set(tab_keys::kOldPositionKey, new base::FundamentalValue( index)); args->Append(object_args); @@ -242,7 +243,7 @@ void BrowserEventRouter::TabClosingAt(TabStripModel* tab_strip_model, int tab_id = ExtensionTabUtil::GetTabId(contents); scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateIntegerValue(tab_id)); + args->Append(new base::FundamentalValue(tab_id)); DictionaryValue* object_args = new DictionaryValue(); object_args->SetInteger(tab_keys::kWindowIdKey, @@ -267,10 +268,10 @@ void BrowserEventRouter::ActiveTabChanged(WebContents* old_contents, int reason) { scoped_ptr<base::ListValue> args(new base::ListValue()); int tab_id = ExtensionTabUtil::GetTabId(new_contents); - args->Append(Value::CreateIntegerValue(tab_id)); + args->Append(new base::FundamentalValue(tab_id)); DictionaryValue* object_args = new DictionaryValue(); - object_args->Set(tab_keys::kWindowIdKey, Value::CreateIntegerValue( + object_args->Set(tab_keys::kWindowIdKey, new base::FundamentalValue( ExtensionTabUtil::GetWindowIdOfTab(new_contents))); args->Append(object_args); @@ -289,7 +290,7 @@ void BrowserEventRouter::ActiveTabChanged(WebContents* old_contents, // The onActivated event takes one argument: {windowId, tabId}. args->Remove(0, NULL); - object_args->Set(tab_keys::kTabIdKey, Value::CreateIntegerValue(tab_id)); + object_args->Set(tab_keys::kTabIdKey, new base::FundamentalValue(tab_id)); DispatchEvent(profile, events::kOnTabActivated, args.Pass(), gesture); } @@ -306,13 +307,13 @@ void BrowserEventRouter::TabSelectionChanged( if (!contents) break; int tab_id = ExtensionTabUtil::GetTabId(contents); - all->Append(Value::CreateIntegerValue(tab_id)); + all->Append(new base::FundamentalValue(tab_id)); } scoped_ptr<base::ListValue> args(new base::ListValue()); DictionaryValue* select_info = new DictionaryValue(); - select_info->Set(tab_keys::kWindowIdKey, Value::CreateIntegerValue( + select_info->Set(tab_keys::kWindowIdKey, new base::FundamentalValue( ExtensionTabUtil::GetWindowIdOfTabStripModel(tab_strip_model))); select_info->Set(tab_keys::kTabIdsKey, all); @@ -331,14 +332,15 @@ void BrowserEventRouter::TabMoved(WebContents* contents, int from_index, int to_index) { scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateIntegerValue(ExtensionTabUtil::GetTabId(contents))); + args->Append( + new base::FundamentalValue(ExtensionTabUtil::GetTabId(contents))); DictionaryValue* object_args = new DictionaryValue(); - object_args->Set(tab_keys::kWindowIdKey, Value::CreateIntegerValue( + object_args->Set(tab_keys::kWindowIdKey, new base::FundamentalValue( ExtensionTabUtil::GetWindowIdOfTab(contents))); - object_args->Set(tab_keys::kFromIndexKey, Value::CreateIntegerValue( + object_args->Set(tab_keys::kFromIndexKey, new base::FundamentalValue( from_index)); - object_args->Set(tab_keys::kToIndexKey, Value::CreateIntegerValue( + object_args->Set(tab_keys::kToIndexKey, new base::FundamentalValue( to_index)); args->Append(object_args); @@ -415,7 +417,7 @@ void BrowserEventRouter::DispatchSimpleBrowserEvent( return; scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateIntegerValue(window_id)); + args->Append(new base::FundamentalValue(window_id)); DispatchEvent(profile, event_name, args.Pass(), EventRouter::USER_GESTURE_UNKNOWN); @@ -518,8 +520,8 @@ void BrowserEventRouter::TabReplacedAt(TabStripModel* tab_strip_model, const int new_tab_id = ExtensionTabUtil::GetTabId(new_contents); const int old_tab_id = ExtensionTabUtil::GetTabId(old_contents); scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateIntegerValue(new_tab_id)); - args->Append(Value::CreateIntegerValue(old_tab_id)); + args->Append(new base::FundamentalValue(new_tab_id)); + args->Append(new base::FundamentalValue(old_tab_id)); DispatchEvent(Profile::FromBrowserContext(new_contents->GetBrowserContext()), events::kOnTabReplaced, @@ -560,13 +562,13 @@ void BrowserEventRouter::DispatchOldPageActionEvent( const std::string& url, int button) { scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateStringValue(page_action_id)); + args->Append(new base::StringValue(page_action_id)); DictionaryValue* data = new DictionaryValue(); - data->Set(tab_keys::kTabIdKey, Value::CreateIntegerValue(tab_id)); - data->Set(tab_keys::kTabUrlKey, Value::CreateStringValue(url)); + data->Set(tab_keys::kTabIdKey, new base::FundamentalValue(tab_id)); + data->Set(tab_keys::kTabUrlKey, new base::StringValue(url)); data->Set(page_actions_keys::kButtonKey, - Value::CreateIntegerValue(button)); + new base::FundamentalValue(button)); args->Append(data); DispatchEventToExtension(profile, extension_id, "pageActions", args.Pass(), diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc index f6fbea7..16ab729 100644 --- a/chrome/browser/extensions/convert_user_script.cc +++ b/chrome/browser/extensions/convert_user_script.cc @@ -102,7 +102,7 @@ scoped_refptr<Extension> ConvertUserScriptToExtension( root->SetBoolean(keys::kConvertedFromUserScript, true); base::ListValue* js_files = new base::ListValue(); - js_files->Append(Value::CreateStringValue("script.js")); + js_files->Append(new base::StringValue("script.js")); // If the script provides its own match patterns, we use those. Otherwise, we // generate some using the include globs. @@ -110,12 +110,12 @@ scoped_refptr<Extension> ConvertUserScriptToExtension( if (!script.url_patterns().is_empty()) { for (URLPatternSet::const_iterator i = script.url_patterns().begin(); i != script.url_patterns().end(); ++i) { - matches->Append(Value::CreateStringValue(i->GetAsString())); + matches->Append(new base::StringValue(i->GetAsString())); } } else { // TODO(aa): Derive tighter matches where possible. - matches->Append(Value::CreateStringValue("http://*/*")); - matches->Append(Value::CreateStringValue("https://*/*")); + matches->Append(new base::StringValue("http://*/*")); + matches->Append(new base::StringValue("https://*/*")); } // Read the exclude matches, if any are present. @@ -124,17 +124,17 @@ scoped_refptr<Extension> ConvertUserScriptToExtension( for (URLPatternSet::const_iterator i = script.exclude_url_patterns().begin(); i != script.exclude_url_patterns().end(); ++i) { - exclude_matches->Append(Value::CreateStringValue(i->GetAsString())); + exclude_matches->Append(new base::StringValue(i->GetAsString())); } } base::ListValue* includes = new base::ListValue(); for (size_t i = 0; i < script.globs().size(); ++i) - includes->Append(Value::CreateStringValue(script.globs().at(i))); + includes->Append(new base::StringValue(script.globs().at(i))); base::ListValue* excludes = new base::ListValue(); for (size_t i = 0; i < script.exclude_globs().size(); ++i) - excludes->Append(Value::CreateStringValue(script.exclude_globs().at(i))); + excludes->Append(new base::StringValue(script.exclude_globs().at(i))); DictionaryValue* content_script = new DictionaryValue(); content_script->Set(keys::kMatches, matches); diff --git a/chrome/browser/extensions/convert_web_app.cc b/chrome/browser/extensions/convert_web_app.cc index 5f844ab..dc3d946 100644 --- a/chrome/browser/extensions/convert_web_app.cc +++ b/chrome/browser/extensions/convert_web_app.cc @@ -57,7 +57,7 @@ std::string GenerateKey(const GURL& manifest_url) { return key; } -} +} // namespace // Generates a version for the converted app using the current date. This isn't @@ -133,14 +133,14 @@ scoped_refptr<Extension> ConvertWebAppToExtension( base::ListValue* permissions = new base::ListValue(); root->Set(keys::kPermissions, permissions); for (size_t i = 0; i < web_app.permissions.size(); ++i) { - permissions->Append(Value::CreateStringValue(web_app.permissions[i])); + permissions->Append(new base::StringValue(web_app.permissions[i])); } // Add the URLs. base::ListValue* urls = new base::ListValue(); root->Set(keys::kWebURLs, urls); for (size_t i = 0; i < web_app.urls.size(); ++i) { - urls->Append(Value::CreateStringValue(web_app.urls[i].spec())); + urls->Append(new base::StringValue(web_app.urls[i].spec())); } // Write the manifest. diff --git a/chrome/browser/extensions/event_router.cc b/chrome/browser/extensions/event_router.cc index f84b5f3..0932d6c 100644 --- a/chrome/browser/extensions/event_router.cc +++ b/chrome/browser/extensions/event_router.cc @@ -130,7 +130,7 @@ void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender, } ListValue args; - args.Set(0, Value::CreateStringValue(event_name)); + args.Set(0, new base::StringValue(event_name)); args.Set(1, event_args); args.Set(2, info.AsValue().release()); ipc_sender->Send(new ExtensionMsg_MessageInvoke( diff --git a/chrome/browser/extensions/extension_keybinding_registry.cc b/chrome/browser/extensions/extension_keybinding_registry.cc index edc6bde..4a87ddd 100644 --- a/chrome/browser/extensions/extension_keybinding_registry.cc +++ b/chrome/browser/extensions/extension_keybinding_registry.cc @@ -71,7 +71,7 @@ void ExtensionKeybindingRegistry::CommandExecuted( granter->GrantIfRequested(extension); scoped_ptr<base::ListValue> args(new base::ListValue()); - args->Append(Value::CreateStringValue(command)); + args->Append(new base::StringValue(command)); scoped_ptr<Event> event(new Event("commands.onCommand", args.Pass())); event->restrict_to_profile = profile_; diff --git a/chrome/browser/extensions/extension_override_apitest.cc b/chrome/browser/extensions/extension_override_apitest.cc index dcaa3cd..79a0119 100644 --- a/chrome/browser/extensions/extension_override_apitest.cc +++ b/chrome/browser/extensions/extension_override_apitest.cc @@ -127,7 +127,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, ShouldCleanUpDuplicateEntries) { // the file already contains dupes when an extension is loaded. base::ListValue* list = new base::ListValue(); for (size_t i = 0; i < 3; ++i) - list->Append(Value::CreateStringValue("http://www.google.com/")); + list->Append(new base::StringValue("http://www.google.com/")); { DictionaryPrefUpdate update(browser()->profile()->GetPrefs(), diff --git a/chrome/browser/extensions/extension_pref_value_map_unittest.cc b/chrome/browser/extensions/extension_pref_value_map_unittest.cc index 7f1b2d5..a7e3b68 100644 --- a/chrome/browser/extensions/extension_pref_value_map_unittest.cc +++ b/chrome/browser/extensions/extension_pref_value_map_unittest.cc @@ -23,7 +23,7 @@ const char kPref4[] = "path4"; } // namespace static Value* CreateVal(const char* str) { - return Value::CreateStringValue(str); + return new base::StringValue(str); } static base::Time CreateTime(int64 t) { diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc index e741f12..78d5f1e 100644 --- a/chrome/browser/extensions/extension_prefs.cc +++ b/chrome/browser/extensions/extension_prefs.cc @@ -581,7 +581,7 @@ void ExtensionPrefs::SetExtensionPrefPermissionSet( tmp->Set(i->name(), detail.release()); api_values->Append(tmp); } else { - api_values->Append(Value::CreateStringValue(i->name())); + api_values->Append(new base::StringValue(i->name())); } } UpdateExtensionPref(extension_id, api_pref, api_values); @@ -607,7 +607,7 @@ int ExtensionPrefs::IncrementAcknowledgePromptCount( ReadPrefAsInteger(extension_id, kPrefAcknowledgePromptCount, &count); ++count; UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount, - Value::CreateIntegerValue(count)); + new base::FundamentalValue(count)); return count; } @@ -620,7 +620,7 @@ void ExtensionPrefs::AcknowledgeExternalExtension( const std::string& extension_id) { DCHECK(Extension::IdIsValid(extension_id)); UpdateExtensionPref(extension_id, kPrefExternalAcknowledged, - Value::CreateBooleanValue(true)); + new base::FundamentalValue(true)); UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount, NULL); } @@ -633,7 +633,7 @@ void ExtensionPrefs::AcknowledgeBlacklistedExtension( const std::string& extension_id) { DCHECK(Extension::IdIsValid(extension_id)); UpdateExtensionPref(extension_id, kPrefBlacklistAcknowledged, - Value::CreateBooleanValue(true)); + new base::FundamentalValue(true)); UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount, NULL); } @@ -646,7 +646,7 @@ void ExtensionPrefs::SetExternalInstallFirstRun( const std::string& extension_id) { DCHECK(Extension::IdIsValid(extension_id)); UpdateExtensionPref(extension_id, kPrefExternalInstallFirstRun, - Value::CreateBooleanValue(true)); + new base::FundamentalValue(true)); } bool ExtensionPrefs::SetAlertSystemFirstRun() { @@ -671,7 +671,7 @@ bool ExtensionPrefs::DidExtensionEscalatePermissions( void ExtensionPrefs::SetDidExtensionEscalatePermissions( const Extension* extension, bool did_escalate) { UpdateExtensionPref(extension->id(), kExtensionDidEscalatePermissions, - Value::CreateBooleanValue(did_escalate)); + new base::FundamentalValue(did_escalate)); } int ExtensionPrefs::GetDisableReasons(const std::string& extension_id) { @@ -688,7 +688,7 @@ void ExtensionPrefs::AddDisableReason(const std::string& extension_id, int new_value = GetDisableReasons(extension_id) | static_cast<int>(disable_reason); UpdateExtensionPref(extension_id, kPrefDisableReasons, - Value::CreateIntegerValue(new_value)); + new base::FundamentalValue(new_value)); } void ExtensionPrefs::RemoveDisableReason( @@ -700,7 +700,7 @@ void ExtensionPrefs::RemoveDisableReason( UpdateExtensionPref(extension_id, kPrefDisableReasons, NULL); } else { UpdateExtensionPref(extension_id, kPrefDisableReasons, - Value::CreateIntegerValue(new_value)); + new base::FundamentalValue(new_value)); } } @@ -832,7 +832,7 @@ bool ExtensionPrefs::GetActiveBit(const std::string& extension_id) { void ExtensionPrefs::SetActiveBit(const std::string& extension_id, bool active) { UpdateExtensionPref(extension_id, kActiveBit, - Value::CreateBooleanValue(active)); + new base::FundamentalValue(active)); } void ExtensionPrefs::MigratePermissions(const ExtensionIdList& extension_ids) { @@ -866,7 +866,7 @@ void ExtensionPrefs::MigratePermissions(const ExtensionIdList& extension_ids) { std::string plugin_name = info->GetByID( APIPermission::kPlugin)->name(); - new_apis->Append(Value::CreateStringValue(plugin_name)); + new_apis->Append(new base::StringValue(plugin_name)); UpdateExtensionPref(*ext_id, granted_apis, new_apis); } @@ -909,7 +909,7 @@ void ExtensionPrefs::MigrateDisableReasons( } UpdateExtensionPref(*ext_id, kPrefDisableReasons, - Value::CreateIntegerValue(new_value)); + new base::FundamentalValue(new_value)); // Remove the old disable reason. UpdateExtensionPref(*ext_id, kDeprecatedPrefDisableReason, NULL); } @@ -973,7 +973,7 @@ void ExtensionPrefs::SetActivePermissions( void ExtensionPrefs::SetExtensionRunning(const std::string& extension_id, bool is_running) { - Value* value = Value::CreateBooleanValue(is_running); + Value* value = new base::FundamentalValue(is_running); UpdateExtensionPref(extension_id, kPrefRunning, value); } @@ -988,7 +988,7 @@ bool ExtensionPrefs::IsExtensionRunning(const std::string& extension_id) { void ExtensionPrefs::SetIsActive(const std::string& extension_id, bool is_active) { - Value* value = Value::CreateBooleanValue(is_active); + Value* value = new base::FundamentalValue(is_active); UpdateExtensionPref(extension_id, kIsActive, value); } @@ -1008,7 +1008,7 @@ bool ExtensionPrefs::IsIncognitoEnabled(const std::string& extension_id) { void ExtensionPrefs::SetIsIncognitoEnabled(const std::string& extension_id, bool enabled) { UpdateExtensionPref(extension_id, kPrefIncognitoEnabled, - Value::CreateBooleanValue(enabled)); + new base::FundamentalValue(enabled)); } bool ExtensionPrefs::AllowFileAccess(const std::string& extension_id) { @@ -1018,7 +1018,7 @@ bool ExtensionPrefs::AllowFileAccess(const std::string& extension_id) { void ExtensionPrefs::SetAllowFileAccess(const std::string& extension_id, bool allow) { UpdateExtensionPref(extension_id, kPrefAllowFileAccess, - Value::CreateBooleanValue(allow)); + new base::FundamentalValue(allow)); } bool ExtensionPrefs::HasAllowFileAccessSetting( @@ -1124,7 +1124,7 @@ extension_misc::LaunchContainer ExtensionPrefs::GetLaunchContainer( void ExtensionPrefs::SetLaunchType(const std::string& extension_id, LaunchType launch_type) { UpdateExtensionPref(extension_id, kPrefLaunchType, - Value::CreateIntegerValue(static_cast<int>(launch_type))); + new base::FundamentalValue(static_cast<int>(launch_type))); } bool ExtensionPrefs::DoesExtensionHaveState( @@ -1186,7 +1186,7 @@ void ExtensionPrefs::OnExtensionUninstalled(const std::string& extension_id, // no longer lists the extension). if (!external_uninstall && Manifest::IsExternalLocation(location)) { UpdateExtensionPref(extension_id, kPrefState, - Value::CreateIntegerValue( + new base::FundamentalValue( Extension::EXTERNAL_EXTENSION_UNINSTALLED)); extension_pref_value_map_->SetExtensionState(extension_id, false); content_settings_store_->SetExtensionState(extension_id, false); @@ -1198,7 +1198,7 @@ void ExtensionPrefs::OnExtensionUninstalled(const std::string& extension_id, void ExtensionPrefs::SetExtensionState(const std::string& extension_id, Extension::State state) { UpdateExtensionPref(extension_id, kPrefState, - Value::CreateIntegerValue(state)); + new base::FundamentalValue(state)); bool enabled = (state == Extension::ENABLED); extension_pref_value_map_->SetExtensionState(extension_id, enabled); content_settings_store_->SetExtensionState(extension_id, enabled); @@ -1388,7 +1388,7 @@ bool ExtensionPrefs::FinishDelayedInstallInfo( const base::Time install_time = time_provider_->GetCurrentTime(); pending_install_dict->Set( kPrefInstallTime, - Value::CreateStringValue( + new base::StringValue( base::Int64ToString(install_time.ToInternalValue()))); // Commit the delayed install data. @@ -1457,7 +1457,7 @@ bool ExtensionPrefs::WasAppDraggedByUser(const std::string& extension_id) { void ExtensionPrefs::SetAppDraggedByUser(const std::string& extension_id) { UpdateExtensionPref(extension_id, kPrefUserDraggedApp, - Value::CreateBooleanValue(true)); + new base::FundamentalValue(true)); } bool ExtensionPrefs::IsFromWebStore( @@ -1579,7 +1579,7 @@ void ExtensionPrefs::FixMissingPrefs(const ExtensionIdList& extension_ids) { const base::Time install_time = time_provider_->GetCurrentTime(); UpdateExtensionPref(*ext_id, kPrefInstallTime, - Value::CreateStringValue(base::Int64ToString( + new base::StringValue(base::Int64ToString( install_time.ToInternalValue()))); } } @@ -1764,7 +1764,7 @@ void ExtensionPrefs::SetExtensionPrefFromVector( list_of_values->Clear(); for (ExtensionIdList::const_iterator iter = strings.begin(); iter != strings.end(); ++iter) - list_of_values->Append(new StringValue(*iter)); + list_of_values->Append(new base::StringValue(*iter)); } void ExtensionPrefs::PopulateExtensionInfoPrefs( @@ -1777,28 +1777,28 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs( // loading new profiles do not fail in GetInstalledExtensionInfo. Older // Chrome versions would only check for an omitted state. if (initial_state != Extension::ENABLED_COMPONENT) - extension_dict->Set(kPrefState, Value::CreateIntegerValue(initial_state)); + extension_dict->Set(kPrefState, new base::FundamentalValue(initial_state)); extension_dict->Set(kPrefLocation, - Value::CreateIntegerValue(extension->location())); + new base::FundamentalValue(extension->location())); extension_dict->Set(kPrefCreationFlags, - Value::CreateIntegerValue(extension->creation_flags())); + new base::FundamentalValue(extension->creation_flags())); extension_dict->Set(kPrefFromWebStore, - Value::CreateBooleanValue(extension->from_webstore())); + new base::FundamentalValue(extension->from_webstore())); extension_dict->Set(kPrefFromBookmark, - Value::CreateBooleanValue(extension->from_bookmark())); + new base::FundamentalValue(extension->from_bookmark())); extension_dict->Set( kPrefWasInstalledByDefault, - Value::CreateBooleanValue(extension->was_installed_by_default())); + new base::FundamentalValue(extension->was_installed_by_default())); extension_dict->Set(kPrefInstallTime, - Value::CreateStringValue( + new base::StringValue( base::Int64ToString(install_time.ToInternalValue()))); if (blacklist_state == Blacklist::BLACKLISTED) - extension_dict->Set(kPrefBlacklist, Value::CreateBooleanValue(true)); + extension_dict->Set(kPrefBlacklist, new base::FundamentalValue(true)); base::FilePath::StringType path = MakePathRelative(install_directory_, extension->path()); - extension_dict->Set(kPrefPath, Value::CreateStringValue(path)); + extension_dict->Set(kPrefPath, new base::StringValue(path)); // We store prefs about LOAD extensions, but don't cache their manifest // since it may change on disk. if (!Manifest::IsUnpackedLocation(extension->location())) { diff --git a/chrome/browser/extensions/extension_prefs_unittest.cc b/chrome/browser/extensions/extension_prefs_unittest.cc index 714c928..eabf8ab 100644 --- a/chrome/browser/extensions/extension_prefs_unittest.cc +++ b/chrome/browser/extensions/extension_prefs_unittest.cc @@ -169,9 +169,9 @@ class ExtensionPrefsGrantedPermissions : public ExtensionPrefsTest { permission_info->CreateAPIPermission()); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append(Value::CreateStringValue("tcp-connect:*.example.com:80")); - value->Append(Value::CreateStringValue("udp-bind::8080")); - value->Append(Value::CreateStringValue("udp-send-to::8888")); + value->Append(new base::StringValue("tcp-connect:*.example.com:80")); + value->Append(new base::StringValue("udp-bind::8080")); + value->Append(new base::StringValue("udp-send-to::8888")); if (!permission->FromValue(value.get())) NOTREACHED(); } diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index c0d461e..562d14e 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -1101,7 +1101,7 @@ class ExtensionServiceTest msg += " = "; msg += base::IntToString(value); - SetPref(extension_id, pref_path, Value::CreateIntegerValue(value), msg); + SetPref(extension_id, pref_path, new base::FundamentalValue(value), msg); } void SetPrefBool(const std::string& extension_id, @@ -1112,7 +1112,7 @@ class ExtensionServiceTest msg += " = "; msg += (value ? "true" : "false"); - SetPref(extension_id, pref_path, Value::CreateBooleanValue(value), msg); + SetPref(extension_id, pref_path, new base::FundamentalValue(value), msg); } void ClearPref(const std::string& extension_id, @@ -1138,7 +1138,7 @@ class ExtensionServiceTest ListValue* list_value = new ListValue(); for (std::set<std::string>::const_iterator iter = value.begin(); iter != value.end(); ++iter) - list_value->Append(Value::CreateStringValue(*iter)); + list_value->Append(new base::StringValue(*iter)); SetPref(extension_id, pref_path, list_value, msg); } @@ -2103,7 +2103,7 @@ TEST_F(ExtensionServiceTest, GrantedAPIAndHostPermissions) { ListValue* api_permissions = new ListValue(); api_permissions->Append( - Value::CreateStringValue("tabs")); + new base::StringValue("tabs")); SetPref(extension_id, "granted_permissions.api", api_permissions, "granted_permissions.api"); SetPrefStringSet( @@ -3355,7 +3355,7 @@ TEST_F(ExtensionServiceTest, UnloadBlacklistedExtensionPolicy) { base::ListValue whitelist; PrefService* prefs = service_->extension_prefs()->pref_service(); - whitelist.Append(base::Value::CreateStringValue(good_crx)); + whitelist.Append(new base::StringValue(good_crx)); prefs->Set(prefs::kExtensionInstallAllowList, whitelist); std::vector<std::string> blacklist; @@ -3419,7 +3419,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallDenyList); ListValue* blacklist = update.Get(); - blacklist->Append(Value::CreateStringValue("*")); + blacklist->Append(new base::StringValue("*")); } // Blacklist prevents us from installing good_crx. @@ -3432,7 +3432,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallAllowList); ListValue* whitelist = update.Get(); - whitelist->Append(Value::CreateStringValue(good_crx)); + whitelist->Append(new base::StringValue(good_crx)); } // Ensure we can now install good_crx. @@ -3456,7 +3456,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyRemovedIfRunning) { ASSERT_TRUE(blacklist != NULL); // Blacklist this extension. - blacklist->Append(Value::CreateStringValue(good_crx)); + blacklist->Append(new base::StringValue(good_crx)); } // Extension should not be running now. @@ -3473,7 +3473,7 @@ TEST_F(ExtensionServiceTest, ComponentExtensionWhitelisted) { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallDenyList); ListValue* blacklist = update.Get(); - blacklist->Append(Value::CreateStringValue("*")); + blacklist->Append(new base::StringValue("*")); } // Install a component extension. @@ -3502,7 +3502,7 @@ TEST_F(ExtensionServiceTest, ComponentExtensionWhitelisted) { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallDenyList); ListValue* blacklist = update.Get(); - blacklist->Append(Value::CreateStringValue(good0)); + blacklist->Append(new base::StringValue(good0)); } base::RunLoop().RunUntilIdle(); ASSERT_EQ(1u, service_->extensions()->size()); @@ -3551,7 +3551,7 @@ TEST_F(ExtensionServiceTest, PolicyInstalledExtensionsWhitelisted) { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallDenyList); ListValue* blacklist = update.Get(); - blacklist->Append(Value::CreateStringValue(good0)); + blacklist->Append(new base::StringValue(good0)); } base::RunLoop().RunUntilIdle(); ASSERT_EQ(1u, service_->extensions()->size()); diff --git a/chrome/browser/extensions/extension_sorting.cc b/chrome/browser/extensions/extension_sorting.cc index 1af6640..fa17dac 100644 --- a/chrome/browser/extensions/extension_sorting.cc +++ b/chrome/browser/extensions/extension_sorting.cc @@ -306,7 +306,7 @@ void ExtensionSorting::SetAppLaunchOrdinal( AddOrdinalMapping(extension_id, page_ordinal, new_app_launch_ordinal); Value* new_value = new_app_launch_ordinal.IsValid() ? - Value::CreateStringValue(new_app_launch_ordinal.ToInternalValue()) : + new base::StringValue(new_app_launch_ordinal.ToInternalValue()) : NULL; extension_scoped_prefs_->UpdateExtensionPref( @@ -385,7 +385,7 @@ void ExtensionSorting::SetPageOrdinal( AddOrdinalMapping(extension_id, new_page_ordinal, app_launch_ordinal); Value* new_value = new_page_ordinal.IsValid() ? - Value::CreateStringValue(new_page_ordinal.ToInternalValue()) : + new base::StringValue(new_page_ordinal.ToInternalValue()) : NULL; extension_scoped_prefs_->UpdateExtensionPref( diff --git a/chrome/browser/extensions/extension_sorting_unittest.cc b/chrome/browser/extensions/extension_sorting_unittest.cc index b84535e..6a51402 100644 --- a/chrome/browser/extensions/extension_sorting_unittest.cc +++ b/chrome/browser/extensions/extension_sorting_unittest.cc @@ -165,24 +165,24 @@ class ExtensionSortingInitialize static_cast<ExtensionScopedPrefs*>(prefs()); scoped_prefs->UpdateExtensionPref(extension1()->id(), kPrefAppLaunchIndexDeprecated, - Value::CreateIntegerValue(0)); + new base::FundamentalValue(0)); scoped_prefs->UpdateExtensionPref(extension1()->id(), kPrefPageIndexDeprecated, - Value::CreateIntegerValue(0)); + new base::FundamentalValue(0)); scoped_prefs->UpdateExtensionPref(extension2()->id(), kPrefAppLaunchIndexDeprecated, - Value::CreateIntegerValue(1)); + new base::FundamentalValue(1)); scoped_prefs->UpdateExtensionPref(extension2()->id(), kPrefPageIndexDeprecated, - Value::CreateIntegerValue(0)); + new base::FundamentalValue(0)); scoped_prefs->UpdateExtensionPref(extension3()->id(), kPrefAppLaunchIndexDeprecated, - Value::CreateIntegerValue(0)); + new base::FundamentalValue(0)); scoped_prefs->UpdateExtensionPref(extension3()->id(), kPrefPageIndexDeprecated, - Value::CreateIntegerValue(1)); + new base::FundamentalValue(1)); // We insert the ids in reserve order so that we have to deal with the // element on the 2nd page before the 1st page is seen. @@ -281,10 +281,10 @@ class ExtensionSortingMigrateAppIndexInvalid static_cast<ExtensionScopedPrefs*>(prefs()); scoped_prefs->UpdateExtensionPref(extension1()->id(), kPrefAppLaunchIndexDeprecated, - Value::CreateIntegerValue(0)); + new base::FundamentalValue(0)); scoped_prefs->UpdateExtensionPref(extension1()->id(), kPrefPageIndexDeprecated, - Value::CreateIntegerValue(-1)); + new base::FundamentalValue(-1)); extensions::ExtensionIdList ids; ids.push_back(extension1()->id()); diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc index 74f34fe..a849f2a 100644 --- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc +++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc @@ -105,8 +105,8 @@ class ExtensionSpecialStoragePolicyTest : public testing::Test { manifest.SetString(keys::kVersion, "1"); manifest.SetString(keys::kLaunchWebURL, "http://explicit/protected/start"); base::ListValue* list = new base::ListValue(); - list->Append(Value::CreateStringValue("http://explicit/protected")); - list->Append(Value::CreateStringValue("*://*.wildcards/protected")); + list->Append(new base::StringValue("http://explicit/protected")); + list->Append(new base::StringValue("*://*.wildcards/protected")); manifest.Set(keys::kWebURLs, list); std::string error; scoped_refptr<Extension> protected_app = Extension::Create( @@ -127,11 +127,11 @@ class ExtensionSpecialStoragePolicyTest : public testing::Test { manifest.SetString(keys::kVersion, "1"); manifest.SetString(keys::kLaunchWebURL, "http://explicit/unlimited/start"); base::ListValue* list = new base::ListValue(); - list->Append(Value::CreateStringValue("unlimitedStorage")); + list->Append(new base::StringValue("unlimitedStorage")); manifest.Set(keys::kPermissions, list); list = new base::ListValue(); - list->Append(Value::CreateStringValue("http://explicit/unlimited")); - list->Append(Value::CreateStringValue("*://*.wildcards/unlimited")); + list->Append(new base::StringValue("http://explicit/unlimited")); + list->Append(new base::StringValue("*://*.wildcards/unlimited")); manifest.Set(keys::kWebURLs, list); std::string error; scoped_refptr<Extension> unlimited_app = Extension::Create( diff --git a/chrome/browser/extensions/menu_manager.h b/chrome/browser/extensions/menu_manager.h index 764e861..b3d085d 100644 --- a/chrome/browser/extensions/menu_manager.h +++ b/chrome/browser/extensions/menu_manager.h @@ -110,7 +110,8 @@ class MenuItem { } scoped_ptr<base::Value> ToValue() const { - return scoped_ptr<base::Value>(base::Value::CreateIntegerValue(value_)); + return scoped_ptr<base::Value>( + new base::FundamentalValue(static_cast<int>(value_))); } bool Populate(const base::Value& value) { diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc index e8ad2c6..5b402be 100644 --- a/chrome/browser/extensions/menu_manager_unittest.cc +++ b/chrome/browser/extensions/menu_manager_unittest.cc @@ -216,15 +216,15 @@ TEST_F(MenuManagerTest, PopulateFromValue) { base::ListValue* document_url_patterns(new base::ListValue()); document_url_patterns->Append( - Value::CreateStringValue("http://www.google.com/*")); + new base::StringValue("http://www.google.com/*")); document_url_patterns->Append( - Value::CreateStringValue("http://www.reddit.com/*")); + new base::StringValue("http://www.reddit.com/*")); base::ListValue* target_url_patterns(new base::ListValue()); target_url_patterns->Append( - Value::CreateStringValue("http://www.yahoo.com/*")); + new base::StringValue("http://www.yahoo.com/*")); target_url_patterns->Append( - Value::CreateStringValue("http://www.facebook.com/*")); + new base::StringValue("http://www.facebook.com/*")); base::DictionaryValue value; value.SetBoolean("incognito", incognito); |