summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-09 06:41:12 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-09 06:41:12 +0000
commit69d7f89d6a93e0fbce451960287066195c6d4ea0 (patch)
tree51c8c1f971d39d652ec38ed76070539bb33e85c7
parente3748a79b523a8d365d4a33ef986eebb4186fa78 (diff)
downloadchromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.zip
chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.tar.gz
chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.tar.bz2
Revert "Rewrite std::string("") to std::string(), Linux edition."
This reverts commit e59558b78e8c6a1b0bd916a724724b638c3c91b6. Revert "Fix build after r193020." This reverts commit 558a35897f6b3ffbcaefde927c1f150b815d140a. Revert "Really fix build after r193020." This reverts commit e3748a79b523a8d365d4a33ef986eebb4186fa78. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193030 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/debug/trace_event_unittest.cc5
-rw-r--r--base/file_util_posix.cc3
-rw-r--r--base/file_util_unittest.cc13
-rw-r--r--base/files/file_path.cc2
-rw-r--r--base/i18n/char_iterator_unittest.cc2
-rw-r--r--base/json/json_value_serializer_unittest.cc2
-rw-r--r--base/metrics/field_trial.cc2
-rw-r--r--base/metrics/field_trial_unittest.cc4
-rw-r--r--base/metrics/statistics_recorder.cc2
-rw-r--r--base/metrics/stats_counters.cc2
-rw-r--r--base/metrics/stats_table.cc4
-rw-r--r--base/nix/mime_util_xdg.cc4
-rw-r--r--base/pickle_unittest.cc4
-rw-r--r--base/prefs/pref_change_registrar_unittest.cc2
-rw-r--r--base/prefs/pref_service_unittest.cc2
-rw-r--r--base/process_util_linux.cc2
-rw-r--r--base/process_util_unittest.cc8
-rw-r--r--base/string_util_unittest.cc44
-rw-r--r--base/strings/string_split.cc3
-rw-r--r--base/strings/string_split_unittest.cc24
-rw-r--r--base/sys_info_posix.cc6
-rw-r--r--base/test/trace_event_analyzer.cc2
-rw-r--r--base/test/trace_event_analyzer_unittest.cc4
-rw-r--r--base/values_unittest.cc2
-rw-r--r--base/vlog_unittest.cc22
-rw-r--r--chrome/browser/about_flags_unittest.cc2
-rw-r--r--chrome/browser/accessibility/accessibility_events.cc1
-rw-r--r--chrome/browser/autofill/autofill_browsertest.cc24
-rw-r--r--chrome/browser/automation/automation_misc_browsertest.cc4
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc6
-rw-r--r--chrome/browser/bookmarks/bookmark_utils_unittest.cc21
-rw-r--r--chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc6
-rw-r--r--chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc10
-rw-r--r--chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc6
-rw-r--r--chrome/browser/browsing_data/cookies_tree_model_unittest.cc2
-rw-r--r--chrome/browser/certificate_manager_model.cc7
-rw-r--r--chrome/browser/content_settings/content_settings_browsertest.cc24
-rw-r--r--chrome/browser/content_settings/content_settings_internal_extension_provider.cc6
-rw-r--r--chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc125
-rw-r--r--chrome/browser/content_settings/content_settings_policy_provider.cc2
-rw-r--r--chrome/browser/content_settings/content_settings_policy_provider_unittest.cc99
-rw-r--r--chrome/browser/content_settings/content_settings_pref_provider.cc27
-rw-r--r--chrome/browser/content_settings/content_settings_pref_provider_unittest.cc142
-rw-r--r--chrome/browser/content_settings/content_settings_provider.h2
-rw-r--r--chrome/browser/content_settings/content_settings_provider_unittest.cc15
-rw-r--r--chrome/browser/content_settings/content_settings_utils.cc8
-rw-r--r--chrome/browser/content_settings/content_settings_utils_unittest.cc2
-rw-r--r--chrome/browser/content_settings/cookie_settings.cc27
-rw-r--r--chrome/browser/content_settings/host_content_settings_map.cc17
-rw-r--r--chrome/browser/content_settings/host_content_settings_map_unittest.cc238
-rw-r--r--chrome/browser/content_settings/mock_settings_observer.cc2
-rw-r--r--chrome/browser/devtools/browser_list_tabcontents_provider.cc6
-rw-r--r--chrome/browser/devtools/devtools_file_helper.cc4
-rw-r--r--chrome/browser/devtools/devtools_sanity_browsertest.cc8
-rw-r--r--chrome/browser/download/download_browsertest.cc9
-rw-r--r--chrome/browser/download/download_file_picker.cc17
-rw-r--r--chrome/browser/download/download_prefs.cc2
-rw-r--r--chrome/browser/extensions/activity_log.cc11
-rw-r--r--chrome/browser/extensions/activity_log_unittest.cc32
-rw-r--r--chrome/browser/extensions/api/alarms/alarms_api_unittest.cc14
-rw-r--r--chrome/browser/extensions/api/bookmarks/bookmarks_api.cc2
-rw-r--r--chrome/browser/extensions/api/content_settings/content_settings_apitest.cc10
-rw-r--r--chrome/browser/extensions/api/content_settings/content_settings_helpers.cc2
-rw-r--r--chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc145
-rw-r--r--chrome/browser/extensions/api/cookies/cookies_api.cc55
-rw-r--r--chrome/browser/extensions/api/cookies/cookies_helpers.cc4
-rw-r--r--chrome/browser/extensions/api/cookies/cookies_unittest.cc28
-rw-r--r--chrome/browser/extensions/api/declarative/initializing_rules_registry.cc6
-rw-r--r--chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc6
-rw-r--r--chrome/browser/extensions/api/declarative_content/content_condition.cc3
-rw-r--r--chrome/browser/extensions/api/declarative_content/content_rules_registry.cc4
-rw-r--r--chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc4
-rw-r--r--chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc4
-rw-r--r--chrome/browser/extensions/api/developer_private/entry_picker.cc5
-rw-r--r--chrome/browser/extensions/api/dial/dial_device_data_unittest.cc6
-rw-r--r--chrome/browser/extensions/api/dial/dial_service_unittest.cc4
-rw-r--r--chrome/browser/extensions/api/downloads/downloads_api.cc6
-rw-r--r--chrome/browser/extensions/api/downloads/downloads_api_unittest.cc9
-rw-r--r--chrome/browser/extensions/api/extension_action/browser_action_apitest.cc8
-rw-r--r--chrome/browser/extensions/api/extension_action/page_action_apitest.cc16
-rw-r--r--chrome/browser/extensions/api/extension_action/script_badge_apitest.cc3
-rw-r--r--chrome/browser/extensions/api/file_system/file_system_api.cc7
-rw-r--r--chrome/browser/extensions/api/file_system/file_system_api_unittest.cc18
-rw-r--r--chrome/browser/extensions/api/identity/identity_apitest.cc2
-rw-r--r--chrome/browser/extensions/api/management/management_api_browsertest.cc10
-rw-r--r--chrome/browser/extensions/api/messaging/message_service.cc7
-rw-r--r--chrome/browser/extensions/api/proxy/proxy_api.cc2
-rw-r--r--chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc48
-rw-r--r--chrome/browser/extensions/api/socket/udp_socket.cc2
-rw-r--r--chrome/browser/extensions/api/storage/settings_sync_unittest.cc7
-rw-r--r--chrome/browser/extensions/api/web_request/web_request_api.cc2
-rw-r--r--chrome/browser/extensions/api/web_request/web_request_api_helpers.cc21
-rw-r--r--chrome/browser/extensions/api/web_request/web_request_api_unittest.cc9
-rw-r--r--chrome/browser/extensions/api/web_socket_proxy_private/web_socket_proxy_private_api.cc2
-rw-r--r--chrome/browser/extensions/api/webstore_private/webstore_private_api.cc4
-rw-r--r--chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc2
-rw-r--r--chrome/browser/extensions/bundle_installer.cc2
-rw-r--r--chrome/browser/extensions/component_loader.cc2
-rw-r--r--chrome/browser/extensions/component_loader_unittest.cc2
-rw-r--r--chrome/browser/extensions/event_router.cc16
-rw-r--r--chrome/browser/extensions/event_router_forwarder.cc10
-rw-r--r--chrome/browser/extensions/extension_action_unittest.cc32
-rw-r--r--chrome/browser/extensions/extension_apitest.cc27
-rw-r--r--chrome/browser/extensions/extension_browsertest.cc10
-rw-r--r--chrome/browser/extensions/extension_browsertest.h26
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc9
-rw-r--r--chrome/browser/extensions/extension_pref_value_map_unittest.cc2
-rw-r--r--chrome/browser/extensions/extension_prefs.cc3
-rw-r--r--chrome/browser/extensions/extension_process_manager.cc2
-rw-r--r--chrome/browser/extensions/extension_protocols.cc3
-rw-r--r--chrome/browser/extensions/extension_service_unittest.cc8
-rw-r--r--chrome/browser/extensions/extension_test_message_listener.cc3
-rw-r--r--chrome/browser/extensions/extensions_quota_service.cc6
-rw-r--r--chrome/browser/extensions/external_policy_loader_unittest.cc3
-rw-r--r--chrome/browser/extensions/isolated_app_browsertest.cc2
-rw-r--r--chrome/browser/extensions/menu_manager.cc8
-rw-r--r--chrome/browser/extensions/pending_extension_info.cc3
-rw-r--r--chrome/browser/extensions/platform_app_browsertest_util.cc4
-rw-r--r--chrome/browser/extensions/platform_app_launcher.cc5
-rw-r--r--chrome/browser/extensions/script_badge_controller_unittest.cc4
-rw-r--r--chrome/browser/extensions/script_executor.cc2
-rw-r--r--chrome/browser/extensions/subscribe_page_action_browsertest.cc6
-rw-r--r--chrome/browser/extensions/tab_helper.cc2
-rw-r--r--chrome/browser/extensions/updater/extension_downloader.cc18
-rw-r--r--chrome/browser/extensions/updater/extension_updater.cc5
-rw-r--r--chrome/browser/extensions/updater/extension_updater_unittest.cc67
-rw-r--r--chrome/browser/extensions/webstore_installer.cc3
-rw-r--r--chrome/browser/extensions/webstore_standalone_installer.cc22
-rw-r--r--chrome/browser/feedback/feedback_util.cc2
-rw-r--r--chrome/browser/file_select_helper.cc7
-rw-r--r--chrome/browser/google/google_util.cc2
-rw-r--r--chrome/browser/google/google_util_unittest.cc4
-rw-r--r--chrome/browser/google_apis/base_operations.cc2
-rw-r--r--chrome/browser/google_apis/base_operations_unittest.cc6
-rw-r--r--chrome/browser/google_apis/drive_api_operations.cc2
-rw-r--r--chrome/browser/google_apis/drive_api_operations_unittest.cc2
-rw-r--r--chrome/browser/google_apis/drive_api_url_generator_unittest.cc9
-rw-r--r--chrome/browser/google_apis/drive_uploader_unittest.cc12
-rw-r--r--chrome/browser/google_apis/fake_drive_service.cc26
-rw-r--r--chrome/browser/google_apis/fake_drive_service_unittest.cc74
-rw-r--r--chrome/browser/google_apis/gdata_wapi_operations_unittest.cc31
-rw-r--r--chrome/browser/google_apis/gdata_wapi_parser_unittest.cc2
-rw-r--r--chrome/browser/google_apis/gdata_wapi_service.cc85
-rw-r--r--chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc144
-rw-r--r--chrome/browser/google_apis/operation_util_unittest.cc2
-rw-r--r--chrome/browser/google_apis/test_server/http_server_unittest.cc2
-rw-r--r--chrome/browser/history/history_querying_unittest.cc2
-rw-r--r--chrome/browser/history/history_tab_helper.cc3
-rw-r--r--chrome/browser/history/history_unittest.cc56
-rw-r--r--chrome/browser/history/thumbnail_database_unittest.cc4
-rw-r--r--chrome/browser/importer/firefox_importer_utils.cc10
-rw-r--r--chrome/browser/internal_auth_unittest.cc7
-rw-r--r--chrome/browser/io_thread.cc15
-rw-r--r--chrome/browser/language_usage_metrics_unittest.cc4
-rw-r--r--chrome/browser/logging_chrome_browsertest.cc2
-rw-r--r--chrome/browser/managed_mode/managed_user_service.cc9
-rw-r--r--chrome/browser/media/media_stream_devices_controller.cc4
-rw-r--r--chrome/browser/media_galleries/media_galleries_dialog_controller.cc6
-rw-r--r--chrome/browser/media_galleries/media_galleries_preferences.cc2
-rw-r--r--chrome/browser/metrics/metrics_log.cc2
-rw-r--r--chrome/browser/metrics/metrics_service.cc4
-rw-r--r--chrome/browser/nacl_host/pnacl_file_host_unittest.cc2
-rw-r--r--chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc3
-rw-r--r--chrome/browser/net/chrome_network_delegate_unittest.cc6
-rw-r--r--chrome/browser/net/dns_probe_job_unittest.cc2
-rw-r--r--chrome/browser/net/http_pipelining_compatibility_client_unittest.cc6
-rw-r--r--chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc6
-rw-r--r--chrome/browser/net/url_info.cc2
-rw-r--r--chrome/browser/page_cycler/page_cycler.cc10
-rw-r--r--chrome/browser/password_manager/native_backend_kwallet_x.cc2
-rw-r--r--chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc2
-rw-r--r--chrome/browser/plugins/plugin_finder.cc6
-rw-r--r--chrome/browser/plugins/plugin_metadata_unittest.cc6
-rw-r--r--chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc4
-rw-r--r--chrome/browser/policy/cloud/cloud_policy_service_unittest.cc2
-rw-r--r--chrome/browser/policy/cloud/device_management_service_unittest.cc6
-rw-r--r--chrome/browser/policy/cloud/mock_cloud_policy_client.cc6
-rw-r--r--chrome/browser/policy/cloud/mock_device_management_service.cc2
-rw-r--r--chrome/browser/policy/configuration_policy_pref_store_unittest.cc67
-rw-r--r--chrome/browser/policy/policy_map_unittest.cc16
-rw-r--r--chrome/browser/policy/policy_prefs_browsertest.cc4
-rw-r--r--chrome/browser/policy/url_blacklist_manager_unittest.cc78
-rw-r--r--chrome/browser/popup_blocker_browsertest.cc14
-rw-r--r--chrome/browser/predictors/autocomplete_action_predictor.cc2
-rw-r--r--chrome/browser/predictors/resource_prefetch_predictor.cc3
-rw-r--r--chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc240
-rw-r--r--chrome/browser/predictors/resource_prefetch_predictor_unittest.cc494
-rw-r--r--chrome/browser/predictors/resource_prefetcher_unittest.cc3
-rw-r--r--chrome/browser/prefs/command_line_pref_store_unittest.cc6
-rw-r--r--chrome/browser/prefs/proxy_config_dictionary.cc30
-rw-r--r--chrome/browser/prefs/proxy_policy_unittest.cc12
-rw-r--r--chrome/browser/prefs/session_startup_pref.cc2
-rw-r--r--chrome/browser/prerender/prerender_contents.cc4
-rw-r--r--chrome/browser/prerender/prerender_histograms.cc6
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc2
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_source.cc2
-rw-r--r--chrome/browser/printing/print_dialog_cloud_interative_uitest.cc2
-rw-r--r--chrome/browser/printing/print_dialog_cloud_unittest.cc2
-rw-r--r--chrome/browser/profiles/gaia_info_update_service_factory.cc3
-rw-r--r--chrome/browser/profiles/gaia_info_update_service_unittest.cc6
-rw-r--r--chrome/browser/profiles/profile_downloader_unittest.cc10
-rw-r--r--chrome/browser/profiles/profile_impl.cc5
-rw-r--r--chrome/browser/profiles/profile_manager.cc2
-rw-r--r--chrome/browser/referrer_policy_browsertest.cc2
-rw-r--r--chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc2
-rw-r--r--chrome/browser/safe_browsing/browser_feature_extractor.cc4
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_host_unittest.cc6
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_service_unittest.cc7
-rw-r--r--chrome/browser/safe_browsing/download_protection_service_unittest.cc2
-rw-r--r--chrome/browser/safe_browsing/malware_details.cc14
-rw-r--r--chrome/browser/safe_browsing/ping_manager.cc2
-rw-r--r--chrome/browser/safe_browsing/protocol_manager_unittest.cc26
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc15
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_util.cc15
-rw-r--r--chrome/browser/safe_browsing/two_phase_uploader.cc4
-rw-r--r--chrome/browser/search/local_ntp_source.cc2
-rw-r--r--chrome/browser/search/local_omnibox_popup_source.cc2
-rw-r--r--chrome/browser/search/search.cc3
-rw-r--r--chrome/browser/search/search_unittest.cc9
-rw-r--r--chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc2
-rw-r--r--chrome/browser/sessions/session_restore_browsertest.cc2
-rw-r--r--chrome/browser/shell_integration_linux.cc4
-rw-r--r--chrome/browser/shell_integration_unittest.cc2
-rw-r--r--chrome/browser/signin/about_signin_internals.cc7
-rw-r--r--chrome/browser/signin/about_signin_internals_factory.cc23
-rw-r--r--chrome/browser/signin/oauth2_token_service_unittest.cc12
-rw-r--r--chrome/browser/signin/signin_internals_util.cc16
-rw-r--r--chrome/browser/signin/signin_manager.cc13
-rw-r--r--chrome/browser/signin/signin_manager_factory.cc9
-rw-r--r--chrome/browser/signin/signin_manager_unittest.cc27
-rw-r--r--chrome/browser/signin/token_service_unittest.cc2
-rw-r--r--chrome/browser/spellchecker/spelling_service_client_unittest.cc2
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.cc6
-rw-r--r--chrome/browser/ssl/ssl_browser_tests.cc6
-rw-r--r--chrome/browser/storage_monitor/media_storage_util.cc5
-rw-r--r--chrome/browser/sync/glue/session_model_associator_unittest.cc2
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_unittest.cc2
-rw-r--r--chrome/browser/sync/glue/synced_session.h2
-rw-r--r--chrome/browser/sync/invalidations/invalidator_storage.cc6
-rw-r--r--chrome/browser/sync/profile_sync_service.cc2
-rw-r--r--chrome/browser/sync/profile_sync_service_bookmark_unittest.cc6
-rw-r--r--chrome/browser/sync/profile_sync_service_harness.cc7
-rw-r--r--chrome/browser/sync/profile_sync_service_session_unittest.cc6
-rw-r--r--chrome/browser/sync/profile_sync_service_startup_unittest.cc17
-rw-r--r--chrome/browser/sync/sync_prefs.cc30
-rw-r--r--chrome/browser/sync/test/integration/sync_extension_helper.cc2
-rw-r--r--chrome/browser/sync_file_system/drive_file_sync_client.cc2
-rw-r--r--chrome/browser/sync_file_system/drive_file_sync_service.cc9
-rw-r--r--chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc2
-rw-r--r--chrome/browser/themes/theme_syncable_service_unittest.cc2
-rw-r--r--chrome/browser/translate/translate_manager_browsertest.cc2
-rw-r--r--chrome/browser/translate/translate_manager_unittest.cc2
-rw-r--r--chrome/browser/ui/app_list/app_list_service.cc2
-rw-r--r--chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc6
-rw-r--r--chrome/browser/ui/browser.cc10
-rw-r--r--chrome/browser/ui/browser_browsertest.cc10
-rw-r--r--chrome/browser/ui/browser_tab_contents.cc6
-rw-r--r--chrome/browser/ui/browser_tabrestore.cc2
-rw-r--r--chrome/browser/ui/certificate_dialogs.cc2
-rw-r--r--chrome/browser/ui/chrome_pages.cc2
-rw-r--r--chrome/browser/ui/chrome_select_file_policy_unittest.cc2
-rw-r--r--chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc2
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc7
-rw-r--r--chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/first_run_bubble.cc8
-rw-r--r--chrome/browser/ui/gtk/location_bar_view_gtk.cc8
-rw-r--r--chrome/browser/ui/gtk/ssl_client_certificate_selector.cc6
-rw-r--r--chrome/browser/ui/prefs/prefs_tab_helper.cc6
-rw-r--r--chrome/browser/ui/search/instant_browsertest.cc2
-rw-r--r--chrome/browser/ui/startup/startup_browser_creator_impl.cc4
-rw-r--r--chrome/browser/ui/sync/one_click_signin_helper_unittest.cc122
-rw-r--r--chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc2
-rw-r--r--chrome/browser/ui/website_settings/website_settings.cc34
-rw-r--r--chrome/browser/ui/website_settings/website_settings_unittest.cc24
-rw-r--r--chrome/browser/ui/webui/about_ui.cc12
-rw-r--r--chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc2
-rw-r--r--chrome/browser/ui/webui/extensions/extension_settings_handler.cc11
-rw-r--r--chrome/browser/ui/webui/extensions/pack_extension_handler.cc8
-rw-r--r--chrome/browser/ui/webui/favicon_source.cc6
-rw-r--r--chrome/browser/ui/webui/feedback_ui.cc8
-rw-r--r--chrome/browser/ui/webui/inspect_ui.cc2
-rw-r--r--chrome/browser/ui/webui/instant_ui.cc3
-rw-r--r--chrome/browser/ui/webui/net_internals/net_internals_ui.cc2
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.cc7
-rw-r--r--chrome/browser/ui/webui/options/certificate_manager_handler.cc6
-rw-r--r--chrome/browser/ui/webui/options/content_settings_handler.cc40
-rw-r--r--chrome/browser/ui/webui/options/font_settings_handler.cc4
-rw-r--r--chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc4
-rw-r--r--chrome/browser/ui/webui/options/preferences_browsertest.cc32
-rw-r--r--chrome/browser/ui/webui/policy_ui_browsertest.cc9
-rw-r--r--chrome/browser/ui/webui/print_preview/print_preview_handler.cc2
-rw-r--r--chrome/browser/ui/webui/print_preview/print_preview_ui.cc2
-rw-r--r--chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc16
-rw-r--r--chrome/browser/ui/webui/sync_setup_handler_unittest.cc105
-rw-r--r--chrome/browser/ui/webui/version_ui.cc2
-rw-r--r--chrome/browser/value_store/leveldb_value_store.cc14
-rw-r--r--chrome/browser/web_applications/web_app_unittest.cc5
-rw-r--r--chrome/browser/webdata/keyword_table.cc4
-rw-r--r--chrome/browser/webdata/token_service_table_unittest.cc2
-rw-r--r--chrome/common/child_process_logging_posix.cc2
-rw-r--r--chrome/common/content_settings_helper.cc13
-rw-r--r--chrome/common/content_settings_pattern.cc4
-rw-r--r--chrome/common/content_settings_pattern_parser.cc2
-rw-r--r--chrome/common/content_settings_pattern_unittest.cc7
-rw-r--r--chrome/common/extensions/api/commands/commands_handler.cc6
-rw-r--r--chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc14
-rw-r--r--chrome/common/extensions/api/extension_api.cc13
-rw-r--r--chrome/common/extensions/api/extension_api_unittest.cc6
-rw-r--r--chrome/common/extensions/csp_validator_unittest.cc15
-rw-r--r--chrome/common/extensions/extension.cc4
-rw-r--r--chrome/common/extensions/extension_file_util_unittest.cc2
-rw-r--r--chrome/common/extensions/extension_icon_set_unittest.cc4
-rw-r--r--chrome/common/extensions/extension_l10n_util.cc2
-rw-r--r--chrome/common/extensions/extension_localization_peer_unittest.cc19
-rw-r--r--chrome/common/extensions/extension_set.cc4
-rw-r--r--chrome/common/extensions/extension_set_unittest.cc9
-rw-r--r--chrome/common/extensions/extension_sync_type_unittest.cc4
-rw-r--r--chrome/common/extensions/extension_unittest.cc14
-rw-r--r--chrome/common/extensions/features/api_feature.cc2
-rw-r--r--chrome/common/extensions/features/complex_feature.cc2
-rw-r--r--chrome/common/extensions/features/manifest_feature.cc2
-rw-r--r--chrome/common/extensions/features/permission_feature.cc2
-rw-r--r--chrome/common/extensions/features/simple_feature.cc8
-rw-r--r--chrome/common/extensions/features/simple_feature_unittest.cc187
-rw-r--r--chrome/common/extensions/manifest_tests/extension_manifest_test.cc8
-rw-r--r--chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc2
-rw-r--r--chrome/common/extensions/manifest_url_handler.cc8
-rw-r--r--chrome/common/extensions/message_bundle.cc2
-rw-r--r--chrome/common/extensions/permissions/bluetooth_device_permission_data.cc4
-rw-r--r--chrome/common/extensions/permissions/socket_permission_unittest.cc2
-rw-r--r--chrome/common/extensions/update_manifest_unittest.cc2
-rw-r--r--chrome/common/json_schema/json_schema_validator.cc4
-rw-r--r--chrome/common/json_schema/json_schema_validator_unittest_base.cc204
-rw-r--r--chrome/common/metrics/entropy_provider_unittest.cc4
-rw-r--r--chrome/common/net/x509_certificate_model.cc2
-rw-r--r--chrome/common/net/x509_certificate_model_nss.cc18
-rw-r--r--chrome/common/pref_names_util_unittest.cc6
-rw-r--r--chrome/renderer/autofill/password_autofill_agent_browsertest.cc28
-rw-r--r--chrome/renderer/automation/automation_renderer_helper_browsertest.cc10
-rw-r--r--chrome/renderer/chrome_content_renderer_client_unittest.cc4
-rw-r--r--chrome/renderer/content_settings_observer_browsertest.cc59
-rw-r--r--chrome/renderer/extensions/chrome_v8_context.cc4
-rw-r--r--chrome/renderer/extensions/extension_helper.cc8
-rw-r--r--chrome/renderer/extensions/resource_request_policy.cc3
-rw-r--r--chrome/renderer/extensions/user_script_scheduler.cc14
-rw-r--r--chrome/renderer/extensions/user_script_slave.cc2
-rw-r--r--chrome/renderer/plugins/plugin_uma_unittest.cc37
-rw-r--r--chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc4
-rw-r--r--chrome/service/cloud_print/cloud_print_proxy.cc13
-rw-r--r--chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc6
-rw-r--r--chrome/service/cloud_print/connector_settings.cc5
-rw-r--r--chrome/service/cloud_print/printer_job_handler_unittest.cc8
-rw-r--r--chrome/service/cloud_print/printer_job_queue_handler_unittest.cc2
-rw-r--r--chrome/service/service_process.cc3
-rw-r--r--chrome/service/service_process_prefs_unittest.cc5
-rw-r--r--chrome/test/base/ui_test_utils.cc2
-rw-r--r--chrome/test/chromedriver/capabilities_unittest.cc2
-rw-r--r--chrome/test/chromedriver/chrome/automation_extension.cc14
-rw-r--r--chrome/test/chromedriver/chrome/chrome_desktop_impl.cc2
-rw-r--r--chrome/test/chromedriver/chrome/devtools_http_client.cc3
-rw-r--r--chrome/test/chromedriver/chrome/devtools_http_client_unittest.cc3
-rw-r--r--chrome/test/chromedriver/chrome/javascript_dialog_manager_unittest.cc16
-rw-r--r--chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc2
-rw-r--r--chrome/test/chromedriver/chrome/stub_chrome.cc4
-rw-r--r--chrome/test/chromedriver/chrome/web_view_impl_unittest.cc24
-rw-r--r--chrome/test/chromedriver/chromedriver.cc4
-rw-r--r--chrome/test/chromedriver/chromedriver_unittest.cc2
-rw-r--r--chrome/test/chromedriver/command_executor_impl_unittest.cc7
-rw-r--r--chrome/test/chromedriver/commands_unittest.cc13
-rw-r--r--chrome/test/chromedriver/key_converter.cc6
-rw-r--r--chrome/test/chromedriver/keycode_text_conversion_x.cc4
-rw-r--r--chrome/test/chromedriver/server/http_handler_unittest.cc14
-rw-r--r--chrome/test/chromedriver/session.cc2
-rw-r--r--chrome/test/chromedriver/session_commands.cc3
-rw-r--r--chrome/test/chromedriver/window_commands.cc6
-rw-r--r--chrome/test/gpu/gpu_pixel_browsertest.cc2
-rw-r--r--chrome/test/perf/dom_checker_uitest.cc10
-rw-r--r--chrome/test/perf/feature_startup_test.cc3
-rw-r--r--chrome/test/perf/frame_rate/frame_rate_tests.cc20
-rw-r--r--chrome/test/perf/indexeddb_uitest.cc7
-rw-r--r--chrome/test/perf/page_cycler_test.cc15
-rw-r--r--chrome/test/perf/perf_test.cc210
-rw-r--r--chrome/test/perf/rendering/latency_tests.cc10
-rw-r--r--chrome/test/perf/rendering/throughput_tests.cc8
-rw-r--r--chrome/test/perf/shutdown_test.cc3
-rw-r--r--chrome/test/perf/startup_test.cc19
-rw-r--r--chrome/test/perf/tab_switching_test.cc3
-rw-r--r--chrome/test/perf/url_fetch_test.cc4
-rw-r--r--chrome/test/ppapi/ppapi_test.cc4
-rw-r--r--chrome/test/reliability/automated_ui_tests.cc2
-rw-r--r--chrome/test/ui/ui_test.cc2
-rw-r--r--chrome/test/webdriver/commands/command.cc2
-rw-r--r--chrome/test/webdriver/commands/set_timeout_commands_unittest.cc2
-rw-r--r--chrome/test/webdriver/frame_path.cc2
-rw-r--r--chrome/test/webdriver/keycode_text_conversion_gtk.cc2
-rw-r--r--chrome/test/webdriver/webdriver_dispatch_unittest.cc4
-rw-r--r--chrome/test/webdriver/webdriver_key_converter.cc12
-rw-r--r--chrome/test/webdriver/webdriver_session.cc8
-rw-r--r--chrome/test/webdriver/webdriver_session_manager.cc2
-rw-r--r--chrome/tools/ipclist/ipcfuzz.cc6
-rw-r--r--chrome/utility/profile_import_handler.cc2
-rw-r--r--components/autofill/browser/phone_number_i18n_unittest.cc2
-rw-r--r--components/autofill/browser/wallet/full_wallet_unittest.cc19
-rw-r--r--components/autofill/browser/wallet/wallet_address_unittest.cc6
-rw-r--r--components/autofill/browser/wallet/wallet_client_unittest.cc10
-rw-r--r--components/autofill/browser/wallet/wallet_items_unittest.cc4
-rw-r--r--components/autofill/browser/wallet/wallet_signin_helper_unittest.cc31
-rw-r--r--content/browser/accessibility/accessibility_tree_formatter.cc10
-rw-r--r--content/browser/accessibility/cross_platform_accessibility_browsertest.cc2
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.cc2
-rw-r--r--content/browser/browser_plugin/browser_plugin_host_browsertest.cc55
-rw-r--r--content/browser/database_browsertest.cc10
-rw-r--r--content/browser/devtools/devtools_http_handler_impl.cc6
-rw-r--r--content/browser/devtools/devtools_http_handler_unittest.cc12
-rw-r--r--content/browser/devtools/renderer_overrides_handler.cc4
-rw-r--r--content/browser/download/base_file.cc4
-rw-r--r--content/browser/download/base_file_unittest.cc16
-rw-r--r--content/browser/download/download_file_impl.cc4
-rw-r--r--content/browser/download/download_item_impl_unittest.cc22
-rw-r--r--content/browser/download/download_manager_impl_unittest.cc4
-rw-r--r--content/browser/download/download_stats.cc4
-rw-r--r--content/browser/download/save_file.cc2
-rw-r--r--content/browser/download/save_package.cc15
-rw-r--r--content/browser/download/save_package_unittest.cc7
-rw-r--r--content/browser/geolocation/network_location_provider_unittest.cc11
-rw-r--r--content/browser/geolocation/wifi_data_provider_linux.cc2
-rw-r--r--content/browser/gpu/gpu_control_list.cc14
-rw-r--r--content/browser/gpu/gpu_control_list_machine_model_info_unittest.cc3
-rw-r--r--content/browser/gpu/gpu_control_list_number_info_unittest.cc32
-rw-r--r--content/browser/gpu/gpu_control_list_os_info_unittest.cc26
-rw-r--r--content/browser/gpu/gpu_control_list_string_info_unittest.cc2
-rw-r--r--content/browser/gpu/gpu_control_list_version_info_unittest.cc38
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.cc8
-rw-r--r--content/browser/gpu/gpu_memory_test.cc16
-rw-r--r--content/browser/gpu/gpu_pixel_browsertest.cc2
-rw-r--r--content/browser/media/media_internals_unittest.cc2
-rw-r--r--content/browser/plugin_service_impl.cc2
-rw-r--r--content/browser/ppapi_plugin_process_host.cc2
-rw-r--r--content/browser/renderer_host/gtk_key_bindings_handler.cc19
-rw-r--r--content/browser/renderer_host/pepper/pepper_host_resolver_private_message_filter.cc6
-rw-r--r--content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.cc4
-rw-r--r--content/browser/renderer_host/render_sandbox_host_linux.cc2
-rw-r--r--content/browser/speech/google_one_shot_remote_engine_unittest.cc2
-rw-r--r--content/browser/speech/speech_recognition_manager_impl.cc3
-rw-r--r--content/browser/speech/speech_recognizer_unittest.cc2
-rw-r--r--content/browser/storage_partition_impl_map_unittest.cc19
-rw-r--r--content/browser/streams/stream_url_request_job_unittest.cc2
-rw-r--r--content/browser/tracing/tracing_ui.cc14
-rw-r--r--content/browser/web_contents/navigation_entry_impl_unittest.cc10
-rw-r--r--content/browser/webui/web_ui_data_source_unittest.cc2
-rw-r--r--content/browser/worker_host/test/worker_browsertest.cc10
-rw-r--r--content/gpu/gpu_info_collector.cc4
-rw-r--r--content/public/test/test_launcher.cc2
-rw-r--r--content/renderer/browser_plugin/browser_plugin.cc4
-rw-r--r--content/renderer/date_time_formatter.cc4
-rw-r--r--content/renderer/media/mock_media_stream_dependency_factory.cc8
-rw-r--r--content/renderer/media/peer_connection_tracker.cc4
-rw-r--r--content/renderer/p2p/port_allocator.cc4
-rw-r--r--content/renderer/pepper/pepper_device_enumeration_event_handler.cc2
-rw-r--r--content/renderer/render_thread_impl.cc2
-rw-r--r--content/renderer/v8_value_converter_impl_unittest.cc8
-rw-r--r--content/shell/shell_devtools_delegate.cc9
-rw-r--r--content/test/gpu/gpu_test_config_unittest.cc2
-rw-r--r--content/test/layout_browsertest.cc11
-rw-r--r--courgette/bsdiff_memory_unittest.cc6
-rw-r--r--crypto/ec_private_key_unittest.cc4
-rw-r--r--crypto/ec_signature_creator_unittest.cc7
-rw-r--r--dbus/end_to_end_async_unittest.cc4
-rw-r--r--dbus/message.cc6
-rw-r--r--dbus/message_unittest.cc6
-rw-r--r--dbus/string_util_unittest.cc2
-rw-r--r--dbus/values_util.cc2
-rw-r--r--device/bluetooth/bluetooth_utils.cc10
-rw-r--r--device/media_transfer_protocol/media_transfer_protocol_manager.cc6
-rw-r--r--extensions/common/extension_resource_unittest.cc3
-rw-r--r--extensions/common/matcher/substring_set_matcher_unittest.cc2
-rw-r--r--extensions/common/matcher/url_matcher.cc4
-rw-r--r--extensions/common/matcher/url_matcher_factory.cc3
-rw-r--r--extensions/common/matcher/url_matcher_unittest.cc51
-rw-r--r--google_apis/gaia/gaia_auth_fetcher.cc20
-rw-r--r--google_apis/gaia/gaia_auth_fetcher_unittest.cc53
-rw-r--r--google_apis/gaia/google_service_auth_error.cc2
-rw-r--r--google_apis/gaia/google_service_auth_error_unittest.cc2
-rw-r--r--google_apis/gaia/oauth2_access_token_fetcher_unittest.cc4
-rw-r--r--google_apis/gaia/oauth2_api_call_flow_unittest.cc10
-rw-r--r--google_apis/gaia/oauth2_mint_token_flow.cc17
-rw-r--r--google_apis/gaia/oauth2_mint_token_flow_unittest.cc2
-rw-r--r--google_apis/gaia/oauth_request_signer.cc6
-rw-r--r--google_apis/gaia/oauth_request_signer_unittest.cc84
-rw-r--r--google_apis/google_api_keys.cc29
-rw-r--r--gpu/command_buffer/service/program_manager.cc10
-rw-r--r--ipc/ipc_channel_factory.cc3
-rw-r--r--jingle/glue/channel_socket_adapter_unittest.cc3
-rw-r--r--jingle/notifier/base/gaia_token_pre_xmpp_auth.cc7
-rw-r--r--jingle/notifier/communicator/single_login_attempt.cc6
-rw-r--r--jingle/notifier/communicator/single_login_attempt_unittest.cc6
-rw-r--r--media/audio/linux/alsa_output.cc2
-rw-r--r--media/audio/null_audio_sink.cc2
-rw-r--r--media/crypto/aes_decryptor.cc2
-rw-r--r--media/crypto/aes_decryptor_unittest.cc15
-rw-r--r--media/filters/pipeline_integration_test.cc3
-rw-r--r--media/filters/pipeline_integration_test_base.cc3
-rw-r--r--media/webm/webm_cluster_parser_unittest.cc93
-rw-r--r--net/base/dns_util.cc6
-rw-r--r--net/base/host_mapping_rules_unittest.cc2
-rw-r--r--net/base/mime_sniffer_unittest.cc33
-rw-r--r--net/base/mime_util.cc2
-rw-r--r--net/base/mime_util_unittest.cc10
-rw-r--r--net/base/net_util.cc4
-rw-r--r--net/base/net_util_unittest.cc84
-rw-r--r--net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc8
-rw-r--r--net/base/sdch_filter_unittest.cc2
-rw-r--r--net/cookies/canonical_cookie_unittest.cc14
-rw-r--r--net/cookies/cookie_monster_unittest.cc87
-rw-r--r--net/cookies/cookie_store_test_helpers.cc2
-rw-r--r--net/cookies/cookie_store_unittest.h96
-rw-r--r--net/cookies/parsed_cookie.cc2
-rw-r--r--net/cookies/parsed_cookie_unittest.cc18
-rw-r--r--net/dns/host_resolver_impl_unittest.cc22
-rw-r--r--net/dns/mapped_host_resolver_unittest.cc4
-rw-r--r--net/dns/mock_host_resolver.cc36
-rw-r--r--net/dns/single_request_host_resolver_unittest.cc2
-rw-r--r--net/ftp/ftp_util.cc2
-rw-r--r--net/http/http_auth.cc6
-rw-r--r--net/http/http_auth_cache_unittest.cc21
-rw-r--r--net/http/http_auth_filter_unittest.cc25
-rw-r--r--net/http/http_auth_gssapi_posix_unittest.cc2
-rw-r--r--net/http/http_auth_handler_digest.cc8
-rw-r--r--net/http/http_auth_unittest.cc2
-rw-r--r--net/http/http_cache.cc6
-rw-r--r--net/http/http_network_transaction.cc2
-rw-r--r--net/http/http_network_transaction_spdy2_unittest.cc23
-rw-r--r--net/http/http_network_transaction_spdy3_unittest.cc23
-rw-r--r--net/http/http_proxy_client_socket_pool_spdy2_unittest.cc58
-rw-r--r--net/http/http_proxy_client_socket_pool_spdy3_unittest.cc58
-rw-r--r--net/http/http_security_headers_unittest.cc6
-rw-r--r--net/http/http_server_properties_impl_unittest.cc8
-rw-r--r--net/http/http_stream_factory_impl_unittest.cc21
-rw-r--r--net/http/http_util_unittest.cc24
-rw-r--r--net/http/http_vary_data.cc2
-rw-r--r--net/http/http_vary_data_unittest.cc2
-rw-r--r--net/proxy/dhcp_proxy_script_fetcher.cc2
-rw-r--r--net/proxy/proxy_resolver_v8_tracing_unittest.cc6
-rw-r--r--net/proxy/proxy_service_unittest.cc12
-rw-r--r--net/quic/quic_http_stream_test.cc6
-rw-r--r--net/quic/quic_packet_creator_test.cc2
-rw-r--r--net/quic/quic_packet_generator_test.cc2
-rw-r--r--net/server/http_server.cc2
-rw-r--r--net/server/http_server_request_info.cc2
-rw-r--r--net/socket/client_socket_pool_base_unittest.cc6
-rw-r--r--net/socket/deterministic_socket_data_unittest.cc5
-rw-r--r--net/socket/ssl_client_socket_pool_unittest.cc90
-rw-r--r--net/socket/transport_client_socket_pool_unittest.cc15
-rw-r--r--net/spdy/spdy_framer_test.cc6
-rw-r--r--net/spdy/spdy_http_utils.cc5
-rw-r--r--net/spdy/spdy_session_spdy2_unittest.cc6
-rw-r--r--net/spdy/spdy_session_spdy3_unittest.cc6
-rw-r--r--net/spdy/spdy_stream.cc2
-rw-r--r--net/spdy/spdy_stream_test_util.cc2
-rw-r--r--net/spdy/spdy_write_queue_unittest.cc3
-rw-r--r--net/ssl/server_bound_cert_service.cc13
-rw-r--r--net/test/base_test_server.cc4
-rw-r--r--net/tools/dump_cache/url_to_filename_encoder_unittest.cc22
-rw-r--r--net/tools/fetch/fetch_server.cc3
-rw-r--r--net/tools/flip_server/acceptor_thread.cc4
-rw-r--r--net/tools/flip_server/flip_in_mem_edsm_server.cc26
-rw-r--r--net/tools/flip_server/spdy_interface.cc11
-rw-r--r--net/tools/flip_server/streamer_interface.cc8
-rw-r--r--net/tools/quic/end_to_end_test.cc4
-rw-r--r--net/tools/quic/quic_client.cc4
-rw-r--r--net/tools/quic/test_tools/quic_test_client.cc2
-rw-r--r--net/udp/udp_socket_unittest.cc4
-rw-r--r--net/url_request/url_fetcher_impl_unittest.cc61
-rw-r--r--net/url_request/url_request_throttler_simulation_unittest.cc10
-rw-r--r--net/url_request/url_request_throttler_test_support.cc2
-rw-r--r--net/url_request/url_request_throttler_unittest.cc29
-rw-r--r--net/url_request/url_request_unittest.cc60
-rw-r--r--net/websockets/websocket_net_log_params_unittest.cc2
-rw-r--r--ppapi/cpp/dev/text_input_dev.cc2
-rw-r--r--ppapi/examples/ime/ime.cc12
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.cc2
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin_error.h2
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc4
-rw-r--r--ppapi/native_client/src/trusted/plugin/service_runtime.cc2
-rw-r--r--ppapi/proxy/audio_input_resource.cc5
-rw-r--r--ppapi/shared_impl/ppb_audio_shared.cc7
-rw-r--r--ppapi/tests/test_file_ref.cc2
-rw-r--r--ppapi/tests/test_flash_clipboard.cc2
-rw-r--r--ppapi/tests/test_flash_file.cc13
-rw-r--r--ppapi/tests/test_ime_input_event.cc6
-rw-r--r--ppapi/tests/test_url_loader.cc19
-rw-r--r--ppapi/tests/test_websocket.cc82
-rw-r--r--ppapi/tests/test_x509_certificate_private.cc28
-rw-r--r--remoting/client/plugin/chromoting_instance.cc4
-rw-r--r--remoting/client/plugin/pepper_port_allocator.cc21
-rw-r--r--remoting/host/desktop_process_unittest.cc2
-rw-r--r--remoting/host/desktop_session_proxy.cc2
-rw-r--r--remoting/host/heartbeat_sender_unittest.cc12
-rw-r--r--remoting/host/host_change_notification_listener_unittest.cc6
-rw-r--r--remoting/host/host_port_allocator.cc22
-rw-r--r--remoting/host/log_to_server_unittest.cc19
-rw-r--r--remoting/host/policy_hack/policy_watcher_unittest.cc24
-rw-r--r--remoting/host/register_support_host_request_unittest.cc10
-rw-r--r--remoting/host/server_log_entry.cc2
-rw-r--r--remoting/host/service_client.cc12
-rw-r--r--remoting/host/setup/daemon_controller_linux.cc6
-rw-r--r--remoting/host/setup/oauth_helper.cc8
-rw-r--r--remoting/host/setup/start_host.cc2
-rw-r--r--remoting/jingle_glue/iq_sender_unittest.cc18
-rw-r--r--remoting/jingle_glue/xmpp_signal_strategy.cc9
-rw-r--r--remoting/protocol/jingle_messages.cc9
-rw-r--r--remoting/protocol/jingle_session.cc5
-rw-r--r--remoting/protocol/jingle_session_unittest.cc2
-rw-r--r--remoting/protocol/libjingle_transport_factory.cc2
-rw-r--r--remoting/protocol/third_party_authenticator_unittest.cc8
-rw-r--r--remoting/protocol/transport.cc2
-rw-r--r--sandbox/linux/tests/unit_tests.cc2
-rw-r--r--sql/statement.cc2
-rw-r--r--sync/api/sync_data.cc2
-rw-r--r--sync/engine/syncer_unittest.cc16
-rw-r--r--sync/engine/syncer_util.cc2
-rw-r--r--sync/internal_api/public/base/model_type_invalidation_map_unittest.cc2
-rw-r--r--sync/internal_api/public/base/ordinal_unittest.cc2
-rw-r--r--sync/internal_api/public/base/unique_position.cc8
-rw-r--r--sync/internal_api/sync_encryption_handler_impl.cc6
-rw-r--r--sync/internal_api/sync_encryption_handler_impl_unittest.cc13
-rw-r--r--sync/internal_api/sync_manager_impl.cc2
-rw-r--r--sync/internal_api/sync_manager_impl_unittest.cc47
-rw-r--r--sync/internal_api/syncapi_server_connection_manager_unittest.cc2
-rw-r--r--sync/notifier/p2p_invalidator.cc22
-rw-r--r--sync/notifier/p2p_invalidator_unittest.cc14
-rw-r--r--sync/notifier/push_client_channel_unittest.cc2
-rw-r--r--sync/notifier/sync_invalidation_listener_unittest.cc2
-rw-r--r--sync/notifier/sync_system_resources.cc5
-rw-r--r--sync/notifier/sync_system_resources_unittest.cc5
-rw-r--r--sync/syncable/directory_backing_store.cc2
-rw-r--r--sync/syncable/model_type.cc2
-rw-r--r--sync/syncable/syncable_unittest.cc2
-rw-r--r--sync/syncable/syncable_write_transaction.cc2
-rw-r--r--sync/test/engine/mock_connection_manager.cc1
-rw-r--r--sync/util/cryptographer.cc16
-rw-r--r--ui/base/gtk/menu_label_accelerator_util.cc2
-rw-r--r--ui/base/l10n/l10n_util_unittest.cc60
-rw-r--r--ui/gl/gl_surface.cc2
-rw-r--r--webkit/appcache/appcache_update_job_unittest.cc14
-rw-r--r--webkit/fileapi/copy_or_move_file_validator_unittest.cc3
-rw-r--r--webkit/fileapi/external_mount_points_unittest.cc6
-rw-r--r--webkit/fileapi/file_system_directory_database_unittest.cc2
-rw-r--r--webkit/fileapi/file_system_origin_database.cc2
-rw-r--r--webkit/fileapi/file_system_util_unittest.cc2
-rw-r--r--webkit/fileapi/local_file_stream_writer_unittest.cc4
-rw-r--r--webkit/fileapi/local_file_system_cross_operation_unittest.cc6
-rw-r--r--webkit/fileapi/obfuscated_file_util_unittest.cc4
-rw-r--r--webkit/fileapi/syncable/canned_syncable_file_system.cc3
-rw-r--r--webkit/glue/webclipboard_impl.cc6
-rw-r--r--webkit/media/crypto/key_systems.cc5
-rw-r--r--webkit/media/crypto/key_systems_unittest.cc24
-rw-r--r--webkit/media/crypto/ppapi/cdm_wrapper.cc2
-rw-r--r--webkit/media/crypto/ppapi/clear_key_cdm.cc9
-rw-r--r--webkit/media/crypto/ppapi_decryptor.cc2
-rw-r--r--webkit/media/crypto/proxy_decryptor.cc3
-rw-r--r--webkit/plugins/ppapi/content_decryptor_delegate.cc9
-rw-r--r--webkit/quota/quota_manager_unittest.cc2
-rw-r--r--webkit/tools/test_shell/test_shell.h3
664 files changed, 3730 insertions, 5049 deletions
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc
index 782f07b..8376660 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -1535,7 +1535,7 @@ TEST_F(TraceEventTestFixture, TraceCategoriesAfterNestedEnable) {
trace_log->SetEnabled(std::string("foo2"), TraceLog::RECORD_UNTIL_FULL);
EXPECT_TRUE(*trace_log->GetCategoryEnabled("foo2"));
EXPECT_FALSE(*trace_log->GetCategoryEnabled("baz"));
- trace_log->SetEnabled(std::string(), TraceLog::RECORD_UNTIL_FULL);
+ trace_log->SetEnabled(std::string(""), TraceLog::RECORD_UNTIL_FULL);
EXPECT_TRUE(*trace_log->GetCategoryEnabled("foo"));
EXPECT_TRUE(*trace_log->GetCategoryEnabled("baz"));
trace_log->SetDisabled();
@@ -1558,8 +1558,7 @@ TEST_F(TraceEventTestFixture, TraceCategoriesAfterNestedEnable) {
TEST_F(TraceEventTestFixture, TraceOptionsParsing) {
ManualTestSetUp();
- EXPECT_EQ(TraceLog::RECORD_UNTIL_FULL,
- TraceLog::TraceOptionsFromString(std::string()));
+ EXPECT_EQ(TraceLog::RECORD_UNTIL_FULL, TraceLog::TraceOptionsFromString(""));
EXPECT_EQ(TraceLog::RECORD_UNTIL_FULL,
TraceLog::TraceOptionsFromString("record-until-full"));
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 8bf164a..fa2c1ff 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -541,8 +541,7 @@ bool CreateDirectory(const FilePath& full_path) {
base::FilePath MakeUniqueDirectory(const base::FilePath& path) {
const int kMaxAttempts = 20;
for (int attempts = 0; attempts < kMaxAttempts; attempts++) {
- int uniquifier =
- GetUniquePathNumber(path, base::FilePath::StringType());
+ int uniquifier = GetUniquePathNumber(path, FILE_PATH_LITERAL(""));
if (uniquifier < 0)
break;
base::FilePath test_path = (uniquifier == 0) ? path :
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 77dd7ac..1f10a335 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -1846,14 +1846,15 @@ TEST_F(FileUtilTest, FileEnumeratorTest) {
// create the files
FilePath dir2file = dir2.Append(FILE_PATH_LITERAL("dir2file.txt"));
- CreateTextFile(dir2file, std::wstring());
+ CreateTextFile(dir2file, L"");
FilePath dir2innerfile = dir2inner.Append(FILE_PATH_LITERAL("innerfile.txt"));
- CreateTextFile(dir2innerfile, std::wstring());
+ CreateTextFile(dir2innerfile, L"");
FilePath file1 = temp_dir_.path().Append(FILE_PATH_LITERAL("file1.txt"));
- CreateTextFile(file1, std::wstring());
- FilePath file2_rel = dir2.Append(FilePath::kParentDirectory)
- .Append(FILE_PATH_LITERAL("file2.txt"));
- CreateTextFile(file2_rel, std::wstring());
+ CreateTextFile(file1, L"");
+ FilePath file2_rel =
+ dir2.Append(FilePath::kParentDirectory)
+ .Append(FILE_PATH_LITERAL("file2.txt"));
+ CreateTextFile(file2_rel, L"");
FilePath file2_abs = temp_dir_.path().Append(FILE_PATH_LITERAL("file2.txt"));
// Only enumerate files.
diff --git a/base/files/file_path.cc b/base/files/file_path.cc
index 01d9eab..72604e8 100644
--- a/base/files/file_path.cc
+++ b/base/files/file_path.cc
@@ -552,7 +552,7 @@ string16 FilePath::LossyDisplayName() const {
std::string FilePath::MaybeAsASCII() const {
if (IsStringASCII(path_))
return path_;
- return std::string();
+ return "";
}
std::string FilePath::AsUTF8Unsafe() const {
diff --git a/base/i18n/char_iterator_unittest.cc b/base/i18n/char_iterator_unittest.cc
index 509e27c..6d1294e 100644
--- a/base/i18n/char_iterator_unittest.cc
+++ b/base/i18n/char_iterator_unittest.cc
@@ -11,7 +11,7 @@ namespace base {
namespace i18n {
TEST(CharIteratorsTest, TestUTF8) {
- std::string empty;
+ std::string empty("");
UTF8CharIterator empty_iter(&empty);
ASSERT_TRUE(empty_iter.end());
ASSERT_EQ(0, empty_iter.array_pos());
diff --git a/base/json/json_value_serializer_unittest.cc b/base/json/json_value_serializer_unittest.cc
index 9df0435..e510500 100644
--- a/base/json/json_value_serializer_unittest.cc
+++ b/base/json/json_value_serializer_unittest.cc
@@ -196,7 +196,7 @@ TEST(JSONValueSerializerTest, Roundtrip) {
// initialized with a const string.
ASSERT_FALSE(serializer.Serialize(*root_dict));
- std::string test_serialization;
+ std::string test_serialization = "";
JSONStringValueSerializer mutable_serializer(&test_serialization);
ASSERT_TRUE(mutable_serializer.Serialize(*root_dict));
ASSERT_EQ(original_serialization, test_serialization);
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc
index 1f4f9ae..4ab5ff9 100644
--- a/base/metrics/field_trial.cc
+++ b/base/metrics/field_trial.cc
@@ -318,7 +318,7 @@ std::string FieldTrialList::FindFullName(const std::string& name) {
FieldTrial* field_trial = Find(name);
if (field_trial)
return field_trial->group_name();
- return std::string();
+ return "";
}
// static
diff --git a/base/metrics/field_trial_unittest.cc b/base/metrics/field_trial_unittest.cc
index bb2c39f..81c4f37 100644
--- a/base/metrics/field_trial_unittest.cc
+++ b/base/metrics/field_trial_unittest.cc
@@ -86,7 +86,7 @@ TEST_F(FieldTrialTest, Registration) {
EXPECT_EQ(name1, trial1->trial_name());
EXPECT_EQ("", trial1->group_name_internal());
- trial1->AppendGroup(std::string(), 7);
+ trial1->AppendGroup("", 7);
EXPECT_EQ(trial1, FieldTrialList::Find(name1));
EXPECT_FALSE(FieldTrialList::Find(name2));
@@ -221,7 +221,7 @@ TEST_F(FieldTrialTest, OneWinner) {
std::string winner_name;
for (int i = 1; i <= group_count; ++i) {
- int might_win = trial->AppendGroup(std::string(), 1);
+ int might_win = trial->AppendGroup("", 1);
// Because we keep appending groups, we want to see if the last group that
// was added has been assigned or not.
diff --git a/base/metrics/statistics_recorder.cc b/base/metrics/statistics_recorder.cc
index 13aeeb7..f6174f3 100644
--- a/base/metrics/statistics_recorder.cc
+++ b/base/metrics/statistics_recorder.cc
@@ -308,7 +308,7 @@ StatisticsRecorder::~StatisticsRecorder() {
DCHECK(histograms_ && ranges_ && lock_);
if (dump_on_exit_) {
string output;
- WriteGraph(std::string(), &output);
+ WriteGraph("", &output);
DLOG(INFO) << output;
}
diff --git a/base/metrics/stats_counters.cc b/base/metrics/stats_counters.cc
index 12416d9..f763220 100644
--- a/base/metrics/stats_counters.cc
+++ b/base/metrics/stats_counters.cc
@@ -45,7 +45,7 @@ int* StatsCounter::GetPtr() {
if (counter_id_ == -1) {
counter_id_ = table->FindCounter(name_);
if (table->GetSlot() == 0) {
- if (!table->RegisterThread(std::string())) {
+ if (!table->RegisterThread("")) {
// There is no room for this thread. This thread
// cannot use counters.
counter_id_ = 0;
diff --git a/base/metrics/stats_table.cc b/base/metrics/stats_table.cc
index 9585863..dede1e4 100644
--- a/base/metrics/stats_table.cc
+++ b/base/metrics/stats_table.cc
@@ -431,8 +431,8 @@ int* StatsTable::FindLocation(const char* name) {
// Get the slot for this thread. Try to register
// it if none exists.
int slot = table->GetSlot();
- if (!slot && !(slot = table->RegisterThread(std::string())))
- return NULL;
+ if (!slot && !(slot = table->RegisterThread("")))
+ return NULL;
// Find the counter id for the counter.
std::string str_name(name);
diff --git a/base/nix/mime_util_xdg.cc b/base/nix/mime_util_xdg.cc
index 5794b6d..00dcafa 100644
--- a/base/nix/mime_util_xdg.cc
+++ b/base/nix/mime_util_xdg.cc
@@ -344,9 +344,9 @@ size_t IconTheme::MatchesSize(SubDirInfo* info, size_t size) {
std::string IconTheme::ReadLine(FILE* fp) {
if (!fp)
- return std::string();
+ return "";
- std::string result;
+ std::string result = "";
const size_t kBufferSize = 100;
char buffer[kBufferSize];
while ((fgets(buffer, kBufferSize - 1, fp)) != NULL) {
diff --git a/base/pickle_unittest.cc b/base/pickle_unittest.cc
index d252dae..d418fdf 100644
--- a/base/pickle_unittest.cc
+++ b/base/pickle_unittest.cc
@@ -134,7 +134,7 @@ TEST(PickleTest, UnalignedSize) {
TEST(PickleTest, ZeroLenStr) {
Pickle pickle;
- EXPECT_TRUE(pickle.WriteString(std::string()));
+ EXPECT_TRUE(pickle.WriteString(""));
PickleIterator iter(pickle);
std::string outstr;
@@ -144,7 +144,7 @@ TEST(PickleTest, ZeroLenStr) {
TEST(PickleTest, ZeroLenWStr) {
Pickle pickle;
- EXPECT_TRUE(pickle.WriteWString(std::wstring()));
+ EXPECT_TRUE(pickle.WriteWString(L""));
PickleIterator iter(pickle);
std::string outstr;
diff --git a/base/prefs/pref_change_registrar_unittest.cc b/base/prefs/pref_change_registrar_unittest.cc
index f353a8f..49da721 100644
--- a/base/prefs/pref_change_registrar_unittest.cc
+++ b/base/prefs/pref_change_registrar_unittest.cc
@@ -132,7 +132,7 @@ class ObserveSetOfPreferencesTest : public testing::Test {
PrefRegistrySimple* registry = pref_service_->registry();
registry->RegisterStringPref(kHomePage, "http://google.com");
registry->RegisterBooleanPref(kHomePageIsNewTabPage, false);
- registry->RegisterStringPref(kApplicationLocale, std::string());
+ registry->RegisterStringPref(kApplicationLocale, "");
}
PrefChangeRegistrar* CreatePrefChangeRegistrar() {
diff --git a/base/prefs/pref_service_unittest.cc b/base/prefs/pref_service_unittest.cc
index 927f2f7..26fe19a 100644
--- a/base/prefs/pref_service_unittest.cc
+++ b/base/prefs/pref_service_unittest.cc
@@ -45,7 +45,7 @@ TEST(PrefServiceTest, NoObserverFire) {
Mock::VerifyAndClearExpectations(&obs);
// Clearing the pref should cause the pref to fire.
- const StringValue expected_default_value((std::string()));
+ const StringValue expected_default_value("");
obs.Expect(pref_name, &expected_default_value);
prefs.ClearPref(pref_name);
Mock::VerifyAndClearExpectations(&obs);
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index e06d99c..2af9227 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -161,7 +161,7 @@ std::string GetProcStatsFieldAsString(
ProcStatsFields field_num) {
if (field_num < VM_COMM || field_num > VM_STATE) {
NOTREACHED();
- return std::string();
+ return "";
}
if (proc_stats.size() > static_cast<size_t>(field_num))
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc
index 3ce9942..265a2df 100644
--- a/base/process_util_unittest.cc
+++ b/base/process_util_unittest.cc
@@ -758,8 +758,8 @@ TEST_F(ProcessUtilTest, LaunchProcess) {
EXPECT_EQ(0, setenv("BASE_TEST", "testing", 1 /* override */));
EXPECT_EQ("testing\n", TestLaunchProcess(env_changes, no_clone_flags));
- env_changes.push_back(
- std::make_pair(std::string("BASE_TEST"), std::string()));
+ env_changes.push_back(std::make_pair(std::string("BASE_TEST"),
+ std::string("")));
EXPECT_EQ("\n", TestLaunchProcess(env_changes, no_clone_flags));
env_changes[0].second = "foo";
@@ -800,7 +800,7 @@ TEST_F(ProcessUtilTest, AlterEnvironment) {
delete[] e;
changes.clear();
- changes.push_back(std::make_pair(std::string("A"), std::string()));
+ changes.push_back(std::make_pair(std::string("A"), std::string("")));
e = base::AlterEnvironment(changes, empty);
EXPECT_TRUE(e[0] == NULL);
delete[] e;
@@ -819,7 +819,7 @@ TEST_F(ProcessUtilTest, AlterEnvironment) {
delete[] e;
changes.clear();
- changes.push_back(std::make_pair(std::string("A"), std::string()));
+ changes.push_back(std::make_pair(std::string("A"), std::string("")));
e = base::AlterEnvironment(changes, a2);
EXPECT_TRUE(e[0] == NULL);
delete[] e;
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc
index d580fba..d36b955 100644
--- a/base/string_util_unittest.cc
+++ b/base/string_util_unittest.cc
@@ -70,7 +70,7 @@ TEST(StringUtilTest, TruncateUTF8ToByteSize) {
std::string output;
// Empty strings and invalid byte_size arguments
- EXPECT_FALSE(Truncated(std::string(), 0, &output));
+ EXPECT_FALSE(Truncated("", 0, &output));
EXPECT_EQ(output, "");
EXPECT_TRUE(Truncated("\xe1\x80\xbf", 0, &output));
EXPECT_EQ(output, "");
@@ -319,7 +319,7 @@ TEST(StringUtilTest, CollapseWhitespaceASCII) {
}
TEST(StringUtilTest, ContainsOnlyWhitespaceASCII) {
- EXPECT_TRUE(ContainsOnlyWhitespaceASCII(std::string()));
+ EXPECT_TRUE(ContainsOnlyWhitespaceASCII(""));
EXPECT_TRUE(ContainsOnlyWhitespaceASCII(" "));
EXPECT_TRUE(ContainsOnlyWhitespaceASCII("\t"));
EXPECT_TRUE(ContainsOnlyWhitespaceASCII("\t \r \n "));
@@ -712,7 +712,7 @@ void TokenizeTest() {
EXPECT_EQ(r[2], STR(" three"));
r.clear();
- size = Tokenize(STR(), STR(","), &r);
+ size = Tokenize(STR(""), STR(","), &r);
EXPECT_EQ(0U, size);
ASSERT_EQ(0U, r.size());
r.clear();
@@ -761,7 +761,7 @@ TEST(StringUtilTest, JoinString) {
in.push_back("c");
EXPECT_EQ("a,b,c", JoinString(in, ','));
- in.push_back(std::string());
+ in.push_back("");
EXPECT_EQ("a,b,c,", JoinString(in, ','));
in.push_back(" ");
EXPECT_EQ("a|b|c|| ", JoinString(in, '|'));
@@ -780,7 +780,7 @@ TEST(StringUtilTest, JoinStringWithString) {
parts.push_back("c");
EXPECT_EQ("a, b, c", JoinString(parts, separator));
- parts.push_back(std::string());
+ parts.push_back("");
EXPECT_EQ("a, b, c, ", JoinString(parts, separator));
parts.push_back(" ");
EXPECT_EQ("a|b|c|| ", JoinString(parts, "|"));
@@ -812,10 +812,10 @@ TEST(StringUtilTest, StartsWith) {
EXPECT_TRUE(StartsWithASCII("JavaScript:url", "javascript", false));
EXPECT_FALSE(StartsWithASCII("java", "javascript", true));
EXPECT_FALSE(StartsWithASCII("java", "javascript", false));
- EXPECT_FALSE(StartsWithASCII(std::string(), "javascript", false));
- EXPECT_FALSE(StartsWithASCII(std::string(), "javascript", true));
- EXPECT_TRUE(StartsWithASCII("java", std::string(), false));
- EXPECT_TRUE(StartsWithASCII("java", std::string(), true));
+ EXPECT_FALSE(StartsWithASCII("", "javascript", false));
+ EXPECT_FALSE(StartsWithASCII("", "javascript", true));
+ EXPECT_TRUE(StartsWithASCII("java", "", false));
+ EXPECT_TRUE(StartsWithASCII("java", "", true));
EXPECT_TRUE(StartsWith(L"javascript:url", L"javascript", true));
EXPECT_FALSE(StartsWith(L"JavaScript:url", L"javascript", true));
@@ -823,10 +823,10 @@ TEST(StringUtilTest, StartsWith) {
EXPECT_TRUE(StartsWith(L"JavaScript:url", L"javascript", false));
EXPECT_FALSE(StartsWith(L"java", L"javascript", true));
EXPECT_FALSE(StartsWith(L"java", L"javascript", false));
- EXPECT_FALSE(StartsWith(std::wstring(), L"javascript", false));
- EXPECT_FALSE(StartsWith(std::wstring(), L"javascript", true));
- EXPECT_TRUE(StartsWith(L"java", std::wstring(), false));
- EXPECT_TRUE(StartsWith(L"java", std::wstring(), true));
+ EXPECT_FALSE(StartsWith(L"", L"javascript", false));
+ EXPECT_FALSE(StartsWith(L"", L"javascript", true));
+ EXPECT_TRUE(StartsWith(L"java", L"", false));
+ EXPECT_TRUE(StartsWith(L"java", L"", true));
}
TEST(StringUtilTest, EndsWith) {
@@ -838,14 +838,14 @@ TEST(StringUtilTest, EndsWith) {
EXPECT_FALSE(EndsWith(L".plug", L".plugin", false));
EXPECT_FALSE(EndsWith(L"Foo.plugin Bar", L".plugin", true));
EXPECT_FALSE(EndsWith(L"Foo.plugin Bar", L".plugin", false));
- EXPECT_FALSE(EndsWith(std::wstring(), L".plugin", false));
- EXPECT_FALSE(EndsWith(std::wstring(), L".plugin", true));
- EXPECT_TRUE(EndsWith(L"Foo.plugin", std::wstring(), false));
- EXPECT_TRUE(EndsWith(L"Foo.plugin", std::wstring(), true));
+ EXPECT_FALSE(EndsWith(L"", L".plugin", false));
+ EXPECT_FALSE(EndsWith(L"", L".plugin", true));
+ EXPECT_TRUE(EndsWith(L"Foo.plugin", L"", false));
+ EXPECT_TRUE(EndsWith(L"Foo.plugin", L"", true));
EXPECT_TRUE(EndsWith(L".plugin", L".plugin", false));
EXPECT_TRUE(EndsWith(L".plugin", L".plugin", true));
- EXPECT_TRUE(EndsWith(std::wstring(), std::wstring(), false));
- EXPECT_TRUE(EndsWith(std::wstring(), std::wstring(), true));
+ EXPECT_TRUE(EndsWith(L"", L"", false));
+ EXPECT_TRUE(EndsWith(L"", L"", true));
}
TEST(StringUtilTest, GetStringFWithOffsets) {
@@ -1142,10 +1142,10 @@ TEST(StringUtilTest, ReplaceChars) {
TEST(StringUtilTest, ContainsOnlyChars) {
// Providing an empty list of characters should return false but for the empty
// string.
- EXPECT_TRUE(ContainsOnlyChars(std::string(), std::string()));
- EXPECT_FALSE(ContainsOnlyChars("Hello", std::string()));
+ EXPECT_TRUE(ContainsOnlyChars("", ""));
+ EXPECT_FALSE(ContainsOnlyChars("Hello", ""));
- EXPECT_TRUE(ContainsOnlyChars(std::string(), "1234"));
+ EXPECT_TRUE(ContainsOnlyChars("", "1234"));
EXPECT_TRUE(ContainsOnlyChars("1", "1234"));
EXPECT_TRUE(ContainsOnlyChars("1", "4321"));
EXPECT_TRUE(ContainsOnlyChars("123", "4321"));
diff --git a/base/strings/string_split.cc b/base/strings/string_split.cc
index 819fdba..f5f19e9 100644
--- a/base/strings/string_split.cc
+++ b/base/strings/string_split.cc
@@ -107,8 +107,7 @@ bool SplitStringIntoKeyValuePairs(
success = false;
}
DCHECK_LE(value.size(), 1U);
- kv_pairs->push_back(
- make_pair(key, value.empty() ? std::string() : value[0]));
+ kv_pairs->push_back(make_pair(key, value.empty()? "" : value[0]));
}
return success;
}
diff --git a/base/strings/string_split_unittest.cc b/base/strings/string_split_unittest.cc
index 6729497..a950cac 100644
--- a/base/strings/string_split_unittest.cc
+++ b/base/strings/string_split_unittest.cc
@@ -36,10 +36,9 @@ class SplitStringIntoKeyValuesTest : public testing::Test {
};
TEST_F(SplitStringIntoKeyValuesTest, EmptyInputMultipleValues) {
- EXPECT_FALSE(SplitStringIntoKeyValues(std::string(), // Empty input
- '\t', // Key separators
- &key,
- &values));
+ EXPECT_FALSE(SplitStringIntoKeyValues("", // Empty input
+ '\t', // Key separators
+ &key, &values));
EXPECT_TRUE(key.empty());
EXPECT_TRUE(values.empty());
}
@@ -70,10 +69,9 @@ TEST_F(SplitStringIntoKeyValuesTest, KeyWithMultipleValues) {
}
TEST_F(SplitStringIntoKeyValuesTest, EmptyInputSingleValue) {
- EXPECT_FALSE(SplitStringIntoKeyValues(std::string(), // Empty input
- '\t', // Key separators
- &key,
- &values));
+ EXPECT_FALSE(SplitStringIntoKeyValues("", // Empty input
+ '\t', // Key separators
+ &key, &values));
EXPECT_TRUE(key.empty());
EXPECT_TRUE(values.empty());
}
@@ -110,9 +108,9 @@ class SplitStringIntoKeyValuePairsTest : public testing::Test {
};
TEST_F(SplitStringIntoKeyValuePairsTest, EmptyString) {
- EXPECT_TRUE(SplitStringIntoKeyValuePairs(std::string(),
- ':', // Key-value delimiters
- ',', // Key-value pair delims
+ EXPECT_TRUE(SplitStringIntoKeyValuePairs("",
+ ':', // Key-value delimiters
+ ',', // Key-value pair delims
&kv_pairs));
EXPECT_TRUE(kv_pairs.empty());
}
@@ -155,7 +153,7 @@ TEST_F(SplitStringIntoKeyValuePairsTest, DelimiterInValue) {
TEST(SplitStringUsingSubstrTest, EmptyString) {
std::vector<std::string> results;
- SplitStringUsingSubstr(std::string(), "DELIMITER", &results);
+ SplitStringUsingSubstr("", "DELIMITER", &results);
ASSERT_EQ(1u, results.size());
EXPECT_THAT(results, ElementsAre(""));
}
@@ -164,7 +162,7 @@ TEST(SplitStringUsingSubstrTest, EmptyString) {
TEST(StringUtilTest, SplitString) {
std::vector<std::wstring> r;
- SplitString(std::wstring(), L',', &r);
+ SplitString(L"", L',', &r);
EXPECT_EQ(0U, r.size());
r.clear();
diff --git a/base/sys_info_posix.cc b/base/sys_info_posix.cc
index 57b7af6..854f123 100644
--- a/base/sys_info_posix.cc
+++ b/base/sys_info_posix.cc
@@ -55,7 +55,7 @@ std::string SysInfo::OperatingSystemName() {
struct utsname info;
if (uname(&info) < 0) {
NOTREACHED();
- return std::string();
+ return "";
}
return std::string(info.sysname);
}
@@ -67,7 +67,7 @@ std::string SysInfo::OperatingSystemVersion() {
struct utsname info;
if (uname(&info) < 0) {
NOTREACHED();
- return std::string();
+ return "";
}
return std::string(info.release);
}
@@ -78,7 +78,7 @@ std::string SysInfo::OperatingSystemArchitecture() {
struct utsname info;
if (uname(&info) < 0) {
NOTREACHED();
- return std::string();
+ return "";
}
std::string arch(info.machine);
if (arch == "i386" || arch == "i486" || arch == "i586" || arch == "i686") {
diff --git a/base/test/trace_event_analyzer.cc b/base/test/trace_event_analyzer.cc
index 8457ce9..431945b 100644
--- a/base/test/trace_event_analyzer.cc
+++ b/base/test/trace_event_analyzer.cc
@@ -140,7 +140,7 @@ std::string TraceEvent::GetKnownArgAsString(const std::string& name) const {
if (GetArgAsString(name, &arg_string))
return arg_string;
NOTREACHED();
- return std::string();
+ return "";
}
double TraceEvent::GetKnownArgAsDouble(const std::string& name) const {
diff --git a/base/test/trace_event_analyzer_unittest.cc b/base/test/trace_event_analyzer_unittest.cc
index 52926fd..33cacbf 100644
--- a/base/test/trace_event_analyzer_unittest.cc
+++ b/base/test/trace_event_analyzer_unittest.cc
@@ -786,7 +786,7 @@ TEST_F(TraceEventAnalyzerTest, FindClosest) {
events[0].name = "one";
events[2].name = "two";
events[4].name = "three";
- Query query_named = Query::EventName() != Query::String(std::string());
+ Query query_named = Query::EventName() != Query::String("");
Query query_one = Query::EventName() == Query::String("one");
// Only one event matches query_one, so two closest can't be found.
@@ -822,7 +822,7 @@ TEST_F(TraceEventAnalyzerTest, CountMatches) {
events[0].name = "one";
events[2].name = "two";
events[4].name = "three";
- Query query_named = Query::EventName() != Query::String(std::string());
+ Query query_named = Query::EventName() != Query::String("");
Query query_one = Query::EventName() == Query::String("one");
EXPECT_EQ(0u, CountMatches(event_ptrs, Query::Bool(false)));
diff --git a/base/values_unittest.cc b/base/values_unittest.cc
index bad83fa..98bc73c 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -599,7 +599,7 @@ TEST(ValuesTest, RemoveEmptyChildren) {
// Make sure we don't prune too much.
root->SetBoolean("bool", true);
root->Set("empty_dict", new DictionaryValue);
- root->SetString("empty_string", std::string());
+ root->SetString("empty_string", "");
root.reset(root->DeepCopyWithoutEmptyChildren());
EXPECT_EQ(2U, root->size());
diff --git a/base/vlog_unittest.cc b/base/vlog_unittest.cc
index 3a508f4..ef7247f 100644
--- a/base/vlog_unittest.cc
+++ b/base/vlog_unittest.cc
@@ -16,20 +16,12 @@ namespace {
TEST(VlogTest, NoVmodule) {
int min_log_level = 0;
- EXPECT_EQ(0,
- VlogInfo(std::string(), std::string(), &min_log_level)
- .GetVlogLevel("test1"));
- EXPECT_EQ(0,
- VlogInfo("0", std::string(), &min_log_level).GetVlogLevel("test2"));
- EXPECT_EQ(
- 0, VlogInfo("blah", std::string(), &min_log_level).GetVlogLevel("test3"));
- EXPECT_EQ(
- 0,
- VlogInfo("0blah1", std::string(), &min_log_level).GetVlogLevel("test4"));
- EXPECT_EQ(1,
- VlogInfo("1", std::string(), &min_log_level).GetVlogLevel("test5"));
- EXPECT_EQ(5,
- VlogInfo("5", std::string(), &min_log_level).GetVlogLevel("test6"));
+ EXPECT_EQ(0, VlogInfo("", "", &min_log_level).GetVlogLevel("test1"));
+ EXPECT_EQ(0, VlogInfo("0", "", &min_log_level).GetVlogLevel("test2"));
+ EXPECT_EQ(0, VlogInfo("blah", "", &min_log_level).GetVlogLevel("test3"));
+ EXPECT_EQ(0, VlogInfo("0blah1", "", &min_log_level).GetVlogLevel("test4"));
+ EXPECT_EQ(1, VlogInfo("1", "", &min_log_level).GetVlogLevel("test5"));
+ EXPECT_EQ(5, VlogInfo("5", "", &min_log_level).GetVlogLevel("test6"));
}
TEST(VlogTest, MatchVlogPattern) {
@@ -100,7 +92,7 @@ TEST(VlogTest, VmoduleDirs) {
const char kVModuleSwitch[] =
"foo/bar.cc=1,baz\\*\\qux.cc=2,*quux/*=3,*/*-inl.h=4";
int min_log_level = 0;
- VlogInfo vlog_info(std::string(), kVModuleSwitch, &min_log_level);
+ VlogInfo vlog_info("", kVModuleSwitch, &min_log_level);
EXPECT_EQ(0, vlog_info.GetVlogLevel("/foo/bar.cc"));
EXPECT_EQ(0, vlog_info.GetVlogLevel("bar.cc"));
EXPECT_EQ(1, vlog_info.GetVlogLevel("foo/bar.cc"));
diff --git a/chrome/browser/about_flags_unittest.cc b/chrome/browser/about_flags_unittest.cc
index 1f6ef04..4720ce6 100644
--- a/chrome/browser/about_flags_unittest.cc
+++ b/chrome/browser/about_flags_unittest.cc
@@ -285,7 +285,7 @@ TEST_F(AboutFlagsTest, CheckValues) {
// Convert the flags to switches.
ConvertFlagsToSwitches(&prefs_, &command_line);
EXPECT_TRUE(command_line.HasSwitch(kSwitch1));
- EXPECT_EQ(std::string(), command_line.GetSwitchValueASCII(kSwitch1));
+ EXPECT_EQ(std::string(""), command_line.GetSwitchValueASCII(kSwitch1));
EXPECT_TRUE(command_line.HasSwitch(kSwitch2));
EXPECT_EQ(std::string(kValueForSwitch2),
command_line.GetSwitchValueASCII(kSwitch2));
diff --git a/chrome/browser/accessibility/accessibility_events.cc b/chrome/browser/accessibility/accessibility_events.cc
index 9a46ef6..65cf111 100644
--- a/chrome/browser/accessibility/accessibility_events.cc
+++ b/chrome/browser/accessibility/accessibility_events.cc
@@ -166,6 +166,7 @@ AccessibilityTextBoxInfo::AccessibilityTextBoxInfo(Profile* profile,
const std::string& context,
bool password)
: AccessibilityControlInfo(profile, name),
+ value_(""),
password_(password),
selection_start_(0),
selection_end_(0) {
diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc
index b3d6f54..af63f86 100644
--- a/chrome/browser/autofill/autofill_browsertest.cc
+++ b/chrome/browser/autofill/autofill_browsertest.cc
@@ -505,14 +505,14 @@ class AutofillTest : public InProcessBrowserTest {
// The previewed values should not be accessible to JavaScript.
ExpectFieldValue("firstname", "M");
- ExpectFieldValue("lastname", std::string());
- ExpectFieldValue("address1", std::string());
- ExpectFieldValue("address2", std::string());
- ExpectFieldValue("city", std::string());
- ExpectFieldValue("state", std::string());
- ExpectFieldValue("zip", std::string());
- ExpectFieldValue("country", std::string());
- ExpectFieldValue("phone", std::string());
+ ExpectFieldValue("lastname", "");
+ ExpectFieldValue("address1", "");
+ ExpectFieldValue("address2", "");
+ ExpectFieldValue("city", "");
+ ExpectFieldValue("state", "");
+ ExpectFieldValue("zip", "");
+ ExpectFieldValue("country", "");
+ ExpectFieldValue("phone", "");
// TODO(isherman): It would be nice to test that the previewed values are
// displayed: http://crbug.com/57220
@@ -742,7 +742,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, DISABLED_AutofillFormWithRepeatedField) {
// Invoke Autofill.
TryBasicFormFill();
- ExpectFieldValue("state_freeform", std::string());
+ ExpectFieldValue("state_freeform", "");
}
// http://crbug.com/150084
@@ -1307,8 +1307,8 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_ComparePhoneNumbers) {
ExpectFieldValue("PHONE_HOME_NUMBER_3-2", "555");
ExpectFieldValue("PHONE_HOME_NUMBER_4-1", "4567");
ExpectFieldValue("PHONE_HOME_NUMBER_4-2", "4567");
- ExpectFieldValue("PHONE_HOME_EXT-1", std::string());
- ExpectFieldValue("PHONE_HOME_EXT-2", std::string());
+ ExpectFieldValue("PHONE_HOME_EXT-1", "");
+ ExpectFieldValue("PHONE_HOME_EXT-2", "");
ExpectFieldValue("PHONE_HOME_COUNTRY_CODE-1", "1");
}
@@ -1447,7 +1447,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_NoAutofillForReadOnlyFields) {
ui_test_utils::NavigateToURL(browser(), url);
PopulateForm("firstname");
- ExpectFieldValue("email", std::string());
+ ExpectFieldValue("email", "");
ExpectFieldValue("address", addr_line1);
}
diff --git a/chrome/browser/automation/automation_misc_browsertest.cc b/chrome/browser/automation/automation_misc_browsertest.cc
index 11ce614..97efd95 100644
--- a/chrome/browser/automation/automation_misc_browsertest.cc
+++ b/chrome/browser/automation/automation_misc_browsertest.cc
@@ -82,8 +82,8 @@ IN_PROC_BROWSER_TEST_F(AutomationMiscBrowserTest, ProcessMouseEvent) {
" window.didClick = true;"
"}, true);"));
AutomationMouseEvent automation_event;
- automation_event.location_script_chain
- .push_back(ScriptEvaluationRequest("{'x': 5, 'y': 10}", std::string()));
+ automation_event.location_script_chain.push_back(
+ ScriptEvaluationRequest("{'x': 5, 'y': 10}", ""));
WebKit::WebMouseEvent& mouse_event = automation_event.mouse_event;
mouse_event.type = WebKit::WebInputEvent::MouseDown;
mouse_event.button = WebKit::WebMouseEvent::ButtonLeft;
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index e176eec..ae9f48c 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -991,7 +991,7 @@ void TestingAutomationProvider::GetTabTitle(int handle,
NavigationController* tab = tab_tracker_->GetResource(handle);
NavigationEntry* entry = tab->GetActiveEntry();
if (entry != NULL) {
- *title = UTF16ToWideHack(entry->GetTitleForDisplay(std::string()));
+ *title = UTF16ToWideHack(entry->GetTitleForDisplay(""));
} else {
*title = std::wstring();
}
@@ -3414,7 +3414,7 @@ void TestingAutomationProvider::RemoveSavedPassword(
// This observer will delete itself.
PasswordStoreLoginsChangedObserver* observer =
new PasswordStoreLoginsChangedObserver(
- this, reply_message, PasswordStoreChange::REMOVE, std::string());
+ this, reply_message, PasswordStoreChange::REMOVE, "");
observer->Init();
password_store->RemoveLogin(to_remove);
@@ -5353,7 +5353,7 @@ void TestingAutomationProvider::GetTabInfo(
return;
}
DictionaryValue dict;
- dict.SetString("title", entry->GetTitleForDisplay(std::string()));
+ dict.SetString("title", entry->GetTitleForDisplay(""));
dict.SetString("url", entry->GetVirtualURL().spec());
reply.SendSuccess(&dict);
} else {
diff --git a/chrome/browser/bookmarks/bookmark_utils_unittest.cc b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
index a5f253d..f71645e 100644
--- a/chrome/browser/bookmarks/bookmark_utils_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
@@ -166,31 +166,22 @@ TEST_F(BookmarkUtilsTest, ApplyEditsWithNoFolderChange) {
{
BookmarkEditor::EditDetails detail(
BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 1));
- ApplyEditsWithNoFolderChange(&model,
- bookmarkbar,
- detail,
- ASCIIToUTF16("folder0"),
- GURL(std::string()));
+ ApplyEditsWithNoFolderChange(&model, bookmarkbar, detail,
+ ASCIIToUTF16("folder0"), GURL(""));
EXPECT_EQ(ASCIIToUTF16("folder0"), bookmarkbar->GetChild(1)->GetTitle());
}
{
BookmarkEditor::EditDetails detail(
BookmarkEditor::EditDetails::AddFolder(bookmarkbar, -1));
- ApplyEditsWithNoFolderChange(&model,
- bookmarkbar,
- detail,
- ASCIIToUTF16("folder1"),
- GURL(std::string()));
+ ApplyEditsWithNoFolderChange(&model, bookmarkbar, detail,
+ ASCIIToUTF16("folder1"), GURL(""));
EXPECT_EQ(ASCIIToUTF16("folder1"), bookmarkbar->GetChild(3)->GetTitle());
}
{
BookmarkEditor::EditDetails detail(
BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 10));
- ApplyEditsWithNoFolderChange(&model,
- bookmarkbar,
- detail,
- ASCIIToUTF16("folder2"),
- GURL(std::string()));
+ ApplyEditsWithNoFolderChange(&model, bookmarkbar, detail,
+ ASCIIToUTF16("folder2"), GURL(""));
EXPECT_EQ(ASCIIToUTF16("folder2"), bookmarkbar->GetChild(4)->GetTitle());
}
}
diff --git a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
index be0879b..94df56c 100644
--- a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
@@ -277,10 +277,8 @@ TEST_F(BrowsingDataCookieHelperTest, CannedDomainCookie) {
helper->AddChangedCookie(origin, origin, "A=1; Domain=.www.google.com",
net::CookieOptions());
// Try adding invalid cookies that will be ignored.
- helper->AddChangedCookie(origin, origin, std::string(), net::CookieOptions());
- helper->AddChangedCookie(origin,
- origin,
- "C=bad guy; Domain=wrongdomain.com",
+ helper->AddChangedCookie(origin, origin, "", net::CookieOptions());
+ helper->AddChangedCookie(origin, origin, "C=bad guy; Domain=wrongdomain.com",
net::CookieOptions());
helper->StartFetching(
diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc
index 019a45b..8c29d07 100644
--- a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc
+++ b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc
@@ -104,9 +104,9 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedAddDatabase) {
scoped_refptr<CannedBrowsingDataDatabaseHelper> helper(
new CannedBrowsingDataDatabaseHelper(browser()->profile()));
- helper->AddDatabase(origin1, db1, std::string());
- helper->AddDatabase(origin1, db2, std::string());
- helper->AddDatabase(origin2, db3, std::string());
+ helper->AddDatabase(origin1, db1, "");
+ helper->AddDatabase(origin1, db2, "");
+ helper->AddDatabase(origin2, db3, "");
TestCompletionCallback callback;
helper->StartFetching(
@@ -136,8 +136,8 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedUnique) {
scoped_refptr<CannedBrowsingDataDatabaseHelper> helper(
new CannedBrowsingDataDatabaseHelper(browser()->profile()));
- helper->AddDatabase(origin, db, std::string());
- helper->AddDatabase(origin, db, std::string());
+ helper->AddDatabase(origin, db, "");
+ helper->AddDatabase(origin, db, "");
TestCompletionCallback callback;
helper->StartFetching(
diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc
index 89c290d..2a2b474 100644
--- a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc
@@ -35,7 +35,7 @@ TEST_F(CannedBrowsingDataDatabaseHelperTest, Empty) {
new CannedBrowsingDataDatabaseHelper(&profile));
ASSERT_TRUE(helper->empty());
- helper->AddDatabase(origin, db, std::string());
+ helper->AddDatabase(origin, db, "");
ASSERT_FALSE(helper->empty());
helper->Reset();
ASSERT_TRUE(helper->empty());
@@ -52,9 +52,9 @@ TEST_F(CannedBrowsingDataDatabaseHelperTest, IgnoreExtensionsAndDevTools) {
new CannedBrowsingDataDatabaseHelper(&profile));
ASSERT_TRUE(helper->empty());
- helper->AddDatabase(origin1, db, std::string());
+ helper->AddDatabase(origin1, db, "");
ASSERT_TRUE(helper->empty());
- helper->AddDatabase(origin2, db, std::string());
+ helper->AddDatabase(origin2, db, "");
ASSERT_TRUE(helper->empty());
helper->Reset();
ASSERT_TRUE(helper->empty());
diff --git a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
index 9699414..58b1dd5 100644
--- a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
+++ b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
@@ -416,7 +416,7 @@ TEST_F(CookiesTreeModelTest, RemoveAll) {
SCOPED_TRACE("After removing");
EXPECT_EQ(1, cookies_model->GetRoot()->GetTotalNodeCount());
EXPECT_EQ(0, cookies_model->GetRoot()->child_count());
- EXPECT_EQ(std::string(), GetDisplayedCookies(cookies_model.get()));
+ EXPECT_EQ(std::string(""), GetDisplayedCookies(cookies_model.get()));
EXPECT_TRUE(mock_browsing_data_cookie_helper_->AllDeleted());
EXPECT_TRUE(mock_browsing_data_database_helper_->AllDeleted());
EXPECT_TRUE(mock_browsing_data_local_storage_helper_->AllDeleted());
diff --git a/chrome/browser/certificate_manager_model.cc b/chrome/browser/certificate_manager_model.cc
index aecd3a3..f519a0d 100644
--- a/chrome/browser/certificate_manager_model.cc
+++ b/chrome/browser/certificate_manager_model.cc
@@ -38,7 +38,7 @@ void CertificateManagerModel::Refresh() {
chrome::UnlockSlotsIfNecessary(
modules,
chrome::kCryptoModulePasswordListCerts,
- std::string(), // unused.
+ "", // unused.
base::Bind(&CertificateManagerModel::RefreshSlotsUnlocked,
base::Unretained(this)));
}
@@ -95,8 +95,9 @@ string16 CertificateManagerModel::GetColumnText(
x509_certificate_model::GetTokenName(cert.os_cert_handle()));
break;
case COL_SERIAL_NUMBER:
- rv = ASCIIToUTF16(x509_certificate_model::GetSerialNumberHexified(
- cert.os_cert_handle(), std::string()));
+ rv = ASCIIToUTF16(
+ x509_certificate_model::GetSerialNumberHexified(
+ cert.os_cert_handle(), ""));
break;
case COL_EXPIRES_ON:
if (!cert.valid_expiry().is_null())
diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc
index f4105ad..88c664c 100644
--- a/chrome/browser/content_settings/content_settings_browsertest.cc
+++ b/chrome/browser/content_settings/content_settings_browsertest.cc
@@ -338,12 +338,12 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, AllowException) {
browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK);
- browser()->profile()->GetHostContentSettingsMap()
- ->SetContentSetting(ContentSettingsPattern::FromURL(url),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string(),
- CONTENT_SETTING_ALLOW);
+ browser()->profile()->GetHostContentSettingsMap()->SetContentSetting(
+ ContentSettingsPattern::FromURL(url),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_PLUGINS,
+ "",
+ CONTENT_SETTING_ALLOW);
string16 expected_title(ASCIIToUTF16("OK"));
content::TitleWatcher title_watcher(
@@ -357,12 +357,12 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, BlockException) {
GURL url = ui_test_utils::GetTestUrl(
base::FilePath(), base::FilePath().AppendASCII("clicktoplay.html"));
- browser()->profile()->GetHostContentSettingsMap()
- ->SetContentSetting(ContentSettingsPattern::FromURL(url),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string(),
- CONTENT_SETTING_BLOCK);
+ browser()->profile()->GetHostContentSettingsMap()->SetContentSetting(
+ ContentSettingsPattern::FromURL(url),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_PLUGINS,
+ "",
+ CONTENT_SETTING_BLOCK);
string16 expected_title(ASCIIToUTF16("Click To Play"));
content::TitleWatcher title_watcher(
diff --git a/chrome/browser/content_settings/content_settings_internal_extension_provider.cc b/chrome/browser/content_settings/content_settings_internal_extension_provider.cc
index 56dd993..815d037 100644
--- a/chrome/browser/content_settings/content_settings_internal_extension_provider.cc
+++ b/chrome/browser/content_settings/content_settings_internal_extension_provider.cc
@@ -117,19 +117,19 @@ void InternalExtensionProvider::SetContentSettingForExtension(
value_map_.DeleteValue(primary_pattern,
secondary_pattern,
CONTENT_SETTINGS_TYPE_PLUGINS,
- ResourceIdentifier());
+ ResourceIdentifier(""));
} else {
value_map_.SetValue(primary_pattern,
secondary_pattern,
CONTENT_SETTINGS_TYPE_PLUGINS,
- ResourceIdentifier(),
+ ResourceIdentifier(""),
Value::CreateIntegerValue(setting));
}
}
NotifyObservers(primary_pattern,
secondary_pattern,
CONTENT_SETTINGS_TYPE_PLUGINS,
- ResourceIdentifier());
+ ResourceIdentifier(""));
}
} // namespace content_settings
diff --git a/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc b/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc
index b8612a5..21089fb 100644
--- a/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc
@@ -14,40 +14,38 @@
TEST(OriginIdentifierValueMapTest, SetGetValue) {
content_settings::OriginIdentifierValueMap map;
- EXPECT_EQ(NULL,
- map.GetValue(GURL("http://www.google.com"),
- GURL("http://www.google.com"),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string()));
- map.SetValue(ContentSettingsPattern::FromString("[*.]google.com"),
- ContentSettingsPattern::FromString("[*.]google.com"),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- Value::CreateIntegerValue(1));
+ EXPECT_EQ(NULL, map.GetValue(GURL("http://www.google.com"),
+ GURL("http://www.google.com"),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ ""));
+ map.SetValue(
+ ContentSettingsPattern::FromString("[*.]google.com"),
+ ContentSettingsPattern::FromString("[*.]google.com"),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ Value::CreateIntegerValue(1));
scoped_ptr<Value> expected_value(Value::CreateIntegerValue(1));
- EXPECT_TRUE(expected_value->Equals(map.GetValue(GURL("http://www.google.com"),
- GURL("http://www.google.com"),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string())));
-
- EXPECT_EQ(NULL,
- map.GetValue(GURL("http://www.google.com"),
- GURL("http://www.youtube.com"),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string()));
-
- EXPECT_EQ(NULL,
- map.GetValue(GURL("http://www.youtube.com"),
- GURL("http://www.google.com"),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string()));
-
- EXPECT_EQ(NULL,
- map.GetValue(GURL("http://www.google.com"),
- GURL("http://www.google.com"),
- CONTENT_SETTINGS_TYPE_POPUPS,
- std::string()));
+ EXPECT_TRUE(expected_value->Equals(
+ map.GetValue(GURL("http://www.google.com"),
+ GURL("http://www.google.com"),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "")));
+
+ EXPECT_EQ(NULL, map.GetValue(GURL("http://www.google.com"),
+ GURL("http://www.youtube.com"),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ ""));
+
+ EXPECT_EQ(NULL, map.GetValue(GURL("http://www.youtube.com"),
+ GURL("http://www.google.com"),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ ""));
+
+ EXPECT_EQ(NULL, map.GetValue(GURL("http://www.google.com"),
+ GURL("http://www.google.com"),
+ CONTENT_SETTINGS_TYPE_POPUPS,
+ ""));
EXPECT_EQ(NULL, map.GetValue(GURL("http://www.google.com"),
GURL("http://www.google.com"),
@@ -121,11 +119,12 @@ TEST(OriginIdentifierValueMapTest, Clear) {
CONTENT_SETTINGS_TYPE_PLUGINS,
"java-plugin",
Value::CreateIntegerValue(1));
- map.SetValue(ContentSettingsPattern::FromString("[*.]google.com"),
- ContentSettingsPattern::FromString("[*.]google.com"),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- Value::CreateIntegerValue(1));
+ map.SetValue(
+ ContentSettingsPattern::FromString("[*.]google.com"),
+ ContentSettingsPattern::FromString("[*.]google.com"),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ Value::CreateIntegerValue(1));
EXPECT_FALSE(map.empty());
int actual_value;
EXPECT_TRUE(map.GetValue(GURL("http://www.google.com"),
@@ -146,36 +145,38 @@ TEST(OriginIdentifierValueMapTest, Clear) {
TEST(OriginIdentifierValueMapTest, ListEntryPrecedences) {
content_settings::OriginIdentifierValueMap map;
- map.SetValue(ContentSettingsPattern::FromString("[*.]google.com"),
- ContentSettingsPattern::FromString("[*.]google.com"),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- Value::CreateIntegerValue(1));
+ map.SetValue(
+ ContentSettingsPattern::FromString("[*.]google.com"),
+ ContentSettingsPattern::FromString("[*.]google.com"),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ Value::CreateIntegerValue(1));
- map.SetValue(ContentSettingsPattern::FromString("www.google.com"),
- ContentSettingsPattern::FromString("[*.]google.com"),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- Value::CreateIntegerValue(2));
+ map.SetValue(
+ ContentSettingsPattern::FromString("www.google.com"),
+ ContentSettingsPattern::FromString("[*.]google.com"),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ Value::CreateIntegerValue(2));
int actual_value;
EXPECT_TRUE(map.GetValue(GURL("http://mail.google.com"),
GURL("http://www.google.com"),
CONTENT_SETTINGS_TYPE_COOKIES,
- std::string())->GetAsInteger(&actual_value));
+ "")->GetAsInteger(&actual_value));
EXPECT_EQ(1, actual_value);
EXPECT_TRUE(map.GetValue(GURL("http://www.google.com"),
GURL("http://www.google.com"),
CONTENT_SETTINGS_TYPE_COOKIES,
- std::string())->GetAsInteger(&actual_value));
+ "")->GetAsInteger(&actual_value));
EXPECT_EQ(2, actual_value);
}
TEST(OriginIdentifierValueMapTest, IterateEmpty) {
content_settings::OriginIdentifierValueMap map;
scoped_ptr<content_settings::RuleIterator> rule_iterator(
- map.GetRuleIterator(CONTENT_SETTINGS_TYPE_COOKIES, std::string(), NULL));
+ map.GetRuleIterator(CONTENT_SETTINGS_TYPE_COOKIES, "", NULL));
EXPECT_FALSE(rule_iterator->HasNext());
}
@@ -186,19 +187,21 @@ TEST(OriginIdentifierValueMapTest, IterateNonempty) {
ContentSettingsPattern::FromString("[*.]google.com");
ContentSettingsPattern sub_pattern =
ContentSettingsPattern::FromString("sub.google.com");
- map.SetValue(pattern,
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- Value::CreateIntegerValue(1));
- map.SetValue(sub_pattern,
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- Value::CreateIntegerValue(2));
+ map.SetValue(
+ pattern,
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ Value::CreateIntegerValue(1));
+ map.SetValue(
+ sub_pattern,
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ Value::CreateIntegerValue(2));
scoped_ptr<content_settings::RuleIterator> rule_iterator(
- map.GetRuleIterator(CONTENT_SETTINGS_TYPE_COOKIES, std::string(), NULL));
+ map.GetRuleIterator(CONTENT_SETTINGS_TYPE_COOKIES, "", NULL));
ASSERT_TRUE(rule_iterator->HasNext());
content_settings::Rule rule = rule_iterator->Next();
EXPECT_EQ(sub_pattern, rule.primary_pattern);
diff --git a/chrome/browser/content_settings/content_settings_policy_provider.cc b/chrome/browser/content_settings/content_settings_policy_provider.cc
index f1e40fb..b112db0 100644
--- a/chrome/browser/content_settings/content_settings_policy_provider.cc
+++ b/chrome/browser/content_settings/content_settings_policy_provider.cc
@@ -276,7 +276,7 @@ void PolicyProvider::GetContentSettingsFromPreferences(
pattern_pair.first,
secondary_pattern,
content_type,
- NO_RESOURCE_IDENTIFIER,
+ ResourceIdentifier(NO_RESOURCE_IDENTIFIER),
base::Value::CreateIntegerValue(
kPrefsForManagedContentSettingsMap[i].setting));
}
diff --git a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
index 37b718c..23c43f8 100644
--- a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
@@ -150,34 +150,22 @@ TEST_F(PolicyProviderTest, GettingManagedContentSettings) {
GURL google_url("http://mail.google.com");
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&provider,
- youtube_url,
- youtube_url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- false));
+ GetContentSetting(
+ &provider, youtube_url, youtube_url,
+ CONTENT_SETTINGS_TYPE_COOKIES, "", false));
EXPECT_EQ(NULL,
- GetContentSettingValue(&provider,
- youtube_url,
- youtube_url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- false));
+ GetContentSettingValue(
+ &provider, youtube_url, youtube_url,
+ CONTENT_SETTINGS_TYPE_COOKIES, "", false));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&provider,
- google_url,
- google_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(
+ &provider, google_url, google_url,
+ CONTENT_SETTINGS_TYPE_IMAGES, "", false));
scoped_ptr<Value> value_ptr(
- GetContentSettingValue(&provider,
- google_url,
- google_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSettingValue(
+ &provider, google_url, google_url,
+ CONTENT_SETTINGS_TYPE_IMAGES, "", false));
int int_value = -1;
value_ptr->GetAsInteger(&int_value);
@@ -188,19 +176,17 @@ TEST_F(PolicyProviderTest, GettingManagedContentSettings) {
// SetWebsiteSetting does nothing.
scoped_ptr<base::Value> value_block(
Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
- bool owned = provider.SetWebsiteSetting(yt_url_pattern,
- yt_url_pattern,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- value_block.get());
+ bool owned = provider.SetWebsiteSetting(
+ yt_url_pattern,
+ yt_url_pattern,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ value_block.get());
EXPECT_FALSE(owned);
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&provider,
- youtube_url,
- youtube_url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- false));
+ GetContentSetting(
+ &provider, youtube_url, youtube_url,
+ CONTENT_SETTINGS_TYPE_COOKIES, "", false));
provider.ShutdownOnUIThread();
}
@@ -227,12 +213,9 @@ TEST_F(PolicyProviderTest, ResourceIdentifier) {
// There is currently no policy support for resource content settings.
// Resource identifiers are simply ignored by the PolicyProvider.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
- GetContentSetting(&provider,
- google_url,
- google_url,
- CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string(),
- false));
+ GetContentSetting(
+ &provider, google_url, google_url,
+ CONTENT_SETTINGS_TYPE_PLUGINS, "", false));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
GetContentSetting(
@@ -249,14 +232,10 @@ TEST_F(PolicyProviderTest, AutoSelectCertificateList) {
PolicyProvider provider(prefs);
GURL google_url("https://mail.google.com");
// Tests the default setting for auto selecting certificates
- EXPECT_EQ(
- NULL,
- GetContentSettingValue(&provider,
- google_url,
- google_url,
- CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
- std::string(),
- false));
+ EXPECT_EQ(NULL,
+ GetContentSettingValue(
+ &provider, google_url, google_url,
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "", false));
// Set the content settings pattern list for origins to auto select
// certificates.
@@ -268,21 +247,13 @@ TEST_F(PolicyProviderTest, AutoSelectCertificateList) {
prefs->SetManagedPref(prefs::kManagedAutoSelectCertificateForUrls,
value);
GURL youtube_url("https://www.youtube.com");
- EXPECT_EQ(
- NULL,
- GetContentSettingValue(&provider,
- youtube_url,
- youtube_url,
- CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
- std::string(),
- false));
- scoped_ptr<Value> cert_filter(
- GetContentSettingValue(&provider,
- google_url,
- google_url,
- CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
- std::string(),
- false));
+ EXPECT_EQ(NULL,
+ GetContentSettingValue(
+ &provider, youtube_url, youtube_url,
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "", false));
+ scoped_ptr<Value> cert_filter(GetContentSettingValue(
+ &provider, google_url, google_url,
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "", false));
ASSERT_EQ(Value::TYPE_DICTIONARY, cert_filter->GetType());
DictionaryValue* dict_value =
diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc
index 4690f2f..a92315e 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider.cc
@@ -188,21 +188,22 @@ void PrefProvider::ClearAllContentSettingsRules(
{
base::AutoLock auto_lock(lock_);
scoped_ptr<RuleIterator> rule_iterator(
- map_to_modify->GetRuleIterator(content_type, std::string(), NULL));
+ map_to_modify->GetRuleIterator(content_type, "", NULL));
// Copy the rules; we cannot call |UpdatePref| while holding |lock_|.
while (rule_iterator->HasNext())
rules_to_delete.push_back(rule_iterator->Next());
- map_to_modify->DeleteValues(content_type, std::string());
+ map_to_modify->DeleteValues(content_type, "");
}
for (std::vector<Rule>::const_iterator it = rules_to_delete.begin();
it != rules_to_delete.end(); ++it) {
- UpdatePref(it->primary_pattern,
- it->secondary_pattern,
- content_type,
- std::string(),
- NULL);
+ UpdatePref(
+ it->primary_pattern,
+ it->secondary_pattern,
+ content_type,
+ "",
+ NULL);
}
NotifyObservers(ContentSettingsPattern(),
ContentSettingsPattern(),
@@ -306,8 +307,8 @@ void PrefProvider::UpdatePref(
void PrefProvider::MigrateObsoleteMediaContentSetting() {
std::vector<Rule> rules_to_delete;
{
- scoped_ptr<RuleIterator> rule_iterator(GetRuleIterator(
- CONTENT_SETTINGS_TYPE_MEDIASTREAM, std::string(), false));
+ scoped_ptr<RuleIterator> rule_iterator(
+ GetRuleIterator(CONTENT_SETTINGS_TYPE_MEDIASTREAM, "", false));
while (rule_iterator->HasNext()) {
// Skip default setting and rules without a value.
const content_settings::Rule& rule = rule_iterator->Next();
@@ -332,7 +333,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() {
SetWebsiteSetting(it->primary_pattern,
it->secondary_pattern,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
- std::string(),
+ "",
Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
}
// Add the exception to the new camera content setting.
@@ -340,7 +341,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() {
SetWebsiteSetting(it->primary_pattern,
it->secondary_pattern,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
- std::string(),
+ "",
Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
}
@@ -348,7 +349,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() {
SetWebsiteSetting(it->primary_pattern,
it->secondary_pattern,
CONTENT_SETTINGS_TYPE_MEDIASTREAM,
- std::string(),
+ "",
NULL);
}
}
@@ -454,7 +455,7 @@ void PrefProvider::ReadContentSettingsFromPref(bool overwrite) {
value_map_.SetValue(pattern_pair.first,
pattern_pair.second,
content_type,
- ResourceIdentifier(),
+ ResourceIdentifier(""),
value);
if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) {
ContentSetting s = ValueToContentSetting(value);
diff --git a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
index 1ddc6d0..f951829 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
@@ -121,7 +121,7 @@ TEST_F(PrefProviderTest, Observer) {
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
pref_content_settings_provider.ShutdownOnUIThread();
@@ -166,26 +166,20 @@ TEST_F(PrefProviderTest, Incognito) {
pattern,
pattern,
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
GURL host("http://example.com/");
// The value should of course be visible in the regular PrefProvider.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
- GetContentSetting(&pref_content_settings_provider,
- host,
- host,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(
+ &pref_content_settings_provider,
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
// And also in the OTR version.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
- GetContentSetting(&pref_content_settings_provider_incognito,
- host,
- host,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(
+ &pref_content_settings_provider_incognito,
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
// But the value should not be overridden in the OTR user prefs accidentally.
EXPECT_FALSE(otr_user_prefs->IsSetInOverlay(
prefs::kContentSettingsPatternPairs));
@@ -203,40 +197,26 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) {
ContentSettingsPattern::FromString("[*.]example.com");
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(&provider, primary_url, primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES, "", false));
EXPECT_EQ(NULL,
- GetContentSettingValue(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSettingValue(
+ &provider, primary_url, primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES, "", false));
- provider.SetWebsiteSetting(primary_pattern,
- primary_pattern,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
+ provider.SetWebsiteSetting(
+ primary_pattern,
+ primary_pattern,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ "",
+ Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(&provider, primary_url, primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES, "", false));
scoped_ptr<Value> value_ptr(
- GetContentSettingValue(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSettingValue(&provider, primary_url, primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES, "", false));
int int_value = -1;
value_ptr->GetAsInteger(&int_value);
EXPECT_EQ(CONTENT_SETTING_BLOCK, IntToContentSetting(int_value));
@@ -244,15 +224,12 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) {
provider.SetWebsiteSetting(primary_pattern,
primary_pattern,
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
NULL);
EXPECT_EQ(NULL,
- GetContentSettingValue(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSettingValue(
+ &provider, primary_url, primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES, "", false));
provider.ShutdownOnUIThread();
}
@@ -273,74 +250,53 @@ TEST_F(PrefProviderTest, Patterns) {
ContentSettingsPattern::FromString("file:///tmp/test.html");
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&pref_content_settings_provider,
- host1,
- host1,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(
+ &pref_content_settings_provider,
+ host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
pref_content_settings_provider.SetWebsiteSetting(
pattern1,
pattern1,
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&pref_content_settings_provider,
- host1,
- host1,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(
+ &pref_content_settings_provider,
+ host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&pref_content_settings_provider,
- host2,
- host2,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(
+ &pref_content_settings_provider,
+ host2, host2, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&pref_content_settings_provider,
- host3,
- host3,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(
+ &pref_content_settings_provider,
+ host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
pref_content_settings_provider.SetWebsiteSetting(
pattern2,
pattern2,
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&pref_content_settings_provider,
- host3,
- host3,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(
+ &pref_content_settings_provider,
+ host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
GetContentSetting(&pref_content_settings_provider,
- host4,
- host4,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ host4, host4, CONTENT_SETTINGS_TYPE_IMAGES, "",
false));
pref_content_settings_provider.SetWebsiteSetting(
pattern3,
pattern3,
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&pref_content_settings_provider,
- host4,
- host4,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ GetContentSetting(
+ &pref_content_settings_provider,
+ host4, host4, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
pref_content_settings_provider.ShutdownOnUIThread();
}
diff --git a/chrome/browser/content_settings/content_settings_provider.h b/chrome/browser/content_settings/content_settings_provider.h
index 6bc64de..fefa226 100644
--- a/chrome/browser/content_settings/content_settings_provider.h
+++ b/chrome/browser/content_settings/content_settings_provider.h
@@ -7,7 +7,7 @@
#ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_
#define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_
-#define NO_RESOURCE_IDENTIFIER std::string()
+#define NO_RESOURCE_IDENTIFIER ""
#include <string>
#include <vector>
diff --git a/chrome/browser/content_settings/content_settings_provider_unittest.cc b/chrome/browser/content_settings/content_settings_provider_unittest.cc
index 0832a1c..e0857b3 100644
--- a/chrome/browser/content_settings/content_settings_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_provider_unittest.cc
@@ -46,18 +46,11 @@ TEST(ContentSettingsProviderTest, Mock) {
CONTENT_SETTINGS_TYPE_PLUGINS,
"flash_plugin", false));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&mock_provider,
- url,
- url,
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- false));
+ GetContentSetting(&mock_provider, url, url,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION, "", false));
EXPECT_EQ(NULL,
- GetContentSettingValue(&mock_provider,
- url,
- url,
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
+ GetContentSettingValue(&mock_provider, url, url,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION, "",
false));
bool owned = mock_provider.SetWebsiteSetting(
diff --git a/chrome/browser/content_settings/content_settings_utils.cc b/chrome/browser/content_settings/content_settings_utils.cc
index 9754ba1..d3a2869 100644
--- a/chrome/browser/content_settings/content_settings_utils.cc
+++ b/chrome/browser/content_settings/content_settings_utils.cc
@@ -190,10 +190,10 @@ ContentSetting GetContentSetting(const ProviderInterface* provider,
void GetRendererContentSettingRules(const HostContentSettingsMap* map,
RendererContentSettingRules* rules) {
- map->GetSettingsForOneType(
- CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &(rules->image_rules));
- map->GetSettingsForOneType(
- CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(), &(rules->script_rules));
+ map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, "",
+ &(rules->image_rules));
+ map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, "",
+ &(rules->script_rules));
}
} // namespace content_settings
diff --git a/chrome/browser/content_settings/content_settings_utils_unittest.cc b/chrome/browser/content_settings/content_settings_utils_unittest.cc
index d5eeeca..69f88c1 100644
--- a/chrome/browser/content_settings/content_settings_utils_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_utils_unittest.cc
@@ -11,7 +11,7 @@
TEST(ContentSettingsUtilsTest, ParsePatternString) {
content_settings::PatternPair pattern_pair;
- pattern_pair = content_settings::ParsePatternString(std::string());
+ pattern_pair = content_settings::ParsePatternString("");
EXPECT_FALSE(pattern_pair.first.IsValid());
EXPECT_FALSE(pattern_pair.second.IsValid());
diff --git a/chrome/browser/content_settings/cookie_settings.cc b/chrome/browser/content_settings/cookie_settings.cc
index e0b1ff6..e34a56e 100644
--- a/chrome/browser/content_settings/cookie_settings.cc
+++ b/chrome/browser/content_settings/cookie_settings.cc
@@ -130,7 +130,7 @@ bool CookieSettings::IsCookieSessionOnly(const GURL& origin) const {
void CookieSettings::GetCookieSettings(
ContentSettingsForOneType* settings) const {
return host_content_settings_map_->GetSettingsForOneType(
- CONTENT_SETTINGS_TYPE_COOKIES, std::string(), settings);
+ CONTENT_SETTINGS_TYPE_COOKIES, "", settings);
}
void CookieSettings::SetDefaultCookieSetting(ContentSetting setting) {
@@ -147,21 +147,17 @@ void CookieSettings::SetCookieSetting(
if (setting == CONTENT_SETTING_SESSION_ONLY) {
DCHECK(secondary_pattern == ContentSettingsPattern::Wildcard());
}
- host_content_settings_map_->SetContentSetting(primary_pattern,
- secondary_pattern,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- setting);
+ host_content_settings_map_->SetContentSetting(
+ primary_pattern, secondary_pattern, CONTENT_SETTINGS_TYPE_COOKIES, "",
+ setting);
}
void CookieSettings::ResetCookieSetting(
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern) {
- host_content_settings_map_->SetContentSetting(primary_pattern,
- secondary_pattern,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- CONTENT_SETTING_DEFAULT);
+ host_content_settings_map_->SetContentSetting(
+ primary_pattern, secondary_pattern, CONTENT_SETTINGS_TYPE_COOKIES, "",
+ CONTENT_SETTING_DEFAULT);
}
void CookieSettings::ShutdownOnUIThread() {
@@ -180,12 +176,9 @@ ContentSetting CookieSettings::GetCookieSetting(
// First get any host-specific settings.
content_settings::SettingInfo info;
- scoped_ptr<base::Value> value(host_content_settings_map_->GetWebsiteSetting(
- url,
- first_party_url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- &info));
+ scoped_ptr<base::Value> value(
+ host_content_settings_map_->GetWebsiteSetting(
+ url, first_party_url, CONTENT_SETTINGS_TYPE_COOKIES, "", &info));
if (source)
*source = info.source;
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index 777203d..8749d6f 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -133,7 +133,7 @@ void HostContentSettingsMap::RegisterExtensionService(
OnContentSettingChanged(ContentSettingsPattern(),
ContentSettingsPattern(),
CONTENT_SETTINGS_TYPE_DEFAULT,
- std::string());
+ "");
}
#endif
@@ -159,7 +159,7 @@ ContentSetting HostContentSettingsMap::GetDefaultContentSettingFromProvider(
ContentSettingsType content_type,
content_settings::ProviderInterface* provider) const {
scoped_ptr<content_settings::RuleIterator> rule_iterator(
- provider->GetRuleIterator(content_type, std::string(), false));
+ provider->GetRuleIterator(content_type, "", false));
ContentSettingsPattern wildcard = ContentSettingsPattern::Wildcard();
while (rule_iterator->HasNext()) {
@@ -460,18 +460,19 @@ void HostContentSettingsMap::MigrateObsoleteClearOnExitPref() {
AddSettingsForOneType(content_settings_providers_[PREF_PROVIDER],
PREF_PROVIDER,
CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
+ "",
&exceptions,
false);
for (ContentSettingsForOneType::iterator it = exceptions.begin();
it != exceptions.end(); ++it) {
if (it->setting != CONTENT_SETTING_ALLOW)
continue;
- SetWebsiteSetting(it->primary_pattern,
- it->secondary_pattern,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- Value::CreateIntegerValue(CONTENT_SETTING_SESSION_ONLY));
+ SetWebsiteSetting(
+ it->primary_pattern,
+ it->secondary_pattern,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ Value::CreateIntegerValue(CONTENT_SETTING_SESSION_ONLY));
}
prefs_->SetBoolean(prefs::kContentSettingsClearOnExitMigrated, true);
diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
index bba4336..57fd929 100644
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -81,16 +81,16 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
ContentSettingsPattern::FromString("[*.]example.com");
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
CONTENT_SETTING_DEFAULT);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
@@ -99,10 +99,10 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_PLUGINS, ""));
// Check returning all settings for a host.
host_content_settings_map->SetContentSetting(
@@ -113,7 +113,7 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
CONTENT_SETTING_DEFAULT);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
@@ -122,7 +122,7 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
@@ -131,23 +131,22 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
CONTENT_SETTING_ALLOW);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_PLUGINS, ""));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_POPUPS, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_POPUPS, ""));
+ EXPECT_EQ(CONTENT_SETTING_ASK,
+ host_content_settings_map->GetContentSetting(
+ host, host, CONTENT_SETTINGS_TYPE_GEOLOCATION, ""));
EXPECT_EQ(CONTENT_SETTING_ASK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
- EXPECT_EQ(
- CONTENT_SETTING_ASK,
- host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, ""));
EXPECT_EQ(CONTENT_SETTING_ASK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_FULLSCREEN, ""));
EXPECT_EQ(CONTENT_SETTING_ASK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_MOUSELOCK, ""));
// Check returning all hosts for a setting.
ContentSettingsPattern pattern2 =
@@ -165,16 +164,18 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
std::string(),
CONTENT_SETTING_BLOCK);
ContentSettingsForOneType host_settings;
- host_content_settings_map->GetSettingsForOneType(
- CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &host_settings);
+ host_content_settings_map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES,
+ "",
+ &host_settings);
// |host_settings| contains the default setting and an exception.
EXPECT_EQ(2U, host_settings.size());
host_content_settings_map->GetSettingsForOneType(
- CONTENT_SETTINGS_TYPE_PLUGINS, std::string(), &host_settings);
+ CONTENT_SETTINGS_TYPE_PLUGINS, "", &host_settings);
// |host_settings| contains the default setting and 2 exceptions.
EXPECT_EQ(3U, host_settings.size());
- host_content_settings_map->GetSettingsForOneType(
- CONTENT_SETTINGS_TYPE_POPUPS, std::string(), &host_settings);
+ host_content_settings_map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_POPUPS,
+ "",
+ &host_settings);
// |host_settings| contains only the default setting.
EXPECT_EQ(1U, host_settings.size());
}
@@ -216,12 +217,13 @@ TEST_F(HostContentSettingsMapTest, Clear) {
host_content_settings_map->ClearSettingsForOneType(
CONTENT_SETTINGS_TYPE_IMAGES);
ContentSettingsForOneType host_settings;
- host_content_settings_map->GetSettingsForOneType(
- CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &host_settings);
+ host_content_settings_map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES,
+ "",
+ &host_settings);
// |host_settings| contains only the default setting.
EXPECT_EQ(1U, host_settings.size());
host_content_settings_map->GetSettingsForOneType(
- CONTENT_SETTINGS_TYPE_PLUGINS, std::string(), &host_settings);
+ CONTENT_SETTINGS_TYPE_PLUGINS, "", &host_settings);
// |host_settings| contains the default setting and an exception.
EXPECT_EQ(2U, host_settings.size());
}
@@ -240,7 +242,7 @@ TEST_F(HostContentSettingsMapTest, Patterns) {
ContentSettingsPattern::FromString("example.org");
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, ""));
host_content_settings_map->SetContentSetting(
pattern1,
ContentSettingsPattern::Wildcard(),
@@ -249,13 +251,13 @@ TEST_F(HostContentSettingsMapTest, Patterns) {
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, ""));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host2, host2, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host2, host2, CONTENT_SETTINGS_TYPE_IMAGES, ""));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, ""));
host_content_settings_map->SetContentSetting(
pattern2,
ContentSettingsPattern::Wildcard(),
@@ -264,7 +266,7 @@ TEST_F(HostContentSettingsMapTest, Patterns) {
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, ""));
}
TEST_F(HostContentSettingsMapTest, Observer) {
@@ -325,7 +327,7 @@ TEST_F(HostContentSettingsMapTest, ObserveDefaultPref) {
CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
// Make a copy of the pref's new value so we can reset it later.
scoped_ptr<Value> new_value(prefs->FindPreference(
@@ -335,13 +337,13 @@ TEST_F(HostContentSettingsMapTest, ObserveDefaultPref) {
prefs->Set(prefs::kDefaultContentSettings, *default_value);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
// Reseting the pref to its previous value should update the cache.
prefs->Set(prefs::kDefaultContentSettings, *new_value);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
}
TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) {
@@ -361,7 +363,7 @@ TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) {
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
host_content_settings_map->SetContentSetting(
pattern,
@@ -371,7 +373,7 @@ TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) {
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
// Make a copy of the pref's new value so we can reset it later.
scoped_ptr<Value> new_value(prefs->FindPreference(
@@ -381,13 +383,13 @@ TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) {
prefs->Set(prefs::kContentSettingsPatternPairs, *default_value);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
// Reseting the pref to its previous value should update the cache.
prefs->Set(prefs::kContentSettingsPatternPairs, *new_value);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
}
TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
@@ -411,26 +413,26 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
CONTENT_SETTING_DEFAULT);
- EXPECT_EQ(
- CONTENT_SETTING_ALLOW,
- host_content_settings_map->GetContentSetting(host_ending_with_dot,
- host_ending_with_dot,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string()));
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
+ host_content_settings_map->GetContentSetting(
+ host_ending_with_dot,
+ host_ending_with_dot,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
CONTENT_SETTING_BLOCK);
- EXPECT_EQ(
- CONTENT_SETTING_BLOCK,
- host_content_settings_map->GetContentSetting(host_ending_with_dot,
- host_ending_with_dot,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string()));
+ EXPECT_EQ(CONTENT_SETTING_BLOCK,
+ host_content_settings_map->GetContentSetting(
+ host_ending_with_dot,
+ host_ending_with_dot,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ ""));
EXPECT_TRUE(cookie_settings->IsSettingCookieAllowed(
host_ending_with_dot, host_ending_with_dot));
@@ -438,7 +440,7 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
+ "",
CONTENT_SETTING_DEFAULT);
EXPECT_TRUE(cookie_settings->IsSettingCookieAllowed(
host_ending_with_dot, host_ending_with_dot));
@@ -446,7 +448,7 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
+ "",
CONTENT_SETTING_BLOCK);
EXPECT_FALSE(cookie_settings->IsSettingCookieAllowed(
host_ending_with_dot, host_ending_with_dot));
@@ -456,93 +458,93 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
host_ending_with_dot,
host_ending_with_dot,
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
- std::string()));
+ ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
- std::string(),
+ "",
CONTENT_SETTING_DEFAULT);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
host_ending_with_dot,
host_ending_with_dot,
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
- std::string()));
+ ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
- std::string(),
+ "",
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host_ending_with_dot,
host_ending_with_dot,
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
- std::string()));
+ ""));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
host_ending_with_dot,
host_ending_with_dot,
CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string()));
+ ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string(),
+ "",
CONTENT_SETTING_DEFAULT);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
host_ending_with_dot,
host_ending_with_dot,
CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string()));
+ ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string(),
+ "",
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host_ending_with_dot,
host_ending_with_dot,
CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string()));
+ ""));
- EXPECT_EQ(
- CONTENT_SETTING_BLOCK,
- host_content_settings_map->GetContentSetting(host_ending_with_dot,
- host_ending_with_dot,
- CONTENT_SETTINGS_TYPE_POPUPS,
- std::string()));
+ EXPECT_EQ(CONTENT_SETTING_BLOCK,
+ host_content_settings_map->GetContentSetting(
+ host_ending_with_dot,
+ host_ending_with_dot,
+ CONTENT_SETTINGS_TYPE_POPUPS,
+ ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_POPUPS,
- std::string(),
+ "",
CONTENT_SETTING_DEFAULT);
- EXPECT_EQ(
- CONTENT_SETTING_BLOCK,
- host_content_settings_map->GetContentSetting(host_ending_with_dot,
- host_ending_with_dot,
- CONTENT_SETTINGS_TYPE_POPUPS,
- std::string()));
+ EXPECT_EQ(CONTENT_SETTING_BLOCK,
+ host_content_settings_map->GetContentSetting(
+ host_ending_with_dot,
+ host_ending_with_dot,
+ CONTENT_SETTINGS_TYPE_POPUPS,
+ ""));
host_content_settings_map->SetContentSetting(
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_POPUPS,
- std::string(),
+ "",
CONTENT_SETTING_ALLOW);
- EXPECT_EQ(
- CONTENT_SETTING_ALLOW,
- host_content_settings_map->GetContentSetting(host_ending_with_dot,
- host_ending_with_dot,
- CONTENT_SETTINGS_TYPE_POPUPS,
- std::string()));
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
+ host_content_settings_map->GetContentSetting(
+ host_ending_with_dot,
+ host_ending_with_dot,
+ CONTENT_SETTINGS_TYPE_POPUPS,
+ ""));
}
TEST_F(HostContentSettingsMapTest, NestedSettings) {
@@ -562,53 +564,52 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
pattern1,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
CONTENT_SETTING_BLOCK);
host_content_settings_map->SetContentSetting(
pattern2,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
+ "",
CONTENT_SETTING_BLOCK);
host_content_settings_map->SetContentSetting(
pattern3,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string(),
+ "",
CONTENT_SETTING_BLOCK);
host_content_settings_map->SetDefaultContentSetting(
CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_COOKIES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_COOKIES, ""));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, ""));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_PLUGINS, ""));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_POPUPS, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_POPUPS, ""));
EXPECT_EQ(CONTENT_SETTING_ASK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
- EXPECT_EQ(
- CONTENT_SETTING_ASK,
- host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_GEOLOCATION, ""));
EXPECT_EQ(CONTENT_SETTING_ASK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, ""));
EXPECT_EQ(CONTENT_SETTING_ASK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_FULLSCREEN, ""));
+ EXPECT_EQ(CONTENT_SETTING_ASK,
+ host_content_settings_map->GetContentSetting(
+ host, host, CONTENT_SETTINGS_TYPE_MOUSELOCK, ""));
}
TEST_F(HostContentSettingsMapTest, OffTheRecord) {
@@ -625,10 +626,10 @@ TEST_F(HostContentSettingsMapTest, OffTheRecord) {
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
otr_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
// Changing content settings on the main map should also affect the
// incognito map.
@@ -636,28 +637,27 @@ TEST_F(HostContentSettingsMapTest, OffTheRecord) {
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
+ "",
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
otr_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
// Changing content settings on the incognito map should NOT affect the
// main map.
- otr_map->SetContentSetting(pattern,
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- CONTENT_SETTING_ALLOW);
+ otr_map->SetContentSetting(
+ pattern,
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_IMAGES, "", CONTENT_SETTING_ALLOW);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
otr_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
otr_map->ShutdownOnUIThread();
}
@@ -738,7 +738,7 @@ TEST_F(HostContentSettingsMapTest, ResourceIdentifier) {
CONTENT_SETTINGS_TYPE_PLUGINS, NULL);
EXPECT_EQ(default_plugin_setting,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_PLUGINS, ""));
// If no resource-specific content settings are defined, the setting should be
// DEFAULT.
@@ -865,7 +865,7 @@ TEST_F(HostContentSettingsMapTest,
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
- std::string(),
+ "",
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
@@ -875,14 +875,14 @@ TEST_F(HostContentSettingsMapTest,
GURL host("http://example.com/");
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, ""));
// Set managed-default-content-setting for content-settings-type JavaScript.
prefs->SetManagedPref(prefs::kManagedDefaultJavaScriptSetting,
Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, ""));
}
// Managed default content setting should have higher priority
@@ -906,7 +906,7 @@ TEST_F(HostContentSettingsMapTest,
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
- std::string(),
+ "",
CONTENT_SETTING_ALLOW);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
@@ -915,20 +915,20 @@ TEST_F(HostContentSettingsMapTest,
GURL host("http://example.com/");
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, ""));
// Set managed-default-content-settings-preferences.
prefs->SetManagedPref(prefs::kManagedDefaultJavaScriptSetting,
Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, ""));
// Remove managed-default-content-settings-preferences.
prefs->RemoveManagedPref(prefs::kManagedDefaultJavaScriptSetting);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, ""));
}
// If a default-content-setting is set to managed setting, the user defined
@@ -1004,10 +1004,10 @@ TEST_F(HostContentSettingsMapTest, GetContentSetting) {
CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
- host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
- embedder, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ embedder, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
}
TEST_F(HostContentSettingsMapTest, ShouldAllowAllContent) {
diff --git a/chrome/browser/content_settings/mock_settings_observer.cc b/chrome/browser/content_settings/mock_settings_observer.cc
index c8de7fa..a281a1d 100644
--- a/chrome/browser/content_settings/mock_settings_observer.cc
+++ b/chrome/browser/content_settings/mock_settings_observer.cc
@@ -35,5 +35,5 @@ void MockSettingsObserver::Observe(
// This checks that calling a Get function from an observer doesn't
// deadlock.
GURL url("http://random-hostname.com/");
- map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string());
+ map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_IMAGES, "");
}
diff --git a/chrome/browser/devtools/browser_list_tabcontents_provider.cc b/chrome/browser/devtools/browser_list_tabcontents_provider.cc
index 2edc6bf..aca4bac 100644
--- a/chrome/browser/devtools/browser_list_tabcontents_provider.cc
+++ b/chrome/browser/devtools/browser_list_tabcontents_provider.cc
@@ -116,19 +116,19 @@ std::string BrowserListTabContentsProvider::GetViewDescription(
content::WebContents* web_contents =
content::WebContents::FromRenderViewHost(rvh);
if (!web_contents)
- return std::string();
+ return "";
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
if (!profile)
- return std::string();
+ return "";
extensions::ExtensionHost* extension_host =
extensions::ExtensionSystem::Get(profile)->process_manager()->
GetBackgroundHostForExtension(web_contents->GetURL().host());
if (!extension_host || extension_host->host_contents() != web_contents)
- return std::string();
+ return "";
return extension_host->extension()->name();
}
diff --git a/chrome/browser/devtools/devtools_file_helper.cc b/chrome/browser/devtools/devtools_file_helper.cc
index d1f2888..d485a52 100644
--- a/chrome/browser/devtools/devtools_file_helper.cc
+++ b/chrome/browser/devtools/devtools_file_helper.cc
@@ -77,7 +77,7 @@ class SelectFileDialog : public ui::SelectFileDialog::Listener,
default_path,
NULL,
0,
- base::FilePath::StringType(),
+ FILE_PATH_LITERAL(""),
NULL,
NULL);
}
@@ -346,7 +346,7 @@ void DevToolsFileHelper::AddValidatedFileSystem(
file_system_id,
registered_name,
file_system_path);
- callback.Run(std::string(), filesystem);
+ callback.Run("", filesystem);
}
void DevToolsFileHelper::RequestFileSystems(
diff --git a/chrome/browser/devtools/devtools_sanity_browsertest.cc b/chrome/browser/devtools/devtools_sanity_browsertest.cc
index 4f832f7..6a8b30c 100644
--- a/chrome/browser/devtools/devtools_sanity_browsertest.cc
+++ b/chrome/browser/devtools/devtools_sanity_browsertest.cc
@@ -441,7 +441,7 @@ IN_PROC_BROWSER_TEST_F(
IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest,
TestDevToolsExtensionAPI) {
LoadExtension("devtools_extension");
- RunTest("waitForTestResultsInConsole", std::string());
+ RunTest("waitForTestResultsInConsole", "");
}
// Tests that chrome.devtools extension can communicate with background page
@@ -449,7 +449,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest,
IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest,
TestDevToolsExtensionMessaging) {
LoadExtension("devtools_messaging");
- RunTest("waitForTestResultsInConsole", std::string());
+ RunTest("waitForTestResultsInConsole", "");
}
// Tests that chrome.experimental.devtools extension is correctly exposed
@@ -457,7 +457,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest,
IN_PROC_BROWSER_TEST_F(DevToolsExperimentalExtensionTest,
TestDevToolsExperimentalExtensionAPI) {
LoadExtension("devtools_experimental");
- RunTest("waitForTestResultsInConsole", std::string());
+ RunTest("waitForTestResultsInConsole", "");
}
// Tests that a content script is in the scripts list.
@@ -478,7 +478,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest,
IN_PROC_BROWSER_TEST_F(DevToolsSanityTest,
MAYBE_TestRendererProcessNativeMemorySize) {
- RunTest("testRendererProcessNativeMemorySize", std::string());
+ RunTest("testRendererProcessNativeMemorySize", "");
}
// Tests that scripts are not duplicated after Scripts Panel switch.
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index 5ec91a2..7c63cb7 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -1655,12 +1655,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, NewWindow) {
IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) {
GURL download_url(URLRequestSlowDownloadJob::kKnownSizeUrl);
- base::FilePath file(net::GenerateFileName(download_url,
- std::string(),
- std::string(),
- std::string(),
- std::string(),
- std::string()));
+ base::FilePath file(net::GenerateFileName(download_url, "", "", "", "", ""));
// We use the server so that we can get a redirect and test url_chain
// persistence.
@@ -2632,7 +2627,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, LoadURLExternallyReferrerPolicy) {
// Check that the file contains the expected referrer.
base::FilePath file(download_items[0]->GetFullPath());
- std::string expected_contents = test_server()->GetURL(std::string()).spec();
+ std::string expected_contents = test_server()->GetURL("").spec();
ASSERT_TRUE(VerifyFile(file, expected_contents, expected_contents.length()));
}
diff --git a/chrome/browser/download/download_file_picker.cc b/chrome/browser/download/download_file_picker.cc
index a968b06..29a1573 100644
--- a/chrome/browser/download/download_file_picker.cc
+++ b/chrome/browser/download/download_file_picker.cc
@@ -86,14 +86,15 @@ void DownloadFilePicker::Init(
platform_util::GetTopLevel(web_contents->GetView()->GetNativeView()) :
NULL;
- select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_SAVEAS_FILE,
- string16(),
- suggested_path_,
- &file_type_info,
- 0,
- base::FilePath::StringType(),
- owning_window,
- NULL);
+ select_file_dialog_->SelectFile(
+ ui::SelectFileDialog::SELECT_SAVEAS_FILE,
+ string16(),
+ suggested_path_,
+ &file_type_info,
+ 0,
+ FILE_PATH_LITERAL(""),
+ owning_window,
+ NULL);
}
DownloadFilePicker::~DownloadFilePicker() {
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
index 4aba528..2bfb792 100644
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -86,7 +86,7 @@ void DownloadPrefs::RegisterUserPrefs(PrefRegistrySyncable* registry) {
false,
PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterStringPref(prefs::kDownloadExtensionsToOpen,
- std::string(),
+ "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kDownloadDirUpgraded,
false,
diff --git a/chrome/browser/extensions/activity_log.cc b/chrome/browser/extensions/activity_log.cc
index dcf8e8f..34f820b 100644
--- a/chrome/browser/extensions/activity_log.cc
+++ b/chrome/browser/extensions/activity_log.cc
@@ -27,7 +27,7 @@ namespace {
// Concatenate arguments.
std::string MakeArgList(const ListValue* args) {
- std::string call_signature;
+ std::string call_signature = "";
ListValue::const_iterator it = args->begin();
for (; it != args->end(); ++it) {
std::string arg;
@@ -395,10 +395,9 @@ void ActivityLog::OnScriptsExecuted(
// of content scripts will be empty. We don't want to log it because
// the call to tabs.executeScript will have already been logged anyway.
if (!it->second.empty()) {
- std::string ext_scripts_str;
+ std::string ext_scripts_str = "";
for (std::set<std::string>::const_iterator it2 = it->second.begin();
- it2 != it->second.end();
- ++it2) {
+ it2 != it->second.end(); ++it2) {
ext_scripts_str += *it2;
ext_scripts_str += " ";
}
@@ -407,9 +406,9 @@ void ActivityLog::OnScriptsExecuted(
LogDOMActionInternal(extension,
on_url,
web_contents->GetTitle(),
- std::string(), // no api call here
+ "", // no api call here
script_names.get(),
- std::string(), // no extras either
+ "", // no extras either
DOMAction::INSERTED);
}
}
diff --git a/chrome/browser/extensions/activity_log_unittest.cc b/chrome/browser/extensions/activity_log_unittest.cc
index a5ecc95..f678d7b 100644
--- a/chrome/browser/extensions/activity_log_unittest.cc
+++ b/chrome/browser/extensions/activity_log_unittest.cc
@@ -93,8 +93,10 @@ TEST_F(ActivityLogTest, Construct) {
extension_service_->AddExtension(extension);
scoped_ptr<ListValue> args(new ListValue());
ASSERT_TRUE(ActivityLog::IsLogEnabled());
- activity_log->LogAPIAction(
- extension, std::string("tabs.testMethod"), args.get(), std::string());
+ activity_log->LogAPIAction(extension,
+ std::string("tabs.testMethod"),
+ args.get(),
+ "");
}
TEST_F(ActivityLogTest, LogAndFetchActions) {
@@ -111,8 +113,10 @@ TEST_F(ActivityLogTest, LogAndFetchActions) {
ASSERT_TRUE(ActivityLog::IsLogEnabled());
// Write some API calls
- activity_log->LogAPIAction(
- extension, std::string("tabs.testMethod"), args.get(), std::string());
+ activity_log->LogAPIAction(extension,
+ std::string("tabs.testMethod"),
+ args.get(),
+ "");
activity_log->LogDOMAction(extension,
GURL("http://www.google.com"),
string16(),
@@ -140,10 +144,14 @@ TEST_F(ActivityLogTest, LogWithoutArguments) {
scoped_ptr<ListValue> args(new ListValue());
args->Set(0, new base::StringValue("hello"));
args->Set(1, new base::StringValue("world"));
- activity_log->LogAPIAction(
- extension, std::string("tabs.testMethod"), args.get(), std::string());
+ activity_log->LogAPIAction(extension,
+ std::string("tabs.testMethod"),
+ args.get(),
+ "");
activity_log->GetActions(
- extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Missing));
+ extension->id(),
+ 0,
+ base::Bind(ActivityLogTest::Arguments_Missing));
}
TEST_F(ActivityLogTest, LogWithArguments) {
@@ -161,10 +169,14 @@ TEST_F(ActivityLogTest, LogWithArguments) {
scoped_ptr<ListValue> args(new ListValue());
args->Set(0, new base::StringValue("hello"));
args->Set(1, new base::StringValue("world"));
- activity_log->LogAPIAction(
- extension, std::string("extension.connect"), args.get(), std::string());
+ activity_log->LogAPIAction(extension,
+ std::string("extension.connect"),
+ args.get(),
+ "");
activity_log->GetActions(
- extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Present));
+ extension->id(),
+ 0,
+ base::Bind(ActivityLogTest::Arguments_Present));
}
} // namespace extensions
diff --git a/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc b/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc
index 34b4187..60c367a 100644
--- a/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc
+++ b/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc
@@ -151,7 +151,7 @@ TEST_F(ExtensionAlarmsTest, Create) {
CreateAlarm("[null, {\"delayInMinutes\": 0}]");
const Alarm* alarm =
- alarm_manager_->GetAlarm(extension_->id(), std::string());
+ alarm_manager_->GetAlarm(extension_->id(), "");
ASSERT_TRUE(alarm);
EXPECT_EQ("", alarm->js_alarm->name);
EXPECT_DOUBLE_EQ(10000, alarm->js_alarm->scheduled_time);
@@ -179,7 +179,7 @@ TEST_F(ExtensionAlarmsTest, CreateRepeating) {
CreateAlarm("[null, {\"periodInMinutes\": 0.001}]");
const Alarm* alarm =
- alarm_manager_->GetAlarm(extension_->id(), std::string());
+ alarm_manager_->GetAlarm(extension_->id(), "");
ASSERT_TRUE(alarm);
EXPECT_EQ("", alarm->js_alarm->name);
EXPECT_DOUBLE_EQ(10060, alarm->js_alarm->scheduled_time);
@@ -205,7 +205,7 @@ TEST_F(ExtensionAlarmsTest, CreateAbsolute) {
CreateAlarm("[null, {\"when\": 10001}]");
const Alarm* alarm =
- alarm_manager_->GetAlarm(extension_->id(), std::string());
+ alarm_manager_->GetAlarm(extension_->id(), "");
ASSERT_TRUE(alarm);
EXPECT_EQ("", alarm->js_alarm->name);
EXPECT_DOUBLE_EQ(10001, alarm->js_alarm->scheduled_time);
@@ -217,7 +217,7 @@ TEST_F(ExtensionAlarmsTest, CreateAbsolute) {
// MessageLoop when that happens.
MessageLoop::current()->Run();
- ASSERT_FALSE(alarm_manager_->GetAlarm(extension_->id(), std::string()));
+ ASSERT_FALSE(alarm_manager_->GetAlarm(extension_->id(), ""));
ASSERT_EQ(1u, alarm_delegate_->alarms_seen.size());
EXPECT_EQ("", alarm_delegate_->alarms_seen[0]);
@@ -228,7 +228,7 @@ TEST_F(ExtensionAlarmsTest, CreateRepeatingWithQuickFirstCall) {
CreateAlarm("[null, {\"when\": 10001, \"periodInMinutes\": 0.001}]");
const Alarm* alarm =
- alarm_manager_->GetAlarm(extension_->id(), std::string());
+ alarm_manager_->GetAlarm(extension_->id(), "");
ASSERT_TRUE(alarm);
EXPECT_EQ("", alarm->js_alarm->name);
EXPECT_DOUBLE_EQ(10001, alarm->js_alarm->scheduled_time);
@@ -240,13 +240,13 @@ TEST_F(ExtensionAlarmsTest, CreateRepeatingWithQuickFirstCall) {
// MessageLoop when that happens.
MessageLoop::current()->Run();
- ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), std::string()));
+ ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), ""));
EXPECT_THAT(alarm_delegate_->alarms_seen, testing::ElementsAre(""));
test_clock_.SetNow(base::Time::FromDoubleT(10.7));
MessageLoop::current()->Run();
- ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), std::string()));
+ ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), ""));
EXPECT_THAT(alarm_delegate_->alarms_seen, testing::ElementsAre("", ""));
}
diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
index 754eeee..0470b78 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
+++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
@@ -946,7 +946,7 @@ void BookmarksIOFunction::ShowSelectFileDialog(
default_path,
&file_type_info,
0,
- base::FilePath::StringType(),
+ FILE_PATH_LITERAL(""),
NULL,
NULL);
}
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc b/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc
index dd20fba1..a424f83 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc
+++ b/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc
@@ -74,16 +74,16 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettings) {
EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
map->GetContentSetting(
- url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ url, url, CONTENT_SETTINGS_TYPE_IMAGES, ""));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
map->GetContentSetting(
- url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
+ url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, ""));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
map->GetContentSetting(
- url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
+ url, url, CONTENT_SETTINGS_TYPE_PLUGINS, ""));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
map->GetContentSetting(
- url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string()));
+ url, url, CONTENT_SETTINGS_TYPE_POPUPS, ""));
#if 0
EXPECT_EQ(CONTENT_SETTING_BLOCK,
map->GetContentSetting(
@@ -91,7 +91,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettings) {
#endif
EXPECT_EQ(CONTENT_SETTING_BLOCK,
map->GetContentSetting(
- url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string()));
+ url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, ""));
}
// Flaky on the trybots. See http://crbug.com/96725.
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc b/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc
index 537d08f..8ee0fbf 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc
+++ b/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc
@@ -48,7 +48,7 @@ std::string GetDefaultPort(const std::string& scheme) {
if (scheme == chrome::kHttpsScheme)
return "443";
NOTREACHED();
- return std::string();
+ return "";
}
} // namespace
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc b/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc
index bedd2ea..5e13633 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc
+++ b/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc
@@ -101,76 +101,73 @@ TEST_F(ContentSettingsStoreTest, RegisterUnregister) {
GURL url("http://www.youtube.com");
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSettingFromStore(store(),
- url,
- url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- false));
+ GetContentSettingFromStore(
+ store(), url, url, CONTENT_SETTINGS_TYPE_COOKIES, "", false));
// Register first extension
std::string ext_id("my_extension");
RegisterExtension(ext_id);
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSettingFromStore(store(),
- url,
- url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- false));
+ GetContentSettingFromStore(
+ store(), url, url, CONTENT_SETTINGS_TYPE_COOKIES, "", false));
// Set setting
ContentSettingsPattern pattern =
ContentSettingsPattern::FromURL(GURL("http://www.youtube.com"));
EXPECT_CALL(observer, OnContentSettingChanged(ext_id, false));
- store()->SetExtensionContentSetting(ext_id,
- pattern,
- pattern,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- CONTENT_SETTING_ALLOW,
- kExtensionPrefsScopeRegular);
+ store()->SetExtensionContentSetting(
+ ext_id,
+ pattern,
+ pattern,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ CONTENT_SETTING_ALLOW,
+ kExtensionPrefsScopeRegular);
Mock::VerifyAndClear(&observer);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
- GetContentSettingFromStore(store(),
- url,
- url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- false));
+ GetContentSettingFromStore(
+ store(),
+ url,
+ url,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ false));
// Register second extension.
std::string ext_id_2("my_second_extension");
RegisterExtension(ext_id_2);
EXPECT_CALL(observer, OnContentSettingChanged(ext_id_2, false));
- store()->SetExtensionContentSetting(ext_id_2,
- pattern,
- pattern,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- CONTENT_SETTING_BLOCK,
- kExtensionPrefsScopeRegular);
+ store()->SetExtensionContentSetting(
+ ext_id_2,
+ pattern,
+ pattern,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ CONTENT_SETTING_BLOCK,
+ kExtensionPrefsScopeRegular);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSettingFromStore(store(),
- url,
- url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- false));
+ GetContentSettingFromStore(
+ store(),
+ url,
+ url,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ false));
// Unregister first extension. This shouldn't change the setting.
EXPECT_CALL(observer, OnContentSettingChanged(ext_id, false));
store()->UnregisterExtension(ext_id);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSettingFromStore(store(),
- url,
- url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- false));
+ GetContentSettingFromStore(
+ store(),
+ url,
+ url,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ false));
Mock::VerifyAndClear(&observer);
// Unregister second extension. This should reset the setting to its default
@@ -178,12 +175,13 @@ TEST_F(ContentSettingsStoreTest, RegisterUnregister) {
EXPECT_CALL(observer, OnContentSettingChanged(ext_id_2, false));
store()->UnregisterExtension(ext_id_2);
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSettingFromStore(store(),
- url,
- url,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- false));
+ GetContentSettingFromStore(
+ store(),
+ url,
+ url,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ false));
store()->RemoveObserver(&observer);
}
@@ -192,7 +190,7 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) {
bool incognito = false;
std::vector<content_settings::Rule> rules;
GetSettingsForOneTypeFromStore(
- store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules);
+ store(), CONTENT_SETTINGS_TYPE_COOKIES, "", incognito, &rules);
ASSERT_EQ(0u, rules.size());
// Register first extension.
@@ -200,16 +198,17 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) {
RegisterExtension(ext_id);
ContentSettingsPattern pattern =
ContentSettingsPattern::FromURL(GURL("http://www.youtube.com"));
- store()->SetExtensionContentSetting(ext_id,
- pattern,
- pattern,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- CONTENT_SETTING_ALLOW,
- kExtensionPrefsScopeRegular);
+ store()->SetExtensionContentSetting(
+ ext_id,
+ pattern,
+ pattern,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ CONTENT_SETTING_ALLOW,
+ kExtensionPrefsScopeRegular);
GetSettingsForOneTypeFromStore(
- store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules);
+ store(), CONTENT_SETTINGS_TYPE_COOKIES, "", incognito, &rules);
ASSERT_EQ(1u, rules.size());
CheckRule(rules[0], pattern, pattern, CONTENT_SETTING_ALLOW);
@@ -218,16 +217,20 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) {
RegisterExtension(ext_id_2);
ContentSettingsPattern pattern_2 =
ContentSettingsPattern::FromURL(GURL("http://www.example.com"));
- store()->SetExtensionContentSetting(ext_id_2,
- pattern_2,
- pattern_2,
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- CONTENT_SETTING_BLOCK,
- kExtensionPrefsScopeRegular);
-
- GetSettingsForOneTypeFromStore(
- store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules);
+ store()->SetExtensionContentSetting(
+ ext_id_2,
+ pattern_2,
+ pattern_2,
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ CONTENT_SETTING_BLOCK,
+ kExtensionPrefsScopeRegular);
+
+ GetSettingsForOneTypeFromStore(store(),
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ "",
+ incognito,
+ &rules);
ASSERT_EQ(2u, rules.size());
// Rules appear in the reverse installation order of the extensions.
CheckRule(rules[0], pattern_2, pattern_2, CONTENT_SETTING_BLOCK);
@@ -237,7 +240,7 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) {
store()->SetExtensionState(ext_id, false);
GetSettingsForOneTypeFromStore(
- store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules);
+ store(), CONTENT_SETTINGS_TYPE_COOKIES, "", incognito, &rules);
ASSERT_EQ(1u, rules.size());
CheckRule(rules[0], pattern_2, pattern_2, CONTENT_SETTING_BLOCK);
@@ -245,7 +248,7 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) {
store()->UnregisterExtension(ext_id_2);
GetSettingsForOneTypeFromStore(
- store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules);
+ store(), CONTENT_SETTINGS_TYPE_COOKIES, "", incognito, &rules);
ASSERT_EQ(0u, rules.size());
}
diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc
index c35b830..f3a4a35 100644
--- a/chrome/browser/extensions/api/cookies/cookies_api.cc
+++ b/chrome/browser/extensions/api/cookies/cookies_api.cc
@@ -203,9 +203,8 @@ bool CookiesGetFunction::RunImpl() {
if (!ParseUrl(parsed_args_->details.url, &url_, true))
return false;
- std::string store_id =
- parsed_args_->details.store_id.get() ? *parsed_args_->details.store_id
- : std::string();
+ std::string store_id = parsed_args_->details.store_id.get() ?
+ *parsed_args_->details.store_id : "";
net::URLRequestContextGetter* store_context = NULL;
if (!ParseStoreContext(&store_id, &store_context))
return false;
@@ -277,9 +276,8 @@ bool CookiesGetAllFunction::RunImpl() {
return false;
}
- std::string store_id =
- parsed_args_->details.store_id.get() ? *parsed_args_->details.store_id
- : std::string();
+ std::string store_id = parsed_args_->details.store_id.get() ?
+ *parsed_args_->details.store_id : "";
net::URLRequestContextGetter* store_context = NULL;
if (!ParseStoreContext(&store_id, &store_context))
return false;
@@ -341,9 +339,8 @@ bool CookiesSetFunction::RunImpl() {
if (!ParseUrl(parsed_args_->details.url, &url_, true))
return false;
- std::string store_id =
- parsed_args_->details.store_id.get() ? *parsed_args_->details.store_id
- : std::string();
+ std::string store_id = parsed_args_->details.store_id.get() ?
+ *parsed_args_->details.store_id : "";
net::URLRequestContextGetter* store_context = NULL;
if (!ParseStoreContext(&store_id, &store_context))
return false;
@@ -377,19 +374,17 @@ void CookiesSetFunction::SetCookieOnIOThread() {
cookie_monster->SetCookieWithDetailsAsync(
url_,
- parsed_args_->details.name.get() ? *parsed_args_->details.name
- : std::string(),
- parsed_args_->details.value.get() ? *parsed_args_->details.value
- : std::string(),
- parsed_args_->details.domain.get() ? *parsed_args_->details.domain
- : std::string(),
- parsed_args_->details.path.get() ? *parsed_args_->details.path
- : std::string(),
+ parsed_args_->details.name.get() ? *parsed_args_->details.name : "",
+ parsed_args_->details.value.get() ? *parsed_args_->details.value : "",
+ parsed_args_->details.domain.get() ? *parsed_args_->details.domain : "",
+ parsed_args_->details.path.get() ? *parsed_args_->details.path : "",
expiration_time,
- parsed_args_->details.secure.get() ? *parsed_args_->details.secure.get()
- : false,
- parsed_args_->details.http_only.get() ? *parsed_args_->details.http_only
- : false,
+ parsed_args_->details.secure.get() ?
+ *parsed_args_->details.secure.get() :
+ false,
+ parsed_args_->details.http_only.get() ?
+ *parsed_args_->details.http_only :
+ false,
base::Bind(&CookiesSetFunction::PullCookie, this));
}
@@ -411,9 +406,8 @@ void CookiesSetFunction::PullCookieCallback(
// Return the first matching cookie. Relies on the fact that the
// CookieMonster returns them in canonical order (longest path, then
// earliest creation time).
- std::string name =
- parsed_args_->details.name.get() ? *parsed_args_->details.name
- : std::string();
+ std::string name = parsed_args_->details.name.get() ?
+ *parsed_args_->details.name : "";
if (it->Name() == name) {
scoped_ptr<Cookie> cookie(
cookies_helpers::CreateCookie(*it, *parsed_args_->details.store_id));
@@ -431,10 +425,10 @@ void CookiesSetFunction::PullCookieCallback(
void CookiesSetFunction::RespondOnUIThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!success_) {
- std::string name =
- parsed_args_->details.name.get() ? *parsed_args_->details.name
- : std::string();
- error_ = ErrorUtils::FormatErrorMessage(keys::kCookieSetFailedError, name);
+ std::string name = parsed_args_->details.name.get() ?
+ *parsed_args_->details.name : "";
+ error_ = ErrorUtils::FormatErrorMessage(
+ keys::kCookieSetFailedError, name);
}
SendResponse(success_);
}
@@ -453,9 +447,8 @@ bool CookiesRemoveFunction::RunImpl() {
if (!ParseUrl(parsed_args_->details.url, &url_, true))
return false;
- std::string store_id =
- parsed_args_->details.store_id.get() ? *parsed_args_->details.store_id
- : std::string();
+ std::string store_id = parsed_args_->details.store_id.get() ?
+ *parsed_args_->details.store_id : "";
net::URLRequestContextGetter* store_context = NULL;
if (!ParseStoreContext(&store_id, &store_context))
return false;
diff --git a/chrome/browser/extensions/api/cookies/cookies_helpers.cc b/chrome/browser/extensions/api/cookies/cookies_helpers.cc
index c61e729..d9866f2 100644
--- a/chrome/browser/extensions/api/cookies/cookies_helpers.cc
+++ b/chrome/browser/extensions/api/cookies/cookies_helpers.cc
@@ -74,8 +74,8 @@ scoped_ptr<Cookie> CreateCookie(
cookie->host_only = net::cookie_util::DomainIsHostOnly(
canonical_cookie.Domain());
// A non-UTF8 path is invalid, so we just replace it with an empty string.
- cookie->path = IsStringUTF8(canonical_cookie.Path()) ? canonical_cookie.Path()
- : std::string();
+ cookie->path = IsStringUTF8(canonical_cookie.Path()) ?
+ canonical_cookie.Path() : "";
cookie->secure = canonical_cookie.IsSecure();
cookie->http_only = canonical_cookie.IsHttpOnly();
cookie->session = !canonical_cookie.IsPersistent();
diff --git a/chrome/browser/extensions/api/cookies/cookies_unittest.cc b/chrome/browser/extensions/api/cookies/cookies_unittest.cc
index 0844b83..f1bd93d 100644
--- a/chrome/browser/extensions/api/cookies/cookies_unittest.cc
+++ b/chrome/browser/extensions/api/cookies/cookies_unittest.cc
@@ -195,36 +195,22 @@ TEST_F(ExtensionCookiesTest, DomainMatching) {
scoped_ptr<GetAll::Params> params(GetAll::Params::Create(args));
cookies_helpers::MatchFilter filter(&params->details);
- net::CanonicalCookie cookie(GURL(),
- std::string(),
- std::string(),
- tests[i].domain,
- std::string(),
- base::Time(),
- base::Time(),
- base::Time(),
- false,
- false);
+ net::CanonicalCookie cookie(GURL(), "", "", tests[i].domain,"",
+ base::Time(), base::Time(), base::Time(),
+ false, false);
EXPECT_EQ(tests[i].matches, filter.MatchesCookie(cookie));
}
}
TEST_F(ExtensionCookiesTest, DecodeUTF8WithErrorHandling) {
- net::CanonicalCookie canonical_cookie(GURL(),
- std::string(),
- "011Q255bNX_1!yd\203e+",
- "test.com",
- "/path\203",
- base::Time(),
- base::Time(),
- base::Time(),
- false,
- false);
+ net::CanonicalCookie canonical_cookie(
+ GURL(), "", "011Q255bNX_1!yd\203e+", "test.com", "/path\203",
+ base::Time(), base::Time(), base::Time(), false, false);
scoped_ptr<Cookie> cookie(
cookies_helpers::CreateCookie(
canonical_cookie, "some cookie store"));
EXPECT_EQ(std::string("011Q255bNX_1!yd\xEF\xBF\xBD" "e+"), cookie->value);
- EXPECT_EQ(std::string(), cookie->path);
+ EXPECT_EQ(std::string(""), cookie->path);
}
} // namespace extensions
diff --git a/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc b/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc
index d209bed..0074233 100644
--- a/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc
+++ b/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc
@@ -39,7 +39,7 @@ std::string InitializingRulesRegistry::RemoveRules(
if (!error.empty())
return error;
RemoveUsedRuleIdentifiers(extension_id, rule_identifiers);
- return std::string();
+ return "";
}
std::string InitializingRulesRegistry::RemoveAllRules(
@@ -48,7 +48,7 @@ std::string InitializingRulesRegistry::RemoveAllRules(
if (!error.empty())
return error;
RemoveAllUsedRuleIdentifiers(extension_id);
- return std::string();
+ return "";
}
std::string InitializingRulesRegistry::GetRules(
@@ -122,7 +122,7 @@ std::string InitializingRulesRegistry::CheckAndFillInOptionalRules(
used_rule_identifiers_[extension_id].insert(*(rule->id));
}
}
- return std::string();
+ return "";
}
void InitializingRulesRegistry::FillInOptionalPriorities(
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc b/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc
index 1be1983..4f49f36 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc
@@ -69,7 +69,7 @@ TEST_F(RulesRegistryWithCacheTest, AddRules) {
registry_->SetResult("Error");
EXPECT_EQ("Error", AddRule(extension_id, rule_id));
EXPECT_EQ(0, GetNumberOfRules(extension_id));
- registry_->SetResult(std::string());
+ registry_->SetResult("");
// Check that rules can be inserted.
EXPECT_EQ("", AddRule(extension_id, rule_id));
@@ -97,7 +97,7 @@ TEST_F(RulesRegistryWithCacheTest, RemoveRules) {
registry_->SetResult("Error");
EXPECT_EQ("Error", RemoveRule(extension_id, rule_id));
EXPECT_EQ(1, GetNumberOfRules(extension_id));
- registry_->SetResult(std::string());
+ registry_->SetResult("");
// Check that nothing happens if a rule does not exist.
EXPECT_EQ("", RemoveRule(extension_id, "unknown_rule"));
@@ -122,7 +122,7 @@ TEST_F(RulesRegistryWithCacheTest, RemoveAllRules) {
registry_->SetResult("Error");
EXPECT_EQ("Error", registry_->RemoveAllRules(extension_id));
EXPECT_EQ(2, GetNumberOfRules(extension_id));
- registry_->SetResult(std::string());
+ registry_->SetResult("");
// Check that rules may be removed and only for the correct extension.
EXPECT_EQ("", registry_->RemoveAllRules(extension_id));
diff --git a/chrome/browser/extensions/api/declarative_content/content_condition.cc b/chrome/browser/extensions/api/declarative_content/content_condition.cc
index 6c00b80..4a88e17 100644
--- a/chrome/browser/extensions/api/declarative_content/content_condition.cc
+++ b/chrome/browser/extensions/api/declarative_content/content_condition.cc
@@ -129,8 +129,7 @@ scoped_ptr<ContentCondition> ContentCondition::Create(
if (!url_matcher_condition_set) {
URLMatcherConditionSet::Conditions url_matcher_conditions;
url_matcher_conditions.insert(
- url_matcher_condition_factory->CreateHostPrefixCondition(
- std::string()));
+ url_matcher_condition_factory->CreateHostPrefixCondition(""));
url_matcher_condition_set =
new URLMatcherConditionSet(++g_next_id, url_matcher_conditions);
}
diff --git a/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc b/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc
index eb95b47..c9ed31e 100644
--- a/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc
+++ b/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc
@@ -176,7 +176,7 @@ std::string ContentRulesRegistry::AddRulesImpl(
UpdateConditionCache();
- return std::string();
+ return "";
}
std::string ContentRulesRegistry::RemoveRulesImpl(
@@ -221,7 +221,7 @@ std::string ContentRulesRegistry::RemoveRulesImpl(
UpdateConditionCache();
- return std::string();
+ return "";
}
std::string ContentRulesRegistry::RemoveAllRulesImpl(
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
index dc3bead..813b6b9 100644
--- a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
+++ b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
@@ -56,7 +56,7 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest, Overview) {
tab, "document.body.innerHTML = '<input type=\"password\">';"));
// Give the mutation observer a chance to run and send back the
// matching-selector update.
- ASSERT_TRUE(content::ExecuteScript(tab, std::string()));
+ ASSERT_TRUE(content::ExecuteScript(tab, ""));
EXPECT_TRUE(page_action->GetIsVisible(tab_id));
// Remove it again to make sure that reverts the action.
@@ -64,7 +64,7 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest, Overview) {
tab, "document.body.innerHTML = 'Hello world';"));
// Give the mutation observer a chance to run and send back the
// matching-selector update.
- ASSERT_TRUE(content::ExecuteScript(tab, std::string()));
+ ASSERT_TRUE(content::ExecuteScript(tab, ""));
EXPECT_FALSE(page_action->GetIsVisible(tab_id));
}
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc
index 695edac..c8cae51 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc
@@ -184,7 +184,7 @@ std::string WebRequestRulesRegistry::AddRulesImpl(
ClearCacheOnNavigation();
- return std::string();
+ return "";
}
std::string WebRequestRulesRegistry::RemoveRulesImpl(
@@ -223,7 +223,7 @@ std::string WebRequestRulesRegistry::RemoveRulesImpl(
ClearCacheOnNavigation();
- return std::string();
+ return "";
}
std::string WebRequestRulesRegistry::RemoveAllRulesImpl(
diff --git a/chrome/browser/extensions/api/developer_private/entry_picker.cc b/chrome/browser/extensions/api/developer_private/entry_picker.cc
index 12a2994..c2b3d78 100644
--- a/chrome/browser/extensions/api/developer_private/entry_picker.cc
+++ b/chrome/browser/extensions/api/developer_private/entry_picker.cc
@@ -64,9 +64,8 @@ EntryPicker::EntryPicker(EntryPickerClient* client,
last_directory,
&info,
file_type_index,
- base::FilePath::StringType(),
- owning_window,
- NULL);
+ FILE_PATH_LITERAL(""),
+ owning_window, NULL);
}
EntryPicker::~EntryPicker() {}
diff --git a/chrome/browser/extensions/api/dial/dial_device_data_unittest.cc b/chrome/browser/extensions/api/dial/dial_device_data_unittest.cc
index 4ccc470..447efca 100644
--- a/chrome/browser/extensions/api/dial/dial_device_data_unittest.cc
+++ b/chrome/browser/extensions/api/dial/dial_device_data_unittest.cc
@@ -96,9 +96,9 @@ TEST(DialDeviceDataTest, TestIsDeviceDescriptionUrl) {
GURL("https://192.168.1.1:1234/dd.xml")));
EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL()));
- EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL(std::string())));
- EXPECT_FALSE(
- DialDeviceData::IsDeviceDescriptionUrl(GURL("file://path/to/file")));
+ EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL("")));
+ EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(
+ GURL("file://path/to/file")));
}
} // namespace extensions
diff --git a/chrome/browser/extensions/api/dial/dial_service_unittest.cc b/chrome/browser/extensions/api/dial/dial_service_unittest.cc
index b378589..da1cc7b 100644
--- a/chrome/browser/extensions/api/dial/dial_service_unittest.cc
+++ b/chrome/browser/extensions/api/dial/dial_service_unittest.cc
@@ -116,7 +116,9 @@ TEST_F(DialServiceTest, TestResponseParsing) {
DialDeviceData not_parsed;
// Empty, garbage
- EXPECT_FALSE(DialServiceImpl::ParseResponse(std::string(), now, &not_parsed));
+ EXPECT_FALSE(DialServiceImpl::ParseResponse(
+ "",
+ now, &not_parsed));
EXPECT_FALSE(DialServiceImpl::ParseResponse(
"\r\n\r\n",
now, &not_parsed));
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc
index 6a126aa..44e7f29 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -218,9 +218,9 @@ scoped_ptr<base::DictionaryValue> DownloadItemToJSON(
json->SetBoolean(kExistsKey, !download_item->GetFileExternallyRemoved());
json->SetInteger(kIdKey, download_item->GetId());
const GURL& url = download_item->GetOriginalUrl();
- json->SetString(kUrlKey, (url.is_valid() ? url.spec() : std::string()));
- json->SetString(kFilenameKey,
- download_item->GetFullPath().LossyDisplayName());
+ json->SetString(kUrlKey, (url.is_valid() ? url.spec() : ""));
+ json->SetString(
+ kFilenameKey, download_item->GetFullPath().LossyDisplayName());
json->SetString(kDangerKey, DangerString(download_item->GetDangerType()));
if (download_item->GetDangerType() !=
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
index e403cd5..23a1131 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
@@ -737,8 +737,7 @@ class HTML5FileWriter {
~HTML5FileWriter() {
CHECK(BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(
&HTML5FileWriter::TearDownURLRequestContext, base::Unretained(this))));
- events_listener_->WaitFor(
- profile_, kURLRequestContextToreDown, std::string());
+ events_listener_->WaitFor(profile_, kURLRequestContextToreDown, "");
}
bool WriteFile() {
@@ -1072,10 +1071,8 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
// Simulate an error during icon load by invoking the mock with an empty
// result string.
- std::string error = RunFunctionAndReturnError(
- MockedGetFileIconFunction(download_item->GetTargetFilePath(),
- IconLoader::NORMAL,
- std::string()),
+ std::string error = RunFunctionAndReturnError(MockedGetFileIconFunction(
+ download_item->GetTargetFilePath(), IconLoader::NORMAL, ""),
args32);
EXPECT_STREQ(download_extension_errors::kIconNotFoundError, error.c_str());
diff --git a/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc b/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc
index 07845e4..0a5497f 100644
--- a/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc
+++ b/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc
@@ -692,9 +692,11 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, TestTriggerBrowserAction) {
"window.domAutomationController.send(document.body.style."
"backgroundColor);";
std::string result;
- const std::string frame_xpath;
- EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString(
- tab, frame_xpath, script, &result));
+ const std::string frame_xpath = "";
+ EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString(tab,
+ frame_xpath,
+ script,
+ &result));
EXPECT_EQ(result, "red");
}
diff --git a/chrome/browser/extensions/api/extension_action/page_action_apitest.cc b/chrome/browser/extensions/api/extension_action/page_action_apitest.cc
index cad5250..232280a 100644
--- a/chrome/browser/extensions/api/extension_action/page_action_apitest.cc
+++ b/chrome/browser/extensions/api/extension_action/page_action_apitest.cc
@@ -63,7 +63,7 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, Basic) {
ExtensionService* service = extensions::ExtensionSystem::Get(
browser()->profile())->extension_service();
service->browser_event_router()->PageActionExecuted(
- browser()->profile(), *action, tab_id, std::string(), 0);
+ browser()->profile(), *action, tab_id, "", 0);
EXPECT_TRUE(catcher.GetNextResult());
}
@@ -108,7 +108,7 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, AddPopup) {
ExtensionService* service = extensions::ExtensionSystem::Get(
browser()->profile())->extension_service();
service->browser_event_router()->PageActionExecuted(
- browser()->profile(), *page_action, tab_id, std::string(), 1);
+ browser()->profile(), *page_action, tab_id, "", 1);
ASSERT_TRUE(catcher.GetNextResult());
}
@@ -188,7 +188,7 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, OldPageActions) {
browser()->profile())->extension_service();
ExtensionAction* page_action = GetPageAction(*extension);
service->browser_event_router()->PageActionExecuted(
- browser()->profile(), *page_action, tab_id, std::string(), 1);
+ browser()->profile(), *page_action, tab_id, "", 1);
EXPECT_TRUE(catcher.GetNextResult());
}
}
@@ -260,7 +260,7 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, TestTriggerPageAction) {
ExtensionService* service = extensions::ExtensionSystem::Get(
browser()->profile())->extension_service();
service->browser_event_router()->PageActionExecuted(
- browser()->profile(), *page_action, tab_id, std::string(), 0);
+ browser()->profile(), *page_action, tab_id, "", 0);
EXPECT_TRUE(catcher.GetNextResult());
}
@@ -273,9 +273,11 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, TestTriggerPageAction) {
"window.domAutomationController.send(document.body.style."
"backgroundColor);";
std::string result;
- const std::string frame_xpath;
- EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString(
- tab, frame_xpath, script, &result));
+ const std::string frame_xpath = "";
+ EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString(tab,
+ frame_xpath,
+ script,
+ &result));
EXPECT_EQ(result, "red");
}
diff --git a/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc b/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc
index ff7fae7..fd32e96 100644
--- a/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc
+++ b/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc
@@ -88,8 +88,7 @@ IN_PROC_BROWSER_TEST_F(ScriptBadgeApiTest, Basics) {
ResultCatcher catcher;
// Visit a non-extension page so the extension can run a content script and
// cause the script badge to be animated in.
- ui_test_utils::NavigateToURL(browser(),
- test_server()->GetURL(std::string()));
+ ui_test_utils::NavigateToURL(browser(), test_server()->GetURL(""));
ASSERT_TRUE(catcher.GetNextResult());
}
EXPECT_TRUE(script_badge->GetIsVisible(tab_id));
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 e849e3cc..3bb588a 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc
@@ -435,11 +435,8 @@ class FileSystemChooseEntryFunction::FilePicker
select_file_dialog_->SelectFile(picker_type,
string16(),
suggested_name,
- &file_type_info,
- 0,
- base::FilePath::StringType(),
- owning_window,
- NULL);
+ &file_type_info, 0, FILE_PATH_LITERAL(""),
+ owning_window, NULL);
}
virtual ~FilePicker() {}
diff --git a/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc b/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc
index 570c0fb..96da293 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc
@@ -70,8 +70,8 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) {
// Test grouping of multiple types.
file_type_info = ui::SelectFileDialog::FileTypeInfo();
std::vector<linked_ptr<AcceptOption> > options;
- options.push_back(linked_ptr<AcceptOption>(BuildAcceptOption(
- std::string(), "application/x-chrome-extension", "jso")));
+ options.push_back(linked_ptr<AcceptOption>(
+ BuildAcceptOption("", "application/x-chrome-extension", "jso")));
acceptsAllTypes = false;
FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info,
base::FilePath::StringType(), &options, &acceptsAllTypes);
@@ -90,7 +90,7 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) {
file_type_info = ui::SelectFileDialog::FileTypeInfo();
options.clear();
options.push_back(linked_ptr<AcceptOption>(
- BuildAcceptOption(std::string(), std::string(), "unrelated")));
+ BuildAcceptOption("", "", "unrelated")));
acceptsAllTypes = false;
FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info,
ToStringType(".jso"), &options, &acceptsAllTypes);
@@ -100,9 +100,9 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) {
file_type_info = ui::SelectFileDialog::FileTypeInfo();
options.clear();
options.push_back(linked_ptr<AcceptOption>(
- BuildAcceptOption(std::string(), std::string(), "jso,js")));
+ BuildAcceptOption("", "", "jso,js")));
options.push_back(linked_ptr<AcceptOption>(
- BuildAcceptOption(std::string(), std::string(), "cpp,cc")));
+ BuildAcceptOption("", "", "cpp,cc")));
acceptsAllTypes = false;
FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info,
base::FilePath::StringType(), &options, &acceptsAllTypes);
@@ -122,7 +122,7 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) {
file_type_info = ui::SelectFileDialog::FileTypeInfo();
options.clear();
options.push_back(linked_ptr<AcceptOption>(
- BuildAcceptOption(std::string(), "image/*", "html")));
+ BuildAcceptOption("", "image/*", "html")));
acceptsAllTypes = false;
FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info,
base::FilePath::StringType(), &options, &acceptsAllTypes);
@@ -134,8 +134,8 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) {
// still present the default.
file_type_info = ui::SelectFileDialog::FileTypeInfo();
options.clear();
- options.push_back(linked_ptr<AcceptOption>(BuildAcceptOption(
- std::string(), "image/*,audio/*,video/*", std::string())));
+ options.push_back(linked_ptr<AcceptOption>(
+ BuildAcceptOption("", "image/*,audio/*,video/*", "")));
acceptsAllTypes = false;
FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info,
base::FilePath::StringType(), &options, &acceptsAllTypes);
@@ -146,7 +146,7 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) {
file_type_info = ui::SelectFileDialog::FileTypeInfo();
options.clear();
options.push_back(linked_ptr<AcceptOption>(
- BuildAcceptOption("File Types 101", "image/jpeg", std::string())));
+ BuildAcceptOption("File Types 101", "image/jpeg", "")));
acceptsAllTypes = false;
FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info,
base::FilePath::StringType(), &options, &acceptsAllTypes);
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc
index 174f922..b6fec79d 100644
--- a/chrome/browser/extensions/api/identity/identity_apitest.cc
+++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -508,7 +508,7 @@ class LaunchWebAuthFlowFunctionTest : public ExtensionBrowserTest {
};
IN_PROC_BROWSER_TEST_F(LaunchWebAuthFlowFunctionTest, Bounds) {
- RunAndCheckBounds(std::string(), 0, 0, 0, 0);
+ RunAndCheckBounds("", 0, 0, 0, 0);
RunAndCheckBounds("\"width\": 100, \"height\": 200", 0, 0, 100, 200);
RunAndCheckBounds("\"left\": 100, \"top\": 200", 100, 200, 0, 0);
RunAndCheckBounds(
diff --git a/chrome/browser/extensions/api/management/management_api_browsertest.cc b/chrome/browser/extensions/api/management/management_api_browsertest.cc
index 5b6b04d..f475e81 100644
--- a/chrome/browser/extensions/api/management/management_api_browsertest.cc
+++ b/chrome/browser/extensions/api/management/management_api_browsertest.cc
@@ -257,15 +257,15 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiEscalationTest,
// This should succeed when user accepts dialog.
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kAppsGalleryInstallAutoConfirmForTests, "accept");
- SetEnabled(true, true, std::string());
+ SetEnabled(true, true, "");
// Crash the extension. Mock a reload by disabling and then enabling. The
// extension should be reloaded and enabled.
ASSERT_TRUE(CrashEnabledExtension(kId));
- SetEnabled(false, true, std::string());
- SetEnabled(true, true, std::string());
- const Extension* extension = ExtensionSystem::Get(browser()->profile())
- ->extension_service()->GetExtensionById(kId, false);
+ SetEnabled(false, true, "");
+ SetEnabled(true, true, "");
+ const Extension* extension = ExtensionSystem::Get(browser()->profile())->
+ extension_service()->GetExtensionById(kId, false);
EXPECT_TRUE(extension);
}
diff --git a/chrome/browser/extensions/api/messaging/message_service.cc b/chrome/browser/extensions/api/messaging/message_service.cc
index e3075f9..aae6a25 100644
--- a/chrome/browser/extensions/api/messaging/message_service.cc
+++ b/chrome/browser/extensions/api/messaging/message_service.cc
@@ -216,7 +216,7 @@ void MessageService::OpenChannelToNativeApp(
}
if (!has_permission) {
- ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, std::string());
+ ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, "");
port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(receiver_port_id),
kMissingPermissionError);
return;
@@ -247,7 +247,7 @@ void MessageService::OpenChannelToNativeApp(
if (!native_process.get()) {
LOG(ERROR) << "Failed to create native process.";
// Treat it as a disconnect.
- ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, std::string());
+ ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, "");
port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(receiver_port_id),
kReceivingEndDoesntExistError);
return;
@@ -320,8 +320,7 @@ bool MessageService::OpenChannelImpl(scoped_ptr<OpenChannelParams> params) {
if (!params->receiver.get() || !params->receiver->GetRenderProcessHost()) {
// Treat it as a disconnect.
- ExtensionMessagePort port(
- params->source, MSG_ROUTING_CONTROL, std::string());
+ ExtensionMessagePort port(params->source, MSG_ROUTING_CONTROL, "");
port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(params->receiver_port_id),
kReceivingEndDoesntExistError);
return false;
diff --git a/chrome/browser/extensions/api/proxy/proxy_api.cc b/chrome/browser/extensions/api/proxy/proxy_api.cc
index 5e811bd..ff945d3 100644
--- a/chrome/browser/extensions/api/proxy/proxy_api.cc
+++ b/chrome/browser/extensions/api/proxy/proxy_api.cc
@@ -41,7 +41,7 @@ void ProxyEventRouter::OnProxyError(
DictionaryValue* dict = new DictionaryValue();
dict->SetBoolean(keys::kProxyEventFatal, true);
dict->SetString(keys::kProxyEventError, net::ErrorToString(error_code));
- dict->SetString(keys::kProxyEventDetails, std::string());
+ dict->SetString(keys::kProxyEventDetails, "");
args->Append(dict);
if (profile) {
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 ff3cd32..116f85a 100644
--- a/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc
+++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc
@@ -222,71 +222,41 @@ TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) {
std::string error;
scoped_ptr<DictionaryValue> exp_direct(ProxyConfigDictionary::CreateDirect());
scoped_ptr<DictionaryValue> out_direct(
- CreateProxyConfigDict(ProxyPrefs::MODE_DIRECT,
- false,
- std::string(),
- std::string(),
- std::string(),
- std::string(),
+ CreateProxyConfigDict(ProxyPrefs::MODE_DIRECT, false, "", "", "", "",
&error));
EXPECT_TRUE(Value::Equals(exp_direct.get(), out_direct.get()));
scoped_ptr<DictionaryValue> exp_auto(
ProxyConfigDictionary::CreateAutoDetect());
scoped_ptr<DictionaryValue> out_auto(
- CreateProxyConfigDict(ProxyPrefs::MODE_AUTO_DETECT,
- false,
- std::string(),
- std::string(),
- std::string(),
- std::string(),
+ CreateProxyConfigDict(ProxyPrefs::MODE_AUTO_DETECT, false, "", "", "", "",
&error));
EXPECT_TRUE(Value::Equals(exp_auto.get(), out_auto.get()));
scoped_ptr<DictionaryValue> exp_pac_url(
ProxyConfigDictionary::CreatePacScript(kSamplePacScriptUrl, false));
scoped_ptr<DictionaryValue> out_pac_url(
- CreateProxyConfigDict(ProxyPrefs::MODE_PAC_SCRIPT,
- false,
- kSamplePacScriptUrl,
- std::string(),
- std::string(),
- std::string(),
- &error));
+ CreateProxyConfigDict(ProxyPrefs::MODE_PAC_SCRIPT, false,
+ kSamplePacScriptUrl, "", "", "", &error));
EXPECT_TRUE(Value::Equals(exp_pac_url.get(), out_pac_url.get()));
scoped_ptr<DictionaryValue> exp_pac_data(
ProxyConfigDictionary::CreatePacScript(kSamplePacScriptAsDataUrl, false));
scoped_ptr<DictionaryValue> out_pac_data(
- CreateProxyConfigDict(ProxyPrefs::MODE_PAC_SCRIPT,
- false,
- std::string(),
- kSamplePacScript,
- std::string(),
- std::string(),
- &error));
+ CreateProxyConfigDict(ProxyPrefs::MODE_PAC_SCRIPT, false, "",
+ kSamplePacScript, "", "", &error));
EXPECT_TRUE(Value::Equals(exp_pac_data.get(), out_pac_data.get()));
scoped_ptr<DictionaryValue> exp_fixed(
ProxyConfigDictionary::CreateFixedServers("foo:80", "localhost"));
scoped_ptr<DictionaryValue> out_fixed(
- CreateProxyConfigDict(ProxyPrefs::MODE_FIXED_SERVERS,
- false,
- std::string(),
- std::string(),
- "foo:80",
- "localhost",
- &error));
+ CreateProxyConfigDict(ProxyPrefs::MODE_FIXED_SERVERS, false, "", "",
+ "foo:80", "localhost", &error));
EXPECT_TRUE(Value::Equals(exp_fixed.get(), out_fixed.get()));
scoped_ptr<DictionaryValue> exp_system(ProxyConfigDictionary::CreateSystem());
scoped_ptr<DictionaryValue> out_system(
- CreateProxyConfigDict(ProxyPrefs::MODE_SYSTEM,
- false,
- std::string(),
- std::string(),
- std::string(),
- std::string(),
+ CreateProxyConfigDict(ProxyPrefs::MODE_SYSTEM, false, "", "", "", "",
&error));
EXPECT_TRUE(Value::Equals(exp_system.get(), out_system.get()));
diff --git a/chrome/browser/extensions/api/socket/udp_socket.cc b/chrome/browser/extensions/api/socket/udp_socket.cc
index b9a804c..a2b5f97 100644
--- a/chrome/browser/extensions/api/socket/udp_socket.cc
+++ b/chrome/browser/extensions/api/socket/udp_socket.cc
@@ -108,7 +108,7 @@ void UDPSocket::RecvFrom(int count,
DCHECK(!callback.is_null());
if (!recv_from_callback_.is_null()) {
- callback.Run(net::ERR_IO_PENDING, NULL, std::string(), 0);
+ callback.Run(net::ERR_IO_PENDING, NULL, "", 0);
return;
} else {
recv_from_callback_ = callback;
diff --git a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc
index fcfcdc8..ec530e8 100644
--- a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc
+++ b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc
@@ -130,10 +130,9 @@ class MockSyncChangeProcessor : public syncer::SyncChangeProcessor {
if (matching_changes.empty()) {
ADD_FAILURE() << "No matching changes for " << extension_id << "/" <<
key << " (out of " << changes_.size() << ")";
- return SettingSyncData(syncer::SyncChange::ACTION_INVALID,
- std::string(),
- std::string(),
- scoped_ptr<Value>(new DictionaryValue()));
+ return SettingSyncData(
+ syncer::SyncChange::ACTION_INVALID, "", "",
+ scoped_ptr<Value>(new DictionaryValue()));
}
if (matching_changes.size() != 1u) {
ADD_FAILURE() << matching_changes.size() << " matching changes for " <<
diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc
index 56a8403..a17684e 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api.cc
@@ -316,7 +316,7 @@ ListValue* GetRequestHeadersList(const net::HttpRequestHeaders& headers) {
// Creates a StringValue with the status line of |headers|. If |headers| is
// NULL, an empty string is returned. Ownership is passed to the caller.
StringValue* GetStatusLine(net::HttpResponseHeaders* headers) {
- return new StringValue(headers ? headers->GetStatusLine() : std::string());
+ return new StringValue(headers ? headers->GetStatusLine() : "");
}
void NotifyWebRequestAPIUsed(void* profile_id, const Extension* extension) {
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 0d2a3d6..a9f1319 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
@@ -621,7 +621,7 @@ static std::string FindSetRequestHeader(
return (*delta)->extension_id;
}
}
- return std::string();
+ return "";
}
// Returns the extension ID of the first extension in |deltas| that removes the
@@ -639,7 +639,7 @@ static std::string FindRemoveRequestHeader(
return (*delta)->extension_id;
}
}
- return std::string();
+ return "";
}
void MergeOnBeforeSendHeadersResponses(
@@ -816,26 +816,22 @@ static bool DoesResponseCookieMatchFilter(net::ParsedCookie* cookie,
if (filter->name.get() && cookie->Name() != *filter->name) return false;
if (filter->value.get() && cookie->Value() != *filter->value) return false;
if (filter->expires.get()) {
- std::string actual_value =
- cookie->HasExpires() ? cookie->Expires() : std::string();
+ std::string actual_value = cookie->HasExpires() ? cookie->Expires() : "";
if (actual_value != *filter->expires)
return false;
}
if (filter->max_age.get()) {
- std::string actual_value =
- cookie->HasMaxAge() ? cookie->MaxAge() : std::string();
+ std::string actual_value = cookie->HasMaxAge() ? cookie->MaxAge() : "";
if (actual_value != base::IntToString(*filter->max_age))
return false;
}
if (filter->domain.get()) {
- std::string actual_value =
- cookie->HasDomain() ? cookie->Domain() : std::string();
+ std::string actual_value = cookie->HasDomain() ? cookie->Domain() : "";
if (actual_value != *filter->domain)
return false;
}
if (filter->path.get()) {
- std::string actual_value =
- cookie->HasPath() ? cookie->Path() : std::string();
+ std::string actual_value = cookie->HasPath() ? cookie->Path() : "";
if (actual_value != *filter->path)
return false;
}
@@ -884,8 +880,7 @@ static bool MergeAddResponseCookieModifications(
continue;
// Cookie names are not unique in response cookies so we always append
// and never override.
- linked_ptr<net::ParsedCookie> cookie(
- new net::ParsedCookie(std::string()));
+ linked_ptr<net::ParsedCookie> cookie(new net::ParsedCookie(""));
ApplyResponseCookieModification((*mod)->modification.get(), cookie.get());
cookies->push_back(cookie);
modified = true;
@@ -1013,7 +1008,7 @@ static std::string FindRemoveResponseHeader(
return (*delta)->extension_id;
}
}
- return std::string();
+ return "";
}
void MergeOnHeadersReceivedResponses(
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 fc78860..91e3dd9 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
@@ -574,10 +574,9 @@ TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) {
keys::kRequestBodyRawBytesKey,
BinaryValue::CreateWithCopiedBuffer(kPlainBlock1, kPlainBlock1Length),
&raw);
- extensions::subtle::AppendKeyValuePair(
- keys::kRequestBodyRawFileKey,
- Value::CreateStringValue(std::string()),
- &raw);
+ extensions::subtle::AppendKeyValuePair(keys::kRequestBodyRawFileKey,
+ Value::CreateStringValue(""),
+ &raw);
extensions::subtle::AppendKeyValuePair(
keys::kRequestBodyRawBytesKey,
BinaryValue::CreateWithCopiedBuffer(kPlainBlock2, kPlainBlock2Length),
@@ -963,7 +962,7 @@ void TestInitFromValue(const std::string& values, bool expected_return_code,
}
TEST_F(ExtensionWebRequestTest, InitFromValue) {
- TestInitFromValue(std::string(), true, 0);
+ TestInitFromValue("", true, 0);
// Single valid values.
TestInitFromValue(
diff --git a/chrome/browser/extensions/api/web_socket_proxy_private/web_socket_proxy_private_api.cc b/chrome/browser/extensions/api/web_socket_proxy_private/web_socket_proxy_private_api.cc
index 91483c5..237941c 100644
--- a/chrome/browser/extensions/api/web_socket_proxy_private/web_socket_proxy_private_api.cc
+++ b/chrome/browser/extensions/api/web_socket_proxy_private/web_socket_proxy_private_api.cc
@@ -95,7 +95,7 @@ void WebSocketProxyPrivate::ResolveHostIOPart(IOThread* io_thread) {
bool WebSocketProxyPrivate::RunImpl() {
AddRef();
- SetResult(Value::CreateStringValue(std::string()));
+ SetResult(Value::CreateStringValue(""));
#if defined(OS_CHROMEOS)
bool delay_response = false;
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 8cb59aa..0264c36 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -295,7 +295,7 @@ bool BeginInstallWithManifestFunction::RunImpl() {
void BeginInstallWithManifestFunction::SetResultCode(ResultCode code) {
switch (code) {
case ERROR_NONE:
- SetResult(Value::CreateStringValue(std::string()));
+ SetResult(Value::CreateStringValue(""));
break;
case UNKNOWN_ERROR:
SetResult(Value::CreateStringValue("unknown_error"));
@@ -338,7 +338,7 @@ void BeginInstallWithManifestFunction::OnWebstoreParseSuccess(
Extension::FROM_WEBSTORE,
id,
localized_name_,
- std::string(),
+ "",
&error);
if (!dummy_extension_) {
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
index 1a39317..81a63d1 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
@@ -248,7 +248,7 @@ class ExtensionWebstoreGetWebGLStatusTest : public InProcessBrowserTest {
function.get(), kEmptyArgs, browser()));
ASSERT_TRUE(result);
EXPECT_EQ(base::Value::TYPE_STRING, result->GetType());
- std::string webgl_status;
+ std::string webgl_status = "";
EXPECT_TRUE(result->GetAsString(&webgl_status));
EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked,
webgl_status.c_str());
diff --git a/chrome/browser/extensions/bundle_installer.cc b/chrome/browser/extensions/bundle_installer.cc
index 7cf66d3..97005be 100644
--- a/chrome/browser/extensions/bundle_installer.cc
+++ b/chrome/browser/extensions/bundle_installer.cc
@@ -215,7 +215,7 @@ void BundleInstaller::ParseManifests() {
for (ItemMap::iterator i = items_.begin(); i != items_.end(); ++i) {
scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper(
- this, i->first, i->second.manifest, std::string(), GURL(), NULL);
+ this, i->first, i->second.manifest, "", GURL(), NULL);
helper->Start();
}
}
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index 82a6883..58c53b7 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -137,7 +137,7 @@ std::string ComponentLoader::Add(const std::string& manifest_contents,
DictionaryValue* manifest = ParseManifest(manifest_contents);
if (manifest)
return Add(manifest, root_directory);
- return std::string();
+ return "";
}
std::string ComponentLoader::Add(const DictionaryValue* parsed_manifest,
diff --git a/chrome/browser/extensions/component_loader_unittest.cc b/chrome/browser/extensions/component_loader_unittest.cc
index 4b2b52a..bedcfee 100644
--- a/chrome/browser/extensions/component_loader_unittest.cc
+++ b/chrome/browser/extensions/component_loader_unittest.cc
@@ -141,7 +141,7 @@ TEST_F(ComponentLoaderTest, ParseManifest) {
// Test manifests that are valid JSON, but don't have an object literal
// at the root. ParseManifest() should always return NULL.
- manifest.reset(component_loader_.ParseManifest(std::string()));
+ manifest.reset(component_loader_.ParseManifest(""));
EXPECT_FALSE(manifest.get());
manifest.reset(component_loader_.ParseManifest("[{ \"foo\": 3 }]"));
diff --git a/chrome/browser/extensions/event_router.cc b/chrome/browser/extensions/event_router.cc
index 72e0f52..4a75636 100644
--- a/chrome/browser/extensions/event_router.cc
+++ b/chrome/browser/extensions/event_router.cc
@@ -119,7 +119,7 @@ void EventRouter::LogExtensionEventMessage(void* profile_id,
LOG(WARNING) << "Extension " << extension_id << " not found!";
} else {
extensions::ActivityLog::GetInstance(profile)->LogEventAction(
- extension, event_name, event_args.get(), std::string());
+ extension, event_name, event_args.get(), "");
}
}
}
@@ -243,8 +243,10 @@ void EventRouter::OnListenerAdded(const EventListener* listener) {
scoped_ptr<ListValue> args(new ListValue());
if (listener->filter)
args->Append(listener->filter->DeepCopy());
- activity_log_->LogAPIAction(
- extension, event_name + ".addListener", args.get(), std::string());
+ activity_log_->LogAPIAction(extension,
+ event_name + ".addListener",
+ args.get(),
+ "");
}
}
@@ -269,8 +271,10 @@ void EventRouter::OnListenerRemoved(const EventListener* listener) {
ExtensionService::INCLUDE_ENABLED);
if (extension) {
scoped_ptr<ListValue> args(new ListValue());
- activity_log_->LogAPIAction(
- extension, event_name + ".removeListener", args.get(), std::string());
+ activity_log_->LogAPIAction(extension,
+ event_name + ".removeListener",
+ args.get(),
+ "");
}
}
@@ -380,7 +384,7 @@ bool EventRouter::HasEventListenerImpl(const ListenerMap& listener_map,
}
void EventRouter::BroadcastEvent(scoped_ptr<Event> event) {
- DispatchEventImpl(std::string(), linked_ptr<Event>(event.release()));
+ DispatchEventImpl("", linked_ptr<Event>(event.release()));
}
void EventRouter::DispatchEventToExtension(const std::string& extension_id,
diff --git a/chrome/browser/extensions/event_router_forwarder.cc b/chrome/browser/extensions/event_router_forwarder.cc
index f094608..15b7e97 100644
--- a/chrome/browser/extensions/event_router_forwarder.cc
+++ b/chrome/browser/extensions/event_router_forwarder.cc
@@ -26,7 +26,7 @@ void EventRouterForwarder::BroadcastEventToRenderers(
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
const GURL& event_url) {
- HandleEvent(std::string(), event_name, event_args.Pass(), 0, true, event_url);
+ HandleEvent("", event_name, event_args.Pass(), 0, true, event_url);
}
void EventRouterForwarder::DispatchEventToRenderers(
@@ -37,12 +37,8 @@ void EventRouterForwarder::DispatchEventToRenderers(
const GURL& event_url) {
if (!profile)
return;
- HandleEvent(std::string(),
- event_name,
- event_args.Pass(),
- profile,
- use_profile_to_restrict_events,
- event_url);
+ HandleEvent("", event_name, event_args.Pass(), profile,
+ use_profile_to_restrict_events, event_url);
}
void EventRouterForwarder::BroadcastEventToExtension(
diff --git a/chrome/browser/extensions/extension_action_unittest.cc b/chrome/browser/extensions/extension_action_unittest.cc
index 6c2ca63..9a5c3ff 100644
--- a/chrome/browser/extensions/extension_action_unittest.cc
+++ b/chrome/browser/extensions/extension_action_unittest.cc
@@ -15,7 +15,7 @@ using extensions::ActionInfo;
TEST(ExtensionActionTest, Title) {
ActionInfo action_info;
action_info.default_title = "Initial Title";
- ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, action_info);
+ ExtensionAction action("", ActionInfo::TYPE_PAGE, action_info);
ASSERT_EQ("Initial Title", action.GetTitle(1));
action.SetTitle(ExtensionAction::kDefaultTabId, "foo");
@@ -31,7 +31,8 @@ TEST(ExtensionActionTest, Title) {
}
TEST(ExtensionActionTest, Visibility) {
- ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, ActionInfo());
+ ExtensionAction action("", ActionInfo::TYPE_PAGE,
+ ActionInfo());
ASSERT_FALSE(action.GetIsVisible(1));
action.SetAppearance(ExtensionAction::kDefaultTabId, ExtensionAction::ACTIVE);
@@ -52,8 +53,8 @@ TEST(ExtensionActionTest, Visibility) {
ASSERT_FALSE(action.GetIsVisible(1));
ASSERT_FALSE(action.GetIsVisible(100));
- ExtensionAction browser_action(
- std::string(), ActionInfo::TYPE_BROWSER, ActionInfo());
+ ExtensionAction browser_action("", ActionInfo::TYPE_BROWSER,
+ ActionInfo());
ASSERT_TRUE(browser_action.GetIsVisible(1));
}
@@ -61,8 +62,8 @@ TEST(ExtensionActionTest, ScriptBadgeAnimation) {
// Supports the icon animation.
MessageLoop message_loop;
- ExtensionAction script_badge(
- std::string(), ActionInfo::TYPE_SCRIPT_BADGE, ActionInfo());
+ ExtensionAction script_badge("", ActionInfo::TYPE_SCRIPT_BADGE,
+ ActionInfo());
EXPECT_FALSE(script_badge.GetIconAnimation(ExtensionAction::kDefaultTabId));
script_badge.SetAppearance(ExtensionAction::kDefaultTabId,
ExtensionAction::ACTIVE);
@@ -85,8 +86,8 @@ TEST(ExtensionActionTest, GetAttention) {
// Supports the icon animation.
scoped_ptr<MessageLoop> message_loop(new MessageLoop);
- ExtensionAction script_badge(
- std::string(), ActionInfo::TYPE_SCRIPT_BADGE, ActionInfo());
+ ExtensionAction script_badge("", ActionInfo::TYPE_SCRIPT_BADGE,
+ ActionInfo());
EXPECT_FALSE(script_badge.GetIsVisible(1));
EXPECT_FALSE(script_badge.GetIconAnimation(1));
script_badge.SetAppearance(1, ExtensionAction::WANTS_ATTENTION);
@@ -106,8 +107,8 @@ TEST(ExtensionActionTest, GetAttention) {
TEST(ExtensionActionTest, Icon) {
ActionInfo action_info;
action_info.default_icon.Add(16, "icon16.png");
- ExtensionAction page_action(
- std::string(), ActionInfo::TYPE_PAGE, action_info);
+ ExtensionAction page_action("", ActionInfo::TYPE_PAGE,
+ action_info);
ASSERT_TRUE(page_action.default_icon());
EXPECT_EQ("icon16.png",
page_action.default_icon()->Get(
@@ -118,7 +119,8 @@ TEST(ExtensionActionTest, Icon) {
}
TEST(ExtensionActionTest, Badge) {
- ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, ActionInfo());
+ ExtensionAction action("", ActionInfo::TYPE_PAGE,
+ ActionInfo());
ASSERT_EQ("", action.GetBadgeText(1));
action.SetBadgeText(ExtensionAction::kDefaultTabId, "foo");
ASSERT_EQ("foo", action.GetBadgeText(1));
@@ -133,7 +135,8 @@ TEST(ExtensionActionTest, Badge) {
}
TEST(ExtensionActionTest, BadgeTextColor) {
- ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, ActionInfo());
+ ExtensionAction action("", ActionInfo::TYPE_PAGE,
+ ActionInfo());
ASSERT_EQ(0x00000000u, action.GetBadgeTextColor(1));
action.SetBadgeTextColor(ExtensionAction::kDefaultTabId, 0xFFFF0000u);
ASSERT_EQ(0xFFFF0000u, action.GetBadgeTextColor(1));
@@ -148,7 +151,8 @@ TEST(ExtensionActionTest, BadgeTextColor) {
}
TEST(ExtensionActionTest, BadgeBackgroundColor) {
- ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, ActionInfo());
+ ExtensionAction action("", ActionInfo::TYPE_PAGE,
+ ActionInfo());
ASSERT_EQ(0x00000000u, action.GetBadgeBackgroundColor(1));
action.SetBadgeBackgroundColor(ExtensionAction::kDefaultTabId,
0xFFFF0000u);
@@ -172,7 +176,7 @@ TEST(ExtensionActionTest, PopupUrl) {
ActionInfo action_info;
action_info.default_popup_url = url_foo;
- ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, action_info);
+ ExtensionAction action("", ActionInfo::TYPE_PAGE, action_info);
ASSERT_EQ(url_foo, action.GetPopupUrl(1));
ASSERT_EQ(url_foo, action.GetPopupUrl(100));
diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc
index 8d072ae..e3534e4 100644
--- a/chrome/browser/extensions/extension_apitest.cc
+++ b/chrome/browser/extensions/extension_apitest.cc
@@ -80,7 +80,7 @@ void ExtensionApiTest::ResultCatcher::Observe(
case chrome::NOTIFICATION_EXTENSION_TEST_PASSED:
VLOG(1) << "Got EXTENSION_TEST_PASSED notification.";
results_.push_back(true);
- messages_.push_back(std::string());
+ messages_.push_back("");
if (waiting_)
MessageLoopForUI::current()->Quit();
break;
@@ -114,45 +114,41 @@ void ExtensionApiTest::TearDownInProcessBrowserTestFixture() {
}
bool ExtensionApiTest::RunExtensionTest(const char* extension_name) {
- return RunExtensionTestImpl(
- extension_name, std::string(), kFlagEnableFileAccess);
+ return RunExtensionTestImpl(extension_name, "", kFlagEnableFileAccess);
}
bool ExtensionApiTest::RunExtensionTestIncognito(const char* extension_name) {
- return RunExtensionTestImpl(extension_name,
- std::string(),
- kFlagEnableIncognito | kFlagEnableFileAccess);
+ return RunExtensionTestImpl(
+ extension_name, "", kFlagEnableIncognito | kFlagEnableFileAccess);
}
bool ExtensionApiTest::RunExtensionTestIgnoreManifestWarnings(
const char* extension_name) {
return RunExtensionTestImpl(
- extension_name, std::string(), kFlagIgnoreManifestWarnings);
+ extension_name, "", kFlagIgnoreManifestWarnings);
}
bool ExtensionApiTest::RunExtensionTestAllowOldManifestVersion(
const char* extension_name) {
return RunExtensionTestImpl(
extension_name,
- std::string(),
+ "",
kFlagEnableFileAccess | kFlagAllowOldManifestVersions);
}
bool ExtensionApiTest::RunComponentExtensionTest(const char* extension_name) {
- return RunExtensionTestImpl(extension_name,
- std::string(),
- kFlagEnableFileAccess | kFlagLoadAsComponent);
+ return RunExtensionTestImpl(
+ extension_name, "", kFlagEnableFileAccess | kFlagLoadAsComponent);
}
bool ExtensionApiTest::RunExtensionTestNoFileAccess(
const char* extension_name) {
- return RunExtensionTestImpl(extension_name, std::string(), kFlagNone);
+ return RunExtensionTestImpl(extension_name, "", kFlagNone);
}
bool ExtensionApiTest::RunExtensionTestIncognitoNoFileAccess(
const char* extension_name) {
- return RunExtensionTestImpl(
- extension_name, std::string(), kFlagEnableIncognito);
+ return RunExtensionTestImpl(extension_name, "", kFlagEnableIncognito);
}
bool ExtensionApiTest::RunExtensionSubtest(const char* extension_name,
@@ -178,8 +174,7 @@ bool ExtensionApiTest::RunPageTest(const std::string& page_url,
}
bool ExtensionApiTest::RunPlatformAppTest(const char* extension_name) {
- return RunExtensionTestImpl(
- extension_name, std::string(), kFlagLaunchPlatformApp);
+ return RunExtensionTestImpl(extension_name, "", kFlagLaunchPlatformApp);
}
// Load |extension_name| extension and/or |page_url| and wait for
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc
index cfad60e..b051df9 100644
--- a/chrome/browser/extensions/extension_browsertest.cc
+++ b/chrome/browser/extensions/extension_browsertest.cc
@@ -337,13 +337,9 @@ class MockAutoConfirmExtensionInstallPrompt : public ExtensionInstallPrompt {
const Extension* ExtensionBrowserTest::InstallExtensionFromWebstore(
const base::FilePath& path,
int expected_change) {
- return InstallOrUpdateExtension(std::string(),
- path,
- INSTALL_UI_TYPE_NONE,
- expected_change,
- Manifest::INTERNAL,
- browser(),
- true);
+ return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_NONE,
+ expected_change, Manifest::INTERNAL,
+ browser(), true);
}
const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
diff --git a/chrome/browser/extensions/extension_browsertest.h b/chrome/browser/extensions/extension_browsertest.h
index 9d79f56..9d1203c 100644
--- a/chrome/browser/extensions/extension_browsertest.h
+++ b/chrome/browser/extensions/extension_browsertest.h
@@ -112,8 +112,8 @@ class ExtensionBrowserTest : virtual public InProcessBrowserTest,
// you expect a failed upgrade.
const extensions::Extension* InstallExtension(const base::FilePath& path,
int expected_change) {
- return InstallOrUpdateExtension(
- std::string(), path, INSTALL_UI_TYPE_NONE, expected_change);
+ return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_NONE,
+ expected_change);
}
// Same as above, but an install source other than Manifest::INTERNAL can be
@@ -122,11 +122,8 @@ class ExtensionBrowserTest : virtual public InProcessBrowserTest,
const base::FilePath& path,
int expected_change,
extensions::Manifest::Location install_source) {
- return InstallOrUpdateExtension(std::string(),
- path,
- INSTALL_UI_TYPE_NONE,
- expected_change,
- install_source);
+ return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_NONE,
+ expected_change, install_source);
}
// Installs extension as if it came from the Chrome Webstore.
@@ -147,27 +144,22 @@ class ExtensionBrowserTest : virtual public InProcessBrowserTest,
const extensions::Extension* InstallExtensionWithUI(
const base::FilePath& path,
int expected_change) {
- return InstallOrUpdateExtension(
- std::string(), path, INSTALL_UI_TYPE_NORMAL, expected_change);
+ return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_NORMAL,
+ expected_change);
}
const extensions::Extension* InstallExtensionWithUIAutoConfirm(
const base::FilePath& path,
int expected_change,
Browser* browser) {
- return InstallOrUpdateExtension(std::string(),
- path,
- INSTALL_UI_TYPE_AUTO_CONFIRM,
- expected_change,
- browser,
- false);
+ return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_AUTO_CONFIRM,
+ expected_change, browser, false);
}
// Begins install process but simulates a user cancel.
const extensions::Extension* StartInstallButCancel(
const base::FilePath& path) {
- return InstallOrUpdateExtension(
- std::string(), path, INSTALL_UI_TYPE_CANCEL, 0);
+ return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_CANCEL, 0);
}
void ReloadExtension(const std::string& extension_id);
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index c15ba6f..00a1f39 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -63,7 +63,7 @@ void LogSuccess(const Extension* extension,
} else {
extensions::ActivityLog* activity_log =
extensions::ActivityLog::GetInstance(profile);
- activity_log->LogAPIAction(extension, api_name, args.get(), std::string());
+ activity_log->LogAPIAction(extension, api_name, args.get(), "");
}
}
@@ -86,8 +86,11 @@ void LogFailure(const Extension* extension,
} else {
extensions::ActivityLog* activity_log =
extensions::ActivityLog::GetInstance(profile);
- activity_log->LogBlockedAction(
- extension, api_name, args.get(), reason, std::string());
+ activity_log->LogBlockedAction(extension,
+ api_name,
+ args.get(),
+ reason,
+ "");
}
}
diff --git a/chrome/browser/extensions/extension_pref_value_map_unittest.cc b/chrome/browser/extensions/extension_pref_value_map_unittest.cc
index 7f1b2d5..bfa573f 100644
--- a/chrome/browser/extensions/extension_pref_value_map_unittest.cc
+++ b/chrome/browser/extensions/extension_pref_value_map_unittest.cc
@@ -45,7 +45,7 @@ class ExtensionPrefValueMapTestBase : public BASECLASS {
// Returns an empty string if the key is not set.
std::string GetValue(const char * key, bool incognito) const {
const Value *value = epvm_.GetEffectivePrefValue(key, incognito, NULL);
- std::string string_value;
+ std::string string_value = "";
if (value)
value->GetAsString(&string_value);
return string_value;
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index b24e0e7..0f1d743 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -1670,8 +1670,7 @@ void ExtensionPrefs::SetDelayedInstallInfo(
if (extension->RequiresSortOrdinal()) {
extension_dict->SetString(
kPrefSuggestedPageOrdinal,
- page_ordinal.IsValid() ? page_ordinal.ToInternalValue()
- : std::string());
+ page_ordinal.IsValid() ? page_ordinal.ToInternalValue() : "");
}
UpdateExtensionPref(extension->id(), kDelayedInstallInfo, extension_dict);
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
index 09fc245..a4cb67f 100644
--- a/chrome/browser/extensions/extension_process_manager.cc
+++ b/chrome/browser/extensions/extension_process_manager.cc
@@ -63,7 +63,7 @@ std::string GetExtensionID(RenderViewHost* render_view_host) {
// This works for both apps and extensions because the site has been
// normalized to the extension URL for apps.
if (!render_view_host->GetSiteInstance())
- return std::string();
+ return "";
return render_view_host->GetSiteInstance()->GetSiteURL().host();
}
diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc
index 503b2ad..049d813 100644
--- a/chrome/browser/extensions/extension_protocols.cc
+++ b/chrome/browser/extensions/extension_protocols.cc
@@ -320,8 +320,7 @@ bool AllowExtensionResourceLoad(net::URLRequest* request,
// some extensions want to be able to do things like create their own
// launchers.
std::string resource_root_relative_path =
- request->url().path().empty() ? std::string()
- : request->url().path().substr(1);
+ request->url().path().empty() ? "" : request->url().path().substr(1);
if (extension->is_hosted_app() &&
!extensions::IconsInfo::GetIcons(extension)
.ContainsPath(resource_root_relative_path)) {
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 368d048..a6068b5 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -1192,7 +1192,7 @@ TEST_F(ExtensionServiceTest, LoadAllExtensionsFromDirectorySuccess) {
EXPECT_EQ(std::string(good1), loaded_[1]->id());
EXPECT_EQ(std::string("My extension 2"), loaded_[1]->name());
- EXPECT_EQ(std::string(), loaded_[1]->description());
+ EXPECT_EQ(std::string(""), loaded_[1]->description());
EXPECT_EQ(loaded_[1]->GetResourceURL("background.html"),
extensions::BackgroundInfo::GetBackgroundURL(loaded_[1]));
EXPECT_EQ(
@@ -1220,7 +1220,7 @@ TEST_F(ExtensionServiceTest, LoadAllExtensionsFromDirectorySuccess) {
int index = expected_num_extensions - 1;
EXPECT_EQ(std::string(good2), loaded_[index]->id());
EXPECT_EQ(std::string("My extension 3"), loaded_[index]->name());
- EXPECT_EQ(std::string(), loaded_[index]->description());
+ EXPECT_EQ(std::string(""), loaded_[index]->description());
EXPECT_EQ(
0u,
extensions::ContentScriptsInfo::GetContentScripts(loaded_[index]).size());
@@ -3313,8 +3313,8 @@ TEST_F(ExtensionServiceTest, ManagementPolicyProhibitsLoadFromPrefs) {
// UNPACKED is for extensions loaded from a directory. We use it here, even
// though we're testing loading from prefs, so that we don't need to provide
// an extension key.
- extensions::ExtensionInfo extension_info(
- &manifest, std::string(), path, Manifest::UNPACKED);
+ extensions::ExtensionInfo extension_info(&manifest, "", path,
+ Manifest::UNPACKED);
// Ensure we can load it with no management policy in place.
management_policy_->UnregisterAllProviders();
diff --git a/chrome/browser/extensions/extension_test_message_listener.cc b/chrome/browser/extensions/extension_test_message_listener.cc
index e892ba1..90aa01a 100644
--- a/chrome/browser/extensions/extension_test_message_listener.cc
+++ b/chrome/browser/extensions/extension_test_message_listener.cc
@@ -17,6 +17,7 @@ ExtensionTestMessageListener::ExtensionTestMessageListener(
satisfied_(false),
waiting_(false),
will_reply_(will_reply),
+ failure_message_(""),
failed_(false) {
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
content::NotificationService::AllSources());
@@ -58,7 +59,7 @@ void ExtensionTestMessageListener::Observe(
satisfied_ = true;
registrar_.RemoveAll(); // Stop listening for more messages.
if (!will_reply_) {
- function_->Reply(std::string());
+ function_->Reply("");
function_ = NULL;
}
if (waiting_) {
diff --git a/chrome/browser/extensions/extensions_quota_service.cc b/chrome/browser/extensions/extensions_quota_service.cc
index 6b267a5..c01b9e3 100644
--- a/chrome/browser/extensions/extensions_quota_service.cc
+++ b/chrome/browser/extensions/extensions_quota_service.cc
@@ -42,7 +42,7 @@ std::string ExtensionsQuotaService::Assess(
DCHECK(CalledOnValidThread());
if (function->ShouldSkipQuotaLimiting())
- return std::string();
+ return "";
// Lookup function list for extension.
FunctionHeuristicsMap& functions = function_heuristics_[extension_id];
@@ -53,7 +53,7 @@ std::string ExtensionsQuotaService::Assess(
function->GetQuotaLimitHeuristics(&heuristics);
if (heuristics.empty())
- return std::string(); // No heuristic implies no limit.
+ return ""; // No heuristic implies no limit.
ViolationErrorMap::iterator violation_error =
violation_errors_.find(extension_id);
@@ -71,7 +71,7 @@ std::string ExtensionsQuotaService::Assess(
}
if (!failed_heuristic)
- return std::string();
+ return "";
std::string error = failed_heuristic->GetError();
DCHECK_GT(error.length(), 0u);
diff --git a/chrome/browser/extensions/external_policy_loader_unittest.cc b/chrome/browser/extensions/external_policy_loader_unittest.cc
index 75bd788..5f8943c 100644
--- a/chrome/browser/extensions/external_policy_loader_unittest.cc
+++ b/chrome/browser/extensions/external_policy_loader_unittest.cc
@@ -139,8 +139,7 @@ TEST_F(ExternalPolicyLoaderTest, InvalidEntriesIgnored) {
// Add invalid entries.
forced_extensions.SetString("invalid", "http://www.example.com/crx");
- forced_extensions.SetString("dddddddddddddddddddddddddddddddd",
- std::string());
+ forced_extensions.SetString("dddddddddddddddddddddddddddddddd", "");
forced_extensions.SetString("invalid", "bad");
MockExternalPolicyProviderVisitor mv;
diff --git a/chrome/browser/extensions/isolated_app_browsertest.cc b/chrome/browser/extensions/isolated_app_browsertest.cc
index ec55a4c..b7717bb 100644
--- a/chrome/browser/extensions/isolated_app_browsertest.cc
+++ b/chrome/browser/extensions/isolated_app_browsertest.cc
@@ -328,7 +328,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppTest, MAYBE_SubresourceCookieIsolation) {
// The app under test acts on URLs whose host is "localhost",
// so the URLs we navigate to must have host "localhost".
- GURL root_url = test_server()->GetURL(std::string());
+ GURL root_url = test_server()->GetURL("");
GURL base_url = test_server()->GetURL("files/extensions/isolated_apps/");
GURL::Replacements replace_host;
std::string host_str("localhost"); // Must stay in scope with replace_host.
diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc
index 4256c61..0335866 100644
--- a/chrome/browser/extensions/menu_manager.cc
+++ b/chrome/browser/extensions/menu_manager.cc
@@ -833,10 +833,14 @@ void MenuManager::RemoveAllIncognitoContextItems() {
RemoveContextMenuItem(*remove_iter);
}
-MenuItem::Id::Id() : incognito(false), uid(0) {}
+MenuItem::Id::Id()
+ : incognito(false), extension_id(""), uid(0), string_uid("") {
+}
MenuItem::Id::Id(bool incognito, const std::string& extension_id)
- : incognito(incognito), extension_id(extension_id), uid(0) {}
+ : incognito(incognito), extension_id(extension_id), uid(0),
+ string_uid("") {
+}
MenuItem::Id::~Id() {
}
diff --git a/chrome/browser/extensions/pending_extension_info.cc b/chrome/browser/extensions/pending_extension_info.cc
index a1e93d8..6fc0adc 100644
--- a/chrome/browser/extensions/pending_extension_info.cc
+++ b/chrome/browser/extensions/pending_extension_info.cc
@@ -25,7 +25,8 @@ PendingExtensionInfo::PendingExtensionInfo(
install_source_(install_source) {}
PendingExtensionInfo::PendingExtensionInfo()
- : update_url_(),
+ : id_(""),
+ update_url_(),
should_allow_install_(NULL),
is_from_sync_(true),
install_silently_(false),
diff --git a/chrome/browser/extensions/platform_app_browsertest_util.cc b/chrome/browser/extensions/platform_app_browsertest_util.cc
index 58c2548..62f8545 100644
--- a/chrome/browser/extensions/platform_app_browsertest_util.cc
+++ b/chrome/browser/extensions/platform_app_browsertest_util.cc
@@ -142,13 +142,13 @@ ShellWindow* PlatformAppBrowserTest::CreateShellWindow(
const Extension* extension) {
ShellWindow::CreateParams params;
return ShellWindow::Create(
- browser()->profile(), extension, GURL(std::string()), params);
+ browser()->profile(), extension, GURL(""), params);
}
ShellWindow* PlatformAppBrowserTest::CreateShellWindowFromParams(
const Extension* extension, const ShellWindow::CreateParams& params) {
return ShellWindow::Create(
- browser()->profile(), extension, GURL(std::string()), params);
+ browser()->profile(), extension, GURL(""), params);
}
void PlatformAppBrowserTest::CloseShellWindow(ShellWindow* window) {
diff --git a/chrome/browser/extensions/platform_app_launcher.cc b/chrome/browser/extensions/platform_app_launcher.cc
index 46daa89..a883e66 100644
--- a/chrome/browser/extensions/platform_app_launcher.cc
+++ b/chrome/browser/extensions/platform_app_launcher.cc
@@ -107,7 +107,10 @@ class PlatformAppPathLauncher
PlatformAppPathLauncher(Profile* profile,
const Extension* extension,
const base::FilePath& file_path)
- : profile_(profile), extension_(extension), file_path_(file_path) {}
+ : profile_(profile),
+ extension_(extension),
+ file_path_(file_path),
+ handler_id_("") {}
void Launch() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
diff --git a/chrome/browser/extensions/script_badge_controller_unittest.cc b/chrome/browser/extensions/script_badge_controller_unittest.cc
index cb773f8..d2cf6bc 100644
--- a/chrome/browser/extensions/script_badge_controller_unittest.cc
+++ b/chrome/browser/extensions/script_badge_controller_unittest.cc
@@ -138,7 +138,7 @@ TEST_F(ScriptBadgeControllerTest, ExecutionMakesBadgeVisible) {
web_contents(),
id_map,
web_contents()->GetController().GetActiveEntry()->GetPageID(),
- GURL(std::string()));
+ GURL(""));
EXPECT_THAT(script_badge_controller_->GetCurrentActions(),
testing::ElementsAre(GetScriptBadge(*extension)));
EXPECT_THAT(location_bar_updated.events, testing::Gt(0));
@@ -167,7 +167,7 @@ TEST_F(ScriptBadgeControllerTest, FragmentNavigation) {
web_contents(),
id_map,
web_contents()->GetController().GetActiveEntry()->GetPageID(),
- GURL(std::string()));
+ GURL(""));
EXPECT_THAT(script_badge_controller_->GetCurrentActions(),
testing::ElementsAre(GetScriptBadge(*extension)));
diff --git a/chrome/browser/extensions/script_executor.cc b/chrome/browser/extensions/script_executor.cc
index b35b776..c5ed09f 100644
--- a/chrome/browser/extensions/script_executor.cc
+++ b/chrome/browser/extensions/script_executor.cc
@@ -66,7 +66,7 @@ class Handler : public content::WebContentsObserver {
virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE {
base::ListValue val;
- callback_.Run(kRendererDestroyed, -1, GURL(std::string()), val);
+ callback_.Run(kRendererDestroyed, -1, GURL(""), val);
delete this;
}
diff --git a/chrome/browser/extensions/subscribe_page_action_browsertest.cc b/chrome/browser/extensions/subscribe_page_action_browsertest.cc
index 02449a1..471ad5c 100644
--- a/chrome/browser/extensions/subscribe_page_action_browsertest.cc
+++ b/chrome/browser/extensions/subscribe_page_action_browsertest.cc
@@ -114,8 +114,10 @@ void NavigateToFeedAndValidate(net::TestServer* server,
GetFeedUrl(server, url, true, extension_id));
WebContents* tab = browser->tab_strip_model()->GetActiveWebContents();
- ASSERT_TRUE(ValidatePageElement(
- tab, std::string(), kScriptFeedTitle, expected_feed_title));
+ ASSERT_TRUE(ValidatePageElement(tab,
+ "",
+ kScriptFeedTitle,
+ expected_feed_title));
ASSERT_TRUE(ValidatePageElement(tab,
"//html/body/div/iframe[1]",
kScriptAnchor,
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc
index cd420ad..cdcec02 100644
--- a/chrome/browser/extensions/tab_helper.cc
+++ b/chrome/browser/extensions/tab_helper.cc
@@ -413,7 +413,7 @@ void TabHelper::OnInlineInstallComplete(int install_id,
const std::string& error) {
if (success) {
Send(new ExtensionMsg_InlineWebstoreInstallResponse(
- return_route_id, install_id, true, std::string()));
+ return_route_id, install_id, true, ""));
} else {
Send(new ExtensionMsg_InlineWebstoreInstallResponse(
return_route_id, install_id, false, error));
diff --git a/chrome/browser/extensions/updater/extension_downloader.cc b/chrome/browser/extensions/updater/extension_downloader.cc
index f165732..0c04a89 100644
--- a/chrome/browser/extensions/updater/extension_downloader.cc
+++ b/chrome/browser/extensions/updater/extension_downloader.cc
@@ -153,7 +153,12 @@ UpdateDetails::UpdateDetails(const std::string& id, const Version& version)
UpdateDetails::~UpdateDetails() {}
-ExtensionDownloader::ExtensionFetch::ExtensionFetch() : url() {}
+
+ExtensionDownloader::ExtensionFetch::ExtensionFetch()
+ : id(""),
+ url(),
+ package_hash(""),
+ version("") {}
ExtensionDownloader::ExtensionFetch::ExtensionFetch(
const std::string& id,
@@ -215,11 +220,7 @@ bool ExtensionDownloader::AddPendingExtension(const std::string& id,
Version version("0.0.0.0");
DCHECK(version.IsValid());
- return AddExtensionData(id,
- version,
- Manifest::TYPE_UNKNOWN,
- update_url,
- std::string(),
+ return AddExtensionData(id, version, Manifest::TYPE_UNKNOWN, update_url, "",
request_id);
}
@@ -248,10 +249,7 @@ void ExtensionDownloader::StartBlacklistUpdate(
new ManifestFetchData(extension_urls::GetWebstoreUpdateUrl(),
request_id));
DCHECK(blacklist_fetch->base_url().SchemeIsSecure());
- blacklist_fetch->AddExtension(kBlacklistAppID,
- version,
- &ping_data,
- std::string(),
+ blacklist_fetch->AddExtension(kBlacklistAppID, version, &ping_data, "",
kDefaultInstallSource);
StartUpdateCheck(blacklist_fetch.Pass());
}
diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc
index 130da8f..feadf5a 100644
--- a/chrome/browser/extensions/updater/extension_updater.cc
+++ b/chrome/browser/extensions/updater/extension_updater.cc
@@ -106,7 +106,10 @@ ExtensionUpdater::FetchedCRXFile::FetchedCRXFile(
download_url(u),
request_ids(request_ids) {}
-ExtensionUpdater::FetchedCRXFile::FetchedCRXFile() : path(), download_url() {}
+ExtensionUpdater::FetchedCRXFile::FetchedCRXFile()
+ : extension_id(""),
+ path(),
+ download_url() {}
ExtensionUpdater::FetchedCRXFile::~FetchedCRXFile() {}
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index 3481c0c..4921d9e 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -432,7 +432,7 @@ static void ExtractParameters(const std::string& params,
if (!key_val.empty()) {
std::string key = key_val[0];
EXPECT_TRUE(result->find(key) == result->end());
- (*result)[key] = (key_val.size() == 2) ? key_val[1] : std::string();
+ (*result)[key] = (key_val.size() == 2) ? key_val[1] : "";
} else {
NOTREACHED();
}
@@ -637,8 +637,7 @@ class ExtensionUpdaterTest : public testing::Test {
// Make sure that an empty update URL data string does not cause a ap=
// option to appear in the x= parameter.
ManifestFetchData fetch_data(GURL("http://localhost/foo"), 0);
- fetch_data.AddExtension(
- id, version, &kNeverPingedData, std::string(), std::string());
+ fetch_data.AddExtension(id, version, &kNeverPingedData, "", "");
std::map<std::string, std::string> params;
VerifyQueryAndExtractParameters(fetch_data.full_url().query(), &params);
@@ -654,8 +653,7 @@ class ExtensionUpdaterTest : public testing::Test {
// Make sure that an update URL data string causes an appropriate ap=
// option to appear in the x= parameter.
ManifestFetchData fetch_data(GURL("http://localhost/foo"), 0);
- fetch_data.AddExtension(
- id, version, &kNeverPingedData, "bar", std::string());
+ fetch_data.AddExtension(id, version, &kNeverPingedData, "bar", "");
std::map<std::string, std::string> params;
VerifyQueryAndExtractParameters(fetch_data.full_url().query(), &params);
EXPECT_EQ(id, params["id"]);
@@ -670,8 +668,7 @@ class ExtensionUpdaterTest : public testing::Test {
// Make sure that an update URL data string causes an appropriate ap=
// option to appear in the x= parameter.
ManifestFetchData fetch_data(GURL("http://localhost/foo"), 0);
- fetch_data.AddExtension(
- id, version, &kNeverPingedData, "a=1&b=2&c", std::string());
+ fetch_data.AddExtension(id, version, &kNeverPingedData, "a=1&b=2&c", "");
std::map<std::string, std::string> params;
VerifyQueryAndExtractParameters(fetch_data.full_url().query(), &params);
EXPECT_EQ(id, params["id"]);
@@ -741,12 +738,14 @@ class ExtensionUpdaterTest : public testing::Test {
// installed and available at v2.0).
const std::string id1 = id_util::GenerateId("1");
const std::string id2 = id_util::GenerateId("2");
- fetch_data.AddExtension(
- id1, "1.0.0.0", &kNeverPingedData, kEmptyUpdateUrlData, std::string());
- AddParseResult(id1, "1.1", "http://localhost/e1_1.1.crx", &updates);
- fetch_data.AddExtension(
- id2, "2.0.0.0", &kNeverPingedData, kEmptyUpdateUrlData, std::string());
- AddParseResult(id2, "2.0.0.0", "http://localhost/e2_2.0.crx", &updates);
+ fetch_data.AddExtension(id1, "1.0.0.0",
+ &kNeverPingedData, kEmptyUpdateUrlData, "");
+ AddParseResult(id1, "1.1",
+ "http://localhost/e1_1.1.crx", &updates);
+ fetch_data.AddExtension(id2, "2.0.0.0",
+ &kNeverPingedData, kEmptyUpdateUrlData, "");
+ AddParseResult(id2, "2.0.0.0",
+ "http://localhost/e2_2.0.crx", &updates);
EXPECT_CALL(delegate, IsExtensionPending(_)).WillRepeatedly(Return(false));
EXPECT_CALL(delegate, GetExtensionExistingVersion(id1, _))
@@ -783,11 +782,8 @@ class ExtensionUpdaterTest : public testing::Test {
std::list<std::string>::const_iterator it;
for (it = ids_for_update_check.begin();
it != ids_for_update_check.end(); ++it) {
- fetch_data.AddExtension(*it,
- "1.0.0.0",
- &kNeverPingedData,
- kEmptyUpdateUrlData,
- std::string());
+ fetch_data.AddExtension(*it, "1.0.0.0",
+ &kNeverPingedData, kEmptyUpdateUrlData, "");
AddParseResult(*it, "1.1", "http://localhost/e1_1.1.crx", &updates);
}
@@ -820,14 +816,10 @@ class ExtensionUpdaterTest : public testing::Test {
scoped_ptr<ManifestFetchData> fetch3(new ManifestFetchData(kUpdateUrl, 0));
scoped_ptr<ManifestFetchData> fetch4(new ManifestFetchData(kUpdateUrl, 0));
ManifestFetchData::PingData zeroDays(0, 0, true);
- fetch1->AddExtension(
- "1111", "1.0", &zeroDays, kEmptyUpdateUrlData, std::string());
- fetch2->AddExtension(
- "2222", "2.0", &zeroDays, kEmptyUpdateUrlData, std::string());
- fetch3->AddExtension(
- "3333", "3.0", &zeroDays, kEmptyUpdateUrlData, std::string());
- fetch4->AddExtension(
- "4444", "4.0", &zeroDays, kEmptyUpdateUrlData, std::string());
+ fetch1->AddExtension("1111", "1.0", &zeroDays, kEmptyUpdateUrlData, "");
+ fetch2->AddExtension("2222", "2.0", &zeroDays, kEmptyUpdateUrlData, "");
+ fetch3->AddExtension("3333", "3.0", &zeroDays, kEmptyUpdateUrlData, "");
+ fetch4->AddExtension("4444", "4.0", &zeroDays, kEmptyUpdateUrlData, "");
// This will start the first fetcher and queue the others. The next in queue
// is started as each fetcher receives its response.
@@ -935,8 +927,7 @@ class ExtensionUpdaterTest : public testing::Test {
scoped_ptr<ManifestFetchData> fetch(new ManifestFetchData(kUpdateUrl, 0));
ManifestFetchData::PingData zeroDays(0, 0, true);
- fetch->AddExtension(
- "1111", "1.0", &zeroDays, kEmptyUpdateUrlData, std::string());
+ fetch->AddExtension("1111", "1.0", &zeroDays, kEmptyUpdateUrlData, "");
// This will start the first fetcher.
downloader.StartUpdateCheck(fetch.Pass());
@@ -963,8 +954,7 @@ class ExtensionUpdaterTest : public testing::Test {
// For response codes that are not in the 5xx range ExtensionDownloader
// should not retry.
fetch.reset(new ManifestFetchData(kUpdateUrl, 0));
- fetch->AddExtension(
- "1111", "1.0", &zeroDays, kEmptyUpdateUrlData, std::string());
+ fetch->AddExtension("1111", "1.0", &zeroDays, kEmptyUpdateUrlData, "");
// This will start the first fetcher.
downloader.StartUpdateCheck(fetch.Pass());
@@ -1016,7 +1006,7 @@ class ExtensionUpdaterTest : public testing::Test {
GURL test_url("http://localhost/extension.crx");
std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
- std::string hash;
+ std::string hash = "";
Version version("0.0.1");
std::set<int> requests;
requests.insert(0);
@@ -1152,8 +1142,8 @@ class ExtensionUpdaterTest : public testing::Test {
std::string id1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
std::string id2 = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
- std::string hash1;
- std::string hash2;
+ std::string hash1 = "";
+ std::string hash2 = "";
std::string version1 = "0.1";
std::string version2 = "0.1";
@@ -1367,7 +1357,7 @@ class ExtensionUpdaterTest : public testing::Test {
fetcher->set_url(fetched_urls[0]);
fetcher->set_status(net::URLRequestStatus());
fetcher->set_response_code(500);
- fetcher->SetResponseString(std::string());
+ fetcher->SetResponseString("");
fetcher->delegate()->OnURLFetchComplete(fetcher);
fetcher = factory.GetFetcherByID(ExtensionDownloader::kManifestFetcherId);
@@ -1452,11 +1442,8 @@ class ExtensionUpdaterTest : public testing::Test {
ManifestFetchData fetch_data(update_url, 0);
const Extension* extension = tmp[0];
- fetch_data.AddExtension(extension->id(),
- extension->VersionString(),
- &kNeverPingedData,
- kEmptyUpdateUrlData,
- std::string());
+ fetch_data.AddExtension(extension->id(), extension->VersionString(),
+ &kNeverPingedData, kEmptyUpdateUrlData, "");
UpdateManifest::Results results;
results.daystart_elapsed_seconds = 750;
@@ -1660,7 +1647,7 @@ TEST_F(ExtensionUpdaterTest, TestManifestFetchesBuilderAddExtension) {
EXPECT_EQ(1u, ManifestFetchersCount(downloader.get()));
// Extensions with empty IDs should be rejected.
- EXPECT_FALSE(downloader->AddPendingExtension(std::string(), GURL(), 0));
+ EXPECT_FALSE(downloader->AddPendingExtension("", GURL(), 0));
downloader->StartAllPending();
EXPECT_EQ(1u, ManifestFetchersCount(downloader.get()));
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index 09b7f8e..81db7ed 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -125,8 +125,7 @@ void GetDownloadFilePath(
base::FilePath file =
directory.AppendASCII(id + "_" + random_number + ".crx");
- int uniquifier =
- file_util::GetUniquePathNumber(file, base::FilePath::StringType());
+ int uniquifier = file_util::GetUniquePathNumber(file, FILE_PATH_LITERAL(""));
if (uniquifier > 0) {
file = file.InsertBeforeExtensionASCII(
base::StringPrintf(" (%d)", uniquifier));
diff --git a/chrome/browser/extensions/webstore_standalone_installer.cc b/chrome/browser/extensions/webstore_standalone_installer.cc
index 7df550f..cadce50 100644
--- a/chrome/browser/extensions/webstore_standalone_installer.cc
+++ b/chrome/browser/extensions/webstore_standalone_installer.cc
@@ -80,7 +80,7 @@ void WebstoreStandaloneInstaller::OnWebstoreRequestFailure() {
void WebstoreStandaloneInstaller::OnWebstoreResponseParseSuccess(
DictionaryValue* webstore_data) {
if (!CheckRequestorAlive()) {
- CompleteInstall(std::string());
+ CompleteInstall("");
return;
}
@@ -141,13 +141,13 @@ void WebstoreStandaloneInstaller::OnWebstoreResponseParseSuccess(
// Assume ownership of webstore_data.
webstore_data_.reset(webstore_data);
- scoped_refptr<WebstoreInstallHelper> helper =
- new WebstoreInstallHelper(this,
- id_,
- manifest,
- std::string(), // We don't have any icon data.
- icon_url,
- profile_->GetRequestContext());
+ scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper(
+ this,
+ id_,
+ manifest,
+ "", // We don't have any icon data.
+ icon_url,
+ profile_->GetRequestContext());
// The helper will call us back via OnWebstoreParseSucces or
// OnWebstoreParseFailure.
helper->Start();
@@ -165,7 +165,7 @@ void WebstoreStandaloneInstaller::OnWebstoreParseSuccess(
CHECK_EQ(id_, id);
if (!CheckRequestorAlive()) {
- CompleteInstall(std::string());
+ CompleteInstall("");
return;
}
@@ -190,7 +190,7 @@ void WebstoreStandaloneInstaller::OnWebstoreParseFailure(
void WebstoreStandaloneInstaller::InstallUIProceed() {
if (!CheckRequestorAlive()) {
- CompleteInstall(std::string());
+ CompleteInstall("");
return;
}
@@ -219,7 +219,7 @@ void WebstoreStandaloneInstaller::InstallUIAbort(bool user_initiated) {
void WebstoreStandaloneInstaller::OnExtensionInstallSuccess(
const std::string& id) {
CHECK_EQ(id_, id);
- CompleteInstall(std::string());
+ CompleteInstall("");
}
void WebstoreStandaloneInstaller::OnExtensionInstallFailure(
diff --git a/chrome/browser/feedback/feedback_util.cc b/chrome/browser/feedback/feedback_util.cc
index f892a87..7133c60 100644
--- a/chrome/browser/feedback/feedback_util.cc
+++ b/chrome/browser/feedback/feedback_util.cc
@@ -283,7 +283,7 @@ void FeedbackUtil::SendReport(scoped_refptr<FeedbackData> data) {
// CHROMEOS_RELEASE_VERSION from /etc/lsb-release
#if !defined(OS_CHROMEOS)
// Add OS version (eg, for WinXP SP2: "5.1.2600 Service Pack 2").
- std::string os_version;
+ std::string os_version = "";
SetOSVersion(&os_version);
AddFeedbackData(&feedback_data, std::string(kOsVersionTag), os_version);
#endif
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc
index 48cf490..15e4a05 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -423,10 +423,9 @@ void FileSelectHelper::RunFileChooserOnUIThread(
params.title,
default_file_name,
select_file_types_.get(),
- select_file_types_.get() && !select_file_types_->extensions.empty()
- ? 1
- : 0, // 1-based index of default extension to show.
- base::FilePath::StringType(),
+ select_file_types_.get() && !select_file_types_->extensions.empty() ?
+ 1 : 0, // 1-based index of default extension to show.
+ FILE_PATH_LITERAL(""),
owning_window,
#if defined(OS_ANDROID)
&accept_types);
diff --git a/chrome/browser/google/google_util.cc b/chrome/browser/google/google_util.cc
index 50900bd..d66a585 100644
--- a/chrome/browser/google/google_util.cc
+++ b/chrome/browser/google/google_util.cc
@@ -32,7 +32,7 @@
#endif
#ifndef LINKDOCTOR_SERVER_REQUEST_URL
-#define LINKDOCTOR_SERVER_REQUEST_URL std::string()
+#define LINKDOCTOR_SERVER_REQUEST_URL ""
#endif
namespace {
diff --git a/chrome/browser/google/google_util_unittest.cc b/chrome/browser/google/google_util_unittest.cc
index 75b7067..cf4c610 100644
--- a/chrome/browser/google/google_util_unittest.cc
+++ b/chrome/browser/google/google_util_unittest.cc
@@ -53,7 +53,7 @@ TEST(GoogleUtilTest, GoodHomePagesSecure) {
}
TEST(GoogleUtilTest, BadHomePages) {
- EXPECT_FALSE(IsGoogleHomePageUrl(std::string()));
+ EXPECT_FALSE(IsGoogleHomePageUrl(""));
// If specified, only the "www" subdomain is OK.
EXPECT_FALSE(IsGoogleHomePageUrl("http://maps.google.com"));
@@ -237,7 +237,7 @@ TEST(GoogleUtilTest, BadSearches) {
"http://www.google.com/search/nogood?q=something"));
EXPECT_FALSE(IsGoogleSearchUrl(
"http://www.google.com/webhp/nogood#q=something"));
- EXPECT_FALSE(IsGoogleSearchUrl(std::string()));
+ EXPECT_FALSE(IsGoogleSearchUrl(""));
// Case sensitive paths.
EXPECT_FALSE(IsGoogleSearchUrl(
diff --git a/chrome/browser/google_apis/base_operations.cc b/chrome/browser/google_apis/base_operations.cc
index 6692a8a..c6f425c 100644
--- a/chrome/browser/google_apis/base_operations.cc
+++ b/chrome/browser/google_apis/base_operations.cc
@@ -186,7 +186,7 @@ void UrlFetchOperationBase::Start(const std::string& access_token,
request_type == URLFetcher::PATCH) {
// Set empty upload content-type and upload content, so that
// the request will have no "Content-type: " header and no content.
- url_fetcher_->SetUploadData(std::string(), std::string());
+ url_fetcher_->SetUploadData("", "");
}
}
diff --git a/chrome/browser/google_apis/base_operations_unittest.cc b/chrome/browser/google_apis/base_operations_unittest.cc
index 047e5c2..2f7e01a 100644
--- a/chrome/browser/google_apis/base_operations_unittest.cc
+++ b/chrome/browser/google_apis/base_operations_unittest.cc
@@ -66,9 +66,9 @@ class BaseOperationsTest : public testing::Test {
virtual void SetUp() OVERRIDE {
profile_.reset(new TestingProfile);
runner_.reset(new OperationRunner(profile_.get(),
- NULL /* url_request_context_getter */,
- std::vector<std::string>() /* scopes */,
- std::string() /* custom user agent */));
+ NULL /* url_request_context_getter */,
+ std::vector<std::string>() /* scopes */,
+ "" /* custom user agent */));
runner_->Initialize();
LOG(ERROR) << "Initialized.";
}
diff --git a/chrome/browser/google_apis/drive_api_operations.cc b/chrome/browser/google_apis/drive_api_operations.cc
index 1206743..7bab455 100644
--- a/chrome/browser/google_apis/drive_api_operations.cc
+++ b/chrome/browser/google_apis/drive_api_operations.cc
@@ -200,7 +200,7 @@ GURL CreateDirectoryOperation::GetURL() const {
if (parent_resource_id_.empty() || directory_name_.empty()) {
return GURL();
}
- return url_generator_.GetFilelistUrl(GURL(), std::string());
+ return url_generator_.GetFilelistUrl(GURL(), "");
}
net::URLFetcher::RequestType CreateDirectoryOperation::GetRequestType() const {
diff --git a/chrome/browser/google_apis/drive_api_operations_unittest.cc b/chrome/browser/google_apis/drive_api_operations_unittest.cc
index b6a0f61..36c2c89 100644
--- a/chrome/browser/google_apis/drive_api_operations_unittest.cc
+++ b/chrome/browser/google_apis/drive_api_operations_unittest.cc
@@ -867,7 +867,7 @@ TEST_F(DriveApiOperationsTest, UploadExistingFileOperation) {
kTestContentType,
kTestContent.size(),
"resource_id", // The resource id of the file to be overwritten.
- std::string(), // No etag.
+ "", // No etag.
CreateComposedCallback(
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&error, &upload_url)));
diff --git a/chrome/browser/google_apis/drive_api_url_generator_unittest.cc b/chrome/browser/google_apis/drive_api_url_generator_unittest.cc
index bcb6c6d..818fb2d 100644
--- a/chrome/browser/google_apis/drive_api_url_generator_unittest.cc
+++ b/chrome/browser/google_apis/drive_api_url_generator_unittest.cc
@@ -69,7 +69,7 @@ TEST_F(DriveApiUrlGeneratorTest, GetFilelistUrl) {
// Use default URL, if |override_url| is empty.
// Do not add q parameter if |search_string| is empty.
EXPECT_EQ("https://www.googleapis.com/drive/v2/files",
- url_generator_.GetFilelistUrl(GURL(), std::string()).spec());
+ url_generator_.GetFilelistUrl(GURL(), "").spec());
// Set q parameter if non-empty |search_string| is given.
EXPECT_EQ("https://www.googleapis.com/drive/v2/files?q=query",
@@ -77,10 +77,9 @@ TEST_F(DriveApiUrlGeneratorTest, GetFilelistUrl) {
// Use the |override_url| for the base URL if given.
// The behavior for the |search_string| should be as same as above cases.
- EXPECT_EQ(
- "https://localhost/drive/v2/files",
- url_generator_.GetFilelistUrl(GURL("https://localhost/drive/v2/files"),
- std::string()).spec());
+ EXPECT_EQ("https://localhost/drive/v2/files",
+ url_generator_.GetFilelistUrl(
+ GURL("https://localhost/drive/v2/files"), "").spec());
EXPECT_EQ("https://localhost/drive/v2/files?q=query",
url_generator_.GetFilelistUrl(
GURL("https://localhost/drive/v2/files"), "query").spec());
diff --git a/chrome/browser/google_apis/drive_uploader_unittest.cc b/chrome/browser/google_apis/drive_uploader_unittest.cc
index f522a87..5f3bb62 100644
--- a/chrome/browser/google_apis/drive_uploader_unittest.cc
+++ b/chrome/browser/google_apis/drive_uploader_unittest.cc
@@ -298,7 +298,7 @@ TEST_F(DriveUploaderTest, UploadExisting0KB) {
base::FilePath::FromUTF8Unsafe(kTestDrivePath),
local_path,
kTestMimeType,
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(
&error, &drive_path, &file_path, &resource_entry));
test_util::RunBlockingPoolTask();
@@ -330,7 +330,7 @@ TEST_F(DriveUploaderTest, UploadExisting512KB) {
base::FilePath::FromUTF8Unsafe(kTestDrivePath),
local_path,
kTestMimeType,
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(
&error, &drive_path, &file_path, &resource_entry));
test_util::RunBlockingPoolTask();
@@ -363,7 +363,7 @@ TEST_F(DriveUploaderTest, UploadExisting1234KB) {
base::FilePath::FromUTF8Unsafe(kTestDrivePath),
local_path,
kTestMimeType,
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(
&error, &drive_path, &file_path, &resource_entry));
test_util::RunBlockingPoolTask();
@@ -429,7 +429,7 @@ TEST_F(DriveUploaderTest, InitiateUploadFail) {
base::FilePath::FromUTF8Unsafe(kTestDrivePath),
local_path,
kTestMimeType,
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(
&error, &drive_path, &file_path, &resource_entry));
test_util::RunBlockingPoolTask();
@@ -508,7 +508,7 @@ TEST_F(DriveUploaderTest, ResumeUploadFail) {
base::FilePath::FromUTF8Unsafe(kTestDrivePath),
local_path,
kTestMimeType,
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(
&error, &drive_path, &file_path, &resource_entry));
test_util::RunBlockingPoolTask();
@@ -528,7 +528,7 @@ TEST_F(DriveUploaderTest, NonExistingSourceFile) {
base::FilePath::FromUTF8Unsafe(kTestDrivePath),
temp_dir_.path().AppendASCII("_this_path_should_not_exist_"),
kTestMimeType,
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(
&error, &drive_path, &file_path, &resource_entry));
test_util::RunBlockingPoolTask();
diff --git a/chrome/browser/google_apis/fake_drive_service.cc b/chrome/browser/google_apis/fake_drive_service.cc
index d5cb4ad..d91aced 100644
--- a/chrome/browser/google_apis/fake_drive_service.cc
+++ b/chrome/browser/google_apis/fake_drive_service.cc
@@ -340,10 +340,10 @@ void FakeDriveService::GetAllResourceList(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
- GetResourceList(GURL(), // no next feed
- 0, // start changestamp
- std::string(), // empty search query
- std::string(), // no directory resource id,
+ GetResourceList(GURL(), // no next feed
+ 0, // start changestamp
+ "", // empty search query
+ "", // no directory resource id,
callback);
}
@@ -354,9 +354,9 @@ void FakeDriveService::GetResourceListInDirectory(
DCHECK(!directory_resource_id.empty());
DCHECK(!callback.is_null());
- GetResourceList(GURL(), // no next feed
- 0, // start changestamp
- std::string(), // empty search query
+ GetResourceList(GURL(), // no next feed
+ 0, // start changestamp
+ "", // empty search query
directory_resource_id,
callback);
}
@@ -367,10 +367,10 @@ void FakeDriveService::Search(const std::string& search_query,
DCHECK(!search_query.empty());
DCHECK(!callback.is_null());
- GetResourceList(GURL(), // no next feed
- 0, // start changestamp
+ GetResourceList(GURL(), // no next feed
+ 0, // start changestamp
search_query,
- std::string(), // no directory resource id,
+ "", // no directory resource id,
callback);
}
@@ -395,10 +395,10 @@ void FakeDriveService::GetChangeList(int64 start_changestamp,
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
- GetResourceList(GURL(), // no next feed
+ GetResourceList(GURL(), // no next feed
start_changestamp,
- std::string(), // empty search query
- std::string(), // no directory resource id,
+ "", // empty search query
+ "", // no directory resource id,
callback);
}
diff --git a/chrome/browser/google_apis/fake_drive_service_unittest.cc b/chrome/browser/google_apis/fake_drive_service_unittest.cc
index 2f94ba5..e89ed15 100644
--- a/chrome/browser/google_apis/fake_drive_service_unittest.cc
+++ b/chrome/browser/google_apis/fake_drive_service_unittest.cc
@@ -96,9 +96,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_All) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL(),
- 0, // start_changestamp
- std::string(), // search_query
- std::string(), // directory_resource_id
+ 0, // start_changestamp
+ "", // search_query
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -117,9 +117,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_WithStartIndex) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL("http://dummyurl/?start-offset=2"),
- 0, // start_changestamp
- std::string(), // search_query
- std::string(), // directory_resource_id
+ 0, // start_changestamp
+ "", // search_query
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -139,9 +139,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_WithStartIndexAndMaxResults) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL("http://localhost/?start-offset=2&max-results=5"),
- 0, // start_changestamp
- std::string(), // search_query
- std::string(), // directory_resource_id
+ 0, // start_changestamp
+ "", // search_query
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -168,9 +168,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_WithDefaultMaxResultsChanged) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL(),
- 0, // start_changestamp
- std::string(), // search_query
- std::string(), // directory_resource_id
+ 0, // start_changestamp
+ "", // search_query
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -196,8 +196,8 @@ TEST_F(FakeDriveServiceTest, GetResourceList_InRootDirectory) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL(),
- 0, // start_changestamp
- std::string(), // search_query
+ 0, // start_changestamp
+ "", // search_query
fake_service_.GetRootResourceId(), // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -217,9 +217,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_Search) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL(),
- 0, // start_changestamp
- "File", // search_query
- std::string(), // directory_resource_id
+ 0, // start_changestamp
+ "File", // search_query
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -239,9 +239,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_SearchWithAttribute) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL(),
- 0, // start_changestamp
+ 0, // start_changestamp
"title:1.txt", // search_query
- std::string(), // directory_resource_id
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -261,9 +261,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_SearchMultipleQueries) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL(),
- 0, // start_changestamp
+ 0, // start_changestamp
"Directory 1", // search_query
- std::string(), // directory_resource_id
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -274,9 +274,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_SearchMultipleQueries) {
fake_service_.GetResourceList(
GURL(),
- 0, // start_changestamp
+ 0, // start_changestamp
"\"Directory 1\"", // search_query
- std::string(), // directory_resource_id
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -299,9 +299,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_NoNewEntries) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL(),
- 654321 + 1, // start_changestamp
- std::string(), // search_query
- std::string(), // directory_resource_id
+ 654321 + 1, // start_changestamp
+ "", // search_query
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -331,9 +331,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_WithNewEntry) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL(),
- 654321 + 1, // start_changestamp
- std::string(), // search_query
- std::string(), // directory_resource_id
+ 654321 + 1, // start_changestamp
+ "", // search_query
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -354,9 +354,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_Offline) {
scoped_ptr<ResourceList> resource_list;
fake_service_.GetResourceList(
GURL(),
- 0, // start_changestamp
- std::string(), // search_query
- std::string(), // directory_resource_id
+ 0, // start_changestamp
+ "", // search_query
+ "", // directory_resource_id
test_util::CreateCopyResultCallback(&error, &resource_list));
message_loop_.RunUntilIdle();
@@ -845,7 +845,7 @@ TEST_F(FakeDriveServiceTest, DeleteResource_ExistingFile) {
GDataErrorCode error = GDATA_OTHER_ERROR;
fake_service_.DeleteResource("file:2_file_resource_id",
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(&error));
message_loop_.RunUntilIdle();
@@ -860,7 +860,7 @@ TEST_F(FakeDriveServiceTest, DeleteResource_NonexistingFile) {
GDataErrorCode error = GDATA_OTHER_ERROR;
fake_service_.DeleteResource("file:nonexisting_resource_id",
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(&error));
message_loop_.RunUntilIdle();
@@ -874,7 +874,7 @@ TEST_F(FakeDriveServiceTest, DeleteResource_Offline) {
GDataErrorCode error = GDATA_OTHER_ERROR;
fake_service_.DeleteResource("file:2_file_resource_id",
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(&error));
message_loop_.RunUntilIdle();
@@ -1506,7 +1506,7 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_Offline) {
"test/foo",
13,
"file:2_file_resource_id",
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(&error, &upload_location));
message_loop_.RunUntilIdle();
@@ -1525,7 +1525,7 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_NotFound) {
"test/foo",
13,
"non_existent",
- std::string(), // etag
+ "", // etag
test_util::CreateCopyResultCallback(&error, &upload_location));
message_loop_.RunUntilIdle();
diff --git a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
index 7f2395d..1a15c62 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
+++ b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
@@ -325,10 +325,10 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_DefaultFeed) {
&operation_registry_,
request_context_getter_.get(),
*url_generator_,
- GURL(), // Pass an empty URL to use the default feed
- 0, // start changestamp
- std::string(), // search string
- std::string(), // directory resource ID
+ GURL(), // Pass an empty URL to use the default feed
+ 0, // start changestamp
+ "", // search string
+ "", // directory resource ID
CreateComposedCallback(
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&result_code, &result_data)));
@@ -360,9 +360,9 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_ValidFeed) {
request_context_getter_.get(),
*url_generator_,
test_server_.GetURL("/files/chromeos/gdata/root_feed.json"),
- 0, // start changestamp
- std::string(), // search string
- std::string(), // directory resource ID
+ 0, // start changestamp
+ "", // search string
+ "", // directory resource ID
CreateComposedCallback(
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&result_code, &result_data)));
@@ -395,9 +395,9 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_InvalidFeed) {
request_context_getter_.get(),
*url_generator_,
test_server_.GetURL("/files/chromeos/gdata/testfile.txt"),
- 0, // start changestamp
- std::string(), // search string
- std::string(), // directory resource ID
+ 0, // start changestamp
+ "", // search string
+ "", // directory resource ID
CreateComposedCallback(
base::Bind(&test_util::RunAndQuit),
test_util::CreateCopyResultCallback(&result_code, &result_data)));
@@ -548,10 +548,11 @@ TEST_F(GDataWapiOperationsTest, DeleteResourceOperation) {
&operation_registry_,
request_context_getter_.get(),
*url_generator_,
- CreateComposedCallback(base::Bind(&test_util::RunAndQuit),
- test_util::CreateCopyResultCallback(&result_code)),
+ CreateComposedCallback(
+ base::Bind(&test_util::RunAndQuit),
+ test_util::CreateCopyResultCallback(&result_code)),
"file:2_file_resource_id",
- std::string());
+ "");
operation->Start(kTestGDataAuthToken, kTestUserAgent,
base::Bind(&test_util::DoNothingForReAuthenticateCallback));
@@ -1134,7 +1135,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) {
// The test is almost identical to UploadNewFile. The only difference is the
// expectation for the Content-Range header.
TEST_F(GDataWapiOperationsTest, UploadNewEmptyFile) {
- const std::string kUploadContent;
+ const std::string kUploadContent = "";
GDataErrorCode result_code = GDATA_OTHER_ERROR;
GURL upload_url;
@@ -1243,7 +1244,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFile) {
"text/plain",
kUploadContent.size(),
"file:foo",
- std::string() /* etag */);
+ "" /* etag */);
initiate_operation->Start(
kTestGDataAuthToken, kTestUserAgent,
diff --git a/chrome/browser/google_apis/gdata_wapi_parser_unittest.cc b/chrome/browser/google_apis/gdata_wapi_parser_unittest.cc
index 1356cf6..f85d325 100644
--- a/chrome/browser/google_apis/gdata_wapi_parser_unittest.cc
+++ b/chrome/browser/google_apis/gdata_wapi_parser_unittest.cc
@@ -324,7 +324,7 @@ TEST(GDataWAPIParserTest, ResourceEntryHasDocumentExtension) {
EXPECT_FALSE(ResourceEntry::HasHostedDocumentExtension(
base::FilePath(FILE_PATH_LITERAL("Test"))));
EXPECT_FALSE(ResourceEntry::HasHostedDocumentExtension(
- base::FilePath()));
+ base::FilePath(FILE_PATH_LITERAL(""))));
}
TEST(GDataWAPIParserTest, ResourceEntryClassifyEntryKind) {
diff --git a/chrome/browser/google_apis/gdata_wapi_service.cc b/chrome/browser/google_apis/gdata_wapi_service.cc
index 2649049..47edcf6 100644
--- a/chrome/browser/google_apis/gdata_wapi_service.cc
+++ b/chrome/browser/google_apis/gdata_wapi_service.cc
@@ -199,14 +199,15 @@ void GDataWapiService::GetAllResourceList(
DCHECK(!callback.is_null());
runner_->StartOperationWithRetry(
- new GetResourceListOperation(operation_registry(),
- url_request_context_getter_,
- url_generator_,
- GURL(), // No override url
- 0, // start changestamp
- std::string(), // empty search query
- std::string(), // no directory resource id
- callback));
+ new GetResourceListOperation(
+ operation_registry(),
+ url_request_context_getter_,
+ url_generator_,
+ GURL(), // No override url
+ 0, // start changestamp
+ "", // empty search query
+ "", // no directory resource id
+ callback));
}
void GDataWapiService::GetResourceListInDirectory(
@@ -217,14 +218,15 @@ void GDataWapiService::GetResourceListInDirectory(
DCHECK(!callback.is_null());
runner_->StartOperationWithRetry(
- new GetResourceListOperation(operation_registry(),
- url_request_context_getter_,
- url_generator_,
- GURL(), // No override url
- 0, // start changestamp
- std::string(), // empty search query
- directory_resource_id,
- callback));
+ new GetResourceListOperation(
+ operation_registry(),
+ url_request_context_getter_,
+ url_generator_,
+ GURL(), // No override url
+ 0, // start changestamp
+ "", // empty search query
+ directory_resource_id,
+ callback));
}
void GDataWapiService::Search(const std::string& search_query,
@@ -234,14 +236,15 @@ void GDataWapiService::Search(const std::string& search_query,
DCHECK(!callback.is_null());
runner_->StartOperationWithRetry(
- new GetResourceListOperation(operation_registry(),
- url_request_context_getter_,
- url_generator_,
- GURL(), // No override url
- 0, // start changestamp
- search_query,
- std::string(), // no directory resource id
- callback));
+ new GetResourceListOperation(
+ operation_registry(),
+ url_request_context_getter_,
+ url_generator_,
+ GURL(), // No override url
+ 0, // start changestamp
+ search_query,
+ "", // no directory resource id
+ callback));
}
void GDataWapiService::SearchInDirectory(
@@ -271,14 +274,15 @@ void GDataWapiService::GetChangeList(int64 start_changestamp,
DCHECK(!callback.is_null());
runner_->StartOperationWithRetry(
- new GetResourceListOperation(operation_registry(),
- url_request_context_getter_,
- url_generator_,
- GURL(), // No override url
- start_changestamp,
- std::string(), // empty search query
- std::string(), // no directory resource id
- callback));
+ new GetResourceListOperation(
+ operation_registry(),
+ url_request_context_getter_,
+ url_generator_,
+ GURL(), // No override url
+ start_changestamp,
+ "", // empty search query
+ "", // no directory resource id
+ callback));
}
void GDataWapiService::ContinueGetResourceList(
@@ -289,14 +293,15 @@ void GDataWapiService::ContinueGetResourceList(
DCHECK(!callback.is_null());
runner_->StartOperationWithRetry(
- new GetResourceListOperation(operation_registry(),
- url_request_context_getter_,
- url_generator_,
- override_url,
- 0, // start changestamp
- std::string(), // empty search query
- std::string(), // no directory resource id
- callback));
+ new GetResourceListOperation(
+ operation_registry(),
+ url_request_context_getter_,
+ url_generator_,
+ override_url,
+ 0, // start changestamp
+ "", // empty search query
+ "", // no directory resource id
+ callback));
}
void GDataWapiService::GetResourceEntry(
diff --git a/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc b/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc
index de80699..571a661 100644
--- a/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc
+++ b/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc
@@ -32,29 +32,29 @@ TEST_F(GDataWapiUrlGeneratorTest, AddInitiateUploadUrlParams) {
}
TEST_F(GDataWapiUrlGeneratorTest, AddFeedUrlParams) {
- EXPECT_EQ(
- "http://www.example.com/?v=3&alt=json&showroot=true&"
- "showfolders=true"
- "&include-shared=true"
- "&max-results=100"
- "&include-installed-apps=true",
- GDataWapiUrlGenerator::AddFeedUrlParams(GURL("http://www.example.com"),
- 100, // num_items_to_fetch
- 0, // changestamp
- std::string() // search_string
- ).spec());
- EXPECT_EQ(
- "http://www.example.com/?v=3&alt=json&showroot=true&"
- "showfolders=true"
- "&include-shared=true"
- "&max-results=100"
- "&include-installed-apps=true"
- "&start-index=123",
- GDataWapiUrlGenerator::AddFeedUrlParams(GURL("http://www.example.com"),
- 100, // num_items_to_fetch
- 123, // changestamp
- std::string() // search_string
- ).spec());
+ EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true&"
+ "showfolders=true"
+ "&include-shared=true"
+ "&max-results=100"
+ "&include-installed-apps=true",
+ GDataWapiUrlGenerator::AddFeedUrlParams(
+ GURL("http://www.example.com"),
+ 100, // num_items_to_fetch
+ 0, // changestamp
+ "" // search_string
+ ).spec());
+ EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true&"
+ "showfolders=true"
+ "&include-shared=true"
+ "&max-results=100"
+ "&include-installed-apps=true"
+ "&start-index=123",
+ GDataWapiUrlGenerator::AddFeedUrlParams(
+ GURL("http://www.example.com"),
+ 100, // num_items_to_fetch
+ 123, // changestamp
+ "" // search_string
+ ).spec());
EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true&"
"showfolders=true"
"&include-shared=true"
@@ -72,52 +72,53 @@ TEST_F(GDataWapiUrlGeneratorTest, AddFeedUrlParams) {
TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) {
// This is the very basic URL for the GetResourceList operation.
- EXPECT_EQ("https://docs.google.com/feeds/default/private/full"
- "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
- "&max-results=500&include-installed-apps=true",
- url_generator_.GenerateResourceListUrl(
- GURL(), // override_url,
- 0, // start_changestamp,
- std::string(), // search_string,
- std::string() // directory resource ID
- ).spec());
+ EXPECT_EQ(
+ "https://docs.google.com/feeds/default/private/full"
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=500&include-installed-apps=true",
+ url_generator_.GenerateResourceListUrl(GURL(), // override_url,
+ 0, // start_changestamp,
+ "", // search_string,
+ "" // directory resource ID
+ ).spec());
// With an override URL provided, the base URL is changed, but the default
// parameters remain as-is.
- EXPECT_EQ("http://localhost/"
- "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
- "&max-results=500&include-installed-apps=true",
- url_generator_.GenerateResourceListUrl(
- GURL("http://localhost/"), // override_url,
- 0, // start_changestamp,
- std::string(), // search_string,
- std::string() // directory resource ID
- ).spec());
+ EXPECT_EQ(
+ "http://localhost/"
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=500&include-installed-apps=true",
+ url_generator_.GenerateResourceListUrl(
+ GURL("http://localhost/"), // override_url,
+ 0, // start_changestamp,
+ "", // search_string,
+ "" // directory resource ID
+ ).spec());
// With a non-zero start_changestamp provided, the base URL is changed from
// "full" to "changes", and "start-index" parameter is added.
- EXPECT_EQ("https://docs.google.com/feeds/default/private/changes"
- "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
- "&max-results=500&include-installed-apps=true"
- "&start-index=100",
- url_generator_.GenerateResourceListUrl(
- GURL(), // override_url,
- 100, // start_changestamp,
- std::string(), // search_string,
- std::string() // directory resource ID
- ).spec());
+ EXPECT_EQ(
+ "https://docs.google.com/feeds/default/private/changes"
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=500&include-installed-apps=true"
+ "&start-index=100",
+ url_generator_.GenerateResourceListUrl(GURL(), // override_url,
+ 100, // start_changestamp,
+ "", // search_string,
+ "" // directory resource ID
+ ).spec());
// With a non-empty search string provided, "max-results" value is changed,
// and "q" parameter is added.
- EXPECT_EQ("https://docs.google.com/feeds/default/private/full"
- "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
- "&max-results=50&include-installed-apps=true&q=foo",
- url_generator_.GenerateResourceListUrl(
- GURL(), // override_url,
- 0, // start_changestamp,
- "foo", // search_string,
- std::string() // directory resource ID
- ).spec());
+ EXPECT_EQ(
+ "https://docs.google.com/feeds/default/private/full"
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=50&include-installed-apps=true&q=foo",
+ url_generator_.GenerateResourceListUrl(GURL(), // override_url,
+ 0, // start_changestamp,
+ "foo", // search_string,
+ "" // directory resource ID
+ ).spec());
// With a non-empty directory resource ID provided, the base URL is
// changed, but the default parameters remain.
@@ -126,23 +127,24 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) {
"?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
"&max-results=500&include-installed-apps=true",
url_generator_.GenerateResourceListUrl(GURL(), // override_url,
- 0, // start_changestamp,
- std::string(), // search_string,
+ 0, // start_changestamp,
+ "", // search_string,
"XXX" // directory resource ID
).spec());
// With a non-empty override_url provided, the base URL is changed, but
// the default parameters remain. Note that start-index should not be
// overridden.
- EXPECT_EQ("http://example.com/"
- "?start-index=123&v=3&alt=json&showroot=true&showfolders=true"
- "&include-shared=true&max-results=500&include-installed-apps=true",
- url_generator_.GenerateResourceListUrl(
- GURL("http://example.com/?start-index=123"), // override_url,
- 100, // start_changestamp,
- std::string(), // search_string,
- "XXX" // directory resource ID
- ).spec());
+ EXPECT_EQ(
+ "http://example.com/"
+ "?start-index=123&v=3&alt=json&showroot=true&showfolders=true"
+ "&include-shared=true&max-results=500&include-installed-apps=true",
+ url_generator_.GenerateResourceListUrl(
+ GURL("http://example.com/?start-index=123"), // override_url,
+ 100, // start_changestamp,
+ "", // search_string,
+ "XXX" // directory resource ID
+ ).spec());
}
TEST_F(GDataWapiUrlGeneratorTest, GenerateEditUrl) {
diff --git a/chrome/browser/google_apis/operation_util_unittest.cc b/chrome/browser/google_apis/operation_util_unittest.cc
index 14e4c5dd..8a8ffe4 100644
--- a/chrome/browser/google_apis/operation_util_unittest.cc
+++ b/chrome/browser/google_apis/operation_util_unittest.cc
@@ -11,7 +11,7 @@ namespace util {
TEST(GenerateIfMatchHeaderTest, GenerateIfMatchHeader) {
// The header matched to all etag should be returned for empty etag.
- EXPECT_EQ("If-Match: *", GenerateIfMatchHeader(std::string()));
+ EXPECT_EQ("If-Match: *", GenerateIfMatchHeader(""));
// Otherwise, the returned header should be matched to the given etag.
EXPECT_EQ("If-Match: abcde", GenerateIfMatchHeader("abcde"));
diff --git a/chrome/browser/google_apis/test_server/http_server_unittest.cc b/chrome/browser/google_apis/test_server/http_server_unittest.cc
index d837baf..e242098 100644
--- a/chrome/browser/google_apis/test_server/http_server_unittest.cc
+++ b/chrome/browser/google_apis/test_server/http_server_unittest.cc
@@ -38,7 +38,7 @@ std::string GetContentTypeFromFetcher(const net::URLFetcher& fetcher) {
if (headers->GetMimeType(&content_type))
return content_type;
}
- return std::string();
+ return "";
}
} // namespace
diff --git a/chrome/browser/history/history_querying_unittest.cc b/chrome/browser/history/history_querying_unittest.cc
index ed138e8..c1355dd 100644
--- a/chrome/browser/history/history_querying_unittest.cc
+++ b/chrome/browser/history/history_querying_unittest.cc
@@ -468,7 +468,7 @@ TEST_F(HistoryQueryTest, Paging) {
// Since results are fetched 1 and 2 at a time, entry #0 and #6 will not
// be de-duplicated.
int expected_results[] = { 4, 2, 3, 1, 7, 6, 5, 0 };
- TestPaging(std::string(), expected_results, arraysize(expected_results));
+ TestPaging("", expected_results, arraysize(expected_results));
}
TEST_F(HistoryQueryTest, FTSPaging) {
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc
index 5438b97..a984557 100644
--- a/chrome/browser/history/history_tab_helper.cc
+++ b/chrome/browser/history/history_tab_helper.cc
@@ -53,8 +53,7 @@ void HistoryTabHelper::UpdateHistoryForNavigation(
void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) {
HistoryService* hs = GetHistoryService();
if (hs)
- hs->SetPageTitle(entry.GetVirtualURL(),
- entry.GetTitleForDisplay(std::string()));
+ hs->SetPageTitle(entry.GetVirtualURL(), entry.GetTitleForDisplay(""));
}
history::HistoryAddPageArgs
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index c988e55..e465a80 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -164,19 +164,20 @@ class HistoryBackendDBTest : public HistoryUnitTestBase {
std::vector<GURL> url_chain;
url_chain.push_back(GURL("foo-url"));
- DownloadRow download(base::FilePath(FILE_PATH_LITERAL("foo-path")),
- base::FilePath(FILE_PATH_LITERAL("foo-path")),
- url_chain,
- GURL(std::string()),
- time,
- time,
- 0,
- 512,
- state,
- content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
- content::DOWNLOAD_INTERRUPT_REASON_NONE,
- 0,
- 0);
+ DownloadRow download(
+ base::FilePath(FILE_PATH_LITERAL("foo-path")),
+ base::FilePath(FILE_PATH_LITERAL("foo-path")),
+ url_chain,
+ GURL(""),
+ time,
+ time,
+ 0,
+ 512,
+ state,
+ content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
+ content::DOWNLOAD_INTERRUPT_REASON_NONE,
+ 0,
+ 0);
return db_->CreateDownload(download);
}
@@ -316,7 +317,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadsReasonPathsAndDangerType) {
int64 db_handle = 0;
// Null path.
s.BindInt64(0, ++db_handle);
- s.BindString(1, std::string());
+ s.BindString(1, "");
s.BindString(2, "http://whatever.com/index.html");
s.BindInt64(3, now.ToTimeT());
s.BindInt64(4, 100);
@@ -463,19 +464,20 @@ TEST_F(HistoryBackendDBTest, DownloadNukeRecordsMissingURLs) {
CreateBackendAndDatabase();
base::Time now(base::Time::Now());
std::vector<GURL> url_chain;
- DownloadRow download(base::FilePath(FILE_PATH_LITERAL("foo-path")),
- base::FilePath(FILE_PATH_LITERAL("foo-path")),
- url_chain,
- GURL(std::string()),
- now,
- now,
- 0,
- 512,
- DownloadItem::COMPLETE,
- content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
- content::DOWNLOAD_INTERRUPT_REASON_NONE,
- 0,
- 0);
+ DownloadRow download(
+ base::FilePath(FILE_PATH_LITERAL("foo-path")),
+ base::FilePath(FILE_PATH_LITERAL("foo-path")),
+ url_chain,
+ GURL(""),
+ now,
+ now,
+ 0,
+ 512,
+ DownloadItem::COMPLETE,
+ content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
+ content::DOWNLOAD_INTERRUPT_REASON_NONE,
+ 0,
+ 0);
// Creating records without any urls should fail.
EXPECT_EQ(DownloadDatabase::kUninitializedHandle,
diff --git a/chrome/browser/history/thumbnail_database_unittest.cc b/chrome/browser/history/thumbnail_database_unittest.cc
index de3bd33..fc92feb 100644
--- a/chrome/browser/history/thumbnail_database_unittest.cc
+++ b/chrome/browser/history/thumbnail_database_unittest.cc
@@ -414,7 +414,7 @@ TEST_F(ThumbnailDatabaseTest, UpgradeToVersion6) {
EXPECT_EQ(url, GURL(statement.ColumnString(1)));
EXPECT_EQ(TOUCH_ICON, statement.ColumnInt(2));
// Any previous data in sizes should be cleared.
- EXPECT_EQ(std::string(), statement.ColumnString(3));
+ EXPECT_EQ(std::string(""), statement.ColumnString(3));
statement.Assign(db.db_.GetCachedStatement(SQL_FROM_HERE,
"SELECT icon_id, last_updated, image_data, width, height "
@@ -854,7 +854,7 @@ TEST_F(ThumbnailDatabaseTest, FaviconSizesToAndFromString) {
// Valid input.
FaviconSizes sizes_empty;
- ThumbnailDatabase::DatabaseStringToFaviconSizes(std::string(), &sizes_empty);
+ ThumbnailDatabase::DatabaseStringToFaviconSizes("", &sizes_empty);
EXPECT_EQ(0u, sizes_empty.size());
FaviconSizes sizes_valid;
diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc
index 8ffe8f2..0535cf6 100644
--- a/chrome/browser/importer/firefox_importer_utils.cc
+++ b/chrome/browser/importer/firefox_importer_utils.cc
@@ -255,12 +255,12 @@ std::string ReadBrowserConfigProp(const base::FilePath& app_path,
const std::string& pref_key) {
std::string content;
if (!ReadPrefFile(app_path.AppendASCII("browserconfig.properties"), &content))
- return std::string();
+ return "";
// This file has the syntax: key=value.
size_t prop_index = content.find(pref_key + "=");
if (prop_index == std::string::npos)
- return std::string();
+ return "";
size_t start = prop_index + pref_key.length();
size_t stop = std::string::npos;
@@ -270,7 +270,7 @@ std::string ReadBrowserConfigProp(const base::FilePath& app_path,
if (start == std::string::npos ||
stop == std::string::npos || (start == stop)) {
LOG(WARNING) << "Firefox property " << pref_key << " could not be parsed.";
- return std::string();
+ return "";
}
return content.substr(start + 1, stop - start - 1);
@@ -280,7 +280,7 @@ std::string ReadPrefsJsValue(const base::FilePath& profile_path,
const std::string& pref_key) {
std::string content;
if (!ReadPrefFile(profile_path.AppendASCII("prefs.js"), &content))
- return std::string();
+ return "";
return GetPrefsJsValue(content, pref_key);
}
@@ -411,7 +411,7 @@ std::string GetPrefsJsValue(const std::string& content,
if (start == std::string::npos || stop == std::string::npos ||
stop < start) {
LOG(WARNING) << "Firefox property " << pref_key << " could not be parsed.";
- return std::string();
+ return "";
}
// String values have double quotes we don't need to return to the caller.
diff --git a/chrome/browser/internal_auth_unittest.cc b/chrome/browser/internal_auth_unittest.cc
index da8954e..42080cd 100644
--- a/chrome/browser/internal_auth_unittest.cc
+++ b/chrome/browser/internal_auth_unittest.cc
@@ -69,10 +69,9 @@ TEST_F(InternalAuthTest, BadGeneration) {
token, long_string_, map));
// Trying empty domain.
- token = InternalAuthGeneration::GeneratePassport(std::string(), map);
+ token = InternalAuthGeneration::GeneratePassport("", map);
ASSERT_TRUE(token.empty());
- ASSERT_FALSE(
- InternalAuthVerification::VerifyPassport(token, std::string(), map));
+ ASSERT_FALSE(InternalAuthVerification::VerifyPassport(token, "", map));
std::string dummy("abcdefghij");
for (size_t i = 1000; i--;) {
@@ -88,7 +87,7 @@ TEST_F(InternalAuthTest, BadGeneration) {
ASSERT_FALSE(InternalAuthVerification::VerifyPassport(token, "zapata", map));
map.clear();
- map[std::string()] = "value";
+ map[""] = "value";
// Trying empty key.
token = InternalAuthGeneration::GeneratePassport("zapata", map);
ASSERT_TRUE(token.empty());
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index b0c5010..76d5df7 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -691,10 +691,8 @@ void IOThread::EnableSpdy(const std::string& mode) {
const std::string& element = *it;
std::vector<std::string> name_value;
base::SplitString(element, '=', &name_value);
- const std::string& option =
- name_value.size() > 0 ? name_value[0] : std::string();
- const std::string value =
- name_value.size() > 1 ? name_value[1] : std::string();
+ const std::string& option = name_value.size() > 0 ? name_value[0] : "";
+ const std::string value = name_value.size() > 1 ? name_value[1] : "";
if (option == kOff) {
net::HttpStreamFactory::set_spdy_enabled(false);
@@ -741,11 +739,10 @@ void IOThread::RegisterPrefs(PrefRegistrySimple* registry) {
"spdyproxy");
registry->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, false);
registry->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false);
- registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string());
- registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist,
- std::string());
- registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string());
- registry->RegisterStringPref(prefs::kSpdyProxyAuthOrigin, std::string());
+ registry->RegisterStringPref(prefs::kAuthServerWhitelist, "");
+ registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, "");
+ registry->RegisterStringPref(prefs::kGSSAPILibraryName, "");
+ registry->RegisterStringPref(prefs::kSpdyProxyAuthOrigin, "");
registry->RegisterBooleanPref(prefs::kEnableReferrers, true);
registry->RegisterInt64Pref(prefs::kHttpReceivedContentLength, 0);
registry->RegisterInt64Pref(prefs::kHttpOriginalContentLength, 0);
diff --git a/chrome/browser/language_usage_metrics_unittest.cc b/chrome/browser/language_usage_metrics_unittest.cc
index e007e70..db6e987 100644
--- a/chrome/browser/language_usage_metrics_unittest.cc
+++ b/chrome/browser/language_usage_metrics_unittest.cc
@@ -16,7 +16,7 @@ TEST(LanguageUsageMetricsTest, ParseAcceptLanguages) {
EXPECT_EQ(JAPANESE, *language_set.begin());
// Empty language.
- LanguageUsageMetrics::ParseAcceptLanguages(std::string(), &language_set);
+ LanguageUsageMetrics::ParseAcceptLanguages("", &language_set);
EXPECT_EQ(0U, language_set.size());
// Country code is ignored.
@@ -86,6 +86,6 @@ TEST(LanguageUsageMetricsTest, ToLanguage) {
EXPECT_EQ(JAPANESE, LanguageUsageMetrics::ToLanguage("ja-JP"));
// Invalid locales are considered as unknown language.
- EXPECT_EQ(UNKNOWN_LANGUAGE, LanguageUsageMetrics::ToLanguage(std::string()));
+ EXPECT_EQ(UNKNOWN_LANGUAGE, LanguageUsageMetrics::ToLanguage(""));
EXPECT_EQ(UNKNOWN_LANGUAGE, LanguageUsageMetrics::ToLanguage("xx"));
}
diff --git a/chrome/browser/logging_chrome_browsertest.cc b/chrome/browser/logging_chrome_browsertest.cc
index df32456..9728fd3 100644
--- a/chrome/browser/logging_chrome_browsertest.cc
+++ b/chrome/browser/logging_chrome_browsertest.cc
@@ -44,7 +44,7 @@ class ChromeLoggingTest : public testing::Test {
// Tests the log file name getter without an environment variable.
TEST_F(ChromeLoggingTest, LogFileName) {
- SaveEnvironmentVariable(std::string());
+ SaveEnvironmentVariable("");
base::FilePath filename = logging::GetLogFileName();
ASSERT_NE(base::FilePath::StringType::npos,
diff --git a/chrome/browser/managed_mode/managed_user_service.cc b/chrome/browser/managed_mode/managed_user_service.cc
index 80b2bc8..0cc29f5 100644
--- a/chrome/browser/managed_mode/managed_user_service.cc
+++ b/chrome/browser/managed_mode/managed_user_service.cc
@@ -154,10 +154,10 @@ void ManagedUserService::RegisterUserPrefs(PrefRegistrySyncable* registry) {
ManagedModeURLFilter::BLOCK,
PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterStringPref(prefs::kManagedModeLocalPassphrase,
- std::string(),
+ "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterStringPref(prefs::kManagedModeLocalSalt,
- std::string(),
+ "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
}
@@ -203,7 +203,7 @@ bool ManagedUserService::UserMayLoad(const extensions::Extension* extension,
string16* error) const {
string16 tmp_error;
// |extension| can be NULL in unit tests.
- if (ExtensionManagementPolicyImpl(extension ? extension->id() : std::string(),
+ if (ExtensionManagementPolicyImpl(extension ? extension->id() : "",
&tmp_error))
return true;
@@ -244,8 +244,7 @@ bool ManagedUserService::UserMayModifySettings(
const extensions::Extension* extension,
string16* error) const {
// |extension| can be NULL in unit tests.
- return ExtensionManagementPolicyImpl(
- extension ? extension->id() : std::string(), error);
+ return ExtensionManagementPolicyImpl(extension ? extension->id() : "", error);
}
void ManagedUserService::Observe(int type,
diff --git a/chrome/browser/media/media_stream_devices_controller.cc b/chrome/browser/media/media_stream_devices_controller.cc
index 2d844a4..c83e74d 100644
--- a/chrome/browser/media/media_stream_devices_controller.cc
+++ b/chrome/browser/media/media_stream_devices_controller.cc
@@ -279,11 +279,11 @@ void MediaStreamDevicesController::HandleTabMediaRequest() {
if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE) {
devices.push_back(content::MediaStreamDevice(
- content::MEDIA_TAB_AUDIO_CAPTURE, std::string(), std::string()));
+ content::MEDIA_TAB_AUDIO_CAPTURE, "", ""));
}
if (request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) {
devices.push_back(content::MediaStreamDevice(
- content::MEDIA_TAB_VIDEO_CAPTURE, std::string(), std::string()));
+ content::MEDIA_TAB_VIDEO_CAPTURE, "", ""));
}
callback_.Run(devices);
diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc
index bcd3ae3..98ba8da 100644
--- a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc
+++ b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc
@@ -147,7 +147,7 @@ string16 MediaGalleriesDialogController::GetHeader() const {
}
string16 MediaGalleriesDialogController::GetSubtext() const {
- std::string extension_name(extension_ ? extension_->name() : std::string());
+ std::string extension_name(extension_ ? extension_->name() : "");
return l10n_util::GetStringFUTF16(IDS_MEDIA_GALLERIES_DIALOG_SUBTEXT,
UTF8ToUTF16(extension_name));
}
@@ -184,9 +184,7 @@ void MediaGalleriesDialogController::OnAddFolderClicked() {
ui::SelectFileDialog::SELECT_FOLDER,
l10n_util::GetStringUTF16(IDS_MEDIA_GALLERIES_DIALOG_ADD_GALLERY_TITLE),
user_data_dir,
- NULL,
- 0,
- base::FilePath::StringType(),
+ NULL, 0, FILE_PATH_LITERAL(""),
web_contents_->GetView()->GetTopLevelNativeWindow(),
NULL);
}
diff --git a/chrome/browser/media_galleries/media_galleries_preferences.cc b/chrome/browser/media_galleries/media_galleries_preferences.cc
index 48689ee..78316ef 100644
--- a/chrome/browser/media_galleries/media_galleries_preferences.cc
+++ b/chrome/browser/media_galleries/media_galleries_preferences.cc
@@ -258,7 +258,7 @@ void MediaGalleriesPreferences::InitFromPrefs(bool notify_observers) {
}
}
if (notify_observers)
- NotifyChangeObservers(std::string());
+ NotifyChangeObservers("");
}
void MediaGalleriesPreferences::NotifyChangeObservers(
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index ec39326..72fff96 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -969,7 +969,7 @@ void MetricsLog::RecordOmniboxOpenedURL(const AutocompleteLog& log) {
// Write the XML version.
OPEN_ELEMENT_FOR_SCOPE("uielement");
WriteAttribute("action", "autocomplete");
- WriteAttribute("targetidhash", std::string());
+ WriteAttribute("targetidhash", "");
// TODO(kochi): Properly track windows.
WriteIntAttribute("window", 0);
if (log.tab_id != -1) {
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index c25c8e6..e68d7bf 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -391,13 +391,13 @@ class MetricsMemoryDetails : public MemoryDetails {
// static
void MetricsService::RegisterPrefs(PrefRegistrySimple* registry) {
DCHECK(IsSingleThreaded());
- registry->RegisterStringPref(prefs::kMetricsClientID, std::string());
+ registry->RegisterStringPref(prefs::kMetricsClientID, "");
registry->RegisterIntegerPref(prefs::kMetricsLowEntropySource,
kLowEntropySourceNotSet);
registry->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0);
registry->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0);
registry->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0);
- registry->RegisterStringPref(prefs::kStabilityStatsVersion, std::string());
+ registry->RegisterStringPref(prefs::kStabilityStatsVersion, "");
registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0);
registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true);
diff --git a/chrome/browser/nacl_host/pnacl_file_host_unittest.cc b/chrome/browser/nacl_host/pnacl_file_host_unittest.cc
index 6e30c29..eb2a74a 100644
--- a/chrome/browser/nacl_host/pnacl_file_host_unittest.cc
+++ b/chrome/browser/nacl_host/pnacl_file_host_unittest.cc
@@ -57,7 +57,7 @@ TEST(PnaclFileHostTest, TestFilenamesWithPnaclPath) {
&out_path));
// Other bad files.
- EXPECT_FALSE(PnaclCanOpenFile(std::string(), &out_path));
+ EXPECT_FALSE(PnaclCanOpenFile("", &out_path));
EXPECT_FALSE(PnaclCanOpenFile(".", &out_path));
EXPECT_FALSE(PnaclCanOpenFile("..", &out_path));
#if defined(OS_WIN)
diff --git a/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc b/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc
index f1d1714..4326fb9 100644
--- a/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc
+++ b/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc
@@ -123,7 +123,8 @@ class NotSendingTestReporter : public TestReporter {
class MockURLRequest : public net::URLRequest {
public:
explicit MockURLRequest(net::URLRequestContext* context)
- : net::URLRequest(GURL(std::string()), NULL, context) {}
+ : net::URLRequest(GURL(""), NULL, context) {
+ }
private:
};
diff --git a/chrome/browser/net/chrome_network_delegate_unittest.cc b/chrome/browser/net/chrome_network_delegate_unittest.cc
index b5c8151..f822195 100644
--- a/chrome/browser/net/chrome_network_delegate_unittest.cc
+++ b/chrome/browser/net/chrome_network_delegate_unittest.cc
@@ -234,7 +234,7 @@ TEST_F(ChromeNetworkDelegateSafeSearchTest, SafeSearchOn) {
"q=goog&" + kBothParameters);
// Test that another website is not affected, without parameters.
- CheckAddedParameters("http://google.com/finance", std::string());
+ CheckAddedParameters("http://google.com/finance", "");
// Test that another website is not affected, with parameters.
CheckAddedParameters("http://google.com/finance?q=goog", "q=goog");
@@ -255,10 +255,10 @@ TEST_F(ChromeNetworkDelegateSafeSearchTest, SafeSearchOff) {
SetDelegate(delegate.get());
// Test the home page.
- CheckAddedParameters("http://google.com/", std::string());
+ CheckAddedParameters("http://google.com/", "");
// Test the search home page.
- CheckAddedParameters("http://google.com/webhp", std::string());
+ CheckAddedParameters("http://google.com/webhp", "");
// Test the home page with parameters.
CheckAddedParameters("http://google.com/search?q=google",
diff --git a/chrome/browser/net/dns_probe_job_unittest.cc b/chrome/browser/net/dns_probe_job_unittest.cc
index 1fe8766..06d6965 100644
--- a/chrome/browser/net/dns_probe_job_unittest.cc
+++ b/chrome/browser/net/dns_probe_job_unittest.cc
@@ -54,7 +54,7 @@ void DnsProbeJobTest::RunProbe(MockDnsClientRule::Result good_result,
const uint16 kTypeA = net::dns_protocol::kTypeA;
MockDnsClientRuleList rules;
rules.push_back(MockDnsClientRule("google.com", kTypeA, good_result));
- rules.push_back(MockDnsClientRule(std::string(), kTypeA, bad_result));
+ rules.push_back(MockDnsClientRule("", kTypeA, bad_result));
scoped_ptr<DnsClient> dns_client = CreateMockDnsClient(config, rules);
dns_client->SetConfig(config);
diff --git a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
index f582d1b..7f33790 100644
--- a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
+++ b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
@@ -118,10 +118,8 @@ class HttpPipeliningCompatibilityClientTest : public testing::Test {
HttpPipeliningCompatibilityClient::Options options) {
HttpPipeliningCompatibilityClient client(NULL);
net::TestCompletionCallback callback;
- client.Start(test_server_.GetURL(std::string()).spec(),
- requests,
- options,
- callback.callback(),
+ client.Start(test_server_.GetURL("").spec(),
+ requests, options, callback.callback(),
context_->GetURLRequestContext());
callback.WaitForResult();
}
diff --git a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc
index c69fc93..3ab5d69 100644
--- a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc
+++ b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc
@@ -135,9 +135,9 @@ TEST_F(PrefProxyConfigTrackerImplTest, BaseConfiguration) {
}
TEST_F(PrefProxyConfigTrackerImplTest, DynamicPrefOverrides) {
- pref_service_->SetManagedPref(prefs::kProxy,
- ProxyConfigDictionary::CreateFixedServers(
- "http://example.com:3128", std::string()));
+ pref_service_->SetManagedPref(
+ prefs::kProxy,
+ ProxyConfigDictionary::CreateFixedServers("http://example.com:3128", ""));
loop_.RunUntilIdle();
net::ProxyConfig actual_config;
diff --git a/chrome/browser/net/url_info.cc b/chrome/browser/net/url_info.cc
index 1046827..ddba658 100644
--- a/chrome/browser/net/url_info.cc
+++ b/chrome/browser/net/url_info.cc
@@ -361,7 +361,7 @@ std::string UrlInfo::GetAsciiMotivation() const {
return RemoveJs(referring_url_.spec());
default:
- return std::string();
+ return "";
}
}
diff --git a/chrome/browser/page_cycler/page_cycler.cc b/chrome/browser/page_cycler/page_cycler.cc
index b78e1fe..04086d2 100644
--- a/chrome/browser/page_cycler/page_cycler.cc
+++ b/chrome/browser/page_cycler/page_cycler.cc
@@ -192,12 +192,10 @@ void PageCycler::PrepareResultsOnBackgroundThread() {
base::ProcessId pid = base::GetCurrentProcId();
#endif // OS_WIN
ChromeProcessList chrome_processes(GetRunningChromeProcesses(pid));
- output += perf_test::MemoryUsageInfoToString(
- std::string(), chrome_processes, pid);
- output +=
- perf_test::IOPerfInfoToString(std::string(), chrome_processes, pid);
- output += perf_test::SystemCommitChargeToString(
- std::string(), base::GetSystemCommitCharge(), false);
+ output += perf_test::MemoryUsageInfoToString("", chrome_processes, pid);
+ output += perf_test::IOPerfInfoToString("", chrome_processes, pid);
+ output += perf_test::SystemCommitChargeToString("",
+ base::GetSystemCommitCharge(), false);
output.append("Pages: [" + urls_string_ + "]\n");
output.append("*RESULT times: t_ref= [" + timings_string_ + "] ms\n");
}
diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc
index 9c6003d..74d6bb9 100644
--- a/chrome/browser/password_manager/native_backend_kwallet_x.cc
+++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc
@@ -186,7 +186,7 @@ bool NativeBackendKWallet::StartKWalletd() {
builder.AppendString("kwalletd"); // serviceName
builder.AppendArrayOfStrings(empty); // urls
builder.AppendArrayOfStrings(empty); // envs
- builder.AppendString(std::string()); // startup_id
+ builder.AppendString(""); // startup_id
builder.AppendBool(false); // blind
scoped_ptr<dbus::Response> response(
klauncher->CallMethodAndBlock(
diff --git a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc
index 11af55a..ad00e11 100644
--- a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc
+++ b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc
@@ -315,7 +315,7 @@ dbus::Response* NativeBackendKWalletTest::KLauncherMethodCall(
scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
dbus::MessageWriter writer(response.get());
writer.AppendInt32(klauncher_ret_);
- writer.AppendString(std::string()); // dbus_name
+ writer.AppendString(""); // dbus_name
writer.AppendString(klauncher_error_);
writer.AppendInt32(1234); // pid
return response.release();
diff --git a/chrome/browser/plugins/plugin_finder.cc b/chrome/browser/plugins/plugin_finder.cc
index 0070387..32ad157 100644
--- a/chrome/browser/plugins/plugin_finder.cc
+++ b/chrome/browser/plugins/plugin_finder.cc
@@ -292,11 +292,9 @@ scoped_ptr<PluginMetadata> PluginFinder::GetPluginMetadata(
std::string identifier = GetIdentifier(plugin);
PluginMetadata* metadata = new PluginMetadata(identifier,
GetGroupName(plugin),
- false,
- GURL(),
- GURL(),
+ false, GURL(), GURL(),
plugin.name,
- std::string());
+ "");
for (size_t i = 0; i < plugin.mime_types.size(); ++i)
metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type);
diff --git a/chrome/browser/plugins/plugin_metadata_unittest.cc b/chrome/browser/plugins/plugin_metadata_unittest.cc
index b542b1b..3e3bf99 100644
--- a/chrome/browser/plugins/plugin_metadata_unittest.cc
+++ b/chrome/browser/plugins/plugin_metadata_unittest.cc
@@ -34,11 +34,9 @@ TEST(PluginMetadataTest, SecurityStatus) {
PluginMetadata plugin_metadata("claybrick-writer",
ASCIIToUTF16("ClayBrick Writer"),
- true,
- GURL(),
- GURL(),
+ true, GURL(), GURL(),
ASCIIToUTF16("ClayBrick"),
- std::string());
+ "");
#if defined(OS_LINUX)
EXPECT_EQ(kRequiresAuthorization,
GetSecurityStatus(&plugin_metadata, "1.2.3"));
diff --git a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc
index 9f3c403..269ca75 100644
--- a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc
+++ b/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc
@@ -127,7 +127,7 @@ TEST_F(CloudPolicyRefreshSchedulerTest, InitialRefreshManagedAlreadyFetched) {
}
TEST_F(CloudPolicyRefreshSchedulerTest, Unregistered) {
- client_.SetDMToken(std::string());
+ client_.SetDMToken("");
scoped_ptr<CloudPolicyRefreshScheduler> scheduler(CreateRefreshScheduler());
client_.NotifyPolicyFetched();
client_.NotifyRegistrationStateChanged();
@@ -182,7 +182,7 @@ TEST_F(CloudPolicyRefreshSchedulerSteadyStateTest, OnRegistrationStateChanged) {
EXPECT_EQ(GetLastDelay(), base::TimeDelta());
task_runner_->ClearPendingTasks();
- client_.SetDMToken(std::string());
+ client_.SetDMToken("");
client_.NotifyRegistrationStateChanged();
EXPECT_TRUE(task_runner_->GetPendingTasks().empty());
}
diff --git a/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc
index b1c7ccb..90b344b 100644
--- a/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc
+++ b/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc
@@ -118,7 +118,7 @@ TEST_F(CloudPolicyServiceTest, RefreshPolicySuccess) {
TEST_F(CloudPolicyServiceTest, RefreshPolicyNotRegistered) {
// Clear the token so the client is not registered.
- client_.SetDMToken(std::string());
+ client_.SetDMToken("");
EXPECT_CALL(client_, FetchPolicy()).Times(0);
EXPECT_CALL(*this, OnPolicyRefresh(false)).Times(1);
diff --git a/chrome/browser/policy/cloud/device_management_service_unittest.cc b/chrome/browser/policy/cloud/device_management_service_unittest.cc
index b83ca80..ae84965 100644
--- a/chrome/browser/policy/cloud/device_management_service_unittest.cc
+++ b/chrome/browser/policy/cloud/device_management_service_unittest.cc
@@ -513,7 +513,7 @@ TEST_F(DeviceManagementServiceTest, CancelDuringCallback) {
// Generate a callback.
net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0);
- SendResponse(fetcher, status, 500, std::string());
+ SendResponse(fetcher, status, 500, "");
// Job should have been reset.
EXPECT_FALSE(request_job.get());
@@ -534,7 +534,7 @@ TEST_F(DeviceManagementServiceTest, RetryOnProxyError) {
// Generate a callback with a proxy failure.
net::URLRequestStatus status(net::URLRequestStatus::FAILED,
net::ERR_PROXY_CONNECTION_FAILED);
- SendResponse(fetcher, status, 200, std::string());
+ SendResponse(fetcher, status, 200, "");
// Verify that a new URLFetcher was started that bypasses the proxy.
fetcher = GetFetcher();
@@ -564,7 +564,7 @@ TEST_F(DeviceManagementServiceTest, RetryOnBadResponseFromProxy) {
// Generate a callback with a valid http response, that was generated by
// a bad/wrong proxy.
net::URLRequestStatus status;
- SendResponse(fetcher, status, 200, std::string());
+ SendResponse(fetcher, status, 200, "");
// Verify that a new URLFetcher was started that bypasses the proxy.
fetcher = GetFetcher();
diff --git a/chrome/browser/policy/cloud/mock_cloud_policy_client.cc b/chrome/browser/policy/cloud/mock_cloud_policy_client.cc
index 92b67e7..7008ec3 100644
--- a/chrome/browser/policy/cloud/mock_cloud_policy_client.cc
+++ b/chrome/browser/policy/cloud/mock_cloud_policy_client.cc
@@ -10,11 +10,7 @@ namespace em = enterprise_management;
namespace policy {
MockCloudPolicyClient::MockCloudPolicyClient()
- : CloudPolicyClient(std::string(),
- std::string(),
- USER_AFFILIATION_NONE,
- NULL,
- NULL) {}
+ : CloudPolicyClient("", "", USER_AFFILIATION_NONE, NULL, NULL) {}
MockCloudPolicyClient::~MockCloudPolicyClient() {}
diff --git a/chrome/browser/policy/cloud/mock_device_management_service.cc b/chrome/browser/policy/cloud/mock_device_management_service.cc
index f7836ce..987cf62 100644
--- a/chrome/browser/policy/cloud/mock_device_management_service.cc
+++ b/chrome/browser/policy/cloud/mock_device_management_service.cc
@@ -116,7 +116,7 @@ ACTION_P2(CreateAsyncMockDeviceManagementJob, service, mock_job) {
MockDeviceManagementJob::~MockDeviceManagementJob() {}
MockDeviceManagementService::MockDeviceManagementService()
- : DeviceManagementService(std::string()) {}
+ : DeviceManagementService("") {}
MockDeviceManagementService::~MockDeviceManagementService() {}
diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
index 321b3732..a801f83 100644
--- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
@@ -409,10 +409,9 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptions) {
ProxyPolicyHandler::PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs("chromium.org",
- std::string(),
- "http://chromium.org/override",
- ProxyPrefs::MODE_FIXED_SERVERS);
+ VerifyProxyPrefs(
+ "chromium.org", "", "http://chromium.org/override",
+ ProxyPrefs::MODE_FIXED_SERVERS);
}
TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptionsReversedApplyOrder) {
@@ -427,10 +426,9 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptionsReversedApplyOrder) {
base::Value::CreateStringValue("chromium.org"));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs("chromium.org",
- std::string(),
- "http://chromium.org/override",
- ProxyPrefs::MODE_FIXED_SERVERS);
+ VerifyProxyPrefs(
+ "chromium.org", "", "http://chromium.org/override",
+ ProxyPrefs::MODE_FIXED_SERVERS);
}
TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptionsInvalid) {
@@ -452,8 +450,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, NoProxyServerMode) {
base::Value::CreateIntegerValue(
ProxyPolicyHandler::PROXY_SERVER_MODE));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs(
- std::string(), std::string(), std::string(), ProxyPrefs::MODE_DIRECT);
+ VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_DIRECT);
}
TEST_F(ConfigurationPolicyPrefStoreProxyTest, NoProxyModeName) {
@@ -461,8 +458,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, NoProxyModeName) {
policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
base::Value::CreateStringValue(ProxyPrefs::kDirectProxyModeName));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs(
- std::string(), std::string(), std::string(), ProxyPrefs::MODE_DIRECT);
+ VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_DIRECT);
}
TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyServerMode) {
@@ -472,10 +468,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyServerMode) {
base::Value::CreateIntegerValue(
ProxyPolicyHandler::PROXY_AUTO_DETECT_PROXY_SERVER_MODE));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs(std::string(),
- std::string(),
- std::string(),
- ProxyPrefs::MODE_AUTO_DETECT);
+ VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_AUTO_DETECT);
}
TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyModeName) {
@@ -484,10 +477,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyModeName) {
base::Value::CreateStringValue(
ProxyPrefs::kAutoDetectProxyModeName));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs(std::string(),
- std::string(),
- std::string(),
- ProxyPrefs::MODE_AUTO_DETECT);
+ VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_AUTO_DETECT);
}
TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyMode) {
@@ -498,9 +488,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyMode) {
base::Value::CreateStringValue(
ProxyPrefs::kPacScriptProxyModeName));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs(std::string(),
- "http://short.org/proxy.pac",
- std::string(),
+ VerifyProxyPrefs("", "http://short.org/proxy.pac", "",
ProxyPrefs::MODE_PAC_SCRIPT);
}
@@ -518,21 +506,15 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyModeInvalid) {
// for unset properties.
TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyModeBug78016) {
PolicyMap policy;
- policy.Set(key::kProxyServer,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
- base::Value::CreateStringValue(std::string()));
- policy.Set(key::kProxyPacUrl,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
+ policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ base::Value::CreateStringValue(""));
+ policy.Set(key::kProxyPacUrl, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
base::Value::CreateStringValue("http://short.org/proxy.pac"));
policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
base::Value::CreateStringValue(
ProxyPrefs::kPacScriptProxyModeName));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs(std::string(),
- "http://short.org/proxy.pac",
- std::string(),
+ VerifyProxyPrefs("", "http://short.org/proxy.pac", "",
ProxyPrefs::MODE_PAC_SCRIPT);
}
@@ -542,8 +524,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystemProxyServerMode) {
base::Value::CreateIntegerValue(
ProxyPolicyHandler::PROXY_USE_SYSTEM_PROXY_SERVER_MODE));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs(
- std::string(), std::string(), std::string(), ProxyPrefs::MODE_SYSTEM);
+ VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_SYSTEM);
}
TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystemProxyMode) {
@@ -551,8 +532,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystemProxyMode) {
policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
base::Value::CreateStringValue(ProxyPrefs::kSystemProxyModeName));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs(
- std::string(), std::string(), std::string(), ProxyPrefs::MODE_SYSTEM);
+ VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_SYSTEM);
}
TEST_F(ConfigurationPolicyPrefStoreProxyTest,
@@ -565,10 +545,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest,
base::Value::CreateStringValue(
ProxyPrefs::kAutoDetectProxyModeName));
UpdateProviderPolicy(policy);
- VerifyProxyPrefs(std::string(),
- std::string(),
- std::string(),
- ProxyPrefs::MODE_AUTO_DETECT);
+ VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_AUTO_DETECT);
}
TEST_F(ConfigurationPolicyPrefStoreProxyTest, ProxyInvalid) {
@@ -791,7 +768,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, Disabled) {
base::FundamentalValue expected_enabled(false);
EXPECT_TRUE(base::Value::Equals(&expected_enabled, value));
EXPECT_TRUE(store_->GetValue(prefs::kDefaultSearchProviderSearchURL, &value));
- base::StringValue expected_search_url((std::string()));
+ base::StringValue expected_search_url("");
EXPECT_TRUE(base::Value::Equals(&expected_search_url, value));
}
@@ -931,10 +908,8 @@ TEST_F(ConfigurationPolicyPrefStorePromptDownloadTest, Default) {
TEST_F(ConfigurationPolicyPrefStorePromptDownloadTest, SetDownloadDirectory) {
PolicyMap policy;
EXPECT_FALSE(store_->GetValue(prefs::kPromptForDownload, NULL));
- policy.Set(key::kDownloadDirectory,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
- base::Value::CreateStringValue(std::string()));
+ policy.Set(key::kDownloadDirectory, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, base::Value::CreateStringValue(""));
UpdateProviderPolicy(policy);
// Setting a DownloadDirectory should disable the PromptForDownload pref.
diff --git a/chrome/browser/policy/policy_map_unittest.cc b/chrome/browser/policy/policy_map_unittest.cc
index 367ce06..a2f6207 100644
--- a/chrome/browser/policy/policy_map_unittest.cc
+++ b/chrome/browser/policy/policy_map_unittest.cc
@@ -103,13 +103,9 @@ TEST(PolicyMapTest, MergeFrom) {
Value::CreateBooleanValue(false));
b.Set(key::kBookmarkBarEnabled, POLICY_LEVEL_RECOMMENDED,
POLICY_SCOPE_MACHINE, Value::CreateBooleanValue(true));
- b.Set(key::kDefaultSearchProviderSearchURL,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_MACHINE,
- Value::CreateStringValue(std::string()));
- b.Set(key::kDisableSpdy,
- POLICY_LEVEL_RECOMMENDED,
- POLICY_SCOPE_USER,
+ b.Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_MACHINE, Value::CreateStringValue(""));
+ b.Set(key::kDisableSpdy, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
Value::CreateBooleanValue(true));
a.MergeFrom(b);
@@ -125,10 +121,8 @@ TEST(PolicyMapTest, MergeFrom) {
c.Set(key::kBookmarkBarEnabled, POLICY_LEVEL_RECOMMENDED,
POLICY_SCOPE_MACHINE, Value::CreateBooleanValue(true));
// POLICY_LEVEL_MANDATORY over POLICY_LEVEL_RECOMMENDED.
- c.Set(key::kDefaultSearchProviderSearchURL,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_MACHINE,
- Value::CreateStringValue(std::string()));
+ c.Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_MACHINE, Value::CreateStringValue(""));
// Merge new ones.
c.Set(key::kDisableSpdy, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
Value::CreateBooleanValue(true));
diff --git a/chrome/browser/policy/policy_prefs_browsertest.cc b/chrome/browser/policy/policy_prefs_browsertest.cc
index 23173bc..bce4fe0 100644
--- a/chrome/browser/policy/policy_prefs_browsertest.cc
+++ b/chrome/browser/policy/policy_prefs_browsertest.cc
@@ -519,8 +519,8 @@ IN_PROC_BROWSER_TEST_P(PolicyPrefsTest, CheckPolicyIndicators) {
// set by policy.
PolicyMap policies;
UpdateProviderPolicy(policies);
- VerifyControlledSettingIndicators(
- browser(), indicator_selector, std::string(), std::string(), false);
+ VerifyControlledSettingIndicators(browser(), indicator_selector,
+ "", "", false);
// Check that the appropriate controlled setting indicator is shown when a
// value is enforced by policy.
policies.LoadFrom(&(*indicator_test_case)->policy(),
diff --git a/chrome/browser/policy/url_blacklist_manager_unittest.cc b/chrome/browser/policy/url_blacklist_manager_unittest.cc
index b1f69d1..3e5ac0f 100644
--- a/chrome/browser/policy/url_blacklist_manager_unittest.cc
+++ b/chrome/browser/policy/url_blacklist_manager_unittest.cc
@@ -240,83 +240,31 @@ INSTANTIATE_TEST_CASE_P(
URLBlacklistFilterToComponentsTest,
testing::Values(
FilterTestParams("google.com",
- std::string(),
- ".google.com",
- true,
- 0u,
- std::string()),
+ "", ".google.com", true, 0u, ""),
FilterTestParams(".google.com",
- std::string(),
- "google.com",
- false,
- 0u,
- std::string()),
+ "", "google.com", false, 0u, ""),
FilterTestParams("http://google.com",
- "http",
- ".google.com",
- true,
- 0u,
- std::string()),
+ "http", ".google.com", true, 0u, ""),
FilterTestParams("google.com/",
- std::string(),
- ".google.com",
- true,
- 0u,
- "/"),
+ "", ".google.com", true, 0u, "/"),
FilterTestParams("http://google.com:8080/whatever",
- "http",
- ".google.com",
- true,
- 8080u,
- "/whatever"),
+ "http", ".google.com", true, 8080u, "/whatever"),
FilterTestParams("http://user:pass@google.com:8080/whatever",
- "http",
- ".google.com",
- true,
- 8080u,
- "/whatever"),
+ "http", ".google.com", true, 8080u, "/whatever"),
FilterTestParams("123.123.123.123",
- std::string(),
- "123.123.123.123",
- false,
- 0u,
- std::string()),
+ "", "123.123.123.123", false, 0u, ""),
FilterTestParams("https://123.123.123.123",
- "https",
- "123.123.123.123",
- false,
- 0u,
- std::string()),
+ "https", "123.123.123.123", false, 0u, ""),
FilterTestParams("123.123.123.123/",
- std::string(),
- "123.123.123.123",
- false,
- 0u,
- "/"),
+ "", "123.123.123.123", false, 0u, "/"),
FilterTestParams("http://123.123.123.123:123/whatever",
- "http",
- "123.123.123.123",
- false,
- 123u,
- "/whatever"),
+ "http", "123.123.123.123", false, 123u, "/whatever"),
FilterTestParams("*",
- std::string(),
- std::string(),
- true,
- 0u,
- std::string()),
+ "", "", true, 0u, ""),
FilterTestParams("ftp://*",
- "ftp",
- std::string(),
- true,
- 0u,
- std::string()),
+ "ftp", "", true, 0u, ""),
FilterTestParams("http://*/whatever",
- "http",
- std::string(),
- true,
- 0u,
- "/whatever")));
+ "http", "", true, 0u, "/whatever")));
TEST_F(URLBlacklistManagerTest, Filtering) {
URLBlacklist blacklist;
diff --git a/chrome/browser/popup_blocker_browsertest.cc b/chrome/browser/popup_blocker_browsertest.cc
index aacbbef..c2e3ede 100644
--- a/chrome/browser/popup_blocker_browsertest.cc
+++ b/chrome/browser/popup_blocker_browsertest.cc
@@ -55,7 +55,7 @@ class PopupBlockerBrowserTest : public InProcessBrowserTest {
// Do a round trip to the renderer first to flush any in-flight IPCs to
// create a to-be-blocked window.
WebContents* tab = browser->tab_strip_model()->GetActiveWebContents();
- CHECK(content::ExecuteScript(tab, std::string()));
+ CHECK(content::ExecuteScript(tab, ""));
BlockedContentTabHelper* blocked_content_tab_helper =
BlockedContentTabHelper::FromWebContents(tab);
std::vector<WebContents*> blocked_contents;
@@ -127,12 +127,12 @@ IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, MultiplePopups) {
IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest,
AllowPopupThroughContentSetting) {
GURL url(GetTestURL());
- browser()->profile()->GetHostContentSettingsMap()
- ->SetContentSetting(ContentSettingsPattern::FromURL(url),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_POPUPS,
- std::string(),
- CONTENT_SETTING_ALLOW);
+ browser()->profile()->GetHostContentSettingsMap()->SetContentSetting(
+ ContentSettingsPattern::FromURL(url),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_POPUPS,
+ "",
+ CONTENT_SETTING_ALLOW);
NavigateAndCheckPopupShown(browser(), url);
}
diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc
index 184e7a7..cc183c36 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor.cc
+++ b/chrome/browser/predictors/autocomplete_action_predictor.cc
@@ -148,7 +148,7 @@ void AutocompleteActionPredictor::StartPrerendering(
prerender::PrerenderManagerFactory::GetForProfile(profile_)) {
content::SessionStorageNamespace* session_storage_namespace = NULL;
content::SessionStorageNamespaceMap::const_iterator it =
- session_storage_namespace_map.find(std::string());
+ session_storage_namespace_map.find("");
if (it != session_storage_namespace_map.end())
session_storage_namespace = it->second;
prerender_handle_.reset(
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc
index b37f3a1..a6d7cbd 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
@@ -1012,8 +1012,7 @@ void ResourcePrefetchPredictor::LearnNavigation(
} else {
bool is_host = key_type == PREFETCH_KEY_TYPE_HOST;
PrefetchData empty_data(
- !is_host ? PREFETCH_KEY_TYPE_HOST : PREFETCH_KEY_TYPE_URL,
- std::string());
+ !is_host ? PREFETCH_KEY_TYPE_HOST : PREFETCH_KEY_TYPE_URL , "");
const PrefetchData& host_data = is_host ? cache_entry->second : empty_data;
const PrefetchData& url_data = is_host ? empty_data : cache_entry->second;
BrowserThread::PostTask(
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc
index fa5be14..d39e892 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc
@@ -167,45 +167,34 @@ void ResourcePrefetchPredictorTablesTest::TestDeleteSingleDataPoint() {
void ResourcePrefetchPredictorTablesTest::TestUpdateData() {
PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com");
google.last_visit = base::Time::FromInternalValue(10);
- google.resources.push_back(ResourceRow(std::string(),
- "http://www.google.com/style.css",
- ResourceType::STYLESHEET,
- 6,
- 2,
- 0,
- 1.0));
- google.resources.push_back(ResourceRow(std::string(),
- "http://www.google.com/image.png",
- ResourceType::IMAGE,
- 6,
- 4,
- 1,
- 4.2));
- google.resources.push_back(ResourceRow(std::string(),
- "http://www.google.com/a.xml",
- ResourceType::LAST_TYPE,
- 1,
- 0,
- 0,
- 6.1));
- google.resources
- .push_back(ResourceRow(std::string(),
- "http://www.resources.google.com/script.js",
- ResourceType::SCRIPT,
- 12,
- 0,
- 0,
- 8.5));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://www.google.com/style.css",
+ ResourceType::STYLESHEET,
+ 6, 2, 0, 1.0));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://www.google.com/image.png",
+ ResourceType::IMAGE,
+ 6, 4, 1, 4.2));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://www.google.com/a.xml",
+ ResourceType::LAST_TYPE,
+ 1, 0, 0, 6.1));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://www.resources.google.com/script.js",
+ ResourceType::SCRIPT,
+ 12, 0, 0, 8.5));
PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com");
yahoo.last_visit = base::Time::FromInternalValue(7);
- yahoo.resources.push_back(ResourceRow(std::string(),
- "http://www.yahoo.com/image.png",
- ResourceType::IMAGE,
- 120,
- 1,
- 1,
- 10.0));
+ yahoo.resources.push_back(ResourceRow(
+ "",
+ "http://www.yahoo.com/image.png",
+ ResourceType::IMAGE,
+ 120, 1, 1, 10.0));
tables_->UpdateData(google, yahoo);
@@ -287,78 +276,59 @@ void ResourcePrefetchPredictorTablesTest::InitializeSampleData() {
{ // Url data.
PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com");
google.last_visit = base::Time::FromInternalValue(1);
- google.resources.push_back(ResourceRow(std::string(),
- "http://www.google.com/style.css",
- ResourceType::STYLESHEET,
- 5,
- 2,
- 1,
- 1.1));
- google.resources.push_back(ResourceRow(std::string(),
- "http://www.google.com/script.js",
- ResourceType::SCRIPT,
- 4,
- 0,
- 1,
- 2.1));
- google.resources.push_back(ResourceRow(std::string(),
- "http://www.google.com/image.png",
- ResourceType::IMAGE,
- 6,
- 3,
- 0,
- 2.2));
- google.resources.push_back(ResourceRow(std::string(),
- "http://www.google.com/a.font",
- ResourceType::LAST_TYPE,
- 2,
- 0,
- 0,
- 5.1));
- google.resources
- .push_back(ResourceRow(std::string(),
- "http://www.resources.google.com/script.js",
- ResourceType::SCRIPT,
- 11,
- 0,
- 0,
- 8.5));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://www.google.com/style.css",
+ ResourceType::STYLESHEET,
+ 5, 2, 1, 1.1));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://www.google.com/script.js",
+ ResourceType::SCRIPT,
+ 4, 0, 1, 2.1));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://www.google.com/image.png",
+ ResourceType::IMAGE,
+ 6, 3, 0, 2.2));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://www.google.com/a.font",
+ ResourceType::LAST_TYPE,
+ 2, 0, 0, 5.1));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://www.resources.google.com/script.js",
+ ResourceType::SCRIPT,
+ 11, 0, 0, 8.5));
PrefetchData reddit(PREFETCH_KEY_TYPE_URL, "http://www.reddit.com");
reddit.last_visit = base::Time::FromInternalValue(2);
- reddit.resources
- .push_back(ResourceRow(std::string(),
- "http://reddit-resource.com/script1.js",
- ResourceType::SCRIPT,
- 4,
- 0,
- 1,
- 1.0));
- reddit.resources
- .push_back(ResourceRow(std::string(),
- "http://reddit-resource.com/script2.js",
- ResourceType::SCRIPT,
- 2,
- 0,
- 0,
- 2.1));
+ reddit.resources.push_back(ResourceRow(
+ "",
+ "http://reddit-resource.com/script1.js",
+ ResourceType::SCRIPT,
+ 4, 0, 1, 1.0));
+ reddit.resources.push_back(ResourceRow(
+ "",
+ "http://reddit-resource.com/script2.js",
+ ResourceType::SCRIPT,
+ 2, 0, 0, 2.1));
PrefetchData yahoo(PREFETCH_KEY_TYPE_URL, "http://www.yahoo.com");
yahoo.last_visit = base::Time::FromInternalValue(3);
- yahoo.resources.push_back(ResourceRow(std::string(),
- "http://www.google.com/image.png",
- ResourceType::IMAGE,
- 20,
- 1,
- 0,
- 10.0));
+ yahoo.resources.push_back(ResourceRow(
+ "",
+ "http://www.google.com/image.png",
+ ResourceType::IMAGE,
+ 20, 1, 0, 10.0));
test_url_data_.clear();
test_url_data_.insert(std::make_pair("http://www.google.com", google));
test_url_data_.insert(std::make_pair("http://www.reddit.com", reddit));
test_url_data_.insert(std::make_pair("http://www.yahoo.com", yahoo));
- PrefetchData empty_host_data(PREFETCH_KEY_TYPE_HOST, std::string());
+ PrefetchData empty_host_data(PREFETCH_KEY_TYPE_HOST, "");
tables_->UpdateData(google, empty_host_data);
tables_->UpdateData(reddit, empty_host_data);
tables_->UpdateData(yahoo, empty_host_data);
@@ -367,61 +337,45 @@ void ResourcePrefetchPredictorTablesTest::InitializeSampleData() {
{ // Host data.
PrefetchData facebook(PREFETCH_KEY_TYPE_HOST, "www.facebook.com");
facebook.last_visit = base::Time::FromInternalValue(4);
- facebook.resources
- .push_back(ResourceRow(std::string(),
- "http://www.facebook.com/style.css",
- ResourceType::STYLESHEET,
- 5,
- 2,
- 1,
- 1.1));
- facebook.resources
- .push_back(ResourceRow(std::string(),
- "http://www.facebook.com/script.js",
- ResourceType::SCRIPT,
- 4,
- 0,
- 1,
- 2.1));
- facebook.resources
- .push_back(ResourceRow(std::string(),
- "http://www.facebook.com/image.png",
- ResourceType::IMAGE,
- 6,
- 3,
- 0,
- 2.2));
- facebook.resources.push_back(ResourceRow(std::string(),
- "http://www.facebook.com/a.font",
- ResourceType::LAST_TYPE,
- 2,
- 0,
- 0,
- 5.1));
- facebook.resources
- .push_back(ResourceRow(std::string(),
- "http://www.resources.facebook.com/script.js",
- ResourceType::SCRIPT,
- 11,
- 0,
- 0,
- 8.5));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.facebook.com/style.css",
+ ResourceType::STYLESHEET,
+ 5, 2, 1, 1.1));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.facebook.com/script.js",
+ ResourceType::SCRIPT,
+ 4, 0, 1, 2.1));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.facebook.com/image.png",
+ ResourceType::IMAGE,
+ 6, 3, 0, 2.2));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.facebook.com/a.font",
+ ResourceType::LAST_TYPE,
+ 2, 0, 0, 5.1));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.resources.facebook.com/script.js",
+ ResourceType::SCRIPT,
+ 11, 0, 0, 8.5));
PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com");
yahoo.last_visit = base::Time::FromInternalValue(5);
- yahoo.resources.push_back(ResourceRow(std::string(),
- "http://www.google.com/image.png",
- ResourceType::IMAGE,
- 20,
- 1,
- 0,
- 10.0));
+ yahoo.resources.push_back(ResourceRow(
+ "",
+ "http://www.google.com/image.png",
+ ResourceType::IMAGE,
+ 20, 1, 0, 10.0));
test_host_data_.clear();
test_host_data_.insert(std::make_pair("www.facebook.com", facebook));
test_host_data_.insert(std::make_pair("www.yahoo.com", yahoo));
- PrefetchData empty_url_data(PREFETCH_KEY_TYPE_URL, std::string());
+ PrefetchData empty_url_data(PREFETCH_KEY_TYPE_URL, "");
tables_->UpdateData(empty_url_data, facebook);
tables_->UpdateData(empty_url_data, yahoo);
}
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
index b6203da..891b70c 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
@@ -176,8 +176,9 @@ ResourcePrefetchPredictorTest::ResourcePrefetchPredictorTest()
profile_(new TestingProfile()),
predictor_(NULL),
mock_tables_(new StrictMock<MockResourcePrefetchPredictorTables>()),
- empty_url_data_(PREFETCH_KEY_TYPE_URL, std::string()),
- empty_host_data_(PREFETCH_KEY_TYPE_HOST, std::string()) {}
+ empty_url_data_(PREFETCH_KEY_TYPE_URL, ""),
+ empty_host_data_(PREFETCH_KEY_TYPE_HOST, "") {
+}
ResourcePrefetchPredictorTest::~ResourcePrefetchPredictorTest() {
profile_.reset(NULL);
@@ -213,70 +214,52 @@ void ResourcePrefetchPredictorTest::InitializeSampleData() {
{ // Url data.
PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com/");
google.last_visit = base::Time::FromInternalValue(1);
- google.resources.push_back(ResourceRow(std::string(),
- "http://google.com/style1.css",
- ResourceType::STYLESHEET,
- 3,
- 2,
- 1,
- 1.0));
- google.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script3.js",
- ResourceType::SCRIPT,
- 4,
- 0,
- 1,
- 2.1));
- google.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script4.js",
- ResourceType::SCRIPT,
- 11,
- 0,
- 0,
- 2.1));
- google.resources.push_back(ResourceRow(std::string(),
- "http://google.com/image1.png",
- ResourceType::IMAGE,
- 6,
- 3,
- 0,
- 2.2));
- google.resources.push_back(ResourceRow(std::string(),
- "http://google.com/a.font",
- ResourceType::LAST_TYPE,
- 2,
- 0,
- 0,
- 5.1));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://google.com/style1.css",
+ ResourceType::STYLESHEET,
+ 3, 2, 1, 1.0));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://google.com/script3.js",
+ ResourceType::SCRIPT,
+ 4, 0, 1, 2.1));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://google.com/script4.js",
+ ResourceType::SCRIPT,
+ 11, 0, 0, 2.1));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://google.com/image1.png",
+ ResourceType::IMAGE,
+ 6, 3, 0, 2.2));
+ google.resources.push_back(ResourceRow(
+ "",
+ "http://google.com/a.font",
+ ResourceType::LAST_TYPE,
+ 2, 0, 0, 5.1));
PrefetchData reddit(PREFETCH_KEY_TYPE_URL, "http://www.reddit.com/");
reddit.last_visit = base::Time::FromInternalValue(2);
- reddit.resources
- .push_back(ResourceRow(std::string(),
- "http://reddit-resource.com/script1.js",
- ResourceType::SCRIPT,
- 4,
- 0,
- 1,
- 1.0));
- reddit.resources
- .push_back(ResourceRow(std::string(),
- "http://reddit-resource.com/script2.js",
- ResourceType::SCRIPT,
- 2,
- 0,
- 0,
- 2.1));
+ reddit.resources.push_back(ResourceRow(
+ "",
+ "http://reddit-resource.com/script1.js",
+ ResourceType::SCRIPT,
+ 4, 0, 1, 1.0));
+ reddit.resources.push_back(ResourceRow(
+ "",
+ "http://reddit-resource.com/script2.js",
+ ResourceType::SCRIPT,
+ 2, 0, 0, 2.1));
PrefetchData yahoo(PREFETCH_KEY_TYPE_URL, "http://www.yahoo.com/");
yahoo.last_visit = base::Time::FromInternalValue(3);
- yahoo.resources.push_back(ResourceRow(std::string(),
- "http://google.com/image.png",
- ResourceType::IMAGE,
- 20,
- 1,
- 0,
- 10.0));
+ yahoo.resources.push_back(ResourceRow(
+ "",
+ "http://google.com/image.png",
+ ResourceType::IMAGE,
+ 20, 1, 0, 10.0));
test_url_data_.clear();
test_url_data_.insert(std::make_pair("http://www.google.com/", google));
@@ -287,55 +270,39 @@ void ResourcePrefetchPredictorTest::InitializeSampleData() {
{ // Host data.
PrefetchData facebook(PREFETCH_KEY_TYPE_HOST, "www.facebook.com");
facebook.last_visit = base::Time::FromInternalValue(4);
- facebook.resources
- .push_back(ResourceRow(std::string(),
- "http://www.facebook.com/style.css",
- ResourceType::STYLESHEET,
- 5,
- 2,
- 1,
- 1.1));
- facebook.resources
- .push_back(ResourceRow(std::string(),
- "http://www.facebook.com/script.js",
- ResourceType::SCRIPT,
- 4,
- 0,
- 1,
- 2.1));
- facebook.resources
- .push_back(ResourceRow(std::string(),
- "http://www.facebook.com/image.png",
- ResourceType::IMAGE,
- 6,
- 3,
- 0,
- 2.2));
- facebook.resources.push_back(ResourceRow(std::string(),
- "http://www.facebook.com/a.font",
- ResourceType::LAST_TYPE,
- 2,
- 0,
- 0,
- 5.1));
- facebook.resources
- .push_back(ResourceRow(std::string(),
- "http://www.resources.facebook.com/script.js",
- ResourceType::SCRIPT,
- 11,
- 0,
- 0,
- 8.5));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.facebook.com/style.css",
+ ResourceType::STYLESHEET,
+ 5, 2, 1, 1.1));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.facebook.com/script.js",
+ ResourceType::SCRIPT,
+ 4, 0, 1, 2.1));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.facebook.com/image.png",
+ ResourceType::IMAGE,
+ 6, 3, 0, 2.2));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.facebook.com/a.font",
+ ResourceType::LAST_TYPE,
+ 2, 0, 0, 5.1));
+ facebook.resources.push_back(ResourceRow(
+ "",
+ "http://www.resources.facebook.com/script.js",
+ ResourceType::SCRIPT,
+ 11, 0, 0, 8.5));
PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com");
yahoo.last_visit = base::Time::FromInternalValue(5);
- yahoo.resources.push_back(ResourceRow(std::string(),
- "http://google.com/image.png",
- ResourceType::IMAGE,
- 20,
- 1,
- 0,
- 10.0));
+ yahoo.resources.push_back(ResourceRow(
+ "",
+ "http://google.com/image.png",
+ ResourceType::IMAGE,
+ 20, 1, 0, 10.0));
test_host_data_.clear();
test_host_data_.insert(std::make_pair("www.facebook.com", facebook));
@@ -376,14 +343,9 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationNotRecorded) {
// Single navigation but history count is low, so should not record.
AddUrlToHistory("http://www.google.com", 1);
- URLRequestSummary main_frame =
- CreateURLRequestSummary(1,
- 1,
- "http://www.google.com",
- "http://www.google.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
+ URLRequestSummary main_frame = CreateURLRequestSummary(
+ 1, 1, "http://www.google.com", "http://www.google.com",
+ ResourceType::MAIN_FRAME, "", false);
predictor_->RecordURLRequest(main_frame);
EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size()));
@@ -402,27 +364,15 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationNotRecorded) {
predictor_->RecordUrlResponse(resource3);
PrefetchData host_data(PREFETCH_KEY_TYPE_HOST, "www.google.com");
- host_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/style1.css",
- ResourceType::STYLESHEET,
- 1,
- 0,
- 0,
- 1.0));
- host_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script1.js",
- ResourceType::SCRIPT,
- 1,
- 0,
- 0,
- 2.0));
- host_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script2.js",
- ResourceType::SCRIPT,
- 1,
- 0,
- 0,
- 3.0));
+ host_data.resources.push_back(ResourceRow(
+ "", "http://google.com/style1.css",
+ ResourceType::STYLESHEET, 1, 0, 0, 1.0));
+ host_data.resources.push_back(ResourceRow(
+ "", "http://google.com/script1.js",
+ ResourceType::SCRIPT, 1, 0, 0, 2.0));
+ host_data.resources.push_back(ResourceRow(
+ "", "http://google.com/script2.js",
+ ResourceType::SCRIPT, 1, 0, 0, 3.0));
EXPECT_CALL(*mock_tables_, UpdateData(empty_url_data_, host_data));
predictor_->OnNavigationComplete(main_frame.navigation_id);
@@ -434,14 +384,9 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlNotInDB) {
// resources and also for number of resources saved.
AddUrlToHistory("http://www.google.com", 4);
- URLRequestSummary main_frame =
- CreateURLRequestSummary(1,
- 1,
- "http://www.google.com",
- "http://www.google.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
+ URLRequestSummary main_frame = CreateURLRequestSummary(
+ 1, 1, "http://www.google.com", "http://www.google.com",
+ ResourceType::MAIN_FRAME, "", false);
predictor_->RecordURLRequest(main_frame);
EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size()));
@@ -479,34 +424,18 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlNotInDB) {
resource7.resource_type);
PrefetchData url_data(PREFETCH_KEY_TYPE_URL, "http://www.google.com/");
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/style1.css",
- ResourceType::STYLESHEET,
- 1,
- 0,
- 0,
- 1.0));
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script1.js",
- ResourceType::SCRIPT,
- 1,
- 0,
- 0,
- 2.0));
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script2.js",
- ResourceType::SCRIPT,
- 1,
- 0,
- 0,
- 3.0));
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/style2.css",
- ResourceType::STYLESHEET,
- 1,
- 0,
- 0,
- 7.0));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://google.com/style1.css",
+ ResourceType::STYLESHEET, 1, 0, 0, 1.0));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://google.com/script1.js",
+ ResourceType::SCRIPT, 1, 0, 0, 2.0));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://google.com/script2.js",
+ ResourceType::SCRIPT, 1, 0, 0, 3.0));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://google.com/style2.css",
+ ResourceType::STYLESHEET, 1, 0, 0, 7.0));
EXPECT_CALL(*mock_tables_, UpdateData(url_data, empty_host_data_));
PrefetchData host_data(PREFETCH_KEY_TYPE_HOST, "www.google.com");
@@ -532,14 +461,9 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlInDB) {
EXPECT_EQ(3, static_cast<int>(predictor_->url_table_cache_->size()));
EXPECT_EQ(2, static_cast<int>(predictor_->host_table_cache_->size()));
- URLRequestSummary main_frame =
- CreateURLRequestSummary(1,
- 1,
- "http://www.google.com",
- "http://www.google.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
+ URLRequestSummary main_frame = CreateURLRequestSummary(
+ 1, 1, "http://www.google.com", "http://www.google.com",
+ ResourceType::MAIN_FRAME, "", false);
predictor_->RecordURLRequest(main_frame);
EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size()));
@@ -577,34 +501,18 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlInDB) {
resource7.resource_type);
PrefetchData url_data(PREFETCH_KEY_TYPE_URL, "http://www.google.com/");
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/style1.css",
- ResourceType::STYLESHEET,
- 4,
- 2,
- 0,
- 1.0));
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script1.js",
- ResourceType::SCRIPT,
- 1,
- 0,
- 0,
- 2.0));
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script4.js",
- ResourceType::SCRIPT,
- 11,
- 1,
- 1,
- 2.1));
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script2.js",
- ResourceType::SCRIPT,
- 1,
- 0,
- 0,
- 3.0));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://google.com/style1.css",
+ ResourceType::STYLESHEET, 4, 2, 0, 1.0));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://google.com/script1.js",
+ ResourceType::SCRIPT, 1, 0, 0, 2.0));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://google.com/script4.js",
+ ResourceType::SCRIPT, 11, 1, 1, 2.1));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://google.com/script2.js",
+ ResourceType::SCRIPT, 1, 0, 0, 3.0));
EXPECT_CALL(*mock_tables_, UpdateData(url_data, empty_host_data_));
EXPECT_CALL(*mock_tables_,
@@ -612,34 +520,18 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlInDB) {
PREFETCH_KEY_TYPE_HOST));
PrefetchData host_data(PREFETCH_KEY_TYPE_HOST, "www.google.com");
- host_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/style1.css",
- ResourceType::STYLESHEET,
- 1,
- 0,
- 0,
- 1.0));
- host_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script1.js",
- ResourceType::SCRIPT,
- 1,
- 0,
- 0,
- 2.0));
- host_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/script2.js",
- ResourceType::SCRIPT,
- 1,
- 0,
- 0,
- 3.0));
- host_data.resources.push_back(ResourceRow(std::string(),
- "http://google.com/style2.css",
- ResourceType::STYLESHEET,
- 1,
- 0,
- 0,
- 7.0));
+ host_data.resources.push_back(ResourceRow(
+ "", "http://google.com/style1.css",
+ ResourceType::STYLESHEET, 1, 0, 0, 1.0));
+ host_data.resources.push_back(ResourceRow(
+ "", "http://google.com/script1.js",
+ ResourceType::SCRIPT, 1, 0, 0, 2.0));
+ host_data.resources.push_back(ResourceRow(
+ "", "http://google.com/script2.js",
+ ResourceType::SCRIPT, 1, 0, 0, 3.0));
+ host_data.resources.push_back(ResourceRow(
+ "", "http://google.com/style2.css",
+ ResourceType::STYLESHEET, 1, 0, 0, 7.0));
EXPECT_CALL(*mock_tables_, UpdateData(empty_url_data_, host_data));
predictor_->OnNavigationComplete(main_frame.navigation_id);
@@ -660,14 +552,9 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlNotInDBAndDBFull) {
EXPECT_EQ(3, static_cast<int>(predictor_->url_table_cache_->size()));
EXPECT_EQ(2, static_cast<int>(predictor_->host_table_cache_->size()));
- URLRequestSummary main_frame =
- CreateURLRequestSummary(1,
- 1,
- "http://www.nike.com",
- "http://www.nike.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
+ URLRequestSummary main_frame = CreateURLRequestSummary(
+ 1, 1, "http://www.nike.com", "http://www.nike.com",
+ ResourceType::MAIN_FRAME, "", false);
predictor_->RecordURLRequest(main_frame);
EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size()));
@@ -688,20 +575,12 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlNotInDBAndDBFull) {
PREFETCH_KEY_TYPE_HOST));
PrefetchData url_data(PREFETCH_KEY_TYPE_URL, "http://www.nike.com/");
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://nike.com/style1.css",
- ResourceType::STYLESHEET,
- 1,
- 0,
- 0,
- 1.0));
- url_data.resources.push_back(ResourceRow(std::string(),
- "http://nike.com/image2.png",
- ResourceType::IMAGE,
- 1,
- 0,
- 0,
- 2.0));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://nike.com/style1.css",
+ ResourceType::STYLESHEET, 1, 0, 0, 1.0));
+ url_data.resources.push_back(ResourceRow(
+ "", "http://nike.com/image2.png",
+ ResourceType::IMAGE, 1, 0, 0, 2.0));
EXPECT_CALL(*mock_tables_, UpdateData(url_data, empty_host_data_));
PrefetchData host_data(PREFETCH_KEY_TYPE_HOST, "www.nike.com");
@@ -768,27 +647,15 @@ TEST_F(ResourcePrefetchPredictorTest, DeleteUrls) {
}
TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRequest) {
- URLRequestSummary summary1 = CreateURLRequestSummary(1,
- 1,
- "http://www.google.com",
- "http://www.google.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
- URLRequestSummary summary2 = CreateURLRequestSummary(1,
- 2,
- "http://www.google.com",
- "http://www.google.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
- URLRequestSummary summary3 = CreateURLRequestSummary(2,
- 1,
- "http://www.yahoo.com",
- "http://www.yahoo.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
+ URLRequestSummary summary1 = CreateURLRequestSummary(
+ 1, 1, "http://www.google.com", "http://www.google.com",
+ ResourceType::MAIN_FRAME, "", false);
+ URLRequestSummary summary2 = CreateURLRequestSummary(
+ 1, 2, "http://www.google.com", "http://www.google.com",
+ ResourceType::MAIN_FRAME, "", false);
+ URLRequestSummary summary3 = CreateURLRequestSummary(
+ 2, 1, "http://www.yahoo.com", "http://www.yahoo.com",
+ ResourceType::MAIN_FRAME, "", false);
predictor_->OnMainFrameRequest(summary1);
EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size()));
@@ -798,20 +665,12 @@ TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRequest) {
EXPECT_EQ(3, static_cast<int>(predictor_->inflight_navigations_.size()));
// Insert anther with same navigation id. It should replace.
- URLRequestSummary summary4 = CreateURLRequestSummary(1,
- 1,
- "http://www.nike.com",
- "http://www.nike.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
- URLRequestSummary summary5 = CreateURLRequestSummary(1,
- 2,
- "http://www.google.com",
- "http://www.google.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
+ URLRequestSummary summary4 = CreateURLRequestSummary(
+ 1, 1, "http://www.nike.com", "http://www.nike.com",
+ ResourceType::MAIN_FRAME, "", false);
+ URLRequestSummary summary5 = CreateURLRequestSummary(
+ 1, 2, "http://www.google.com", "http://www.google.com",
+ ResourceType::MAIN_FRAME, "", false);
predictor_->OnMainFrameRequest(summary4);
EXPECT_EQ(3, static_cast<int>(predictor_->inflight_navigations_.size()));
@@ -822,13 +681,9 @@ TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRequest) {
predictor_->OnMainFrameRequest(summary5);
EXPECT_EQ(3, static_cast<int>(predictor_->inflight_navigations_.size()));
- URLRequestSummary summary6 = CreateURLRequestSummary(3,
- 1,
- "http://www.shoes.com",
- "http://www.shoes.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
+ URLRequestSummary summary6 = CreateURLRequestSummary(
+ 3, 1, "http://www.shoes.com", "http://www.shoes.com",
+ ResourceType::MAIN_FRAME, "", false);
predictor_->OnMainFrameRequest(summary6);
EXPECT_EQ(3, static_cast<int>(predictor_->inflight_navigations_.size()));
@@ -841,27 +696,15 @@ TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRequest) {
}
TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRedirect) {
- URLRequestSummary summary1 = CreateURLRequestSummary(1,
- 1,
- "http://www.google.com",
- "http://www.google.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
- URLRequestSummary summary2 = CreateURLRequestSummary(1,
- 2,
- "http://www.google.com",
- "http://www.google.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
- URLRequestSummary summary3 = CreateURLRequestSummary(2,
- 1,
- "http://www.yahoo.com",
- "http://www.yahoo.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
+ URLRequestSummary summary1 = CreateURLRequestSummary(
+ 1, 1, "http://www.google.com", "http://www.google.com",
+ ResourceType::MAIN_FRAME, "", false);
+ URLRequestSummary summary2 = CreateURLRequestSummary(
+ 1, 2, "http://www.google.com", "http://www.google.com",
+ ResourceType::MAIN_FRAME, "", false);
+ URLRequestSummary summary3 = CreateURLRequestSummary(
+ 2, 1, "http://www.yahoo.com", "http://www.yahoo.com",
+ ResourceType::MAIN_FRAME, "", false);
predictor_->OnMainFrameRedirect(summary1);
EXPECT_TRUE(predictor_->inflight_navigations_.empty());
@@ -888,14 +731,9 @@ TEST_F(ResourcePrefetchPredictorTest, OnSubresourceResponse) {
EXPECT_TRUE(predictor_->inflight_navigations_.empty());
// Add an inflight navigation.
- URLRequestSummary main_frame1 =
- CreateURLRequestSummary(1,
- 1,
- "http://www.google.com",
- "http://www.google.com",
- ResourceType::MAIN_FRAME,
- std::string(),
- false);
+ URLRequestSummary main_frame1 = CreateURLRequestSummary(
+ 1, 1, "http://www.google.com", "http://www.google.com",
+ ResourceType::MAIN_FRAME, "", false);
predictor_->OnMainFrameRequest(main_frame1);
EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size()));
diff --git a/chrome/browser/predictors/resource_prefetcher_unittest.cc b/chrome/browser/predictors/resource_prefetcher_unittest.cc
index 865c8af..9d5ef5a 100644
--- a/chrome/browser/predictors/resource_prefetcher_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetcher_unittest.cc
@@ -111,8 +111,7 @@ class ResourcePrefetcherTest : public testing::Test {
void OnReceivedRedirect(const std::string& url) {
- prefetcher_->OnReceivedRedirect(
- GetInFlightRequest(url), GURL(std::string()), NULL);
+ prefetcher_->OnReceivedRedirect(GetInFlightRequest(url), GURL(""), NULL);
}
void OnAuthRequired(const std::string& url) {
prefetcher_->OnAuthRequired(GetInFlightRequest(url), NULL);
diff --git a/chrome/browser/prefs/command_line_pref_store_unittest.cc b/chrome/browser/prefs/command_line_pref_store_unittest.cc
index 1e23383..5d2c939 100644
--- a/chrome/browser/prefs/command_line_pref_store_unittest.cc
+++ b/chrome/browser/prefs/command_line_pref_store_unittest.cc
@@ -116,7 +116,7 @@ TEST(CommandLinePrefStoreTest, MultipleSwitches) {
ASSERT_EQ(Value::TYPE_DICTIONARY, value->GetType());
ProxyConfigDictionary dict(static_cast<const DictionaryValue*>(value));
- std::string string_result;
+ std::string string_result = "";
ASSERT_TRUE(dict.GetProxyServer(&string_result));
EXPECT_EQ("proxy", string_result);
@@ -172,9 +172,9 @@ TEST(CommandLinePrefStoreTest, ManualProxyModeInference) {
store2->VerifyProxyMode(ProxyPrefs::MODE_PAC_SCRIPT);
CommandLine cl3(CommandLine::NO_PROGRAM);
- cl3.AppendSwitchASCII(switches::kProxyServer, std::string());
+ cl3.AppendSwitchASCII(switches::kProxyServer, "");
scoped_refptr<TestCommandLinePrefStore> store3 =
- new TestCommandLinePrefStore(&cl3);
+ new TestCommandLinePrefStore(&cl3);
store3->VerifyProxyMode(ProxyPrefs::MODE_DIRECT);
}
diff --git a/chrome/browser/prefs/proxy_config_dictionary.cc b/chrome/browser/prefs/proxy_config_dictionary.cc
index b6db822..a99fa7c 100644
--- a/chrome/browser/prefs/proxy_config_dictionary.cc
+++ b/chrome/browser/prefs/proxy_config_dictionary.cc
@@ -67,20 +67,12 @@ bool ProxyConfigDictionary::HasBypassList() const {
// static
DictionaryValue* ProxyConfigDictionary::CreateDirect() {
- return CreateDictionary(ProxyPrefs::MODE_DIRECT,
- std::string(),
- false,
- std::string(),
- std::string());
+ return CreateDictionary(ProxyPrefs::MODE_DIRECT, "", false, "", "");
}
// static
DictionaryValue* ProxyConfigDictionary::CreateAutoDetect() {
- return CreateDictionary(ProxyPrefs::MODE_AUTO_DETECT,
- std::string(),
- false,
- std::string(),
- std::string());
+ return CreateDictionary(ProxyPrefs::MODE_AUTO_DETECT, "", false, "", "");
}
// static
@@ -88,10 +80,7 @@ DictionaryValue* ProxyConfigDictionary::CreatePacScript(
const std::string& pac_url,
bool pac_mandatory) {
return CreateDictionary(ProxyPrefs::MODE_PAC_SCRIPT,
- pac_url,
- pac_mandatory,
- std::string(),
- std::string());
+ pac_url, pac_mandatory, "", "");
}
// static
@@ -99,11 +88,8 @@ DictionaryValue* ProxyConfigDictionary::CreateFixedServers(
const std::string& proxy_server,
const std::string& bypass_list) {
if (!proxy_server.empty()) {
- return CreateDictionary(ProxyPrefs::MODE_FIXED_SERVERS,
- std::string(),
- false,
- proxy_server,
- bypass_list);
+ return CreateDictionary(
+ ProxyPrefs::MODE_FIXED_SERVERS, "", false, proxy_server, bypass_list);
} else {
return CreateDirect();
}
@@ -111,11 +97,7 @@ DictionaryValue* ProxyConfigDictionary::CreateFixedServers(
// static
DictionaryValue* ProxyConfigDictionary::CreateSystem() {
- return CreateDictionary(ProxyPrefs::MODE_SYSTEM,
- std::string(),
- false,
- std::string(),
- std::string());
+ return CreateDictionary(ProxyPrefs::MODE_SYSTEM, "", false, "", "");
}
// static
diff --git a/chrome/browser/prefs/proxy_policy_unittest.cc b/chrome/browser/prefs/proxy_policy_unittest.cc
index 512e514..ec51894 100644
--- a/chrome/browser/prefs/proxy_policy_unittest.cc
+++ b/chrome/browser/prefs/proxy_policy_unittest.cc
@@ -68,9 +68,9 @@ void assertBypassList(const ProxyConfigDictionary& dict,
void assertProxyModeWithoutParams(const ProxyConfigDictionary& dict,
ProxyPrefs::ProxyMode proxy_mode) {
assertProxyMode(dict, proxy_mode);
- assertProxyServer(dict, std::string());
- assertPacUrl(dict, std::string());
- assertBypassList(dict, std::string());
+ assertProxyServer(dict, "");
+ assertPacUrl(dict, "");
+ assertBypassList(dict, "");
}
} // namespace
@@ -130,7 +130,7 @@ TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) {
ProxyConfigDictionary dict(prefs->GetDictionary(prefs::kProxy));
assertProxyMode(dict, ProxyPrefs::MODE_FIXED_SERVERS);
assertProxyServer(dict, "789");
- assertPacUrl(dict, std::string());
+ assertPacUrl(dict, "");
assertBypassList(dict, "123");
// Try a second time time with the managed PrefStore in place, the
@@ -140,7 +140,7 @@ TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) {
ProxyConfigDictionary dict2(prefs->GetDictionary(prefs::kProxy));
assertProxyMode(dict2, ProxyPrefs::MODE_FIXED_SERVERS);
assertProxyServer(dict2, "ghi");
- assertPacUrl(dict2, std::string());
+ assertPacUrl(dict2, "");
assertBypassList(dict2, "abc");
}
@@ -160,7 +160,7 @@ TEST_F(ProxyPolicyTest, OverridesUnrelatedCommandLineOptions) {
ProxyConfigDictionary dict(prefs->GetDictionary(prefs::kProxy));
assertProxyMode(dict, ProxyPrefs::MODE_FIXED_SERVERS);
assertProxyServer(dict, "789");
- assertPacUrl(dict, std::string());
+ assertPacUrl(dict, "");
assertBypassList(dict, "123");
// Try a second time time with the managed PrefStore in place, the
diff --git a/chrome/browser/prefs/session_startup_pref.cc b/chrome/browser/prefs/session_startup_pref.cc
index fbbf62f..d822cc0 100644
--- a/chrome/browser/prefs/session_startup_pref.cc
+++ b/chrome/browser/prefs/session_startup_pref.cc
@@ -45,7 +45,7 @@ void URLListToPref(const base::ListValue* url_list, SessionStartupPref* pref) {
for (size_t i = 0; i < url_list->GetSize(); ++i) {
std::string url_text;
if (url_list->GetString(i, &url_text)) {
- GURL fixed_url = URLFixerUpper::FixupURL(url_text, std::string());
+ GURL fixed_url = URLFixerUpper::FixupURL(url_text, "");
pref->urls.push_back(fixed_url);
}
}
diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc
index 508ec89..ff32646 100644
--- a/chrome/browser/prerender/prerender_contents.cc
+++ b/chrome/browser/prerender/prerender_contents.cc
@@ -465,8 +465,8 @@ WebContents* PrerenderContents::CreateWebContents(
// TODO(ajwong): Remove the temporary map once prerendering is aware of
// multiple session storage namespaces per tab.
content::SessionStorageNamespaceMap session_storage_namespace_map;
- session_storage_namespace_map[std::string()] = session_storage_namespace;
- return WebContents::CreateWithSessionStorage(
+ session_storage_namespace_map[""] = session_storage_namespace;
+ return WebContents::CreateWithSessionStorage(
WebContents::CreateParams(profile_), session_storage_namespace_map);
}
diff --git a/chrome/browser/prerender/prerender_histograms.cc b/chrome/browser/prerender/prerender_histograms.cc
index 325c00e..d836cf8 100644
--- a/chrome/browser/prerender/prerender_histograms.cc
+++ b/chrome/browser/prerender/prerender_histograms.cc
@@ -92,9 +92,9 @@ bool OriginIsOmnibox(Origin origin) {
#define PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, wash, HISTOGRAM, \
histogram_name) { \
{ \
- /* Do not rename. HISTOGRAM expects a local variable "name". */ \
- std::string name = ComposeHistogramName(std::string(), histogram_name); \
- HISTOGRAM; \
+ /* Do not rename. HISTOGRAM expects a local variable "name". */ \
+ std::string name = ComposeHistogramName("", histogram_name); \
+ HISTOGRAM; \
} \
/* Do not rename. HISTOGRAM expects a local variable "name". */ \
std::string name = GetHistogramName(origin, experiment, wash, \
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
index 131b45a..299567a 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
@@ -66,7 +66,7 @@ CloudPrintSetupFlow* CloudPrintSetupFlow::OpenDialog(
chrome::GetActiveDesktop());
// Set the arguments for showing the gaia login page.
DictionaryValue args;
- args.SetString("user", std::string());
+ args.SetString("user", "");
args.SetInteger("error", 0);
args.SetBoolean("editable_user", true);
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc
index 8c18da8..7bb6d73 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc
@@ -87,7 +87,7 @@ void CloudPrintSetupSource::StartDataRequest(
// None of the strings used here currently have sync-specific wording in
// them. There is a unit test to catch if that happens.
- dict->SetString("introduction", std::string());
+ dict->SetString("introduction", "");
AddString(dict, "signinprefix", IDS_SYNC_LOGIN_SIGNIN_PREFIX);
AddString(dict, "signinsuffix", IDS_SYNC_LOGIN_SIGNIN_SUFFIX);
AddString(dict, "cannotbeblank", IDS_SYNC_CANNOT_BE_BLANK);
diff --git a/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc b/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc
index eb8eef4..2529a1d 100644
--- a/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc
+++ b/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc
@@ -251,7 +251,7 @@ net::URLRequestJob* PrintDialogCloudTest::Factory(
return new net::URLRequestTestJob(request,
network_delegate,
net::URLRequestTestJob::test_headers(),
- std::string(),
+ "",
true);
}
diff --git a/chrome/browser/printing/print_dialog_cloud_unittest.cc b/chrome/browser/printing/print_dialog_cloud_unittest.cc
index ce50f28..217fa53 100644
--- a/chrome/browser/printing/print_dialog_cloud_unittest.cc
+++ b/chrome/browser/printing/print_dialog_cloud_unittest.cc
@@ -270,7 +270,7 @@ TEST_F(CloudPrintDataSenderTest, NoData) {
TEST_F(CloudPrintDataSenderTest, EmptyData) {
EXPECT_CALL(*mock_helper_, CallJavascriptFunction(_, _, _)).Times(0);
- std::string data;
+ std::string data("");
scoped_refptr<CloudPrintDataSender> print_data_sender(
CreateSender(base::RefCountedString::TakeString(&data)));
base::FilePath test_data_file_name = GetTestDataFileName();
diff --git a/chrome/browser/profiles/gaia_info_update_service_factory.cc b/chrome/browser/profiles/gaia_info_update_service_factory.cc
index f8f46f7..88ef612 100644
--- a/chrome/browser/profiles/gaia_info_update_service_factory.cc
+++ b/chrome/browser/profiles/gaia_info_update_service_factory.cc
@@ -39,8 +39,7 @@ void GAIAInfoUpdateServiceFactory::RegisterUserPrefs(
PrefRegistrySyncable* prefs) {
prefs->RegisterInt64Pref(prefs::kProfileGAIAInfoUpdateTime, 0,
PrefRegistrySyncable::UNSYNCABLE_PREF);
- prefs->RegisterStringPref(prefs::kProfileGAIAInfoPictureURL,
- std::string(),
+ prefs->RegisterStringPref(prefs::kProfileGAIAInfoPictureURL, "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
}
diff --git a/chrome/browser/profiles/gaia_info_update_service_unittest.cc b/chrome/browser/profiles/gaia_info_update_service_unittest.cc
index 37dfdd7..dd85970 100644
--- a/chrome/browser/profiles/gaia_info_update_service_unittest.cc
+++ b/chrome/browser/profiles/gaia_info_update_service_unittest.cc
@@ -184,8 +184,7 @@ TEST_F(GAIAInfoUpdateServiceTest, LogOut) {
GAIAInfoUpdateService service(profile());
EXPECT_FALSE(service.GetCachedPictureURL().empty());
// Log out.
- profile()->GetPrefs()
- ->SetString(prefs::kGoogleServicesUsername, std::string());
+ profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "");
// Verify that the GAIA name and picture, and picture URL are unset.
EXPECT_TRUE(GetCache()->GetGAIANameOfProfileAtIndex(0).empty());
@@ -194,8 +193,7 @@ TEST_F(GAIAInfoUpdateServiceTest, LogOut) {
}
TEST_F(GAIAInfoUpdateServiceTest, LogIn) {
- profile()->GetPrefs()
- ->SetString(prefs::kGoogleServicesUsername, std::string());
+ profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "");
GAIAInfoUpdateServiceMock service(profile());
// Log in.
diff --git a/chrome/browser/profiles/profile_downloader_unittest.cc b/chrome/browser/profiles/profile_downloader_unittest.cc
index 5346694..2e47968 100644
--- a/chrome/browser/profiles/profile_downloader_unittest.cc
+++ b/chrome/browser/profiles/profile_downloader_unittest.cc
@@ -68,25 +68,25 @@ TEST_F(ProfileDownloaderTest, ParseData) {
true);
// Data with only name.
- VerifyWithNameAndURL("Pat Smith", std::string(), std::string(), true);
+ VerifyWithNameAndURL("Pat Smith", "", "", true);
// Data with only URL.
VerifyWithNameAndURL(
- std::string(),
+ "",
"https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/photo.jpg",
"https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s32-c/photo.jpg",
true);
// Data without name or URL.
- VerifyWithNameAndURL(std::string(), std::string(), std::string(), false);
+ VerifyWithNameAndURL("", "", "", false);
// Data with an invalid URL.
- VerifyWithNameAndURL(std::string(), "invalid url", std::string(), false);
+ VerifyWithNameAndURL( "", "invalid url", "", false);
}
TEST_F(ProfileDownloaderTest, DefaultURL) {
// Empty URL should be default photo
- EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL(std::string()));
+ EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL(""));
// Picasa default photo
EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL(
"https://example.com/-4/AAAAAAAAAAA/AAAAAAAAAAE/G/s64-c/photo.jpg"));
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index a068fb3..f99cbba 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -289,8 +289,9 @@ void ProfileImpl::RegisterUserPrefs(PrefRegistrySyncable* registry) {
registry->RegisterIntegerPref(prefs::kProfileAvatarIndex,
-1,
PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterStringPref(
- prefs::kProfileName, std::string(), PrefRegistrySyncable::SYNCABLE_PREF);
+ registry->RegisterStringPref(prefs::kProfileName,
+ "",
+ PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kProfileIsManaged,
false,
PrefRegistrySyncable::SYNCABLE_PREF);
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 69da963..59f2e69 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -890,7 +890,7 @@ void ProfileManager::CreateMultiProfileAsync(
// static
void ProfileManager::RegisterPrefs(PrefRegistrySimple* registry) {
- registry->RegisterStringPref(prefs::kProfileLastUsed, std::string());
+ registry->RegisterStringPref(prefs::kProfileLastUsed, "");
registry->RegisterIntegerPref(prefs::kProfilesNumCreated, 1);
registry->RegisterListPref(prefs::kProfilesLastActive);
}
diff --git a/chrome/browser/referrer_policy_browsertest.cc b/chrome/browser/referrer_policy_browsertest.cc
index 0b9f40f..83a32b4 100644
--- a/chrome/browser/referrer_policy_browsertest.cc
+++ b/chrome/browser/referrer_policy_browsertest.cc
@@ -376,7 +376,7 @@ IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, History) {
EXPECT_ORIGIN_AS_REFERRER);
// Navigate to C.
- ui_test_utils::NavigateToURL(browser(), test_server_->GetURL(std::string()));
+ ui_test_utils::NavigateToURL(browser(), test_server_->GetURL(""));
string16 expected_title =
GetExpectedTitle(start_url, EXPECT_ORIGIN_AS_REFERRER);
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc
index be2ce33..f39e75a 100644
--- a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc
@@ -316,7 +316,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgWriteData(
scw.WriteText(UTF8ToUTF16(data[i]));
break;
case PP_FLASH_CLIPBOARD_FORMAT_HTML:
- scw.WriteHTML(UTF8ToUTF16(data[i]), std::string());
+ scw.WriteHTML(UTF8ToUTF16(data[i]), "");
break;
case PP_FLASH_CLIPBOARD_FORMAT_RTF:
scw.WriteRTF(data[i]);
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc
index a40c66d..142f375 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc
@@ -208,8 +208,8 @@ void BrowserFeatureExtractor::ExtractFeatures(const BrowseInfo* info,
// 2) The first url on the same host as the candidate url (assuming that
// it's different from the candidate url).
if (url_index != -1) {
- AddNavigationFeatures(
- std::string(), controller, url_index, info->url_redirects, request);
+ AddNavigationFeatures("", controller, url_index, info->url_redirects,
+ request);
}
if (first_host_index != -1) {
AddNavigationFeatures(features::kHostPrefix,
diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
index ec8b4e3..74ec857 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
@@ -635,11 +635,11 @@ TEST_F(ClientSideDetectionHostTest, UpdateIPHostMap) {
BrowseInfo* browse_info = GetBrowseInfo();
// Empty IP or host are skipped
- UpdateIPHostMap("250.10.10.10", std::string());
+ UpdateIPHostMap("250.10.10.10", "");
ASSERT_EQ(0U, browse_info->ips.size());
- UpdateIPHostMap(std::string(), "google.com/");
+ UpdateIPHostMap("", "google.com/");
ASSERT_EQ(0U, browse_info->ips.size());
- UpdateIPHostMap(std::string(), std::string());
+ UpdateIPHostMap("", "");
ASSERT_EQ(0U, browse_info->ips.size());
std::set<std::string> expected_hosts;
diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
index ed533604..f5fd98b 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
@@ -252,8 +252,9 @@ TEST_F(ClientSideDetectionServiceTest, FetchModelTest) {
Mock::VerifyAndClearExpectations(&service);
// Empty model file.
- SetModelFetchResponse(std::string(), true /* success */);
- EXPECT_CALL(service, EndFetchModel(ClientSideDetectionService::MODEL_EMPTY))
+ SetModelFetchResponse("", true /* success */);
+ EXPECT_CALL(service, EndFetchModel(
+ ClientSideDetectionService::MODEL_EMPTY))
.WillOnce(QuitCurrentMessageLoop());
service.StartFetchModel();
msg_loop_.Run(); // EndFetchModel will quit the message loop.
@@ -575,7 +576,7 @@ TEST_F(ClientSideDetectionServiceTest, IsBadIpAddress) {
ClientSideDetectionService::SetBadSubnets(
model, &(csd_service_->bad_subnets_));
EXPECT_FALSE(csd_service_->IsBadIpAddress("blabla"));
- EXPECT_FALSE(csd_service_->IsBadIpAddress(std::string()));
+ EXPECT_FALSE(csd_service_->IsBadIpAddress(""));
EXPECT_TRUE(csd_service_->IsBadIpAddress(
"2620:0:1000:3103:21a:a0ff:fe10:786e"));
diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
index af98856..e8da2ee 100644
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
@@ -390,7 +390,7 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadFetchFailed) {
net::FakeURLFetcherFactory factory(NULL);
// HTTP request will fail.
factory.SetFakeResponse(
- DownloadProtectionService::GetDownloadRequestUrl(), std::string(), false);
+ DownloadProtectionService::GetDownloadRequestUrl(), "", false);
base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp"));
base::FilePath a_exe(FILE_PATH_LITERAL("a.exe"));
diff --git a/chrome/browser/safe_browsing/malware_details.cc b/chrome/browser/safe_browsing/malware_details.cc
index 7eb336d..41cf690 100644
--- a/chrome/browser/safe_browsing/malware_details.cc
+++ b/chrome/browser/safe_browsing/malware_details.cc
@@ -178,16 +178,16 @@ void MalwareDetails::StartCollection() {
}
// Add the nodes, starting from the page url.
- AddUrl(page_url, GURL(), std::string(), NULL);
+ AddUrl(page_url, GURL(), "", NULL);
// Add the resource_url and its original url, if non-empty and different.
if (!resource_.original_url.is_empty() &&
resource_.url != resource_.original_url) {
// Add original_url, as the parent of resource_url.
- AddUrl(resource_.original_url, GURL(), std::string(), NULL);
- AddUrl(resource_.url, resource_.original_url, std::string(), NULL);
+ AddUrl(resource_.original_url, GURL(), "", NULL);
+ AddUrl(resource_.url, resource_.original_url, "", NULL);
} else {
- AddUrl(resource_.url, GURL(), std::string(), NULL);
+ AddUrl(resource_.url, GURL(), "", NULL);
}
// Add the redirect urls, if non-empty. The redirect urls do not include the
@@ -201,13 +201,13 @@ void MalwareDetails::StartCollection() {
}
// Set the previous redirect url as the parent of the next one
for (unsigned int i = 0; i < resource_.redirect_urls.size(); ++i) {
- AddUrl(resource_.redirect_urls[i], parent_url, std::string(), NULL);
+ AddUrl(resource_.redirect_urls[i], parent_url, "", NULL);
parent_url = resource_.redirect_urls[i];
}
// Add the referrer url.
if (nav_entry && !referrer_url.is_empty()) {
- AddUrl(referrer_url, GURL(), std::string(), NULL);
+ AddUrl(referrer_url, GURL(), "", NULL);
}
// Get URLs of frames, scripts etc from the DOM.
@@ -287,7 +287,7 @@ void MalwareDetails::OnRedirectionCollectionReady() {
void MalwareDetails::AddRedirectUrlList(const std::vector<GURL>& urls) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
for (size_t i = 0; i < urls.size()-1; ++i) {
- AddUrl(urls[i], urls[i + 1], std::string(), NULL);
+ AddUrl(urls[i], urls[i+1], "", NULL);
}
}
diff --git a/chrome/browser/safe_browsing/ping_manager.cc b/chrome/browser/safe_browsing/ping_manager.cc
index 56580d00..6e73985 100644
--- a/chrome/browser/safe_browsing/ping_manager.cc
+++ b/chrome/browser/safe_browsing/ping_manager.cc
@@ -113,7 +113,7 @@ GURL SafeBrowsingPingManager::SafeBrowsingHitUrl(
threat_type == SB_THREAT_TYPE_BINARY_MALWARE_HASH ||
threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL);
std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl(
- url_prefix_, "report", client_name_, version_, std::string());
+ url_prefix_, "report", client_name_, version_, "");
std::string threat_list = "none";
switch (threat_type) {
case SB_THREAT_TYPE_URL_MALWARE:
diff --git a/chrome/browser/safe_browsing/protocol_manager_unittest.cc b/chrome/browser/safe_browsing/protocol_manager_unittest.cc
index ca89ce5..0bd9c3a 100644
--- a/chrome/browser/safe_browsing/protocol_manager_unittest.cc
+++ b/chrome/browser/safe_browsing/protocol_manager_unittest.cc
@@ -378,7 +378,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, ExistingDatabase) {
url_fetcher->set_status(net::URLRequestStatus());
url_fetcher->set_response_code(200);
- url_fetcher->SetResponseString(std::string());
+ url_fetcher->SetResponseString("");
url_fetcher->delegate()->OnURLFetchComplete(url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
@@ -424,7 +424,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseBadBodyBackupSuccess) {
// Respond to the backup successfully.
backup_url_fetcher->set_status(net::URLRequestStatus());
backup_url_fetcher->set_response_code(200);
- backup_url_fetcher->SetResponseString(std::string());
+ backup_url_fetcher->SetResponseString("");
backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
@@ -460,7 +460,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupError) {
// Go ahead and respond to it.
url_fetcher->set_status(net::URLRequestStatus());
url_fetcher->set_response_code(404);
- url_fetcher->SetResponseString(std::string());
+ url_fetcher->SetResponseString("");
url_fetcher->delegate()->OnURLFetchComplete(url_fetcher);
// There should now be a backup request.
@@ -471,7 +471,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupError) {
// Respond to the backup unsuccessfully.
backup_url_fetcher->set_status(net::URLRequestStatus());
backup_url_fetcher->set_response_code(404);
- backup_url_fetcher->SetResponseString(std::string());
+ backup_url_fetcher->SetResponseString("");
backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
@@ -507,7 +507,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupSuccess) {
// Go ahead and respond to it.
url_fetcher->set_status(net::URLRequestStatus());
url_fetcher->set_response_code(404);
- url_fetcher->SetResponseString(std::string());
+ url_fetcher->SetResponseString("");
url_fetcher->delegate()->OnURLFetchComplete(url_fetcher);
// There should now be a backup request.
@@ -519,7 +519,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupSuccess) {
// Respond to the backup successfully.
backup_url_fetcher->set_status(net::URLRequestStatus());
backup_url_fetcher->set_response_code(200);
- backup_url_fetcher->SetResponseString(std::string());
+ backup_url_fetcher->SetResponseString("");
backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
@@ -555,7 +555,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupTimeout) {
// Go ahead and respond to it.
url_fetcher->set_status(net::URLRequestStatus());
url_fetcher->set_response_code(404);
- url_fetcher->SetResponseString(std::string());
+ url_fetcher->SetResponseString("");
url_fetcher->delegate()->OnURLFetchComplete(url_fetcher);
// There should now be a backup request.
@@ -617,7 +617,7 @@ TEST_F(SafeBrowsingProtocolManagerTest,
// Respond to the backup unsuccessfully.
backup_url_fetcher->set_status(net::URLRequestStatus());
backup_url_fetcher->set_response_code(404);
- backup_url_fetcher->SetResponseString(std::string());
+ backup_url_fetcher->SetResponseString("");
backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
@@ -665,7 +665,7 @@ TEST_F(SafeBrowsingProtocolManagerTest,
// Respond to the backup unsuccessfully.
backup_url_fetcher->set_status(net::URLRequestStatus());
backup_url_fetcher->set_response_code(200);
- backup_url_fetcher->SetResponseString(std::string());
+ backup_url_fetcher->SetResponseString("");
backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
@@ -713,7 +713,7 @@ TEST_F(SafeBrowsingProtocolManagerTest,
// Respond to the backup unsuccessfully.
backup_url_fetcher->set_status(net::URLRequestStatus());
backup_url_fetcher->set_response_code(404);
- backup_url_fetcher->SetResponseString(std::string());
+ backup_url_fetcher->SetResponseString("");
backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
@@ -762,7 +762,7 @@ TEST_F(SafeBrowsingProtocolManagerTest,
// Respond to the backup unsuccessfully.
backup_url_fetcher->set_status(net::URLRequestStatus());
backup_url_fetcher->set_response_code(200);
- backup_url_fetcher->SetResponseString(std::string());
+ backup_url_fetcher->SetResponseString("");
backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
@@ -807,7 +807,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseTimeoutBackupSuccess) {
// Respond to the backup unsuccessfully.
backup_url_fetcher->set_status(net::URLRequestStatus());
backup_url_fetcher->set_response_code(200);
- backup_url_fetcher->SetResponseString(std::string());
+ backup_url_fetcher->SetResponseString("");
backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
@@ -888,7 +888,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, EmptyRedirectResponse) {
chunk_url_fetcher, "https://redirect-server.example.com/path");
chunk_url_fetcher->set_status(net::URLRequestStatus());
chunk_url_fetcher->set_response_code(200);
- chunk_url_fetcher->SetResponseString(std::string());
+ chunk_url_fetcher->SetResponseString("");
chunk_url_fetcher->delegate()->OnURLFetchComplete(chunk_url_fetcher);
EXPECT_TRUE(pm->IsUpdateScheduled());
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index 032d5ec..3d0f2d9 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -1004,8 +1004,8 @@ void SafeBrowsingBlockingPageV2::PopulateMalwareStringDictionary(
if (!CanShowMalwareDetailsOption()) {
strings->SetBoolean(kDisplayCheckBox, false);
- strings->SetString("confirm_text", std::string());
- strings->SetString(kBoxChecked, std::string());
+ strings->SetString("confirm_text", "");
+ strings->SetString(kBoxChecked, "");
} else {
// Show the checkbox for sending malware details.
strings->SetBoolean(kDisplayCheckBox, true);
@@ -1022,7 +1022,7 @@ void SafeBrowsingBlockingPageV2::PopulateMalwareStringDictionary(
if (IsPrefEnabled(prefs::kSafeBrowsingReportingEnabled))
strings->SetString(kBoxChecked, "yes");
else
- strings->SetString(kBoxChecked, std::string());
+ strings->SetString(kBoxChecked, "");
}
strings->SetString("report_error", string16());
@@ -1042,11 +1042,10 @@ void SafeBrowsingBlockingPageV2::PopulatePhishingStringDictionary(
string16(),
l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_DESCRIPTION2));
- strings->SetString("details", std::string());
- strings->SetString("confirm_text", std::string());
- strings->SetString(kBoxChecked, std::string());
- strings->SetString(
- "report_error",
+ strings->SetString("details", "");
+ strings->SetString("confirm_text", "");
+ strings->SetString(kBoxChecked, "");
+ strings->SetString("report_error",
l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR));
strings->SetBoolean(kDisplayCheckBox, false);
strings->SetString("learnMore",
diff --git a/chrome/browser/safe_browsing/safe_browsing_util.cc b/chrome/browser/safe_browsing/safe_browsing_util.cc
index 7e6710f..ef620a7 100644
--- a/chrome/browser/safe_browsing/safe_browsing_util.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_util.cc
@@ -298,10 +298,8 @@ void CanonicalizeUrl(const GURL& url,
url_unescaped_str.length(), &parsed);
// 3. In hostname, remove all leading and trailing dots.
- const std::string host =
- (parsed.host.len > 0)
- ? url_unescaped_str.substr(parsed.host.begin, parsed.host.len)
- : std::string();
+ const std::string host = (parsed.host.len > 0) ? url_unescaped_str.substr(
+ parsed.host.begin, parsed.host.len) : "";
const char kCharsToTrim[] = ".";
std::string host_without_end_dots;
TrimString(host, kCharsToTrim, &host_without_end_dots);
@@ -311,11 +309,10 @@ void CanonicalizeUrl(const GURL& url,
host_without_end_dots, '.'));
// 5. In path, replace runs of consecutive slashes with a single slash.
- std::string path =
- (parsed.path.len > 0)
- ? url_unescaped_str.substr(parsed.path.begin, parsed.path.len)
- : std::string();
- std::string path_without_consecutive_slash(RemoveConsecutiveChars(path, '/'));
+ std::string path = (parsed.path.len > 0) ? url_unescaped_str.substr(
+ parsed.path.begin, parsed.path.len): "";
+ std::string path_without_consecutive_slash(RemoveConsecutiveChars(
+ path, '/'));
url_canon::Replacements<char> hp_replacements;
hp_replacements.SetHost(host_without_consecutive_dots.data(),
diff --git a/chrome/browser/safe_browsing/two_phase_uploader.cc b/chrome/browser/safe_browsing/two_phase_uploader.cc
index df58625..9b6165e 100644
--- a/chrome/browser/safe_browsing/two_phase_uploader.cc
+++ b/chrome/browser/safe_browsing/two_phase_uploader.cc
@@ -63,7 +63,7 @@ void TwoPhaseUploader::OnURLFetchComplete(const net::URLFetcher* source) {
if (!status.is_success()) {
LOG(ERROR) << "URLFetcher failed, status=" << status.status()
<< " err=" << status.error();
- Finish(status.error(), response_code, std::string());
+ Finish(status.error(), response_code, "");
return;
}
@@ -83,7 +83,7 @@ void TwoPhaseUploader::OnURLFetchComplete(const net::URLFetcher* source) {
if (!source->GetResponseHeaders()->EnumerateHeader(
NULL, kLocationHeader, &location)) {
LOG(ERROR) << "no location header";
- Finish(net::OK, response_code, std::string());
+ Finish(net::OK, response_code, "");
return;
}
DVLOG(1) << "upload location: " << location;
diff --git a/chrome/browser/search/local_ntp_source.cc b/chrome/browser/search/local_ntp_source.cc
index 38cbd7a..d1fde35 100644
--- a/chrome/browser/search/local_ntp_source.cc
+++ b/chrome/browser/search/local_ntp_source.cc
@@ -74,7 +74,7 @@ std::string LocalNtpSource::GetMimeType(
path == kCloseBarActiveFilename) {
return "image/png";
}
- return std::string();
+ return "";
}
bool LocalNtpSource::ShouldServiceRequest(
diff --git a/chrome/browser/search/local_omnibox_popup_source.cc b/chrome/browser/search/local_omnibox_popup_source.cc
index fa2d940..1ae3c8a 100644
--- a/chrome/browser/search/local_omnibox_popup_source.cc
+++ b/chrome/browser/search/local_omnibox_popup_source.cc
@@ -76,7 +76,7 @@ std::string LocalOmniboxPopupSource::GetMimeType(
if (path == kPageIconFilename || path == kPageIcon2xFilename ||
path == kSearchIconFilename || path == kSearchIcon2xFilename)
return "image/png";
- return std::string();
+ return "";
}
bool LocalOmniboxPopupSource::ShouldServiceRequest(
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index 726bc89..83186b4 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -527,8 +527,7 @@ uint64 GetUInt64ValueForFlagWithDefault(const std::string& flag,
uint64 default_value,
const FieldTrialFlags& flags) {
uint64 value;
- std::string str_value =
- GetStringValueForFlagWithDefault(flag, std::string(), flags);
+ std::string str_value = GetStringValueForFlagWithDefault(flag, "", flags);
if (base::StringToUint64(str_value, &value))
return value;
return default_value;
diff --git a/chrome/browser/search/search_unittest.cc b/chrome/browser/search/search_unittest.cc
index 7c4bf4c..90ff642b 100644
--- a/chrome/browser/search/search_unittest.cc
+++ b/chrome/browser/search/search_unittest.cc
@@ -22,7 +22,7 @@ TEST(EmbeddedSearchFieldTrialTest, GetFieldTrialInfo) {
uint64 group_number = 0;
const uint64 ZERO = 0;
- EXPECT_FALSE(GetFieldTrialInfo(std::string(), &flags, &group_number));
+ EXPECT_FALSE(GetFieldTrialInfo("", &flags, &group_number));
EXPECT_EQ(ZERO, group_number);
EXPECT_EQ(ZERO, flags.size());
@@ -62,10 +62,9 @@ TEST(EmbeddedSearchFieldTrialTest, GetFieldTrialInfo) {
EXPECT_EQ(uint64(3), flags.size());
EXPECT_EQ(true, GetBoolValueForFlagWithDefault("bar", false, flags));
EXPECT_EQ(uint64(7), GetUInt64ValueForFlagWithDefault("baz", 0, flags));
- EXPECT_EQ("dogs",
- GetStringValueForFlagWithDefault("cat", std::string(), flags));
- EXPECT_EQ("default",
- GetStringValueForFlagWithDefault("moose", "default", flags));
+ EXPECT_EQ("dogs", GetStringValueForFlagWithDefault("cat", "", flags));
+ EXPECT_EQ("default", GetStringValueForFlagWithDefault(
+ "moose", "default", flags));
group_number = 0;
flags.clear();
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc b/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc
index aa47992..3237137 100644
--- a/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc
+++ b/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc
@@ -167,7 +167,7 @@ TEST(TemplateURLPrepopulateDataTest, ProvidersFromPrefs) {
entry->SetInteger("id", 1002);
entry->SetString("name", "bar");
entry->SetString("keyword", "bark");
- entry->SetString("encoding", std::string());
+ entry->SetString("encoding", "");
overrides->Append(entry->DeepCopy());
entry->SetInteger("id", 1003);
entry->SetString("name", "baz");
diff --git a/chrome/browser/sessions/session_restore_browsertest.cc b/chrome/browser/sessions/session_restore_browsertest.cc
index e82391e..5e2953a 100644
--- a/chrome/browser/sessions/session_restore_browsertest.cc
+++ b/chrome/browser/sessions/session_restore_browsertest.cc
@@ -985,7 +985,7 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, SessionStorageAfterTabReplace) {
ASSERT_TRUE(controller->GetDefaultSessionStorageNamespace());
content::SessionStorageNamespaceMap session_storage_namespace_map;
- session_storage_namespace_map[std::string()] =
+ session_storage_namespace_map[""] =
controller->GetDefaultSessionStorageNamespace();
scoped_ptr<content::WebContents> web_contents(
content::WebContents::CreateWithSessionStorage(
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index c0be6de..2a656fe 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -435,7 +435,7 @@ ShellIntegration::DefaultWebClientSetPermission
// static
bool ShellIntegration::SetAsDefaultBrowser() {
- return SetDefaultWebClient(std::string());
+ return SetDefaultWebClient("");
}
// static
@@ -445,7 +445,7 @@ bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) {
// static
ShellIntegration::DefaultWebClientState ShellIntegration::GetDefaultBrowser() {
- return GetIsDefaultWebClient(std::string());
+ return GetIsDefaultWebClient("");
}
// static
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc
index 8715114..0b81311 100644
--- a/chrome/browser/shell_integration_unittest.cc
+++ b/chrome/browser/shell_integration_unittest.cc
@@ -644,7 +644,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
test_cases[i].template_contents,
web_app::GenerateApplicationNameFromURL(GURL(test_cases[i].url)),
GURL(test_cases[i].url),
- std::string(),
+ "",
base::FilePath(),
ASCIIToUTF16(test_cases[i].title),
test_cases[i].icon_name,
diff --git a/chrome/browser/signin/about_signin_internals.cc b/chrome/browser/signin/about_signin_internals.cc
index e58a013..ad83b0d 100644
--- a/chrome/browser/signin/about_signin_internals.cc
+++ b/chrome/browser/signin/about_signin_internals.cc
@@ -25,8 +25,7 @@ AboutSigninInternals::AboutSigninInternals() : profile_(NULL) {
for (size_t i = 0; i < kNumTokenPrefs; ++i) {
signin_status_.token_info_map.insert(std::pair<std::string, TokenInfo>(
kTokenPrefsArray[i],
- TokenInfo(
- std::string(), "Not Loaded", std::string(), kTokenPrefsArray[i])));
+ TokenInfo("", "Not Loaded", "", kTokenPrefsArray[i])));
}
}
@@ -171,7 +170,7 @@ void AboutSigninInternals::NotifyTokenReceivedFailure(
const std::string value_pref = TokenPrefPath(token_name) + ".value";
const std::string time_pref = TokenPrefPath(token_name) + ".time";
const std::string status_pref = TokenPrefPath(token_name) + ".status";
- profile_->GetPrefs()->SetString(value_pref.c_str(), std::string());
+ profile_->GetPrefs()->SetString(value_pref.c_str(), "");
profile_->GetPrefs()->SetString(time_pref.c_str(), time_as_str);
profile_->GetPrefs()->SetString(status_pref.c_str(), error);
@@ -187,7 +186,7 @@ void AboutSigninInternals::NotifyClearStoredToken(
signin_status_.token_info_map[token_name].token.clear();
const std::string value_pref = TokenPrefPath(token_name) + ".value";
- profile_->GetPrefs()->SetString(value_pref.c_str(), std::string());
+ profile_->GetPrefs()->SetString(value_pref.c_str(), "");
NotifyObservers();
}
diff --git a/chrome/browser/signin/about_signin_internals_factory.cc b/chrome/browser/signin/about_signin_internals_factory.cc
index f5f197f..ccce353 100644
--- a/chrome/browser/signin/about_signin_internals_factory.cc
+++ b/chrome/browser/signin/about_signin_internals_factory.cc
@@ -42,8 +42,7 @@ void AboutSigninInternalsFactory::RegisterUserPrefs(
for (int i = UNTIMED_FIELDS_BEGIN; i < UNTIMED_FIELDS_END; ++i) {
const std::string pref_path = SigninStatusFieldToString(
static_cast<UntimedSigninStatusField>(i));
- user_prefs->RegisterStringPref(pref_path.c_str(),
- std::string(),
+ user_prefs->RegisterStringPref(pref_path.c_str(), "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
}
for (int i = TIMED_FIELDS_BEGIN; i < TIMED_FIELDS_END; ++i) {
@@ -51,10 +50,10 @@ void AboutSigninInternalsFactory::RegisterUserPrefs(
static_cast<TimedSigninStatusField>(i)) + ".value";
const std::string time = SigninStatusFieldToString(
static_cast<TimedSigninStatusField>(i)) + ".time";
- user_prefs->RegisterStringPref(
- value.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF);
- user_prefs->RegisterStringPref(
- time.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF);
+ user_prefs->RegisterStringPref(value.c_str(), "",
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
+ user_prefs->RegisterStringPref(time.c_str(), "",
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
}
// TokenService information for about:signin-internals.
for (size_t i = 0; i < kNumTokenPrefs; i++) {
@@ -62,12 +61,12 @@ void AboutSigninInternalsFactory::RegisterUserPrefs(
const std::string value = pref + ".value";
const std::string status = pref + ".status";
const std::string time = pref + ".time";
- user_prefs->RegisterStringPref(
- value.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF);
- user_prefs->RegisterStringPref(
- status.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF);
- user_prefs->RegisterStringPref(
- time.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF);
+ user_prefs->RegisterStringPref(value.c_str(), "",
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
+ user_prefs->RegisterStringPref(status.c_str(), "",
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
+ user_prefs->RegisterStringPref(time.c_str(), "",
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
}
}
diff --git a/chrome/browser/signin/oauth2_token_service_unittest.cc b/chrome/browser/signin/oauth2_token_service_unittest.cc
index 7095b43..3649374 100644
--- a/chrome/browser/signin/oauth2_token_service_unittest.cc
+++ b/chrome/browser/signin/oauth2_token_service_unittest.cc
@@ -138,7 +138,7 @@ TEST_F(OAuth2TokenServiceTest, FailureShouldNotRetry) {
net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
EXPECT_TRUE(fetcher);
fetcher->set_response_code(net::HTTP_UNAUTHORIZED);
- fetcher->SetResponseString(std::string());
+ fetcher->SetResponseString("");
fetcher->delegate()->OnURLFetchComplete(fetcher);
EXPECT_EQ(0, consumer_.number_of_correct_tokens_);
EXPECT_EQ(1, consumer_.number_of_errors_);
@@ -251,7 +251,7 @@ TEST_F(OAuth2TokenServiceTest, SuccessAndExpirationAndFailure) {
fetcher = factory_.GetFetcherByID(0);
EXPECT_TRUE(fetcher);
fetcher->set_response_code(net::HTTP_UNAUTHORIZED);
- fetcher->SetResponseString(std::string());
+ fetcher->SetResponseString("");
fetcher->delegate()->OnURLFetchComplete(fetcher);
EXPECT_EQ(1, consumer_.number_of_correct_tokens_);
EXPECT_EQ(1, consumer_.number_of_errors_);
@@ -374,7 +374,7 @@ TEST_F(OAuth2TokenServiceTest, SuccessAndSignOutAndRequest) {
// Signs out
service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
- std::string());
+ "");
service_->EraseTokensFromDB();
request = oauth2_service_->StartRequest(std::set<std::string>(), &consumer_);
@@ -404,7 +404,7 @@ TEST_F(OAuth2TokenServiceTest, SuccessAndSignOutAndSignInAndSuccess) {
// Signs out and signs in
service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
- std::string());
+ "");
service_->EraseTokensFromDB();
service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
"refreshToken");
@@ -486,7 +486,7 @@ TEST_F(OAuth2TokenServiceTest, RetryingConsumer) {
net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
EXPECT_TRUE(fetcher);
fetcher->set_response_code(net::HTTP_UNAUTHORIZED);
- fetcher->SetResponseString(std::string());
+ fetcher->SetResponseString("");
fetcher->delegate()->OnURLFetchComplete(fetcher);
EXPECT_EQ(0, consumer.number_of_correct_tokens_);
EXPECT_EQ(1, consumer.number_of_errors_);
@@ -494,7 +494,7 @@ TEST_F(OAuth2TokenServiceTest, RetryingConsumer) {
fetcher = factory_.GetFetcherByID(0);
EXPECT_TRUE(fetcher);
fetcher->set_response_code(net::HTTP_UNAUTHORIZED);
- fetcher->SetResponseString(std::string());
+ fetcher->SetResponseString("");
fetcher->delegate()->OnURLFetchComplete(fetcher);
EXPECT_EQ(0, consumer.number_of_correct_tokens_);
EXPECT_EQ(2, consumer.number_of_errors_);
diff --git a/chrome/browser/signin/signin_internals_util.cc b/chrome/browser/signin/signin_internals_util.cc
index f187418..adae0a1 100644
--- a/chrome/browser/signin/signin_internals_util.cc
+++ b/chrome/browser/signin/signin_internals_util.cc
@@ -98,11 +98,11 @@ std::string SigninStatusFieldToString(UntimedSigninStatusField field) {
ENUM_CASE(LSID);
case UNTIMED_FIELDS_END:
NOTREACHED();
- return std::string();
+ return "";
}
NOTREACHED();
- return std::string();
+ return "";
}
std::string SigninStatusFieldToString(TimedSigninStatusField field) {
@@ -113,11 +113,11 @@ std::string SigninStatusFieldToString(TimedSigninStatusField field) {
ENUM_CASE(GET_USER_INFO_STATUS);
case TIMED_FIELDS_END:
NOTREACHED();
- return std::string();
+ return "";
}
NOTREACHED();
- return std::string();
+ return "";
}
SigninStatus::SigninStatus()
@@ -203,10 +203,10 @@ std::string SigninStatusFieldToLabel(UntimedSigninStatusField field) {
return "Sid (Hash)";
case UNTIMED_FIELDS_END:
NOTREACHED();
- return std::string();
+ return "";
}
NOTREACHED();
- return std::string();
+ return "";
}
TimedSigninStatusValue SigninStatusFieldToLabel(
@@ -226,10 +226,10 @@ TimedSigninStatusValue SigninStatusFieldToLabel(
"Last OnGetUserInfo Time");
case TIMED_FIELDS_END:
NOTREACHED();
- return TimedSigninStatusValue("Error", std::string());
+ return TimedSigninStatusValue("Error", "");
}
NOTREACHED();
- return TimedSigninStatusValue("Error", std::string());
+ return TimedSigninStatusValue("Error", "");
}
} // namespace
diff --git a/chrome/browser/signin/signin_manager.cc b/chrome/browser/signin/signin_manager.cc
index ab5befc..a8bc081 100644
--- a/chrome/browser/signin/signin_manager.cc
+++ b/chrome/browser/signin/signin_manager.cc
@@ -305,9 +305,10 @@ std::string SigninManager::SigninTypeToString(
}
NOTREACHED();
- return std::string();
+ return "";
}
+
bool SigninManager::PrepareForSignin(SigninType type,
const std::string& username,
const std::string& password) {
@@ -467,8 +468,7 @@ void SigninManager::StartSignInWithOAuth(const std::string& username,
scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope());
const std::string& locale = g_browser_process->GetApplicationLocale();
- client_login_->StartClientOAuth(
- username, password, scopes, std::string(), locale);
+ client_login_->StartClientOAuth(username, password, scopes, "", locale);
// Register for token availability. The signin manager will pre-login the
// user when the GAIA service token is ready for use. Only do this if we
@@ -549,9 +549,10 @@ void SigninManager::SignOut() {
profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesUsername);
// Erase (now) stale information from AboutSigninInternals.
- NotifyDiagnosticsObservers(USERNAME, std::string());
- NotifyDiagnosticsObservers(LSID, std::string());
- NotifyDiagnosticsObservers(signin_internals_util::SID, std::string());
+ NotifyDiagnosticsObservers(USERNAME, "");
+ NotifyDiagnosticsObservers(LSID, "");
+ NotifyDiagnosticsObservers(
+ signin_internals_util::SID, "");
TokenService* token_service = TokenServiceFactory::GetForProfile(profile_);
content::NotificationService::current()->Notify(
diff --git a/chrome/browser/signin/signin_manager_factory.cc b/chrome/browser/signin/signin_manager_factory.cc
index 11dd5e6..67e33c0 100644
--- a/chrome/browser/signin/signin_manager_factory.cc
+++ b/chrome/browser/signin/signin_manager_factory.cc
@@ -39,11 +39,9 @@ SigninManagerFactory* SigninManagerFactory::GetInstance() {
}
void SigninManagerFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) {
- registry->RegisterStringPref(prefs::kGoogleServicesLastUsername,
- std::string(),
+ registry->RegisterStringPref(prefs::kGoogleServicesLastUsername, "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
- registry->RegisterStringPref(prefs::kGoogleServicesUsername,
- std::string(),
+ registry->RegisterStringPref(prefs::kGoogleServicesUsername, "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kAutologinEnabled, true,
PrefRegistrySyncable::UNSYNCABLE_PREF);
@@ -56,8 +54,7 @@ void SigninManagerFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) {
// static
void SigninManagerFactory::RegisterPrefs(PrefRegistrySimple* registry) {
- registry->RegisterStringPref(prefs::kGoogleServicesUsernamePattern,
- std::string());
+ registry->RegisterStringPref(prefs::kGoogleServicesUsernamePattern, "");
}
ProfileKeyedService* SigninManagerFactory::BuildServiceInstanceFor(
diff --git a/chrome/browser/signin/signin_manager_unittest.cc b/chrome/browser/signin/signin_manager_unittest.cc
index c49f7a1..79964d0 100644
--- a/chrome/browser/signin/signin_manager_unittest.cc
+++ b/chrome/browser/signin/signin_manager_unittest.cc
@@ -308,8 +308,7 @@ TEST_F(SigninManagerTest, SignInClientLogin) {
manager_->Initialize(profile_.get());
EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
- manager_->StartSignIn(
- "user@gmail.com", "password", std::string(), std::string());
+ manager_->StartSignIn("user@gmail.com", "password", "", "");
EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
SimulateValidResponseClientLogin(true);
@@ -341,7 +340,7 @@ TEST_F(SigninManagerTest, Prohibited) {
EXPECT_TRUE(manager_->IsAllowedUsername("happy@google.com"));
EXPECT_FALSE(manager_->IsAllowedUsername("test@invalid.com"));
EXPECT_FALSE(manager_->IsAllowedUsername("test@notgoogle.com"));
- EXPECT_FALSE(manager_->IsAllowedUsername(std::string()));
+ EXPECT_FALSE(manager_->IsAllowedUsername(""));
}
TEST_F(SigninManagerTest, TestAlternateWildcard) {
@@ -354,7 +353,7 @@ TEST_F(SigninManagerTest, TestAlternateWildcard) {
EXPECT_TRUE(manager_->IsAllowedUsername("happy@google.com"));
EXPECT_FALSE(manager_->IsAllowedUsername("test@invalid.com"));
EXPECT_FALSE(manager_->IsAllowedUsername("test@notgoogle.com"));
- EXPECT_FALSE(manager_->IsAllowedUsername(std::string()));
+ EXPECT_FALSE(manager_->IsAllowedUsername(""));
}
TEST_F(SigninManagerTest, ProhibitedAtStartup) {
@@ -422,7 +421,7 @@ TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordValidCookie) {
net::CookieMonster::SetCookiesCallback());
// Since the password is empty, will verify the gaia cookies first.
- manager_->StartSignInWithCredentials("0", "user@gmail.com", std::string());
+ manager_->StartSignInWithCredentials("0", "user@gmail.com", "");
WaitUntilUIDone();
@@ -435,7 +434,7 @@ TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordNoValidCookie) {
EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
// Since the password is empty, will verify the gaia cookies first.
- manager_->StartSignInWithCredentials("0", "user@gmail.com", std::string());
+ manager_->StartSignInWithCredentials("0", "user@gmail.com", "");
WaitUntilUIDone();
@@ -459,7 +458,7 @@ TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordInValidCookie) {
net::CookieMonster::SetCookiesCallback());
// Since the password is empty, must verify the gaia cookies first.
- manager_->StartSignInWithCredentials("0", "user@gmail.com", std::string());
+ manager_->StartSignInWithCredentials("0", "user@gmail.com", "");
WaitUntilUIDone();
@@ -472,7 +471,7 @@ TEST_F(SigninManagerTest, SignInClientLoginNoGPlus) {
manager_->Initialize(profile_.get());
EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
- manager_->StartSignIn("username", "password", std::string(), std::string());
+ manager_->StartSignIn("username", "password", "", "");
EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
SimulateValidResponseClientLogin(false);
@@ -483,7 +482,7 @@ TEST_F(SigninManagerTest, ClearTransientSigninData) {
manager_->Initialize(profile_.get());
EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
- manager_->StartSignIn("username", "password", std::string(), std::string());
+ manager_->StartSignIn("username", "password", "", "");
EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
SimulateValidResponseClientLogin(false);
@@ -514,7 +513,7 @@ TEST_F(SigninManagerTest, ClearTransientSigninData) {
TEST_F(SigninManagerTest, SignOutClientLogin) {
manager_->Initialize(profile_.get());
- manager_->StartSignIn("username", "password", std::string(), std::string());
+ manager_->StartSignIn("username", "password", "", "");
SimulateValidResponseClientLogin(false);
manager_->OnClientLoginSuccess(credentials_);
@@ -530,7 +529,7 @@ TEST_F(SigninManagerTest, SignOutClientLogin) {
TEST_F(SigninManagerTest, SignInFailureClientLogin) {
manager_->Initialize(profile_.get());
- manager_->StartSignIn("username", "password", std::string(), std::string());
+ manager_->StartSignIn("username", "password", "", "");
GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
manager_->OnClientLoginFailure(error);
@@ -548,7 +547,7 @@ TEST_F(SigninManagerTest, SignInFailureClientLogin) {
TEST_F(SigninManagerTest, ProvideSecondFactorSuccess) {
manager_->Initialize(profile_.get());
- manager_->StartSignIn("username", "password", std::string(), std::string());
+ manager_->StartSignIn("username", "password", "", "");
GoogleServiceAuthError error(GoogleServiceAuthError::TWO_FACTOR);
manager_->OnClientLoginFailure(error);
@@ -567,7 +566,7 @@ TEST_F(SigninManagerTest, ProvideSecondFactorSuccess) {
TEST_F(SigninManagerTest, ProvideSecondFactorFailure) {
manager_->Initialize(profile_.get());
- manager_->StartSignIn("username", "password", std::string(), std::string());
+ manager_->StartSignIn("username", "password", "", "");
GoogleServiceAuthError error1(GoogleServiceAuthError::TWO_FACTOR);
manager_->OnClientLoginFailure(error1);
@@ -597,7 +596,7 @@ TEST_F(SigninManagerTest, ProvideSecondFactorFailure) {
TEST_F(SigninManagerTest, SignOutMidConnect) {
manager_->Initialize(profile_.get());
- manager_->StartSignIn("username", "password", std::string(), std::string());
+ manager_->StartSignIn("username", "password", "", "");
manager_->SignOut();
EXPECT_EQ(0U, google_login_success_.size());
EXPECT_EQ(0U, google_login_failure_.size());
diff --git a/chrome/browser/signin/token_service_unittest.cc b/chrome/browser/signin/token_service_unittest.cc
index fbe83df..617a394 100644
--- a/chrome/browser/signin/token_service_unittest.cc
+++ b/chrome/browser/signin/token_service_unittest.cc
@@ -225,7 +225,7 @@ TEST_F(TokenServiceTest, OnTokenSuccessUpdate) {
EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService),
"token2");
- service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, std::string());
+ service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "");
EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService), "");
}
diff --git a/chrome/browser/spellchecker/spelling_service_client_unittest.cc b/chrome/browser/spellchecker/spelling_service_client_unittest.cc
index 5833fce..d3243e8 100644
--- a/chrome/browser/spellchecker/spelling_service_client_unittest.cc
+++ b/chrome/browser/spellchecker/spelling_service_client_unittest.cc
@@ -343,7 +343,7 @@ TEST_F(SpellingServiceClientTest, AvailableServices) {
// SpellingServiceClient::IsAvailable() describes why this function returns
// false for suggestions.) If there is no language set, then we
// do not allow any remote.
- pref->SetString(prefs::kSpellCheckDictionary, std::string());
+ pref->SetString(prefs::kSpellCheckDictionary, "");
EXPECT_FALSE(client_.IsAvailable(&profile_, kSuggest));
EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck));
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index 615c4c6..6942d1e 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -218,9 +218,9 @@ std::string SSLBlockingPage::GetHTMLContents() {
l10n_util::GetStringUTF16(
IDS_SSL_ERROR_PAGE_CANNOT_PROCEED));
} else {
- strings.SetString("reasonForNotProceeding", std::string());
+ strings.SetString("reasonForNotProceeding", "");
}
- strings.SetString("errorType", std::string());
+ strings.SetString("errorType", "");
}
strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr");
@@ -318,6 +318,6 @@ void SSLBlockingPage::SetExtraInfo(
strings->SetString(keys[i], extra_info[i]);
}
for (; i < 5; i++) {
- strings->SetString(keys[i], std::string());
+ strings->SetString(keys[i], "");
}
}
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc
index d4afe0f..42cfbf6 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -738,9 +738,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestHTTPSErrorWithNoNavEntry) {
IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadHTTPSDownload) {
ASSERT_TRUE(test_server()->Start());
ASSERT_TRUE(https_server_expired_.Start());
- GURL url_non_dangerous = test_server()->GetURL(std::string());
- GURL url_dangerous =
- https_server_expired_.GetURL("files/downloads/dangerous/dangerous.exe");
+ GURL url_non_dangerous = test_server()->GetURL("");
+ GURL url_dangerous = https_server_expired_.GetURL(
+ "files/downloads/dangerous/dangerous.exe");
base::ScopedTempDir downloads_directory_;
// Need empty temp dir to avoid having Chrome ask us for a new filename
diff --git a/chrome/browser/storage_monitor/media_storage_util.cc b/chrome/browser/storage_monitor/media_storage_util.cc
index dc9c61b..72602fa 100644
--- a/chrome/browser/storage_monitor/media_storage_util.cc
+++ b/chrome/browser/storage_monitor/media_storage_util.cc
@@ -187,9 +187,8 @@ std::string MediaStorageUtil::MakeDeviceId(Type type,
bool MediaStorageUtil::CrackDeviceId(const std::string& device_id,
Type* type, std::string* unique_id) {
size_t prefix_length = device_id.find_first_of(':');
- std::string prefix = prefix_length != std::string::npos
- ? device_id.substr(0, prefix_length + 1)
- : std::string();
+ std::string prefix = prefix_length != std::string::npos ?
+ device_id.substr(0, prefix_length + 1) : "";
Type found_type;
if (prefix == kRemovableMassStorageWithDCIMPrefix) {
diff --git a/chrome/browser/sync/glue/session_model_associator_unittest.cc b/chrome/browser/sync/glue/session_model_associator_unittest.cc
index e5ceab1e..d1f63bb 100644
--- a/chrome/browser/sync/glue/session_model_associator_unittest.cc
+++ b/chrome/browser/sync/glue/session_model_associator_unittest.cc
@@ -375,7 +375,7 @@ TEST_F(SyncSessionModelAssociatorTest, SetSessionTabFromDelegate) {
// Create tab specifics with an empty favicon. Ensure it gets ignored and not
// stored into the synced favicon lookups.
TEST_F(SyncSessionModelAssociatorTest, LoadEmptyFavicon) {
- std::string favicon;
+ std::string favicon = "";
std::string favicon_url = "http://www.faviconurl.com/favicon.ico";
std::string page_url = "http://www.faviconurl.com/page.html";
sync_pb::SessionTab tab;
diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
index d05dd46..96d1acb 100644
--- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
@@ -194,7 +194,7 @@ class SyncBackendHostTest : public testing::Test {
WillOnce(InvokeWithoutArgs(QuitMessageLoop));
backend_->Initialize(&mock_frontend_,
syncer::WeakHandle<syncer::JsEventHandler>(),
- GURL(std::string()),
+ GURL(""),
credentials_,
true,
&fake_manager_factory_,
diff --git a/chrome/browser/sync/glue/synced_session.h b/chrome/browser/sync/glue/synced_session.h
index 80ff9be..a1d0d68 100644
--- a/chrome/browser/sync/glue/synced_session.h
+++ b/chrome/browser/sync/glue/synced_session.h
@@ -74,7 +74,7 @@ struct SyncedSession {
case SyncedSession::TYPE_TABLET:
return "tablet";
default:
- return std::string();
+ return "";
}
}
diff --git a/chrome/browser/sync/invalidations/invalidator_storage.cc b/chrome/browser/sync/invalidations/invalidator_storage.cc
index e88d0e2..acbbd47 100644
--- a/chrome/browser/sync/invalidations/invalidator_storage.cc
+++ b/chrome/browser/sync/invalidations/invalidator_storage.cc
@@ -282,10 +282,8 @@ void InvalidatorStorage::SetBootstrapData(const std::string& data) {
}
std::string InvalidatorStorage::GetBootstrapData() const {
- std::string base64_data(
- pref_service_
- ? pref_service_->GetString(prefs::kInvalidatorInvalidationState)
- : std::string());
+ std::string base64_data(pref_service_ ?
+ pref_service_->GetString(prefs::kInvalidatorInvalidationState) : "");
std::string data;
base::Base64Decode(base64_data, &data);
return data;
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index a58fff4..2d8bbd3 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -726,7 +726,7 @@ void ProfileSyncService::ClearUnrecoverableError() {
std::string ProfileSyncService::GetExperimentNameForDataType(
syncer::ModelType data_type) {
NOTREACHED();
- return std::string();
+ return "";
}
void ProfileSyncService::RegisterNewDataType(syncer::ModelType data_type) {
diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
index 1ad62a1..bc62c97 100644
--- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
@@ -706,9 +706,9 @@ TEST_F(ProfileSyncServiceBookmarkTest, ServerChangeProcessing) {
"'about:blank','gnotesWin','location=0,menubar=0," \
"scrollbars=0,status=0,toolbar=0,width=300," \
"height=300,resizable');});");
- adds.AddURL(std::wstring(), javascript_url, other_bookmarks_id(), 0);
- int64 u6 = adds.AddURL(
- L"Sync1", "http://www.syncable.edu/", mobile_bookmarks_id(), 0);
+ adds.AddURL(L"", javascript_url, other_bookmarks_id(), 0);
+ int64 u6 = adds.AddURL(L"Sync1", "http://www.syncable.edu/",
+ mobile_bookmarks_id(), 0);
syncer::ChangeRecordList::const_iterator it;
// The bookmark model shouldn't yet have seen any of the nodes of |adds|.
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index eb0b074..c290374 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -134,7 +134,7 @@ ProfileSyncServiceHarness* ProfileSyncServiceHarness::CreateAndAttach(
NOTREACHED() << "Profile has never signed into sync.";
return NULL;
}
- return new ProfileSyncServiceHarness(profile, std::string(), std::string());
+ return new ProfileSyncServiceHarness(profile, "", "");
}
void ProfileSyncServiceHarness::SetCredentials(const std::string& username,
@@ -179,8 +179,7 @@ bool ProfileSyncServiceHarness::SetupSync(
service_->SetSetupInProgress(true);
// Authenticate sync client using GAIA credentials.
- service_->signin()
- ->StartSignIn(username_, password_, std::string(), std::string());
+ service_->signin()->StartSignIn(username_, password_, "", "");
// Wait for the OnBackendInitialized() callback.
if (!AwaitBackendInitialized()) {
@@ -1015,7 +1014,7 @@ std::string ProfileSyncServiceHarness::GetSerializedProgressMarker(
syncer::ProgressMarkerMap::const_iterator it =
markers_map.find(model_type);
- return (it != markers_map.end()) ? it->second : std::string();
+ return (it != markers_map.end()) ? it->second : "";
}
std::string ProfileSyncServiceHarness::GetClientInfoString(
diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc
index 4ed28ab..1ee92a6 100644
--- a/chrome/browser/sync/profile_sync_service_session_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc
@@ -85,10 +85,8 @@ class FakeProfileSyncService : public TestProfileSyncService {
virtual ~FakeProfileSyncService() {}
virtual scoped_ptr<DeviceInfo> GetLocalDeviceInfo() const OVERRIDE {
- return scoped_ptr<DeviceInfo>(new DeviceInfo("client_name",
- std::string(),
- std::string(),
- sync_pb::SyncEnums::TYPE_WIN));
+ return scoped_ptr<DeviceInfo>(
+ new DeviceInfo("client_name", "", "", sync_pb::SyncEnums::TYPE_WIN));
}
};
diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
index d85946e..1a00308 100644
--- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
@@ -189,10 +189,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartFirstTime) {
// Create some tokens in the token service; the service will startup when
// it is notified that tokens are available.
sync_->SetSetupInProgress(true);
- sync_->signin()
- ->StartSignIn("test_user", std::string(), std::string(), std::string());
- TokenServiceFactory::GetForProfile(profile_.get())
- ->IssueAuthTokenForTest(GaiaConstants::kSyncService, "sync_token");
+ sync_->signin()->StartSignIn("test_user", "", "", "");
+ TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
+ GaiaConstants::kSyncService, "sync_token");
TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
GaiaConstants::kGaiaOAuth2LoginRefreshToken, "oauth2_login_token");
sync_->SetSetupInProgress(false);
@@ -236,8 +235,7 @@ TEST_F(ProfileSyncServiceStartupTest, StartNoCredentials) {
EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
sync_->SetSetupInProgress(true);
- sync_->signin()
- ->StartSignIn("test_user", std::string(), std::string(), std::string());
+ sync_->signin()->StartSignIn("test_user", "", "", "");
// NOTE: Unlike StartFirstTime, this test does not issue any auth tokens.
token_service->LoadTokensFromDB();
sync_->SetSetupInProgress(false);
@@ -271,10 +269,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartInvalidCredentials) {
EXPECT_CALL(*data_type_manager, Stop()).Times(1);
EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
sync_->SetSetupInProgress(true);
- sync_->signin()
- ->StartSignIn("test_user", std::string(), std::string(), std::string());
- token_service->IssueAuthTokenForTest(GaiaConstants::kSyncService,
- "sync_token");
+ sync_->signin()->StartSignIn("test_user", "", "", "");
+ token_service->IssueAuthTokenForTest(
+ GaiaConstants::kSyncService, "sync_token");
sync_->SetSetupInProgress(false);
MessageLoop::current()->Run();
diff --git a/chrome/browser/sync/sync_prefs.cc b/chrome/browser/sync/sync_prefs.cc
index a5c58e8..0c7a4bd 100644
--- a/chrome/browser/sync/sync_prefs.cc
+++ b/chrome/browser/sync/sync_prefs.cc
@@ -87,10 +87,10 @@ void SyncPrefs::RegisterUserPrefs(PrefRegistrySyncable* registry) {
false,
PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterStringPref(prefs::kSyncEncryptionBootstrapToken,
- std::string(),
+ "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterStringPref(prefs::kSyncKeystoreEncryptionBootstrapToken,
- std::string(),
+ "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
#if defined(OS_CHROMEOS)
registry->RegisterStringPref(prefs::kSyncSpareBootstrapToken,
@@ -99,7 +99,7 @@ void SyncPrefs::RegisterUserPrefs(PrefRegistrySyncable* registry) {
#endif
registry->RegisterStringPref(prefs::kSyncSessionsGUID,
- std::string(),
+ "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
// We will start prompting people about new data types after the launch of
@@ -181,9 +181,9 @@ void SyncPrefs::SetStartSuppressed(bool is_suppressed) {
std::string SyncPrefs::GetGoogleServicesUsername() const {
DCHECK(CalledOnValidThread());
- return pref_service_
- ? pref_service_->GetString(prefs::kGoogleServicesUsername)
- : std::string();
+ return
+ pref_service_ ?
+ pref_service_->GetString(prefs::kGoogleServicesUsername) : "";
}
base::Time SyncPrefs::GetLastSyncedTime() const {
@@ -266,9 +266,9 @@ bool SyncPrefs::IsManaged() const {
std::string SyncPrefs::GetEncryptionBootstrapToken() const {
DCHECK(CalledOnValidThread());
- return pref_service_
- ? pref_service_->GetString(prefs::kSyncEncryptionBootstrapToken)
- : std::string();
+ return
+ pref_service_ ?
+ pref_service_->GetString(prefs::kSyncEncryptionBootstrapToken) : "";
}
void SyncPrefs::SetEncryptionBootstrapToken(const std::string& token) {
@@ -278,9 +278,10 @@ void SyncPrefs::SetEncryptionBootstrapToken(const std::string& token) {
std::string SyncPrefs::GetKeystoreEncryptionBootstrapToken() const {
DCHECK(CalledOnValidThread());
- return pref_service_ ? pref_service_->GetString(
- prefs::kSyncKeystoreEncryptionBootstrapToken)
- : std::string();
+ return
+ pref_service_ ?
+ pref_service_->GetString(prefs::kSyncKeystoreEncryptionBootstrapToken) :
+ "";
}
void SyncPrefs::SetKeystoreEncryptionBootstrapToken(const std::string& token) {
@@ -290,8 +291,9 @@ void SyncPrefs::SetKeystoreEncryptionBootstrapToken(const std::string& token) {
std::string SyncPrefs::GetSyncSessionsGUID() const {
DCHECK(CalledOnValidThread());
- return pref_service_ ? pref_service_->GetString(prefs::kSyncSessionsGUID)
- : std::string();
+ return
+ pref_service_ ?
+ pref_service_->GetString(prefs::kSyncSessionsGUID) : "";
}
void SyncPrefs::SetSyncSessionsGUID(const std::string& guid) {
diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.cc b/chrome/browser/sync/test/integration/sync_extension_helper.cc
index fc007af9..84cf7547 100644
--- a/chrome/browser/sync/test/integration/sync_extension_helper.cc
+++ b/chrome/browser/sync/test/integration/sync_extension_helper.cc
@@ -63,7 +63,7 @@ std::string SyncExtensionHelper::InstallExtension(
scoped_refptr<Extension> extension = GetExtension(profile, name, type);
if (!extension.get()) {
NOTREACHED() << "Could not install extension " << name;
- return std::string();
+ return "";
}
profile->GetExtensionService()->OnExtensionInstalled(
extension, syncer::StringOrdinal(), false /* no requirement errors */,
diff --git a/chrome/browser/sync_file_system/drive_file_sync_client.cc b/chrome/browser/sync_file_system/drive_file_sync_client.cc
index 7f8903a..b6c8095 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_client.cc
+++ b/chrome/browser/sync_file_system/drive_file_sync_client.cc
@@ -129,7 +129,7 @@ DriveFileSyncClient::DriveFileSyncClient(Profile* profile)
drive_service_.reset(new google_apis::GDataWapiService(
profile->GetRequestContext(),
GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction),
- std::string() /* custom_user_agent */));
+ "" /* custom_user_agent */));
drive_service_->Initialize(profile);
drive_service_->AddObserver(this);
net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
diff --git a/chrome/browser/sync_file_system/drive_file_sync_service.cc b/chrome/browser/sync_file_system/drive_file_sync_service.cc
index 15691f49..c7a12a7 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_service.cc
+++ b/chrome/browser/sync_file_system/drive_file_sync_service.cc
@@ -411,8 +411,7 @@ void DriveFileSyncService::RegisterOriginForTrackingChanges(
void DriveFileSyncService::UnregisterOriginForTrackingChanges(
const GURL& origin,
const SyncStatusCallback& callback) {
- scoped_ptr<TaskToken> token(
- GetToken(FROM_HERE, TASK_TYPE_DATABASE, std::string()));
+ scoped_ptr<TaskToken> token(GetToken(FROM_HERE, TASK_TYPE_DATABASE, ""));
if (!token) {
pending_tasks_.push_back(base::Bind(
&DriveFileSyncService::UnregisterOriginForTrackingChanges,
@@ -443,8 +442,7 @@ void DriveFileSyncService::EnableOriginForTrackingChanges(
if (!metadata_store_->IsOriginDisabled(origin))
return;
- scoped_ptr<TaskToken> token(
- GetToken(FROM_HERE, TASK_TYPE_DATABASE, std::string()));
+ scoped_ptr<TaskToken> token(GetToken(FROM_HERE, TASK_TYPE_DATABASE, ""));
if (!token) {
pending_tasks_.push_back(base::Bind(
&DriveFileSyncService::EnableOriginForTrackingChanges,
@@ -465,8 +463,7 @@ void DriveFileSyncService::DisableOriginForTrackingChanges(
!metadata_store_->IsIncrementalSyncOrigin(origin))
return;
- scoped_ptr<TaskToken> token(
- GetToken(FROM_HERE, TASK_TYPE_DATABASE, std::string()));
+ scoped_ptr<TaskToken> token(GetToken(FROM_HERE, TASK_TYPE_DATABASE, ""));
if (!token) {
pending_tasks_.push_back(base::Bind(
&DriveFileSyncService::DisableOriginForTrackingChanges,
diff --git a/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc b/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc
index 47d6bdb..fd5ca6f 100644
--- a/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc
+++ b/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc
@@ -301,7 +301,7 @@ IN_PROC_BROWSER_TEST_F(SpellingMenuObserverTest, EnableSpellingService) {
new SpellingMenuObserver(menu.get()));
menu->SetObserver(observer.get());
menu->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, true);
- menu->GetPrefs()->SetString(prefs::kSpellCheckDictionary, std::string());
+ menu->GetPrefs()->SetString(prefs::kSpellCheckDictionary, "");
content::ContextMenuParams params;
params.is_editable = true;
diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc
index 8fa7d25..8a1829f 100644
--- a/chrome/browser/themes/theme_syncable_service_unittest.cc
+++ b/chrome/browser/themes/theme_syncable_service_unittest.cc
@@ -104,7 +104,7 @@ class FakeThemeService : public ThemeService {
if (theme_extension_)
return theme_extension_->id();
else
- return std::string();
+ return "";
}
const extensions::Extension* theme_extension() const {
diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc
index 8f2b12d..1078295 100644
--- a/chrome/browser/translate/translate_manager_browsertest.cc
+++ b/chrome/browser/translate/translate_manager_browsertest.cc
@@ -538,7 +538,7 @@ TEST_F(TranslateManagerBrowserTest, TranslateUnknownLanguage) {
RenderViewHostTester::TestOnMessageReceived(
rvh(),
ChromeViewHostMsg_PageTranslated(
- 2, 0, std::string(), "en", TranslateErrors::UNKNOWN_LANGUAGE));
+ 2, 0, "", "en", TranslateErrors::UNKNOWN_LANGUAGE));
infobar = GetTranslateInfoBar();
ASSERT_TRUE(infobar != NULL);
EXPECT_EQ(TranslateInfoBarDelegate::TRANSLATION_ERROR,
diff --git a/chrome/browser/translate/translate_manager_unittest.cc b/chrome/browser/translate/translate_manager_unittest.cc
index 6b176a1..9b25c95 100644
--- a/chrome/browser/translate/translate_manager_unittest.cc
+++ b/chrome/browser/translate/translate_manager_unittest.cc
@@ -16,7 +16,7 @@
typedef testing::Test TranslateManagerTest;
TEST_F(TranslateManagerTest, CheckTranslatableURL) {
- GURL empty_url = GURL(std::string());
+ GURL empty_url = GURL("");
EXPECT_FALSE(TranslateManager::IsTranslatableURL(empty_url));
std::string chrome = std::string(chrome::kChromeUIScheme) + "://flags";
diff --git a/chrome/browser/ui/app_list/app_list_service.cc b/chrome/browser/ui/app_list/app_list_service.cc
index a0bf010..f02da1e 100644
--- a/chrome/browser/ui/app_list/app_list_service.cc
+++ b/chrome/browser/ui/app_list/app_list_service.cc
@@ -66,7 +66,7 @@ void AppListService::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterIntegerPref(prefs::kAppListLaunchCount, 0);
registry->RegisterInt64Pref(prefs::kLastAppListAppLaunchPing, 0);
registry->RegisterIntegerPref(prefs::kAppListAppLaunchCount, 0);
- registry->RegisterStringPref(prefs::kAppListProfile, std::string());
+ registry->RegisterStringPref(prefs::kAppListProfile, "");
#if defined(OS_WIN)
registry->RegisterBooleanPref(prefs::kRestartWithAppList, false);
#endif
diff --git a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc
index 844f210..2ee22c3 100644
--- a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc
+++ b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc
@@ -110,8 +110,10 @@ void BlockedContentTabHelper::AddPopup(content::WebContents* new_contents,
if (creator.is_valid() &&
profile->GetHostContentSettingsMap()->GetContentSetting(
- creator, creator, CONTENT_SETTINGS_TYPE_POPUPS, std::string()) ==
- CONTENT_SETTING_ALLOW) {
+ creator,
+ creator,
+ CONTENT_SETTINGS_TYPE_POPUPS,
+ "") == CONTENT_SETTING_ALLOW) {
content::WebContentsDelegate* delegate = web_contents()->GetDelegate();
if (delegate) {
delegate->AddNewContents(web_contents(),
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index a31b4b0..47f07ca 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -813,13 +813,9 @@ void Browser::OpenFile() {
ui::SelectFileDialog::FileTypeInfo file_types;
file_types.support_drive = true;
select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_OPEN_FILE,
- string16(),
- directory,
- &file_types,
- 0,
- base::FilePath::StringType(),
- parent_window,
- NULL);
+ string16(), directory,
+ &file_types, 0, FILE_PATH_LITERAL(""),
+ parent_window, NULL);
}
void Browser::UpdateDownloadShelfVisibility(bool visible) {
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index e253102..5e6b769 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -558,7 +558,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) {
base::FilePath(kDocRoot));
ASSERT_TRUE(https_test_server.Start());
GURL http_url(test_server()->GetURL("files/title1.html"));
- GURL https_url(https_test_server.GetURL(std::string()));
+ GURL https_url(https_test_server.GetURL(""));
// Start with an http URL.
ui_test_utils::NavigateToURL(browser(), http_url);
@@ -647,7 +647,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) {
base::FilePath(kDocRoot));
ASSERT_TRUE(https_test_server.Start());
GURL http_url(test_server()->GetURL("files/title1.html"));
- GURL https_url(https_test_server.GetURL(std::string()));
+ GURL https_url(https_test_server.GetURL(""));
// Start with an http URL.
ui_test_utils::NavigateToURL(browser(), http_url);
@@ -747,7 +747,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttp) {
browser()->command_controller()->command_updater();
ASSERT_TRUE(test_server()->Start());
- GURL http_url(test_server()->GetURL(std::string()));
+ GURL http_url(test_server()->GetURL(""));
ASSERT_TRUE(http_url.SchemeIs(chrome::kHttpScheme));
ui_test_utils::NavigateToURL(browser(), http_url);
EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
@@ -775,7 +775,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutFtp) {
net::TestServer::kLocalhost,
base::FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
- GURL ftp_url(test_server.GetURL(std::string()));
+ GURL ftp_url(test_server.GetURL(""));
ASSERT_TRUE(ftp_url.SchemeIs(chrome::kFtpScheme));
ui_test_utils::NavigateToURL(browser(), ftp_url);
EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
@@ -807,7 +807,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutInvalid) {
// DISABLED: http://crbug.com/72310
IN_PROC_BROWSER_TEST_F(BrowserTest, DISABLED_ConvertTabToAppShortcut) {
ASSERT_TRUE(test_server()->Start());
- GURL http_url(test_server()->GetURL(std::string()));
+ GURL http_url(test_server()->GetURL(""));
ASSERT_TRUE(http_url.SchemeIs(chrome::kHttpScheme));
ASSERT_EQ(1, browser()->tab_strip_model()->count());
diff --git a/chrome/browser/ui/browser_tab_contents.cc b/chrome/browser/ui/browser_tab_contents.cc
index fdcaa16..c4fe56c 100644
--- a/chrome/browser/ui/browser_tab_contents.cc
+++ b/chrome/browser/ui/browser_tab_contents.cc
@@ -172,10 +172,8 @@ void BrowserTabContents::AttachTabHelpers(WebContents* web_contents) {
// because the connected state may change while this tab is open. Having a
// one-click signin helper attached does not cause problems if the profile
// happens to be already connected.
- if (OneClickSigninHelper::CanOffer(web_contents,
- OneClickSigninHelper::CAN_OFFER_FOR_ALL,
- std::string(),
- NULL)) {
+ if (OneClickSigninHelper::CanOffer(
+ web_contents, OneClickSigninHelper::CAN_OFFER_FOR_ALL, "", NULL)) {
OneClickSigninHelper::CreateForWebContents(web_contents);
}
#endif
diff --git a/chrome/browser/ui/browser_tabrestore.cc b/chrome/browser/ui/browser_tabrestore.cc
index 373de5c..0e96e0d 100644
--- a/chrome/browser/ui/browser_tabrestore.cc
+++ b/chrome/browser/ui/browser_tabrestore.cc
@@ -50,7 +50,7 @@ WebContents* CreateRestoredTab(
// session_storage_namespace.h include since we only need that to assign
// into the map.
content::SessionStorageNamespaceMap session_storage_namespace_map;
- session_storage_namespace_map[std::string()] = session_storage_namespace;
+ session_storage_namespace_map[""] = session_storage_namespace;
WebContents::CreateParams create_params(
browser->profile(),
tab_util::GetSiteInstanceForNewTab(browser->profile(), restore_url));
diff --git a/chrome/browser/ui/certificate_dialogs.cc b/chrome/browser/ui/certificate_dialogs.cc
index 939c3a13..8e69b5d 100644
--- a/chrome/browser/ui/certificate_dialogs.cc
+++ b/chrome/browser/ui/certificate_dialogs.cc
@@ -52,7 +52,7 @@ std::string GetBase64String(net::X509Certificate::OSCertHandle cert) {
if (!base::Base64Encode(
x509_certificate_model::GetDerString(cert), &base64)) {
LOG(ERROR) << "base64 encoding error";
- return std::string();
+ return "";
}
return "-----BEGIN CERTIFICATE-----\r\n" +
WrapAt64(base64) +
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc
index 7fed38a..fe9300c 100644
--- a/chrome/browser/ui/chrome_pages.cc
+++ b/chrome/browser/ui/chrome_pages.cc
@@ -65,7 +65,7 @@ void ShowBookmarkManager(Browser* browser) {
}
void ShowBookmarkManagerForNode(Browser* browser, int64 node_id) {
- OpenBookmarkManagerWithHash(browser, std::string(), node_id);
+ OpenBookmarkManagerWithHash(browser, "", node_id);
}
void ShowHistory(Browser* browser) {
diff --git a/chrome/browser/ui/chrome_select_file_policy_unittest.cc b/chrome/browser/ui/chrome_select_file_policy_unittest.cc
index ad735f8..d5a6c10 100644
--- a/chrome/browser/ui/chrome_select_file_policy_unittest.cc
+++ b/chrome/browser/ui/chrome_select_file_policy_unittest.cc
@@ -56,7 +56,7 @@ class FileSelectionUser : public ui::SelectFileDialog::Listener {
file_path,
NULL,
0,
- base::FilePath::StringType()),
+ FILE_PATH_LITERAL(""),
NULL,
NULL);
file_selection_initialisation_in_progress = false;
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
index 3c851f4..34bb7f0 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
@@ -658,7 +658,7 @@ FullscreenControllerStateTest::StateTransitionInfo
std::string FullscreenControllerStateTest::GetAndClearDebugLog() {
debugging_log_ << "(End of Debugging Log)\n";
std::string output_log = "\nDebugging Log:\n" + debugging_log_.str();
- debugging_log_.str(std::string());
+ debugging_log_.str("");
return output_log;
}
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
index a4d0a2b..3796706 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
@@ -462,12 +462,7 @@ bool CreateNewBookmarkFromNetscapeURL(GtkSelectionData* selection_data,
string16 GetNameForURL(const GURL& url) {
if (url.is_valid()) {
- return net::GetSuggestedFilename(url,
- std::string(),
- std::string(),
- std::string(),
- std::string(),
- std::string());
+ return net::GetSuggestedFilename(url, "", "", "", "", std::string());
} else {
return l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME);
}
diff --git a/chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc b/chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc
index fdb10b5..fe42588 100644
--- a/chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc
+++ b/chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc
@@ -127,7 +127,7 @@ ConstrainedWebDialogDelegateViewGtk::ConstrainedWebDialogDelegateViewGtk(
void ConstrainedWebDialogDelegateViewGtk::OnDestroy(GtkWidget* widget) {
if (!impl_->closed_via_webui())
- GetWebDialogDelegate()->OnDialogClosed(std::string());
+ GetWebDialogDelegate()->OnDialogClosed("");
delete this;
}
diff --git a/chrome/browser/ui/gtk/first_run_bubble.cc b/chrome/browser/ui/gtk/first_run_bubble.cc
index 70bf245..7207758 100644
--- a/chrome/browser/ui/gtk/first_run_bubble.cc
+++ b/chrome/browser/ui/gtk/first_run_bubble.cc
@@ -44,12 +44,10 @@ FirstRunBubble::FirstRunBubble(Browser* browser,
: browser_(browser),
bubble_(NULL) {
GtkThemeService* theme_service = GtkThemeService::GetFrom(browser->profile());
- GtkWidget* title = theme_service->BuildLabel(std::string(), ui::kGdkBlack);
- char* markup = g_markup_printf_escaped(
- kSearchLabelMarkup,
+ GtkWidget* title = theme_service->BuildLabel("", ui::kGdkBlack);
+ char* markup = g_markup_printf_escaped(kSearchLabelMarkup,
l10n_util::GetStringFUTF8(IDS_FR_BUBBLE_TITLE,
- GetDefaultSearchEngineName(browser->profile()))
- .c_str());
+ GetDefaultSearchEngineName(browser->profile())).c_str());
gtk_label_set_markup(GTK_LABEL(title), markup);
g_free(markup);
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
index 9bd0ebb..befcd30 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
@@ -410,9 +410,9 @@ void LocationBarViewGtk::Init(bool popup_window_mode) {
// Tab to search (the keyword box on the left hand side).
tab_to_search_full_label_ =
- theme_service_->BuildLabel(std::string(), ui::kGdkBlack);
+ theme_service_->BuildLabel("", ui::kGdkBlack);
tab_to_search_partial_label_ =
- theme_service_->BuildLabel(std::string(), ui::kGdkBlack);
+ theme_service_->BuildLabel("", ui::kGdkBlack);
GtkWidget* tab_to_search_label_hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox),
tab_to_search_full_label_, FALSE, FALSE, 0);
@@ -458,12 +458,12 @@ void LocationBarViewGtk::Init(bool popup_window_mode) {
tab_to_search_hint_ = gtk_hbox_new(FALSE, 0);
gtk_widget_set_name(tab_to_search_hint_, "chrome-tab-to-search-hint");
tab_to_search_hint_leading_label_ =
- theme_service_->BuildLabel(std::string(), kHintTextColor);
+ theme_service_->BuildLabel("", kHintTextColor);
gtk_widget_set_sensitive(tab_to_search_hint_leading_label_, FALSE);
tab_to_search_hint_icon_ = gtk_image_new_from_pixbuf(
rb.GetNativeImageNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB).ToGdkPixbuf());
tab_to_search_hint_trailing_label_ =
- theme_service_->BuildLabel(std::string(), kHintTextColor);
+ theme_service_->BuildLabel("", kHintTextColor);
gtk_widget_set_sensitive(tab_to_search_hint_trailing_label_, FALSE);
gtk_box_pack_start(GTK_BOX(tab_to_search_hint_),
tab_to_search_hint_leading_label_,
diff --git a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc
index d96e1d2..ebf2e78 100644
--- a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc
+++ b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc
@@ -249,7 +249,7 @@ std::string SSLClientCertificateSelector::FormatComboBoxText(
net::X509Certificate::OSCertHandle cert, const std::string& nickname) {
std::string rv(nickname);
rv += " [";
- rv += x509_certificate_model::GetSerialNumberHexified(cert, std::string());
+ rv += x509_certificate_model::GetSerialNumberHexified(cert, "");
rv += ']';
return rv;
}
@@ -266,8 +266,8 @@ std::string SSLClientCertificateSelector::FormatDetailsText(
rv += "\n ";
rv += l10n_util::GetStringFUTF8(
IDS_CERT_SERIAL_NUMBER_FORMAT,
- UTF8ToUTF16(x509_certificate_model::GetSerialNumberHexified(
- cert, std::string())));
+ UTF8ToUTF16(
+ x509_certificate_model::GetSerialNumberHexified(cert, "")));
base::Time issued, expires;
if (x509_certificate_model::GetTimes(cert, &issued, &expires)) {
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
index 7056161..b629064 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -152,7 +152,7 @@ ALL_FONT_SCRIPTS(WEBKIT_WEBPREFS_FONTS_STANDARD)
// We haven't already set a default value for this font preference, so set
// an empty string as the default.
registry->RegisterStringPref(
- pref_name, std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF);
+ pref_name, "", PrefRegistrySyncable::UNSYNCABLE_PREF);
}
}
}
@@ -587,7 +587,7 @@ void PrefsTabHelper::RegisterUserPrefs(PrefRegistrySyncable* registry) {
IDS_STATIC_ENCODING_LIST,
PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterStringPref(prefs::kRecentlySelectedEncoding,
- std::string(),
+ "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
RegisterPrefsToMigrate(registry);
@@ -666,7 +666,7 @@ void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) {
if (pref_value.empty()) {
WebPreferences web_prefs =
web_contents_->GetRenderViewHost()->GetWebkitPreferences();
- OverrideFontFamily(&web_prefs, generic_family, script, std::string());
+ OverrideFontFamily(&web_prefs, generic_family, script, "");
web_contents_->GetRenderViewHost()->UpdateWebkitPreferences(web_prefs);
return;
}
diff --git a/chrome/browser/ui/search/instant_browsertest.cc b/chrome/browser/ui/search/instant_browsertest.cc
index 2e4beb2..6afe15b 100644
--- a/chrome/browser/ui/search/instant_browsertest.cc
+++ b/chrome/browser/ui/search/instant_browsertest.cc
@@ -607,7 +607,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, PageVisibility) {
EXPECT_TRUE(CheckVisibilityIs(overlay, true));
// Deleting the omnibox text should hide the overlay.
- SetOmniboxText(std::string());
+ SetOmniboxText("");
EXPECT_TRUE(CheckVisibilityIs(active_tab, true));
EXPECT_TRUE(CheckVisibilityIs(overlay, false));
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 1d0cff3..7600026 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -933,8 +933,8 @@ void StartupBrowserCreatorImpl::AddStartupURLs(
GURL(std::string(chrome::kChromeUISettingsURL) +
chrome::kManagedUserSettingsSubPage));
if (has_reset_local_passphrase_switch) {
- prefs->SetString(prefs::kManagedModeLocalPassphrase, std::string());
- prefs->SetString(prefs::kManagedModeLocalSalt, std::string());
+ prefs->SetString(prefs::kManagedModeLocalPassphrase, "");
+ prefs->SetString(prefs::kManagedModeLocalSalt, "");
}
}
diff --git a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
index 4892ab6..e879b6e 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
@@ -389,15 +389,13 @@ TEST_F(OneClickSigninHelperTest, CanOfferNoContents) {
"user@gmail.com", &error_message));
EXPECT_EQ("", error_message);
EXPECT_FALSE(OneClickSigninHelper::CanOffer(
- NULL,
- OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
- std::string(),
- &error_message));
+ NULL, OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
+ "", &error_message));
EXPECT_EQ("", error_message);
}
TEST_F(OneClickSigninHelperTest, CanOffer) {
- CreateSigninManager(false, std::string());
+ CreateSigninManager(false, "");
EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
WillRepeatedly(Return(true));
@@ -410,10 +408,9 @@ TEST_F(OneClickSigninHelperTest, CanOffer) {
web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_ALL,
"user@gmail.com", NULL));
EXPECT_TRUE(OneClickSigninHelper::CanOffer(
- web_contents(),
- OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
- std::string(),
- NULL));
+ web_contents(),
+ OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
+ "", NULL));
EnableOneClick(false);
@@ -427,15 +424,14 @@ TEST_F(OneClickSigninHelperTest, CanOffer) {
web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_ALL,
"user@gmail.com", &error_message));
EXPECT_FALSE(OneClickSigninHelper::CanOffer(
- web_contents(),
- OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
- std::string(),
- &error_message));
+ web_contents(),
+ OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
+ "", &error_message));
EXPECT_EQ("", error_message);
}
TEST_F(OneClickSigninHelperTest, CanOfferFirstSetup) {
- CreateSigninManager(false, std::string());
+ CreateSigninManager(false, "");
EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
WillRepeatedly(Return(true));
@@ -458,10 +454,8 @@ TEST_F(OneClickSigninHelperTest, CanOfferFirstSetup) {
OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
"foo@gmail.com", NULL));
EXPECT_TRUE(OneClickSigninHelper::CanOffer(
- web_contents(),
- OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
- std::string(),
- NULL));
+ web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
+ "", NULL));
}
TEST_F(OneClickSigninHelperTest, CanOfferProfileConnected) {
@@ -498,14 +492,12 @@ TEST_F(OneClickSigninHelperTest, CanOfferProfileConnected) {
UTF8ToUTF16("foo@gmail.com")),
error_message);
EXPECT_TRUE(OneClickSigninHelper::CanOffer(
- web_contents(),
- OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
- std::string(),
- &error_message));
+ web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
+ "", &error_message));
}
TEST_F(OneClickSigninHelperTest, CanOfferUsernameNotAllowed) {
- CreateSigninManager(false, std::string());
+ CreateSigninManager(false, "");
EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
WillRepeatedly(Return(false));
@@ -521,15 +513,16 @@ TEST_F(OneClickSigninHelperTest, CanOfferUsernameNotAllowed) {
"foo@gmail.com", &error_message));
EXPECT_EQ(l10n_util::GetStringUTF8(IDS_SYNC_LOGIN_NAME_PROHIBITED),
error_message);
- EXPECT_TRUE(OneClickSigninHelper::CanOffer(
- web_contents(),
- OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
- std::string(),
- &error_message));
+ EXPECT_TRUE(
+ OneClickSigninHelper::CanOffer(
+ web_contents(),
+ OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
+ "",
+ &error_message));
}
TEST_F(OneClickSigninHelperTest, CanOfferWithRejectedEmail) {
- CreateSigninManager(false, std::string());
+ CreateSigninManager(false, "");
EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
WillRepeatedly(Return(true));
@@ -558,7 +551,7 @@ TEST_F(OneClickSigninHelperTest, CanOfferWithRejectedEmail) {
}
TEST_F(OneClickSigninHelperTest, CanOfferIncognito) {
- CreateSigninManager(true, std::string());
+ CreateSigninManager(true, "");
std::string error_message;
EXPECT_FALSE(OneClickSigninHelper::CanOffer(
@@ -570,15 +563,13 @@ TEST_F(OneClickSigninHelperTest, CanOfferIncognito) {
"user@gmail.com", &error_message));
EXPECT_EQ("", error_message);
EXPECT_FALSE(OneClickSigninHelper::CanOffer(
- web_contents(),
- OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
- std::string(),
- &error_message));
+ web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
+ "", &error_message));
EXPECT_EQ("", error_message);
}
TEST_F(OneClickSigninHelperTest, CanOfferNoSigninCookies) {
- CreateSigninManager(false, std::string());
+ CreateSigninManager(false, "");
AllowSigninCookies(false);
EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
@@ -594,10 +585,8 @@ TEST_F(OneClickSigninHelperTest, CanOfferNoSigninCookies) {
"user@gmail.com", &error_message));
EXPECT_EQ("", error_message);
EXPECT_FALSE(OneClickSigninHelper::CanOffer(
- web_contents(),
- OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
- std::string(),
- &error_message));
+ web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
+ "", &error_message));
EXPECT_EQ("", error_message);
}
@@ -606,7 +595,7 @@ TEST_F(OneClickSigninHelperTest, CanOfferUntrustedProcess) {
ASSERT_NE(trusted.GetID(), process()->GetID());
// Make sure the RenderProcessHost used by the test is untrusted.
SetTrustedSigninProcessID(trusted.GetID());
- CreateSigninManager(false, std::string());
+ CreateSigninManager(false, "");
EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
WillRepeatedly(Return(true));
@@ -618,7 +607,7 @@ TEST_F(OneClickSigninHelperTest, CanOfferUntrustedProcess) {
}
TEST_F(OneClickSigninHelperTest, CanOfferDisabledByPolicy) {
- CreateSigninManager(false, std::string());
+ CreateSigninManager(false, "");
EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
WillRepeatedly(Return(true));
@@ -653,7 +642,7 @@ TEST_F(OneClickSigninHelperTest, CanOfferDisabledByPolicy) {
// Should not crash if a helper instance is not associated with an incognito
// web contents.
TEST_F(OneClickSigninHelperTest, ShowInfoBarUIThreadIncognito) {
- CreateSigninManager(true, std::string());
+ CreateSigninManager(true, "");
OneClickSigninHelper* helper =
OneClickSigninHelper::FromWebContents(web_contents());
EXPECT_EQ(NULL, helper);
@@ -668,9 +657,9 @@ TEST_F(OneClickSigninHelperTest, ShowInfoBarUIThreadIncognito) {
// config sync, then Chrome should redirect immidiately to sync settings page,
// and upon successful setup, redirect back to webstore.
TEST_F(OneClickSigninHelperTest, SigninFromWebstoreWithConfigSyncfirst) {
- CreateSigninManager(false, std::string());
- EXPECT_CALL(*signin_manager_, IsAllowedUsername(_))
- .WillRepeatedly(Return(true));
+ CreateSigninManager(false, "");
+ EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
+ WillRepeatedly(Return(true));
CreateProfileSyncServiceMock();
@@ -698,9 +687,9 @@ TEST_F(OneClickSigninHelperTest, SigninFromWebstoreWithConfigSyncfirst) {
}
TEST_F(OneClickSigninHelperTest, ShowSigninBubbleAfterSigninComplete) {
- CreateSigninManager(false, std::string());
- EXPECT_CALL(*signin_manager_, IsAllowedUsername(_))
- .WillRepeatedly(Return(true));
+ CreateSigninManager(false, "");
+ EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
+ WillRepeatedly(Return(true));
CreateProfileSyncServiceMock();
@@ -736,34 +725,31 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThread) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
EXPECT_EQ(OneClickSigninHelper::CAN_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadIncognito) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(true));
EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoIOData) {
EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, NULL));
+ valid_gaia_url_, "", &request_, NULL));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadBadURL) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
- EXPECT_EQ(
- OneClickSigninHelper::IGNORE_REQUEST,
- OneClickSigninHelper::CanOfferOnIOThreadImpl(
- GURL("https://foo.com/"), std::string(), &request_, io_data.get()));
EXPECT_EQ(OneClickSigninHelper::IGNORE_REQUEST,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- GURL("http://accounts.google.com/"),
- std::string(),
- &request_,
- io_data.get()));
+ GURL("https://foo.com/"), "", &request_, io_data.get()));
+ EXPECT_EQ(OneClickSigninHelper::IGNORE_REQUEST,
+ OneClickSigninHelper::CanOfferOnIOThreadImpl(
+ GURL("http://accounts.google.com/"), "",
+ &request_, io_data.get()));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadReferrer) {
@@ -810,7 +796,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadDisabled) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadSignedIn) {
@@ -820,7 +806,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadSignedIn) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadEmailNotAllowed) {
@@ -828,7 +814,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadEmailNotAllowed) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadEmailAlreadyUsed) {
@@ -841,7 +827,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadEmailAlreadyUsed) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadWithRejectedEmail) {
@@ -849,7 +835,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadWithRejectedEmail) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoSigninCookies) {
@@ -857,14 +843,14 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoSigninCookies) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
}
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadDisabledByPolicy) {
scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
EXPECT_EQ(OneClickSigninHelper::CAN_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
// Simulate a policy disabling signin by writing kSigninAllowed directly.
// We should not offer to sign in the browser.
@@ -872,7 +858,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadDisabledByPolicy) {
prefs::kSigninAllowed, base::Value::CreateBooleanValue(false));
EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
// Reset the preference.
profile_->GetTestingPrefService()->SetManagedPref(
@@ -884,5 +870,5 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadDisabledByPolicy) {
prefs::kSyncManaged, base::Value::CreateBooleanValue(true));
EXPECT_EQ(OneClickSigninHelper::CAN_OFFER,
OneClickSigninHelper::CanOfferOnIOThreadImpl(
- valid_gaia_url_, std::string(), &request_, io_data.get()));
+ valid_gaia_url_, "", &request_, io_data.get()));
}
diff --git a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc
index 4115f18..4b003cf 100644
--- a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc
+++ b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc
@@ -43,7 +43,7 @@ Profile* TabContentsSyncedTabDelegate::profile() const {
std::string TabContentsSyncedTabDelegate::GetExtensionAppId() const {
const scoped_refptr<const extensions::Extension> extension_app(
extensions::TabHelper::FromWebContents(web_contents_)->extension_app());
- return (extension_app.get() ? extension_app->id() : std::string());
+ return (extension_app.get() ? extension_app->id() : "");
}
int TabContentsSyncedTabDelegate::GetCurrentEntryIndex() const {
diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc
index 8a37c39..daf7257 100644
--- a/chrome/browser/ui/website_settings/website_settings.cc
+++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -143,18 +143,12 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type,
secondary_pattern = ContentSettingsPattern::Wildcard();
// Set permission for both microphone and camera.
content_settings_->SetContentSetting(
- primary_pattern,
- secondary_pattern,
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
- std::string(),
- setting);
+ primary_pattern, secondary_pattern,
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, "", setting);
content_settings_->SetContentSetting(
- primary_pattern,
- secondary_pattern,
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
- std::string(),
- setting);
+ primary_pattern, secondary_pattern,
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, "", setting);
break;
}
default:
@@ -173,7 +167,7 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type,
// can not create media settings exceptions by hand.
content_settings::SettingInfo info;
scoped_ptr<Value> v(content_settings_->GetWebsiteSetting(
- site_url_, site_url_, type, std::string(), &info));
+ site_url_, site_url_, type, "", &info));
DCHECK(info.source == content_settings::SETTING_SOURCE_USER);
ContentSettingsPattern::Relation r1 =
info.primary_pattern.Compare(primary_pattern);
@@ -194,7 +188,7 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type,
if (setting != CONTENT_SETTING_DEFAULT)
value = Value::CreateIntegerValue(setting);
content_settings_->SetWebsiteSetting(
- primary_pattern, secondary_pattern, type, std::string(), value);
+ primary_pattern, secondary_pattern, type, "", value);
}
show_info_bar_ = true;
@@ -458,20 +452,14 @@ void WebsiteSettings::PresentSitePermissions() {
content_settings::SettingInfo info;
if (permission_info.type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) {
scoped_ptr<base::Value> mic_value(content_settings_->GetWebsiteSetting(
- site_url_,
- site_url_,
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
- std::string(),
- &info));
+ site_url_, site_url_, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
+ "", &info));
ContentSetting mic_setting =
content_settings::ValueToContentSetting(mic_value.get());
scoped_ptr<base::Value> camera_value(content_settings_->GetWebsiteSetting(
- site_url_,
- site_url_,
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
- std::string(),
- &info));
+ site_url_, site_url_, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
+ "", &info));
ContentSetting camera_setting =
content_settings::ValueToContentSetting(camera_value.get());
@@ -481,7 +469,7 @@ void WebsiteSettings::PresentSitePermissions() {
permission_info.setting = mic_setting;
} else {
scoped_ptr<Value> value(content_settings_->GetWebsiteSetting(
- site_url_, site_url_, permission_info.type, std::string(), &info));
+ site_url_, site_url_, permission_info.type, "", &info));
DCHECK(value.get());
if (value->GetType() == Value::TYPE_INTEGER) {
permission_info.setting =
diff --git a/chrome/browser/ui/website_settings/website_settings_unittest.cc b/chrome/browser/ui/website_settings/website_settings_unittest.cc
index 8f486af..4fe881a 100644
--- a/chrome/browser/ui/website_settings/website_settings_unittest.cc
+++ b/chrome/browser/ui/website_settings/website_settings_unittest.cc
@@ -165,22 +165,22 @@ TEST_F(WebsiteSettingsTest, OnPermissionsChanged) {
HostContentSettingsMap* content_settings =
profile()->GetHostContentSettingsMap();
ContentSetting setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, "");
EXPECT_EQ(setting, CONTENT_SETTING_BLOCK);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_PLUGINS, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_PLUGINS, "");
EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, "");
EXPECT_EQ(setting, CONTENT_SETTING_ASK);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "");
EXPECT_EQ(setting, CONTENT_SETTING_ASK);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, "");
EXPECT_EQ(setting, CONTENT_SETTING_ASK);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, "");
EXPECT_EQ(setting, CONTENT_SETTING_ASK);
EXPECT_CALL(*mock_ui(), SetIdentityInfo(_));
@@ -212,22 +212,22 @@ TEST_F(WebsiteSettingsTest, OnPermissionsChanged) {
// Verify that the site permissions were changed correctly.
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, "");
EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_PLUGINS, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_PLUGINS, "");
EXPECT_EQ(setting, CONTENT_SETTING_BLOCK);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, "");
EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "");
EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, "");
EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
setting = content_settings->GetContentSetting(
- url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string());
+ url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, "");
EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
}
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
index b2dc2ae..861d2be 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -785,21 +785,15 @@ std::string AboutSandbox() {
data.append("<table>");
- AboutSandboxRow(&data,
- std::string(),
- IDS_ABOUT_SANDBOX_SUID_SANDBOX,
+ AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SUID_SANDBOX,
status & content::kSandboxLinuxSUID);
AboutSandboxRow(&data, "&nbsp;&nbsp;", IDS_ABOUT_SANDBOX_PID_NAMESPACES,
status & content::kSandboxLinuxPIDNS);
AboutSandboxRow(&data, "&nbsp;&nbsp;", IDS_ABOUT_SANDBOX_NET_NAMESPACES,
status & content::kSandboxLinuxNetNS);
- AboutSandboxRow(&data,
- std::string(),
- IDS_ABOUT_SANDBOX_SECCOMP_LEGACY_SANDBOX,
+ AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SECCOMP_LEGACY_SANDBOX,
status & content::kSandboxLinuxSeccompLegacy);
- AboutSandboxRow(&data,
- std::string(),
- IDS_ABOUT_SANDBOX_SECCOMP_BPF_SANDBOX,
+ AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SECCOMP_BPF_SANDBOX,
status & content::kSandboxLinuxSeccompBpf);
data.append("</table>");
diff --git a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc
index 19e6404..0bfa286 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc
@@ -147,7 +147,7 @@ IN_PROC_BROWSER_TEST_F(DownloadsDOMHandlerTest,
base::FilePath(FILE_PATH_LITERAL("/path/to/file")),
base::FilePath(FILE_PATH_LITERAL("/path/to/file")),
url_chain,
- GURL(std::string()),
+ GURL(""),
current,
current,
128,
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
index 11ea684..bd3bc6f 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -930,14 +930,9 @@ void ExtensionSettingsHandler::HandleLoadUnpackedExtensionMessage(
load_extension_dialog_ = ui::SelectFileDialog::Create(
this, new ChromeSelectFilePolicy(web_ui()->GetWebContents()));
load_extension_dialog_->SelectFile(
- kSelectType,
- select_title,
- last_unpacked_directory_,
- NULL,
- kFileTypeIndex,
- base::FilePath::StringType(),
- web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(),
- NULL);
+ kSelectType, select_title, last_unpacked_directory_, NULL,
+ kFileTypeIndex, FILE_PATH_LITERAL(""),
+ web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL);
}
void ExtensionSettingsHandler::ShowAlert(const std::string& message) {
diff --git a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc
index d201c91..a69cd4d 100644
--- a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc
+++ b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc
@@ -184,12 +184,8 @@ void PackExtensionHandler::HandleSelectFilePathMessage(
load_extension_dialog_ = ui::SelectFileDialog::Create(
this, new ChromeSelectFilePolicy(web_ui()->GetWebContents()));
load_extension_dialog_->SelectFile(
- type,
- select_title,
- base::FilePath(),
- &info,
- file_type_index,
- base::FilePath::StringType(),
+ type, select_title, base::FilePath(), &info, file_type_index,
+ FILE_PATH_LITERAL(""),
web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(),
NULL);
}
diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc
index 232b6eb..6864120 100644
--- a/chrome/browser/ui/webui/favicon_source.cc
+++ b/chrome/browser/ui/webui/favicon_source.cc
@@ -253,8 +253,10 @@ void FaviconSource::OnFaviconDataAvailable(
void FaviconSource::SendDefaultResponse(
const content::URLDataSource::GotDataCallback& callback) {
- SendDefaultResponse(
- IconRequest(callback, std::string(), 16, ui::SCALE_FACTOR_100P));
+ SendDefaultResponse(IconRequest(callback,
+ "",
+ 16,
+ ui::SCALE_FACTOR_100P));
}
void FaviconSource::SendDefaultResponse(const IconRequest& icon_request) {
diff --git a/chrome/browser/ui/webui/feedback_ui.cc b/chrome/browser/ui/webui/feedback_ui.cc
index b28e065..3cb20bf 100644
--- a/chrome/browser/ui/webui/feedback_ui.cc
+++ b/chrome/browser/ui/webui/feedback_ui.cc
@@ -409,23 +409,23 @@ bool FeedbackHandler::Init() {
std::string query_str = *it;
if (StartsWithASCII(query_str, std::string(kSessionIDParameter), true)) {
ReplaceFirstSubstringAfterOffset(
- &query_str, 0, kSessionIDParameter, std::string());
+ &query_str, 0, kSessionIDParameter, "");
if (!base::StringToInt(query_str, &session_id))
return false;
} else if (StartsWithASCII(*it, std::string(kTabIndexParameter), true)) {
ReplaceFirstSubstringAfterOffset(
- &query_str, 0, kTabIndexParameter, std::string());
+ &query_str, 0, kTabIndexParameter, "");
if (!base::StringToInt(query_str, &index))
return false;
} else if (StartsWithASCII(*it, std::string(kCustomPageUrlParameter),
true)) {
ReplaceFirstSubstringAfterOffset(
- &query_str, 0, kCustomPageUrlParameter, std::string());
+ &query_str, 0, kCustomPageUrlParameter, "");
custom_page_url = query_str;
} else if (StartsWithASCII(*it, std::string(kCategoryTagParameter),
true)) {
ReplaceFirstSubstringAfterOffset(
- &query_str, 0, kCategoryTagParameter, std::string());
+ &query_str, 0, kCategoryTagParameter, "");
category_tag_ = query_str;
#if defined(OS_CHROMEOS)
} else if (StartsWithASCII(*it, std::string(kTimestampParameter), true)) {
diff --git a/chrome/browser/ui/webui/inspect_ui.cc b/chrome/browser/ui/webui/inspect_ui.cc
index b98ea9e..b0b67c3 100644
--- a/chrome/browser/ui/webui/inspect_ui.cc
+++ b/chrome/browser/ui/webui/inspect_ui.cc
@@ -462,7 +462,7 @@ void InspectUI::OnAdbPages(
targets.Append(target_data);
}
- std::string json_string;
+ std::string json_string = "";
base::JSONWriter::Write(&targets, &json_string);
callback.Run(base::RefCountedString::TakeString(&json_string));
}
diff --git a/chrome/browser/ui/webui/instant_ui.cc b/chrome/browser/ui/webui/instant_ui.cc
index 23a255c..f84bf9a 100644
--- a/chrome/browser/ui/webui/instant_ui.cc
+++ b/chrome/browser/ui/webui/instant_ui.cc
@@ -169,7 +169,6 @@ InstantUI::InstantUI(content::WebUI* web_ui) : WebUIController(web_ui) {
// static
void InstantUI::RegisterUserPrefs(PrefRegistrySyncable* registry) {
- registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix,
- std::string(),
+ registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix, "",
PrefRegistrySyncable::UNSYNCABLE_PREF);
}
diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
index 0ac1324..cea9824 100644
--- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
+++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
@@ -1409,7 +1409,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyStatus(
next_protos_value = Value::CreateStringValue(
JoinString(net::HttpStreamFactory::next_protos(), ','));
} else {
- next_protos_value = Value::CreateStringValue(std::string());
+ next_protos_value = Value::CreateStringValue("");
}
status_dict->Set("next_protos", next_protos_value);
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 54c5c31..48f4f60 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -1194,11 +1194,8 @@ void BrowserOptionsHandler::HandleSelectDownloadLocation(
ui::SelectFileDialog::SELECT_FOLDER,
l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE),
pref_service->GetFilePath(prefs::kDownloadDefaultDirectory),
- &info,
- 0,
- base::FilePath::StringType(),
- web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(),
- NULL);
+ &info, 0, FILE_PATH_LITERAL(""),
+ web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL);
}
void BrowserOptionsHandler::FileSelected(const base::FilePath& path, int index,
diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc
index f30eaec..c1e18da 100644
--- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc
@@ -326,7 +326,7 @@ void CertificateManagerHandler::GetLocalizedValues(
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_CA_DESCRIPTION));
localized_strings->SetString("unknownCertsTabDeleteConfirm",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_UNKNOWN_FORMAT));
- localized_strings->SetString("unknownCertsTabDeleteImpact", std::string());
+ localized_strings->SetString("unknownCertsTabDeleteImpact", "");
// Certificate Restore overlay strings.
localized_strings->SetString("certificateRestorePasswordDescription",
@@ -614,7 +614,7 @@ void CertificateManagerHandler::ExportPersonalPasswordSelected(
chrome::UnlockCertSlotIfNecessary(
selected_cert_list_[0].get(),
chrome::kCryptoModulePasswordCertExport,
- std::string(), // unused.
+ "", // unused.
base::Bind(&CertificateManagerHandler::ExportPersonalSlotsUnlocked,
base::Unretained(this)));
}
@@ -723,7 +723,7 @@ void CertificateManagerHandler::ImportPersonalFileRead(
chrome::UnlockSlotsIfNecessary(
modules,
chrome::kCryptoModulePasswordCertImport,
- std::string(), // unused.
+ "", // unused.
base::Bind(&CertificateManagerHandler::ImportPersonalSlotUnlocked,
base::Unretained(this)));
}
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index 549856b..85249bc 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -123,7 +123,7 @@ std::string ContentSettingToString(ContentSetting setting) {
NOTREACHED();
}
- return std::string();
+ return "";
}
ContentSetting ContentSettingFromString(const std::string& name) {
@@ -151,9 +151,8 @@ DictionaryValue* GetExceptionForPage(
DictionaryValue* exception = new DictionaryValue();
exception->SetString(kOrigin, pattern.ToString());
exception->SetString(kEmbeddingOrigin,
- secondary_pattern == ContentSettingsPattern::Wildcard()
- ? std::string()
- : secondary_pattern.ToString());
+ secondary_pattern == ContentSettingsPattern::Wildcard() ? "" :
+ secondary_pattern.ToString());
exception->SetString(kSetting, ContentSettingToString(setting));
exception->SetString(kSource, provider_name);
return exception;
@@ -605,7 +604,7 @@ void ContentSettingsHandler::UpdateMediaSettingsView() {
media_ui_settings.SetString("askText", "mediaStreamAsk");
media_ui_settings.SetString("blockText", "mediaStreamBlock");
media_ui_settings.SetBoolean("showBubble", false);
- media_ui_settings.SetString("bubbleText", std::string());
+ media_ui_settings.SetString("bubbleText", "");
web_ui()->CallJavascriptFunction("ContentSettings.updateMediaUI",
media_ui_settings);
@@ -1053,16 +1052,18 @@ void ContentSettingsHandler::RemoveMediaException(
mode == "normal" ? GetContentSettingsMap() :
GetOTRContentSettingsMap();
if (settings_map) {
- settings_map->SetWebsiteSetting(ContentSettingsPattern::FromString(pattern),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
- std::string(),
- NULL);
- settings_map->SetWebsiteSetting(ContentSettingsPattern::FromString(pattern),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
- std::string(),
- NULL);
+ settings_map->SetWebsiteSetting(
+ ContentSettingsPattern::FromString(pattern),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
+ "",
+ NULL);
+ settings_map->SetWebsiteSetting(
+ ContentSettingsPattern::FromString(pattern),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
+ "",
+ NULL);
}
}
@@ -1087,11 +1088,10 @@ void ContentSettingsHandler::RemoveExceptionFromHostContentSettingsMap(
if (settings_map) {
settings_map->SetWebsiteSetting(
ContentSettingsPattern::FromString(pattern),
- secondary_pattern.empty()
- ? ContentSettingsPattern::Wildcard()
- : ContentSettingsPattern::FromString(secondary_pattern),
+ secondary_pattern.empty() ? ContentSettingsPattern::Wildcard() :
+ ContentSettingsPattern::FromString(secondary_pattern),
type,
- std::string(),
+ "",
NULL);
}
}
@@ -1259,7 +1259,7 @@ void ContentSettingsHandler::SetException(const ListValue* args) {
settings_map->SetContentSetting(ContentSettingsPattern::FromString(pattern),
ContentSettingsPattern::Wildcard(),
type,
- std::string(),
+ "",
ContentSettingFromString(setting));
}
}
diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc
index 558effc..61f1524 100644
--- a/chrome/browser/ui/webui/options/font_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/font_settings_handler.cc
@@ -188,8 +188,8 @@ void FontSettingsHandler::FontsListHasLoaded(
option->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr"));
} else {
// Add empty name/value to indicate a separator item.
- option->Append(new base::StringValue(std::string()));
- option->Append(new base::StringValue(std::string()));
+ option->Append(new base::StringValue(""));
+ option->Append(new base::StringValue(""));
}
encoding_list.Append(option);
}
diff --git a/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc b/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc
index f3aac91..2090137 100644
--- a/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc
+++ b/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc
@@ -110,8 +110,8 @@ void ManagedUserPassphraseHandler::IsPassphraseSet(
void ManagedUserPassphraseHandler::ResetPassphrase(
const base::ListValue* args) {
PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
- pref_service->SetString(prefs::kManagedModeLocalPassphrase, std::string());
- pref_service->SetString(prefs::kManagedModeLocalSalt, std::string());
+ pref_service->SetString(prefs::kManagedModeLocalPassphrase, "");
+ pref_service->SetString(prefs::kManagedModeLocalSalt, "");
}
void ManagedUserPassphraseHandler::SetLocalPassphrase(
diff --git a/chrome/browser/ui/webui/options/preferences_browsertest.cc b/chrome/browser/ui/webui/options/preferences_browsertest.cc
index 8dbc971..5839538 100644
--- a/chrome/browser/ui/webui/options/preferences_browsertest.cc
+++ b/chrome/browser/ui/webui/options/preferences_browsertest.cc
@@ -343,7 +343,7 @@ void PreferencesBrowserTest::VerifySetPref(const std::string& name,
std::string observed_json;
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
render_view_host_, javascript.str(), &observed_json));
- VerifyObservedPref(observed_json, name, value, std::string(), false, !commit);
+ VerifyObservedPref(observed_json, name, value, "", false, !commit);
VerifyAndClearExpectations();
}
@@ -385,7 +385,7 @@ void PreferencesBrowserTest::VerifyCommit(const std::string& name,
void PreferencesBrowserTest::VerifySetCommit(const std::string& name,
const base::Value* value) {
ExpectSetCommit(name, value);
- VerifyCommit(name, value, std::string());
+ VerifyCommit(name, value, "");
VerifyAndClearExpectations();
}
@@ -476,8 +476,8 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, FetchPrefs) {
// Verify notifications when default values are in effect.
SetupJavaScriptTestEnvironment(pref_names_, &observed_json);
- VerifyObservedPrefs(
- observed_json, pref_names_, default_values_, std::string(), false, false);
+ VerifyObservedPrefs(observed_json, pref_names_, default_values_,
+ "", false, false);
// Verify notifications when recommended values are in effect.
SetUserPolicies(policy_names_, non_default_values_,
@@ -497,12 +497,8 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, FetchPrefs) {
ClearUserPolicies();
SetUserValues(pref_names_, non_default_values_);
SetupJavaScriptTestEnvironment(pref_names_, &observed_json);
- VerifyObservedPrefs(observed_json,
- pref_names_,
- non_default_values_,
- std::string(),
- false,
- false);
+ VerifyObservedPrefs(observed_json, pref_names_, non_default_values_,
+ "", false, false);
}
// Verifies that setting a user-modified pref value through the JavaScript
@@ -554,7 +550,7 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, DialogPrefsSetRollback) {
ASSERT_NO_FATAL_FAILURE(SetupJavaScriptTestEnvironment(pref_names_, NULL));
for (size_t i = 0; i < pref_names_.size(); ++i) {
VerifySetPref(pref_names_[i], types_[i], non_default_values_[i], false);
- VerifyRollback(pref_names_[i], default_values_[i], std::string());
+ VerifyRollback(pref_names_[i], default_values_[i], "");
}
// Verify behavior when recommended values are in effect.
@@ -596,7 +592,7 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, DialogPrefsClearRollback) {
ASSERT_NO_FATAL_FAILURE(SetupJavaScriptTestEnvironment(pref_names_, NULL));
for (size_t i = 0; i < pref_names_.size(); ++i) {
VerifyClearPref(pref_names_[i], default_values_[i], false);
- VerifyRollback(pref_names_[i], non_default_values_[i], std::string());
+ VerifyRollback(pref_names_[i], non_default_values_[i], "");
}
}
@@ -628,19 +624,15 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, NotificationsOnBackendChanges) {
StartObserving();
ClearUserPolicies();
FinishObserving(&observed_json);
- VerifyObservedPrefs(
- observed_json, pref_names_, default_values_, std::string(), false, false);
+ VerifyObservedPrefs(observed_json, pref_names_, default_values_,
+ "", false, false);
// Verify notifications when user-modified values come into effect.
StartObserving();
SetUserValues(pref_names_, non_default_values_);
FinishObserving(&observed_json);
- VerifyObservedPrefs(observed_json,
- pref_names_,
- non_default_values_,
- std::string(),
- false,
- false);
+ VerifyObservedPrefs(observed_json, pref_names_, non_default_values_,
+ "", false, false);
}
#if defined(OS_CHROMEOS)
diff --git a/chrome/browser/ui/webui/policy_ui_browsertest.cc b/chrome/browser/ui/webui/policy_ui_browsertest.cc
index 6293fef..6af1613 100644
--- a/chrome/browser/ui/webui/policy_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/policy_ui_browsertest.cc
@@ -43,7 +43,7 @@ std::vector<std::string> PopulateExpectedPolicy(
metadata->scope == policy::POLICY_SCOPE_MACHINE ?
IDS_POLICY_SCOPE_DEVICE : IDS_POLICY_SCOPE_USER));
} else {
- expected_policy.push_back(std::string());
+ expected_policy.push_back("");
}
// Populate expected level.
@@ -52,7 +52,7 @@ std::vector<std::string> PopulateExpectedPolicy(
metadata->level == policy::POLICY_LEVEL_RECOMMENDED ?
IDS_POLICY_LEVEL_RECOMMENDED : IDS_POLICY_LEVEL_MANDATORY));
} else {
- expected_policy.push_back(std::string());
+ expected_policy.push_back("");
}
// Populate expected policy name.
@@ -178,7 +178,7 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyNames) {
for (const policy::PolicyDefinitionList::Entry* policy = policies->begin;
policy != policies->end; ++policy) {
expected_policies.push_back(
- PopulateExpectedPolicy(policy->name, std::string(), NULL, false));
+ PopulateExpectedPolicy(policy->name, "", NULL, false));
}
// Retrieve the contents of the policy table from the UI and verify that it
@@ -240,8 +240,7 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyValues) {
policy != policies->end; ++policy) {
std::map<std::string, std::string>::const_iterator it =
expected_values.find(policy->name);
- const std::string value =
- it == expected_values.end() ? std::string() : it->second;
+ const std::string value = it == expected_values.end() ? "" : it->second;
const policy::PolicyMap::Entry* metadata = values.Get(policy->name);
expected_policies.insert(
metadata ? expected_policies.begin() + first_unset_position++ :
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 7899260..0525da3 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -866,7 +866,7 @@ void PrintPreviewHandler::SelectFile(const base::FilePath& default_filename) {
sticky_settings->save_path()->Append(default_filename),
&file_type_info,
0,
- base::FilePath::StringType(),
+ FILE_PATH_LITERAL(""),
platform_util::GetTopLevel(
preview_web_contents()->GetView()->GetNativeView()),
NULL);
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
index 4e10802..52cbe91 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
@@ -571,7 +571,7 @@ void PrintPreviewUI::OnClosePrintPreviewDialog() {
ConstrainedWebDialogDelegate* delegate = GetConstrainedDelegate();
if (!delegate)
return;
- delegate->GetWebDialogDelegate()->OnDialogClosed(std::string());
+ delegate->GetWebDialogDelegate()->OnDialogClosed("");
delegate->OnDialogCloseFromWebUI();
}
diff --git a/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc
index cd6f5fe..e24b730 100644
--- a/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc
+++ b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc
@@ -142,11 +142,11 @@ class ProfileSigninConfirmationDialogTest : public testing::Test {
false);
// Create a dialog, but don't display it.
- dialog_ = new ProfileSigninConfirmationDialog(profile_.get(),
- std::string(),
- base::Bind(&base::DoNothing),
- base::Bind(&base::DoNothing),
- base::Bind(&base::DoNothing));
+ dialog_ = new ProfileSigninConfirmationDialog(
+ profile_.get(), "",
+ base::Bind(&base::DoNothing),
+ base::Bind(&base::DoNothing),
+ base::Bind(&base::DoNothing));
}
virtual void TearDown() OVERRIDE {
@@ -204,10 +204,10 @@ TEST_F(ProfileSigninConfirmationDialogTest, PromptForNewProfile_Extensions) {
&ProfileSigninConfirmationDialog::CheckShouldPromptForNewProfile,
base::Unretained(dialog_))));
- scoped_refptr<extensions::Extension> extension =
- CreateExtension("foo", std::string());
+ scoped_refptr<extensions::Extension> extension = CreateExtension("foo", "");
extensions->extension_prefs()->AddGrantedPermissions(
- extension->id(), make_scoped_refptr(new extensions::PermissionSet));
+ extension->id(),
+ make_scoped_refptr(new extensions::PermissionSet));
extensions->AddExtension(extension);
EXPECT_TRUE(
GetCallbackResult(
diff --git a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
index 19f2d0e..f958519 100644
--- a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
@@ -457,13 +457,8 @@ TEST_P(SyncSetupHandlerTest, DisplayBasicLogin) {
// Now make sure that the appropriate params are being passed.
DictionaryValue* dictionary;
ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary));
- CheckShowSyncSetupArgs(dictionary,
- std::string(),
- false,
- GoogleServiceAuthError::NONE,
- std::string(),
- true,
- std::string());
+ CheckShowSyncSetupArgs(
+ dictionary, "", false, GoogleServiceAuthError::NONE, "", true, "");
} else {
ASSERT_FALSE(handler_->is_configuring_sync());
ASSERT_TRUE(handler_->have_signin_tracker());
@@ -499,13 +494,8 @@ TEST_P(SyncSetupHandlerTest, DisplayForceLogin) {
// Now make sure that the appropriate params are being passed.
DictionaryValue* dictionary;
ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary));
- CheckShowSyncSetupArgs(dictionary,
- std::string(),
- false,
- GoogleServiceAuthError::NONE,
- std::string(),
- true,
- std::string());
+ CheckShowSyncSetupArgs(
+ dictionary, "", false, GoogleServiceAuthError::NONE, "", true, "");
} else {
ASSERT_FALSE(handler_->is_configuring_sync());
ASSERT_TRUE(handler_->have_signin_tracker());
@@ -689,7 +679,7 @@ TEST_P(SyncSetupHandlerTest, HandleGaiaAuthFailure) {
if (!SyncPromoUI::UseWebBasedSigninFlow()) {
// Fake a failed signin attempt.
- handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string());
+ handler_->TryLogin(kTestUser, kTestPassword, "", "");
GoogleServiceAuthError error(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
handler_->SigninFailed(error);
@@ -705,13 +695,9 @@ TEST_P(SyncSetupHandlerTest, HandleGaiaAuthFailure) {
// Now make sure that the appropriate params are being passed.
DictionaryValue* dictionary;
ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary));
- CheckShowSyncSetupArgs(dictionary,
- std::string(),
- false,
- GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS,
- kTestUser,
- true,
- std::string());
+ CheckShowSyncSetupArgs(
+ dictionary, "", false, GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS,
+ kTestUser, true, "");
} else {
ASSERT_FALSE(handler_->is_configuring_sync());
ASSERT_TRUE(handler_->have_signin_tracker());
@@ -732,7 +718,7 @@ TEST_P(SyncSetupHandlerTest, HandleCaptcha) {
if (!SyncPromoUI::UseWebBasedSigninFlow()) {
// Fake a failed signin attempt that requires a captcha.
- handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string());
+ handler_->TryLogin(kTestUser, kTestPassword, "", "");
GoogleServiceAuthError error =
GoogleServiceAuthError::FromClientLoginCaptchaChallenge(
"token", GURL(kTestCaptchaImageUrl), GURL(kTestCaptchaUnlockUrl));
@@ -748,13 +734,9 @@ TEST_P(SyncSetupHandlerTest, HandleCaptcha) {
// Now make sure that the appropriate params are being passed.
DictionaryValue* dictionary;
ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary));
- CheckShowSyncSetupArgs(dictionary,
- std::string(),
- false,
- GoogleServiceAuthError::CAPTCHA_REQUIRED,
- kTestUser,
- true,
- kTestCaptchaImageUrl);
+ CheckShowSyncSetupArgs(
+ dictionary, "", false, GoogleServiceAuthError::CAPTCHA_REQUIRED,
+ kTestUser, true, kTestCaptchaImageUrl);
} else {
ASSERT_FALSE(handler_->is_configuring_sync());
ASSERT_TRUE(handler_->have_signin_tracker());
@@ -776,7 +758,7 @@ TEST_P(SyncSetupHandlerTest, UnrecoverableErrorInitializingSync) {
ASSERT_EQ(1U, web_ui_.call_data().size());
// Fake a successful GAIA request (gaia credentials valid, but signin not
// complete yet).
- handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string());
+ handler_->TryLogin(kTestUser, kTestPassword, "", "");
handler_->GaiaCredentialsValid();
ASSERT_EQ(2U, web_ui_.call_data().size());
EXPECT_EQ("SyncSetupOverlay.showSuccessAndSettingUp",
@@ -798,13 +780,9 @@ TEST_P(SyncSetupHandlerTest, UnrecoverableErrorInitializingSync) {
// Now make sure that the appropriate params are being passed.
DictionaryValue* dictionary;
ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary));
- CheckShowSyncSetupArgs(dictionary,
- std::string(),
- true,
- GoogleServiceAuthError::NONE,
- kTestUser,
- true,
- std::string());
+ CheckShowSyncSetupArgs(
+ dictionary, "", true, GoogleServiceAuthError::NONE,
+ kTestUser, true, "");
} else {
ASSERT_FALSE(handler_->is_configuring_sync());
ASSERT_TRUE(handler_->have_signin_tracker());
@@ -825,7 +803,7 @@ TEST_P(SyncSetupHandlerTest, GaiaErrorInitializingSync) {
ASSERT_EQ(1U, web_ui_.call_data().size());
// Fake a successful GAIA request (gaia credentials valid, but signin not
// complete yet).
- handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string());
+ handler_->TryLogin(kTestUser, kTestPassword, "", "");
handler_->GaiaCredentialsValid();
ASSERT_EQ(2U, web_ui_.call_data().size());
EXPECT_EQ("SyncSetupOverlay.showSuccessAndSettingUp",
@@ -848,13 +826,9 @@ TEST_P(SyncSetupHandlerTest, GaiaErrorInitializingSync) {
// Now make sure that the appropriate params are being passed.
DictionaryValue* dictionary;
ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary));
- CheckShowSyncSetupArgs(dictionary,
- std::string(),
- false,
- GoogleServiceAuthError::SERVICE_UNAVAILABLE,
- kTestUser,
- true,
- std::string());
+ CheckShowSyncSetupArgs(
+ dictionary, "", false, GoogleServiceAuthError::SERVICE_UNAVAILABLE,
+ kTestUser, true, "");
} else {
ASSERT_FALSE(handler_->is_configuring_sync());
ASSERT_TRUE(handler_->have_signin_tracker());
@@ -863,7 +837,7 @@ TEST_P(SyncSetupHandlerTest, GaiaErrorInitializingSync) {
TEST_P(SyncSetupHandlerTest, TestSyncEverything) {
std::string args = GetConfiguration(
- NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_PASSWORDS);
+ NULL, SYNC_ALL_DATA, GetAllTypes(), "", ENCRYPT_PASSWORDS);
ListValue list_args;
list_args.Append(new StringValue(args));
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
@@ -881,7 +855,7 @@ TEST_P(SyncSetupHandlerTest, TestSyncEverything) {
TEST_P(SyncSetupHandlerTest, TurnOnEncryptAll) {
std::string args = GetConfiguration(
- NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_ALL_DATA);
+ NULL, SYNC_ALL_DATA, GetAllTypes(), "", ENCRYPT_ALL_DATA);
ListValue list_args;
list_args.Append(new StringValue(args));
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
@@ -900,7 +874,7 @@ TEST_P(SyncSetupHandlerTest, TurnOnEncryptAll) {
TEST_P(SyncSetupHandlerTest, TestPassphraseStillRequired) {
std::string args = GetConfiguration(
- NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_PASSWORDS);
+ NULL, SYNC_ALL_DATA, GetAllTypes(), "", ENCRYPT_PASSWORDS);
ListValue list_args;
list_args.Append(new StringValue(args));
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
@@ -1016,11 +990,8 @@ TEST_P(SyncSetupHandlerTest, TestSyncIndividualTypes) {
for (it = user_selectable_types.First(); it.Good(); it.Inc()) {
syncer::ModelTypeSet type_to_set;
type_to_set.Put(it.Get());
- std::string args = GetConfiguration(NULL,
- CHOOSE_WHAT_TO_SYNC,
- type_to_set,
- std::string(),
- ENCRYPT_PASSWORDS);
+ std::string args = GetConfiguration(
+ NULL, CHOOSE_WHAT_TO_SYNC, type_to_set, "", ENCRYPT_PASSWORDS);
ListValue list_args;
list_args.Append(new StringValue(args));
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
@@ -1039,11 +1010,8 @@ TEST_P(SyncSetupHandlerTest, TestSyncIndividualTypes) {
}
TEST_P(SyncSetupHandlerTest, TestSyncAllManually) {
- std::string args = GetConfiguration(NULL,
- CHOOSE_WHAT_TO_SYNC,
- GetAllTypes(),
- std::string(),
- ENCRYPT_PASSWORDS);
+ std::string args = GetConfiguration(
+ NULL, CHOOSE_WHAT_TO_SYNC, GetAllTypes(), "", ENCRYPT_PASSWORDS);
ListValue list_args;
list_args.Append(new StringValue(args));
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
@@ -1106,12 +1074,12 @@ TEST_P(SyncSetupHandlerTest, ShowSyncSetupWithAuthError) {
ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary));
// We should display a login screen with a non-editable username filled in.
CheckShowSyncSetupArgs(dictionary,
- std::string(),
+ "",
false,
GoogleServiceAuthError::NONE,
kTestUser,
false,
- std::string());
+ "");
} else {
ASSERT_FALSE(handler_->is_configuring_sync());
ASSERT_TRUE(handler_->have_signin_tracker());
@@ -1276,9 +1244,9 @@ TEST_P(SyncSetupHandlerTest, SubmitAuthWithInvalidUsername) {
DictionaryValue args;
args.SetString("user", "user@not_allowed.com");
args.SetString("pass", "password");
- args.SetString("captcha", std::string());
- args.SetString("otp", std::string());
- args.SetString("accessCode", std::string());
+ args.SetString("captcha", "");
+ args.SetString("otp", "");
+ args.SetString("accessCode", "");
std::string json;
base::JSONWriter::Write(&args, &json);
ListValue list_args;
@@ -1299,13 +1267,8 @@ TEST_P(SyncSetupHandlerTest, SubmitAuthWithInvalidUsername) {
DictionaryValue* dictionary;
ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary));
std::string err = l10n_util::GetStringUTF8(IDS_SYNC_LOGIN_NAME_PROHIBITED);
- CheckShowSyncSetupArgs(dictionary,
- err,
- false,
- GoogleServiceAuthError::NONE,
- std::string(),
- true,
- std::string());
+ CheckShowSyncSetupArgs(
+ dictionary, err, false, GoogleServiceAuthError::NONE, "", true, "");
handler_->CloseSyncSetup();
EXPECT_EQ(NULL,
LoginUIServiceFactory::GetForProfile(
diff --git a/chrome/browser/ui/webui/version_ui.cc b/chrome/browser/ui/webui/version_ui.cc
index 6497ae0..678492a 100644
--- a/chrome/browser/ui/webui/version_ui.cc
+++ b/chrome/browser/ui/webui/version_ui.cc
@@ -92,7 +92,7 @@ content::WebUIDataSource* CreateVersionUIDataSource(Profile* profile) {
html_source->AddString("command_line",
WideToUTF16(CommandLine::ForCurrentProcess()->GetCommandLineString()));
#elif defined(OS_POSIX)
- std::string command_line;
+ std::string command_line = "";
typedef std::vector<std::string> ArgvList;
const ArgvList& argv = CommandLine::ForCurrentProcess()->argv();
for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++)
diff --git a/chrome/browser/value_store/leveldb_value_store.cc b/chrome/browser/value_store/leveldb_value_store.cc
index bad05dd..47ad0c0 100644
--- a/chrome/browser/value_store/leveldb_value_store.cc
+++ b/chrome/browser/value_store/leveldb_value_store.cc
@@ -334,7 +334,7 @@ std::string LeveldbValueStore::EnsureDbIsOpen() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (db_.get())
- return std::string();
+ return "";
#if defined(OS_POSIX)
std::string os_path(db_path_.value());
@@ -356,7 +356,7 @@ std::string LeveldbValueStore::EnsureDbIsOpen() {
}
db_.reset(db);
- return std::string();
+ return "";
}
std::string LeveldbValueStore::ReadFromDb(
@@ -371,7 +371,7 @@ std::string LeveldbValueStore::ReadFromDb(
if (s.IsNotFound()) {
// Despite there being no value, it was still a success.
// Check this first because ok() is false on IsNotFound.
- return std::string();
+ return "";
}
if (!s.ok())
@@ -384,7 +384,7 @@ std::string LeveldbValueStore::ReadFromDb(
}
setting->reset(value);
- return std::string();
+ return "";
}
std::string LeveldbValueStore::AddToBatch(
@@ -410,16 +410,16 @@ std::string LeveldbValueStore::AddToBatch(
batch->Put(key, value_as_json);
}
- return std::string();
+ return "";
}
std::string LeveldbValueStore::WriteToDb(leveldb::WriteBatch* batch) {
leveldb::Status status = db_->Write(leveldb::WriteOptions(), batch);
if (status.IsNotFound()) {
NOTREACHED() << "IsNotFound() but writing?!";
- return std::string();
+ return "";
}
- return status.ok() ? std::string() : status.ToString();
+ return status.ok() ? "" : status.ToString();
}
bool LeveldbValueStore::IsEmpty() {
diff --git a/chrome/browser/web_applications/web_app_unittest.cc b/chrome/browser/web_applications/web_app_unittest.cc
index 149f62b..0bd1c01 100644
--- a/chrome/browser/web_applications/web_app_unittest.cc
+++ b/chrome/browser/web_applications/web_app_unittest.cc
@@ -71,8 +71,9 @@ TEST_F(WebApplicationTest, AppDirWithId) {
TEST_F(WebApplicationTest, AppDirWithUrl) {
base::FilePath profile_path(FILE_PATH_LITERAL("profile"));
base::FilePath result(web_app::GetWebAppDataDirectory(
- profile_path, std::string(), GURL("http://example.com")));
+ profile_path, "", GURL("http://example.com")));
base::FilePath expected = profile_path.AppendASCII("Web Applications")
- .AppendASCII("example.com").AppendASCII("http_80");
+ .AppendASCII("example.com")
+ .AppendASCII("http_80");
EXPECT_EQ(expected, result);
}
diff --git a/chrome/browser/webdata/keyword_table.cc b/chrome/browser/webdata/keyword_table.cc
index 10d224e..956d60b 100644
--- a/chrome/browser/webdata/keyword_table.cc
+++ b/chrome/browser/webdata/keyword_table.cc
@@ -388,7 +388,7 @@ bool KeywordTable::MigrateToVersion45RemoveLogoIDAndAutogenerateColumns() {
// Migrate the keywords backup table as well.
if (!MigrateKeywordsTableForVersion45("keywords_backup") ||
!meta_table_->SetValue("Default Search Provider ID Backup Signature",
- std::string()))
+ ""))
return false;
return transaction.Commit();
@@ -409,7 +409,7 @@ bool KeywordTable::MigrateToVersion47AddAlternateURLsColumn() {
if (!db_->Execute("ALTER TABLE keywords_backup ADD COLUMN "
"alternate_urls VARCHAR DEFAULT ''") ||
!meta_table_->SetValue("Default Search Provider ID Backup Signature",
- std::string()))
+ ""))
return false;
return transaction.Commit();
diff --git a/chrome/browser/webdata/token_service_table_unittest.cc b/chrome/browser/webdata/token_service_table_unittest.cc
index 3c60ccf..db409f8 100644
--- a/chrome/browser/webdata/token_service_table_unittest.cc
+++ b/chrome/browser/webdata/token_service_table_unittest.cc
@@ -89,7 +89,7 @@ TEST_F(TokenServiceTableTest, MAYBE_TokenServiceGetSet) {
out_map.clear();
// try blanking it - won't remove it from the db though!
- EXPECT_TRUE(table_->SetTokenForService(service, std::string()));
+ EXPECT_TRUE(table_->SetTokenForService(service, ""));
EXPECT_TRUE(table_->GetAllTokens(&out_map));
EXPECT_EQ(out_map.find(service)->second, "");
out_map.clear();
diff --git a/chrome/common/child_process_logging_posix.cc b/chrome/common/child_process_logging_posix.cc
index 496103e..1690cd5 100644
--- a/chrome/common/child_process_logging_posix.cc
+++ b/chrome/common/child_process_logging_posix.cc
@@ -66,7 +66,7 @@ void SetActiveURL(const GURL& url) {
void SetClientId(const std::string& client_id) {
std::string str(client_id);
- ReplaceSubstringsAfterOffset(&str, 0, "-", std::string());
+ ReplaceSubstringsAfterOffset(&str, 0, "-", "");
if (str.empty())
return;
diff --git a/chrome/common/content_settings_helper.cc b/chrome/common/content_settings_helper.cc
index 68e8d40..306cbe7 100644
--- a/chrome/common/content_settings_helper.cc
+++ b/chrome/common/content_settings_helper.cc
@@ -12,14 +12,11 @@
namespace content_settings_helper {
std::string OriginToString(const GURL& origin) {
- std::string port_component(origin.IntPort() != url_parse::PORT_UNSPECIFIED
- ? ":" + origin.port()
- : std::string());
- std::string scheme_component(!origin.SchemeIs(chrome::kHttpScheme)
- ? origin.scheme() +
- content::kStandardSchemeSeparator
- : std::string());
- return scheme_component + origin.host() + port_component;
+ std::string port_component(origin.IntPort() != url_parse::PORT_UNSPECIFIED ?
+ ":" + origin.port() : "");
+ std::string scheme_component(!origin.SchemeIs(chrome::kHttpScheme) ?
+ origin.scheme() + content::kStandardSchemeSeparator : "");
+ return scheme_component + origin.host() + port_component;
}
string16 OriginToString16(const GURL& origin) {
diff --git a/chrome/common/content_settings_pattern.cc b/chrome/common/content_settings_pattern.cc
index ee02312..9153de6 100644
--- a/chrome/common/content_settings_pattern.cc
+++ b/chrome/common/content_settings_pattern.cc
@@ -26,7 +26,7 @@ std::string GetDefaultPort(const std::string& scheme) {
return "80";
if (scheme == chrome::kHttpsScheme)
return "443";
- return std::string();
+ return "";
}
// Returns true if |sub_domain| is a sub domain or equls |domain|. E.g.
@@ -501,7 +501,7 @@ const std::string ContentSettingsPattern::ToString() const {
if (IsValid())
return content_settings::PatternParser::ToString(parts_);
else
- return std::string();
+ return "";
}
ContentSettingsPattern::Relation ContentSettingsPattern::Compare(
diff --git a/chrome/common/content_settings_pattern_parser.cc b/chrome/common/content_settings_pattern_parser.cc
index 73da479..2f823cc 100644
--- a/chrome/common/content_settings_pattern_parser.cc
+++ b/chrome/common/content_settings_pattern_parser.cc
@@ -198,7 +198,7 @@ std::string PatternParser::ToString(
parts.is_port_wildcard)
return "*";
- std::string str;
+ std::string str = "";
if (!parts.is_scheme_wildcard)
str += parts.scheme + content::kStandardSchemeSeparator;
diff --git a/chrome/common/content_settings_pattern_unittest.cc b/chrome/common/content_settings_pattern_unittest.cc
index c1c1e37..921f97b 100644
--- a/chrome/common/content_settings_pattern_unittest.cc
+++ b/chrome/common/content_settings_pattern_unittest.cc
@@ -420,8 +420,8 @@ TEST(ContentSettingsPatternTest, InvalidPatterns) {
EXPECT_STREQ("", ContentSettingsPattern().ToString().c_str());
// Empty pattern string
- EXPECT_FALSE(Pattern(std::string()).IsValid());
- EXPECT_STREQ("", Pattern(std::string()).ToString().c_str());
+ EXPECT_FALSE(Pattern("").IsValid());
+ EXPECT_STREQ("", Pattern("").ToString().c_str());
// Pattern strings with invalid scheme part.
EXPECT_FALSE(Pattern("ftp://myhost.org").IsValid());
@@ -630,7 +630,8 @@ TEST(ContentSettingsPatternTest, PatternSupport_Legacy) {
EXPECT_TRUE(
Pattern("file:///tmp/test.html").Matches(
GURL("file:///tmp/test.html")));
- EXPECT_FALSE(Pattern(std::string()).Matches(GURL("http://www.example.com/")));
+ EXPECT_FALSE(Pattern("").Matches(
+ GURL("http://www.example.com/")));
EXPECT_FALSE(Pattern("[*.]example.com").Matches(
GURL("http://example.org/")));
EXPECT_FALSE(Pattern("example.com").Matches(
diff --git a/chrome/common/extensions/api/commands/commands_handler.cc b/chrome/common/extensions/api/commands/commands_handler.cc
index b5ed3c4..309a204 100644
--- a/chrome/common/extensions/api/commands/commands_handler.cc
+++ b/chrome/common/extensions/api/commands/commands_handler.cc
@@ -137,10 +137,8 @@ void CommandsHandler::MaybeSetBrowserActionDefault(const Extension* extension,
CommandsInfo* info) {
if (extension->manifest()->HasKey(keys::kBrowserAction) &&
!info->browser_action_command.get()) {
- info->browser_action_command.reset(
- new Command(extension_manifest_values::kBrowserActionCommandEvent,
- string16(),
- std::string()));
+ info->browser_action_command.reset(new Command(
+ extension_manifest_values::kBrowserActionCommandEvent, string16(), ""));
}
}
diff --git a/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc b/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc
index ac5040c..84277176 100644
--- a/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc
+++ b/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc
@@ -100,13 +100,15 @@ TEST_F(BrowserActionManifestTest,
TEST_F(BrowserActionManifestTest,
BrowserActionManifestIcons_InvalidDefaultIcon) {
scoped_ptr<DictionaryValue> manifest_value = DictionaryBuilder()
- .Set("name", "Invalid default icon").Set("version", "1.0.0")
+ .Set("name", "Invalid default icon")
+ .Set("version", "1.0.0")
.Set("manifest_version", 2)
- .Set("browser_action",
- DictionaryBuilder().Set(
- "default_icon",
- DictionaryBuilder().Set("19", std::string()) // Invalid value.
- .Set("24", "icon24.png").Set("38", "icon38.png"))).Build();
+ .Set("browser_action", DictionaryBuilder()
+ .Set("default_icon", DictionaryBuilder()
+ .Set("19", "") // Invalid value.
+ .Set("24", "icon24.png")
+ .Set("38", "icon38.png")))
+ .Build();
string16 error = ErrorUtils::FormatErrorMessageUTF16(
errors::kInvalidIconPath, "19");
diff --git a/chrome/common/extensions/api/extension_api.cc b/chrome/common/extensions/api/extension_api.cc
index 97a2fdd..b1095a4 100644
--- a/chrome/common/extensions/api/extension_api.cc
+++ b/chrome/common/extensions/api/extension_api.cc
@@ -426,11 +426,10 @@ Feature::Availability ExtensionAPI::IsAvailable(const std::string& full_name,
// Check APIs not using the feature system first.
if (!feature) {
- return IsNonFeatureAPIAvailable(api_name, context, extension, url)
- ? Feature::CreateAvailability(Feature::IS_AVAILABLE,
- std::string())
- : Feature::CreateAvailability(Feature::INVALID_CONTEXT,
- kUnavailableMessage);
+ return IsNonFeatureAPIAvailable(api_name, context, extension, url) ?
+ Feature::CreateAvailability(Feature::IS_AVAILABLE, "") :
+ Feature::CreateAvailability(Feature::INVALID_CONTEXT,
+ kUnavailableMessage);
}
Feature::Availability availability =
@@ -446,7 +445,7 @@ Feature::Availability ExtensionAPI::IsAvailable(const std::string& full_name,
return dependency_availability;
}
- return Feature::CreateAvailability(Feature::IS_AVAILABLE, std::string());
+ return Feature::CreateAvailability(Feature::IS_AVAILABLE, "");
}
bool ExtensionAPI::IsPrivileged(const std::string& full_name) {
@@ -635,7 +634,7 @@ std::string ExtensionAPI::GetAPINameFromFullName(const std::string& full_name,
}
*child_name = "";
- return std::string();
+ return "";
}
bool ExtensionAPI::IsAPIAllowed(const std::string& name,
diff --git a/chrome/common/extensions/api/extension_api_unittest.cc b/chrome/common/extensions/api/extension_api_unittest.cc
index f980b57..98830ea 100644
--- a/chrome/common/extensions/api/extension_api_unittest.cc
+++ b/chrome/common/extensions/api/extension_api_unittest.cc
@@ -97,7 +97,7 @@ TEST_F(ExtensionAPITest, IsPrivileged) {
EXPECT_TRUE(extension_api->IsPrivileged("runtime.lastError"));
// Default unknown names to privileged for paranoia's sake.
- EXPECT_TRUE(extension_api->IsPrivileged(std::string()));
+ EXPECT_TRUE(extension_api->IsPrivileged(""));
EXPECT_TRUE(extension_api->IsPrivileged("<unknown-namespace>"));
EXPECT_TRUE(extension_api->IsPrivileged("extension.<unknown-member>"));
@@ -224,8 +224,8 @@ TEST(ExtensionAPI, APIFeatures) {
TEST_F(ExtensionAPITest, LazyGetSchema) {
scoped_ptr<ExtensionAPI> apis(ExtensionAPI::CreateWithDefaultConfiguration());
- EXPECT_EQ(NULL, apis->GetSchema(std::string()));
- EXPECT_EQ(NULL, apis->GetSchema(std::string()));
+ EXPECT_EQ(NULL, apis->GetSchema(""));
+ EXPECT_EQ(NULL, apis->GetSchema(""));
EXPECT_EQ(NULL, apis->GetSchema("experimental"));
EXPECT_EQ(NULL, apis->GetSchema("experimental"));
EXPECT_EQ(NULL, apis->GetSchema("foo"));
diff --git a/chrome/common/extensions/csp_validator_unittest.cc b/chrome/common/extensions/csp_validator_unittest.cc
index 13cbfe8..e96c42d 100644
--- a/chrome/common/extensions/csp_validator_unittest.cc
+++ b/chrome/common/extensions/csp_validator_unittest.cc
@@ -23,10 +23,10 @@ TEST(ExtensionCSPValidator, IsLegal) {
}
TEST(ExtensionCSPValidator, IsSecure) {
- EXPECT_FALSE(
- ContentSecurityPolicyIsSecure(std::string(), Manifest::TYPE_EXTENSION));
- EXPECT_FALSE(ContentSecurityPolicyIsSecure("img-src https://google.com",
- Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "", Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "img-src https://google.com", Manifest::TYPE_EXTENSION));
EXPECT_FALSE(ContentSecurityPolicyIsSecure(
"default-src *", Manifest::TYPE_EXTENSION));
@@ -146,10 +146,9 @@ TEST(ExtensionCSPValidator, IsSecure) {
}
TEST(ExtensionCSPValidator, IsSandboxed) {
- EXPECT_FALSE(ContentSecurityPolicyIsSandboxed(std::string(),
- Manifest::TYPE_EXTENSION));
- EXPECT_FALSE(ContentSecurityPolicyIsSandboxed("img-src https://google.com",
- Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSandboxed("", Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSandboxed(
+ "img-src https://google.com", Manifest::TYPE_EXTENSION));
// Sandbox directive is required.
EXPECT_TRUE(ContentSecurityPolicyIsSandboxed(
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 42407b8..a941208 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -437,8 +437,8 @@ bool Extension::ParsePermissions(const char* key,
if (manifest_->HasKey(key)) {
const ListValue* permissions = NULL;
if (!manifest_->GetList(key, &permissions)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidPermissions,
- std::string());
+ *error = ErrorUtils::FormatErrorMessageUTF16(
+ errors::kInvalidPermissions, "");
return false;
}
diff --git a/chrome/common/extensions/extension_file_util_unittest.cc b/chrome/common/extensions/extension_file_util_unittest.cc
index 6d68bc1..cb9260f 100644
--- a/chrome/common/extensions/extension_file_util_unittest.cc
+++ b/chrome/common/extensions/extension_file_util_unittest.cc
@@ -304,7 +304,7 @@ TEST_F(ExtensionFileUtilTest, ExtensionResourceURLToFilePath) {
// Setup filesystem for testing.
base::FilePath root_path;
ASSERT_TRUE(file_util::CreateNewTempDirectory(
- base::FilePath::StringType(), &root_path));
+ FILE_PATH_LITERAL(""), &root_path));
ASSERT_TRUE(file_util::AbsolutePath(&root_path));
base::FilePath api_path = root_path.Append(FILE_PATH_LITERAL("apiname"));
diff --git a/chrome/common/extensions/extension_icon_set_unittest.cc b/chrome/common/extensions/extension_icon_set_unittest.cc
index c7300a7..1202cda 100644
--- a/chrome/common/extensions/extension_icon_set_unittest.cc
+++ b/chrome/common/extensions/extension_icon_set_unittest.cc
@@ -62,7 +62,7 @@ TEST(ExtensionIconSet, Values) {
EXPECT_TRUE(icons.ContainsPath("foo"));
EXPECT_TRUE(icons.ContainsPath("bar"));
EXPECT_FALSE(icons.ContainsPath("baz"));
- EXPECT_FALSE(icons.ContainsPath(std::string()));
+ EXPECT_FALSE(icons.ContainsPath(""));
icons.Clear();
EXPECT_FALSE(icons.ContainsPath("foo"));
@@ -83,7 +83,7 @@ TEST(ExtensionIconSet, FindSize) {
EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID,
icons.GetIconSizeFromPath("baz"));
EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID,
- icons.GetIconSizeFromPath(std::string()));
+ icons.GetIconSizeFromPath(""));
icons.Clear();
EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID,
diff --git a/chrome/common/extensions/extension_l10n_util.cc b/chrome/common/extensions/extension_l10n_util.cc
index d2dada0..b86ab49 100644
--- a/chrome/common/extensions/extension_l10n_util.cc
+++ b/chrome/common/extensions/extension_l10n_util.cc
@@ -44,7 +44,7 @@ std::string GetDefaultLocaleFromManifest(const DictionaryValue& manifest,
return default_locale;
*error = errors::kInvalidDefaultLocale;
- return std::string();
+ return "";
}
diff --git a/chrome/common/extensions/extension_localization_peer_unittest.cc b/chrome/common/extensions/extension_localization_peer_unittest.cc
index df74791..92085ed 100644
--- a/chrome/common/extensions/extension_localization_peer_unittest.cc
+++ b/chrome/common/extensions/extension_localization_peer_unittest.cc
@@ -144,8 +144,8 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestBadURLRequestStatus) {
EXPECT_CALL(*original_peer_, OnCompletedRequest(
net::ERR_ABORTED, false, "", base::TimeTicks()));
- filter_peer->OnCompletedRequest(
- net::ERR_FAILED, false, std::string(), base::TimeTicks());
+ filter_peer->OnCompletedRequest(net::ERR_FAILED, false, "",
+ base::TimeTicks());
}
TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestEmptyData) {
@@ -159,8 +159,7 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestEmptyData) {
EXPECT_CALL(*original_peer_, OnCompletedRequest(
net::OK, false, "", base::TimeTicks()));
- filter_peer->OnCompletedRequest(
- net::OK, false, std::string(), base::TimeTicks());
+ filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks());
}
TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestNoCatalogs) {
@@ -179,16 +178,14 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestNoCatalogs) {
EXPECT_CALL(*original_peer_, OnCompletedRequest(
net::OK, false, "", base::TimeTicks())).Times(2);
- filter_peer->OnCompletedRequest(
- net::OK, false, std::string(), base::TimeTicks());
+ filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks());
// Test if Send gets called again (it shouldn't be) when first call returned
// an empty dictionary.
filter_peer =
CreateExtensionLocalizationPeer("text/css", GURL(kExtensionUrl_1));
SetData(filter_peer, "some text");
- filter_peer->OnCompletedRequest(
- net::OK, false, std::string(), base::TimeTicks());
+ filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks());
}
TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestWithCatalogs) {
@@ -216,8 +213,7 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestWithCatalogs) {
EXPECT_CALL(*original_peer_, OnCompletedRequest(
net::OK, false, "", base::TimeTicks()));
- filter_peer->OnCompletedRequest(
- net::OK, false, std::string(), base::TimeTicks());
+ filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks());
}
TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestReplaceMessagesFails) {
@@ -245,6 +241,5 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestReplaceMessagesFails) {
EXPECT_CALL(*original_peer_, OnCompletedRequest(
net::OK, false, "", base::TimeTicks()));
- filter_peer->OnCompletedRequest(
- net::OK, false, std::string(), base::TimeTicks());
+ filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks());
}
diff --git a/chrome/common/extensions/extension_set.cc b/chrome/common/extensions/extension_set.cc
index 8b68fb6..84872b8 100644
--- a/chrome/common/extensions/extension_set.cc
+++ b/chrome/common/extensions/extension_set.cc
@@ -77,11 +77,11 @@ std::string ExtensionSet::GetExtensionOrAppIDByURL(
DCHECK(!info.origin().isNull());
if (info.url().SchemeIs(extensions::kExtensionScheme))
- return info.origin().isUnique() ? std::string() : info.url().host();
+ return info.origin().isUnique() ? "" : info.url().host();
const Extension* extension = GetExtensionOrAppByURL(info);
if (!extension)
- return std::string();
+ return "";
return extension->id();
}
diff --git a/chrome/common/extensions/extension_set_unittest.cc b/chrome/common/extensions/extension_set_unittest.cc
index c27b0a9..1703966 100644
--- a/chrome/common/extensions/extension_set_unittest.cc
+++ b/chrome/common/extensions/extension_set_unittest.cc
@@ -59,8 +59,7 @@ TEST(ExtensionSetTest, ExtensionSet) {
scoped_refptr<Extension> ext3(CreateTestExtension(
"b", "http://dev.chromium.org/", "http://dev.chromium.org/"));
- scoped_refptr<Extension> ext4(
- CreateTestExtension("c", std::string(), std::string()));
+ scoped_refptr<Extension> ext4(CreateTestExtension("c", "", ""));
ASSERT_TRUE(ext1 && ext2 && ext3 && ext4);
@@ -119,10 +118,8 @@ TEST(ExtensionSetTest, ExtensionSet) {
EXPECT_FALSE(extensions.GetByID(ext2->id()));
// Make a union of a set with 3 more extensions (only 2 are new).
- scoped_refptr<Extension> ext5(
- CreateTestExtension("d", std::string(), std::string()));
- scoped_refptr<Extension> ext6(
- CreateTestExtension("e", std::string(), std::string()));
+ scoped_refptr<Extension> ext5(CreateTestExtension("d", "", ""));
+ scoped_refptr<Extension> ext6(CreateTestExtension("e", "", ""));
ASSERT_TRUE(ext5 && ext6);
scoped_ptr<ExtensionSet> to_add(new ExtensionSet());
diff --git a/chrome/common/extensions/extension_sync_type_unittest.cc b/chrome/common/extensions/extension_sync_type_unittest.cc
index b25e197..3256c8d 100644
--- a/chrome/common/extensions/extension_sync_type_unittest.cc
+++ b/chrome/common/extensions/extension_sync_type_unittest.cc
@@ -56,7 +56,7 @@ class ExtensionSyncTypeTest : public ExtensionTest {
ListValue* plugins = new ListValue();
for (int i = 0; i < num_plugins; ++i) {
DictionaryValue* plugin = new DictionaryValue();
- plugin->SetString(keys::kPluginsPath, std::string());
+ plugin->SetString(keys::kPluginsPath, "");
plugins->Set(i, plugin);
}
source.Set(keys::kPlugins, plugins);
@@ -158,7 +158,7 @@ TEST_F(ExtensionSyncTypeTest, DisplayInXManifestProperties) {
manifest.SetString(keys::kName, "TestComponentApp");
manifest.SetString(keys::kVersion, "0.0.0.0");
manifest.SetString(keys::kApp, "true");
- manifest.SetString(keys::kPlatformAppBackgroundPage, std::string());
+ manifest.SetString(keys::kPlatformAppBackgroundPage, "");
std::string error;
scoped_refptr<Extension> app;
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index edf24c4..6a3c80d 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -233,22 +233,16 @@ TEST_F(ExtensionTest, MimeTypeSniffing) {
ASSERT_TRUE(file_util::ReadFileToString(path, &data));
std::string result;
- EXPECT_TRUE(net::SniffMimeType(data.c_str(),
- data.size(),
- GURL("http://www.example.com/foo.crx"),
- std::string(),
- &result));
+ EXPECT_TRUE(net::SniffMimeType(data.c_str(), data.size(),
+ GURL("http://www.example.com/foo.crx"), "", &result));
EXPECT_EQ(std::string(Extension::kMimeType), result);
data.clear();
result.clear();
path = path.DirName().AppendASCII("bad_magic.crx");
ASSERT_TRUE(file_util::ReadFileToString(path, &data));
- EXPECT_TRUE(net::SniffMimeType(data.c_str(),
- data.size(),
- GURL("http://www.example.com/foo.crx"),
- std::string(),
- &result));
+ EXPECT_TRUE(net::SniffMimeType(data.c_str(), data.size(),
+ GURL("http://www.example.com/foo.crx"), "", &result));
EXPECT_EQ("application/octet-stream", result);
}
diff --git a/chrome/common/extensions/features/api_feature.cc b/chrome/common/extensions/features/api_feature.cc
index f6d826e..0020632 100644
--- a/chrome/common/extensions/features/api_feature.cc
+++ b/chrome/common/extensions/features/api_feature.cc
@@ -26,7 +26,7 @@ std::string APIFeature::Parse(const DictionaryValue* value) {
if (GetContexts()->empty())
return name() + ": API features must specify at least one context.";
- return std::string();
+ return "";
}
} // namespace
diff --git a/chrome/common/extensions/features/complex_feature.cc b/chrome/common/extensions/features/complex_feature.cc
index a4515d0e4..f6f1c11 100644
--- a/chrome/common/extensions/features/complex_feature.cc
+++ b/chrome/common/extensions/features/complex_feature.cc
@@ -76,7 +76,7 @@ std::string ComplexFeature::GetAvailabilityMessage(AvailabilityResult result,
Manifest::Type type,
const GURL& url) const {
if (result == IS_AVAILABLE)
- return std::string();
+ return "";
// TODO(justinlin): Form some kind of combined availabilities/messages from
// SimpleFeatures.
diff --git a/chrome/common/extensions/features/manifest_feature.cc b/chrome/common/extensions/features/manifest_feature.cc
index 5196b52..cd4a53f 100644
--- a/chrome/common/extensions/features/manifest_feature.cc
+++ b/chrome/common/extensions/features/manifest_feature.cc
@@ -47,7 +47,7 @@ std::string ManifestFeature::Parse(const DictionaryValue* value) {
if (!GetContexts()->empty())
return name() + ": Manifest features do not support contexts.";
- return std::string();
+ return "";
}
} // namespace
diff --git a/chrome/common/extensions/features/permission_feature.cc b/chrome/common/extensions/features/permission_feature.cc
index 4681aa2..72b261f 100644
--- a/chrome/common/extensions/features/permission_feature.cc
+++ b/chrome/common/extensions/features/permission_feature.cc
@@ -49,7 +49,7 @@ std::string PermissionFeature::Parse(const DictionaryValue* value) {
if (!GetContexts()->empty())
return name() + ": Permission features do not support contexts.";
- return std::string();
+ return "";
}
} // namespace
diff --git a/chrome/common/extensions/features/simple_feature.cc b/chrome/common/extensions/features/simple_feature.cc
index 4b08c60..13c8573 100644
--- a/chrome/common/extensions/features/simple_feature.cc
+++ b/chrome/common/extensions/features/simple_feature.cc
@@ -168,7 +168,7 @@ std::string GetDisplayTypeName(Manifest::Type type) {
}
NOTREACHED();
- return std::string();
+ return "";
}
} // namespace
@@ -229,7 +229,7 @@ std::string SimpleFeature::Parse(const DictionaryValue* value) {
return name() + ": Allowing web_page contexts requires supplying a value " +
"for matches.";
}
- return std::string();
+ return "";
}
Feature::Availability SimpleFeature::IsAvailableToManifest(
@@ -313,7 +313,7 @@ std::string SimpleFeature::GetAvailabilityMessage(
AvailabilityResult result, Manifest::Type type, const GURL& url) const {
switch (result) {
case IS_AVAILABLE:
- return std::string();
+ return "";
case NOT_FOUND_IN_WHITELIST:
return base::StringPrintf(
"'%s' is not allowed for specified extension ID.",
@@ -381,7 +381,7 @@ std::string SimpleFeature::GetAvailabilityMessage(
}
NOTREACHED();
- return std::string();
+ return "";
}
Feature::Availability SimpleFeature::CreateAvailability(
diff --git a/chrome/common/extensions/features/simple_feature_unittest.cc b/chrome/common/extensions/features/simple_feature_unittest.cc
index 4f92a34..443b152 100644
--- a/chrome/common/extensions/features/simple_feature_unittest.cc
+++ b/chrome/common/extensions/features/simple_feature_unittest.cc
@@ -91,13 +91,9 @@ TEST_F(ExtensionSimpleFeatureTest, Whitelist) {
EXPECT_EQ(Feature::NOT_FOUND_IN_WHITELIST, feature.IsAvailableToManifest(
kIdBaz, Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1,
Feature::UNSPECIFIED_PLATFORM).result());
- EXPECT_EQ(
- Feature::NOT_FOUND_IN_WHITELIST,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- -1,
- Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::NOT_FOUND_IN_WHITELIST, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1,
+ Feature::UNSPECIFIED_PLATFORM).result());
feature.extension_types()->insert(Manifest::TYPE_LEGACY_PACKAGED_APP);
EXPECT_EQ(Feature::NOT_FOUND_IN_WHITELIST, feature.IsAvailableToManifest(
@@ -137,35 +133,19 @@ TEST_F(ExtensionSimpleFeatureTest, PackageType) {
feature.extension_types()->insert(Manifest::TYPE_EXTENSION);
feature.extension_types()->insert(Manifest::TYPE_LEGACY_PACKAGED_APP);
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_EXTENSION,
- Feature::UNSPECIFIED_LOCATION,
- -1,
- Feature::UNSPECIFIED_PLATFORM).result());
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_LEGACY_PACKAGED_APP,
- Feature::UNSPECIFIED_LOCATION,
- -1,
- Feature::UNSPECIFIED_PLATFORM).result());
-
- EXPECT_EQ(
- Feature::INVALID_TYPE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- -1,
- Feature::UNSPECIFIED_PLATFORM).result());
- EXPECT_EQ(
- Feature::INVALID_TYPE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_THEME,
- Feature::UNSPECIFIED_LOCATION,
- -1,
- Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_EXTENSION, Feature::UNSPECIFIED_LOCATION, -1,
+ Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_LEGACY_PACKAGED_APP, Feature::UNSPECIFIED_LOCATION,
+ -1, Feature::UNSPECIFIED_PLATFORM).result());
+
+ EXPECT_EQ(Feature::INVALID_TYPE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1,
+ Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::INVALID_TYPE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_THEME, Feature::UNSPECIFIED_LOCATION, -1,
+ Feature::UNSPECIFIED_PLATFORM).result());
}
TEST_F(ExtensionSimpleFeatureTest, Context) {
@@ -240,107 +220,64 @@ TEST_F(ExtensionSimpleFeatureTest, Location) {
// If the feature specifies "component" as its location, then only component
// extensions can access it.
feature.set_location(Feature::COMPONENT_LOCATION);
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::COMPONENT_LOCATION,
- -1,
- Feature::UNSPECIFIED_PLATFORM).result());
- EXPECT_EQ(
- Feature::INVALID_LOCATION,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- -1,
- Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::COMPONENT_LOCATION, -1,
+ Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::INVALID_LOCATION, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1,
+ Feature::UNSPECIFIED_PLATFORM).result());
// But component extensions can access anything else, whatever their location.
feature.set_location(Feature::UNSPECIFIED_LOCATION);
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::COMPONENT_LOCATION,
- -1,
- Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::COMPONENT_LOCATION, -1,
+ Feature::UNSPECIFIED_PLATFORM).result());
}
TEST_F(ExtensionSimpleFeatureTest, Platform) {
SimpleFeature feature;
feature.set_platform(Feature::CHROMEOS_PLATFORM);
- EXPECT_EQ(Feature::IS_AVAILABLE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- -1,
- Feature::CHROMEOS_PLATFORM).result());
- EXPECT_EQ(
- Feature::INVALID_PLATFORM,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- -1,
- Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1,
+ Feature::CHROMEOS_PLATFORM).result());
+ EXPECT_EQ(Feature::INVALID_PLATFORM, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1,
+ Feature::UNSPECIFIED_PLATFORM).result());
}
TEST_F(ExtensionSimpleFeatureTest, Version) {
SimpleFeature feature;
feature.set_min_manifest_version(5);
- EXPECT_EQ(
- Feature::INVALID_MIN_MANIFEST_VERSION,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- 0,
- Feature::UNSPECIFIED_PLATFORM).result());
- EXPECT_EQ(
- Feature::INVALID_MIN_MANIFEST_VERSION,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- 4,
- Feature::UNSPECIFIED_PLATFORM).result());
-
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- 5,
- Feature::UNSPECIFIED_PLATFORM).result());
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- 10,
- Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::INVALID_MIN_MANIFEST_VERSION,
+ feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION,
+ 0, Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::INVALID_MIN_MANIFEST_VERSION,
+ feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION,
+ 4, Feature::UNSPECIFIED_PLATFORM).result());
+
+ EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION,
+ 5, Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION,
+ 10, Feature::UNSPECIFIED_PLATFORM).result());
feature.set_max_manifest_version(8);
- EXPECT_EQ(
- Feature::INVALID_MAX_MANIFEST_VERSION,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- 10,
- Feature::UNSPECIFIED_PLATFORM).result());
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- 8,
- Feature::UNSPECIFIED_PLATFORM).result());
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature.IsAvailableToManifest(std::string(),
- Manifest::TYPE_UNKNOWN,
- Feature::UNSPECIFIED_LOCATION,
- 7,
- Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::INVALID_MAX_MANIFEST_VERSION,
+ feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION,
+ 10, Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE,
+ feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION,
+ 8, Feature::UNSPECIFIED_PLATFORM).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest(
+ "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION,
+ 7, Feature::UNSPECIFIED_PLATFORM).result());
}
TEST_F(ExtensionSimpleFeatureTest, ParseNull) {
@@ -612,15 +549,15 @@ TEST_F(ExtensionSimpleFeatureTest, SupportedChannel) {
// Default supported channel (trunk).
EXPECT_EQ(Feature::IS_AVAILABLE,
- IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_UNKNOWN));
+ IsAvailableInChannel("", VersionInfo::CHANNEL_UNKNOWN));
EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
- IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_CANARY));
+ IsAvailableInChannel("", VersionInfo::CHANNEL_CANARY));
EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
- IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_DEV));
+ IsAvailableInChannel("", VersionInfo::CHANNEL_DEV));
EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
- IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_BETA));
+ IsAvailableInChannel("", VersionInfo::CHANNEL_BETA));
EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
- IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_STABLE));
+ IsAvailableInChannel("", VersionInfo::CHANNEL_STABLE));
}
} // namespace
diff --git a/chrome/common/extensions/manifest_tests/extension_manifest_test.cc b/chrome/common/extensions/manifest_tests/extension_manifest_test.cc
index 4e72588..b61d5f7 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifest_test.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifest_test.cc
@@ -217,16 +217,20 @@ ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename,
ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename)
: manifest_filename_(manifest_filename),
+ expected_error_(""),
location_(extensions::Manifest::INTERNAL),
- flags_(Extension::NO_FLAGS) {}
+ flags_(Extension::NO_FLAGS) {
+}
ExtensionManifestTest::Testcase::Testcase(
std::string manifest_filename,
extensions::Manifest::Location location,
int flags)
: manifest_filename_(manifest_filename),
+ expected_error_(""),
location_(location),
- flags_(flags) {}
+ flags_(flags) {
+}
void ExtensionManifestTest::RunTestcases(const Testcase* testcases,
size_t num_testcases,
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
index bb93903..1fdab49 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
@@ -98,7 +98,7 @@ TEST_F(PlatformAppsManifestTest, PlatformAppContentSecurityPolicy) {
EXPECT_TRUE(extension->is_platform_app());
EXPECT_EQ(
"default-src 'self' https://www.google.com",
- CSPInfo::GetResourceContentSecurityPolicy(extension, std::string()));
+ CSPInfo::GetResourceContentSecurityPolicy(extension, ""));
// But even whitelisted ones must specify a secure policy.
LoadAndExpectError(
diff --git a/chrome/common/extensions/manifest_url_handler.cc b/chrome/common/extensions/manifest_url_handler.cc
index 690cc03..2e18eb1 100644
--- a/chrome/common/extensions/manifest_url_handler.cc
+++ b/chrome/common/extensions/manifest_url_handler.cc
@@ -125,8 +125,8 @@ bool HomepageURLHandler::Parse(Extension* extension, string16* error) {
std::string homepage_url_str;
if (!extension->manifest()->GetString(keys::kHomepageURL,
&homepage_url_str)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidHomepageURL,
- std::string());
+ *error = ErrorUtils::FormatErrorMessageUTF16(
+ errors::kInvalidHomepageURL, "");
return false;
}
manifest_url->url_ = GURL(homepage_url_str);
@@ -156,8 +156,8 @@ bool UpdateURLHandler::Parse(Extension* extension, string16* error) {
std::string tmp_update_url;
if (!extension->manifest()->GetString(keys::kUpdateURL, &tmp_update_url)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidUpdateURL,
- std::string());
+ *error = ErrorUtils::FormatErrorMessageUTF16(
+ errors::kInvalidUpdateURL, "");
return false;
}
diff --git a/chrome/common/extensions/message_bundle.cc b/chrome/common/extensions/message_bundle.cc
index bb7d547..708e2e4 100644
--- a/chrome/common/extensions/message_bundle.cc
+++ b/chrome/common/extensions/message_bundle.cc
@@ -303,7 +303,7 @@ std::string MessageBundle::GetL10nMessage(const std::string& name,
return it->second;
}
- return std::string();
+ return "";
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/common/extensions/permissions/bluetooth_device_permission_data.cc b/chrome/common/extensions/permissions/bluetooth_device_permission_data.cc
index 82c5acd..3698ebf 100644
--- a/chrome/common/extensions/permissions/bluetooth_device_permission_data.cc
+++ b/chrome/common/extensions/permissions/bluetooth_device_permission_data.cc
@@ -18,7 +18,9 @@ const char* kDeviceAddressKey = "deviceAddress";
namespace extensions {
-BluetoothDevicePermissionData::BluetoothDevicePermissionData() {}
+BluetoothDevicePermissionData::BluetoothDevicePermissionData()
+ : device_address_("") {
+}
BluetoothDevicePermissionData::BluetoothDevicePermissionData(
const std::string& device_address) : device_address_(device_address) {
diff --git a/chrome/common/extensions/permissions/socket_permission_unittest.cc b/chrome/common/extensions/permissions/socket_permission_unittest.cc
index 05e7d3d..6bb07be 100644
--- a/chrome/common/extensions/permissions/socket_permission_unittest.cc
+++ b/chrome/common/extensions/permissions/socket_permission_unittest.cc
@@ -48,7 +48,7 @@ TEST_F(SocketPermissionTest, General) {
TEST_F(SocketPermissionTest, Parse) {
SocketPermissionData data;
- EXPECT_FALSE(data.ParseForTest(std::string()));
+ EXPECT_FALSE(data.ParseForTest(""));
EXPECT_FALSE(data.ParseForTest("*"));
EXPECT_FALSE(data.ParseForTest("\00\00*"));
EXPECT_FALSE(data.ParseForTest("\01*"));
diff --git a/chrome/common/extensions/update_manifest_unittest.cc b/chrome/common/extensions/update_manifest_unittest.cc
index 2a16b9c..9af11df 100644
--- a/chrome/common/extensions/update_manifest_unittest.cc
+++ b/chrome/common/extensions/update_manifest_unittest.cc
@@ -120,7 +120,7 @@ TEST(ExtensionUpdateManifestTest, TestUpdateManifest) {
UpdateManifest parser;
// Test parsing of a number of invalid xml cases
- EXPECT_FALSE(parser.Parse(std::string()));
+ EXPECT_FALSE(parser.Parse(""));
EXPECT_FALSE(parser.errors().empty());
EXPECT_TRUE(parser.Parse(kMissingAppId));
diff --git a/chrome/common/json_schema/json_schema_validator.cc b/chrome/common/json_schema/json_schema_validator.cc
index 6e5e070..a303442 100644
--- a/chrome/common/json_schema/json_schema_validator.cc
+++ b/chrome/common/json_schema/json_schema_validator.cc
@@ -99,7 +99,7 @@ std::string JSONSchemaValidator::GetJSONSchemaType(const Value* value) {
return schema::kArray;
default:
NOTREACHED() << "Unexpected value type: " << value->GetType();
- return std::string();
+ return "";
}
}
@@ -147,7 +147,7 @@ JSONSchemaValidator::~JSONSchemaValidator() {}
bool JSONSchemaValidator::Validate(const Value* instance) {
errors_.clear();
- Validate(instance, schema_root_, std::string());
+ Validate(instance, schema_root_, "");
return errors_.empty();
}
diff --git a/chrome/common/json_schema/json_schema_validator_unittest_base.cc b/chrome/common/json_schema/json_schema_validator_unittest_base.cc
index 8ce82b7..ecd9846 100644
--- a/chrome/common/json_schema/json_schema_validator_unittest_base.cc
+++ b/chrome/common/json_schema/json_schema_validator_unittest_base.cc
@@ -130,9 +130,7 @@ void JSONSchemaValidatorTestBase::TestStringPattern() {
schema.get(), NULL);
ExpectNotValid(TEST_SOURCE,
scoped_ptr<base::Value>(new base::StringValue("bar")).get(),
- schema.get(),
- NULL,
- std::string(),
+ schema.get(), NULL, "",
JSONSchemaValidator::FormatErrorMessage(
JSONSchemaValidator::kStringPattern, "foo+"));
}
@@ -152,16 +150,10 @@ void JSONSchemaValidatorTestBase::TestEnum() {
ExpectNotValid(TEST_SOURCE,
scoped_ptr<base::Value>(new base::StringValue("42")).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::kInvalidEnum);
+ schema.get(), NULL, "", JSONSchemaValidator::kInvalidEnum);
ExpectNotValid(TEST_SOURCE,
scoped_ptr<base::Value>(base::Value::CreateNullValue()).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::kInvalidEnum);
+ schema.get(), NULL, "", JSONSchemaValidator::kInvalidEnum);
}
void JSONSchemaValidatorTestBase::TestChoices() {
@@ -181,24 +173,14 @@ void JSONSchemaValidatorTestBase::TestChoices() {
ExpectNotValid(TEST_SOURCE,
scoped_ptr<base::Value>(new base::StringValue("foo")).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::kInvalidChoice);
+ schema.get(), NULL, "", JSONSchemaValidator::kInvalidChoice);
ExpectNotValid(TEST_SOURCE,
scoped_ptr<base::Value>(new base::ListValue()).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::kInvalidChoice);
+ schema.get(), NULL, "", JSONSchemaValidator::kInvalidChoice);
instance->SetInteger("foo", 42);
- ExpectNotValid(TEST_SOURCE,
- instance.get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::kInvalidChoice);
+ ExpectNotValid(TEST_SOURCE, instance.get(),
+ schema.get(), NULL, "", JSONSchemaValidator::kInvalidChoice);
}
void JSONSchemaValidatorTestBase::TestExtends() {
@@ -351,11 +333,7 @@ void JSONSchemaValidatorTestBase::TestArrayTuple() {
ExpectValid(TEST_SOURCE, instance.get(), schema.get(), NULL);
instance->Append(new base::StringValue("anything"));
- ExpectNotValid(TEST_SOURCE,
- instance.get(),
- schema.get(),
- NULL,
- std::string(),
+ ExpectNotValid(TEST_SOURCE, instance.get(), schema.get(), NULL, "",
JSONSchemaValidator::FormatErrorMessage(
JSONSchemaValidator::kArrayMaxItems, "2"));
@@ -425,21 +403,13 @@ void JSONSchemaValidatorTestBase::TestArrayNonTuple() {
ExpectValid(TEST_SOURCE, instance.get(), schema.get(), NULL);
instance->Append(new base::StringValue("x"));
- ExpectNotValid(TEST_SOURCE,
- instance.get(),
- schema.get(),
- NULL,
- std::string(),
+ ExpectNotValid(TEST_SOURCE, instance.get(), schema.get(), NULL, "",
JSONSchemaValidator::FormatErrorMessage(
JSONSchemaValidator::kArrayMaxItems, "3"));
instance->Remove(1, NULL);
instance->Remove(1, NULL);
instance->Remove(1, NULL);
- ExpectNotValid(TEST_SOURCE,
- instance.get(),
- schema.get(),
- NULL,
- std::string(),
+ ExpectNotValid(TEST_SOURCE, instance.get(), schema.get(), NULL, "",
JSONSchemaValidator::FormatErrorMessage(
JSONSchemaValidator::kArrayMinItems, "2"));
@@ -466,20 +436,15 @@ void JSONSchemaValidatorTestBase::TestString() {
new base::StringValue("xxxxxxxxxx")).get(),
schema.get(), NULL);
- ExpectNotValid(
- TEST_SOURCE,
- scoped_ptr<base::Value>(new base::StringValue(std::string())).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::FormatErrorMessage(
- JSONSchemaValidator::kStringMinLength, "1"));
+ ExpectNotValid(TEST_SOURCE,
+ scoped_ptr<base::Value>(new base::StringValue("")).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::FormatErrorMessage(
+ JSONSchemaValidator::kStringMinLength, "1"));
ExpectNotValid(
TEST_SOURCE,
scoped_ptr<base::Value>(new base::StringValue("xxxxxxxxxxx")).get(),
- schema.get(),
- NULL,
- std::string(),
+ schema.get(), NULL, "",
JSONSchemaValidator::FormatErrorMessage(
JSONSchemaValidator::kStringMaxLength, "10"));
}
@@ -504,19 +469,16 @@ void JSONSchemaValidatorTestBase::TestNumber() {
scoped_ptr<base::Value>(new base::FundamentalValue(88.88)).get(),
schema.get(), NULL);
- ExpectNotValid(TEST_SOURCE,
- scoped_ptr<base::Value>(new base::FundamentalValue(0.5)).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::FormatErrorMessage(
- JSONSchemaValidator::kNumberMinimum, "1"));
+ ExpectNotValid(
+ TEST_SOURCE,
+ scoped_ptr<base::Value>(new base::FundamentalValue(0.5)).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::FormatErrorMessage(
+ JSONSchemaValidator::kNumberMinimum, "1"));
ExpectNotValid(
TEST_SOURCE,
scoped_ptr<base::Value>(new base::FundamentalValue(100.1)).get(),
- schema.get(),
- NULL,
- std::string(),
+ schema.get(), NULL, "",
JSONSchemaValidator::FormatErrorMessage(
JSONSchemaValidator::kNumberMaximum, "100"));
}
@@ -644,83 +606,73 @@ void JSONSchemaValidatorTestBase::TestTypes() {
// not valid
schema->SetString(schema::kType, schema::kObject);
- ExpectNotValid(
- TEST_SOURCE,
- scoped_ptr<base::Value>(new base::ListValue()).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::FormatErrorMessage(
- JSONSchemaValidator::kInvalidType, schema::kObject, schema::kArray));
+ ExpectNotValid(TEST_SOURCE,
+ scoped_ptr<base::Value>(new base::ListValue()).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::FormatErrorMessage(
+ JSONSchemaValidator::kInvalidType,
+ schema::kObject,
+ schema::kArray));
schema->SetString(schema::kType, schema::kObject);
- ExpectNotValid(
- TEST_SOURCE,
- scoped_ptr<base::Value>(base::Value::CreateNullValue()).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::FormatErrorMessage(
- JSONSchemaValidator::kInvalidType, schema::kObject, schema::kNull));
+ ExpectNotValid(TEST_SOURCE,
+ scoped_ptr<base::Value>(base::Value::CreateNullValue()).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::FormatErrorMessage(
+ JSONSchemaValidator::kInvalidType,
+ schema::kObject,
+ schema::kNull));
schema->SetString(schema::kType, schema::kArray);
- ExpectNotValid(
- TEST_SOURCE,
- scoped_ptr<base::Value>(new base::FundamentalValue(42)).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::FormatErrorMessage(
- JSONSchemaValidator::kInvalidType, schema::kArray, schema::kInteger));
+ ExpectNotValid(TEST_SOURCE,
+ scoped_ptr<base::Value>(new base::FundamentalValue(42)).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::FormatErrorMessage(
+ JSONSchemaValidator::kInvalidType,
+ schema::kArray,
+ schema::kInteger));
schema->SetString(schema::kType, schema::kString);
- ExpectNotValid(
- TEST_SOURCE,
- scoped_ptr<base::Value>(new base::FundamentalValue(42)).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::FormatErrorMessage(JSONSchemaValidator::kInvalidType,
- schema::kString,
- schema::kInteger));
+ ExpectNotValid(TEST_SOURCE,
+ scoped_ptr<base::Value>(new base::FundamentalValue(42)).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::FormatErrorMessage(
+ JSONSchemaValidator::kInvalidType,
+ schema::kString,
+ schema::kInteger));
schema->SetString(schema::kType, schema::kNumber);
- ExpectNotValid(
- TEST_SOURCE,
- scoped_ptr<base::Value>(new base::StringValue("42")).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::FormatErrorMessage(
- JSONSchemaValidator::kInvalidType, schema::kNumber, schema::kString));
+ ExpectNotValid(TEST_SOURCE,
+ scoped_ptr<base::Value>(new base::StringValue("42")).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::FormatErrorMessage(
+ JSONSchemaValidator::kInvalidType,
+ schema::kNumber,
+ schema::kString));
schema->SetString(schema::kType, schema::kInteger);
- ExpectNotValid(
- TEST_SOURCE,
- scoped_ptr<base::Value>(new base::FundamentalValue(88.8)).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::kInvalidTypeIntegerNumber);
+ ExpectNotValid(TEST_SOURCE,
+ scoped_ptr<base::Value>(
+ new base::FundamentalValue(88.8)).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::kInvalidTypeIntegerNumber);
schema->SetString(schema::kType, schema::kBoolean);
- ExpectNotValid(
- TEST_SOURCE,
- scoped_ptr<base::Value>(new base::FundamentalValue(1)).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::FormatErrorMessage(JSONSchemaValidator::kInvalidType,
- schema::kBoolean,
- schema::kInteger));
+ ExpectNotValid(TEST_SOURCE,
+ scoped_ptr<base::Value>(new base::FundamentalValue(1)).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::FormatErrorMessage(
+ JSONSchemaValidator::kInvalidType,
+ schema::kBoolean,
+ schema::kInteger));
schema->SetString(schema::kType, schema::kNull);
- ExpectNotValid(
- TEST_SOURCE,
- scoped_ptr<base::Value>(new base::FundamentalValue(false)).get(),
- schema.get(),
- NULL,
- std::string(),
- JSONSchemaValidator::FormatErrorMessage(
- JSONSchemaValidator::kInvalidType, schema::kNull, schema::kBoolean));
+ ExpectNotValid(TEST_SOURCE,
+ scoped_ptr<base::Value>(
+ new base::FundamentalValue(false)).get(),
+ schema.get(), NULL, "",
+ JSONSchemaValidator::FormatErrorMessage(
+ JSONSchemaValidator::kInvalidType,
+ schema::kNull,
+ schema::kBoolean));
}
diff --git a/chrome/common/metrics/entropy_provider_unittest.cc b/chrome/common/metrics/entropy_provider_unittest.cc
index c3547ab..9881d7e 100644
--- a/chrome/common/metrics/entropy_provider_unittest.cc
+++ b/chrome/common/metrics/entropy_provider_unittest.cc
@@ -200,7 +200,7 @@ TEST_F(EntropyProviderTest, UseOneTimeRandomizationSHA1) {
trials[i]->UseOneTimeRandomization();
for (int j = 0; j < 100; ++j)
- trials[i]->AppendGroup(std::string(), 1);
+ trials[i]->AppendGroup("", 1);
}
// The trials are most likely to give different results since they have
@@ -228,7 +228,7 @@ TEST_F(EntropyProviderTest, UseOneTimeRandomizationPermuted) {
trials[i]->UseOneTimeRandomization();
for (int j = 0; j < 100; ++j)
- trials[i]->AppendGroup(std::string(), 1);
+ trials[i]->AppendGroup("", 1);
}
// The trials are most likely to give different results since they have
diff --git a/chrome/common/net/x509_certificate_model.cc b/chrome/common/net/x509_certificate_model.cc
index e1f0847..950b4f2 100644
--- a/chrome/common/net/x509_certificate_model.cc
+++ b/chrome/common/net/x509_certificate_model.cc
@@ -61,7 +61,7 @@ std::string ProcessRawBytesWithSeparators(const unsigned char* data,
size_t kMin = 0U;
if (!data_length)
- return std::string();
+ return "";
ret.reserve(std::max(kMin, data_length * 3 - 1));
diff --git a/chrome/common/net/x509_certificate_model_nss.cc b/chrome/common/net/x509_certificate_model_nss.cc
index 51e2642..5f40ce3 100644
--- a/chrome/common/net/x509_certificate_model_nss.cc
+++ b/chrome/common/net/x509_certificate_model_nss.cc
@@ -100,8 +100,8 @@ using net::X509Certificate;
using std::string;
string GetCertNameOrNickname(X509Certificate::OSCertHandle cert_handle) {
- string name = ProcessIDN(
- Stringize(CERT_GetCommonName(&cert_handle->subject), std::string()));
+ string name = ProcessIDN(Stringize(CERT_GetCommonName(&cert_handle->subject),
+ ""));
if (!name.empty())
return name;
return GetNickname(cert_handle);
@@ -132,7 +132,7 @@ string GetVersion(X509Certificate::OSCertHandle cert_handle) {
SEC_ASN1DecodeInteger(&cert_handle->version, &version) == SECSuccess) {
return base::UintToString(version + 1);
}
- return std::string();
+ return "";
}
net::CertType GetType(X509Certificate::OSCertHandle cert_handle) {
@@ -142,7 +142,7 @@ net::CertType GetType(X509Certificate::OSCertHandle cert_handle) {
string GetEmailAddress(X509Certificate::OSCertHandle cert_handle) {
if (cert_handle->emailAddr)
return cert_handle->emailAddr;
- return std::string();
+ return "";
}
void GetUsageStrings(X509Certificate::OSCertHandle cert_handle,
@@ -346,14 +346,14 @@ string GetCMSString(const X509Certificate::OSCertHandles& cert_chain,
message.get(), cert_chain[start], PR_FALSE));
if (!signed_data.get()) {
DLOG(ERROR) << "NSS_CMSSignedData_Create failed";
- return std::string();
+ return "";
}
// Add the rest of the chain (if any).
for (size_t i = start + 1; i < end; ++i) {
if (NSS_CMSSignedData_AddCertificate(signed_data.get(), cert_chain[i]) !=
SECSuccess) {
DLOG(ERROR) << "NSS_CMSSignedData_AddCertificate failed on " << i;
- return std::string();
+ return "";
}
}
@@ -363,7 +363,7 @@ string GetCMSString(const X509Certificate::OSCertHandles& cert_chain,
ignore_result(signed_data.release());
} else {
DLOG(ERROR) << "NSS_CMSMessage_GetContentInfo failed";
- return std::string();
+ return "";
}
SECItem cert_p7 = { siBuffer, NULL, 0 };
@@ -373,12 +373,12 @@ string GetCMSString(const X509Certificate::OSCertHandles& cert_chain,
NULL);
if (!ecx) {
DLOG(ERROR) << "NSS_CMSEncoder_Start failed";
- return std::string();
+ return "";
}
if (NSS_CMSEncoder_Finish(ecx) != SECSuccess) {
DLOG(ERROR) << "NSS_CMSEncoder_Finish failed";
- return std::string();
+ return "";
}
return string(reinterpret_cast<const char*>(cert_p7.data), cert_p7.len);
diff --git a/chrome/common/pref_names_util_unittest.cc b/chrome/common/pref_names_util_unittest.cc
index 9f215ea..2d1356a 100644
--- a/chrome/common/pref_names_util_unittest.cc
+++ b/chrome/common/pref_names_util_unittest.cc
@@ -28,7 +28,7 @@ void ExpectParse(const std::string& path,
} // namespace
TEST(PrefNamesUtilTest, Basic) {
- ExpectNoParse(std::string());
+ ExpectNoParse("");
ExpectNoParse(".");
ExpectNoParse(".....");
ExpectNoParse("webkit.webprefs.fonts.");
@@ -43,8 +43,8 @@ TEST(PrefNamesUtilTest, Basic) {
// We don't particularly care about the parsed family and script for these
// inputs, but just want to make sure it does something reasonable. Returning
// false may also be an option.
- ExpectParse("webkit.webprefs.fonts...", std::string(), ".");
- ExpectParse("webkit.webprefs.fonts....", std::string(), "..");
+ ExpectParse("webkit.webprefs.fonts...", "", ".");
+ ExpectParse("webkit.webprefs.fonts....", "", "..");
// Check that passing NULL output params is okay.
EXPECT_TRUE(pref_names_util::ParseFontNamePrefPath(
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
index 567c305..4a619f5 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -251,7 +251,7 @@ TEST_F(PasswordAutofillAgentTest, NoInitialAutocompleteForReadOnly) {
// Only the username should have been autocompleted.
// TODO(jcivelli): may be we should not event fill the username?
- CheckTextFieldsState(kAliceUsername, true, std::string(), false);
+ CheckTextFieldsState(kAliceUsername, true, "", false);
}
// Tests that having a non-matching username precludes the autocomplete.
@@ -263,7 +263,7 @@ TEST_F(PasswordAutofillAgentTest, NoInitialAutocompleteForFilledField) {
SimulateOnFillPasswordForm(fill_data_);
// Neither field should be autocompleted.
- CheckTextFieldsState("bogus", false, std::string(), false);
+ CheckTextFieldsState("bogus", false, "", false);
}
// Tests that having a matching username does not preclude the autocomplete.
@@ -288,7 +288,7 @@ TEST_F(PasswordAutofillAgentTest, PasswordClearOnEdit) {
SimulateUsernameChange("alicia", true);
// The password should have been cleared.
- CheckTextFieldsState("alicia", false, std::string(), false);
+ CheckTextFieldsState("alicia", false, "", false);
}
// Tests that we only autocomplete on focus lost and with a full username match
@@ -299,27 +299,27 @@ TEST_F(PasswordAutofillAgentTest, WaitUsername) {
SimulateOnFillPasswordForm(fill_data_);
// No auto-fill should have taken place.
- CheckTextFieldsState(std::string(), false, std::string(), false);
+ CheckTextFieldsState("", false, "", false);
// No autocomplete should happen when text is entered in the username.
SimulateUsernameChange("a", true);
- CheckTextFieldsState("a", false, std::string(), false);
+ CheckTextFieldsState("a", false, "", false);
SimulateUsernameChange("al", true);
- CheckTextFieldsState("al", false, std::string(), false);
+ CheckTextFieldsState("al", false, "", false);
SimulateUsernameChange(kAliceUsername, true);
- CheckTextFieldsState(kAliceUsername, false, std::string(), false);
+ CheckTextFieldsState(kAliceUsername, false, "", false);
// Autocomplete should happen only when the username textfield is blurred with
// a full match.
username_element_.setValue("a");
autofill_agent_->textFieldDidEndEditing(username_element_);
- CheckTextFieldsState("a", false, std::string(), false);
+ CheckTextFieldsState("a", false, "", false);
username_element_.setValue("al");
autofill_agent_->textFieldDidEndEditing(username_element_);
- CheckTextFieldsState("al", false, std::string(), false);
+ CheckTextFieldsState("al", false, "", false);
username_element_.setValue("alices");
autofill_agent_->textFieldDidEndEditing(username_element_);
- CheckTextFieldsState("alices", false, std::string(), false);
+ CheckTextFieldsState("alices", false, "", false);
username_element_.setValue(ASCIIToUTF16(kAliceUsername));
autofill_agent_->textFieldDidEndEditing(username_element_);
CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true);
@@ -351,7 +351,7 @@ TEST_F(PasswordAutofillAgentTest, InlineAutocomplete) {
// Test that deleting does not trigger autocomplete.
SimulateKeyDownEvent(username_element_, ui::VKEY_BACK);
SimulateUsernameChange("alic", true);
- CheckTextFieldsState("alic", false, std::string(), false);
+ CheckTextFieldsState("alic", false, "", false);
CheckUsernameSelection(4, 4); // No selection.
// Reset the last pressed key to something other than backspace.
SimulateKeyDownEvent(username_element_, ui::VKEY_A);
@@ -361,7 +361,7 @@ TEST_F(PasswordAutofillAgentTest, InlineAutocomplete) {
// practice the username should no longer be 'alice' and the selected range
// should be empty.
SimulateUsernameChange("alf", true);
- CheckTextFieldsState("alf", false, std::string(), false);
+ CheckTextFieldsState("alf", false, "", false);
CheckUsernameSelection(3, 3); // No selection.
// Ok, so now the user removes all the text and enters the letter 'b'.
@@ -379,7 +379,7 @@ TEST_F(PasswordAutofillAgentTest, InlineAutocomplete) {
// want case-sensitive autocompletion, so the username and the selected range
// should be empty.
SimulateUsernameChange("c", true);
- CheckTextFieldsState("c", false, std::string(), false);
+ CheckTextFieldsState("c", false, "", false);
CheckUsernameSelection(1, 1);
}
@@ -419,7 +419,7 @@ TEST_F(PasswordAutofillAgentTest, SuggestionSelect) {
WebKit::WebString(),
0);
// Autocomplete should not have kicked in.
- CheckTextFieldsState(std::string(), false, std::string(), false);
+ CheckTextFieldsState("", false, "", false);
}
} // namespace autofill
diff --git a/chrome/renderer/automation/automation_renderer_helper_browsertest.cc b/chrome/renderer/automation/automation_renderer_helper_browsertest.cc
index 65bd018..659d312 100644
--- a/chrome/renderer/automation/automation_renderer_helper_browsertest.cc
+++ b/chrome/renderer/automation/automation_renderer_helper_browsertest.cc
@@ -84,9 +84,9 @@ TEST_F(AutomationRendererHelperTest, RTLSnapshot) {
}
TEST_F(AutomationRendererHelperTest, ScriptChain) {
- ScriptEvaluationRequest request("({'result': 10})", std::string());
- ScriptEvaluationRequest request_plus1("({'result': arguments[0].result + 1})",
- std::string());
+ ScriptEvaluationRequest request("({'result': 10})", "");
+ ScriptEvaluationRequest request_plus1(
+ "({'result': arguments[0].result + 1})", "");
std::vector<ScriptEvaluationRequest> script_chain;
script_chain.push_back(request);
script_chain.push_back(request_plus1);
@@ -102,10 +102,10 @@ TEST_F(AutomationRendererHelperTest, ScriptChain) {
}
TEST_F(AutomationRendererHelperTest, ScriptChainError) {
- ScriptEvaluationRequest request("({'result': 10})", std::string());
+ ScriptEvaluationRequest request("({'result': 10})", "");
ScriptEvaluationRequest error_request(
"({'result': arguments[0].result + 1, 'error': {'msg': 'some msg'}})",
- std::string());
+ "");
std::vector<ScriptEvaluationRequest> script_chain;
script_chain.push_back(request);
script_chain.push_back(error_request);
diff --git a/chrome/renderer/chrome_content_renderer_client_unittest.cc b/chrome/renderer/chrome_content_renderer_client_unittest.cc
index 1387ff0..b099eea 100644
--- a/chrome/renderer/chrome_content_renderer_client_unittest.cc
+++ b/chrome/renderer/chrome_content_renderer_client_unittest.cc
@@ -96,8 +96,8 @@ scoped_refptr<const extensions::Extension> CreateTestExtension(
scoped_refptr<const extensions::Extension> CreateExtension(
bool is_unrestricted, bool is_from_webstore) {
- return CreateTestExtension(
- is_unrestricted, is_from_webstore, kNotHostedApp, std::string());
+ return CreateTestExtension(is_unrestricted, is_from_webstore, kNotHostedApp,
+ "");
}
scoped_refptr<const extensions::Extension> CreateHostedApp(
diff --git a/chrome/renderer/content_settings_observer_browsertest.cc b/chrome/renderer/content_settings_observer_browsertest.cc
index 8397c94..f4777d2 100644
--- a/chrome/renderer/content_settings_observer_browsertest.cc
+++ b/chrome/renderer/content_settings_observer_browsertest.cc
@@ -110,11 +110,12 @@ TEST_F(ChromeRenderViewTest, JSBlockSentAfterPageLoad) {
ContentSettingsForOneType& script_setting_rules =
content_setting_rules.script_rules;
script_setting_rules.push_back(
- ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTING_BLOCK,
- std::string(),
- false));
+ ContentSettingPatternSource(
+ ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_BLOCK,
+ "",
+ false));
ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_);
observer->SetContentSettingRules(&content_setting_rules);
@@ -192,7 +193,7 @@ TEST_F(ChromeRenderViewTest, ImagesBlockedByDefault) {
ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
CONTENT_SETTING_BLOCK,
- std::string(),
+ "",
false));
ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_);
@@ -210,7 +211,7 @@ TEST_F(ChromeRenderViewTest, ImagesBlockedByDefault) {
ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::FromString(mock_observer.image_origin_),
CONTENT_SETTING_ALLOW,
- std::string(),
+ "",
false));
EXPECT_CALL(
@@ -235,7 +236,7 @@ TEST_F(ChromeRenderViewTest, ImagesAllowedByDefault) {
ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
CONTENT_SETTING_ALLOW,
- std::string(),
+ "",
false));
ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_);
@@ -254,7 +255,7 @@ TEST_F(ChromeRenderViewTest, ImagesAllowedByDefault) {
ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::FromString(mock_observer.image_origin_),
CONTENT_SETTING_BLOCK,
- std::string(),
+ "",
false));
EXPECT_CALL(mock_observer,
OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
@@ -269,11 +270,12 @@ TEST_F(ChromeRenderViewTest, ContentSettingsBlockScripts) {
ContentSettingsForOneType& script_setting_rules =
content_setting_rules.script_rules;
script_setting_rules.push_back(
- ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTING_BLOCK,
- std::string(),
- false));
+ ContentSettingPatternSource(
+ ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_BLOCK,
+ "",
+ false));
ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_);
observer->SetContentSettingRules(&content_setting_rules);
@@ -304,11 +306,12 @@ TEST_F(ChromeRenderViewTest, ContentSettingsAllowScripts) {
ContentSettingsForOneType& script_setting_rules =
content_setting_rules.script_rules;
script_setting_rules.push_back(
- ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTING_ALLOW,
- std::string(),
- false));
+ ContentSettingPatternSource(
+ ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_ALLOW,
+ "",
+ false));
ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_);
observer->SetContentSettingRules(&content_setting_rules);
@@ -340,20 +343,18 @@ TEST_F(ChromeRenderViewTest, ContentSettingsInterstitialPages) {
ContentSettingsForOneType& script_setting_rules =
content_setting_rules.script_rules;
script_setting_rules.push_back(
- ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTING_BLOCK,
- std::string(),
- false));
+ ContentSettingPatternSource(
+ ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_BLOCK, "", false));
// Block images.
ContentSettingsForOneType& image_setting_rules =
content_setting_rules.image_rules;
image_setting_rules.push_back(
- ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTING_BLOCK,
- std::string(),
- false));
+ ContentSettingPatternSource(
+ ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_BLOCK, "", false));
ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_);
observer->SetContentSettingRules(&content_setting_rules);
diff --git a/chrome/renderer/extensions/chrome_v8_context.cc b/chrome/renderer/extensions/chrome_v8_context.cc
index 5feff00..b4ae80e 100644
--- a/chrome/renderer/extensions/chrome_v8_context.cc
+++ b/chrome/renderer/extensions/chrome_v8_context.cc
@@ -63,7 +63,7 @@ void ChromeV8Context::Invalidate() {
}
std::string ChromeV8Context::GetExtensionID() {
- return extension_ ? extension_->id() : std::string();
+ return extension_ ? extension_->id() : "";
}
// static
@@ -187,7 +187,7 @@ std::string ChromeV8Context::GetContextTypeDescription() {
case Feature::WEB_PAGE_CONTEXT: return "WEB_PAGE";
}
NOTREACHED();
- return std::string();
+ return "";
}
ChromeV8Context* ChromeV8Context::GetContext() {
diff --git a/chrome/renderer/extensions/extension_helper.cc b/chrome/renderer/extensions/extension_helper.cc
index ac456a8..a488cb7 100644
--- a/chrome/renderer/extensions/extension_helper.cc
+++ b/chrome/renderer/extensions/extension_helper.cc
@@ -313,12 +313,8 @@ void ExtensionHelper::OnExecuteCode(
WebFrame* main_frame = webview->mainFrame();
if (!main_frame) {
ListValue val;
- Send(new ExtensionHostMsg_ExecuteCodeFinished(routing_id(),
- params.request_id,
- "No main frame",
- -1,
- GURL(std::string()),
- val));
+ Send(new ExtensionHostMsg_ExecuteCodeFinished(
+ routing_id(), params.request_id, "No main frame", -1, GURL(""), val));
return;
}
diff --git a/chrome/renderer/extensions/resource_request_policy.cc b/chrome/renderer/extensions/resource_request_policy.cc
index 83ccb3f..116b218 100644
--- a/chrome/renderer/extensions/resource_request_policy.cc
+++ b/chrome/renderer/extensions/resource_request_policy.cc
@@ -51,8 +51,7 @@ bool ResourceRequestPolicy::CanRequestResource(
// some extensions want to be able to do things like create their own
// launchers.
std::string resource_root_relative_path =
- resource_url.path().empty() ? std::string()
- : resource_url.path().substr(1);
+ resource_url.path().empty() ? "" : resource_url.path().substr(1);
if (extension->is_hosted_app() &&
!IconsInfo::GetIcons(extension)
.ContainsPath(resource_root_relative_path)) {
diff --git a/chrome/renderer/extensions/user_script_scheduler.cc b/chrome/renderer/extensions/user_script_scheduler.cc
index f194a23..3cb01ba 100644
--- a/chrome/renderer/extensions/user_script_scheduler.cc
+++ b/chrome/renderer/extensions/user_script_scheduler.cc
@@ -147,13 +147,13 @@ void UserScriptScheduler::ExecuteCodeImpl(
// Since extension info is sent separately from user script info, they can
// be out of sync. We just ignore this situation.
if (!extension) {
- render_view->Send(
- new ExtensionHostMsg_ExecuteCodeFinished(render_view->GetRoutingID(),
- params.request_id,
- std::string(), // no error
- -1,
- GURL(std::string()),
- execution_results));
+ render_view->Send(new ExtensionHostMsg_ExecuteCodeFinished(
+ render_view->GetRoutingID(),
+ params.request_id,
+ "", // no error
+ -1,
+ GURL(""),
+ execution_results));
return;
}
diff --git a/chrome/renderer/extensions/user_script_slave.cc b/chrome/renderer/extensions/user_script_slave.cc
index 3e64b7d..f715207 100644
--- a/chrome/renderer/extensions/user_script_slave.cc
+++ b/chrome/renderer/extensions/user_script_slave.cc
@@ -92,7 +92,7 @@ std::string UserScriptSlave::GetExtensionIdForIsolatedWorld(
if (iter->second == isolated_world_id)
return iter->first;
}
- return std::string();
+ return "";
}
// static
diff --git a/chrome/renderer/plugins/plugin_uma_unittest.cc b/chrome/renderer/plugins/plugin_uma_unittest.cc
index 3b1950c..99e6271 100644
--- a/chrome/renderer/plugins/plugin_uma_unittest.cc
+++ b/chrome/renderer/plugins/plugin_uma_unittest.cc
@@ -118,8 +118,9 @@ TEST_F(PluginUMATest, WidevineCdm) {
}
TEST_F(PluginUMATest, BySrcExtension) {
- ExpectPluginType(
- PluginUMAReporter::QUICKTIME, std::string(), GURL("file://file.mov"));
+ ExpectPluginType(PluginUMAReporter::QUICKTIME,
+ "",
+ GURL("file://file.mov"));
// When plugin's mime type is given, we don't check extension.
ExpectPluginType(PluginUMAReporter::UNSUPPORTED_MIMETYPE,
@@ -127,36 +128,40 @@ TEST_F(PluginUMATest, BySrcExtension) {
GURL("http://file.mov"));
ExpectPluginType(PluginUMAReporter::WINDOWS_MEDIA_PLAYER,
- std::string(),
+ "",
GURL("file://file.asx"));
- ExpectPluginType(
- PluginUMAReporter::REALPLAYER, std::string(), GURL("file://file.rm"));
+ ExpectPluginType(PluginUMAReporter::REALPLAYER,
+ "",
+ GURL("file://file.rm"));
ExpectPluginType(PluginUMAReporter::QUICKTIME,
- std::string(),
+ "",
GURL("http://aaa/file.mov?x=aaaa&y=b#c"));
ExpectPluginType(PluginUMAReporter::QUICKTIME,
- std::string(),
+ "",
GURL("http://file.mov?x=aaaa&y=b#c"));
ExpectPluginType(PluginUMAReporter::SHOCKWAVE_FLASH,
- std::string(),
+ "",
GURL("http://file.swf?x=aaaa&y=b#c"));
ExpectPluginType(PluginUMAReporter::SHOCKWAVE_FLASH,
- std::string(),
+ "",
GURL("http://file.spl?x=aaaa&y=b#c"));
ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION,
- std::string(),
+ "",
GURL("http://file.unknown_extension"));
- ExpectPluginType(
- PluginUMAReporter::UNSUPPORTED_EXTENSION, std::string(), GURL("http://"));
- ExpectPluginType(
- PluginUMAReporter::UNSUPPORTED_EXTENSION, std::string(), GURL("mov"));
+ ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION,
+ "",
+ GURL("http://"));
+ ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION,
+ "",
+ GURL("mov"));
}
TEST_F(PluginUMATest, CaseSensitivity) {
ExpectPluginType(PluginUMAReporter::QUICKTIME,
"video/QUICKTIME",
GURL("http://file.aaa"));
- ExpectPluginType(
- PluginUMAReporter::QUICKTIME, std::string(), GURL("http://file.MoV"));
+ ExpectPluginType(PluginUMAReporter::QUICKTIME,
+ "",
+ GURL("http://file.MoV"));
}
diff --git a/chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc b/chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc
index 8a120cb..034655f 100644
--- a/chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc
+++ b/chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc
@@ -97,7 +97,7 @@ TEST_F(MalwareDOMDetailsTest, Everything) {
}
{ // >50 subframes, to verify kMaxNodes.
- std::string html;
+ std::string html = "";
for (int i = 0; i < 55; ++i) {
// The iframe contents is just a number.
GURL iframe_url(base::StringPrintf("%s%d", urlprefix, i));
@@ -113,7 +113,7 @@ TEST_F(MalwareDOMDetailsTest, Everything) {
}
{ // A page with >50 scripts, to verify kMaxNodes.
- std::string html;
+ std::string html = "";
for (int i = 0; i < 55; ++i) {
// The iframe contents is just a number.
GURL script_url(base::StringPrintf("%s%d", urlprefix, i));
diff --git a/chrome/service/cloud_print/cloud_print_proxy.cc b/chrome/service/cloud_print/cloud_print_proxy.cc
index 12eee70..a65da81 100644
--- a/chrome/service/cloud_print/cloud_print_proxy.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy.cc
@@ -85,10 +85,10 @@ void CloudPrintProxy::EnableForUser(const std::string& lsid) {
DCHECK(backend_.get());
// Read persisted robot credentials because we may decide to reuse it if the
// passed in LSID belongs the same user.
- std::string robot_refresh_token = service_prefs_->GetString(
- prefs::kCloudPrintRobotRefreshToken, std::string());
+ std::string robot_refresh_token =
+ service_prefs_->GetString(prefs::kCloudPrintRobotRefreshToken, "");
std::string robot_email =
- service_prefs_->GetString(prefs::kCloudPrintRobotEmail, std::string());
+ service_prefs_->GetString(prefs::kCloudPrintRobotEmail, "");
user_email_ = service_prefs_->GetString(prefs::kCloudPrintEmail, user_email_);
// If we have been passed in an LSID, we want to use this to authenticate.
@@ -104,7 +104,7 @@ void CloudPrintProxy::EnableForUser(const std::string& lsid) {
} else {
// Finally see if we have persisted user credentials (legacy case).
std::string cloud_print_token =
- service_prefs_->GetString(prefs::kCloudPrintAuthToken, std::string());
+ service_prefs_->GetString(prefs::kCloudPrintAuthToken, "");
DCHECK(!cloud_print_token.empty());
backend_->InitializeWithToken(cloud_print_token);
}
@@ -124,7 +124,7 @@ void CloudPrintProxy::EnableForUserWithRobot(
ShutdownBackend();
std::string proxy_id(
- service_prefs_->GetString(prefs::kCloudPrintProxyId, std::string()));
+ service_prefs_->GetString(prefs::kCloudPrintProxyId, ""));
service_prefs_->RemovePref(prefs::kCloudPrintRoot);
if (!proxy_id.empty()) {
// Keep only proxy id;
@@ -204,8 +204,7 @@ void CloudPrintProxy::GetProxyInfo(CloudPrintProxyInfo* info) {
// If the Cloud Print service is not enabled, we may need to read the old
// value of proxy_id from prefs.
if (info->proxy_id.empty())
- info->proxy_id =
- service_prefs_->GetString(prefs::kCloudPrintProxyId, std::string());
+ info->proxy_id = service_prefs_->GetString(prefs::kCloudPrintProxyId, "");
}
void CloudPrintProxy::CheckCloudPrintProxyPolicy() {
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
index a86d24c..343eaa8 100644
--- a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
+++ b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
@@ -217,9 +217,9 @@ void CloudPrintURLFetcherTest::CreateFetcher(const GURL& url, int max_retries) {
// Registers an entry for test url. It only allows 3 requests to be sent
// in 200 milliseconds.
- scoped_refptr<net::URLRequestThrottlerEntry>
- entry(new net::URLRequestThrottlerEntry(
- fetcher_->throttler_manager(), std::string(), 200, 3, 1, 2.0, 0.0, 256));
+ scoped_refptr<net::URLRequestThrottlerEntry> entry(
+ new net::URLRequestThrottlerEntry(
+ fetcher_->throttler_manager(), "", 200, 3, 1, 2.0, 0.0, 256));
fetcher_->throttler_manager()->OverrideEntryForTests(url, entry);
max_retries_ = max_retries;
diff --git a/chrome/service/cloud_print/connector_settings.cc b/chrome/service/cloud_print/connector_settings.cc
index 1e9b761..2b43b15 100644
--- a/chrome/service/cloud_print/connector_settings.cc
+++ b/chrome/service/cloud_print/connector_settings.cc
@@ -32,7 +32,7 @@ ConnectorSettings::~ConnectorSettings() {
void ConnectorSettings::InitFrom(ServiceProcessPrefs* prefs) {
CopyFrom(ConnectorSettings());
- proxy_id_ = prefs->GetString(prefs::kCloudPrintProxyId, std::string());
+ proxy_id_ = prefs->GetString(prefs::kCloudPrintProxyId, "");
if (proxy_id_.empty()) {
proxy_id_ = PrintSystem::GenerateProxyId();
prefs->SetString(prefs::kCloudPrintProxyId, proxy_id_);
@@ -51,8 +51,7 @@ void ConnectorSettings::InitFrom(ServiceProcessPrefs* prefs) {
}
// Check if there is an override for the cloud print server URL.
- server_url_ =
- GURL(prefs->GetString(prefs::kCloudPrintServiceURL, std::string()));
+ server_url_ = GURL(prefs->GetString(prefs::kCloudPrintServiceURL, ""));
DCHECK(server_url_.is_empty() || server_url_.is_valid());
if (server_url_.is_empty() || !server_url_.is_valid()) {
server_url_ = GURL(kDefaultCloudPrintServerUrl);
diff --git a/chrome/service/cloud_print/printer_job_handler_unittest.cc b/chrome/service/cloud_print/printer_job_handler_unittest.cc
index 0576bb0..9e19519 100644
--- a/chrome/service/cloud_print/printer_job_handler_unittest.cc
+++ b/chrome/service/cloud_print/printer_job_handler_unittest.cc
@@ -194,7 +194,7 @@ const char kExamplePrinterDescription[] = "Example Description";
// These are functions used to construct the various sample strings.
std::string JobListResponse(int num_jobs) {
- std::string job_objects;
+ std::string job_objects = "";
for (int i = 0; i < num_jobs; i++) {
job_objects = job_objects + StringPrintf(kExampleJobObject, i+1, i+1, i+1,
i+1);
@@ -683,7 +683,7 @@ TEST_F(PrinterJobHandlerTest, TicketDownloadFailureTest) {
JobListResponse(2), true);
factory_.SetFakeResponse(JobListURI(kJobFetchReasonQueryMore),
JobListResponse(0), true);
- factory_.SetFakeResponse(TicketURI(1), std::string(), false);
+ factory_.SetFakeResponse(TicketURI(1), "", false);
EXPECT_CALL(url_callback_, OnRequestCreate(GURL(TicketURI(1)), _))
.Times(AtLeast(1));
@@ -734,7 +734,7 @@ TEST_F(PrinterJobHandlerTest, DISABLED_ManyFailureTest) {
SetUpJobSuccessTest(1);
- factory_.SetFakeResponse(TicketURI(1), std::string(), false);
+ factory_.SetFakeResponse(TicketURI(1), "", false);
loop_.PostDelayedTask(FROM_HERE,
base::Bind(&net::FakeURLFetcherFactory::SetFakeResponse,
@@ -759,7 +759,7 @@ TEST_F(PrinterJobHandlerTest, DISABLED_CompleteFailureTest) {
factory_.SetFakeResponse(JobListURI(kJobFetchReasonRetry),
JobListResponse(1), true);
factory_.SetFakeResponse(ErrorURI(1), StatusResponse(1, "ERROR"), true);
- factory_.SetFakeResponse(TicketURI(1), std::string(), false);
+ factory_.SetFakeResponse(TicketURI(1), "", false);
EXPECT_CALL(url_callback_,
OnRequestCreate(GURL(JobListURI(kJobFetchReasonStartup)), _))
diff --git a/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc b/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc
index b29f5a4..05532b9 100644
--- a/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc
+++ b/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc
@@ -81,7 +81,7 @@ TEST_F(PrinterJobQueueHandlerTest, BasicJobReadTest) {
std::set<std::string> expected_tags;
expected_tags.insert("^own");
- expected_tags.insert(std::string());
+ expected_tags.insert("");
std::set<std::string> actual_tags;
actual_tags.insert(jobs[0].tags_.begin(), jobs[0].tags_.end());
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc
index 32d5cc2..2cae376 100644
--- a/chrome/service/service_process.cc
+++ b/chrome/service/service_process.cc
@@ -175,8 +175,7 @@ bool ServiceProcess::Initialize(MessageLoopForUI* message_loop,
} else {
// If no command-line value was specified, read the last used locale from
// the prefs.
- locale =
- service_prefs_->GetString(prefs::kApplicationLocale, std::string());
+ locale = service_prefs_->GetString(prefs::kApplicationLocale, "");
// If no locale was specified anywhere, use the default one.
if (locale.empty())
locale = kDefaultServiceProcessLocale;
diff --git a/chrome/service/service_process_prefs_unittest.cc b/chrome/service/service_process_prefs_unittest.cc
index 3d7ae1f..5d68ab3 100644
--- a/chrome/service/service_process_prefs_unittest.cc
+++ b/chrome/service/service_process_prefs_unittest.cc
@@ -39,8 +39,9 @@ TEST_F(ServiceProcessPrefsTest, RetrievePrefs) {
prefs_->WritePrefs();
message_loop_.RunUntilIdle();
prefs_->SetBoolean("testb", false); // overwrite
- prefs_->SetString("tests", std::string()); // overwrite
+ prefs_->SetString("tests", ""); // overwrite
prefs_->ReadPrefs();
EXPECT_EQ(prefs_->GetBoolean("testb", false), true);
- EXPECT_EQ(prefs_->GetString("tests", std::string()), "testvalue");
+ EXPECT_EQ(prefs_->GetString("tests", ""), "testvalue");
}
+
diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc
index fbf366d..f3b91f6 100644
--- a/chrome/test/base/ui_test_utils.cc
+++ b/chrome/test/base/ui_test_utils.cc
@@ -187,7 +187,7 @@ bool GetCurrentTabTitle(const Browser* browser, string16* title) {
NavigationEntry* last_entry = web_contents->GetController().GetActiveEntry();
if (!last_entry)
return false;
- title->assign(last_entry->GetTitleForDisplay(std::string()));
+ title->assign(last_entry->GetTitleForDisplay(""));
return true;
}
diff --git a/chrome/test/chromedriver/capabilities_unittest.cc b/chrome/test/chromedriver/capabilities_unittest.cc
index 9bf6c32..f6ac5ec 100644
--- a/chrome/test/chromedriver/capabilities_unittest.cc
+++ b/chrome/test/chromedriver/capabilities_unittest.cc
@@ -21,7 +21,7 @@ TEST(ParseCapabilities, WithAndroidPackage) {
TEST(ParseCapabilities, EmptyAndroidPackage) {
Capabilities capabilities;
base::DictionaryValue caps;
- caps.SetString("chromeOptions.android_package", std::string());
+ caps.SetString("chromeOptions.android_package", "");
Status status = capabilities.Parse(caps);
ASSERT_FALSE(status.IsOk());
}
diff --git a/chrome/test/chromedriver/chrome/automation_extension.cc b/chrome/test/chromedriver/chrome/automation_extension.cc
index 63ad223..0a91cf5 100644
--- a/chrome/test/chromedriver/chrome/automation_extension.cc
+++ b/chrome/test/chromedriver/chrome/automation_extension.cc
@@ -52,11 +52,8 @@ Status AutomationExtension::GetWindowInfo(int* x,
int* height) {
base::ListValue args;
scoped_ptr<base::Value> result;
- Status status = web_view_->CallAsyncFunction(std::string(),
- "getWindowInfo",
- args,
- base::TimeDelta::FromSeconds(10),
- &result);
+ Status status = web_view_->CallAsyncFunction(
+ "", "getWindowInfo", args, base::TimeDelta::FromSeconds(10), &result);
if (status.IsError())
return status;
@@ -81,9 +78,6 @@ Status AutomationExtension::UpdateWindow(
base::ListValue args;
args.Append(update_info.DeepCopy());
scoped_ptr<base::Value> result;
- return web_view_->CallAsyncFunction(std::string(),
- "updateWindow",
- args,
- base::TimeDelta::FromSeconds(10),
- &result);
+ return web_view_->CallAsyncFunction(
+ "", "updateWindow", args, base::TimeDelta::FromSeconds(10), &result);
}
diff --git a/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc b/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc
index 49dfad2..bee5bd2 100644
--- a/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc
+++ b/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc
@@ -67,7 +67,7 @@ Status ChromeDesktopImpl::GetAutomationExtension(
return status;
// Wait for the extension background page to load.
- status = web_view->WaitForPendingNavigations(std::string());
+ status = web_view->WaitForPendingNavigations("");
if (status.IsError())
return status;
diff --git a/chrome/test/chromedriver/chrome/devtools_http_client.cc b/chrome/test/chromedriver/chrome/devtools_http_client.cc
index 3cfcdae..c0fc841 100644
--- a/chrome/test/chromedriver/chrome/devtools_http_client.cc
+++ b/chrome/test/chromedriver/chrome/devtools_http_client.cc
@@ -169,8 +169,7 @@ Status DevToolsHttpClient::CloseFrontends(const std::string& for_client_id) {
scoped_ptr<base::Value> result;
status = web_view->EvaluateScript(
- std::string(),
- "document.querySelector('*[id^=\"close-button-\"').click();",
+ "", "document.querySelector('*[id^=\"close-button-\"').click();",
&result);
// Ignore disconnected error, because it may be closed already.
if (status.IsError() && status.code() != kDisconnected)
diff --git a/chrome/test/chromedriver/chrome/devtools_http_client_unittest.cc b/chrome/test/chromedriver/chrome/devtools_http_client_unittest.cc
index c92abb8..eff9b3f 100644
--- a/chrome/test/chromedriver/chrome/devtools_http_client_unittest.cc
+++ b/chrome/test/chromedriver/chrome/devtools_http_client_unittest.cc
@@ -64,7 +64,8 @@ TEST(ParseWebViewsInfo, WithoutDebuggerUrl) {
ASSERT_TRUE(status.IsOk());
ASSERT_EQ(1u, views_info.GetSize());
ExpectEqual(
- WebViewInfo("1", std::string(), "http://page1", WebViewInfo::kPage),
+ WebViewInfo(
+ "1", "", "http://page1", WebViewInfo::kPage),
views_info.Get(0));
}
diff --git a/chrome/test/chromedriver/chrome/javascript_dialog_manager_unittest.cc b/chrome/test/chromedriver/chrome/javascript_dialog_manager_unittest.cc
index 1333090..fcc3dce 100644
--- a/chrome/test/chromedriver/chrome/javascript_dialog_manager_unittest.cc
+++ b/chrome/test/chromedriver/chrome/javascript_dialog_manager_unittest.cc
@@ -19,7 +19,7 @@ TEST(JavaScriptDialogManager, NoDialog) {
ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code());
ASSERT_FALSE(manager.IsDialogOpen());
ASSERT_STREQ("HI", message.c_str());
- ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code());
+ ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code());
}
namespace {
@@ -73,7 +73,7 @@ TEST(JavaScriptDialogManager, ReconnectClearsStateAndSendsEnable) {
ASSERT_EQ("Page.enable", client.method_);
ASSERT_FALSE(manager.IsDialogOpen());
ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code());
- ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code());
+ ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code());
}
namespace {
@@ -125,10 +125,10 @@ TEST(JavaScriptDialogManager, OneDialog) {
ASSERT_EQ("hi", message);
client.set_closing_count(1);
- ASSERT_EQ(kOk, manager.HandleDialog(false, std::string()).code());
+ ASSERT_EQ(kOk, manager.HandleDialog(false, "").code());
ASSERT_FALSE(manager.IsDialogOpen());
ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code());
- ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code());
+ ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code());
}
TEST(JavaScriptDialogManager, TwoDialogs) {
@@ -145,16 +145,16 @@ TEST(JavaScriptDialogManager, TwoDialogs) {
ASSERT_TRUE(manager.IsDialogOpen());
ASSERT_EQ("1", message);
- ASSERT_EQ(kOk, manager.HandleDialog(false, std::string()).code());
+ ASSERT_EQ(kOk, manager.HandleDialog(false, "").code());
ASSERT_TRUE(manager.IsDialogOpen());
ASSERT_EQ(kOk, manager.GetDialogMessage(&message).code());
ASSERT_EQ("2", message);
client.set_closing_count(2);
- ASSERT_EQ(kOk, manager.HandleDialog(false, std::string()).code());
+ ASSERT_EQ(kOk, manager.HandleDialog(false, "").code());
ASSERT_FALSE(manager.IsDialogOpen());
ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code());
- ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code());
+ ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code());
}
TEST(JavaScriptDialogManager, OneDialogManualClose) {
@@ -174,5 +174,5 @@ TEST(JavaScriptDialogManager, OneDialogManualClose) {
manager.OnEvent("Page.javascriptDialogClosing", params);
ASSERT_FALSE(manager.IsDialogOpen());
ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code());
- ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code());
+ ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code());
}
diff --git a/chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc b/chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc
index 19a78ef3..79cc0f6 100644
--- a/chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc
+++ b/chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc
@@ -173,7 +173,7 @@ class DeterminingLoadStateDevToolsClient : public StubDevToolsClient {
TEST(NavigationTracker, UnknownStateForcesStart) {
base::DictionaryValue params;
- DeterminingLoadStateDevToolsClient client(true, std::string(), &params);
+ DeterminingLoadStateDevToolsClient client(true, "", &params);
NavigationTracker tracker(&client);
ASSERT_NO_FATAL_FAILURE(AssertPendingState(&tracker, "f", true));
}
diff --git a/chrome/test/chromedriver/chrome/stub_chrome.cc b/chrome/test/chromedriver/chrome/stub_chrome.cc
index d990d4e..39888a8 100644
--- a/chrome/test/chromedriver/chrome/stub_chrome.cc
+++ b/chrome/test/chromedriver/chrome/stub_chrome.cc
@@ -11,7 +11,7 @@ StubChrome::StubChrome() {}
StubChrome::~StubChrome() {}
std::string StubChrome::GetVersion() {
- return std::string();
+ return "";
}
int StubChrome::GetBuildNo() {
@@ -49,7 +49,7 @@ Status StubChrome::GetAutomationExtension(AutomationExtension** extension) {
}
std::string StubChrome::GetOperatingSystemName() {
- return std::string();
+ return "";
}
Status StubChrome::Quit() {
diff --git a/chrome/test/chromedriver/chrome/web_view_impl_unittest.cc b/chrome/test/chromedriver/chrome/web_view_impl_unittest.cc
index ecdc85b..37e3284 100644
--- a/chrome/test/chromedriver/chrome/web_view_impl_unittest.cc
+++ b/chrome/test/chromedriver/chrome/web_view_impl_unittest.cc
@@ -60,8 +60,8 @@ void AssertEvalFails(const base::DictionaryValue& command_result) {
scoped_ptr<base::DictionaryValue> result;
FakeDevToolsClient client;
client.set_result(command_result);
- Status status = internal::EvaluateScript(
- &client, 0, std::string(), internal::ReturnByValue, &result);
+ Status status = internal::EvaluateScript(&client, 0, "",
+ internal::ReturnByValue, &result);
ASSERT_EQ(kUnknownError, status.code());
ASSERT_FALSE(result);
}
@@ -72,8 +72,8 @@ TEST(EvaluateScript, CommandError) {
scoped_ptr<base::DictionaryValue> result;
FakeDevToolsClient client;
client.set_status(Status(kUnknownError));
- Status status = internal::EvaluateScript(
- &client, 0, std::string(), internal::ReturnByValue, &result);
+ Status status = internal::EvaluateScript(&client, 0, "",
+ internal::ReturnByValue, &result);
ASSERT_EQ(kUnknownError, status.code());
ASSERT_FALSE(result);
}
@@ -104,7 +104,7 @@ TEST(EvaluateScript, Ok) {
FakeDevToolsClient client;
client.set_result(dict);
ASSERT_TRUE(internal::EvaluateScript(
- &client, 0, std::string(), internal::ReturnByValue, &result).IsOk());
+ &client, 0, "", internal::ReturnByValue, &result).IsOk());
ASSERT_TRUE(result);
ASSERT_TRUE(result->HasKey("key"));
}
@@ -117,7 +117,7 @@ TEST(EvaluateScriptAndGetValue, MissingType) {
dict.SetInteger("result.value", 1);
client.set_result(dict);
ASSERT_TRUE(internal::EvaluateScriptAndGetValue(
- &client, 0, std::string(), &result).IsError());
+ &client, 0, "", &result).IsError());
}
TEST(EvaluateScriptAndGetValue, Undefined) {
@@ -127,8 +127,8 @@ TEST(EvaluateScriptAndGetValue, Undefined) {
dict.SetBoolean("wasThrown", false);
dict.SetString("result.type", "undefined");
client.set_result(dict);
- Status status =
- internal::EvaluateScriptAndGetValue(&client, 0, std::string(), &result);
+ Status status = internal::EvaluateScriptAndGetValue(
+ &client, 0, "", &result);
ASSERT_EQ(kOk, status.code());
ASSERT_TRUE(result && result->IsType(base::Value::TYPE_NULL));
}
@@ -141,8 +141,8 @@ TEST(EvaluateScriptAndGetValue, Ok) {
dict.SetString("result.type", "integer");
dict.SetInteger("result.value", 1);
client.set_result(dict);
- Status status =
- internal::EvaluateScriptAndGetValue(&client, 0, std::string(), &result);
+ Status status = internal::EvaluateScriptAndGetValue(
+ &client, 0, "", &result);
ASSERT_EQ(kOk, status.code());
int value;
ASSERT_TRUE(result && result->GetAsInteger(&value));
@@ -158,7 +158,7 @@ TEST(EvaluateScriptAndGetObject, NoObject) {
bool got_object;
std::string object_id;
ASSERT_TRUE(internal::EvaluateScriptAndGetObject(
- &client, 0, std::string(), &got_object, &object_id).IsOk());
+ &client, 0, "", &got_object, &object_id).IsOk());
ASSERT_FALSE(got_object);
ASSERT_TRUE(object_id.empty());
}
@@ -172,7 +172,7 @@ TEST(EvaluateScriptAndGetObject, Ok) {
bool got_object;
std::string object_id;
ASSERT_TRUE(internal::EvaluateScriptAndGetObject(
- &client, 0, std::string(), &got_object, &object_id).IsOk());
+ &client, 0, "", &got_object, &object_id).IsOk());
ASSERT_TRUE(got_object);
ASSERT_STREQ("id", object_id.c_str());
}
diff --git a/chrome/test/chromedriver/chromedriver.cc b/chrome/test/chromedriver/chromedriver.cc
index 8f7ddce0..40e48fc 100644
--- a/chrome/test/chromedriver/chromedriver.cc
+++ b/chrome/test/chromedriver/chromedriver.cc
@@ -36,7 +36,7 @@ void SetError(const std::string& error_msg,
std::string* response) {
base::DictionaryValue value;
value.SetString("message", error_msg);
- SetResponse(kUnknownError, &value, std::string(), response);
+ SetResponse(kUnknownError, &value, "", response);
}
} // namespace
@@ -120,6 +120,6 @@ void Shutdown() {
scoped_ptr<base::Value> value;
std::string session_id;
g_command_executor->ExecuteCommand(
- "quitAll", params, std::string(), &status_code, &value, &session_id);
+ "quitAll", params, "", &status_code, &value, &session_id);
delete g_command_executor;
}
diff --git a/chrome/test/chromedriver/chromedriver_unittest.cc b/chrome/test/chromedriver/chromedriver_unittest.cc
index 9e585e3..91e1e06 100644
--- a/chrome/test/chromedriver/chromedriver_unittest.cc
+++ b/chrome/test/chromedriver/chromedriver_unittest.cc
@@ -164,7 +164,7 @@ TEST(ChromeDriver, ExecuteCommand) {
base::DictionaryValue params;
scoped_ptr<base::Value> value(base::Value::CreateNullValue());
mock->Expect(scoped_ptr<ExpectedCommand>(new ExpectedCommand(
- "quitAll", params, std::string(), kOk, value.Pass(), std::string())));
+ "quitAll", params, "", kOk, value.Pass(), "")));
}
Shutdown();
}
diff --git a/chrome/test/chromedriver/command_executor_impl_unittest.cc b/chrome/test/chromedriver/command_executor_impl_unittest.cc
index dafa6e4..f538d06 100644
--- a/chrome/test/chromedriver/command_executor_impl_unittest.cc
+++ b/chrome/test/chromedriver/command_executor_impl_unittest.cc
@@ -118,11 +118,8 @@ TEST(CommandExecutorImplTest, CommandThatReturnsError) {
StatusCode status_code;
scoped_ptr<base::Value> value;
std::string out_session_id;
- executor.ExecuteCommand("simpleCommand",
- params,
- std::string(),
- &status_code,
- &value,
+ executor.ExecuteCommand("simpleCommand", params, "",
+ &status_code, &value,
&out_session_id);
ASSERT_EQ(kUnknownError, status_code);
ASSERT_TRUE(value);
diff --git a/chrome/test/chromedriver/commands_unittest.cc b/chrome/test/chromedriver/commands_unittest.cc
index dcfc06f..dabe0e2 100644
--- a/chrome/test/chromedriver/commands_unittest.cc
+++ b/chrome/test/chromedriver/commands_unittest.cc
@@ -28,8 +28,7 @@ TEST(CommandsTest, GetStatus) {
base::DictionaryValue params;
scoped_ptr<base::Value> value;
std::string session_id;
- ASSERT_EQ(
- kOk, ExecuteGetStatus(params, std::string(), &value, &session_id).code());
+ ASSERT_EQ(kOk, ExecuteGetStatus(params, "", &value, &session_id).code());
base::DictionaryValue* dict;
ASSERT_TRUE(value->GetAsDictionary(&dict));
base::Value* unused;
@@ -73,7 +72,7 @@ TEST(CommandsTest, QuitAll) {
scoped_ptr<base::Value> value;
std::string session_id;
Status status =
- ExecuteQuitAll(cmd, &map, params, std::string(), &value, &session_id);
+ ExecuteQuitAll(cmd, &map, params, "", &value, &session_id);
ASSERT_EQ(kOk, status.code());
ASSERT_FALSE(value.get());
ASSERT_EQ(2, count);
@@ -244,7 +243,7 @@ TEST(CommandsTest, SuccessfulFindElement) {
FindElementWebView web_view(true, kElementExistsQueryTwice);
Session session("id");
session.implicit_wait = 1000;
- session.SwitchToSubFrame("frame_id1", std::string());
+ session.SwitchToSubFrame("frame_id1", "");
base::DictionaryValue params;
params.SetString("using", "id");
params.SetString("value", "a");
@@ -273,7 +272,7 @@ TEST(CommandsTest, SuccessfulFindElements) {
FindElementWebView web_view(false, kElementExistsQueryTwice);
Session session("id");
session.implicit_wait = 1000;
- session.SwitchToSubFrame("frame_id2", std::string());
+ session.SwitchToSubFrame("frame_id2", "");
base::DictionaryValue params;
params.SetString("using", "name");
params.SetString("value", "b");
@@ -307,7 +306,7 @@ TEST(CommandsTest, SuccessfulFindChildElement) {
FindElementWebView web_view(true, kElementExistsQueryTwice);
Session session("id");
session.implicit_wait = 1000;
- session.SwitchToSubFrame("frame_id3", std::string());
+ session.SwitchToSubFrame("frame_id3", "");
base::DictionaryValue params;
params.SetString("using", "tag name");
params.SetString("value", "div");
@@ -345,7 +344,7 @@ TEST(CommandsTest, SuccessfulFindChildElements) {
FindElementWebView web_view(false, kElementExistsQueryTwice);
Session session("id");
session.implicit_wait = 1000;
- session.SwitchToSubFrame("frame_id4", std::string());
+ session.SwitchToSubFrame("frame_id4", "");
base::DictionaryValue params;
params.SetString("using", "class name");
params.SetString("value", "c");
diff --git a/chrome/test/chromedriver/key_converter.cc b/chrome/test/chromedriver/key_converter.cc
index 49b95f3..64c6099 100644
--- a/chrome/test/chromedriver/key_converter.cc
+++ b/chrome/test/chromedriver/key_converter.cc
@@ -158,13 +158,11 @@ bool KeyCodeFromShorthandKey(char16 key_utf16,
} // namespace
KeyEvent CreateKeyDownEvent(ui::KeyboardCode key_code, int modifiers) {
- return KeyEvent(
- kRawKeyDownEventType, modifiers, std::string(), std::string(), key_code);
+ return KeyEvent(kRawKeyDownEventType, modifiers, "", "", key_code);
}
KeyEvent CreateKeyUpEvent(ui::KeyboardCode key_code, int modifiers) {
- return KeyEvent(
- kKeyUpEventType, modifiers, std::string(), std::string(), key_code);
+ return KeyEvent(kKeyUpEventType, modifiers, "", "", key_code);
}
KeyEvent CreateCharEvent(const std::string& unmodified_text,
diff --git a/chrome/test/chromedriver/keycode_text_conversion_x.cc b/chrome/test/chromedriver/keycode_text_conversion_x.cc
index 7cf3b32..5b89935 100644
--- a/chrome/test/chromedriver/keycode_text_conversion_x.cc
+++ b/chrome/test/chromedriver/keycode_text_conversion_x.cc
@@ -180,7 +180,7 @@ bool GetXModifierMask(Display* display, int modifier, int* x_modifier) {
std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) {
int x_key_code = KeyboardCodeToXKeyCode(key_code);
if (x_key_code == -1)
- return std::string();
+ return "";
XEvent event;
memset(&event, 0, sizeof(XEvent));
@@ -211,7 +211,7 @@ std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) {
uint16 character = ui::GetCharacterFromXEvent(&event);
if (!character)
- return std::string();
+ return "";
return UTF16ToUTF8(string16(1, character));
}
diff --git a/chrome/test/chromedriver/server/http_handler_unittest.cc b/chrome/test/chromedriver/server/http_handler_unittest.cc
index a4d81a4..d516902 100644
--- a/chrome/test/chromedriver/server/http_handler_unittest.cc
+++ b/chrome/test/chromedriver/server/http_handler_unittest.cc
@@ -56,7 +56,7 @@ TEST(HttpHandlerTest, HandleUnknownCommand) {
scoped_ptr<CommandExecutor>(new DummyExecutor()),
scoped_ptr<HttpHandler::CommandMap>(new HttpHandler::CommandMap()),
"/");
- HttpRequest request(kGet, "/path", std::string());
+ HttpRequest request(kGet, "/path", "");
HttpResponse response;
handler.Handle(request, &response);
ASSERT_EQ(HttpResponse::kNotFound, response.status());
@@ -68,7 +68,7 @@ TEST(HttpHandlerTest, HandleNewSession) {
HttpHandler handler(
scoped_ptr<CommandExecutor>(new DummyExecutor()),
map.Pass(), "/base/");
- HttpRequest request(kPost, "/base/session", std::string());
+ HttpRequest request(kPost, "/base/session", "");
HttpResponse response;
handler.Handle(request, &response);
ASSERT_EQ(HttpResponse::kSeeOther, response.status());
@@ -96,7 +96,7 @@ TEST(HttpHandlerTest, HandleUnimplementedCommand) {
HttpHandler handler(
scoped_ptr<CommandExecutor>(new DummyExecutor(kUnknownCommand)),
map.Pass(), "/");
- HttpRequest request(kPost, "/path", std::string());
+ HttpRequest request(kPost, "/path", "");
HttpResponse response;
handler.Handle(request, &response);
ASSERT_EQ(HttpResponse::kNotImplemented, response.status());
@@ -108,7 +108,7 @@ TEST(HttpHandlerTest, HandleCommand) {
HttpHandler handler(
scoped_ptr<CommandExecutor>(new DummyExecutor()),
map.Pass(), "/");
- HttpRequest request(kPost, "/path", std::string());
+ HttpRequest request(kPost, "/path", "");
HttpResponse response;
handler.Handle(request, &response);
ASSERT_EQ(HttpResponse::kOk, response.status());
@@ -140,9 +140,9 @@ TEST(MatchesCommandTest, DiffPathLength) {
ASSERT_FALSE(internal::MatchesCommand(
kPost, "path", command, &session_id, &params));
ASSERT_FALSE(internal::MatchesCommand(
- kPost, std::string(), command, &session_id, &params));
- ASSERT_FALSE(
- internal::MatchesCommand(kPost, "/", command, &session_id, &params));
+ kPost, "", command, &session_id, &params));
+ ASSERT_FALSE(internal::MatchesCommand(
+ kPost, "/", command, &session_id, &params));
ASSERT_FALSE(internal::MatchesCommand(
kPost, "path/path/path", command, &session_id, &params));
}
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc
index ae10238..d6f6673 100644
--- a/chrome/test/chromedriver/session.cc
+++ b/chrome/test/chromedriver/session.cc
@@ -67,7 +67,7 @@ void Session::SwitchToSubFrame(const std::string& frame_id,
std::string Session::GetCurrentFrameId() const {
if (frames.empty())
- return std::string();
+ return "";
return frames.back().frame_id;
}
diff --git a/chrome/test/chromedriver/session_commands.cc b/chrome/test/chromedriver/session_commands.cc
index 4be22c4..8fdea23 100644
--- a/chrome/test/chromedriver/session_commands.cc
+++ b/chrome/test/chromedriver/session_commands.cc
@@ -201,8 +201,7 @@ Status ExecuteSwitchToWindow(
status = web_view->ConnectIfNecessary();
if (status.IsError())
return status;
- status = web_view->CallFunction(
- std::string(), kGetWindowNameScript, args, &result);
+ status = web_view->CallFunction("", kGetWindowNameScript, args, &result);
if (status.IsError())
return status;
std::string window_name;
diff --git a/chrome/test/chromedriver/window_commands.cc b/chrome/test/chromedriver/window_commands.cc
index e7b7cd1..557d572 100644
--- a/chrome/test/chromedriver/window_commands.cc
+++ b/chrome/test/chromedriver/window_commands.cc
@@ -347,8 +347,7 @@ Status ExecuteGoBack(
WebView* web_view,
const base::DictionaryValue& params,
scoped_ptr<base::Value>* value) {
- return web_view->EvaluateScript(
- std::string(), "window.history.back();", value);
+ return web_view->EvaluateScript("", "window.history.back();", value);
}
Status ExecuteGoForward(
@@ -356,8 +355,7 @@ Status ExecuteGoForward(
WebView* web_view,
const base::DictionaryValue& params,
scoped_ptr<base::Value>* value) {
- return web_view->EvaluateScript(
- std::string(), "window.history.forward();", value);
+ return web_view->EvaluateScript("", "window.history.forward();", value);
}
Status ExecuteRefresh(
diff --git a/chrome/test/gpu/gpu_pixel_browsertest.cc b/chrome/test/gpu/gpu_pixel_browsertest.cc
index 82972a0..71d9478 100644
--- a/chrome/test/gpu/gpu_pixel_browsertest.cc
+++ b/chrome/test/gpu/gpu_pixel_browsertest.cc
@@ -145,7 +145,7 @@ class GpuPixelBrowserTest : public InProcessBrowserTest {
const char* test_status_prefixes[] = {"DISABLED_", "FLAKY_", "FAILS_"};
for (size_t i = 0; i < arraysize(test_status_prefixes); ++i) {
ReplaceFirstSubstringAfterOffset(
- &test_name_, 0, test_status_prefixes[i], std::string());
+ &test_name_, 0, test_status_prefixes[i], "");
}
ui::DisableTestCompositor();
diff --git a/chrome/test/perf/dom_checker_uitest.cc b/chrome/test/perf/dom_checker_uitest.cc
index f22cce4..f966250 100644
--- a/chrome/test/perf/dom_checker_uitest.cc
+++ b/chrome/test/perf/dom_checker_uitest.cc
@@ -143,24 +143,20 @@ class DomCheckerTest : public UITest {
}
bool WaitUntilTestCompletes(TabProxy* tab) {
- return WaitUntilJavaScriptCondition(
- tab,
- std::wstring(),
+ return WaitUntilJavaScriptCondition(tab, L"",
L"window.domAutomationController.send(automation.IsDone());",
TestTimeouts::large_test_timeout());
}
bool GetTestCount(TabProxy* tab, int* test_count) {
- return tab->ExecuteAndExtractInt(
- std::wstring(),
+ return tab->ExecuteAndExtractInt(L"",
L"window.domAutomationController.send(automation.GetTestCount());",
test_count);
}
bool GetTestsFailed(TabProxy* tab, ResultsSet* tests_failed) {
std::wstring json_wide;
- bool succeeded = tab->ExecuteAndExtractString(
- std::wstring(),
+ bool succeeded = tab->ExecuteAndExtractString(L"",
L"window.domAutomationController.send("
L" JSON.stringify(automation.GetFailures()));",
&json_wide);
diff --git a/chrome/test/perf/feature_startup_test.cc b/chrome/test/perf/feature_startup_test.cc
index 0caaa44..c11a386 100644
--- a/chrome/test/perf/feature_startup_test.cc
+++ b/chrome/test/perf/feature_startup_test.cc
@@ -38,8 +38,7 @@ class NewTabUIStartupTest : public UIPerfTest {
std::string times;
for (int i = 0; i < kNumCycles; ++i)
base::StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
- perf_test::PrintResultList(
- "new_tab", std::string(), label, times, "ms", important);
+ perf_test::PrintResultList("new_tab", "", label, times, "ms", important);
}
void InitProfile(UITestBase::ProfileType profile_type) {
diff --git a/chrome/test/perf/frame_rate/frame_rate_tests.cc b/chrome/test/perf/frame_rate/frame_rate_tests.cc
index 7b36b27..7be2b36 100644
--- a/chrome/test/perf/frame_rate/frame_rate_tests.cc
+++ b/chrome/test/perf/frame_rate/frame_rate_tests.cc
@@ -196,10 +196,8 @@ class FrameRateTest
// race condition caused by an html redirect. If that is the case, verify
// that flag kHasRedirect is enabled for the current test.
ASSERT_TRUE(WaitUntilJavaScriptCondition(
- tab,
- std::wstring(),
- L"window.domAutomationController.send(__initialized);",
- TestTimeouts::large_test_timeout()));
+ tab, L"", L"window.domAutomationController.send(__initialized);",
+ TestTimeouts::large_test_timeout()));
if (HasFlag(kForceGpuComposited)) {
ASSERT_TRUE(tab->NavigateToURLAsync(
@@ -211,9 +209,7 @@ class FrameRateTest
// Block until the tests completes.
ASSERT_TRUE(WaitUntilJavaScriptCondition(
- tab,
- std::wstring(),
- L"window.domAutomationController.send(!__running_all);",
+ tab, L"", L"window.domAutomationController.send(!__running_all);",
TestTimeouts::large_test_timeout()));
// TODO(jbates): remove this check when ref builds are updated.
@@ -229,7 +225,7 @@ class FrameRateTest
// Read out the results.
std::wstring json;
ASSERT_TRUE(tab->ExecuteAndExtractString(
- std::wstring(),
+ L"",
L"window.domAutomationController.send("
L"JSON.stringify(__calc_results_total()));",
&json));
@@ -251,12 +247,8 @@ class FrameRateTest
results["sigmas"].c_str());
std::string mean_and_error = results["mean"] + "," + results["sigma"];
- perf_test::PrintResultMeanAndError(name,
- std::string(),
- trace_name,
- mean_and_error,
- "milliseconds-per-frame",
- true);
+ perf_test::PrintResultMeanAndError(name, "", trace_name, mean_and_error,
+ "milliseconds-per-frame", true);
// Navigate back to NTP so that we can quit without timing out during the
// wait-for-idle stage in test framework.
diff --git a/chrome/test/perf/indexeddb_uitest.cc b/chrome/test/perf/indexeddb_uitest.cc
index 48db062..787f2bf1 100644
--- a/chrome/test/perf/indexeddb_uitest.cc
+++ b/chrome/test/perf/indexeddb_uitest.cc
@@ -63,8 +63,7 @@ class IndexedDBTest : public UIPerfTest {
bool GetResults(TabProxy* tab, ResultsMap* results) {
std::wstring json_wide;
- bool succeeded = tab->ExecuteAndExtractString(
- std::wstring(),
+ bool succeeded = tab->ExecuteAndExtractString(L"",
L"window.domAutomationController.send("
L" JSON.stringify(automation.getResults()));",
&json_wide);
@@ -85,8 +84,8 @@ class IndexedDBTest : public UIPerfTest {
ResultsMap::const_iterator it = results.begin();
for (; it != results.end(); ++it)
- perf_test::PrintResultList(
- it->first, std::string(), trace_name, it->second, "ms", false);
+ perf_test::PrintResultList(it->first, "", trace_name, it->second, "ms",
+ false);
}
DISALLOW_COPY_AND_ASSIGN(IndexedDBTest);
diff --git a/chrome/test/perf/page_cycler_test.cc b/chrome/test/perf/page_cycler_test.cc
index 9d13000..4354faf 100644
--- a/chrome/test/perf/page_cycler_test.cc
+++ b/chrome/test/perf/page_cycler_test.cc
@@ -215,11 +215,10 @@ class PageCyclerTest : public UIPerfTest {
// Get the timing cookie value from the DOM automation.
std::wstring wcookie;
- ASSERT_TRUE(tab->ExecuteAndExtractString(
- std::wstring(),
- L"window.domAutomationController.send("
- L"JSON.stringify(__get_timings()));",
- &wcookie));
+ ASSERT_TRUE(tab->ExecuteAndExtractString(L"",
+ L"window.domAutomationController.send("
+ L"JSON.stringify(__get_timings()));",
+ &wcookie));
cookie = base::SysWideToNativeMB(wcookie);
// JSON.stringify() encapsulates the returned string in quotes, strip them.
@@ -261,8 +260,8 @@ class PageCyclerTest : public UIPerfTest {
printf("Pages: [%s]\n", base::SysWideToNativeMB(pages).c_str());
- perf_test::PrintResultList(
- graph, std::string(), trace_name, timings, "ms", true /* important */);
+ perf_test::PrintResultList(graph, "", trace_name, timings, "ms",
+ true /* important */);
}
void RunTest(const char* graph, const char* name, bool use_http) {
@@ -276,7 +275,7 @@ class PageCyclerTest : public UIPerfTest {
ASSERT_TRUE(tab.get());
std::wstring whistogram;
ASSERT_TRUE(tab->ExecuteAndExtractString(
- std::wstring(),
+ L"",
L"window.domAutomationController.send("
L"window.domAutomationController.getHistogram ? "
L"window.domAutomationController.getHistogram(\"" +
diff --git a/chrome/test/perf/perf_test.cc b/chrome/test/perf/perf_test.cc
index ec1d214..68c92e1 100644
--- a/chrome/test/perf/perf_test.cc
+++ b/chrome/test/perf/perf_test.cc
@@ -54,14 +54,8 @@ void PrintResult(const std::string& measurement,
size_t value,
const std::string& units,
bool important) {
- PrintResultsImpl(measurement,
- modifier,
- trace,
- base::UintToString(value),
- std::string(),
- std::string(),
- units,
- important);
+ PrintResultsImpl(measurement, modifier, trace, base::UintToString(value),
+ "", "", units, important);
}
void AppendResult(std::string& output,
@@ -71,14 +65,9 @@ void AppendResult(std::string& output,
size_t value,
const std::string& units,
bool important) {
- output += ResultsToString(measurement,
- modifier,
- trace,
+ output += ResultsToString(measurement, modifier, trace,
base::UintToString(value),
- std::string(),
- std::string(),
- units,
- important);
+ "", "", units, important);
}
void PrintResult(const std::string& measurement,
@@ -87,13 +76,7 @@ void PrintResult(const std::string& measurement,
const std::string& value,
const std::string& units,
bool important) {
- PrintResultsImpl(measurement,
- modifier,
- trace,
- value,
- std::string(),
- std::string(),
- units,
+ PrintResultsImpl(measurement, modifier, trace, value, "", "", units,
important);
}
@@ -104,13 +87,7 @@ void AppendResult(std::string& output,
const std::string& value,
const std::string& units,
bool important) {
- output += ResultsToString(measurement,
- modifier,
- trace,
- value,
- std::string(),
- std::string(),
- units,
+ output += ResultsToString(measurement, modifier, trace, value, "", "", units,
important);
}
@@ -256,120 +233,40 @@ std::string IOPerfInfoToString(const std::string& test_name,
}
std::string t_name(test_name);
- AppendResult(output,
- "read_op_b",
- std::string(),
- "r_op_b" + t_name,
- read_op_b,
- "ops",
+ AppendResult(output, "read_op_b", "", "r_op_b" + t_name, read_op_b, "ops",
false);
- AppendResult(output,
- "write_op_b",
- std::string(),
- "w_op_b" + t_name,
- write_op_b,
- "ops",
+ AppendResult(output, "write_op_b", "", "w_op_b" + t_name, write_op_b, "ops",
false);
- AppendResult(output,
- "other_op_b",
- std::string(),
- "o_op_b" + t_name,
- other_op_b,
- "ops",
+ AppendResult(output, "other_op_b", "", "o_op_b" + t_name, other_op_b, "ops",
false);
- AppendResult(output,
- "total_op_b",
- std::string(),
- "IO_op_b" + t_name,
- total_op_b,
- "ops",
+ AppendResult(output, "total_op_b", "", "IO_op_b" + t_name, total_op_b, "ops",
false);
- AppendResult(output,
- "read_byte_b",
- std::string(),
- "r_b" + t_name,
- read_byte_b,
- "kb",
+ AppendResult(output, "read_byte_b", "", "r_b" + t_name, read_byte_b, "kb",
false);
- AppendResult(output,
- "write_byte_b",
- std::string(),
- "w_b" + t_name,
- write_byte_b,
- "kb",
+ AppendResult(output, "write_byte_b", "", "w_b" + t_name, write_byte_b, "kb",
false);
- AppendResult(output,
- "other_byte_b",
- std::string(),
- "o_b" + t_name,
- other_byte_b,
- "kb",
+ AppendResult(output, "other_byte_b", "", "o_b" + t_name, other_byte_b, "kb",
false);
- AppendResult(output,
- "total_byte_b",
- std::string(),
- "IO_b" + t_name,
- total_byte_b,
- "kb",
+ AppendResult(output, "total_byte_b", "", "IO_b" + t_name, total_byte_b, "kb",
false);
- AppendResult(output,
- "read_op_r",
- std::string(),
- "r_op_r" + t_name,
- read_op_r,
- "ops",
+ AppendResult(output, "read_op_r", "", "r_op_r" + t_name, read_op_r, "ops",
false);
- AppendResult(output,
- "write_op_r",
- std::string(),
- "w_op_r" + t_name,
- write_op_r,
- "ops",
+ AppendResult(output, "write_op_r", "", "w_op_r" + t_name, write_op_r, "ops",
false);
- AppendResult(output,
- "other_op_r",
- std::string(),
- "o_op_r" + t_name,
- other_op_r,
- "ops",
+ AppendResult(output, "other_op_r", "", "o_op_r" + t_name, other_op_r, "ops",
false);
- AppendResult(output,
- "total_op_r",
- std::string(),
- "IO_op_r" + t_name,
- total_op_r,
- "ops",
+ AppendResult(output, "total_op_r", "", "IO_op_r" + t_name, total_op_r, "ops",
false);
- AppendResult(output,
- "read_byte_r",
- std::string(),
- "r_r" + t_name,
- read_byte_r,
- "kb",
+ AppendResult(output, "read_byte_r", "", "r_r" + t_name, read_byte_r, "kb",
false);
- AppendResult(output,
- "write_byte_r",
- std::string(),
- "w_r" + t_name,
- write_byte_r,
- "kb",
+ AppendResult(output, "write_byte_r", "", "w_r" + t_name, write_byte_r, "kb",
false);
- AppendResult(output,
- "other_byte_r",
- std::string(),
- "o_r" + t_name,
- other_byte_r,
- "kb",
+ AppendResult(output, "other_byte_r", "", "o_r" + t_name, other_byte_r, "kb",
false);
- AppendResult(output,
- "total_byte_r",
- std::string(),
- "IO_r" + t_name,
- total_byte_r,
- "kb",
+ AppendResult(output, "total_byte_r", "", "IO_r" + t_name, total_byte_r, "kb",
false);
return output;
@@ -495,57 +392,29 @@ std::string MemoryUsageInfoToString(const std::string& test_name,
total_working_set_size, "bytes",
false /* not important */);
#elif defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_ANDROID)
- AppendResult(output,
- "vm_size_final_b",
- std::string(),
- "vm_size_f_b" + trace_name,
- browser_virtual_size,
- "bytes",
+ AppendResult(output, "vm_size_final_b", "", "vm_size_f_b" + trace_name,
+ browser_virtual_size, "bytes",
false /* not important */);
- AppendResult(output,
- "vm_rss_final_b",
- std::string(),
- "vm_rss_f_b" + trace_name,
- browser_working_set_size,
- "bytes",
+ AppendResult(output, "vm_rss_final_b", "", "vm_rss_f_b" + trace_name,
+ browser_working_set_size, "bytes",
false /* not important */);
- AppendResult(output,
- "vm_size_final_r",
- std::string(),
- "vm_size_f_r" + trace_name,
- renderer_virtual_size,
- "bytes",
+ AppendResult(output, "vm_size_final_r", "", "vm_size_f_r" + trace_name,
+ renderer_virtual_size, "bytes",
false /* not important */);
- AppendResult(output,
- "vm_rss_final_r",
- std::string(),
- "vm_rss_f_r" + trace_name,
- renderer_working_set_size,
- "bytes",
+ AppendResult(output, "vm_rss_final_r", "", "vm_rss_f_r" + trace_name,
+ renderer_working_set_size, "bytes",
false /* not important */);
- AppendResult(output,
- "vm_size_final_t",
- std::string(),
- "vm_size_f_t" + trace_name,
- total_virtual_size,
- "bytes",
+ AppendResult(output, "vm_size_final_t", "", "vm_size_f_t" + trace_name,
+ total_virtual_size, "bytes",
false /* not important */);
- AppendResult(output,
- "vm_rss_final_t",
- std::string(),
- "vm_rss_f_t" + trace_name,
- total_working_set_size,
- "bytes",
+ AppendResult(output, "vm_rss_final_t", "", "vm_rss_f_t" + trace_name,
+ total_working_set_size, "bytes",
false /* not important */);
#else
NOTIMPLEMENTED();
#endif
- AppendResult(output,
- "processes",
- std::string(),
- "proc_" + trace_name,
- chrome_processes.size(),
- "count",
+ AppendResult(output, "processes", "", "proc_" + trace_name,
+ chrome_processes.size(), "count",
false /* not important */);
return output;
@@ -570,12 +439,7 @@ std::string SystemCommitChargeToString(const std::string& test_name,
bool important) {
std::string trace_name(test_name);
std::string output;
- AppendResult(output,
- "commit_charge",
- std::string(),
- "cc" + trace_name,
- charge,
- "kb",
+ AppendResult(output, "commit_charge", "", "cc" + trace_name, charge, "kb",
important);
return output;
}
diff --git a/chrome/test/perf/rendering/latency_tests.cc b/chrome/test/perf/rendering/latency_tests.cc
index fdd00d7..70939fd 100644
--- a/chrome/test/perf/rendering/latency_tests.cc
+++ b/chrome/test/perf/rendering/latency_tests.cc
@@ -153,7 +153,7 @@ class LatencyTest
return "software";
default:
NOTREACHED() << "invalid mode";
- return std::string();
+ return "";
}
}
@@ -586,12 +586,8 @@ double LatencyTest::CalculateLatency() {
std::string trace_name = GetTraceName(test_flags_);
std::string mean_and_error = base::StringPrintf("%f,%f", mean_latency,
mean_error);
- perf_test::PrintResultMeanAndError(GetModeString(),
- std::string(),
- trace_name,
- mean_and_error,
- "frames",
- true);
+ perf_test::PrintResultMeanAndError(GetModeString(), "", trace_name,
+ mean_and_error, "frames", true);
return mean_latency;
}
diff --git a/chrome/test/perf/rendering/throughput_tests.cc b/chrome/test/perf/rendering/throughput_tests.cc
index 08a1483..79d6bbb 100644
--- a/chrome/test/perf/rendering/throughput_tests.cc
+++ b/chrome/test/perf/rendering/throughput_tests.cc
@@ -383,12 +383,8 @@ class ThroughputTest : public BrowserPerfTest {
ran_on_gpu ? "gpu" : "software";
std::string mean_and_error = base::StringPrintf("%f,%f", mean_ms,
std_dev_ms);
- perf_test::PrintResultMeanAndError(test_name,
- std::string(),
- trace_name,
- mean_and_error,
- "frame_time",
- true);
+ perf_test::PrintResultMeanAndError(test_name, "", trace_name,
+ mean_and_error, "frame_time", true);
if (flags & kAllowExternalDNS)
ResetAllowExternalDNS();
diff --git a/chrome/test/perf/shutdown_test.cc b/chrome/test/perf/shutdown_test.cc
index d97c58b..7cbc7b6 100644
--- a/chrome/test/perf/shutdown_test.cc
+++ b/chrome/test/perf/shutdown_test.cc
@@ -114,8 +114,7 @@ class ShutdownTest : public UIPerfTest {
std::string times;
for (int i = 0; i < numCycles; ++i)
base::StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
- perf_test::PrintResultList(
- graph, std::string(), trace, times, "ms", important);
+ perf_test::PrintResultList(graph, "", trace, times, "ms", important);
}
};
diff --git a/chrome/test/perf/startup_test.cc b/chrome/test/perf/startup_test.cc
index 0a07ce8..1d8243f 100644
--- a/chrome/test/perf/startup_test.cc
+++ b/chrome/test/perf/startup_test.cc
@@ -295,8 +295,7 @@ class StartupTest : public UIPerfTest {
"%.2f,",
timings[i].end_to_end.InMillisecondsF());
}
- perf_test::PrintResultList(
- graph, std::string(), trace, times, "ms", important);
+ perf_test::PrintResultList(graph, "", trace, times, "ms", important);
if (num_tabs > 0) {
std::string name_base = trace;
@@ -306,15 +305,15 @@ class StartupTest : public UIPerfTest {
name = name_base + "-start";
for (int i = 0; i < numCycles; ++i)
base::StringAppendF(&times, "%.2f,", timings[i].first_start_ms);
- perf_test::PrintResultList(
- graph, std::string(), name.c_str(), times, "ms", important);
+ perf_test::PrintResultList(graph, "", name.c_str(), times, "ms",
+ important);
times.clear();
name = name_base + "-first";
for (int i = 0; i < numCycles; ++i)
base::StringAppendF(&times, "%.2f,", timings[i].first_stop_ms);
- perf_test::PrintResultList(
- graph, std::string(), name.c_str(), times, "ms", important);
+ perf_test::PrintResultList(graph, "", name.c_str(), times, "ms",
+ important);
if (nth_timed_tab > 0) {
// Display only the time necessary to load the first n tabs.
@@ -322,8 +321,8 @@ class StartupTest : public UIPerfTest {
name = name_base + "-" + base::IntToString(nth_timed_tab);
for (int i = 0; i < numCycles; ++i)
base::StringAppendF(&times, "%.2f,", timings[i].nth_tab_stop_ms);
- perf_test::PrintResultList(
- graph, std::string(), name.c_str(), times, "ms", important);
+ perf_test::PrintResultList(graph, "", name.c_str(), times, "ms",
+ important);
}
if (num_tabs > 1) {
@@ -332,8 +331,8 @@ class StartupTest : public UIPerfTest {
name = name_base + "-all";
for (int i = 0; i < numCycles; ++i)
base::StringAppendF(&times, "%.2f,", timings[i].last_stop_ms);
- perf_test::PrintResultList(
- graph, std::string(), name.c_str(), times, "ms", important);
+ perf_test::PrintResultList(graph, "", name.c_str(), times, "ms",
+ important);
}
}
}
diff --git a/chrome/test/perf/tab_switching_test.cc b/chrome/test/perf/tab_switching_test.cc
index a56c792..45a0891 100644
--- a/chrome/test/perf/tab_switching_test.cc
+++ b/chrome/test/perf/tab_switching_test.cc
@@ -69,8 +69,7 @@ class TabSwitchingUITest : public UIPerfTest {
std::string times;
for (int i = 0; i < kNumCycles; ++i)
base::StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
- perf_test::PrintResultList(
- "times", std::string(), label, times, "ms", important);
+ perf_test::PrintResultList("times", "", label, times, "ms", important);
}
void RunTabSwitchingUITest(const char* label, bool important) {
diff --git a/chrome/test/perf/url_fetch_test.cc b/chrome/test/perf/url_fetch_test.cc
index 2cffb68..6c8712f 100644
--- a/chrome/test/perf/url_fetch_test.cc
+++ b/chrome/test/perf/url_fetch_test.cc
@@ -77,8 +77,8 @@ class UrlFetchTest : public UIPerfTest {
"window.domAutomationController.send(%s);", var_to_fetch);
std::wstring value;
- bool success = tab->ExecuteAndExtractString(
- std::wstring(), ASCIIToWide(script), &value);
+ bool success = tab->ExecuteAndExtractString(L"", ASCIIToWide(script),
+ &value);
ASSERT_TRUE(success);
result->javascript_variable = WideToUTF8(value);
}
diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc
index 4cc99f4..bec32a6 100644
--- a/chrome/test/ppapi/ppapi_test.cc
+++ b/chrome/test/ppapi/ppapi_test.cc
@@ -156,7 +156,7 @@ GURL PPAPITestBase::GetTestFileUrl(const std::string& test_case) {
GURL test_url = net::FilePathToFileURL(test_path);
GURL::Replacements replacements;
- std::string query = BuildQuery(std::string(), test_case);
+ std::string query = BuildQuery("", test_case);
replacements.SetQuery(query.c_str(), url_parse::Component(0, query.size()));
return test_url.ReplaceComponents(replacements);
}
@@ -182,7 +182,7 @@ void PPAPITestBase::RunTestViaHTTP(const std::string& test_case) {
net::TestServer::kLocalhost,
document_root);
ASSERT_TRUE(http_server.Start());
- RunTestURL(GetTestURL(http_server, test_case, std::string()));
+ RunTestURL(GetTestURL(http_server, test_case, ""));
}
void PPAPITestBase::RunTestWithSSLServer(const std::string& test_case) {
diff --git a/chrome/test/reliability/automated_ui_tests.cc b/chrome/test/reliability/automated_ui_tests.cc
index 4654082..fd50b23 100644
--- a/chrome/test/reliability/automated_ui_tests.cc
+++ b/chrome/test/reliability/automated_ui_tests.cc
@@ -505,7 +505,7 @@ bool AutomatedUITest::ChangeEncoding() {
std::string cur_locale = g_browser_process->GetApplicationLocale();
const std::vector<CharacterEncoding::EncodingInfo>* encodings =
CharacterEncoding::GetCurrentDisplayEncodings(
- cur_locale, "ISO-8859-1,windows-1252", std::string());
+ cur_locale, "ISO-8859-1,windows-1252", "");
DCHECK(encodings);
DCHECK(!encodings->empty());
unsigned len = static_cast<unsigned>(encodings->size());
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 40bdf16..cf839fb 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -516,7 +516,7 @@ bool UITestBase::BeginTracing(const std::string& categories) {
std::string UITestBase::EndTracing() {
std::string json_trace_output;
if (!automation()->EndTracing(&json_trace_output))
- return std::string();
+ return "";
return json_trace_output;
}
diff --git a/chrome/test/webdriver/commands/command.cc b/chrome/test/webdriver/commands/command.cc
index dfde908..1471e0a 100644
--- a/chrome/test/webdriver/commands/command.cc
+++ b/chrome/test/webdriver/commands/command.cc
@@ -32,7 +32,7 @@ bool Command::Init(Response* const response) {
void Command::Finish(Response* const response) {}
std::string Command::GetPathVariable(const size_t i) const {
- return i < path_segments_.size() ? path_segments_.at(i) : std::string();
+ return i < path_segments_.size() ? path_segments_.at(i) : "";
}
bool Command::HasParameter(const std::string& key) const {
diff --git a/chrome/test/webdriver/commands/set_timeout_commands_unittest.cc b/chrome/test/webdriver/commands/set_timeout_commands_unittest.cc
index 767fbb1..2db4f4c 100644
--- a/chrome/test/webdriver/commands/set_timeout_commands_unittest.cc
+++ b/chrome/test/webdriver/commands/set_timeout_commands_unittest.cc
@@ -55,7 +55,7 @@ TEST(ImplicitWaitCommandTest, SettingImplicitWaits) {
ASSERT_EQ(0, test_session.implicit_wait()) << "Sanity check failed";
std::vector<std::string> path_segments;
- path_segments.push_back(std::string());
+ path_segments.push_back("");
path_segments.push_back("session");
path_segments.push_back(test_session.id());
path_segments.push_back("timeouts");
diff --git a/chrome/test/webdriver/frame_path.cc b/chrome/test/webdriver/frame_path.cc
index fd45a8d..bce634d9 100644
--- a/chrome/test/webdriver/frame_path.cc
+++ b/chrome/test/webdriver/frame_path.cc
@@ -8,7 +8,7 @@
namespace webdriver {
-FramePath::FramePath() {}
+FramePath::FramePath() : path_("") {}
FramePath::FramePath(const FramePath& other) : path_(other.path_) {}
diff --git a/chrome/test/webdriver/keycode_text_conversion_gtk.cc b/chrome/test/webdriver/keycode_text_conversion_gtk.cc
index 302d708..05b17db 100644
--- a/chrome/test/webdriver/keycode_text_conversion_gtk.cc
+++ b/chrome/test/webdriver/keycode_text_conversion_gtk.cc
@@ -23,7 +23,7 @@ std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) {
gdk_key_code = gdk_keyval_to_upper(gdk_key_code);
guint32 unicode_char = gdk_keyval_to_unicode(gdk_key_code);
if (!unicode_char)
- return std::string();
+ return "";
gchar buffer[6];
gint length = g_unichar_to_utf8(unicode_char, buffer);
return std::string(buffer, length);
diff --git a/chrome/test/webdriver/webdriver_dispatch_unittest.cc b/chrome/test/webdriver/webdriver_dispatch_unittest.cc
index 8e75edb..855711d 100644
--- a/chrome/test/webdriver/webdriver_dispatch_unittest.cc
+++ b/chrome/test/webdriver/webdriver_dispatch_unittest.cc
@@ -158,7 +158,7 @@ class ParseRequestInfoTest : public testing::Test {
virtual ~ParseRequestInfoTest() {}
virtual void TearDown() {
- SessionManager::GetInstance()->set_url_base(std::string());
+ SessionManager::GetInstance()->set_url_base("");
}
private:
@@ -178,7 +178,7 @@ TEST_F(ParseRequestInfoTest, ParseRequestWithEmptyUrlBase) {
base::DictionaryValue* parameters;
Response response;
- SessionManager::GetInstance()->set_url_base(std::string());
+ SessionManager::GetInstance()->set_url_base("");
EXPECT_TRUE(internal::ParseRequestInfo(
&request_info,
NULL, // NULL is ok because GET not POST is used
diff --git a/chrome/test/webdriver/webdriver_key_converter.cc b/chrome/test/webdriver/webdriver_key_converter.cc
index b83d3cb..e19e9dc 100644
--- a/chrome/test/webdriver/webdriver_key_converter.cc
+++ b/chrome/test/webdriver/webdriver_key_converter.cc
@@ -162,19 +162,11 @@ bool KeyCodeFromShorthandKey(char16 key_utf16,
namespace webdriver {
WebKeyEvent CreateKeyDownEvent(ui::KeyboardCode key_code, int modifiers) {
- return WebKeyEvent(automation::kRawKeyDownType,
- key_code,
- std::string(),
- std::string(),
- modifiers);
+ return WebKeyEvent(automation::kRawKeyDownType, key_code, "", "", modifiers);
}
WebKeyEvent CreateKeyUpEvent(ui::KeyboardCode key_code, int modifiers) {
- return WebKeyEvent(automation::kKeyUpType,
- key_code,
- std::string(),
- std::string(),
- modifiers);
+ return WebKeyEvent(automation::kKeyUpType, key_code, "", "", modifiers);
}
WebKeyEvent CreateCharEvent(const std::string& unmodified_text,
diff --git a/chrome/test/webdriver/webdriver_session.cc b/chrome/test/webdriver/webdriver_session.cc
index 6ed89d9..953120a 100644
--- a/chrome/test/webdriver/webdriver_session.cc
+++ b/chrome/test/webdriver/webdriver_session.cc
@@ -942,11 +942,9 @@ Error* Session::GetElementRegionInView(
// Find the frame element for the current frame path.
FrameId frame_id(current_target_.view_id, frame_path.Parent());
ElementId frame_element;
- error = FindElement(frame_id,
- ElementId(std::string()),
- LocatorType::kXpath,
- frame_path.BaseName().value(),
- &frame_element);
+ error = FindElement(
+ frame_id, ElementId(""),
+ LocatorType::kXpath, frame_path.BaseName().value(), &frame_element);
if (error) {
std::string context = base::StringPrintf(
"Could not find frame element (%s) in frame (%s)",
diff --git a/chrome/test/webdriver/webdriver_session_manager.cc b/chrome/test/webdriver/webdriver_session_manager.cc
index aa5aeca..8dc42e2 100644
--- a/chrome/test/webdriver/webdriver_session_manager.cc
+++ b/chrome/test/webdriver/webdriver_session_manager.cc
@@ -49,7 +49,7 @@ std::string SessionManager::url_base() const {
return url_base_;
}
-SessionManager::SessionManager() {}
+SessionManager::SessionManager() : port_(""), url_base_("") {}
SessionManager::~SessionManager() {}
diff --git a/chrome/tools/ipclist/ipcfuzz.cc b/chrome/tools/ipclist/ipcfuzz.cc
index 1d288c5..0eafb14 100644
--- a/chrome/tools/ipclist/ipcfuzz.cc
+++ b/chrome/tools/ipclist/ipcfuzz.cc
@@ -180,17 +180,17 @@ class DefaultFuzzer : public IPC::Fuzzer {
}
virtual void FuzzString(std::string* value) OVERRIDE {
- FuzzStringType<std::string>(value, frequency_, "BORKED", std::string());
+ FuzzStringType<std::string>(value, frequency_, "BORKED", "");
}
virtual void FuzzWString(std::wstring* value) OVERRIDE {
- FuzzStringType<std::wstring>(value, frequency_, L"BORKED", std::wstring());
+ FuzzStringType<std::wstring>(value, frequency_, L"BORKED", L"");
}
virtual void FuzzString16(string16* value) OVERRIDE {
FuzzStringType<string16>(value, frequency_,
WideToUTF16(L"BORKED"),
- WideToUTF16(std::wstring()));
+ WideToUTF16(L""));
}
virtual void FuzzData(char* data, int length) OVERRIDE {
diff --git a/chrome/utility/profile_import_handler.cc b/chrome/utility/profile_import_handler.cc
index 413feea..473581c 100644
--- a/chrome/utility/profile_import_handler.cc
+++ b/chrome/utility/profile_import_handler.cc
@@ -68,7 +68,7 @@ void ProfileImportHandler::OnImportItemFinished(uint16 item) {
items_to_import_ ^= item; // Remove finished item from mask.
// If we've finished with all items, notify the browser process.
if (items_to_import_ == 0) {
- Send(new ProfileImportProcessHostMsg_Import_Finished(true, std::string()));
+ Send(new ProfileImportProcessHostMsg_Import_Finished(true, ""));
ImporterCleanup();
}
}
diff --git a/components/autofill/browser/phone_number_i18n_unittest.cc b/components/autofill/browser/phone_number_i18n_unittest.cc
index 0547520..7744272 100644
--- a/components/autofill/browser/phone_number_i18n_unittest.cc
+++ b/components/autofill/browser/phone_number_i18n_unittest.cc
@@ -337,7 +337,7 @@ TEST(PhoneNumberI18NTest, PhoneNumbersMatch) {
// Same numbers, undefined country code.
EXPECT_TRUE(PhoneNumbersMatch(ASCIIToUTF16("4158889999"),
ASCIIToUTF16("4158889999"),
- std::string(),
+ "",
"en-US"));
// Numbers differ by country code only.
diff --git a/components/autofill/browser/wallet/full_wallet_unittest.cc b/components/autofill/browser/wallet/full_wallet_unittest.cc
index 5a65940..9eead30 100644
--- a/components/autofill/browser/wallet/full_wallet_unittest.cc
+++ b/components/autofill/browser/wallet/full_wallet_unittest.cc
@@ -402,8 +402,8 @@ TEST_F(FullWalletTest, CreateFullWalletWithRequiredActions) {
FullWallet full_wallet(-1,
-1,
- std::string(),
- std::string(),
+ "",
+ "",
scoped_ptr<Address>(),
scoped_ptr<Address>(),
required_actions);
@@ -411,13 +411,14 @@ TEST_F(FullWalletTest, CreateFullWalletWithRequiredActions) {
ASSERT_FALSE(required_actions.empty());
required_actions.pop_back();
- FullWallet different_required_actions(-1,
- -1,
- std::string(),
- std::string(),
- scoped_ptr<Address>(),
- scoped_ptr<Address>(),
- required_actions);
+ FullWallet different_required_actions(
+ -1,
+ -1,
+ "",
+ "",
+ scoped_ptr<Address>(),
+ scoped_ptr<Address>(),
+ required_actions);
EXPECT_NE(full_wallet, different_required_actions);
}
diff --git a/components/autofill/browser/wallet/wallet_address_unittest.cc b/components/autofill/browser/wallet/wallet_address_unittest.cc
index 7ac92f7..0949c6a 100644
--- a/components/autofill/browser/wallet/wallet_address_unittest.cc
+++ b/components/autofill/browser/wallet/wallet_address_unittest.cc
@@ -176,7 +176,7 @@ TEST_F(WalletAddressTest, CreateAddressMissingObjectId) {
ASCIIToUTF16("administrative_area_name"),
ASCIIToUTF16("postal_code_number"),
ASCIIToUTF16("phone_number"),
- std::string());
+ "");
ASSERT_EQ(address, *Address::CreateAddress(*dict_));
}
@@ -243,7 +243,7 @@ TEST_F(WalletAddressTest, CreateDisplayAddress) {
ASCIIToUTF16("state"),
ASCIIToUTF16("postal_code"),
ASCIIToUTF16("phone_number"),
- std::string());
+ "");
ASSERT_EQ(address, *Address::CreateDisplayAddress(*dict_));
}
@@ -272,7 +272,7 @@ TEST_F(WalletAddressTest, ToDictionaryWithoutID) {
ASCIIToUTF16("administrative_area_name"),
ASCIIToUTF16("postal_code_number"),
ASCIIToUTF16("phone_number"),
- std::string());
+ "");
EXPECT_TRUE(expected.Equals(address.ToDictionaryWithoutID().get()));
}
diff --git a/components/autofill/browser/wallet/wallet_client_unittest.cc b/components/autofill/browser/wallet/wallet_client_unittest.cc
index 6229847..27d1a2d 100644
--- a/components/autofill/browser/wallet/wallet_client_unittest.cc
+++ b/components/autofill/browser/wallet/wallet_client_unittest.cc
@@ -810,8 +810,9 @@ TEST_F(WalletClientTest, NetworkFailureOnExpectedVoidResponse) {
delegate_.ExpectBaselineMetrics(NO_ESCROW_REQUEST, HAS_WALLET_REQUEST);
delegate_.ExpectWalletErrorMetric(AutofillMetrics::WALLET_NETWORK_ERROR);
- wallet_client_->SendAutocheckoutStatus(
- autofill::SUCCESS, GURL(kMerchantUrl), std::string());
+ wallet_client_->SendAutocheckoutStatus(autofill::SUCCESS,
+ GURL(kMerchantUrl),
+ "");
net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
ASSERT_TRUE(fetcher);
fetcher->set_response_code(net::HTTP_UNAUTHORIZED);
@@ -839,8 +840,9 @@ TEST_F(WalletClientTest, RequestError) {
delegate_.ExpectBaselineMetrics(NO_ESCROW_REQUEST, HAS_WALLET_REQUEST);
delegate_.ExpectWalletErrorMetric(AutofillMetrics::WALLET_BAD_REQUEST);
- wallet_client_->SendAutocheckoutStatus(
- autofill::SUCCESS, GURL(kMerchantUrl), std::string());
+ wallet_client_->SendAutocheckoutStatus(autofill::SUCCESS,
+ GURL(kMerchantUrl),
+ "");
net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
ASSERT_TRUE(fetcher);
fetcher->set_response_code(net::HTTP_BAD_REQUEST);
diff --git a/components/autofill/browser/wallet/wallet_items_unittest.cc b/components/autofill/browser/wallet/wallet_items_unittest.cc
index 9495d8b..552a31b 100644
--- a/components/autofill/browser/wallet/wallet_items_unittest.cc
+++ b/components/autofill/browser/wallet/wallet_items_unittest.cc
@@ -418,7 +418,7 @@ TEST_F(WalletItemsTest, CreateMaskedInstrument) {
ASCIIToUTF16("state"),
ASCIIToUTF16("postal_code"),
ASCIIToUTF16("phone_number"),
- std::string()));
+ ""));
std::vector<string16> supported_currencies;
supported_currencies.push_back(ASCIIToUTF16("currency"));
WalletItems::MaskedInstrument masked_instrument(
@@ -520,7 +520,7 @@ TEST_F(WalletItemsTest, CreateWalletItems) {
ASCIIToUTF16("state"),
ASCIIToUTF16("postal_code"),
ASCIIToUTF16("phone_number"),
- std::string()));
+ ""));
std::vector<string16> supported_currencies;
supported_currencies.push_back(ASCIIToUTF16("currency"));
scoped_ptr<WalletItems::MaskedInstrument> masked_instrument(
diff --git a/components/autofill/browser/wallet/wallet_signin_helper_unittest.cc b/components/autofill/browser/wallet/wallet_signin_helper_unittest.cc
index 20175b1..e574d55 100644
--- a/components/autofill/browser/wallet/wallet_signin_helper_unittest.cc
+++ b/components/autofill/browser/wallet/wallet_signin_helper_unittest.cc
@@ -120,10 +120,9 @@ class WalletSigninHelperTest : public testing::Test {
void MockFailedOAuthLoginResponse404() {
SetUpFetcherResponseAndCompleteRequest(
- GaiaUrls::GetInstance()->client_login_url(),
- 404,
+ GaiaUrls::GetInstance()->client_login_url(), 404,
net::ResponseCookies(),
- std::string());
+ "");
}
void MockSuccessfulGaiaUserInfoResponse(const std::string& username) {
@@ -135,10 +134,9 @@ class WalletSigninHelperTest : public testing::Test {
void MockFailedGaiaUserInfoResponse404() {
SetUpFetcherResponseAndCompleteRequest(
- GaiaUrls::GetInstance()->get_user_info_url(),
- 404,
+ GaiaUrls::GetInstance()->get_user_info_url(), 404,
net::ResponseCookies(),
- std::string());
+ "");
}
void MockSuccessfulGetAccountInfoResponse(const std::string& username) {
@@ -152,24 +150,23 @@ class WalletSigninHelperTest : public testing::Test {
void MockFailedGetAccountInfoResponse404() {
SetUpFetcherResponseAndCompleteRequest(
- signin_helper_->GetGetAccountInfoUrlForTesting(),
- 404,
+ signin_helper_->GetGetAccountInfoUrlForTesting(), 404,
net::ResponseCookies(),
- std::string());
+ "");
}
void MockSuccessfulPassiveAuthUrlMergeAndRedirectResponse() {
- SetUpFetcherResponseAndCompleteRequest(wallet::GetPassiveAuthUrl().spec(),
- 200,
- net::ResponseCookies(),
- std::string());
+ SetUpFetcherResponseAndCompleteRequest(
+ wallet::GetPassiveAuthUrl().spec(), 200,
+ net::ResponseCookies(),
+ "");
}
void MockFailedPassiveAuthUrlMergeAndRedirectResponse404() {
- SetUpFetcherResponseAndCompleteRequest(wallet::GetPassiveAuthUrl().spec(),
- 404,
- net::ResponseCookies(),
- std::string());
+ SetUpFetcherResponseAndCompleteRequest(
+ wallet::GetPassiveAuthUrl().spec(), 404,
+ net::ResponseCookies(),
+ "");
}
WalletSigninHelperForTesting::State state() const {
diff --git a/content/browser/accessibility/accessibility_tree_formatter.cc b/content/browser/accessibility/accessibility_tree_formatter.cc
index 3904bc0..cbe0629 100644
--- a/content/browser/accessibility/accessibility_tree_formatter.cc
+++ b/content/browser/accessibility/accessibility_tree_formatter.cc
@@ -80,28 +80,28 @@ void AccessibilityTreeFormatter::Initialize() {}
// static
const base::FilePath::StringType
AccessibilityTreeFormatter::GetActualFileSuffix() {
- return base::FilePath::StringType();
+ return FILE_PATH_LITERAL("");
}
// static
const base::FilePath::StringType
AccessibilityTreeFormatter::GetExpectedFileSuffix() {
- return base::FilePath::StringType();
+ return FILE_PATH_LITERAL("");
}
// static
const std::string AccessibilityTreeFormatter::GetAllowEmptyString() {
- return std::string();
+ return "";
}
// static
const std::string AccessibilityTreeFormatter::GetAllowString() {
- return std::string();
+ return "";
}
// static
const std::string AccessibilityTreeFormatter::GetDenyString() {
- return std::string();
+ return "";
}
#endif
diff --git a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc
index ff5789a..9fe99c4 100644
--- a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc
+++ b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc
@@ -107,7 +107,7 @@ std::string CrossPlatformAccessibilityBrowserTest::GetAttr(
if (iter != node.string_attributes.end())
return UTF16ToUTF8(iter->second);
else
- return std::string();
+ return "";
}
// Convenience method to get the value of a particular AccessibilityNodeData
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 3248afd..14dbc9a 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -92,7 +92,7 @@ static std::string RetrieveDownloadURLFromRequestId(
ResourceDispatcherHostImpl::Get()->GetURLRequest(global_id);
if (url_request)
return url_request->url().possibly_invalid_spec();
- return std::string();
+ return "";
}
}
diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
index 94568493..23977a5 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -388,8 +388,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest,
TestShortHangTimeoutGuestFactory::GetInstance());
const char kEmbedderURL[] =
"files/browser_plugin_embedder_guest_unresponsive.html";
- StartBrowserPluginTest(
- kEmbedderURL, kHTMLForGuestBusyLoop, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestBusyLoop, true, "");
// Wait until the busy loop starts.
{
const string16 expected_title = ASCIIToUTF16("start");
@@ -454,7 +453,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, NavigateAfterResize) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AdvanceFocus) {
const char kEmbedderURL[] = "files/browser_plugin_focus.html";
const char* kGuestURL = "files/browser_plugin_focus_child.html";
- StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, "");
SimulateMouseClick(test_embedder()->web_contents(), 0,
WebKit::WebMouseEvent::ButtonLeft);
@@ -485,7 +484,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderChangedAfterSwap) {
// 1. Load an embedder page with one guest in it.
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
// 2. Navigate to a URL in https, so we trigger a RenderViewHost swap.
GURL test_https_url(https_server.GetURL(
@@ -511,7 +510,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderChangedAfterSwap) {
// web_contents.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderSameAfterNav) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
WebContentsImpl* embedder_web_contents = test_embedder()->web_contents();
// Navigate to another page in same host and port, so RenderViewHost swap
@@ -536,7 +535,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderSameAfterNav) {
// This test verifies that hiding the embedder also hides the guest.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BrowserPluginVisibilityChanged) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
// Hide the Browser Plugin.
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
@@ -550,7 +549,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BrowserPluginVisibilityChanged) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderVisibilityChanged) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
// Hide the embedder.
test_embedder()->web_contents()->WasHidden();
@@ -562,7 +561,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderVisibilityChanged) {
// This test verifies that calling the reload method reloads the guest.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadGuest) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
test_guest()->ResetUpdateRectCount();
@@ -576,7 +575,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadGuest) {
// to the guest's WebContents.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, StopGuest) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -588,8 +587,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, StopGuest) {
// plugin correctly updates the touch-event handling state in the embedder.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AcceptTouchEvents) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(
- kEmbedderURL, kHTMLForGuestTouchHandler, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestTouchHandler, true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -617,7 +615,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AcceptTouchEvents) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(
- kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, std::string());
+ kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -712,7 +710,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) {
// and that the guest is reset.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -763,7 +761,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -778,7 +776,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BackAfterTerminateGuest) {
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(
- kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, std::string());
+ kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -820,7 +818,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BackAfterTerminateGuest) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStart) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, "about:blank", true, "");
const string16 expected_title = ASCIIToUTF16(kHTMLForGuest);
content::TitleWatcher title_watcher(test_embedder()->web_contents(),
@@ -837,7 +835,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStart) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadAbort) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, "about:blank", true, "");
{
// Navigate the guest to "close-socket".
@@ -884,7 +882,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadAbort) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, "about:blank", true, "");
const string16 expected_title = ASCIIToUTF16("redirected");
content::TitleWatcher title_watcher(test_embedder()->web_contents(),
@@ -924,8 +922,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) {
// correctly.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_AcceptDragEvents) {
const char kEmbedderURL[] = "files/browser_plugin_dragging.html";
- StartBrowserPluginTest(
- kEmbedderURL, kHTMLForGuestAcceptDrag, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestAcceptDrag, true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -981,7 +978,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, PostMessage) {
const char* kTesting = "testing123";
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
const char* kGuestURL = "files/browser_plugin_post_message_guest.html";
- StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
{
@@ -1009,7 +1006,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) {
const char* kTesting = "testing123";
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
const char* kGuestURL = "files/browser_plugin_post_message_guest.html";
- StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
{
@@ -1055,7 +1052,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) {
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, "about:blank", true, "");
const string16 expected_title = ASCIIToUTF16("loadStop");
content::TitleWatcher title_watcher(
@@ -1072,7 +1069,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadCommit) {
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, "about:blank", true, "");
const string16 expected_title = ASCIIToUTF16(
base::StringPrintf("loadCommit:%s", kHTMLForGuest));
@@ -1108,7 +1105,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, HiddenBeforeNavigation) {
// the new guest will inherit the visibility state of the old guest.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, VisibilityPreservation) {
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
// Hide the BrowserPlugin.
@@ -1148,7 +1145,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusBeforeNavigation) {
// crbug.com/170249
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_FocusPreservation) {
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
@@ -1187,7 +1184,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_FocusPreservation) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusTracksEmbedder) {
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
@@ -1232,7 +1229,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AutoSizeBeforeNavigation) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AutoSizeAfterNavigation) {
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(
- kEmbedderURL, kHTMLForGuestWithSize, true, std::string());
+ kEmbedderURL, kHTMLForGuestWithSize, true, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -1286,7 +1283,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, GetRenderViewHostAtPositionTest) {
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ChangeWindowName) {
const char kEmbedderURL[] = "files/browser_plugin_naming_embedder.html";
const char* kGuestURL = "files/browser_plugin_naming_guest.html";
- StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string());
+ StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, "");
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
diff --git a/content/browser/database_browsertest.cc b/content/browser/database_browsertest.cc
index 29030ad..48f7304 100644
--- a/content/browser/database_browsertest.cc
+++ b/content/browser/database_browsertest.cc
@@ -102,7 +102,7 @@ IN_PROC_BROWSER_TEST_F(DatabaseTest, DeleteRecord) {
CreateTable(shell());
InsertRecord(shell(), "text");
DeleteRecord(shell(), 0);
- CompareRecords(shell(), std::string());
+ CompareRecords(shell(), "");
InsertRecord(shell(), "0");
InsertRecord(shell(), "1");
@@ -151,12 +151,12 @@ IN_PROC_BROWSER_TEST_F(DatabaseTest, DatabaseOperations) {
for (int i = 0; i < 10; ++i)
DeleteRecord(shell(), 0);
- CompareRecords(shell(), std::string());
+ CompareRecords(shell(), "");
RunScriptAndCheckResult(
shell(), "deleteRecord(1)", "could not find row with index: 1");
- CompareRecords(shell(), std::string());
+ CompareRecords(shell(), "");
}
// Create records in the database and verify they persist after reload.
@@ -186,7 +186,7 @@ IN_PROC_BROWSER_TEST_F(DatabaseTest, OffTheRecordCannotReadRegularDatabase) {
ASSERT_FALSE(HasTable(otr));
CreateTable(otr);
- CompareRecords(otr, std::string());
+ CompareRecords(otr, "");
}
// Attempt to read a database created in an off the record browser from a
@@ -200,7 +200,7 @@ IN_PROC_BROWSER_TEST_F(DatabaseTest, RegularCannotReadOffTheRecordDatabase) {
Navigate(shell());
ASSERT_FALSE(HasTable(shell()));
CreateTable(shell());
- CompareRecords(shell(), std::string());
+ CompareRecords(shell(), "");
}
// Verify DB changes within first window are present in the second window.
diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc
index 4869c2b..414785e 100644
--- a/content/browser/devtools/devtools_http_handler_impl.cc
+++ b/content/browser/devtools/devtools_http_handler_impl.cc
@@ -459,7 +459,7 @@ void DevToolsHttpHandlerImpl::OnJsonRequestUI(
content::GetContentClient()->GetProduct());
version.SetString("User-Agent",
webkit_glue::GetUserAgent(GURL(chrome::kAboutBlankURL)));
- SendJson(connection_id, net::HTTP_OK, &version, std::string());
+ SendJson(connection_id, net::HTTP_OK, &version, "");
return;
}
@@ -506,7 +506,7 @@ void DevToolsHttpHandlerImpl::OnJsonRequestUI(
}
std::string host = info.headers["Host"];
scoped_ptr<base::DictionaryValue> dictionary(SerializePageInfo(rvh, host));
- SendJson(connection_id, net::HTTP_OK, dictionary.get(), std::string());
+ SendJson(connection_id, net::HTTP_OK, dictionary.get(), "");
return;
}
@@ -552,7 +552,7 @@ void DevToolsHttpHandlerImpl::CollectWorkerInfo(ListValue* target_list,
void DevToolsHttpHandlerImpl::SendTargetList(int connection_id,
ListValue* target_list) {
- SendJson(connection_id, net::HTTP_OK, target_list, std::string());
+ SendJson(connection_id, net::HTTP_OK, target_list, "");
delete target_list;
Release(); // Balanced OnJsonRequestUI.
}
diff --git a/content/browser/devtools/devtools_http_handler_unittest.cc b/content/browser/devtools/devtools_http_handler_unittest.cc
index c926015..839ef60 100644
--- a/content/browser/devtools/devtools_http_handler_unittest.cc
+++ b/content/browser/devtools/devtools_http_handler_unittest.cc
@@ -56,20 +56,20 @@ class DummyListenSocketFactory : public net::StreamListenSocketFactory {
class DummyDelegate : public DevToolsHttpHandlerDelegate {
public:
- virtual std::string GetDiscoveryPageHTML() OVERRIDE { return std::string(); }
+ virtual std::string GetDiscoveryPageHTML() OVERRIDE { return ""; }
virtual bool BundlesFrontendResources() OVERRIDE { return true; }
virtual base::FilePath GetDebugFrontendDir() OVERRIDE {
return base::FilePath();
}
virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE {
- return std::string();
+ return "";
}
virtual RenderViewHost* CreateNewTarget() OVERRIDE { return NULL; }
virtual TargetType GetTargetType(RenderViewHost*) OVERRIDE {
return kTargetTypeTab;
}
virtual std::string GetViewDescription(content::RenderViewHost*) OVERRIDE {
- return std::string();
+ return "";
}
};
@@ -98,9 +98,9 @@ TEST_F(DevToolsHttpHandlerTest, TestStartStop) {
base::RunLoop run_loop, run_loop_2;
content::DevToolsHttpHandler* devtools_http_handler_ =
content::DevToolsHttpHandler::Start(
- new DummyListenSocketFactory(run_loop.QuitClosure(),
- run_loop_2.QuitClosure()),
- std::string(),
+ new DummyListenSocketFactory(
+ run_loop.QuitClosure(), run_loop_2.QuitClosure()),
+ "",
new DummyDelegate());
// Our dummy socket factory will post a quit message once the server will
// become ready.
diff --git a/content/browser/devtools/renderer_overrides_handler.cc b/content/browser/devtools/renderer_overrides_handler.cc
index f7db2e8..94395d1 100644
--- a/content/browser/devtools/renderer_overrides_handler.cc
+++ b/content/browser/devtools/renderer_overrides_handler.cc
@@ -145,8 +145,8 @@ RendererOverridesHandler::PageNavigate(
if (host) {
WebContents* web_contents = host->GetDelegate()->GetAsWebContents();
if (web_contents) {
- web_contents->GetController()
- .LoadURL(gurl, Referrer(), PAGE_TRANSITION_TYPED, std::string());
+ web_contents->GetController().LoadURL(
+ gurl, Referrer(), PAGE_TRANSITION_TYPED, "");
return command->SuccessResponse(new base::DictionaryValue());
}
}
diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc
index 0b1db97..b5ded45 100644
--- a/content/browser/download/base_file.cc
+++ b/content/browser/download/base_file.cc
@@ -232,11 +232,11 @@ bool BaseFile::GetHash(std::string* hash) {
std::string BaseFile::GetHashState() {
if (!calculate_hash_)
- return std::string();
+ return "";
Pickle hash_state;
if (!secure_hash_->Serialize(&hash_state))
- return std::string();
+ return "";
return std::string(reinterpret_cast<const char*>(hash_state.data()),
hash_state.size());
diff --git a/content/browser/download/base_file_unittest.cc b/content/browser/download/base_file_unittest.cc
index 0e6239f..799076d 100644
--- a/content/browser/download/base_file_unittest.cc
+++ b/content/browser/download/base_file_unittest.cc
@@ -54,7 +54,7 @@ class BaseFileTest : public testing::Test {
GURL(),
0,
false,
- std::string(),
+ "",
scoped_ptr<net::FileStream>(),
net::BoundNetLog()));
}
@@ -105,7 +105,7 @@ class BaseFileTest : public testing::Test {
GURL(),
0,
true,
- std::string(),
+ "",
scoped_ptr<net::FileStream>(),
net::BoundNetLog()));
}
@@ -145,7 +145,7 @@ class BaseFileTest : public testing::Test {
GURL(),
0,
false,
- std::string(),
+ "",
scoped_ptr<net::FileStream>(),
net::BoundNetLog());
@@ -171,7 +171,7 @@ class BaseFileTest : public testing::Test {
GURL(),
0,
false,
- std::string(),
+ "",
scoped_ptr<net::FileStream>(),
net::BoundNetLog());
EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NONE,
@@ -503,7 +503,7 @@ TEST_F(BaseFileTest, MultipleWritesWithError) {
GURL(),
0,
false,
- std::string(),
+ "",
mock_file_stream_scoped_ptr.Pass(),
net::BoundNetLog()));
ASSERT_TRUE(InitializeFile());
@@ -550,7 +550,7 @@ TEST_F(BaseFileTest, AppendToBaseFile) {
GURL(),
kTestDataLength4,
false,
- std::string(),
+ "",
scoped_ptr<net::FileStream>(),
net::BoundNetLog()));
@@ -584,7 +584,7 @@ TEST_F(BaseFileTest, ReadonlyBaseFile) {
GURL(),
0,
false,
- std::string(),
+ "",
scoped_ptr<net::FileStream>(),
net::BoundNetLog()));
@@ -609,7 +609,7 @@ TEST_F(BaseFileTest, IsEmptyHash) {
EXPECT_TRUE(BaseFile::IsEmptyHash(empty));
std::string not_empty(BaseFile::kSha256HashLen, '\x01');
EXPECT_FALSE(BaseFile::IsEmptyHash(not_empty));
- EXPECT_FALSE(BaseFile::IsEmptyHash(std::string()));
+ EXPECT_FALSE(BaseFile::IsEmptyHash(""));
}
// Test that calculating speed after no writes.
diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc
index 5286e0c..ab95900 100644
--- a/content/browser/download/download_file_impl.cc
+++ b/content/browser/download/download_file_impl.cc
@@ -108,8 +108,8 @@ void DownloadFileImpl::RenameAndUniquify(
base::FilePath new_path(full_path);
- int uniquifier = file_util::GetUniquePathNumber(
- new_path, base::FilePath::StringType());
+ int uniquifier =
+ file_util::GetUniquePathNumber(new_path, FILE_PATH_LITERAL(""));
if (uniquifier > 0) {
new_path = new_path.InsertBeforeExtensionASCII(
base::StringPrintf(" (%d)", uniquifier));
diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc
index caee4ae..83b0cf0 100644
--- a/content/browser/download/download_item_impl_unittest.cc
+++ b/content/browser/download/download_item_impl_unittest.cc
@@ -344,7 +344,7 @@ TEST_F(DownloadItemTest, NotificationAfterUpdate) {
DownloadItemImpl* item = CreateDownloadItem();
MockObserver observer(item);
- item->UpdateProgress(kDownloadChunkSize, kDownloadSpeed, std::string());
+ item->UpdateProgress(kDownloadChunkSize, kDownloadSpeed, "");
ASSERT_TRUE(observer.CheckUpdated());
EXPECT_EQ(kDownloadSpeed, item->CurrentSpeed());
}
@@ -545,7 +545,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) {
DownloadItemImpl* safe_item = CreateDownloadItem();
MockObserver safe_observer(safe_item);
- safe_item->OnAllDataSaved(std::string());
+ safe_item->OnAllDataSaved("");
EXPECT_TRUE(safe_observer.CheckUpdated());
safe_item->OnContentCheckCompleted(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
EXPECT_TRUE(safe_observer.CheckUpdated());
@@ -555,7 +555,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) {
CreateDownloadItem();
MockObserver unsafeurl_observer(unsafeurl_item);
- unsafeurl_item->OnAllDataSaved(std::string());
+ unsafeurl_item->OnAllDataSaved("");
EXPECT_TRUE(unsafeurl_observer.CheckUpdated());
unsafeurl_item->OnContentCheckCompleted(DOWNLOAD_DANGER_TYPE_DANGEROUS_URL);
EXPECT_TRUE(unsafeurl_observer.CheckUpdated());
@@ -567,7 +567,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) {
CreateDownloadItem();
MockObserver unsafefile_observer(unsafefile_item);
- unsafefile_item->OnAllDataSaved(std::string());
+ unsafefile_item->OnAllDataSaved("");
EXPECT_TRUE(unsafefile_observer.CheckUpdated());
unsafefile_item->OnContentCheckCompleted(DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE);
EXPECT_TRUE(unsafefile_observer.CheckUpdated());
@@ -697,7 +697,7 @@ TEST_F(DownloadItemTest, CallbackAfterRename) {
.WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE,
final_path));
EXPECT_CALL(*download_file, Detach());
- item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string());
+ item->DestinationObserverAsWeakPtr()->DestinationCompleted("");
RunAllPendingInMessageLoops();
::testing::Mock::VerifyAndClearExpectations(download_file);
mock_delegate()->VerifyAndClearExpectations();
@@ -862,7 +862,7 @@ TEST_F(DownloadItemTest, EnabledActionsForNormalDownload) {
EXPECT_CALL(*mock_delegate(), ShouldCompleteDownload(item, _))
.WillOnce(Return(true));
EXPECT_CALL(*download_file, Detach());
- item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string());
+ item->DestinationObserverAsWeakPtr()->DestinationCompleted("");
RunAllPendingInMessageLoops();
ASSERT_TRUE(item->IsComplete());
@@ -889,7 +889,7 @@ TEST_F(DownloadItemTest, EnabledActionsForTemporaryDownload) {
.WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE,
base::FilePath(kDummyPath)));
EXPECT_CALL(*download_file, Detach());
- item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string());
+ item->DestinationObserverAsWeakPtr()->DestinationCompleted("");
RunAllPendingInMessageLoops();
ASSERT_TRUE(item->IsComplete());
@@ -937,7 +937,7 @@ TEST_F(DownloadItemTest, CompleteDelegate_ReturnTrue) {
// Drive the delegate interaction.
EXPECT_CALL(*mock_delegate(), ShouldCompleteDownload(item, _))
.WillOnce(Return(true));
- item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string());
+ item->DestinationObserverAsWeakPtr()->DestinationCompleted("");
EXPECT_EQ(DownloadItem::IN_PROGRESS, item->GetState());
EXPECT_FALSE(item->IsDangerous());
@@ -966,7 +966,7 @@ TEST_F(DownloadItemTest, CompleteDelegate_BlockOnce) {
.WillOnce(DoAll(SaveArg<1>(&delegate_callback),
Return(false)))
.WillOnce(Return(true));
- item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string());
+ item->DestinationObserverAsWeakPtr()->DestinationCompleted("");
ASSERT_FALSE(delegate_callback.is_null());
copy_delegate_callback = delegate_callback;
delegate_callback.Reset();
@@ -1001,7 +1001,7 @@ TEST_F(DownloadItemTest, CompleteDelegate_SetDanger) {
.WillOnce(DoAll(SaveArg<1>(&delegate_callback),
Return(false)))
.WillOnce(Return(true));
- item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string());
+ item->DestinationObserverAsWeakPtr()->DestinationCompleted("");
ASSERT_FALSE(delegate_callback.is_null());
copy_delegate_callback = delegate_callback;
delegate_callback.Reset();
@@ -1047,7 +1047,7 @@ TEST_F(DownloadItemTest, CompleteDelegate_BlockTwice) {
.WillOnce(DoAll(SaveArg<1>(&delegate_callback),
Return(false)))
.WillOnce(Return(true));
- item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string());
+ item->DestinationObserverAsWeakPtr()->DestinationCompleted("");
ASSERT_FALSE(delegate_callback.is_null());
copy_delegate_callback = delegate_callback;
delegate_callback.Reset();
diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc
index e08402e..4a33159 100644
--- a/content/browser/download/download_manager_impl_unittest.cc
+++ b/content/browser/download/download_manager_impl_unittest.cc
@@ -169,9 +169,7 @@ class MockDownloadItemImpl : public DownloadItemImpl {
MOCK_CONST_METHOD0(GetUserVerifiedFilePath, base::FilePath());
MOCK_METHOD0(NotifyRemoved, void());
// May be called when vlog is on.
- virtual std::string DebugString(bool verbose) const OVERRIDE {
- return std::string();
- }
+ virtual std::string DebugString(bool verbose) const OVERRIDE { return ""; }
};
class MockDownloadManagerDelegate : public DownloadManagerDelegate {
diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc
index e13200e..cad6cbe 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -305,8 +305,8 @@ void RecordDownloadContentDisposition(
const std::string& content_disposition_string) {
if (content_disposition_string.empty())
return;
- net::HttpContentDisposition content_disposition(content_disposition_string,
- std::string());
+ net::HttpContentDisposition content_disposition(
+ content_disposition_string, "");
int result = content_disposition.parse_result_flags();
bool is_valid = !content_disposition.filename().empty();
diff --git a/content/browser/download/save_file.cc b/content/browser/download/save_file.cc
index 80caf13..3e7f7bd 100644
--- a/content/browser/download/save_file.cc
+++ b/content/browser/download/save_file.cc
@@ -20,7 +20,7 @@ SaveFile::SaveFile(const SaveFileCreateInfo* info, bool calculate_hash)
GURL(),
0,
calculate_hash,
- std::string(),
+ "",
scoped_ptr<net::FileStream>(),
net::BoundNetLog()),
info_(info) {
diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
index f97d2d6..cbff60a 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -365,7 +365,7 @@ void SavePackage::OnMHTMLGenerated(const base::FilePath& path, int64 size) {
// with SavePackage flow.
if (download_->IsInProgress()) {
download_->SetTotalBytes(size);
- download_->UpdateProgress(size, 0, std::string());
+ download_->UpdateProgress(size, 0, "");
// Must call OnAllDataSaved here in order for
// GDataDownloadObserver::ShouldUpload() to return true.
// ShouldCompleteDownload() may depend on the gdata uploader to finish.
@@ -449,11 +449,7 @@ bool SavePackage::GenerateFileName(const std::string& disposition,
base::FilePath::StringType* generated_name) {
// TODO(jungshik): Figure out the referrer charset when having one
// makes sense and pass it to GenerateFileName.
- base::FilePath file_path = net::GenerateFileName(url,
- disposition,
- std::string(),
- std::string(),
- std::string(),
+ base::FilePath file_path = net::GenerateFileName(url, disposition, "", "", "",
kDefaultSaveName);
DCHECK(!file_path.empty());
@@ -792,8 +788,7 @@ void SavePackage::Finish() {
// with SavePackage flow.
if (download_->IsInProgress()) {
if (save_type_ != SAVE_PAGE_TYPE_AS_MHTML) {
- download_->UpdateProgress(
- all_save_items_count_, CurrentSpeed(), std::string());
+ download_->UpdateProgress(all_save_items_count_, CurrentSpeed(), "");
download_->OnAllDataSaved(DownloadItem::kEmptyFileHash);
}
download_->MarkAsComplete();
@@ -823,7 +818,7 @@ void SavePackage::SaveFinished(int32 save_id, int64 size, bool is_success) {
// TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
// with SavePackage flow.
if (download_ && download_->IsInProgress())
- download_->UpdateProgress(completed_count(), CurrentSpeed(), std::string());
+ download_->UpdateProgress(completed_count(), CurrentSpeed(), "");
if (save_item->save_source() == SaveFileCreateInfo::SAVE_FILE_FROM_DOM &&
save_item->url() == page_url_ && !save_item->received_bytes()) {
@@ -868,7 +863,7 @@ void SavePackage::SaveFailed(const GURL& save_url) {
// TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
// with SavePackage flow.
if (download_ && download_->IsInProgress())
- download_->UpdateProgress(completed_count(), CurrentSpeed(), std::string());
+ download_->UpdateProgress(completed_count(), CurrentSpeed(), "");
if ((save_type_ == SAVE_PAGE_TYPE_AS_ONLY_HTML) ||
(save_type_ == SAVE_PAGE_TYPE_AS_MHTML) ||
diff --git a/content/browser/download/save_package_unittest.cc b/content/browser/download/save_package_unittest.cc
index e40af08..b5a07ae 100644
--- a/content/browser/download/save_package_unittest.cc
+++ b/content/browser/download/save_package_unittest.cc
@@ -221,21 +221,20 @@ TEST_F(SavePackageTest, MAYBE_TestLongSavePackageFilename) {
base::FilePath::StringType filename;
// Test that the filename is successfully shortened to fit.
- ASSERT_TRUE(GetGeneratedFilename(true, std::string(), url, false, &filename));
+ ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename));
EXPECT_TRUE(filename.length() < long_file.length());
EXPECT_FALSE(HasOrdinalNumber(filename));
// Test that the filename is successfully shortened to fit, and gets an
// an ordinal appended.
- ASSERT_TRUE(GetGeneratedFilename(true, std::string(), url, false, &filename));
+ ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename));
EXPECT_TRUE(filename.length() < long_file.length());
EXPECT_TRUE(HasOrdinalNumber(filename));
// Test that the filename is successfully shortened to fit, and gets a
// different ordinal appended.
base::FilePath::StringType filename2;
- ASSERT_TRUE(
- GetGeneratedFilename(true, std::string(), url, false, &filename2));
+ ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename2));
EXPECT_TRUE(filename2.length() < long_file.length());
EXPECT_TRUE(HasOrdinalNumber(filename2));
EXPECT_NE(filename, filename2);
diff --git a/content/browser/geolocation/network_location_provider_unittest.cc b/content/browser/geolocation/network_location_provider_unittest.cc
index 3b91466..fb01795 100644
--- a/content/browser/geolocation/network_location_provider_unittest.cc
+++ b/content/browser/geolocation/network_location_provider_unittest.cc
@@ -344,7 +344,7 @@ TEST_F(GeolocationNetworkProviderTest, StartProvider) {
EXPECT_TRUE(provider->StartProvider(false));
net::TestURLFetcher* fetcher = get_url_fetcher_and_advance_id();
ASSERT_TRUE(fetcher != NULL);
- CheckRequestIsValid(*fetcher, 0, 0, 0, std::string());
+ CheckRequestIsValid(*fetcher, 0, 0, 0, "");
}
TEST_F(GeolocationNetworkProviderTest, StartProviderDefaultUrl) {
@@ -353,9 +353,10 @@ TEST_F(GeolocationNetworkProviderTest, StartProviderDefaultUrl) {
EXPECT_TRUE(provider->StartProvider(false));
net::TestURLFetcher* fetcher = get_url_fetcher_and_advance_id();
ASSERT_TRUE(fetcher != NULL);
- CheckRequestIsValid(*fetcher, 0, 0, 0, std::string());
+ CheckRequestIsValid(*fetcher, 0, 0, 0, "");
}
+
TEST_F(GeolocationNetworkProviderTest, StartProviderLongRequest) {
scoped_ptr<LocationProviderBase> provider(CreateProvider(true));
EXPECT_TRUE(provider->StartProvider(false));
@@ -368,7 +369,7 @@ TEST_F(GeolocationNetworkProviderTest, StartProviderLongRequest) {
// in length by not including access points with the lowest signal strength
// in the request.
EXPECT_LT(fetcher->GetOriginalURL().spec().size(), size_t(2048));
- CheckRequestIsValid(*fetcher, 0, 16, 4, std::string());
+ CheckRequestIsValid(*fetcher, 0, 16, 4, "");
}
TEST_F(GeolocationNetworkProviderTest, MultiRegistrations) {
@@ -417,7 +418,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
fetcher = get_url_fetcher_and_advance_id();
ASSERT_TRUE(fetcher != NULL);
// The request should have the wifi data.
- CheckRequestIsValid(*fetcher, 0, kFirstScanAps, 0, std::string());
+ CheckRequestIsValid(*fetcher, 0, kFirstScanAps, 0, "");
// Send a reply with good position fix.
const char* kReferenceNetworkResponse =
@@ -471,7 +472,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
fetcher->set_url(test_server_url_);
fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::FAILED, -1));
fetcher->set_response_code(200); // should be ignored
- fetcher->SetResponseString(std::string());
+ fetcher->SetResponseString("");
fetcher->delegate()->OnURLFetchComplete(fetcher);
// Error means we now no longer have a fix.
diff --git a/content/browser/geolocation/wifi_data_provider_linux.cc b/content/browser/geolocation/wifi_data_provider_linux.cc
index c8d68ac..709063a 100644
--- a/content/browser/geolocation/wifi_data_provider_linux.cc
+++ b/content/browser/geolocation/wifi_data_provider_linux.cc
@@ -270,7 +270,7 @@ bool NetworkManagerWlanApi::GetAccessPointsForAdapter(
continue;
}
- ReplaceSubstringsAfterOffset(&mac, 0U, ":", std::string());
+ ReplaceSubstringsAfterOffset(&mac, 0U, ":", "");
std::vector<uint8> mac_bytes;
if (!base::HexStringToBytes(mac, &mac_bytes) || mac_bytes.size() != 6) {
LOG(WARNING) << "Can't parse mac address (found " << mac_bytes.size()
diff --git a/content/browser/gpu/gpu_control_list.cc b/content/browser/gpu/gpu_control_list.cc
index 0fba7c8..3592505 100644
--- a/content/browser/gpu/gpu_control_list.cc
+++ b/content/browser/gpu/gpu_control_list.cc
@@ -217,8 +217,8 @@ GpuControlList::OsInfo::OsInfo(const std::string& os,
const std::string& version_string2) {
type_ = StringToOsType(os);
if (type_ != kOsUnknown) {
- version_info_.reset(new VersionInfo(
- version_op, std::string(), version_string, version_string2));
+ version_info_.reset(
+ new VersionInfo(version_op, "", version_string, version_string2));
}
}
@@ -265,8 +265,8 @@ GpuControlList::MachineModelInfo::MachineModelInfo(
const std::string& version_string,
const std::string& version_string2) {
name_info_.reset(new StringInfo(name_op, name_value));
- version_info_.reset(new VersionInfo(
- version_op, std::string(), version_string, version_string2));
+ version_info_.reset(
+ new VersionInfo(version_op, "", version_string, version_string2));
}
GpuControlList::MachineModelInfo::~MachineModelInfo() {}
@@ -864,7 +864,7 @@ bool GpuControlList::GpuControlListEntry::SetDriverDateInfo(
const std::string& date_string,
const std::string& date_string2) {
driver_date_info_.reset(
- new VersionInfo(date_op, std::string(), date_string, date_string2));
+ new VersionInfo(date_op, "", date_string, date_string2));
return driver_date_info_->IsValid();
}
@@ -1348,8 +1348,8 @@ GpuControlList::IsEntrySupportedByCurrentBrowserVersion(
browser_version_value->GetString("number", &version_string);
browser_version_value->GetString("number2", &version_string2);
scoped_ptr<VersionInfo> browser_version_info;
- browser_version_info.reset(new VersionInfo(
- version_op, std::string(), version_string, version_string2));
+ browser_version_info.reset(
+ new VersionInfo(version_op, "", version_string, version_string2));
if (!browser_version_info->IsValid())
return kMalformed;
if (browser_version_info->Contains(browser_version_))
diff --git a/content/browser/gpu/gpu_control_list_machine_model_info_unittest.cc b/content/browser/gpu/gpu_control_list_machine_model_info_unittest.cc
index 8d00a33..b8c3b1f 100644
--- a/content/browser/gpu/gpu_control_list_machine_model_info_unittest.cc
+++ b/content/browser/gpu/gpu_control_list_machine_model_info_unittest.cc
@@ -47,7 +47,8 @@ TEST_F(MachineModelInfoTest, ValidModelInfo) {
}
TEST_F(MachineModelInfoTest, ModelComparison) {
- MachineModelInfo info("=", "model_a", ">", "3.4", std::string());
+ MachineModelInfo info("=", "model_a",
+ ">", "3.4", "");
EXPECT_TRUE(info.Contains("model_a", "4"));
EXPECT_FALSE(info.Contains("model_b", "4"));
EXPECT_FALSE(info.Contains("model_a", "3.2"));
diff --git a/content/browser/gpu/gpu_control_list_number_info_unittest.cc b/content/browser/gpu/gpu_control_list_number_info_unittest.cc
index 0cb72a7..f4e0ba6 100644
--- a/content/browser/gpu/gpu_control_list_number_info_unittest.cc
+++ b/content/browser/gpu/gpu_control_list_number_info_unittest.cc
@@ -46,7 +46,7 @@ TEST_F(NumberInfoTest, ValidFloatInfo) {
"-2.14",
};
for (size_t i = 0; i < arraysize(value); ++i) {
- FloatInfo info("=", value[i], std::string());
+ FloatInfo info("=", value[i], "");
EXPECT_TRUE(info.IsValid());
}
}
@@ -60,11 +60,11 @@ TEST_F(NumberInfoTest, InvalidFloatInfo) {
">=",
};
for (size_t i = 0; i < arraysize(op); ++i) {
- FloatInfo info(op[i], std::string(), std::string());
+ FloatInfo info(op[i], "", "");
EXPECT_FALSE(info.IsValid());
}
{
- FloatInfo info("between", "3.14", std::string());
+ FloatInfo info("between", "3.14", "");
EXPECT_FALSE(info.IsValid());
}
const std::string value[] = {
@@ -75,33 +75,33 @@ TEST_F(NumberInfoTest, InvalidFloatInfo) {
"- 2.14",
};
for (size_t i = 0; i < arraysize(value); ++i) {
- FloatInfo info("=", value[i], std::string());
+ FloatInfo info("=", value[i], "");
EXPECT_FALSE(info.IsValid());
}
}
TEST_F(NumberInfoTest, FloatComparison) {
{
- FloatInfo info("=", "3.14", std::string());
+ FloatInfo info("=", "3.14", "");
EXPECT_TRUE(info.Contains(3.14f));
EXPECT_TRUE(info.Contains(3.1400f));
EXPECT_FALSE(info.Contains(3.1f));
EXPECT_FALSE(info.Contains(3));
}
{
- FloatInfo info(">", "3.14", std::string());
+ FloatInfo info(">", "3.14", "");
EXPECT_FALSE(info.Contains(3.14f));
EXPECT_TRUE(info.Contains(3.141f));
EXPECT_FALSE(info.Contains(3.1f));
}
{
- FloatInfo info("<=", "3.14", std::string());
+ FloatInfo info("<=", "3.14", "");
EXPECT_TRUE(info.Contains(3.14f));
EXPECT_FALSE(info.Contains(3.141f));
EXPECT_TRUE(info.Contains(3.1f));
}
{
- FloatInfo info("any", std::string(), std::string());
+ FloatInfo info("any", "", "");
EXPECT_TRUE(info.Contains(3.14f));
}
{
@@ -140,7 +140,7 @@ TEST_F(NumberInfoTest, ValidIntInfo) {
"-12",
};
for (size_t i = 0; i < arraysize(value); ++i) {
- IntInfo info("=", value[i], std::string());
+ IntInfo info("=", value[i], "");
EXPECT_TRUE(info.IsValid());
}
}
@@ -154,11 +154,11 @@ TEST_F(NumberInfoTest, InvalidIntInfo) {
">=",
};
for (size_t i = 0; i < arraysize(op); ++i) {
- IntInfo info(op[i], std::string(), std::string());
+ IntInfo info(op[i], "", "");
EXPECT_FALSE(info.IsValid());
}
{
- IntInfo info("between", "3", std::string());
+ IntInfo info("between", "3", "");
EXPECT_FALSE(info.IsValid());
}
const std::string value[] = {
@@ -169,31 +169,31 @@ TEST_F(NumberInfoTest, InvalidIntInfo) {
"3.14"
};
for (size_t i = 0; i < arraysize(value); ++i) {
- IntInfo info("=", value[i], std::string());
+ IntInfo info("=", value[i], "");
EXPECT_FALSE(info.IsValid());
}
}
TEST_F(NumberInfoTest, IntComparison) {
{
- IntInfo info("=", "3", std::string());
+ IntInfo info("=", "3", "");
EXPECT_TRUE(info.Contains(3));
EXPECT_FALSE(info.Contains(4));
}
{
- IntInfo info(">", "3", std::string());
+ IntInfo info(">", "3", "");
EXPECT_FALSE(info.Contains(2));
EXPECT_FALSE(info.Contains(3));
EXPECT_TRUE(info.Contains(4));
}
{
- IntInfo info("<=", "3", std::string());
+ IntInfo info("<=", "3", "");
EXPECT_TRUE(info.Contains(2));
EXPECT_TRUE(info.Contains(3));
EXPECT_FALSE(info.Contains(4));
}
{
- IntInfo info("any", std::string(), std::string());
+ IntInfo info("any", "", "");
EXPECT_TRUE(info.Contains(3));
}
{
diff --git a/content/browser/gpu/gpu_control_list_os_info_unittest.cc b/content/browser/gpu/gpu_control_list_os_info_unittest.cc
index 5ea03b2..8aefb03 100644
--- a/content/browser/gpu/gpu_control_list_os_info_unittest.cc
+++ b/content/browser/gpu/gpu_control_list_os_info_unittest.cc
@@ -33,12 +33,12 @@ TEST_F(OsInfoTest, ValidOsInfo) {
GpuControlList::kOsAny
};
for (size_t i = 0; i < arraysize(os); ++i) {
- OsInfo info(os[i], "=", "10.6", std::string());
+ OsInfo info(os[i], "=", "10.6", "");
EXPECT_TRUE(info.IsValid());
EXPECT_EQ(os_type[i], info.type());
}
{
- OsInfo info("any", "any", std::string(), std::string());
+ OsInfo info("any", "any", "", "");
EXPECT_TRUE(info.IsValid());
}
}
@@ -54,15 +54,15 @@ TEST_F(OsInfoTest, InvalidOsInfo) {
};
for (size_t i = 0; i < arraysize(os); ++i) {
{
- OsInfo info(os[i], std::string(), std::string(), std::string());
+ OsInfo info(os[i], "", "", "");
EXPECT_FALSE(info.IsValid());
}
{
- OsInfo info(os[i], "=", std::string(), std::string());
+ OsInfo info(os[i], "=", "", "");
EXPECT_FALSE(info.IsValid());
}
{
- OsInfo info(os[i], std::string(), "10.6", std::string());
+ OsInfo info(os[i], "", "10.6", "");
EXPECT_FALSE(info.IsValid());
}
}
@@ -74,32 +74,34 @@ TEST_F(OsInfoTest, InvalidOsInfo) {
"Android",
};
for (size_t i = 0; i < arraysize(os_cap); ++i) {
- OsInfo info(os_cap[i], "=", "10.6", std::string());
+ OsInfo info(os_cap[i], "=", "10.6", "");
EXPECT_FALSE(info.IsValid());
}
}
TEST_F(OsInfoTest, OsComparison) {
{
- OsInfo info("any", "any", std::string(), std::string());
+ OsInfo info("any", "any", "", "");
const GpuControlList::OsType os_type[] = {
- GpuControlList::kOsWin, GpuControlList::kOsLinux,
- GpuControlList::kOsMacosx, GpuControlList::kOsChromeOS,
+ GpuControlList::kOsWin,
+ GpuControlList::kOsLinux,
+ GpuControlList::kOsMacosx,
+ GpuControlList::kOsChromeOS,
GpuControlList::kOsAndroid,
};
for (size_t i = 0; i < arraysize(os_type); ++i) {
- EXPECT_TRUE(info.Contains(os_type[i], std::string()));
+ EXPECT_TRUE(info.Contains(os_type[i], ""));
EXPECT_TRUE(info.Contains(os_type[i], "7.8"));
}
}
{
- OsInfo info("win", ">=", "6", std::string());
+ OsInfo info("win", ">=", "6", "");
EXPECT_FALSE(info.Contains(GpuControlList::kOsMacosx, "10.8.3"));
EXPECT_FALSE(info.Contains(GpuControlList::kOsLinux, "10"));
EXPECT_FALSE(info.Contains(GpuControlList::kOsChromeOS, "13"));
EXPECT_FALSE(info.Contains(GpuControlList::kOsAndroid, "7"));
EXPECT_FALSE(info.Contains(GpuControlList::kOsAny, "7"));
- EXPECT_FALSE(info.Contains(GpuControlList::kOsWin, std::string()));
+ EXPECT_FALSE(info.Contains(GpuControlList::kOsWin, ""));
EXPECT_TRUE(info.Contains(GpuControlList::kOsWin, "6"));
EXPECT_TRUE(info.Contains(GpuControlList::kOsWin, "6.1"));
EXPECT_TRUE(info.Contains(GpuControlList::kOsWin, "7"));
diff --git a/content/browser/gpu/gpu_control_list_string_info_unittest.cc b/content/browser/gpu/gpu_control_list_string_info_unittest.cc
index c2c8009..43bb952 100644
--- a/content/browser/gpu/gpu_control_list_string_info_unittest.cc
+++ b/content/browser/gpu/gpu_control_list_string_info_unittest.cc
@@ -24,7 +24,7 @@ TEST_F(StringInfoTest, ValidStringInfo) {
};
for (size_t i = 0; i < arraysize(op); ++i) {
{
- StringInfo info(op[i], std::string());
+ StringInfo info(op[i], "");
EXPECT_TRUE(info.IsValid());
}
{
diff --git a/content/browser/gpu/gpu_control_list_version_info_unittest.cc b/content/browser/gpu/gpu_control_list_version_info_unittest.cc
index eb18648..f05d71c 100644
--- a/content/browser/gpu/gpu_control_list_version_info_unittest.cc
+++ b/content/browser/gpu/gpu_control_list_version_info_unittest.cc
@@ -32,7 +32,7 @@ TEST_F(VersionInfoTest, ValidVersionInfo) {
string1 = "8.9";
if (op[i] == "between")
string2 = "9.0";
- VersionInfo info(op[i], std::string(), string1, string2);
+ VersionInfo info(op[i], "", string1, string2);
EXPECT_TRUE(info.IsValid());
}
@@ -42,7 +42,7 @@ TEST_F(VersionInfoTest, ValidVersionInfo) {
"" // Default, same as "numerical"
};
for (size_t i =0; i < arraysize(style); ++i) {
- VersionInfo info("=", style[i], "8.9", std::string());
+ VersionInfo info("=", style[i], "8.9", "");
EXPECT_TRUE(info.IsValid());
if (style[i] == "lexical")
EXPECT_TRUE(info.IsLexical());
@@ -65,7 +65,7 @@ TEST_F(VersionInfoTest, ValidVersionInfo) {
"10. 9",
};
for (size_t i =0; i < arraysize(number); ++i) {
- VersionInfo info("=", std::string(), number[i], std::string());
+ VersionInfo info("=", "", number[i], "");
EXPECT_TRUE(info.IsValid());
}
}
@@ -82,21 +82,21 @@ TEST_F(VersionInfoTest, InvalidVersionInfo) {
};
for (size_t i = 0; i < arraysize(op); ++i) {
{
- VersionInfo info(op[i], std::string(), "8.9", std::string());
+ VersionInfo info(op[i], "", "8.9", "");
if (op[i] == "between")
EXPECT_FALSE(info.IsValid());
else
EXPECT_TRUE(info.IsValid());
}
{
- VersionInfo info(op[i], std::string(), std::string(), std::string());
+ VersionInfo info(op[i], "", "", "");
if (op[i] == "any")
EXPECT_TRUE(info.IsValid());
else
EXPECT_FALSE(info.IsValid());
}
{
- VersionInfo info(op[i], std::string(), "8.9", "9.0");
+ VersionInfo info(op[i], "", "8.9", "9.0");
EXPECT_TRUE(info.IsValid());
}
}
@@ -106,34 +106,34 @@ TEST_F(VersionInfoTest, InvalidVersionInfo) {
"8-9",
};
for (size_t i = 0; i < arraysize(number); ++i) {
- VersionInfo info("=", std::string(), number[i], std::string());
+ VersionInfo info("=", "", number[i], "");
EXPECT_FALSE(info.IsValid());
}
}
TEST_F(VersionInfoTest, VersionComparison) {
{
- VersionInfo info("any", std::string(), std::string(), std::string());
+ VersionInfo info("any", "", "", "");
EXPECT_TRUE(info.Contains("0"));
EXPECT_TRUE(info.Contains("8.9"));
EXPECT_TRUE(info.Contains("100"));
}
{
- VersionInfo info(">", std::string(), "8.9", std::string());
+ VersionInfo info(">", "", "8.9", "");
EXPECT_FALSE(info.Contains("7"));
EXPECT_FALSE(info.Contains("8.9"));
EXPECT_FALSE(info.Contains("8.9.1"));
EXPECT_TRUE(info.Contains("9"));
}
{
- VersionInfo info(">=", std::string(), "8.9", std::string());
+ VersionInfo info(">=", "", "8.9", "");
EXPECT_FALSE(info.Contains("7"));
EXPECT_TRUE(info.Contains("8.9"));
EXPECT_TRUE(info.Contains("8.9.1"));
EXPECT_TRUE(info.Contains("9"));
}
{
- VersionInfo info("=", std::string(), "8.9", std::string());
+ VersionInfo info("=", "", "8.9", "");
EXPECT_FALSE(info.Contains("7"));
EXPECT_TRUE(info.Contains("8"));
EXPECT_TRUE(info.Contains("8.9"));
@@ -141,7 +141,7 @@ TEST_F(VersionInfoTest, VersionComparison) {
EXPECT_FALSE(info.Contains("9"));
}
{
- VersionInfo info("<", std::string(), "8.9", std::string());
+ VersionInfo info("<", "", "8.9", "");
EXPECT_TRUE(info.Contains("7"));
EXPECT_TRUE(info.Contains("8.8"));
EXPECT_FALSE(info.Contains("8"));
@@ -150,7 +150,7 @@ TEST_F(VersionInfoTest, VersionComparison) {
EXPECT_FALSE(info.Contains("9"));
}
{
- VersionInfo info("<=", std::string(), "8.9", std::string());
+ VersionInfo info("<=", "", "8.9", "");
EXPECT_TRUE(info.Contains("7"));
EXPECT_TRUE(info.Contains("8.8"));
EXPECT_TRUE(info.Contains("8"));
@@ -159,7 +159,7 @@ TEST_F(VersionInfoTest, VersionComparison) {
EXPECT_FALSE(info.Contains("9"));
}
{
- VersionInfo info("between", std::string(), "8.9", "9.1");
+ VersionInfo info("between", "", "8.9", "9.1");
EXPECT_FALSE(info.Contains("7"));
EXPECT_FALSE(info.Contains("8.8"));
EXPECT_TRUE(info.Contains("8"));
@@ -177,14 +177,14 @@ TEST_F(VersionInfoTest, DateComparison) {
// When we use '-' as splitter, we assume a format of mm-dd-yyyy
// or mm-yyyy, i.e., a date.
{
- VersionInfo info("=", std::string(), "1976.3.21", std::string());
+ VersionInfo info("=", "", "1976.3.21", "");
EXPECT_TRUE(info.Contains("3-21-1976", '-'));
EXPECT_TRUE(info.Contains("3-1976", '-'));
EXPECT_TRUE(info.Contains("03-1976", '-'));
EXPECT_FALSE(info.Contains("21-3-1976", '-'));
}
{
- VersionInfo info(">", std::string(), "1976.3.21", std::string());
+ VersionInfo info(">", "", "1976.3.21", "");
EXPECT_TRUE(info.Contains("3-22-1976", '-'));
EXPECT_TRUE(info.Contains("4-1976", '-'));
EXPECT_TRUE(info.Contains("04-1976", '-'));
@@ -192,7 +192,7 @@ TEST_F(VersionInfoTest, DateComparison) {
EXPECT_FALSE(info.Contains("2-1976", '-'));
}
{
- VersionInfo info("between", std::string(), "1976.3.21", "2012.12.25");
+ VersionInfo info("between", "", "1976.3.21", "2012.12.25");
EXPECT_FALSE(info.Contains("3-20-1976", '-'));
EXPECT_TRUE(info.Contains("3-21-1976", '-'));
EXPECT_TRUE(info.Contains("3-22-1976", '-'));
@@ -215,7 +215,7 @@ TEST_F(VersionInfoTest, LexicalComparison) {
// When we use lexical style, we assume a format major.minor.*.
// We apply numerical comparison to major, lexical comparison to others.
{
- VersionInfo info("<", "lexical", "8.201", std::string());
+ VersionInfo info("<", "lexical", "8.201", "");
EXPECT_TRUE(info.Contains("8.001.100"));
EXPECT_TRUE(info.Contains("8.109"));
EXPECT_TRUE(info.Contains("8.10900"));
@@ -234,7 +234,7 @@ TEST_F(VersionInfoTest, LexicalComparison) {
EXPECT_FALSE(info.Contains("12.201"));
}
{
- VersionInfo info("<", "lexical", "9.002", std::string());
+ VersionInfo info("<", "lexical", "9.002", "");
EXPECT_TRUE(info.Contains("8.001.100"));
EXPECT_TRUE(info.Contains("8.109"));
EXPECT_TRUE(info.Contains("8.10900"));
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index 467cc21..675222b 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -117,7 +117,7 @@ void GpuDataManagerImpl::InitializeForTesting(
// This function is for testing only, so disable histograms.
update_histograms_ = false;
- InitializeImpl(gpu_blacklist_json, std::string(), std::string(), gpu_info);
+ InitializeImpl(gpu_blacklist_json, "", "", gpu_info);
}
bool GpuDataManagerImpl::IsFeatureBlacklisted(int feature) const {
@@ -350,7 +350,7 @@ void GpuDataManagerImpl::UpdateGpuInfo(const GPUInfo& gpu_info) {
if (gpu_blacklist_.get()) {
std::set<int> features = gpu_blacklist_->MakeDecision(
- GpuControlList::kOsAny, std::string(), my_gpu_info);
+ GpuControlList::kOsAny, "", my_gpu_info);
if (update_histograms_)
UpdateStats(gpu_blacklist_.get(), features);
@@ -358,7 +358,7 @@ void GpuDataManagerImpl::UpdateGpuInfo(const GPUInfo& gpu_info) {
}
if (gpu_switching_list_.get()) {
std::set<int> option = gpu_switching_list_->MakeDecision(
- GpuControlList::kOsAny, std::string(), my_gpu_info);
+ GpuControlList::kOsAny, "", my_gpu_info);
if (option.size() == 1) {
// Blacklist decision should not overwrite commandline switch from users.
CommandLine* command_line = CommandLine::ForCurrentProcess();
@@ -368,7 +368,7 @@ void GpuDataManagerImpl::UpdateGpuInfo(const GPUInfo& gpu_info) {
}
if (gpu_driver_bug_list_.get())
gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision(
- GpuControlList::kOsAny, std::string(), my_gpu_info);
+ GpuControlList::kOsAny, "", my_gpu_info);
// We have to update GpuFeatureType before notify all the observers.
NotifyGpuInfoUpdate();
diff --git a/content/browser/gpu/gpu_memory_test.cc b/content/browser/gpu/gpu_memory_test.cc
index 832b947..36584c3 100644
--- a/content/browser/gpu/gpu_memory_test.cc
+++ b/content/browser/gpu/gpu_memory_test.cc
@@ -116,8 +116,12 @@ class GpuMemoryTest : public ContentBrowserTest {
js_call << mb_to_use;
js_call << ");";
std::string message;
- ASSERT_TRUE(ExecuteScriptInFrameAndExtractString(
- tab_to_load->web_contents(), std::string(), js_call.str(), &message));
+ ASSERT_TRUE(
+ ExecuteScriptInFrameAndExtractString(
+ tab_to_load->web_contents(),
+ "",
+ js_call.str(),
+ &message));
EXPECT_EQ("DONE_USE_GPU_MEMORY", message);
}
@@ -192,8 +196,12 @@ class GpuMemoryTest : public ContentBrowserTest {
" domAutomationController.send(\"DONE_RAF\");"
"})");
std::string message;
- ASSERT_TRUE(ExecuteScriptInFrameAndExtractString(
- (*it)->web_contents(), std::string(), js_call, &message));
+ ASSERT_TRUE(
+ ExecuteScriptInFrameAndExtractString(
+ (*it)->web_contents(),
+ "",
+ js_call,
+ &message));
EXPECT_EQ("DONE_RAF", message);
}
// TODO(ccameron): send an IPC from Browser -> Renderer (delay it until
diff --git a/content/browser/gpu/gpu_pixel_browsertest.cc b/content/browser/gpu/gpu_pixel_browsertest.cc
index 758d2b4..e146a08 100644
--- a/content/browser/gpu/gpu_pixel_browsertest.cc
+++ b/content/browser/gpu/gpu_pixel_browsertest.cc
@@ -147,7 +147,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest {
"DISABLED_", "FLAKY_", "FAILS_", "MANUAL_"};
for (size_t i = 0; i < arraysize(test_status_prefixes); ++i) {
ReplaceFirstSubstringAfterOffset(
- &test_name_, 0, test_status_prefixes[i], std::string());
+ &test_name_, 0, test_status_prefixes[i], "");
}
ui::DisableTestCompositor();
diff --git a/content/browser/media/media_internals_unittest.cc b/content/browser/media/media_internals_unittest.cc
index 591a287..0db2580 100644
--- a/content/browser/media/media_internals_unittest.cc
+++ b/content/browser/media/media_internals_unittest.cc
@@ -41,7 +41,7 @@ class MediaInternalsTest : public testing::Test {
void UpdateItem(const std::string& item, const std::string& property,
base::Value* value) {
- internals_->UpdateItem(std::string(), item, property, value);
+ internals_->UpdateItem("", item, property, value);
}
void SendUpdate(const std::string& function, base::Value* value) {
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc
index a800ec2..4ae318a 100644
--- a/content/browser/plugin_service_impl.cc
+++ b/content/browser/plugin_service_impl.cc
@@ -178,7 +178,7 @@ void PluginServiceImpl::Init() {
if (command_line->HasSwitch(switches::kSitePerProcess)) {
webkit::WebPluginInfo webview_plugin(
ASCIIToUTF16("WebView Tag"),
- base::FilePath(),
+ base::FilePath(FILE_PATH_LITERAL("")),
ASCIIToUTF16("1.2.3.4"),
ASCIIToUTF16("Browser Plugin."));
webview_plugin.type = webkit::WebPluginInfo::PLUGIN_TYPE_NPAPI;
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 9956326..a315130 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -317,7 +317,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
#if defined(OS_POSIX)
bool use_zygote = !is_broker_ && plugin_launcher.empty() && info.is_sandboxed;
if (!info.is_sandboxed)
- cmd_line->AppendSwitchASCII(switches::kNoSandbox, std::string());
+ cmd_line->AppendSwitchASCII(switches::kNoSandbox, "");
#endif // OS_POSIX
process_->Launch(
#if defined(OS_WIN)
diff --git a/content/browser/renderer_host/gtk_key_bindings_handler.cc b/content/browser/renderer_host/gtk_key_bindings_handler.cc
index e86ea60..756bcc3 100644
--- a/content/browser/renderer_host/gtk_key_bindings_handler.cc
+++ b/content/browser/renderer_host/gtk_key_bindings_handler.cc
@@ -132,16 +132,15 @@ GtkKeyBindingsHandler* GtkKeyBindingsHandler::GetHandlerOwner(
}
void GtkKeyBindingsHandler::BackSpace(GtkTextView* text_view) {
- GetHandlerOwner(text_view)
- ->EditCommandMatched("DeleteBackward", std::string());
+ GetHandlerOwner(text_view)->EditCommandMatched("DeleteBackward", "");
}
void GtkKeyBindingsHandler::CopyClipboard(GtkTextView* text_view) {
- GetHandlerOwner(text_view)->EditCommandMatched("Copy", std::string());
+ GetHandlerOwner(text_view)->EditCommandMatched("Copy", "");
}
void GtkKeyBindingsHandler::CutClipboard(GtkTextView* text_view) {
- GetHandlerOwner(text_view)->EditCommandMatched("Cut", std::string());
+ GetHandlerOwner(text_view)->EditCommandMatched("Cut", "");
}
void GtkKeyBindingsHandler::DeleteFromCursor(
@@ -192,7 +191,7 @@ void GtkKeyBindingsHandler::DeleteFromCursor(
count = -count;
for (; count > 0; --count) {
for (const char* const* p = commands; *p; ++p)
- owner->EditCommandMatched(*p, std::string());
+ owner->EditCommandMatched(*p, "");
}
}
@@ -248,7 +247,7 @@ void GtkKeyBindingsHandler::MoveCursor(
if (count < 0)
count = -count;
for (; count > 0; --count)
- owner->EditCommandMatched(command, std::string());
+ owner->EditCommandMatched(command, "");
}
void GtkKeyBindingsHandler::MoveViewport(
@@ -257,18 +256,18 @@ void GtkKeyBindingsHandler::MoveViewport(
}
void GtkKeyBindingsHandler::PasteClipboard(GtkTextView* text_view) {
- GetHandlerOwner(text_view)->EditCommandMatched("Paste", std::string());
+ GetHandlerOwner(text_view)->EditCommandMatched("Paste", "");
}
void GtkKeyBindingsHandler::SelectAll(GtkTextView* text_view, gboolean select) {
if (select)
- GetHandlerOwner(text_view)->EditCommandMatched("SelectAll", std::string());
+ GetHandlerOwner(text_view)->EditCommandMatched("SelectAll", "");
else
- GetHandlerOwner(text_view)->EditCommandMatched("Unselect", std::string());
+ GetHandlerOwner(text_view)->EditCommandMatched("Unselect", "");
}
void GtkKeyBindingsHandler::SetAnchor(GtkTextView* text_view) {
- GetHandlerOwner(text_view)->EditCommandMatched("SetMark", std::string());
+ GetHandlerOwner(text_view)->EditCommandMatched("SetMark", "");
}
void GtkKeyBindingsHandler::ToggleCursorVisible(GtkTextView* text_view) {
diff --git a/content/browser/renderer_host/pepper/pepper_host_resolver_private_message_filter.cc b/content/browser/renderer_host/pepper/pepper_host_resolver_private_message_filter.cc
index e4bb14c..d42cb56 100644
--- a/content/browser/renderer_host/pepper/pepper_host_resolver_private_message_filter.cc
+++ b/content/browser/renderer_host/pepper/pepper_host_resolver_private_message_filter.cc
@@ -122,9 +122,9 @@ int32_t PepperHostResolverPrivateMessageFilter::OnMsgResolve(
// Check plugin permissions.
SocketPermissionRequest request(
- content::SocketPermissionRequest::NONE, std::string(), 0);
- RenderViewHost* render_view_host =
- RenderViewHost::FromID(render_process_id_, render_view_id_);
+ content::SocketPermissionRequest::NONE, "", 0);
+ RenderViewHost* render_view_host = RenderViewHost::FromID(render_process_id_,
+ render_view_id_);
if (!render_view_host ||
!pepper_socket_utils::CanUseSocketAPIs(external_plugin_,
request,
diff --git a/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.cc b/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.cc
index 4799d66..08384e78 100644
--- a/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.cc
+++ b/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.cc
@@ -380,9 +380,7 @@ void PepperUDPSocketPrivateMessageFilter::SendBindError(
void PepperUDPSocketPrivateMessageFilter::SendRecvFromError(
const ppapi::host::ReplyMessageContext& context,
int32_t result) {
- SendRecvFromReply(context,
- result,
- std::string(),
+ SendRecvFromReply(context, result, "",
NetAddressPrivateImpl::kInvalidNetAddress);
}
diff --git a/content/browser/renderer_host/render_sandbox_host_linux.cc b/content/browser/renderer_host/render_sandbox_host_linux.cc
index 78eba83..0cc3638 100644
--- a/content/browser/renderer_host/render_sandbox_host_linux.cc
+++ b/content/browser/renderer_host/render_sandbox_host_linux.cc
@@ -278,7 +278,7 @@ class SandboxIPCProcess {
if (family.name.data()) {
reply.WriteString(family.name.data());
} else {
- reply.WriteString(std::string());
+ reply.WriteString("");
}
reply.WriteBool(family.isBold);
reply.WriteBool(family.isItalic);
diff --git a/content/browser/speech/google_one_shot_remote_engine_unittest.cc b/content/browser/speech/google_one_shot_remote_engine_unittest.cc
index 694e246..efcf84f 100644
--- a/content/browser/speech/google_one_shot_remote_engine_unittest.cc
+++ b/content/browser/speech/google_one_shot_remote_engine_unittest.cc
@@ -104,7 +104,7 @@ TEST_F(GoogleOneShotRemoteEngineTest, BasicTest) {
EXPECT_EQ(0U, result().hypotheses.size());
// Http failure case.
- CreateAndTestRequest(false, std::string());
+ CreateAndTestRequest(false, "");
EXPECT_EQ(error_, SPEECH_RECOGNITION_ERROR_NETWORK);
EXPECT_EQ(0U, result().hypotheses.size());
diff --git a/content/browser/speech/speech_recognition_manager_impl.cc b/content/browser/speech/speech_recognition_manager_impl.cc
index 2dc6cf8..8f9c3e1 100644
--- a/content/browser/speech/speech_recognition_manager_impl.cc
+++ b/content/browser/speech/speech_recognition_manager_impl.cc
@@ -100,8 +100,7 @@ int SpeechRecognitionManagerImpl::CreateSession(
remote_engine_config.interim_results = config.interim_results;
remote_engine_config.max_hypotheses = config.max_hypotheses;
remote_engine_config.hardware_info = hardware_info;
- remote_engine_config.origin_url =
- can_report_metrics ? config.origin_url : std::string();
+ remote_engine_config.origin_url = can_report_metrics ? config.origin_url : "";
SpeechRecognitionEngine* google_remote_engine;
if (config.is_legacy_api) {
diff --git a/content/browser/speech/speech_recognizer_unittest.cc b/content/browser/speech/speech_recognizer_unittest.cc
index 4c061c2..2cc4db3 100644
--- a/content/browser/speech/speech_recognizer_unittest.cc
+++ b/content/browser/speech/speech_recognizer_unittest.cc
@@ -305,7 +305,7 @@ TEST_F(SpeechRecognizerTest, ConnectionError) {
status.set_error(net::ERR_CONNECTION_REFUSED);
fetcher->set_status(status);
fetcher->set_response_code(0);
- fetcher->SetResponseString(std::string());
+ fetcher->SetResponseString("");
fetcher->delegate()->OnURLFetchComplete(fetcher);
MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(recognition_ended_);
diff --git a/content/browser/storage_partition_impl_map_unittest.cc b/content/browser/storage_partition_impl_map_unittest.cc
index 04127cc..1c44fcc 100644
--- a/content/browser/storage_partition_impl_map_unittest.cc
+++ b/content/browser/storage_partition_impl_map_unittest.cc
@@ -13,18 +13,13 @@ class StoragePartitionConfigTest : public testing::Test {
// Test that the Less comparison function is implemented properly to uniquely
// identify storage partitions used as keys in a std::map.
TEST_F(StoragePartitionConfigTest, OperatorLess) {
- StoragePartitionImplMap::StoragePartitionConfig c1(
- std::string(), std::string(), false);
- StoragePartitionImplMap::StoragePartitionConfig c2(
- std::string(), std::string(), false);
- StoragePartitionImplMap::StoragePartitionConfig c3(
- std::string(), std::string(), true);
- StoragePartitionImplMap::StoragePartitionConfig c4("a", std::string(), true);
- StoragePartitionImplMap::StoragePartitionConfig c5("b", std::string(), true);
- StoragePartitionImplMap::StoragePartitionConfig c6(
- std::string(), "abc", false);
- StoragePartitionImplMap::StoragePartitionConfig c7(
- std::string(), "abc", true);
+ StoragePartitionImplMap::StoragePartitionConfig c1("", "", false);
+ StoragePartitionImplMap::StoragePartitionConfig c2("", "", false);
+ StoragePartitionImplMap::StoragePartitionConfig c3("", "", true);
+ StoragePartitionImplMap::StoragePartitionConfig c4("a", "", true);
+ StoragePartitionImplMap::StoragePartitionConfig c5("b", "", true);
+ StoragePartitionImplMap::StoragePartitionConfig c6("", "abc", false);
+ StoragePartitionImplMap::StoragePartitionConfig c7("", "abc", true);
StoragePartitionImplMap::StoragePartitionConfig c8("a", "abc", false);
StoragePartitionImplMap::StoragePartitionConfig c9("a", "abc", true);
diff --git a/content/browser/streams/stream_url_request_job_unittest.cc b/content/browser/streams/stream_url_request_job_unittest.cc
index bed96fa..10a02c9 100644
--- a/content/browser/streams/stream_url_request_job_unittest.cc
+++ b/content/browser/streams/stream_url_request_job_unittest.cc
@@ -169,7 +169,7 @@ TEST_F(StreamURLRequestJobTest, TestInvalidRangeDataRequest) {
net::HttpRequestHeaders extra_headers;
extra_headers.SetHeader(net::HttpRequestHeaders::kRange, "bytes=1-3");
- TestRequest("GET", kStreamURL, extra_headers, 405, std::string());
+ TestRequest("GET", kStreamURL, extra_headers, 405, "");
}
} // namespace content
diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc
index 40bbee3..aa2e529 100644
--- a/content/browser/tracing/tracing_ui.cc
+++ b/content/browser/tracing/tracing_ui.cc
@@ -317,11 +317,8 @@ void TracingMessageHandler::OnLoadTraceFile(const base::ListValue* list) {
ui::SelectFileDialog::SELECT_OPEN_FILE,
string16(),
base::FilePath(),
- NULL,
- 0,
- base::FilePath::StringType(),
- web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(),
- NULL);
+ NULL, 0, FILE_PATH_LITERAL(""),
+ web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL);
}
void TracingMessageHandler::LoadTraceFileComplete(string16* contents) {
@@ -370,11 +367,8 @@ void TracingMessageHandler::OnSaveTraceFile(const base::ListValue* list) {
ui::SelectFileDialog::SELECT_SAVEAS_FILE,
string16(),
base::FilePath(),
- NULL,
- 0,
- base::FilePath::StringType(),
- web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(),
- NULL);
+ NULL, 0, FILE_PATH_LITERAL(""),
+ web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL);
}
void TracingMessageHandler::SaveTraceFileComplete() {
diff --git a/content/browser/web_contents/navigation_entry_impl_unittest.cc b/content/browser/web_contents/navigation_entry_impl_unittest.cc
index 8bc5de1..00857ed 100644
--- a/content/browser/web_contents/navigation_entry_impl_unittest.cc
+++ b/content/browser/web_contents/navigation_entry_impl_unittest.cc
@@ -61,23 +61,23 @@ TEST_F(NavigationEntryTest, NavigationEntryURLs) {
EXPECT_EQ(GURL(), entry1_->GetURL());
EXPECT_EQ(GURL(), entry1_->GetVirtualURL());
- EXPECT_TRUE(entry1_->GetTitleForDisplay(std::string()).empty());
+ EXPECT_TRUE(entry1_->GetTitleForDisplay("").empty());
// Setting URL affects virtual_url and GetTitleForDisplay
entry1_->SetURL(GURL("http://www.google.com"));
EXPECT_EQ(GURL("http://www.google.com"), entry1_->GetURL());
EXPECT_EQ(GURL("http://www.google.com"), entry1_->GetVirtualURL());
EXPECT_EQ(ASCIIToUTF16("www.google.com"),
- entry1_->GetTitleForDisplay(std::string()));
+ entry1_->GetTitleForDisplay(""));
// file:/// URLs should only show the filename.
entry1_->SetURL(GURL("file:///foo/bar baz.txt"));
EXPECT_EQ(ASCIIToUTF16("bar baz.txt"),
- entry1_->GetTitleForDisplay(std::string()));
+ entry1_->GetTitleForDisplay(""));
// Title affects GetTitleForDisplay
entry1_->SetTitle(ASCIIToUTF16("Google"));
- EXPECT_EQ(ASCIIToUTF16("Google"), entry1_->GetTitleForDisplay(std::string()));
+ EXPECT_EQ(ASCIIToUTF16("Google"), entry1_->GetTitleForDisplay(""));
// Setting virtual_url doesn't affect URL
entry2_->SetVirtualURL(GURL("display:url"));
@@ -86,7 +86,7 @@ TEST_F(NavigationEntryTest, NavigationEntryURLs) {
EXPECT_EQ(GURL("display:url"), entry2_->GetVirtualURL());
// Having a title set in constructor overrides virtual URL
- EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitleForDisplay(std::string()));
+ EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitleForDisplay(""));
// User typed URL is independent of the others
EXPECT_EQ(GURL(), entry1_->GetUserTypedURL());
diff --git a/content/browser/webui/web_ui_data_source_unittest.cc b/content/browser/webui/web_ui_data_source_unittest.cc
index bece8d0..24d1d2b 100644
--- a/content/browser/webui/web_ui_data_source_unittest.cc
+++ b/content/browser/webui/web_ui_data_source_unittest.cc
@@ -141,7 +141,7 @@ TEST_F(WebUIDataSourceTest, NamedResource) {
TEST_F(WebUIDataSourceTest, MimeType) {
const char* html = "text/html";
const char* js = "application/javascript";
- EXPECT_EQ(GetMimeType(std::string()), html);
+ EXPECT_EQ(GetMimeType(""), html);
EXPECT_EQ(GetMimeType("foo"), html);
EXPECT_EQ(GetMimeType("foo.html"), html);
EXPECT_EQ(GetMimeType(".js"), js);
diff --git a/content/browser/worker_host/test/worker_browsertest.cc b/content/browser/worker_host/test/worker_browsertest.cc
index 3e67d7f..1be3007 100644
--- a/content/browser/worker_host/test/worker_browsertest.cc
+++ b/content/browser/worker_host/test/worker_browsertest.cc
@@ -300,11 +300,11 @@ class WorkerTest : public ContentBrowserTest {
};
IN_PROC_BROWSER_TEST_F(WorkerTest, SingleWorker) {
- RunTest("single_worker.html", std::string());
+ RunTest("single_worker.html", "");
}
IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleWorkers) {
- RunTest("multi_worker.html", std::string());
+ RunTest("multi_worker.html", "");
}
IN_PROC_BROWSER_TEST_F(WorkerTest, SingleSharedWorker) {
@@ -320,10 +320,10 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleSharedWorkers) {
// http://crbug.com/30021
IN_PROC_BROWSER_TEST_F(WorkerTest, IncognitoSharedWorkers) {
// Load a non-incognito tab and have it create a shared worker
- RunTest("incognito_worker.html", std::string());
+ RunTest("incognito_worker.html", "");
// Incognito worker should not share with non-incognito
- RunTest(CreateOffTheRecordBrowser(), "incognito_worker.html", std::string());
+ RunTest(CreateOffTheRecordBrowser(), "incognito_worker.html", "");
}
// Make sure that auth dialog is displayed from worker context.
@@ -399,7 +399,7 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, LimitTotal) {
// Flaky, http://crbug.com/59786.
IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerClose) {
- RunTest("worker_close.html", std::string());
+ RunTest("worker_close.html", "");
ASSERT_TRUE(WaitForWorkerProcessCount(0));
}
diff --git a/content/gpu/gpu_info_collector.cc b/content/gpu/gpu_info_collector.cc
index d3f5867..86fb0c5 100644
--- a/content/gpu/gpu_info_collector.cc
+++ b/content/gpu/gpu_info_collector.cc
@@ -53,7 +53,7 @@ std::string GetGLString(unsigned int pname) {
reinterpret_cast<const char*>(glGetString(pname));
if (gl_string)
return std::string(gl_string);
- return std::string();
+ return "";
}
// Return a version string in the format of "major.minor".
@@ -71,7 +71,7 @@ std::string GetVersionFromString(const std::string& version_string) {
if (pieces.size() >= 2)
return pieces[0] + "." + pieces[1];
}
- return std::string();
+ return "";
}
} // namespace anonymous
diff --git a/content/public/test/test_launcher.cc b/content/public/test/test_launcher.cc
index f4635ec..40545d5 100644
--- a/content/public/test/test_launcher.cc
+++ b/content/public/test/test_launcher.cc
@@ -454,7 +454,7 @@ bool RunTests(TestLauncherDelegate* launcher_delegate,
// Split --gtest_filter at '-', if there is one, to separate into
// positive filter and negative filter portions.
std::string positive_filter = filter;
- std::string negative_filter;
+ std::string negative_filter = "";
size_t dash_pos = filter.find('-');
if (dash_pos != std::string::npos) {
positive_filter = filter.substr(0, dash_pos); // Everything up to the dash.
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index 62c973318..9fe3191 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -110,7 +110,7 @@ static std::string PermissionTypeToString(BrowserPluginPermissionType type) {
NOTREACHED();
break;
}
- return std::string();
+ return "";
}
typedef std::map<WebKit::WebPluginContainer*,
@@ -227,7 +227,7 @@ void BrowserPlugin::RemoveDOMAttribute(const std::string& attribute_name) {
std::string BrowserPlugin::GetDOMAttributeValue(
const std::string& attribute_name) const {
if (!container())
- return std::string();
+ return "";
return container()->element().getAttribute(
WebKit::WebString::fromUTF8(attribute_name)).utf8();
diff --git a/content/renderer/date_time_formatter.cc b/content/renderer/date_time_formatter.cc
index 1adb0de..d3c16e3 100644
--- a/content/renderer/date_time_formatter.cc
+++ b/content/renderer/date_time_formatter.cc
@@ -95,7 +95,7 @@ const std::string DateTimeFormatter::FormatString() const {
UErrorCode success = U_ZERO_ERROR;
if (year_ == 0 && month_ == 0 && day_ == 0 &&
hour_ == 0 && minute_ == 0 && second_ == 0) {
- return std::string();
+ return "";
}
std::string result;
@@ -113,7 +113,7 @@ const std::string DateTimeFormatter::FormatString() const {
return result;
}
LOG(WARNING) << "Calendar not created: error " << success;
- return std::string();
+ return "";
}
void DateTimeFormatter::ExtractType(
diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc
index f2656c0..af3177f 100644
--- a/content/renderer/media/mock_media_stream_dependency_factory.cc
+++ b/content/renderer/media/mock_media_stream_dependency_factory.cc
@@ -203,7 +203,7 @@ cricket::VideoRenderer* MockLocalVideoTrack::FrameInput() {
std::string MockLocalVideoTrack::kind() const {
NOTIMPLEMENTED();
- return std::string();
+ return "";
}
std::string MockLocalVideoTrack::id() const { return id_; }
@@ -239,7 +239,7 @@ VideoSourceInterface* MockLocalVideoTrack::GetSource() const {
std::string MockLocalAudioTrack::kind() const {
NOTIMPLEMENTED();
- return std::string();
+ return "";
}
std::string MockLocalAudioTrack::id() const { return id_; }
@@ -292,11 +292,11 @@ class MockSessionDescription : public SessionDescriptionInterface {
}
virtual std::string session_id() const OVERRIDE {
NOTIMPLEMENTED();
- return std::string();
+ return "";
}
virtual std::string session_version() const OVERRIDE {
NOTIMPLEMENTED();
- return std::string();
+ return "";
}
virtual std::string type() const OVERRIDE {
return type_;
diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc
index 82f3c58..095d85f 100644
--- a/content/renderer/media/peer_connection_tracker.cc
+++ b/content/renderer/media/peer_connection_tracker.cc
@@ -376,7 +376,7 @@ void PeerConnectionTracker::TrackCreateDataChannel(
}
void PeerConnectionTracker::TrackStop(RTCPeerConnectionHandler* pc_handler) {
- SendPeerConnectionUpdate(pc_handler, "stop", std::string());
+ SendPeerConnectionUpdate(pc_handler, "stop", "");
}
void PeerConnectionTracker::TrackSignalingStateChange(
@@ -430,7 +430,7 @@ void PeerConnectionTracker::TrackSessionDescriptionCallback(
void PeerConnectionTracker::TrackOnRenegotiationNeeded(
RTCPeerConnectionHandler* pc_handler) {
- SendPeerConnectionUpdate(pc_handler, "onRenegotiationNeeded", std::string());
+ SendPeerConnectionUpdate(pc_handler, "onRenegotiationNeeded", "");
}
void PeerConnectionTracker::TrackCreateDTMFSender(
diff --git a/content/renderer/p2p/port_allocator.cc b/content/renderer/p2p/port_allocator.cc
index 7380113..7d06f6e 100644
--- a/content/renderer/p2p/port_allocator.cc
+++ b/content/renderer/p2p/port_allocator.cc
@@ -282,8 +282,8 @@ void P2PPortAllocatorSession::ParseRelayResponse() {
}
void P2PPortAllocatorSession::AddConfig() {
- cricket::PortConfiguration* config = new cricket::PortConfiguration(
- stun_server_address_, std::string(), std::string());
+ cricket::PortConfiguration* config =
+ new cricket::PortConfiguration(stun_server_address_, "", "");
if (allocator_->config_.legacy_relay) {
// Passing empty credentials for legacy google relay.
diff --git a/content/renderer/pepper/pepper_device_enumeration_event_handler.cc b/content/renderer/pepper/pepper_device_enumeration_event_handler.cc
index 7a8dce6..b23df8a 100644
--- a/content/renderer/pepper/pepper_device_enumeration_event_handler.cc
+++ b/content/renderer/pepper/pepper_device_enumeration_event_handler.cc
@@ -78,7 +78,7 @@ void PepperDeviceEnumerationEventHandler::OnDeviceOpened(
}
void PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed(int request_id) {
- NotifyDeviceOpened(request_id, false, std::string());
+ NotifyDeviceOpened(request_id, false, "");
}
// static
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 3e06f1f..0c4212b 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -180,7 +180,7 @@ std::string HostToCustomHistogramSuffix(const std::string& host) {
return ".docs";
if (host == "plus.google.com")
return ".plus";
- return std::string();
+ return "";
}
void* CreateHistogram(
diff --git a/content/renderer/v8_value_converter_impl_unittest.cc b/content/renderer/v8_value_converter_impl_unittest.cc
index 1f6b9bf..df68e80 100644
--- a/content/renderer/v8_value_converter_impl_unittest.cc
+++ b/content/renderer/v8_value_converter_impl_unittest.cc
@@ -70,7 +70,7 @@ class V8ValueConverterImplTest : public testing::Test {
std::string temp;
if (!value->GetString(key, &temp)) {
ADD_FAILURE();
- return std::string();
+ return "";
}
return temp;
}
@@ -80,7 +80,7 @@ class V8ValueConverterImplTest : public testing::Test {
value->Get(v8::String::New(key.c_str())).As<v8::String>();
if (temp.IsEmpty()) {
ADD_FAILURE();
- return std::string();
+ return "";
}
v8::String::Utf8Value utf8(temp);
return std::string(*utf8, utf8.length());
@@ -90,7 +90,7 @@ class V8ValueConverterImplTest : public testing::Test {
std::string temp;
if (!value->GetString(static_cast<size_t>(index), &temp)) {
ADD_FAILURE();
- return std::string();
+ return "";
}
return temp;
}
@@ -99,7 +99,7 @@ class V8ValueConverterImplTest : public testing::Test {
v8::Handle<v8::String> temp = value->Get(index).As<v8::String>();
if (temp.IsEmpty()) {
ADD_FAILURE();
- return std::string();
+ return "";
}
v8::String::Utf8Value utf8(temp);
return std::string(*utf8, utf8.length());
diff --git a/content/shell/shell_devtools_delegate.cc b/content/shell/shell_devtools_delegate.cc
index 07ebbde..58182f1 100644
--- a/content/shell/shell_devtools_delegate.cc
+++ b/content/shell/shell_devtools_delegate.cc
@@ -30,11 +30,12 @@ ShellDevToolsDelegate::ShellDevToolsDelegate(BrowserContext* browser_context,
devtools_http_handler_ = DevToolsHttpHandler::Start(
#if defined(OS_ANDROID)
new net::UnixDomainSocketWithAbstractNamespaceFactory(
- kSocketName, base::Bind(&CanUserConnectToDevTools)),
+ kSocketName,
+ base::Bind(&CanUserConnectToDevTools)),
#else
new net::TCPListenSocketFactory("127.0.0.1", port),
#endif
- std::string(),
+ "",
this);
}
@@ -60,7 +61,7 @@ base::FilePath ShellDevToolsDelegate::GetDebugFrontendDir() {
}
std::string ShellDevToolsDelegate::GetPageThumbnailData(const GURL& url) {
- return std::string();
+ return "";
}
RenderViewHost* ShellDevToolsDelegate::CreateNewTarget() {
@@ -79,7 +80,7 @@ ShellDevToolsDelegate::GetTargetType(RenderViewHost*) {
std::string ShellDevToolsDelegate::GetViewDescription(
content::RenderViewHost*) {
- return std::string();
+ return "";
}
} // namespace content
diff --git a/content/test/gpu/gpu_test_config_unittest.cc b/content/test/gpu/gpu_test_config_unittest.cc
index a87d215..f58139f 100644
--- a/content/test/gpu/gpu_test_config_unittest.cc
+++ b/content/test/gpu/gpu_test_config_unittest.cc
@@ -148,7 +148,7 @@ TEST_F(GPUTestConfigTest, StringMatches) {
config.set_gpu_device_id(0x0640);
EXPECT_TRUE(config.IsValid());
- EXPECT_TRUE(config.Matches(std::string()));
+ EXPECT_TRUE(config.Matches(""));
// os matching
EXPECT_TRUE(config.Matches("WIN"));
diff --git a/content/test/layout_browsertest.cc b/content/test/layout_browsertest.cc
index 431e890..4c34a38 100644
--- a/content/test/layout_browsertest.cc
+++ b/content/test/layout_browsertest.cc
@@ -155,8 +155,8 @@ void InProcessBrowserLayoutTest::RunLayoutTestInternal(
test_controller_->set_printer(printer.release());
LOG(INFO) << "Navigating to URL " << url << " and blocking.";
- ASSERT_TRUE(test_controller_->PrepareForLayoutTest(
- url, layout_test_dir_, false, std::string()));
+ ASSERT_TRUE(
+ test_controller_->PrepareForLayoutTest(url, layout_test_dir_, false, ""));
base::RunLoop run_loop;
run_loop.Run();
LOG(INFO) << "Navigation completed.";
@@ -195,10 +195,9 @@ void InProcessBrowserLayoutTest::RunLayoutTestInternal(
std::string InProcessBrowserLayoutTest::SaveResults(const std::string& expected,
const std::string& actual) {
base::FilePath cwd;
- EXPECT_TRUE(file_util::CreateNewTempDirectory(
- base::FilePath::StringType(), &cwd));
- base::FilePath expected_filename =
- cwd.Append(FILE_PATH_LITERAL("expected.txt"));
+ EXPECT_TRUE(file_util::CreateNewTempDirectory(FILE_PATH_LITERAL(""), &cwd));
+ base::FilePath expected_filename = cwd.Append(
+ FILE_PATH_LITERAL("expected.txt"));
base::FilePath actual_filename = cwd.Append(FILE_PATH_LITERAL("actual.txt"));
EXPECT_NE(-1, file_util::WriteFile(expected_filename,
expected.c_str(),
diff --git a/courgette/bsdiff_memory_unittest.cc b/courgette/bsdiff_memory_unittest.cc
index fe9fae6..f1718e2 100644
--- a/courgette/bsdiff_memory_unittest.cc
+++ b/courgette/bsdiff_memory_unittest.cc
@@ -51,15 +51,15 @@ std::string BSDiffMemoryTest::GenerateSyntheticInput(size_t length, int seed)
}
TEST_F(BSDiffMemoryTest, TestEmpty) {
- GenerateAndTestPatch(std::string(), std::string());
+ GenerateAndTestPatch("", "");
}
TEST_F(BSDiffMemoryTest, TestEmptyVsNonempty) {
- GenerateAndTestPatch(std::string(), "xxx");
+ GenerateAndTestPatch("", "xxx");
}
TEST_F(BSDiffMemoryTest, TestNonemptyVsEmpty) {
- GenerateAndTestPatch("xxx", std::string());
+ GenerateAndTestPatch("xxx", "");
}
TEST_F(BSDiffMemoryTest, TestSmallInputsWithSmallChanges) {
diff --git a/crypto/ec_private_key_unittest.cc b/crypto/ec_private_key_unittest.cc
index d2ec256..a052a9a 100644
--- a/crypto/ec_private_key_unittest.cc
+++ b/crypto/ec_private_key_unittest.cc
@@ -23,7 +23,7 @@ TEST(ECPrivateKeyUnitTest, OpenSSLStub) {
// back the same exact public key, and the private key should have the same
// value and elliptic curve params.
TEST(ECPrivateKeyUnitTest, InitRandomTest) {
- const std::string password1;
+ const std::string password1 = "";
const std::string password2 = "test";
scoped_ptr<crypto::ECPrivateKey> keypair1(
@@ -86,7 +86,7 @@ TEST(ECPrivateKeyUnitTest, InitRandomTest) {
}
TEST(ECPrivateKeyUnitTest, BadPasswordTest) {
- const std::string password1;
+ const std::string password1 = "";
const std::string password2 = "test";
scoped_ptr<crypto::ECPrivateKey> keypair1(
diff --git a/crypto/ec_signature_creator_unittest.cc b/crypto/ec_signature_creator_unittest.cc
index b34022b..df73bec 100644
--- a/crypto/ec_signature_creator_unittest.cc
+++ b/crypto/ec_signature_creator_unittest.cc
@@ -30,14 +30,13 @@ TEST(ECSignatureCreatorTest, BasicTest) {
ASSERT_TRUE(key_original.get());
std::vector<uint8> key_info;
- ASSERT_TRUE(
- key_original->ExportEncryptedPrivateKey(std::string(), 1000, &key_info));
+ ASSERT_TRUE(key_original->ExportEncryptedPrivateKey("", 1000, &key_info));
std::vector<uint8> pubkey_info;
ASSERT_TRUE(key_original->ExportPublicKey(&pubkey_info));
scoped_ptr<crypto::ECPrivateKey> key(
- crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
- std::string(), key_info, pubkey_info));
+ crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo("", key_info,
+ pubkey_info));
ASSERT_TRUE(key.get());
ASSERT_TRUE(key->key() != NULL);
diff --git a/dbus/end_to_end_async_unittest.cc b/dbus/end_to_end_async_unittest.cc
index 6943494..0a3446e 100644
--- a/dbus/end_to_end_async_unittest.cc
+++ b/dbus/end_to_end_async_unittest.cc
@@ -185,7 +185,7 @@ class EndToEndAsyncTest : public testing::Test {
ASSERT_TRUE(reader.PopString(&response_string));
response_strings_.push_back(response_string);
} else {
- response_strings_.push_back(std::string());
+ response_strings_.push_back("");
}
message_loop_.Quit();
};
@@ -205,7 +205,7 @@ class EndToEndAsyncTest : public testing::Test {
ASSERT_NE("", error->GetErrorName());
error_names_.push_back(error->GetErrorName());
} else {
- error_names_.push_back(std::string());
+ error_names_.push_back("");
}
message_loop_.Quit();
}
diff --git a/dbus/message.cc b/dbus/message.cc
index 737b0c4..ce53a48 100644
--- a/dbus/message.cc
+++ b/dbus/message.cc
@@ -87,7 +87,7 @@ std::string Message::GetMessageTypeAsString() {
return "MESSAGE_ERROR";
}
NOTREACHED();
- return std::string();
+ return "";
}
std::string Message::ToStringInternal(const std::string& indent,
@@ -251,7 +251,7 @@ std::string Message::ToStringInternal(const std::string& indent,
// ...
std::string Message::ToString() {
if (!raw_message_)
- return std::string();
+ return "";
// Generate headers first.
std::string headers;
@@ -268,7 +268,7 @@ std::string Message::ToString() {
// Generate the payload.
MessageReader reader(this);
- return headers + "\n" + ToStringInternal(std::string(), &reader);
+ return headers + "\n" + ToStringInternal("", &reader);
}
bool Message::SetDestination(const std::string& destination) {
diff --git a/dbus/message_unittest.cc b/dbus/message_unittest.cc
index 383e1c1..7e4455a8 100644
--- a/dbus/message_unittest.cc
+++ b/dbus/message_unittest.cc
@@ -557,7 +557,7 @@ TEST(MessageTest, GetAndSetHeaders) {
scoped_ptr<dbus::Response> message(dbus::Response::CreateEmpty());
EXPECT_EQ("", message->GetDestination());
- EXPECT_EQ(dbus::ObjectPath(std::string()), message->GetPath());
+ EXPECT_EQ(dbus::ObjectPath(""), message->GetPath());
EXPECT_EQ("", message->GetInterface());
EXPECT_EQ("", message->GetMember());
EXPECT_EQ("", message->GetErrorName());
@@ -587,7 +587,7 @@ TEST(MessageTest, GetAndSetHeaders) {
TEST(MessageTest, SetInvalidHeaders) {
scoped_ptr<dbus::Response> message(dbus::Response::CreateEmpty());
EXPECT_EQ("", message->GetDestination());
- EXPECT_EQ(dbus::ObjectPath(std::string()), message->GetPath());
+ EXPECT_EQ(dbus::ObjectPath(""), message->GetPath());
EXPECT_EQ("", message->GetInterface());
EXPECT_EQ("", message->GetMember());
EXPECT_EQ("", message->GetErrorName());
@@ -607,7 +607,7 @@ TEST(MessageTest, SetInvalidHeaders) {
EXPECT_FALSE(message->SetSender("?!#*"));
EXPECT_EQ("", message->GetDestination());
- EXPECT_EQ(dbus::ObjectPath(std::string()), message->GetPath());
+ EXPECT_EQ(dbus::ObjectPath(""), message->GetPath());
EXPECT_EQ("", message->GetInterface());
EXPECT_EQ("", message->GetMember());
EXPECT_EQ("", message->GetErrorName());
diff --git a/dbus/string_util_unittest.cc b/dbus/string_util_unittest.cc
index 99eb691..76bdfcb 100644
--- a/dbus/string_util_unittest.cc
+++ b/dbus/string_util_unittest.cc
@@ -10,7 +10,7 @@ TEST(StringUtilTest, IsValidObjectPath) {
EXPECT_TRUE(dbus::IsValidObjectPath("/foo/bar"));
EXPECT_TRUE(dbus::IsValidObjectPath("/hoge_fuga/piyo123"));
// Empty string.
- EXPECT_FALSE(dbus::IsValidObjectPath(std::string()));
+ EXPECT_FALSE(dbus::IsValidObjectPath(""));
// Emptyr elemnt.
EXPECT_FALSE(dbus::IsValidObjectPath("//"));
EXPECT_FALSE(dbus::IsValidObjectPath("/foo//bar"));
diff --git a/dbus/values_util.cc b/dbus/values_util.cc
index 7574f39..2e2d8e3 100644
--- a/dbus/values_util.cc
+++ b/dbus/values_util.cc
@@ -79,7 +79,7 @@ std::string GetTypeSignature(const base::Value& value) {
return "a{sv}";
default:
DLOG(ERROR) << "Unexpected type " << value.GetType();
- return std::string();
+ return "";
}
}
diff --git a/device/bluetooth/bluetooth_utils.cc b/device/bluetooth/bluetooth_utils.cc
index 4f30202..1e7b827 100644
--- a/device/bluetooth/bluetooth_utils.cc
+++ b/device/bluetooth/bluetooth_utils.cc
@@ -21,18 +21,18 @@ namespace bluetooth_utils {
std::string CanonicalUuid(std::string uuid) {
if (uuid.empty())
- return std::string();
+ return "";
if (uuid.size() < 11 && uuid.find("0x") == 0)
uuid = uuid.substr(2);
if (!(uuid.size() == 4 || uuid.size() == 8 || uuid.size() == 36))
- return std::string();
+ return "";
if (uuid.size() == 4 || uuid.size() == 8) {
for (size_t i = 0; i < uuid.size(); ++i) {
if (!IsHexDigit(uuid[i]))
- return std::string();
+ return "";
}
if (uuid.size() == 4)
@@ -45,10 +45,10 @@ std::string CanonicalUuid(std::string uuid) {
for (int i = 0; i < kUuidSize; ++i) {
if (i == 8 || i == 13 || i == 18 || i == 23) {
if (uuid[i] != '-')
- return std::string();
+ return "";
} else {
if (!IsHexDigit(uuid[i]))
- return std::string();
+ return "";
uuid_result[i] = tolower(uuid[i]);
}
}
diff --git a/device/media_transfer_protocol/media_transfer_protocol_manager.cc b/device/media_transfer_protocol/media_transfer_protocol_manager.cc
index d3fce03..bbd13b3 100644
--- a/device/media_transfer_protocol/media_transfer_protocol_manager.cc
+++ b/device/media_transfer_protocol/media_transfer_protocol_manager.cc
@@ -111,7 +111,7 @@ class MediaTransferProtocolManagerImpl : public MediaTransferProtocolManager {
const OpenStorageCallback& callback) OVERRIDE {
DCHECK(thread_checker_.CalledOnValidThread());
if (!ContainsKey(storage_info_map_, storage_name)) {
- callback.Run(std::string(), true);
+ callback.Run("", true);
return;
}
open_storage_callbacks_.push(callback);
@@ -333,13 +333,13 @@ class MediaTransferProtocolManagerImpl : public MediaTransferProtocolManager {
open_storage_callbacks_.front().Run(handle, false);
} else {
NOTREACHED();
- open_storage_callbacks_.front().Run(std::string(), true);
+ open_storage_callbacks_.front().Run("", true);
}
open_storage_callbacks_.pop();
}
void OnOpenStorageError() {
- open_storage_callbacks_.front().Run(std::string(), true);
+ open_storage_callbacks_.front().Run("", true);
open_storage_callbacks_.pop();
}
diff --git a/extensions/common/extension_resource_unittest.cc b/extensions/common/extension_resource_unittest.cc
index 3791b14..132e718 100644
--- a/extensions/common/extension_resource_unittest.cc
+++ b/extensions/common/extension_resource_unittest.cc
@@ -131,8 +131,7 @@ TEST(ExtensionResourceTest, CreateWithAllResourcesOnDisk) {
ASSERT_TRUE(file_util::CreateDirectory(l10n_path));
std::vector<std::string> locales;
- l10n_util::GetParentLocales(l10n_util::GetApplicationLocale(std::string()),
- &locales);
+ l10n_util::GetParentLocales(l10n_util::GetApplicationLocale(""), &locales);
ASSERT_FALSE(locales.empty());
for (size_t i = 0; i < locales.size(); i++) {
base::FilePath make_path;
diff --git a/extensions/common/matcher/substring_set_matcher_unittest.cc b/extensions/common/matcher/substring_set_matcher_unittest.cc
index fde65bf..4152ff9 100644
--- a/extensions/common/matcher/substring_set_matcher_unittest.cc
+++ b/extensions/common/matcher/substring_set_matcher_unittest.cc
@@ -117,7 +117,7 @@ TEST(SubstringSetMatcherTest, TestMatcher) {
// String abcde
// Pattern 1
// Pattern 2 abcdef
- TestTwoPatterns("abcde", std::string(), "abcdef", true, false);
+ TestTwoPatterns("abcde", "", "abcdef", true, false);
}
TEST(SubstringSetMatcherTest, RegisterAndRemove) {
diff --git a/extensions/common/matcher/url_matcher.cc b/extensions/common/matcher/url_matcher.cc
index b599293..d7779a2 100644
--- a/extensions/common/matcher/url_matcher.cc
+++ b/extensions/common/matcher/url_matcher.cc
@@ -256,8 +256,8 @@ URLMatcherConditionFactory::~URLMatcherConditionFactory() {
std::string URLMatcherConditionFactory::CanonicalizeURLForComponentSearches(
const GURL& url) const {
return kBeginningOfURL + CanonicalizeHostname(url.host()) + kEndOfDomain +
- url.path() + kEndOfPath +
- (url.has_query() ? "?" + url.query() : std::string()) + kEndOfURL;
+ url.path() + kEndOfPath + (url.has_query() ? "?" + url.query() : "") +
+ kEndOfURL;
}
URLMatcherCondition URLMatcherConditionFactory::CreateHostPrefixCondition(
diff --git a/extensions/common/matcher/url_matcher_factory.cc b/extensions/common/matcher/url_matcher_factory.cc
index 3ca4aa2..cdd08ba 100644
--- a/extensions/common/matcher/url_matcher_factory.cc
+++ b/extensions/common/matcher/url_matcher_factory.cc
@@ -151,8 +151,7 @@ URLMatcherFactory::CreateFromURLFilterDictionary(
// matched.
if (url_matcher_conditions.empty()) {
url_matcher_conditions.insert(
- url_matcher_condition_factory->CreateHostPrefixCondition(
- std::string()));
+ url_matcher_condition_factory->CreateHostPrefixCondition(""));
}
scoped_refptr<URLMatcherConditionSet> url_matcher_condition_set(
diff --git a/extensions/common/matcher/url_matcher_unittest.cc b/extensions/common/matcher/url_matcher_unittest.cc
index b17c13c..09fc562 100644
--- a/extensions/common/matcher/url_matcher_unittest.cc
+++ b/extensions/common/matcher/url_matcher_unittest.cc
@@ -247,7 +247,7 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) {
std::string url = factory.CanonicalizeURLForComponentSearches(gurl);
// Test host component.
- EXPECT_TRUE(Matches(factory.CreateHostPrefixCondition(std::string()), url));
+ EXPECT_TRUE(Matches(factory.CreateHostPrefixCondition(""), url));
EXPECT_TRUE(Matches(factory.CreateHostPrefixCondition("www.goog"), url));
EXPECT_TRUE(
Matches(factory.CreateHostPrefixCondition("www.google.com"), url));
@@ -258,7 +258,7 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) {
Matches(factory.CreateHostPrefixCondition("www.google.com/"), url));
EXPECT_FALSE(Matches(factory.CreateHostPrefixCondition("webhp"), url));
- EXPECT_TRUE(Matches(factory.CreateHostSuffixCondition(std::string()), url));
+ EXPECT_TRUE(Matches(factory.CreateHostSuffixCondition(""), url));
EXPECT_TRUE(Matches(factory.CreateHostSuffixCondition("com"), url));
EXPECT_TRUE(Matches(factory.CreateHostSuffixCondition(".com"), url));
EXPECT_TRUE(
@@ -270,7 +270,7 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) {
Matches(factory.CreateHostSuffixCondition("www.google.com/"), url));
EXPECT_FALSE(Matches(factory.CreateHostSuffixCondition("webhp"), url));
- EXPECT_FALSE(Matches(factory.CreateHostEqualsCondition(std::string()), url));
+ EXPECT_FALSE(Matches(factory.CreateHostEqualsCondition(""), url));
EXPECT_FALSE(Matches(factory.CreateHostEqualsCondition("www"), url));
EXPECT_TRUE(
Matches(factory.CreateHostEqualsCondition("www.google.com"), url));
@@ -279,14 +279,14 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) {
// Test path component.
- EXPECT_TRUE(Matches(factory.CreatePathPrefixCondition(std::string()), url));
+ EXPECT_TRUE(Matches(factory.CreatePathPrefixCondition(""), url));
EXPECT_TRUE(Matches(factory.CreatePathPrefixCondition("/web"), url));
EXPECT_TRUE(Matches(factory.CreatePathPrefixCondition("/webhp"), url));
EXPECT_FALSE(Matches(factory.CreatePathPrefixCondition("webhp"), url));
EXPECT_FALSE(Matches(factory.CreatePathPrefixCondition("/webhp?"), url));
EXPECT_FALSE(Matches(factory.CreatePathPrefixCondition("?sourceid"), url));
- EXPECT_TRUE(Matches(factory.CreatePathSuffixCondition(std::string()), url));
+ EXPECT_TRUE(Matches(factory.CreatePathSuffixCondition(""), url));
EXPECT_TRUE(Matches(factory.CreatePathSuffixCondition("webhp"), url));
EXPECT_TRUE(Matches(factory.CreatePathSuffixCondition("/webhp"), url));
EXPECT_FALSE(Matches(factory.CreatePathSuffixCondition("/web"), url));
@@ -300,12 +300,12 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) {
// Test query component.
- EXPECT_TRUE(Matches(factory.CreateQueryPrefixCondition(std::string()), url));
+ EXPECT_TRUE(Matches(factory.CreateQueryPrefixCondition(""), url));
EXPECT_TRUE(Matches(factory.CreateQueryPrefixCondition("sourceid"), url));
// The '?' at the beginning is just ignored.
EXPECT_TRUE(Matches(factory.CreateQueryPrefixCondition("?sourceid"), url));
- EXPECT_TRUE(Matches(factory.CreateQuerySuffixCondition(std::string()), url));
+ EXPECT_TRUE(Matches(factory.CreateQuerySuffixCondition(""), url));
EXPECT_TRUE(Matches(factory.CreateQuerySuffixCondition("ion=1"), url));
EXPECT_FALSE(Matches(factory.CreateQuerySuffixCondition("www"), url));
// "Suffix" condition + pattern starting with '?' = "equals" condition.
@@ -330,26 +330,21 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) {
// Test adjacent components
EXPECT_TRUE(Matches(factory.CreateHostSuffixPathPrefixCondition(
"google.com", "/webhp"), url));
- EXPECT_TRUE(Matches(
- factory.CreateHostSuffixPathPrefixCondition(std::string(), "/webhp"),
- url));
- EXPECT_TRUE(Matches(
- factory.CreateHostSuffixPathPrefixCondition("google.com", std::string()),
- url));
- EXPECT_FALSE(Matches(
- factory.CreateHostSuffixPathPrefixCondition("www", std::string()), url));
+ EXPECT_TRUE(Matches(factory.CreateHostSuffixPathPrefixCondition(
+ "", "/webhp"), url));
+ EXPECT_TRUE(Matches(factory.CreateHostSuffixPathPrefixCondition(
+ "google.com", ""), url));
+ EXPECT_FALSE(Matches(factory.CreateHostSuffixPathPrefixCondition(
+ "www", ""), url));
EXPECT_TRUE(Matches(factory.CreateHostEqualsPathPrefixCondition(
"www.google.com", "/webhp"), url));
- EXPECT_FALSE(Matches(
- factory.CreateHostEqualsPathPrefixCondition(std::string(), "/webhp"),
- url));
+ EXPECT_FALSE(Matches(factory.CreateHostEqualsPathPrefixCondition(
+ "", "/webhp"), url));
EXPECT_TRUE(Matches(factory.CreateHostEqualsPathPrefixCondition(
- "www.google.com", std::string()),
- url));
- EXPECT_FALSE(Matches(
- factory.CreateHostEqualsPathPrefixCondition("google.com", std::string()),
- url));
+ "www.google.com", ""), url));
+ EXPECT_FALSE(Matches(factory.CreateHostEqualsPathPrefixCondition(
+ "google.com", ""), url));
}
TEST(URLMatcherConditionFactoryTest, TestFullSearches) {
@@ -359,9 +354,9 @@ TEST(URLMatcherConditionFactoryTest, TestFullSearches) {
URLMatcherConditionFactory factory;
std::string url = factory.CanonicalizeURLForFullSearches(gurl);
- EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition(std::string()), url));
- EXPECT_TRUE(
- Matches(factory.CreateURLPrefixCondition("https://www.goog"), url));
+ EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition(""), url));
+ EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition(
+ "https://www.goog"), url));
EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition(
"https://www.google.com"), url));
EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition(
@@ -370,11 +365,11 @@ TEST(URLMatcherConditionFactoryTest, TestFullSearches) {
"http://www.google.com"), url));
EXPECT_FALSE(Matches(factory.CreateURLPrefixCondition("webhp"), url));
- EXPECT_TRUE(Matches(factory.CreateURLSuffixCondition(std::string()), url));
+ EXPECT_TRUE(Matches(factory.CreateURLSuffixCondition(""), url));
EXPECT_TRUE(Matches(factory.CreateURLSuffixCondition("ion=1"), url));
EXPECT_FALSE(Matches(factory.CreateURLSuffixCondition("www"), url));
- EXPECT_TRUE(Matches(factory.CreateURLContainsCondition(std::string()), url));
+ EXPECT_TRUE(Matches(factory.CreateURLContainsCondition(""), url));
EXPECT_TRUE(Matches(factory.CreateURLContainsCondition("www.goog"), url));
EXPECT_TRUE(Matches(factory.CreateURLContainsCondition("webhp"), url));
EXPECT_TRUE(Matches(factory.CreateURLContainsCondition("?"), url));
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
index 15aa78a..9354447 100644
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -617,7 +617,7 @@ void GaiaAuthFetcher::StartClientLogin(
allow_hosted_accounts);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
client_login_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -635,7 +635,7 @@ void GaiaAuthFetcher::StartIssueAuthToken(const std::string& sid,
request_body_ = MakeIssueAuthTokenBody(sid, lsid, service);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
issue_auth_token_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -669,7 +669,7 @@ void GaiaAuthFetcher::StartRevokeOAuth2Token(const std::string& auth_token) {
request_body_ = MakeRevokeTokenBody(auth_token);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
oauth2_revoke_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -692,7 +692,7 @@ void GaiaAuthFetcher::StartCookieForOAuthLoginTokenExchange(
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
client_login_to_oauth2_gurl_,
net::LOAD_NORMAL,
this));
@@ -708,7 +708,7 @@ void GaiaAuthFetcher::StartAuthCodeForOAuth2TokenExchange(
request_body_ = MakeGetTokenPairBody(auth_code);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
oauth2_token_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -723,7 +723,7 @@ void GaiaAuthFetcher::StartGetUserInfo(const std::string& lsid) {
request_body_ = MakeGetUserInfoBody(lsid);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
get_user_info_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -748,7 +748,7 @@ void GaiaAuthFetcher::StartMergeSession(const std::string& uber_token) {
request_body_ = MakeMergeSessionBody(uber_token, continue_url, source_);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
merge_session_gurl_,
net::LOAD_NORMAL,
this));
@@ -765,7 +765,7 @@ void GaiaAuthFetcher::StartTokenFetchForUberAuthExchange(
std::string authentication_header =
base::StringPrintf(kOAuthHeaderFormat, access_token.c_str());
fetcher_.reset(CreateGaiaFetcher(getter_,
- std::string(),
+ "",
authentication_header,
uberauth_token_gurl_,
kLoadFlagsIgnoreCookies,
@@ -785,7 +785,7 @@ void GaiaAuthFetcher::StartClientOAuth(const std::string& username,
source_, locale);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
client_oauth_gurl_,
kLoadFlagsIgnoreCookies,
this));
@@ -814,7 +814,7 @@ void GaiaAuthFetcher::StartClientOAuthChallengeResponse(
request_body_ = MakeClientOAuthChallengeResponseBody(name, token, solution);
fetcher_.reset(CreateGaiaFetcher(getter_,
request_body_,
- std::string(),
+ "",
client_oauth_gurl_,
kLoadFlagsIgnoreCookies,
this));
diff --git a/google_apis/gaia/gaia_auth_fetcher_unittest.cc b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
index 47b6d15..226ee1a 100644
--- a/google_apis/gaia/gaia_auth_fetcher_unittest.cc
+++ b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
@@ -311,10 +311,10 @@ TEST_F(GaiaAuthFetcherTest, ParseRequest) {
RunParsingTest("SID=sid\nLSID=lsid\nAuth=auth\n", "sid", "lsid", "auth");
RunParsingTest("LSID=lsid\nSID=sid\nAuth=auth\n", "sid", "lsid", "auth");
RunParsingTest("SID=sid\nLSID=lsid\nAuth=auth", "sid", "lsid", "auth");
- RunParsingTest("SID=sid\nAuth=auth\n", "sid", std::string(), "auth");
- RunParsingTest("LSID=lsid\nAuth=auth\n", std::string(), "lsid", "auth");
- RunParsingTest("\nAuth=auth\n", std::string(), std::string(), "auth");
- RunParsingTest("SID=sid", "sid", std::string(), std::string());
+ RunParsingTest("SID=sid\nAuth=auth\n", "sid", "", "auth");
+ RunParsingTest("LSID=lsid\nAuth=auth\n", "", "lsid", "auth");
+ RunParsingTest("\nAuth=auth\n", "", "", "auth");
+ RunParsingTest("SID=sid", "sid", "", "");
}
TEST_F(GaiaAuthFetcherTest, ParseErrorRequest) {
@@ -588,11 +588,7 @@ TEST_F(GaiaAuthFetcherTest, FullTokenFailure) {
MockFetcher mock_fetcher(
issue_auth_token_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_FORBIDDEN,
- cookies_,
- std::string(),
- net::URLFetcher::GET,
- &auth);
+ net::HTTP_FORBIDDEN, cookies_, "", net::URLFetcher::GET, &auth);
auth.OnURLFetchComplete(&mock_fetcher);
EXPECT_FALSE(auth.HasPendingFetch());
}
@@ -617,11 +613,8 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenSuccess) {
MockFetcher mock_fetcher1(
client_login_to_oauth2_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_OK,
- cookies,
- std::string(),
- net::URLFetcher::POST,
- &auth);
+ net::HTTP_OK, cookies, "",
+ net::URLFetcher::POST, &auth);
auth.OnURLFetchComplete(&mock_fetcher1);
EXPECT_TRUE(auth.HasPendingFetch());
MockFetcher mock_fetcher2(
@@ -659,11 +652,8 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenClientLoginToOAuth2Failure) {
MockFetcher mock_fetcher(
client_login_to_oauth2_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_FORBIDDEN,
- cookies,
- std::string(),
- net::URLFetcher::POST,
- &auth);
+ net::HTTP_FORBIDDEN, cookies, "",
+ net::URLFetcher::POST, &auth);
auth.OnURLFetchComplete(&mock_fetcher);
EXPECT_FALSE(auth.HasPendingFetch());
}
@@ -684,21 +674,15 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenOAuth2TokenPairFailure) {
MockFetcher mock_fetcher1(
client_login_to_oauth2_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_OK,
- cookies,
- std::string(),
- net::URLFetcher::POST,
- &auth);
+ net::HTTP_OK, cookies, "",
+ net::URLFetcher::POST, &auth);
auth.OnURLFetchComplete(&mock_fetcher1);
EXPECT_TRUE(auth.HasPendingFetch());
MockFetcher mock_fetcher2(
oauth2_token_source_,
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_FORBIDDEN,
- cookies_,
- std::string(),
- net::URLFetcher::POST,
- &auth);
+ net::HTTP_FORBIDDEN, cookies_, "",
+ net::URLFetcher::POST, &auth);
auth.OnURLFetchComplete(&mock_fetcher2);
EXPECT_FALSE(auth.HasPendingFetch());
}
@@ -826,7 +810,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthSuccess) {
std::vector<std::string> scopes;
scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope());
scopes.push_back("https://some.other.scope.com");
- auth.StartClientOAuth("username", "password", scopes, std::string(), "en");
+ auth.StartClientOAuth("username", "password", scopes, "", "en");
std::string expected_text = base::StringPrintf(
"{"
@@ -858,8 +842,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthWithQuote) {
GaiaAuthFetcher auth(&consumer, "te\"sts", profile_.GetRequestContext());
std::vector<std::string> scopes;
scopes.push_back("https://some.\"other.scope.com");
- auth.StartClientOAuth(
- "user\"name", "pass\"word", scopes, std::string(), "e\"n");
+ auth.StartClientOAuth("user\"name", "pass\"word", scopes, "", "e\"n");
std::string expected_text = base::StringPrintf(
"{"
@@ -896,7 +879,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthBadAuth) {
GaiaAuthFetcher auth(&consumer, "tests", profile_.GetRequestContext());
std::vector<std::string> scopes;
scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope());
- auth.StartClientOAuth("username", "password", scopes, std::string(), "en");
+ auth.StartClientOAuth("username", "password", scopes, "", "en");
}
TEST_F(GaiaAuthFetcherTest, ClientOAuthCaptchaChallenge) {
@@ -925,7 +908,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthCaptchaChallenge) {
GaiaAuthFetcher auth(&consumer, "tests", profile_.GetRequestContext());
std::vector<std::string> scopes;
scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope());
- auth.StartClientOAuth("username", "password", scopes, std::string(), "en");
+ auth.StartClientOAuth("username", "password", scopes, "", "en");
}
TEST_F(GaiaAuthFetcherTest, ClientOAuthTwoFactorChallenge) {
@@ -953,7 +936,7 @@ TEST_F(GaiaAuthFetcherTest, ClientOAuthTwoFactorChallenge) {
GaiaAuthFetcher auth(&consumer, "tests", profile_.GetRequestContext());
std::vector<std::string> scopes;
scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope());
- auth.StartClientOAuth("username", "password", scopes, std::string(), "en");
+ auth.StartClientOAuth("username", "password", scopes, "", "en");
}
TEST_F(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess) {
diff --git a/google_apis/gaia/google_service_auth_error.cc b/google_apis/gaia/google_service_auth_error.cc
index 96fc063..8beeb4d 100644
--- a/google_apis/gaia/google_service_auth_error.cc
+++ b/google_apis/gaia/google_service_auth_error.cc
@@ -225,7 +225,7 @@ DictionaryValue* GoogleServiceAuthError::ToValue() const {
std::string GoogleServiceAuthError::ToString() const {
switch (state_) {
case NONE:
- return std::string();
+ return "";
case INVALID_GAIA_CREDENTIALS:
return "Invalid credentials.";
case USER_NOT_SIGNED_UP:
diff --git a/google_apis/gaia/google_service_auth_error_unittest.cc b/google_apis/gaia/google_service_auth_error_unittest.cc
index 15155b6..59aa510 100644
--- a/google_apis/gaia/google_service_auth_error_unittest.cc
+++ b/google_apis/gaia/google_service_auth_error_unittest.cc
@@ -64,7 +64,7 @@ TEST_F(GoogleServiceAuthErrorTest, CaptchaChallenge) {
EXPECT_TRUE(value->GetDictionary("captcha", &captcha_value));
ASSERT_TRUE(captcha_value);
ExpectDictStringValue("captcha_token", *captcha_value, "token");
- ExpectDictStringValue(std::string(), *captcha_value, "audioUrl");
+ ExpectDictStringValue("", *captcha_value, "audioUrl");
ExpectDictStringValue("http://www.google.com/", *captcha_value, "imageUrl");
ExpectDictStringValue("http://www.bing.com/", *captcha_value, "unlockUrl");
ExpectDictIntegerValue(0, *captcha_value, "imageWidth");
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
index 7c761c7..feb8020 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
@@ -120,7 +120,7 @@ class OAuth2AccessTokenFetcherTest : public testing::Test {
// These four tests time out, see http://crbug.com/113446.
TEST_F(OAuth2AccessTokenFetcherTest, DISABLED_GetAccessTokenRequestFailure) {
- TestURLFetcher* url_fetcher = SetupGetAccessToken(false, 0, std::string());
+ TestURLFetcher* url_fetcher = SetupGetAccessToken(false, 0, "");
EXPECT_CALL(consumer_, OnGetTokenFailure(_)).Times(1);
fetcher_.Start("client_id", "client_secret", "refresh_token", ScopeList());
fetcher_.OnURLFetchComplete(url_fetcher);
@@ -129,7 +129,7 @@ TEST_F(OAuth2AccessTokenFetcherTest, DISABLED_GetAccessTokenRequestFailure) {
TEST_F(OAuth2AccessTokenFetcherTest,
DISABLED_GetAccessTokenResponseCodeFailure) {
TestURLFetcher* url_fetcher =
- SetupGetAccessToken(true, net::HTTP_FORBIDDEN, std::string());
+ SetupGetAccessToken(true, net::HTTP_FORBIDDEN, "");
EXPECT_CALL(consumer_, OnGetTokenFailure(_)).Times(1);
fetcher_.Start("client_id", "client_secret", "refresh_token", ScopeList());
fetcher_.OnURLFetchComplete(url_fetcher);
diff --git a/google_apis/gaia/oauth2_api_call_flow_unittest.cc b/google_apis/gaia/oauth2_api_call_flow_unittest.cc
index 4e8692e..137eaeb 100644
--- a/google_apis/gaia/oauth2_api_call_flow_unittest.cc
+++ b/google_apis/gaia/oauth2_api_call_flow_unittest.cc
@@ -158,8 +158,8 @@ class OAuth2ApiCallFlowTest : public testing::Test {
GURL url(CreateApiUrl());
EXPECT_CALL(*flow_, CreateApiCallBody()).WillOnce(Return(body));
EXPECT_CALL(*flow_, CreateApiCallUrl()).WillOnce(Return(url));
- TestURLFetcher* url_fetcher =
- CreateURLFetcher(url, succeeds, status, std::string());
+ TestURLFetcher* url_fetcher = CreateURLFetcher(
+ url, succeeds, status, "");
EXPECT_CALL(factory_, CreateURLFetcher(_, url, _, _))
.WillOnce(Return(url_fetcher));
return url_fetcher;
@@ -240,7 +240,7 @@ TEST_F(OAuth2ApiCallFlowTest, EmptyAccessTokenFirstApiCallSucceeds) {
std::string at = "access_token";
std::vector<std::string> scopes(CreateTestScopes());
- CreateFlow(rt, std::string(), scopes);
+ CreateFlow(rt, "", scopes);
SetupAccessTokenFetcher(rt, scopes);
TestURLFetcher* url_fetcher = SetupApiCall(true, net::HTTP_OK);
EXPECT_CALL(*flow_, ProcessApiCallSuccess(url_fetcher));
@@ -256,7 +256,7 @@ TEST_F(OAuth2ApiCallFlowTest, EmptyAccessTokenApiCallFails) {
std::string at = "access_token";
std::vector<std::string> scopes(CreateTestScopes());
- CreateFlow(rt, std::string(), scopes);
+ CreateFlow(rt, "", scopes);
SetupAccessTokenFetcher(rt, scopes);
TestURLFetcher* url_fetcher = SetupApiCall(false, net::HTTP_BAD_GATEWAY);
EXPECT_CALL(*flow_, ProcessApiCallFailure(url_fetcher));
@@ -272,7 +272,7 @@ TEST_F(OAuth2ApiCallFlowTest, EmptyAccessTokenNewTokenGenerationFails) {
std::string at = "access_token";
std::vector<std::string> scopes(CreateTestScopes());
- CreateFlow(rt, std::string(), scopes);
+ CreateFlow(rt, "", scopes);
SetupAccessTokenFetcher(rt, scopes);
GoogleServiceAuthError error(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
diff --git a/google_apis/gaia/oauth2_mint_token_flow.cc b/google_apis/gaia/oauth2_mint_token_flow.cc
index 169d187..42fc4ef 100644
--- a/google_apis/gaia/oauth2_mint_token_flow.cc
+++ b/google_apis/gaia/oauth2_mint_token_flow.cc
@@ -89,16 +89,17 @@ OAuth2MintTokenFlow::Parameters::Parameters(
OAuth2MintTokenFlow::Parameters::~Parameters() {}
-OAuth2MintTokenFlow::OAuth2MintTokenFlow(URLRequestContextGetter* context,
- Delegate* delegate,
- const Parameters& parameters)
- : OAuth2ApiCallFlow(context,
- parameters.login_refresh_token,
- std::string(),
- std::vector<std::string>()),
+OAuth2MintTokenFlow::OAuth2MintTokenFlow(
+ URLRequestContextGetter* context,
+ Delegate* delegate,
+ const Parameters& parameters)
+ : OAuth2ApiCallFlow(
+ context, parameters.login_refresh_token,
+ "", std::vector<std::string>()),
delegate_(delegate),
parameters_(parameters),
- ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {}
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
+}
OAuth2MintTokenFlow::~OAuth2MintTokenFlow() { }
diff --git a/google_apis/gaia/oauth2_mint_token_flow_unittest.cc b/google_apis/gaia/oauth2_mint_token_flow_unittest.cc
index 3206601..e213984 100644
--- a/google_apis/gaia/oauth2_mint_token_flow_unittest.cc
+++ b/google_apis/gaia/oauth2_mint_token_flow_unittest.cc
@@ -272,7 +272,7 @@ TEST_F(OAuth2MintTokenFlowTest, ParseIssueAdviceResponse) {
TEST_F(OAuth2MintTokenFlowTest, ProcessApiCallSuccess) {
{ // No body.
TestURLFetcher url_fetcher(1, GURL("http://www.google.com"), NULL);
- url_fetcher.SetResponseString(std::string());
+ url_fetcher.SetResponseString("");
CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE);
EXPECT_CALL(delegate_, OnMintTokenFailure(_));
flow_->ProcessApiCallSuccess(&url_fetcher);
diff --git a/google_apis/gaia/oauth_request_signer.cc b/google_apis/gaia/oauth_request_signer.cc
index 9952a6f..b5d138f 100644
--- a/google_apis/gaia/oauth_request_signer.cc
+++ b/google_apis/gaia/oauth_request_signer.cc
@@ -89,7 +89,7 @@ std::string BuildBaseString(const GURL& request_base_url,
std::string BuildBaseStringParameters(
const OAuthRequestSigner::Parameters& parameters) {
- std::string result;
+ std::string result = "";
OAuthRequestSigner::Parameters::const_iterator cursor;
OAuthRequestSigner::Parameters::const_iterator limit;
bool first = true;
@@ -297,7 +297,7 @@ bool SignParameters(const GURL& request_base_url,
// static
bool OAuthRequestSigner::Decode(const std::string& text,
std::string* decoded_text) {
- std::string accumulator;
+ std::string accumulator = "";
std::string::const_iterator cursor;
std::string::const_iterator limit;
for (limit = text.end(), cursor = text.begin(); cursor != limit; ++cursor) {
@@ -335,7 +335,7 @@ bool OAuthRequestSigner::Decode(const std::string& text,
// static
std::string OAuthRequestSigner::Encode(const std::string& text) {
- std::string result;
+ std::string result = "";
std::string::const_iterator cursor;
std::string::const_iterator limit;
for (limit = text.end(), cursor = text.begin(); cursor != limit; ++cursor) {
diff --git a/google_apis/gaia/oauth_request_signer_unittest.cc b/google_apis/gaia/oauth_request_signer_unittest.cc
index 40206f6..5cf2dc2 100644
--- a/google_apis/gaia/oauth_request_signer_unittest.cc
+++ b/google_apis/gaia/oauth_request_signer_unittest.cc
@@ -109,15 +109,15 @@ TEST(OAuthRequestSignerTest, SignGet2) {
parameters["oauth_nonce"] = "4d4hZW9DygWQujP2tz06UN";
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::SignURL(
- request_url,
- parameters,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::GET_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ parameters,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::GET_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ(signed_text,
"https://accounts.google.com/OAuthGetAccessToken"
"?oauth_consumer_key=anonymous"
@@ -137,14 +137,14 @@ TEST(OAuthRequestSignerTest, ParseAndSignGet1) {
"&oauth_timestamp=1308152953");
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::ParseAndSign(
- request_url,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::GET_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::GET_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ("https://www.google.com/accounts/o8/GetOAuthToken"
"?oauth_consumer_key=anonymous"
"&oauth_nonce=2oiE_aHdk5qRTz0L9C8Lq0g"
@@ -164,14 +164,14 @@ TEST(OAuthRequestSignerTest, ParseAndSignGet2) {
"&oauth_nonce=4d4hZW9DygWQujP2tz06UN");
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::ParseAndSign(
- request_url,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::GET_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::GET_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ(signed_text,
"https://accounts.google.com/OAuthGetAccessToken"
"?oauth_consumer_key=anonymous"
@@ -220,15 +220,15 @@ TEST(OAuthRequestSignerTest, SignPost2) {
parameters["oauth_nonce"] = "17171717171717171";
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::SignURL(
- request_url,
- parameters,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::POST_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ parameters,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::POST_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ(signed_text,
"oauth_consumer_key=anonymous"
"&oauth_nonce=17171717171717171"
@@ -273,14 +273,14 @@ TEST(OAuthRequestSignerTest, ParseAndSignPost2) {
"&oauth_nonce=17171717171717171");
std::string signed_text;
ASSERT_TRUE(OAuthRequestSigner::ParseAndSign(
- request_url,
- OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
- OAuthRequestSigner::POST_METHOD,
- "anonymous", // oauth_consumer_key
- "anonymous", // consumer secret
- "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
- std::string(), // token secret
- &signed_text));
+ request_url,
+ OAuthRequestSigner::HMAC_SHA1_SIGNATURE,
+ OAuthRequestSigner::POST_METHOD,
+ "anonymous", // oauth_consumer_key
+ "anonymous", // consumer secret
+ "4/CcC-hgdj1TNnWaX8NTQ76YDXCBEK", // oauth_token
+ "", // token secret
+ &signed_text));
ASSERT_EQ(signed_text,
"oauth_consumer_key=anonymous"
"&oauth_nonce=17171717171717171"
diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc
index c05435e..cd13b9e 100644
--- a/google_apis/google_api_keys.cc
+++ b/google_apis/google_api_keys.cc
@@ -98,25 +98,22 @@ class APIKeyCache {
api_key_ = CalculateKeyValue(GOOGLE_API_KEY,
STRINGIZE_NO_EXPANSION(GOOGLE_API_KEY),
- NULL,
- std::string(),
+ NULL, "",
environment.get(),
command_line);
- std::string default_client_id =
- CalculateKeyValue(GOOGLE_DEFAULT_CLIENT_ID,
- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID),
- NULL,
- std::string(),
- environment.get(),
- command_line);
- std::string default_client_secret =
- CalculateKeyValue(GOOGLE_DEFAULT_CLIENT_SECRET,
- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET),
- NULL,
- std::string(),
- environment.get(),
- command_line);
+ std::string default_client_id = CalculateKeyValue(
+ GOOGLE_DEFAULT_CLIENT_ID,
+ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID),
+ NULL, "",
+ environment.get(),
+ command_line);
+ std::string default_client_secret = CalculateKeyValue(
+ GOOGLE_DEFAULT_CLIENT_SECRET,
+ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET),
+ NULL, "",
+ environment.get(),
+ command_line);
// We currently only allow overriding the baked-in values for the
// default OAuth2 client ID and secret using a command-line
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index 5c31f14..747d157 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -445,8 +445,8 @@ void ProgramManager::DoCompileShader(Shader* shader,
FeatureInfo* feature_info) {
TimeTicks before = TimeTicks::HighResNow();
if (program_cache_ &&
- program_cache_->GetShaderCompilationStatus(
- shader->source() ? *shader->source() : std::string()) ==
+ program_cache_->GetShaderCompilationStatus(shader->source() ?
+ *shader->source() : "") ==
ProgramCache::COMPILATION_SUCCEEDED) {
shader->SetStatus(true, "", translator);
shader->FlagSourceAsCompiled(false);
@@ -525,9 +525,9 @@ void ProgramManager::ForceCompileShader(const std::string* source,
LOG_IF(ERROR, translator)
<< "Shader translator allowed/produced an invalid shader "
<< "unless the driver is buggy:"
- << "\n--original-shader--\n" << (source ? *source : std::string())
- << "\n--translated-shader--\n" << shader_src << "\n--info-log--\n"
- << *shader->log_info();
+ << "\n--original-shader--\n" << (source ? *source : "")
+ << "\n--translated-shader--\n" << shader_src
+ << "\n--info-log--\n" << *shader->log_info();
}
}
diff --git a/ipc/ipc_channel_factory.cc b/ipc/ipc_channel_factory.cc
index 3d5c866..d355328 100644
--- a/ipc/ipc_channel_factory.cc
+++ b/ipc/ipc_channel_factory.cc
@@ -64,8 +64,7 @@ void ChannelFactory::OnFileCanReadWithoutBlocking(int fd) {
if (!IsPeerAuthorized(new_fd))
return;
- ChannelHandle handle(std::string(),
- base::FileDescriptor(*scoped_fd.release(), true));
+ ChannelHandle handle("", base::FileDescriptor(*scoped_fd.release(), true));
delegate_->OnClientConnected(handle);
}
diff --git a/jingle/glue/channel_socket_adapter_unittest.cc b/jingle/glue/channel_socket_adapter_unittest.cc
index d90cbca..c9b0bb7 100644
--- a/jingle/glue/channel_socket_adapter_unittest.cc
+++ b/jingle/glue/channel_socket_adapter_unittest.cc
@@ -29,7 +29,8 @@ const int kTestError = -32123;
class MockTransportChannel : public cricket::TransportChannel {
public:
- MockTransportChannel() : cricket::TransportChannel(std::string(), 0) {
+ MockTransportChannel()
+ : cricket::TransportChannel("", 0) {
set_writable(true);
set_readable(true);
}
diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc
index f7ddf8d..24aa6a9 100644
--- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc
+++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc
@@ -101,10 +101,9 @@ std::string GaiaTokenPreXmppAuth::GetAuthMechanism() const {
std::string GaiaTokenPreXmppAuth::ChooseBestSaslMechanism(
const std::vector<std::string> & mechanisms, bool encrypted) {
- return (std::find(mechanisms.begin(), mechanisms.end(), auth_mechanism_) !=
- mechanisms.end())
- ? auth_mechanism_
- : std::string();
+ return (std::find(mechanisms.begin(),
+ mechanisms.end(), auth_mechanism_) !=
+ mechanisms.end()) ? auth_mechanism_ : "";
}
buzz::SaslMechanism* GaiaTokenPreXmppAuth::CreateSaslMechanism(
diff --git a/jingle/notifier/communicator/single_login_attempt.cc b/jingle/notifier/communicator/single_login_attempt.cc
index 49fcdee..dda0cfe 100644
--- a/jingle/notifier/communicator/single_login_attempt.cc
+++ b/jingle/notifier/communicator/single_login_attempt.cc
@@ -85,9 +85,9 @@ net::HostPortPair ParseRedirectText(const std::string& redirect_text) {
void SingleLoginAttempt::OnError(buzz::XmppEngine::Error error, int subcode,
const buzz::XmlElement* stream_error) {
DVLOG(1) << "Error: " << error << ", subcode: " << subcode
- << (stream_error
- ? (", stream error: " + XmlElementToString(*stream_error))
- : std::string());
+ << (stream_error ?
+ (", stream error: " + XmlElementToString(*stream_error)) :
+ "");
DCHECK_EQ(error == buzz::XmppEngine::ERROR_STREAM, stream_error != NULL);
diff --git a/jingle/notifier/communicator/single_login_attempt_unittest.cc b/jingle/notifier/communicator/single_login_attempt_unittest.cc
index 4d009c2..582b808 100644
--- a/jingle/notifier/communicator/single_login_attempt_unittest.cc
+++ b/jingle/notifier/communicator/single_login_attempt_unittest.cc
@@ -219,7 +219,7 @@ TEST_F(SingleLoginAttemptTest, RedirectInvalidPort) {
// Fire an empty redirect and make sure the delegate does not get a
// redirect.
TEST_F(SingleLoginAttemptTest, RedirectEmpty) {
- scoped_ptr<buzz::XmlElement> redirect_error(MakeRedirectError(std::string()));
+ scoped_ptr<buzz::XmlElement> redirect_error(MakeRedirectError(""));
FireRedirect(redirect_error.get());
EXPECT_EQ(IDLE, fake_delegate_.state());
}
@@ -227,7 +227,7 @@ TEST_F(SingleLoginAttemptTest, RedirectEmpty) {
// Fire a redirect with a missing text element and make sure the
// delegate does not get a redirect.
TEST_F(SingleLoginAttemptTest, RedirectMissingText) {
- scoped_ptr<buzz::XmlElement> redirect_error(MakeRedirectError(std::string()));
+ scoped_ptr<buzz::XmlElement> redirect_error(MakeRedirectError(""));
redirect_error->RemoveChildAfter(redirect_error->FirstChild());
FireRedirect(redirect_error.get());
EXPECT_EQ(IDLE, fake_delegate_.state());
@@ -236,7 +236,7 @@ TEST_F(SingleLoginAttemptTest, RedirectMissingText) {
// Fire a redirect with a missing see-other-host element and make sure
// the delegate does not get a redirect.
TEST_F(SingleLoginAttemptTest, RedirectMissingSeeOtherHost) {
- scoped_ptr<buzz::XmlElement> redirect_error(MakeRedirectError(std::string()));
+ scoped_ptr<buzz::XmlElement> redirect_error(MakeRedirectError(""));
redirect_error->RemoveChildAfter(NULL);
FireRedirect(redirect_error.get());
EXPECT_EQ(IDLE, fake_delegate_.state());
diff --git a/media/audio/linux/alsa_output.cc b/media/audio/linux/alsa_output.cc
index f3c3f91..4615d01 100644
--- a/media/audio/linux/alsa_output.cc
+++ b/media/audio/linux/alsa_output.cc
@@ -523,7 +523,7 @@ std::string AlsaPcmOutputStream::FindDeviceForChannels(uint32 channels) {
const char* wanted_device = GuessSpecificDeviceName(channels);
if (!wanted_device)
- return std::string();
+ return "";
std::string guessed_device;
void** hints = NULL;
diff --git a/media/audio/null_audio_sink.cc b/media/audio/null_audio_sink.cc
index 40db453..5c4f67a 100644
--- a/media/audio/null_audio_sink.cc
+++ b/media/audio/null_audio_sink.cc
@@ -85,7 +85,7 @@ void NullAudioSink::StartAudioHashForTesting() {
}
std::string NullAudioSink::GetAudioHashForTesting() {
- return audio_hash_ ? audio_hash_->ToString() : std::string();
+ return audio_hash_ ? audio_hash_->ToString() : "";
}
} // namespace media
diff --git a/media/crypto/aes_decryptor.cc b/media/crypto/aes_decryptor.cc
index 430568c..e214b06 100644
--- a/media/crypto/aes_decryptor.cc
+++ b/media/crypto/aes_decryptor.cc
@@ -152,7 +152,7 @@ bool AesDecryptor::GenerateKeyRequest(const std::string& key_system,
init_data_length);
}
- key_message_cb_.Run(key_system, session_id_string, message, std::string());
+ key_message_cb_.Run(key_system, session_id_string, message, "");
return true;
}
diff --git a/media/crypto/aes_decryptor_unittest.cc b/media/crypto/aes_decryptor_unittest.cc
index abc7e6e..f882150 100644
--- a/media/crypto/aes_decryptor_unittest.cc
+++ b/media/crypto/aes_decryptor_unittest.cc
@@ -242,13 +242,11 @@ class AesDecryptorTest : public testing::Test {
void GenerateKeyRequest(const uint8* key_id, int key_id_size) {
std::string key_id_string(reinterpret_cast<const char*>(key_id),
key_id_size);
- EXPECT_CALL(
- *this,
- KeyMessage(
- kClearKeySystem, StrNe(std::string()), StrEq(key_id_string), ""))
+ EXPECT_CALL(*this, KeyMessage(kClearKeySystem,
+ StrNe(""), StrEq(key_id_string), ""))
.WillOnce(SaveArg<1>(&session_id_string_));
- EXPECT_TRUE(decryptor_.GenerateKeyRequest(
- kClearKeySystem, std::string(), key_id, key_id_size));
+ EXPECT_TRUE(decryptor_.GenerateKeyRequest(kClearKeySystem, "",
+ key_id, key_id_size));
}
void AddKeyAndExpectToSucceed(const uint8* key_id, int key_id_size,
@@ -327,9 +325,8 @@ class AesDecryptorTest : public testing::Test {
};
TEST_F(AesDecryptorTest, GenerateKeyRequestWithNullInitData) {
- EXPECT_CALL(*this, KeyMessage(kClearKeySystem, StrNe(std::string()), "", ""));
- EXPECT_TRUE(
- decryptor_.GenerateKeyRequest(kClearKeySystem, std::string(), NULL, 0));
+ EXPECT_CALL(*this, KeyMessage(kClearKeySystem, StrNe(""), "", ""));
+ EXPECT_TRUE(decryptor_.GenerateKeyRequest(kClearKeySystem, "", NULL, 0));
}
TEST_F(AesDecryptorTest, NormalWebMDecryption) {
diff --git a/media/filters/pipeline_integration_test.cc b/media/filters/pipeline_integration_test.cc
index 2945db2..5244376 100644
--- a/media/filters/pipeline_integration_test.cc
+++ b/media/filters/pipeline_integration_test.cc
@@ -316,8 +316,7 @@ class MockMediaSource {
DCHECK(init_data.get());
DCHECK_GT(init_data_size, 0);
CHECK(!need_key_cb_.is_null());
- need_key_cb_.Run(
- std::string(), std::string(), type, init_data.Pass(), init_data_size);
+ need_key_cb_.Run("", "", type, init_data.Pass(), init_data_size);
}
private:
diff --git a/media/filters/pipeline_integration_test_base.cc b/media/filters/pipeline_integration_test_base.cc
index 1b650d5..68b648e 100644
--- a/media/filters/pipeline_integration_test_base.cc
+++ b/media/filters/pipeline_integration_test_base.cc
@@ -67,8 +67,7 @@ void PipelineIntegrationTestBase::DemuxerNeedKeyCB(
DCHECK(init_data.get());
DCHECK_GT(init_data_size, 0);
CHECK(!need_key_cb_.is_null());
- need_key_cb_.Run(
- std::string(), std::string(), type, init_data.Pass(), init_data_size);
+ need_key_cb_.Run("", "", type, init_data.Pass(), init_data_size);
}
void PipelineIntegrationTestBase::OnEnded() {
diff --git a/media/webm/webm_cluster_parser_unittest.cc b/media/webm/webm_cluster_parser_unittest.cc
index baa35f2..dc73329 100644
--- a/media/webm/webm_cluster_parser_unittest.cc
+++ b/media/webm/webm_cluster_parser_unittest.cc
@@ -203,14 +203,13 @@ static void AppendToEnd(const WebMClusterParser::BufferQueue& src,
class WebMClusterParserTest : public testing::Test {
public:
WebMClusterParserTest()
- : parser_(new WebMClusterParser(kTimecodeScale,
- kAudioTrackNum,
- kVideoTrackNum,
- std::set<int>(),
- std::set<int64>(),
- std::string(),
- std::string(),
- LogCB())) {}
+ : parser_(new WebMClusterParser(
+ kTimecodeScale, kAudioTrackNum, kVideoTrackNum,
+ std::set<int>(),
+ std::set<int64>(),
+ "", "",
+ LogCB())) {
+ }
protected:
scoped_ptr<WebMClusterParser> parser_;
@@ -335,14 +334,11 @@ TEST_F(WebMClusterParserTest, IgnoredTracks) {
std::set<int64> ignored_tracks;
ignored_tracks.insert(kTextTrackNum);
- parser_.reset(new WebMClusterParser(kTimecodeScale,
- kAudioTrackNum,
- kVideoTrackNum,
- std::set<int>(),
- ignored_tracks,
- std::string(),
- std::string(),
- LogCB()));
+ parser_.reset(new WebMClusterParser(
+ kTimecodeScale, kAudioTrackNum, kVideoTrackNum,
+ std::set<int>(),
+ ignored_tracks, "", "",
+ LogCB()));
const BlockInfo kInputBlockInfo[] = {
{ kAudioTrackNum, 0, 23, true },
@@ -375,14 +371,11 @@ TEST_F(WebMClusterParserTest, ParseTextTracks) {
std::set<int> text_tracks;
text_tracks.insert(kTextTrackNum);
- parser_.reset(new WebMClusterParser(kTimecodeScale,
- kAudioTrackNum,
- kVideoTrackNum,
- text_tracks,
- std::set<int64>(),
- std::string(),
- std::string(),
- LogCB()));
+ parser_.reset(new WebMClusterParser(
+ kTimecodeScale, kAudioTrackNum, kVideoTrackNum,
+ text_tracks,
+ std::set<int64>(), "", "",
+ LogCB()));
const BlockInfo kInputBlockInfo[] = {
{ kAudioTrackNum, 0, 23, true },
@@ -407,14 +400,11 @@ TEST_F(WebMClusterParserTest, TextTracksSimpleBlock) {
std::set<int> text_tracks;
text_tracks.insert(kTextTrackNum);
- parser_.reset(new WebMClusterParser(kTimecodeScale,
- kAudioTrackNum,
- kVideoTrackNum,
- text_tracks,
- std::set<int64>(),
- std::string(),
- std::string(),
- LogCB()));
+ parser_.reset(new WebMClusterParser(
+ kTimecodeScale, kAudioTrackNum, kVideoTrackNum,
+ text_tracks,
+ std::set<int64>(), "", "",
+ LogCB()));
const BlockInfo kInputBlockInfo[] = {
{ kTextTrackNum, 33, 42, true },
@@ -438,14 +428,11 @@ TEST_F(WebMClusterParserTest, ParseMultipleTextTracks) {
text_tracks.insert(kSubtitleTextTrackNum);
text_tracks.insert(kCaptionTextTrackNum);
- parser_.reset(new WebMClusterParser(kTimecodeScale,
- kAudioTrackNum,
- kVideoTrackNum,
- text_tracks,
- std::set<int64>(),
- std::string(),
- std::string(),
- LogCB()));
+ parser_.reset(new WebMClusterParser(
+ kTimecodeScale, kAudioTrackNum, kVideoTrackNum,
+ text_tracks,
+ std::set<int64>(), "", "",
+ LogCB()));
const BlockInfo kInputBlockInfo[] = {
{ kAudioTrackNum, 0, 23, true },
@@ -483,14 +470,11 @@ TEST_F(WebMClusterParserTest, ParseMultipleTextTracks) {
TEST_F(WebMClusterParserTest, ParseEncryptedBlock) {
scoped_ptr<Cluster> cluster(CreateEncryptedCluster(sizeof(kEncryptedFrame)));
- parser_.reset(new WebMClusterParser(kTimecodeScale,
- kAudioTrackNum,
- kVideoTrackNum,
- std::set<int>(),
- std::set<int64>(),
- std::string(),
- "video_key_id",
- LogCB()));
+ parser_.reset(new WebMClusterParser(
+ kTimecodeScale, kAudioTrackNum, kVideoTrackNum,
+ std::set<int>(),
+ std::set<int64>(), "", "video_key_id",
+ LogCB()));
int result = parser_->Parse(cluster->data(), cluster->size());
EXPECT_EQ(cluster->size(), result);
ASSERT_EQ(1UL, parser_->video_buffers().size());
@@ -502,14 +486,11 @@ TEST_F(WebMClusterParserTest, ParseBadEncryptedBlock) {
scoped_ptr<Cluster> cluster(
CreateEncryptedCluster(sizeof(kEncryptedFrame) - 1));
- parser_.reset(new WebMClusterParser(kTimecodeScale,
- kAudioTrackNum,
- kVideoTrackNum,
- std::set<int>(),
- std::set<int64>(),
- std::string(),
- "video_key_id",
- LogCB()));
+ parser_.reset(new WebMClusterParser(
+ kTimecodeScale, kAudioTrackNum, kVideoTrackNum,
+ std::set<int>(),
+ std::set<int64>(), "", "video_key_id",
+ LogCB()));
int result = parser_->Parse(cluster->data(), cluster->size());
EXPECT_EQ(-1, result);
}
diff --git a/net/base/dns_util.cc b/net/base/dns_util.cc
index b94eff8..816095b 100644
--- a/net/base/dns_util.cc
+++ b/net/base/dns_util.cc
@@ -62,16 +62,16 @@ std::string DNSDomainToString(const base::StringPiece& domain) {
for (unsigned i = 0; i < domain.size() && domain[i]; i += domain[i] + 1) {
#if CHAR_MIN < 0
if (domain[i] < 0)
- return std::string();
+ return "";
#endif
if (domain[i] > 63)
- return std::string();
+ return "";
if (i)
ret += ".";
if (static_cast<unsigned>(domain[i]) + i + 1 > domain.size())
- return std::string();
+ return "";
domain.substr(i + 1, domain[i]).AppendToString(&ret);
}
diff --git a/net/base/host_mapping_rules_unittest.cc b/net/base/host_mapping_rules_unittest.cc
index 8d8f7b1..9ecd4b7 100644
--- a/net/base/host_mapping_rules_unittest.cc
+++ b/net/base/host_mapping_rules_unittest.cc
@@ -72,7 +72,7 @@ TEST(HostMappingRulesTest, ParseInvalidRules) {
HostMappingRules rules;
EXPECT_FALSE(rules.AddRuleFromString("xyz"));
- EXPECT_FALSE(rules.AddRuleFromString(std::string()));
+ EXPECT_FALSE(rules.AddRuleFromString(""));
EXPECT_FALSE(rules.AddRuleFromString(" "));
EXPECT_FALSE(rules.AddRuleFromString("EXCLUDE"));
EXPECT_FALSE(rules.AddRuleFromString("EXCLUDE foo bar"));
diff --git a/net/base/mime_sniffer_unittest.cc b/net/base/mime_sniffer_unittest.cc
index 7865350..a4bde0f 100644
--- a/net/base/mime_sniffer_unittest.cc
+++ b/net/base/mime_sniffer_unittest.cc
@@ -304,14 +304,13 @@ TEST(MimeSnifferTest, FlashTest) {
TEST(MimeSnifferTest, XMLTest) {
// An easy feed to identify.
EXPECT_EQ("application/atom+xml",
- SniffMimeType("<?xml?><feed", std::string(), "text/xml"));
+ SniffMimeType("<?xml?><feed", "", "text/xml"));
// Don't sniff out of plain text.
EXPECT_EQ("text/plain",
- SniffMimeType("<?xml?><feed", std::string(), "text/plain"));
+ SniffMimeType("<?xml?><feed", "", "text/plain"));
// Simple RSS.
EXPECT_EQ("application/rss+xml",
- SniffMimeType(
- "<?xml version='1.0'?>\r\n<rss", std::string(), "text/xml"));
+ SniffMimeType("<?xml version='1.0'?>\r\n<rss", "", "text/xml"));
// The top of CNN's RSS feed, which we'd like to recognize as RSS.
static const char kCNNRSS[] =
@@ -324,43 +323,39 @@ TEST(MimeSnifferTest, XMLTest) {
"version=\"2.0\">";
// CNN's RSS
EXPECT_EQ("application/rss+xml",
- SniffMimeType(kCNNRSS, std::string(), "text/xml"));
- EXPECT_EQ("text/plain", SniffMimeType(kCNNRSS, std::string(), "text/plain"));
+ SniffMimeType(kCNNRSS, "", "text/xml"));
+ EXPECT_EQ("text/plain",
+ SniffMimeType(kCNNRSS, "", "text/plain"));
// Don't sniff random XML as something different.
EXPECT_EQ("text/xml",
- SniffMimeType("<?xml?><notafeed", std::string(), "text/xml"));
+ SniffMimeType("<?xml?><notafeed", "", "text/xml"));
// Don't sniff random plain-text as something different.
EXPECT_EQ("text/plain",
- SniffMimeType("<?xml?><notafeed", std::string(), "text/plain"));
+ SniffMimeType("<?xml?><notafeed", "", "text/plain"));
// Positive test for the two instances we upgrade to XHTML.
EXPECT_EQ("application/xhtml+xml",
SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "text/xml"));
+ "", "text/xml"));
EXPECT_EQ("application/xhtml+xml",
SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "application/xml"));
+ "", "application/xml"));
// Following our behavior with HTML, don't call other mime types XHTML.
EXPECT_EQ("text/plain",
SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "text/plain"));
+ "", "text/plain"));
EXPECT_EQ("application/rss+xml",
SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "application/rss+xml"));
+ "", "application/rss+xml"));
// Don't sniff other HTML-looking bits as HTML.
EXPECT_EQ("text/xml",
- SniffMimeType("<html><head>", std::string(), "text/xml"));
+ SniffMimeType("<html><head>", "", "text/xml"));
EXPECT_EQ("text/xml",
SniffMimeType("<foo><html xmlns=\"http://www.w3.org/1999/xhtml\">",
- std::string(),
- "text/xml"));
+ "", "text/xml"));
}
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index b3053a6..21a05bf 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -967,7 +967,7 @@ const std::string GetIANAMediaType(const std::string& mime_type) {
return kIanaMediaTypes[i].name;
}
}
- return std::string();
+ return "";
}
CertificateMimeType GetCertificateMimeTypeForMimeType(
diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc
index 565f9de..ee6663b 100644
--- a/net/base/mime_util_unittest.cc
+++ b/net/base/mime_util_unittest.cc
@@ -93,11 +93,11 @@ TEST(MimeUtilTest, MatchesMimeType) {
"application/html+xml"));
EXPECT_TRUE(MatchesMimeType("application/*+xml", "application/+xml"));
EXPECT_TRUE(MatchesMimeType("aaa*aaa", "aaaaaa"));
- EXPECT_TRUE(MatchesMimeType("*", std::string()));
+ EXPECT_TRUE(MatchesMimeType("*", ""));
EXPECT_FALSE(MatchesMimeType("video/", "video/x-mpeg"));
- EXPECT_FALSE(MatchesMimeType(std::string(), "video/x-mpeg"));
- EXPECT_FALSE(MatchesMimeType(std::string(), std::string()));
- EXPECT_FALSE(MatchesMimeType("video/x-mpeg", std::string()));
+ EXPECT_FALSE(MatchesMimeType("", "video/x-mpeg"));
+ EXPECT_FALSE(MatchesMimeType("", ""));
+ EXPECT_FALSE(MatchesMimeType("video/x-mpeg", ""));
EXPECT_FALSE(MatchesMimeType("application/*+xml", "application/xml"));
EXPECT_FALSE(MatchesMimeType("application/*+xml",
"application/html+xmlz"));
@@ -219,7 +219,7 @@ TEST(MimeUtilTest, TestIsMimeType) {
TEST(MimeUtilTest, TestToIANAMediaType) {
EXPECT_EQ("", GetIANAMediaType("texting/driving"));
EXPECT_EQ("", GetIANAMediaType("ham/sandwich"));
- EXPECT_EQ("", GetIANAMediaType(std::string()));
+ EXPECT_EQ("", GetIANAMediaType(""));
EXPECT_EQ("", GetIANAMediaType("/application/hamsandwich"));
EXPECT_EQ("application", GetIANAMediaType("application/poodle-wrestler"));
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 18d00fe..066812c 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1433,7 +1433,7 @@ std::string NetAddressToString(const struct sockaddr* sa,
if (!GetIPAddressFromSockAddr(sa, sock_addr_len, &address,
&address_len, NULL)) {
NOTREACHED();
- return std::string();
+ return "";
}
return IPAddressToString(address, address_len);
}
@@ -1446,7 +1446,7 @@ std::string NetAddressToStringWithPort(const struct sockaddr* sa,
if (!GetIPAddressFromSockAddr(sa, sock_addr_len, &address,
&address_len, &port)) {
NOTREACHED();
- return std::string();
+ return "";
}
return IPAddressToStringWithPort(address, address_len, port);
}
diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc
index ab8a236..8512d09 100644
--- a/net/base/net_util_unittest.cc
+++ b/net/base/net_util_unittest.cc
@@ -2596,14 +2596,10 @@ TEST(NetUtilTest, FormatUrlParsed) {
formatted.substr(parsed.ref.begin, parsed.ref.len));
// View-source case.
- formatted =
- FormatUrl(GURL("view-source:http://user:passwd@host:81/path?query#ref"),
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- &parsed,
- NULL,
- NULL);
+ formatted = FormatUrl(
+ GURL("view-source:http://user:passwd@host:81/path?query#ref"),
+ "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, &parsed,
+ NULL, NULL);
EXPECT_EQ(WideToUTF16(L"view-source:http://host:81/path?query#ref"),
formatted);
EXPECT_EQ(WideToUTF16(L"view-source:http"),
@@ -2622,13 +2618,9 @@ TEST(NetUtilTest, FormatUrlParsed) {
formatted.substr(parsed.ref.begin, parsed.ref.len));
// omit http case.
- formatted = FormatUrl(GURL("http://host:8000/a?b=c#d"),
- std::string(),
- kFormatUrlOmitHTTP,
- UnescapeRule::NORMAL,
- &parsed,
- NULL,
- NULL);
+ formatted = FormatUrl(
+ GURL("http://host:8000/a?b=c#d"),
+ "", kFormatUrlOmitHTTP, UnescapeRule::NORMAL, &parsed, NULL, NULL);
EXPECT_EQ(WideToUTF16(L"host:8000/a?b=c#d"), formatted);
EXPECT_FALSE(parsed.scheme.is_valid());
EXPECT_FALSE(parsed.username.is_valid());
@@ -2645,13 +2637,9 @@ TEST(NetUtilTest, FormatUrlParsed) {
formatted.substr(parsed.ref.begin, parsed.ref.len));
// omit http starts with ftp case.
- formatted = FormatUrl(GURL("http://ftp.host:8000/a?b=c#d"),
- std::string(),
- kFormatUrlOmitHTTP,
- UnescapeRule::NORMAL,
- &parsed,
- NULL,
- NULL);
+ formatted = FormatUrl(
+ GURL("http://ftp.host:8000/a?b=c#d"),
+ "", kFormatUrlOmitHTTP, UnescapeRule::NORMAL, &parsed, NULL, NULL);
EXPECT_EQ(WideToUTF16(L"http://ftp.host:8000/a?b=c#d"), formatted);
EXPECT_TRUE(parsed.scheme.is_valid());
EXPECT_FALSE(parsed.username.is_valid());
@@ -2670,13 +2658,9 @@ TEST(NetUtilTest, FormatUrlParsed) {
formatted.substr(parsed.ref.begin, parsed.ref.len));
// omit http starts with 'f' case.
- formatted = FormatUrl(GURL("http://f/"),
- std::string(),
- kFormatUrlOmitHTTP,
- UnescapeRule::NORMAL,
- &parsed,
- NULL,
- NULL);
+ formatted = FormatUrl(
+ GURL("http://f/"),
+ "", kFormatUrlOmitHTTP, UnescapeRule::NORMAL, &parsed, NULL, NULL);
EXPECT_EQ(WideToUTF16(L"f/"), formatted);
EXPECT_FALSE(parsed.scheme.is_valid());
EXPECT_FALSE(parsed.username.is_valid());
@@ -2698,13 +2682,9 @@ TEST(NetUtilTest, FormatUrlRoundTripPathASCII) {
GURL url(std::string("http://www.google.com/") +
static_cast<char>(test_char));
size_t prefix_len;
- base::string16 formatted = FormatUrl(url,
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- NULL,
- &prefix_len,
- NULL);
+ base::string16 formatted = FormatUrl(
+ url, "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL,
+ &prefix_len, NULL);
EXPECT_EQ(url.spec(), GURL(formatted).spec());
}
}
@@ -2719,13 +2699,9 @@ TEST(NetUtilTest, FormatUrlRoundTripPathEscaped) {
GURL url(original_url);
size_t prefix_len;
- base::string16 formatted = FormatUrl(url,
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- NULL,
- &prefix_len,
- NULL);
+ base::string16 formatted = FormatUrl(
+ url, "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL,
+ &prefix_len, NULL);
EXPECT_EQ(url.spec(), GURL(formatted).spec());
}
}
@@ -2737,13 +2713,9 @@ TEST(NetUtilTest, FormatUrlRoundTripQueryASCII) {
GURL url(std::string("http://www.google.com/?") +
static_cast<char>(test_char));
size_t prefix_len;
- base::string16 formatted = FormatUrl(url,
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- NULL,
- &prefix_len,
- NULL);
+ base::string16 formatted = FormatUrl(
+ url, "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL,
+ &prefix_len, NULL);
EXPECT_EQ(url.spec(), GURL(formatted).spec());
}
}
@@ -2762,13 +2734,9 @@ TEST(NetUtilTest, FormatUrlRoundTripQueryEscaped) {
GURL url(original_url);
size_t prefix_len;
- base::string16 formatted = FormatUrl(url,
- std::string(),
- kFormatUrlOmitUsernamePassword,
- UnescapeRule::NORMAL,
- NULL,
- &prefix_len,
- NULL);
+ base::string16 formatted = FormatUrl(
+ url, "", kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL,
+ &prefix_len, NULL);
if (test_char &&
strchr(kUnescapedCharacters, static_cast<char>(test_char))) {
@@ -3068,7 +3036,7 @@ TEST(NetUtilTest, ParseIPLiteralToNumber_FailParse) {
EXPECT_FALSE(ParseIPLiteralToNumber("bad value", &number));
EXPECT_FALSE(ParseIPLiteralToNumber("bad:value", &number));
- EXPECT_FALSE(ParseIPLiteralToNumber(std::string(), &number));
+ EXPECT_FALSE(ParseIPLiteralToNumber("", &number));
EXPECT_FALSE(ParseIPLiteralToNumber("192.168.0.1:30", &number));
EXPECT_FALSE(ParseIPLiteralToNumber(" 192.168.0.1 ", &number));
EXPECT_FALSE(ParseIPLiteralToNumber("[::1]", &number));
diff --git a/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc b/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
index 8ad8a55..7ae5da4 100644
--- a/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
+++ b/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
@@ -79,7 +79,7 @@ TEST_F(RegistryControlledDomainTest, TestGetDomainAndRegistry) {
EXPECT_EQ("baz.com", GetDomainFromURL("http://baz.com")); // none
EXPECT_EQ("baz.com.", GetDomainFromURL("http://baz.com.")); // none
- EXPECT_EQ("", GetDomainFromURL(std::string()));
+ EXPECT_EQ("", GetDomainFromURL(""));
EXPECT_EQ("", GetDomainFromURL("http://"));
EXPECT_EQ("", GetDomainFromURL("file:///C:/file.html"));
EXPECT_EQ("", GetDomainFromURL("http://foo.com.."));
@@ -108,7 +108,7 @@ TEST_F(RegistryControlledDomainTest, TestGetDomainAndRegistry) {
EXPECT_EQ("baz.com", GetDomainFromHost("baz.com")); // none
EXPECT_EQ("baz.com.", GetDomainFromHost("baz.com.")); // none
- EXPECT_EQ("", GetDomainFromHost(std::string()));
+ EXPECT_EQ("", GetDomainFromHost(""));
EXPECT_EQ("", GetDomainFromHost("foo.com.."));
EXPECT_EQ("", GetDomainFromHost("..."));
EXPECT_EQ("", GetDomainFromHost("192.168.0.1"));
@@ -143,7 +143,7 @@ TEST_F(RegistryControlledDomainTest, TestGetRegistryLength) {
EXPECT_EQ(3U, GetRegistryLengthFromURL("http://baz.com", true)); // none
EXPECT_EQ(4U, GetRegistryLengthFromURL("http://baz.com.", true)); // none
- EXPECT_EQ(std::string::npos, GetRegistryLengthFromURL(std::string(), false));
+ EXPECT_EQ(std::string::npos, GetRegistryLengthFromURL("", false));
EXPECT_EQ(std::string::npos, GetRegistryLengthFromURL("http://", false));
EXPECT_EQ(std::string::npos,
GetRegistryLengthFromURL("file:///C:/file.html", false));
@@ -177,7 +177,7 @@ TEST_F(RegistryControlledDomainTest, TestGetRegistryLength) {
EXPECT_EQ(3U, GetRegistryLengthFromHost("baz.com", true)); // none
EXPECT_EQ(4U, GetRegistryLengthFromHost("baz.com.", true)); // none
- EXPECT_EQ(std::string::npos, GetRegistryLengthFromHost(std::string(), false));
+ EXPECT_EQ(std::string::npos, GetRegistryLengthFromHost("", false));
EXPECT_EQ(0U, GetRegistryLengthFromHost("foo.com..", false));
EXPECT_EQ(0U, GetRegistryLengthFromHost("..", false));
EXPECT_EQ(0U, GetRegistryLengthFromHost("192.168.0.1", false));
diff --git a/net/base/sdch_filter_unittest.cc b/net/base/sdch_filter_unittest.cc
index 1cc70cb..2e0f5ec 100644
--- a/net/base/sdch_filter_unittest.cc
+++ b/net/base/sdch_filter_unittest.cc
@@ -1346,7 +1346,7 @@ TEST_F(SdchFilterTest, PathMatch) {
// Make sure less that sufficient prefix match is false.
EXPECT_FALSE(PathMatch("/sear", "/search"));
EXPECT_FALSE(PathMatch("/", "/search"));
- EXPECT_FALSE(PathMatch(std::string(), "/search"));
+ EXPECT_FALSE(PathMatch("", "/search"));
// Add examples with several levels of direcories in the restriction.
EXPECT_FALSE(PathMatch("/search/something", "search/s"));
diff --git a/net/cookies/canonical_cookie_unittest.cc b/net/cookies/canonical_cookie_unittest.cc
index 161b27f..d7c25d188 100644
--- a/net/cookies/canonical_cookie_unittest.cc
+++ b/net/cookies/canonical_cookie_unittest.cc
@@ -55,16 +55,8 @@ TEST(CanonicalCookieTest, Constructor) {
EXPECT_EQ("/test", cookie.Path());
EXPECT_FALSE(cookie.IsSecure());
- CanonicalCookie cookie2(url,
- "A",
- "2",
- std::string(),
- std::string(),
- current_time,
- base::Time(),
- current_time,
- false,
- false);
+ CanonicalCookie cookie2(url, "A", "2", "", "", current_time, base::Time(),
+ current_time, false, false);
EXPECT_EQ(url.GetOrigin().spec(), cookie.Source());
EXPECT_EQ("A", cookie2.Name());
EXPECT_EQ("2", cookie2.Value());
@@ -295,7 +287,7 @@ TEST(CanonicalCookieTest, IsOnPath) {
EXPECT_TRUE(cookie->IsOnPath("/test/bar.html"));
// Test the empty string edge case.
- EXPECT_FALSE(cookie->IsOnPath(std::string()));
+ EXPECT_FALSE(cookie->IsOnPath(""));
cookie.reset(
CanonicalCookie::Create(GURL("http://www.example.com/test/foo.html"),
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index b3688c3..116d486 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -233,44 +233,20 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> {
base::Time(), false, false));
// Host cookies
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_1,
- "host_1",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- false));
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "host_2",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- false));
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_3,
- "host_3",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_1,
+ "host_1", "X", "", "/",
+ base::Time(), false, false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "host_2", "X", "", "/",
+ base::Time(), false, false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_3,
+ "host_3", "X", "", "/",
+ base::Time(), false, false));
// Http_only cookie
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "httpo_check",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- true));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "httpo_check", "X", "", "/",
+ base::Time(), false, true));
// Secure cookies
EXPECT_TRUE(this->SetCookieWithDetails(cm,
@@ -278,14 +254,9 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> {
"sec_dom", "X", ".math.harvard.edu",
"/", base::Time(), true, false));
EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2_secure,
- "sec_host",
- "X",
- std::string(),
- "/",
- base::Time(),
- true,
- false));
+ url_top_level_domain_plus_2_secure,
+ "sec_host", "X", "", "/",
+ base::Time(), true, false));
// Domain path cookies
EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
@@ -298,24 +269,14 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> {
base::Time(), false, false));
// Host path cookies
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "host_path_1",
- "X",
- std::string(),
- "/dir1",
- base::Time(),
- false,
- false));
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "host_path_2",
- "X",
- std::string(),
- "/dir1/dir2",
- base::Time(),
- false,
- false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "host_path_1", "X",
+ "", "/dir1",
+ base::Time(), false, false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "host_path_2", "X",
+ "", "/dir1/dir2",
+ base::Time(), false, false));
EXPECT_EQ(13U, this->GetAllCookies(cm).size());
}
@@ -2244,7 +2205,7 @@ TEST_F(CookieMonsterTest, PersisentCookieStorageTest) {
EXPECT_EQ(CookieStoreCommand::ADD, store->commands()[0].type);
// Remove it.
EXPECT_TRUE(SetCookie(cm, url_google_,"A=B; max-age=0"));
- this->MatchCookieLines(std::string(), GetCookies(cm, url_google_));
+ this->MatchCookieLines("", GetCookies(cm, url_google_));
ASSERT_EQ(2u, store->commands().size());
EXPECT_EQ(CookieStoreCommand::REMOVE, store->commands()[1].type);
diff --git a/net/cookies/cookie_store_test_helpers.cc b/net/cookies/cookie_store_test_helpers.cc
index 6ae4357d..e499538 100644
--- a/net/cookies/cookie_store_test_helpers.cc
+++ b/net/cookies/cookie_store_test_helpers.cc
@@ -90,7 +90,7 @@ std::string DelayedCookieMonster::GetCookiesWithOptions(
const GURL& url,
const CookieOptions& options) {
ADD_FAILURE();
- return std::string();
+ return "";
}
void DelayedCookieMonster::DeleteCookie(const GURL& url,
diff --git a/net/cookies/cookie_store_unittest.h b/net/cookies/cookie_store_unittest.h
index 0d2d7ed..134a193 100644
--- a/net/cookies/cookie_store_unittest.h
+++ b/net/cookies/cookie_store_unittest.h
@@ -275,10 +275,9 @@ TYPED_TEST_P(CookieStoreTest, DomainTest) {
// Test domain enforcement, should fail on a sub-domain or something too deep.
EXPECT_FALSE(this->SetCookie(cs, this->url_google_, "I=J; domain=.izzle"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL("http://a.izzle")));
- EXPECT_FALSE(this->SetCookie(
- cs, this->url_google_, "K=L; domain=.bla.www.google.izzle"));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL("http://a.izzle")));
+ EXPECT_FALSE(this->SetCookie(cs, this->url_google_,
+ "K=L; domain=.bla.www.google.izzle"));
this->MatchCookieLines("C=D; E=F; G=H",
this->GetCookies(cs, GURL("http://bla.www.google.izzle")));
this->MatchCookieLines("A=B; C=D; E=F; G=H",
@@ -293,8 +292,7 @@ TYPED_TEST_P(CookieStoreTest, DomainWithTrailingDotTest) {
"a=1; domain=.www.google.com."));
EXPECT_FALSE(this->SetCookie(cs, this->url_google_,
"b=2; domain=.www.google.com.."));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
}
// Test that cookies can bet set on higher level domains.
@@ -368,7 +366,7 @@ TYPED_TEST_P(CookieStoreTest, InvalidDomainTest) {
EXPECT_FALSE(this->SetCookie(cs, url_foobar,
"o=15; domain=.foo.bar.com#sup"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_foobar));
+ this->MatchCookieLines("", this->GetCookies(cs, url_foobar));
}
{
@@ -379,7 +377,7 @@ TYPED_TEST_P(CookieStoreTest, InvalidDomainTest) {
GURL url_foocom("http://foo.com.com");
EXPECT_FALSE(this->SetCookie(cs, url_foocom,
"a=1; domain=.foo.com.com.com"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_foocom));
+ this->MatchCookieLines("", this->GetCookies(cs, url_foocom));
}
}
@@ -404,8 +402,8 @@ TYPED_TEST_P(CookieStoreTest, DomainWithoutLeadingDotTest) {
this->MatchCookieLines("a=1", this->GetCookies(cs, url));
this->MatchCookieLines("a=1",
this->GetCookies(cs, GURL("http://sub.www.google.com")));
- this->MatchCookieLines(
- std::string(), this->GetCookies(cs, GURL("http://something-else.com")));
+ this->MatchCookieLines("",
+ this->GetCookies(cs, GURL("http://something-else.com")));
}
}
@@ -431,11 +429,11 @@ TYPED_TEST_P(CookieStoreTest, TestIpAddress) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
EXPECT_FALSE(this->SetCookie(cs, url_ip, "b=2; domain=.1.2.3.4"));
EXPECT_FALSE(this->SetCookie(cs, url_ip, "c=3; domain=.3.4"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_ip));
+ this->MatchCookieLines("", this->GetCookies(cs, url_ip));
// It should be allowed to set a cookie if domain= matches the IP address
// exactly. This matches IE/Firefox, even though it seems a bit wrong.
EXPECT_FALSE(this->SetCookie(cs, url_ip, "b=2; domain=1.2.3.3"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_ip));
+ this->MatchCookieLines("", this->GetCookies(cs, url_ip));
EXPECT_TRUE(this->SetCookie(cs, url_ip, "b=2; domain=1.2.3.4"));
this->MatchCookieLines("b=2", this->GetCookies(cs, url_ip));
}
@@ -453,12 +451,10 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
this->MatchCookieLines("a=1", this->GetCookies(cs, url));
// Make sure it doesn't show up for a normal .com, it should be a host
// not a domain cookie.
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://hopefully-no-cookies.com/")));
if (TypeParam::supports_non_dotted_domains) {
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL("http://.com/")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL("http://.com/")));
}
}
@@ -469,8 +465,7 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
if (TypeParam::supports_trailing_dots) {
EXPECT_TRUE(this->SetCookie(cs, url, "a=1"));
this->MatchCookieLines("a=1", this->GetCookies(cs, url));
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://hopefully-no-cookies.com./")));
} else {
EXPECT_FALSE(this->SetCookie(cs, url, "a=1"));
@@ -482,7 +477,7 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
GURL url("http://a.b");
EXPECT_FALSE(this->SetCookie(cs, url, "a=1; domain=.b"));
EXPECT_FALSE(this->SetCookie(cs, url, "b=2; domain=b"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url));
+ this->MatchCookieLines("", this->GetCookies(cs, url));
}
{ // Same test as above, but explicitly on a known TLD (com).
@@ -490,7 +485,7 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
GURL url("http://google.com");
EXPECT_FALSE(this->SetCookie(cs, url, "a=1; domain=.com"));
EXPECT_FALSE(this->SetCookie(cs, url, "b=2; domain=com"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url));
+ this->MatchCookieLines("", this->GetCookies(cs, url));
}
{ // Make sure can't set cookie on TLD which is dotted.
@@ -498,12 +493,11 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
GURL url("http://google.co.uk");
EXPECT_FALSE(this->SetCookie(cs, url, "a=1; domain=.co.uk"));
EXPECT_FALSE(this->SetCookie(cs, url, "b=2; domain=.uk"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url));
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("", this->GetCookies(cs, url));
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://something-else.co.uk")));
- this->MatchCookieLines(
- std::string(), this->GetCookies(cs, GURL("http://something-else.uk")));
+ this->MatchCookieLines("",
+ this->GetCookies(cs, GURL("http://something-else.uk")));
}
{ // Intranet URLs should only be able to set host cookies.
@@ -539,11 +533,9 @@ TYPED_TEST_P(CookieStoreTest, TestHostEndsWithDot) {
}
// Make sure there weren't any side effects.
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://hopefully-no-cookies.com/")));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL("http://.com/")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL("http://.com/")));
}
TYPED_TEST_P(CookieStoreTest, InvalidScheme) {
@@ -560,7 +552,7 @@ TYPED_TEST_P(CookieStoreTest, InvalidScheme_Read) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
EXPECT_TRUE(this->SetCookie(cs, GURL(kUrlGoogle), kValidDomainCookieLine));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, GURL(kUrlFtp)));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL(kUrlFtp)));
}
TYPED_TEST_P(CookieStoreTest, PathTest) {
@@ -573,9 +565,8 @@ TYPED_TEST_P(CookieStoreTest, PathTest) {
this->MatchCookieLines("A=B",
this->GetCookies(cs, GURL(url + "/wee/war/more/more")));
if (!TypeParam::has_path_prefix_bug)
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL(url + "/weehee")));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, GURL(url + "/")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL(url + "/weehee")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL(url + "/")));
// If we add a 0 length path, it should default to /
EXPECT_TRUE(this->SetCookie(cs, GURL(url), "A=C; path="));
@@ -621,17 +612,15 @@ TYPED_TEST_P(CookieStoreTest, HttpOnlyTest) {
options));
// Check httponly read protection.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
- this->MatchCookieLines(
- "A=B", this->GetCookiesWithOptions(cs, this->url_google_, options));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("A=B",
+ this->GetCookiesWithOptions(cs, this->url_google_, options));
// Check httponly overwrite protection.
EXPECT_FALSE(this->SetCookie(cs, this->url_google_, "A=C"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
- this->MatchCookieLines(
- "A=B", this->GetCookiesWithOptions(cs, this->url_google_, options));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("A=B",
+ this->GetCookiesWithOptions(cs, this->url_google_, options));
EXPECT_TRUE(this->SetCookieWithOptions(cs, this->url_google_, "A=C",
options));
this->MatchCookieLines("A=C", this->GetCookies(cs, this->url_google_));
@@ -656,7 +645,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
// Delete it via Max-Age.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) + "; max-age=0"));
- this->MatchCookieLineWithTimeout(cs, this->url_google_, std::string());
+ this->MatchCookieLineWithTimeout(cs, this->url_google_, "");
// Create a session cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_, kValidCookieLine));
@@ -665,8 +654,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) +
"; expires=Mon, 18-Apr-1977 22:50:13 GMT"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
// Create a persistent cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
@@ -677,7 +665,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
// Delete it via Max-Age.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) + "; max-age=0"));
- this->MatchCookieLineWithTimeout(cs, this->url_google_, std::string());
+ this->MatchCookieLineWithTimeout(cs, this->url_google_, "");
// Create a persistent cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
@@ -688,8 +676,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) +
"; expires=Mon, 18-Apr-1977 22:50:13 GMT"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
// Create a persistent cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
@@ -716,8 +703,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) +
"; expires=Thu, 1-Jan-1970 00:00:00 GMT"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
}
TYPED_TEST_P(CookieStoreTest, TestDeleteAllCreatedBetween) {
@@ -745,8 +731,7 @@ TYPED_TEST_P(CookieStoreTest, TestDeleteAllCreatedBetween) {
// Remove the cookie with an interval defined by two dates.
EXPECT_EQ(1, this->DeleteCreatedBetween(cs, last_minute, next_minute));
// Check that the cookie disappeared.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
// Add another cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_, "C=D"));
@@ -756,8 +741,7 @@ TYPED_TEST_P(CookieStoreTest, TestDeleteAllCreatedBetween) {
// Remove the cookie with a null ending time.
EXPECT_EQ(1, this->DeleteCreatedBetween(cs, last_minute, base::Time()));
// Check that the cookie disappeared.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
}
TYPED_TEST_P(CookieStoreTest, TestSecure) {
@@ -769,13 +753,11 @@ TYPED_TEST_P(CookieStoreTest, TestSecure) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_secure_, "A=B; secure"));
// The secure should overwrite the non-secure.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
this->MatchCookieLines("A=B", this->GetCookies(cs, this->url_google_secure_));
EXPECT_TRUE(this->SetCookie(cs, this->url_google_secure_, "D=E; secure"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
this->MatchCookieLines("A=B; D=E",
this->GetCookies(cs, this->url_google_secure_));
diff --git a/net/cookies/parsed_cookie.cc b/net/cookies/parsed_cookie.cc
index ecb8712..5cd542d 100644
--- a/net/cookies/parsed_cookie.cc
+++ b/net/cookies/parsed_cookie.cc
@@ -424,7 +424,7 @@ bool ParsedCookie::SetBool(size_t* index,
ClearAttributePair(*index);
return true;
} else {
- return SetAttributePair(index, key, std::string());
+ return SetAttributePair(index, key, "");
}
}
diff --git a/net/cookies/parsed_cookie_unittest.cc b/net/cookies/parsed_cookie_unittest.cc
index 57de115..3729650 100644
--- a/net/cookies/parsed_cookie_unittest.cc
+++ b/net/cookies/parsed_cookie_unittest.cc
@@ -208,7 +208,7 @@ TEST(ParsedCookieTest, InvalidTooLong) {
}
TEST(ParsedCookieTest, InvalidEmpty) {
- ParsedCookie pc((std::string()));
+ ParsedCookie pc("");
EXPECT_FALSE(pc.IsValid());
}
@@ -259,7 +259,7 @@ TEST(ParsedCookieTest, SerializeCookieLine) {
TEST(ParsedCookieTest, SetNameAndValue) {
- ParsedCookie empty((std::string()));
+ ParsedCookie empty("");
EXPECT_FALSE(empty.IsValid());
EXPECT_FALSE(empty.SetDomain("foobar.com"));
EXPECT_TRUE(empty.SetName("name"));
@@ -282,7 +282,7 @@ TEST(ParsedCookieTest, SetNameAndValue) {
EXPECT_EQ("name=value", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
- EXPECT_FALSE(pc.SetName(std::string()));
+ EXPECT_FALSE(pc.SetName(""));
EXPECT_EQ("name=value", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
@@ -303,7 +303,7 @@ TEST(ParsedCookieTest, SetNameAndValue) {
EXPECT_EQ("test=\"foobar\"", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
- EXPECT_TRUE(pc.SetValue(std::string()));
+ EXPECT_TRUE(pc.SetValue(""));
EXPECT_EQ("test=", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
}
@@ -313,7 +313,7 @@ TEST(ParsedCookieTest, SetAttributes) {
EXPECT_TRUE(pc.IsValid());
// Clear an unset attribute.
- EXPECT_TRUE(pc.SetDomain(std::string()));
+ EXPECT_TRUE(pc.SetDomain(""));
EXPECT_FALSE(pc.HasDomain());
EXPECT_EQ("name=value", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
@@ -355,10 +355,10 @@ TEST(ParsedCookieTest, SetAttributes) {
pc.ToCookieLine());
// Clear the rest and change the name and value.
- EXPECT_TRUE(pc.SetDomain(std::string()));
- EXPECT_TRUE(pc.SetPath(std::string()));
- EXPECT_TRUE(pc.SetExpires(std::string()));
- EXPECT_TRUE(pc.SetMaxAge(std::string()));
+ EXPECT_TRUE(pc.SetDomain(""));
+ EXPECT_TRUE(pc.SetPath(""));
+ EXPECT_TRUE(pc.SetExpires(""));
+ EXPECT_TRUE(pc.SetMaxAge(""));
EXPECT_TRUE(pc.SetIsSecure(false));
EXPECT_TRUE(pc.SetIsHttpOnly(false));
EXPECT_TRUE(pc.SetName("name2"));
diff --git a/net/dns/host_resolver_impl_unittest.cc b/net/dns/host_resolver_impl_unittest.cc
index 26bebeb..c9ebec0 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -107,7 +107,7 @@ class MockHostResolverProc : public HostResolverProc {
void AddRule(const std::string& hostname, AddressFamily family,
const std::string& ip_list) {
AddressList result;
- int rv = ParseAddressList(ip_list, std::string(), &result);
+ int rv = ParseAddressList(ip_list, "", &result);
DCHECK_EQ(OK, rv);
AddRule(hostname, family, result);
}
@@ -115,7 +115,7 @@ class MockHostResolverProc : public HostResolverProc {
void AddRuleForAllFamilies(const std::string& hostname,
const std::string& ip_list) {
AddressList result;
- int rv = ParseAddressList(ip_list, std::string(), &result);
+ int rv = ParseAddressList(ip_list, "", &result);
DCHECK_EQ(OK, rv);
AddRule(hostname, ADDRESS_FAMILY_UNSPECIFIED, result);
AddRule(hostname, ADDRESS_FAMILY_IPV4, result);
@@ -137,7 +137,7 @@ class MockHostResolverProc : public HostResolverProc {
--num_slots_available_;
--num_requests_waiting_;
if (rules_.empty()) {
- int rv = ParseAddressList("127.0.0.1", std::string(), addrlist);
+ int rv = ParseAddressList("127.0.0.1", "", addrlist);
DCHECK_EQ(OK, rv);
return OK;
}
@@ -527,8 +527,7 @@ TEST_F(HostResolverImplTest, AsynchronousLookup) {
}
TEST_F(HostResolverImplTest, FailedAsynchronousLookup) {
- proc_->AddRuleForAllFamilies(std::string(),
- "0.0.0.0"); // Default to failures.
+ proc_->AddRuleForAllFamilies("", "0.0.0.0"); // Default to failures.
proc_->SignalMultiple(1u);
Request* req = CreateRequest("just.testing", 80);
@@ -583,7 +582,7 @@ TEST_F(HostResolverImplTest, NumericIPv6Address) {
}
TEST_F(HostResolverImplTest, EmptyHost) {
- Request* req = CreateRequest(std::string(), 5555);
+ Request* req = CreateRequest("", 5555);
EXPECT_EQ(ERR_NAME_NOT_RESOLVED, req->Resolve());
}
@@ -1345,8 +1344,7 @@ TEST_F(HostResolverImplDnsTest, ServeFromHosts) {
DnsConfig config = CreateValidDnsConfig();
ChangeDnsConfig(config);
- proc_->AddRuleForAllFamilies(std::string(),
- std::string()); // Default to failures.
+ proc_->AddRuleForAllFamilies("", ""); // Default to failures.
proc_->SignalMultiple(1u); // For the first request which misses.
Request* req0 = CreateRequest("er_ipv4", 80);
@@ -1398,8 +1396,7 @@ TEST_F(HostResolverImplDnsTest, ServeFromHosts) {
TEST_F(HostResolverImplDnsTest, BypassDnsTask) {
ChangeDnsConfig(CreateValidDnsConfig());
- proc_->AddRuleForAllFamilies(std::string(),
- std::string()); // Default to failures.
+ proc_->AddRuleForAllFamilies("", ""); // Default to failures.
EXPECT_EQ(ERR_IO_PENDING, CreateRequest("ok.local", 80)->Resolve());
EXPECT_EQ(ERR_IO_PENDING, CreateRequest("ok.local.", 80)->Resolve());
@@ -1419,8 +1416,7 @@ TEST_F(HostResolverImplDnsTest, BypassDnsTask) {
TEST_F(HostResolverImplDnsTest, DisableDnsClientOnPersistentFailure) {
ChangeDnsConfig(CreateValidDnsConfig());
- proc_->AddRuleForAllFamilies(std::string(),
- std::string()); // Default to failures.
+ proc_->AddRuleForAllFamilies("", ""); // Default to failures.
// Check that DnsTask works.
Request* req = CreateRequest("ok_1", 80);
@@ -1474,7 +1470,7 @@ TEST_F(HostResolverImplDnsTest, DontDisableDnsClientOnSporadicFailure) {
EXPECT_EQ(OK, requests_[i]->WaitForResult()) << i;
// Make |proc_| default to failures.
- proc_->AddRuleForAllFamilies(std::string(), std::string());
+ proc_->AddRuleForAllFamilies("", "");
// DnsTask should still be enabled.
Request* req = CreateRequest("ok_last", 80);
diff --git a/net/dns/mapped_host_resolver_unittest.cc b/net/dns/mapped_host_resolver_unittest.cc
index d859466..8da95e1 100644
--- a/net/dns/mapped_host_resolver_unittest.cc
+++ b/net/dns/mapped_host_resolver_unittest.cc
@@ -18,7 +18,7 @@ namespace {
std::string FirstAddress(const AddressList& address_list) {
if (address_list.empty())
- return std::string();
+ return "";
return address_list.front().ToString();
}
@@ -171,7 +171,7 @@ TEST(MappedHostResolverTest, ParseInvalidRules) {
new MappedHostResolver(scoped_ptr<HostResolver>()));
EXPECT_FALSE(resolver->AddRuleFromString("xyz"));
- EXPECT_FALSE(resolver->AddRuleFromString(std::string()));
+ EXPECT_FALSE(resolver->AddRuleFromString(""));
EXPECT_FALSE(resolver->AddRuleFromString(" "));
EXPECT_FALSE(resolver->AddRuleFromString("EXCLUDE"));
EXPECT_FALSE(resolver->AddRuleFromString("EXCLUDE foo bar"));
diff --git a/net/dns/mock_host_resolver.cc b/net/dns/mock_host_resolver.cc
index e6ecf59..fb03836 100644
--- a/net/dns/mock_host_resolver.cc
+++ b/net/dns/mock_host_resolver.cc
@@ -256,13 +256,8 @@ void RuleBasedHostResolverProc::AddRuleForAddressFamily(
DCHECK(!replacement.empty());
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY |
HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
- Rule rule(Rule::kResolverTypeSystem,
- host_pattern,
- address_family,
- flags,
- replacement,
- std::string(),
- 0);
+ Rule rule(Rule::kResolverTypeSystem, host_pattern, address_family, flags,
+ replacement, "", 0);
rules_.push_back(rule);
}
@@ -291,13 +286,8 @@ void RuleBasedHostResolverProc::AddRuleWithLatency(
DCHECK(!replacement.empty());
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY |
HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
- Rule rule(Rule::kResolverTypeSystem,
- host_pattern,
- ADDRESS_FAMILY_UNSPECIFIED,
- flags,
- replacement,
- std::string(),
- latency_ms);
+ Rule rule(Rule::kResolverTypeSystem, host_pattern, ADDRESS_FAMILY_UNSPECIFIED,
+ flags, replacement, "", latency_ms);
rules_.push_back(rule);
}
@@ -305,13 +295,8 @@ void RuleBasedHostResolverProc::AllowDirectLookup(
const std::string& host_pattern) {
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY |
HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
- Rule rule(Rule::kResolverTypeSystem,
- host_pattern,
- ADDRESS_FAMILY_UNSPECIFIED,
- flags,
- std::string(),
- std::string(),
- 0);
+ Rule rule(Rule::kResolverTypeSystem, host_pattern, ADDRESS_FAMILY_UNSPECIFIED,
+ flags, "", "", 0);
rules_.push_back(rule);
}
@@ -319,13 +304,8 @@ void RuleBasedHostResolverProc::AddSimulatedFailure(
const std::string& host_pattern) {
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY |
HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
- Rule rule(Rule::kResolverTypeFail,
- host_pattern,
- ADDRESS_FAMILY_UNSPECIFIED,
- flags,
- std::string(),
- std::string(),
- 0);
+ Rule rule(Rule::kResolverTypeFail, host_pattern, ADDRESS_FAMILY_UNSPECIFIED,
+ flags, "", "", 0);
rules_.push_back(rule);
}
diff --git a/net/dns/single_request_host_resolver_unittest.cc b/net/dns/single_request_host_resolver_unittest.cc
index 1b0198f..3e2ea1e 100644
--- a/net/dns/single_request_host_resolver_unittest.cc
+++ b/net/dns/single_request_host_resolver_unittest.cc
@@ -68,7 +68,7 @@ TEST(SingleRequestHostResolverTest, NormalResolve) {
// Create a host resolver dependency that returns address "199.188.1.166"
// for resolutions of "watsup".
MockHostResolver resolver;
- resolver.rules()->AddIPLiteralRule("watsup", "199.188.1.166", std::string());
+ resolver.rules()->AddIPLiteralRule("watsup", "199.188.1.166", "");
SingleRequestHostResolver single_request_resolver(&resolver);
diff --git a/net/ftp/ftp_util.cc b/net/ftp/ftp_util.cc
index 68307a2..0eab465 100644
--- a/net/ftp/ftp_util.cc
+++ b/net/ftp/ftp_util.cc
@@ -107,7 +107,7 @@ std::string FtpUtil::VMSPathToUnix(const std::string& vms_path) {
std::string result(vms_path);
if (vms_path[0] == '[') {
// It's a relative path.
- ReplaceFirstSubstringAfterOffset(&result, 0, "[.", std::string());
+ ReplaceFirstSubstringAfterOffset(&result, 0, "[.", "");
} else {
// It's an absolute path.
result.insert(0, "/");
diff --git a/net/http/http_auth.cc b/net/http/http_auth.cc
index 9e9410b..fb7fc5d 100644
--- a/net/http/http_auth.cc
+++ b/net/http/http_auth.cc
@@ -146,7 +146,7 @@ std::string HttpAuth::GetChallengeHeaderName(Target target) {
return "WWW-Authenticate";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
@@ -159,7 +159,7 @@ std::string HttpAuth::GetAuthorizationHeaderName(Target target) {
return HttpRequestHeaders::kAuthorization;
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
@@ -172,7 +172,7 @@ std::string HttpAuth::GetAuthTargetString(Target target) {
return "server";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
diff --git a/net/http/http_auth_cache_unittest.cc b/net/http/http_auth_cache_unittest.cc
index 0bdb280..af3b25c 100644
--- a/net/http/http_auth_cache_unittest.cc
+++ b/net/http/http_auth_cache_unittest.cc
@@ -106,13 +106,11 @@ TEST(HttpAuthCacheTest, Basic) {
new MockAuthHandler(HttpAuth::AUTH_SCHEME_BASIC,
kRealm3,
HttpAuth::AUTH_PROXY));
- cache.Add(
- origin,
- realm3_basic_handler->realm(),
- realm3_basic_handler->auth_scheme(),
- "Basic realm=Realm3",
- CreateASCIICredentials("realm3-basic-user", "realm3-basic-password"),
- std::string());
+ cache.Add(origin, realm3_basic_handler->realm(),
+ realm3_basic_handler->auth_scheme(), "Basic realm=Realm3",
+ CreateASCIICredentials("realm3-basic-user",
+ "realm3-basic-password"),
+ "");
scoped_ptr<HttpAuthHandler> realm3_digest_handler(
new MockAuthHandler(HttpAuth::AUTH_SCHEME_DIGEST,
@@ -207,7 +205,7 @@ TEST(HttpAuthCacheTest, Basic) {
// Negative tests:
entry = cache.LookupByPath(origin, "/foo3/index.html");
EXPECT_FALSE(realm2_entry == entry);
- entry = cache.LookupByPath(origin, std::string());
+ entry = cache.LookupByPath(origin, "");
EXPECT_FALSE(realm2_entry == entry);
// Confirm we find the same realm, different auth scheme by path lookup
@@ -233,7 +231,7 @@ TEST(HttpAuthCacheTest, Basic) {
EXPECT_FALSE(realm3DigestEntry == entry);
// Lookup using empty path (may be used for proxy).
- entry = cache.LookupByPath(origin, std::string());
+ entry = cache.LookupByPath(origin, "");
EXPECT_FALSE(NULL == entry);
EXPECT_EQ(HttpAuth::AUTH_SCHEME_BASIC, entry->scheme());
EXPECT_EQ(kRealm3, entry->realm());
@@ -542,10 +540,7 @@ class HttpAuthCacheEvictionTest : public testing::Test {
}
void AddPathToRealm(int realm_i, int path_i) {
- cache_.Add(origin_,
- GenerateRealm(realm_i),
- HttpAuth::AUTH_SCHEME_BASIC,
- std::string(),
+ cache_.Add(origin_, GenerateRealm(realm_i), HttpAuth::AUTH_SCHEME_BASIC, "",
AuthCredentials(kUsername, kPassword),
GeneratePath(realm_i, path_i));
}
diff --git a/net/http/http_auth_filter_unittest.cc b/net/http/http_auth_filter_unittest.cc
index e6891dd..0aab9d4 100644
--- a/net/http/http_auth_filter_unittest.cc
+++ b/net/http/http_auth_filter_unittest.cc
@@ -35,17 +35,22 @@ struct UrlData {
};
static const UrlData urls[] = {
- { GURL(std::string()), HttpAuth::AUTH_NONE, false, 0 },
- { GURL("http://foo.cn"), HttpAuth::AUTH_PROXY, true, ALL_SERVERS_MATCH },
- { GURL("http://foo.cn"), HttpAuth::AUTH_SERVER, false, 0 },
- { GURL("http://slashdot.org"), HttpAuth::AUTH_NONE, false, 0 },
- { GURL("http://www.google.com"), HttpAuth::AUTH_SERVER, true, 1 << 0 },
- { GURL("http://www.google.com"), HttpAuth::AUTH_PROXY, true,
- ALL_SERVERS_MATCH },
+ { GURL(""),
+ HttpAuth::AUTH_NONE, false, 0 },
+ { GURL("http://foo.cn"),
+ HttpAuth::AUTH_PROXY, true, ALL_SERVERS_MATCH },
+ { GURL("http://foo.cn"),
+ HttpAuth::AUTH_SERVER, false, 0 },
+ { GURL("http://slashdot.org"),
+ HttpAuth::AUTH_NONE, false, 0 },
+ { GURL("http://www.google.com"),
+ HttpAuth::AUTH_SERVER, true, 1 << 0 },
+ { GURL("http://www.google.com"),
+ HttpAuth::AUTH_PROXY, true, ALL_SERVERS_MATCH },
{ GURL("https://login.facebook.com/login.php?login_attempt=1"),
HttpAuth::AUTH_NONE, false, 0 },
- { GURL("http://codereview.chromium.org/634002/show"), HttpAuth::AUTH_SERVER,
- true, 1 << 3 },
+ { GURL("http://codereview.chromium.org/634002/show"),
+ HttpAuth::AUTH_SERVER, true, 1 << 3 },
{ GURL("http://code.google.com/p/chromium/issues/detail?id=34505"),
HttpAuth::AUTH_SERVER, true, 1 << 0 },
{ GURL("http://code.google.com/p/chromium/issues/list?can=2&q=label:"
@@ -72,7 +77,7 @@ static const UrlData urls[] = {
TEST(HttpAuthFilterTest, EmptyFilter) {
// Create an empty filter
- HttpAuthFilterWhitelist filter((std::string()));
+ HttpAuthFilterWhitelist filter("");
for (size_t i = 0; i < arraysize(urls); i++) {
EXPECT_EQ(urls[i].target == HttpAuth::AUTH_PROXY,
filter.IsValid(urls[i].url, urls[i].target))
diff --git a/net/http/http_auth_gssapi_posix_unittest.cc b/net/http/http_auth_gssapi_posix_unittest.cc
index 1c3d12b..cbf4d3d 100644
--- a/net/http/http_auth_gssapi_posix_unittest.cc
+++ b/net/http/http_auth_gssapi_posix_unittest.cc
@@ -76,7 +76,7 @@ TEST(HttpAuthGSSAPIPOSIXTest, GSSAPIStartup) {
// TODO(ahendrickson): Manipulate the libraries and paths to test each of the
// libraries we expect, and also whether or not they have the interface
// functions we want.
- scoped_ptr<GSSAPILibrary> gssapi(new GSSAPISharedLibrary(std::string()));
+ scoped_ptr<GSSAPILibrary> gssapi(new GSSAPISharedLibrary(""));
DCHECK(gssapi.get());
EXPECT_TRUE(gssapi.get()->Init());
}
diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc
index cc90b52..bfc8312 100644
--- a/net/http/http_auth_handler_digest.cc
+++ b/net/http/http_auth_handler_digest.cc
@@ -270,12 +270,12 @@ bool HttpAuthHandlerDigest::ParseChallengeProperty(const std::string& name,
std::string HttpAuthHandlerDigest::QopToString(QualityOfProtection qop) {
switch (qop) {
case QOP_UNSPECIFIED:
- return std::string();
+ return "";
case QOP_AUTH:
return "auth";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
@@ -284,14 +284,14 @@ std::string HttpAuthHandlerDigest::AlgorithmToString(
DigestAlgorithm algorithm) {
switch (algorithm) {
case ALGORITHM_UNSPECIFIED:
- return std::string();
+ return "";
case ALGORITHM_MD5:
return "MD5";
case ALGORITHM_MD5_SESS:
return "MD5-sess";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
diff --git a/net/http/http_auth_unittest.cc b/net/http/http_auth_unittest.cc
index ff63c9b..88c7f95 100644
--- a/net/http/http_auth_unittest.cc
+++ b/net/http/http_auth_unittest.cc
@@ -304,7 +304,7 @@ TEST(HttpAuthTest, ChallengeTokenizerMismatchedQuotesNoValue) {
EXPECT_TRUE(parameters.GetNext());
EXPECT_TRUE(parameters.valid());
EXPECT_EQ(std::string("realm"), parameters.name());
- EXPECT_EQ(std::string(), parameters.value());
+ EXPECT_EQ(std::string(""), parameters.value());
EXPECT_FALSE(parameters.GetNext());
}
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 27c591d..a2a9dfc 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -445,7 +445,7 @@ int HttpCache::CreateBackend(disk_cache::Backend** backend,
// This is the only operation that we can do that is not related to any given
// entry, so we use an empty key for it.
- PendingOp* pending_op = GetPendingOp(std::string());
+ PendingOp* pending_op = GetPendingOp("");
if (pending_op->writer) {
if (!callback.is_null())
pending_op->pending_queue.push_back(item.release());
@@ -477,7 +477,7 @@ int HttpCache::GetBackendForTransaction(Transaction* trans) {
WorkItem* item = new WorkItem(
WI_CREATE_BACKEND, trans, net::CompletionCallback(), NULL);
- PendingOp* pending_op = GetPendingOp(std::string());
+ PendingOp* pending_op = GetPendingOp("");
DCHECK(pending_op->writer);
pending_op->pending_queue.push_back(item);
return ERR_IO_PENDING;
@@ -896,7 +896,7 @@ void HttpCache::RemovePendingTransaction(Transaction* trans) {
return;
if (building_backend_) {
- PendingOpsMap::const_iterator j = pending_ops_.find(std::string());
+ PendingOpsMap::const_iterator j = pending_ops_.find("");
if (j != pending_ops_.end())
found = RemovePendingTransactionFromPendingOp(j->second, trans);
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 467eb94..54d79f3 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -929,7 +929,7 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) {
// We treat any other 1xx in this same way (although in practice getting
// a 1xx that isn't a 100 is rare).
if (response_.headers->response_code() / 100 == 1) {
- response_.headers = new HttpResponseHeaders(std::string());
+ response_.headers = new HttpResponseHeaders("");
next_state_ = STATE_READ_HEADERS;
return OK;
}
diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc
index 0da9f2e..3f81030 100644
--- a/net/http/http_network_transaction_spdy2_unittest.cc
+++ b/net/http/http_network_transaction_spdy2_unittest.cc
@@ -461,24 +461,12 @@ CaptureGroupNameHttpProxySocketPool::CaptureGroupNameSocketPool(
CertVerifier* /* cert_verifier */)
: HttpProxyClientSocketPool(0, 0, NULL, host_resolver, NULL, NULL, NULL) {}
-template <>
+template<>
CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool(
HostResolver* host_resolver,
CertVerifier* cert_verifier)
- : SSLClientSocketPool(0,
- 0,
- NULL,
- host_resolver,
- cert_verifier,
- NULL,
- NULL,
- std::string(),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL) {}
+ : SSLClientSocketPool(0, 0, NULL, host_resolver, cert_verifier, NULL,
+ NULL, "", NULL, NULL, NULL, NULL, NULL, NULL) {}
//-----------------------------------------------------------------------------
@@ -8863,10 +8851,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test,
SSLClientSocketContext context;
context.cert_verifier = session_deps.cert_verifier.get();
ssl_connection->set_socket(session_deps.socket_factory->CreateSSLClientSocket(
- connection.release(),
- HostPortPair(std::string(), 443),
- ssl_config,
- context));
+ connection.release(), HostPortPair("" , 443), ssl_config, context));
EXPECT_EQ(ERR_IO_PENDING,
ssl_connection->socket()->Connect(callback.callback()));
EXPECT_EQ(OK, callback.WaitForResult());
diff --git a/net/http/http_network_transaction_spdy3_unittest.cc b/net/http/http_network_transaction_spdy3_unittest.cc
index 8a90c7b..3076326 100644
--- a/net/http/http_network_transaction_spdy3_unittest.cc
+++ b/net/http/http_network_transaction_spdy3_unittest.cc
@@ -461,24 +461,12 @@ CaptureGroupNameHttpProxySocketPool::CaptureGroupNameSocketPool(
CertVerifier* /* cert_verifier */)
: HttpProxyClientSocketPool(0, 0, NULL, host_resolver, NULL, NULL, NULL) {}
-template <>
+template<>
CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool(
HostResolver* host_resolver,
CertVerifier* cert_verifier)
- : SSLClientSocketPool(0,
- 0,
- NULL,
- host_resolver,
- cert_verifier,
- NULL,
- NULL,
- std::string(),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL) {}
+ : SSLClientSocketPool(0, 0, NULL, host_resolver, cert_verifier, NULL,
+ NULL, "", NULL, NULL, NULL, NULL, NULL, NULL) {}
//-----------------------------------------------------------------------------
@@ -8839,10 +8827,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test,
SSLClientSocketContext context;
context.cert_verifier = session_deps.cert_verifier.get();
ssl_connection->set_socket(session_deps.socket_factory->CreateSSLClientSocket(
- connection.release(),
- HostPortPair(std::string(), 443),
- ssl_config,
- context));
+ connection.release(), HostPortPair("" , 443), ssl_config, context));
EXPECT_EQ(ERR_IO_PENDING,
ssl_connection->socket()->Connect(callback.callback()));
EXPECT_EQ(OK, callback.WaitForResult());
diff --git a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc
index 48ac42c..77ccbed 100644
--- a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc
@@ -47,37 +47,26 @@ class HttpProxyClientSocketPoolSpdy2Test : public TestWithHttpParam {
protected:
HttpProxyClientSocketPoolSpdy2Test()
: ssl_config_(),
- ignored_transport_socket_params_(
- new TransportSocketParams(HostPortPair("proxy", 80),
- LOWEST,
- false,
- false,
- OnHostResolutionCallback())),
- ignored_ssl_socket_params_(
- new SSLSocketParams(ignored_transport_socket_params_,
- NULL,
- NULL,
- ProxyServer::SCHEME_DIRECT,
- HostPortPair("www.google.com", 443),
- ssl_config_,
- 0,
- false,
- false)),
+ ignored_transport_socket_params_(new TransportSocketParams(
+ HostPortPair("proxy", 80), LOWEST, false, false,
+ OnHostResolutionCallback())),
+ ignored_ssl_socket_params_(new SSLSocketParams(
+ ignored_transport_socket_params_, NULL, NULL,
+ ProxyServer::SCHEME_DIRECT, HostPortPair("www.google.com", 443),
+ ssl_config_, 0, false, false)),
tcp_histograms_("MockTCP"),
transport_socket_pool_(
- kMaxSockets,
- kMaxSocketsPerGroup,
+ kMaxSockets, kMaxSocketsPerGroup,
&tcp_histograms_,
session_deps_.deterministic_socket_factory.get()),
ssl_histograms_("MockSSL"),
- ssl_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
+ ssl_socket_pool_(kMaxSockets, kMaxSocketsPerGroup,
&ssl_histograms_,
session_deps_.host_resolver.get(),
session_deps_.cert_verifier.get(),
NULL /* server_bound_cert_store */,
NULL /* transport_security_state */,
- std::string() /* ssl_session_cache_shard */,
+ "" /* ssl_session_cache_shard */,
session_deps_.deterministic_socket_factory.get(),
&transport_socket_pool_,
NULL,
@@ -88,13 +77,13 @@ class HttpProxyClientSocketPoolSpdy2Test : public TestWithHttpParam {
http_proxy_histograms_("HttpProxyUnitTest"),
ssl_data_(NULL),
data_(NULL),
- pool_(kMaxSockets,
- kMaxSocketsPerGroup,
+ pool_(kMaxSockets, kMaxSocketsPerGroup,
&http_proxy_histograms_,
NULL,
&transport_socket_pool_,
&ssl_socket_pool_,
- NULL) {}
+ NULL) {
+ }
virtual ~HttpProxyClientSocketPoolSpdy2Test() {
}
@@ -126,16 +115,17 @@ class HttpProxyClientSocketPoolSpdy2Test : public TestWithHttpParam {
// Returns the a correctly constructed HttpProxyParms
// for the HTTP or HTTPS proxy.
scoped_refptr<HttpProxySocketParams> GetParams(bool tunnel) {
- return scoped_refptr<HttpProxySocketParams>(new HttpProxySocketParams(
- GetTcpParams(),
- GetSslParams(),
- GURL(tunnel ? "https://www.google.com/" : "http://www.google.com"),
- std::string(),
- HostPortPair("www.google.com", tunnel ? 443 : 80),
- session_->http_auth_cache(),
- session_->http_auth_handler_factory(),
- session_->spdy_session_pool(),
- tunnel));
+ return scoped_refptr<HttpProxySocketParams>(
+ new HttpProxySocketParams(
+ GetTcpParams(),
+ GetSslParams(),
+ GURL(tunnel ? "https://www.google.com/" : "http://www.google.com"),
+ "",
+ HostPortPair("www.google.com", tunnel ? 443 : 80),
+ session_->http_auth_cache(),
+ session_->http_auth_handler_factory(),
+ session_->spdy_session_pool(),
+ tunnel));
}
scoped_refptr<HttpProxySocketParams> GetTunnelParams() {
diff --git a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc
index 36e5869..86924fc 100644
--- a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc
@@ -47,37 +47,26 @@ class HttpProxyClientSocketPoolSpdy3Test : public TestWithHttpParam {
protected:
HttpProxyClientSocketPoolSpdy3Test()
: ssl_config_(),
- ignored_transport_socket_params_(
- new TransportSocketParams(HostPortPair("proxy", 80),
- LOWEST,
- false,
- false,
- OnHostResolutionCallback())),
- ignored_ssl_socket_params_(
- new SSLSocketParams(ignored_transport_socket_params_,
- NULL,
- NULL,
- ProxyServer::SCHEME_DIRECT,
- HostPortPair("www.google.com", 443),
- ssl_config_,
- 0,
- false,
- false)),
+ ignored_transport_socket_params_(new TransportSocketParams(
+ HostPortPair("proxy", 80), LOWEST, false, false,
+ OnHostResolutionCallback())),
+ ignored_ssl_socket_params_(new SSLSocketParams(
+ ignored_transport_socket_params_, NULL, NULL,
+ ProxyServer::SCHEME_DIRECT, HostPortPair("www.google.com", 443),
+ ssl_config_, 0, false, false)),
tcp_histograms_("MockTCP"),
transport_socket_pool_(
- kMaxSockets,
- kMaxSocketsPerGroup,
+ kMaxSockets, kMaxSocketsPerGroup,
&tcp_histograms_,
session_deps_.deterministic_socket_factory.get()),
ssl_histograms_("MockSSL"),
- ssl_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
+ ssl_socket_pool_(kMaxSockets, kMaxSocketsPerGroup,
&ssl_histograms_,
session_deps_.host_resolver.get(),
session_deps_.cert_verifier.get(),
NULL /* server_bound_cert_store */,
NULL /* transport_security_state */,
- std::string() /* ssl_session_cache_shard */,
+ "" /* ssl_session_cache_shard */,
session_deps_.deterministic_socket_factory.get(),
&transport_socket_pool_,
NULL,
@@ -88,13 +77,13 @@ class HttpProxyClientSocketPoolSpdy3Test : public TestWithHttpParam {
http_proxy_histograms_("HttpProxyUnitTest"),
ssl_data_(NULL),
data_(NULL),
- pool_(kMaxSockets,
- kMaxSocketsPerGroup,
+ pool_(kMaxSockets, kMaxSocketsPerGroup,
&http_proxy_histograms_,
NULL,
&transport_socket_pool_,
&ssl_socket_pool_,
- NULL) {}
+ NULL) {
+ }
virtual ~HttpProxyClientSocketPoolSpdy3Test() {
}
@@ -126,16 +115,17 @@ class HttpProxyClientSocketPoolSpdy3Test : public TestWithHttpParam {
// Returns the a correctly constructed HttpProxyParms
// for the HTTP or HTTPS proxy.
scoped_refptr<HttpProxySocketParams> GetParams(bool tunnel) {
- return scoped_refptr<HttpProxySocketParams>(new HttpProxySocketParams(
- GetTcpParams(),
- GetSslParams(),
- GURL(tunnel ? "https://www.google.com/" : "http://www.google.com"),
- std::string(),
- HostPortPair("www.google.com", tunnel ? 443 : 80),
- session_->http_auth_cache(),
- session_->http_auth_handler_factory(),
- session_->spdy_session_pool(),
- tunnel));
+ return scoped_refptr<HttpProxySocketParams>(
+ new HttpProxySocketParams(
+ GetTcpParams(),
+ GetSslParams(),
+ GURL(tunnel ? "https://www.google.com/" : "http://www.google.com"),
+ "",
+ HostPortPair("www.google.com", tunnel ? 443 : 80),
+ session_->http_auth_cache(),
+ session_->http_auth_handler_factory(),
+ session_->spdy_session_pool(),
+ tunnel));
}
scoped_refptr<HttpProxySocketParams> GetTunnelParams() {
diff --git a/net/http/http_security_headers_unittest.cc b/net/http/http_security_headers_unittest.cc
index 4f1e580..a142486 100644
--- a/net/http/http_security_headers_unittest.cc
+++ b/net/http/http_security_headers_unittest.cc
@@ -51,8 +51,7 @@ TEST_F(HttpSecurityHeadersTest, BogusHeaders) {
base::Time expiry = now;
bool include_subdomains = false;
- EXPECT_FALSE(
- ParseHSTSHeader(now, std::string(), &expiry, &include_subdomains));
+ EXPECT_FALSE(ParseHSTSHeader(now, "", &expiry, &include_subdomains));
EXPECT_FALSE(ParseHSTSHeader(now, " ", &expiry, &include_subdomains));
EXPECT_FALSE(ParseHSTSHeader(now, "abc", &expiry, &include_subdomains));
EXPECT_FALSE(ParseHSTSHeader(now, " abc", &expiry, &include_subdomains));
@@ -136,8 +135,7 @@ static void TestBogusPinsHeaders(HashValueTag tag) {
std::string good_pin = GetTestPin(2, tag);
std::string backup_pin = GetTestPin(4, tag);
- EXPECT_FALSE(
- ParseHPKPHeader(now, std::string(), chain_hashes, &expiry, &hashes));
+ EXPECT_FALSE(ParseHPKPHeader(now, "", chain_hashes, &expiry, &hashes));
EXPECT_FALSE(ParseHPKPHeader(now, " ", chain_hashes, &expiry, &hashes));
EXPECT_FALSE(ParseHPKPHeader(now, "abc", chain_hashes, &expiry, &hashes));
EXPECT_FALSE(ParseHPKPHeader(now, " abc", chain_hashes, &expiry, &hashes));
diff --git a/net/http/http_server_properties_impl_unittest.cc b/net/http/http_server_properties_impl_unittest.cc
index b9ef0bf..8dc9de3 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -65,7 +65,7 @@ TEST_F(SpdyServerPropertiesTest, Initialize) {
}
TEST_F(SpdyServerPropertiesTest, SupportsSpdyTest) {
- HostPortPair spdy_server_empty(std::string(), 443);
+ HostPortPair spdy_server_empty("", 443);
EXPECT_FALSE(impl_.SupportsSpdy(spdy_server_empty));
// Add www.google.com:443 as supporting SPDY.
@@ -89,7 +89,7 @@ TEST_F(SpdyServerPropertiesTest, SupportsSpdyTest) {
}
TEST_F(SpdyServerPropertiesTest, SetSupportsSpdy) {
- HostPortPair spdy_server_empty(std::string(), 443);
+ HostPortPair spdy_server_empty("", 443);
impl_.SetSupportsSpdy(spdy_server_empty, true);
EXPECT_FALSE(impl_.SupportsSpdy(spdy_server_empty));
@@ -134,7 +134,7 @@ TEST_F(SpdyServerPropertiesTest, GetSpdyServerList) {
EXPECT_EQ(0U, spdy_server_list.GetSize());
// Check empty server is not added.
- HostPortPair spdy_server_empty(std::string(), 443);
+ HostPortPair spdy_server_empty("", 443);
impl_.SetSupportsSpdy(spdy_server_empty, true);
impl_.GetSpdyServerList(&spdy_server_list);
EXPECT_EQ(0U, spdy_server_list.GetSize());
@@ -303,7 +303,7 @@ TEST_F(SpdySettingsServerPropertiesTest, Initialize) {
}
TEST_F(SpdySettingsServerPropertiesTest, SetSpdySetting) {
- HostPortPair spdy_server_empty(std::string(), 443);
+ HostPortPair spdy_server_empty("", 443);
const SettingsMap& settings_map0 = impl_.GetSpdySettings(spdy_server_empty);
EXPECT_EQ(0U, settings_map0.size()); // Returns kEmptySettingsMap.
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc
index f228d9a..0a9437f 100644
--- a/net/http/http_stream_factory_impl_unittest.cc
+++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -271,24 +271,11 @@ CapturePreconnectsHttpProxySocketPool::CapturePreconnectsSocketPool(
: HttpProxyClientSocketPool(0, 0, NULL, host_resolver, NULL, NULL, NULL),
last_num_streams_(-1) {}
-template <>
+template<>
CapturePreconnectsSSLSocketPool::CapturePreconnectsSocketPool(
- HostResolver* host_resolver,
- CertVerifier* cert_verifier)
- : SSLClientSocketPool(0,
- 0,
- NULL,
- host_resolver,
- cert_verifier,
- NULL,
- NULL,
- std::string(),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL),
+ HostResolver* host_resolver, CertVerifier* cert_verifier)
+ : SSLClientSocketPool(0, 0, NULL, host_resolver, cert_verifier, NULL,
+ NULL, "", NULL, NULL, NULL, NULL, NULL, NULL),
last_num_streams_(-1) {}
TEST(HttpStreamFactoryTest, PreconnectDirect) {
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc
index f86821c..083343d 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -966,12 +966,12 @@ TEST(HttpUtilTest, NameValuePairsIteratorCopyAndAssign) {
}
TEST(HttpUtilTest, NameValuePairsIteratorEmptyInput) {
- std::string data;
+ std::string data = "";
HttpUtil::NameValuePairsIterator parser(data.begin(), data.end(), ';');
EXPECT_TRUE(parser.valid());
- ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair(
- &parser, false, true, std::string(), std::string()));
+ ASSERT_NO_FATAL_FAILURE(
+ CheckNextNameValuePair(&parser, false, true, "", ""));
}
TEST(HttpUtilTest, NameValuePairsIterator) {
@@ -997,19 +997,19 @@ TEST(HttpUtilTest, NameValuePairsIterator) {
ASSERT_NO_FATAL_FAILURE(
CheckNextNameValuePair(&parser, true, true, "f", "'hello world'"));
ASSERT_NO_FATAL_FAILURE(
- CheckNextNameValuePair(&parser, true, true, "g", std::string()));
+ CheckNextNameValuePair(&parser, true, true, "g", ""));
ASSERT_NO_FATAL_FAILURE(
CheckNextNameValuePair(&parser, true, true, "h", "hello"));
- ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair(
- &parser, false, true, std::string(), std::string()));
+ ASSERT_NO_FATAL_FAILURE(
+ CheckNextNameValuePair(&parser, false, true, "", ""));
}
TEST(HttpUtilTest, NameValuePairsIteratorIllegalInputs) {
ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("alpha=1", "; beta"));
- ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair(std::string(), "beta"));
+ ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("", "beta"));
ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("alpha=1", "; 'beta'=2"));
- ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair(std::string(), "'beta'=2"));
+ ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("", "'beta'=2"));
ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("alpha=1", ";beta="));
ASSERT_NO_FATAL_FAILURE(CheckInvalidNameValuePair("alpha=1",
";beta=;cappa=2"));
@@ -1033,8 +1033,8 @@ TEST(HttpUtilTest, NameValuePairsIteratorExtraSeparators) {
CheckNextNameValuePair(&parser, true, true, "beta", "2"));
ASSERT_NO_FATAL_FAILURE(
CheckNextNameValuePair(&parser, true, true, "cappa", "3"));
- ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair(
- &parser, false, true, std::string(), std::string()));
+ ASSERT_NO_FATAL_FAILURE(
+ CheckNextNameValuePair(&parser, false, true, "", ""));
}
// See comments on the implementation of NameValuePairsIterator::GetNext
@@ -1046,6 +1046,6 @@ TEST(HttpUtilTest, NameValuePairsIteratorMissingEndQuote) {
ASSERT_NO_FATAL_FAILURE(
CheckNextNameValuePair(&parser, true, true, "name", "value"));
- ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair(
- &parser, false, true, std::string(), std::string()));
+ ASSERT_NO_FATAL_FAILURE(
+ CheckNextNameValuePair(&parser, false, true, "", ""));
}
diff --git a/net/http/http_vary_data.cc b/net/http/http_vary_data.cc
index 51b74a4..c716ca0 100644
--- a/net/http/http_vary_data.cc
+++ b/net/http/http_vary_data.cc
@@ -105,7 +105,7 @@ std::string HttpVaryData::GetRequestValue(
if (request_info.extra_headers.GetHeader(request_header, &result))
return result;
- return std::string();
+ return "";
}
// static
diff --git a/net/http/http_vary_data_unittest.cc b/net/http/http_vary_data_unittest.cc
index 93ee4f45..38e4e32 100644
--- a/net/http/http_vary_data_unittest.cc
+++ b/net/http/http_vary_data_unittest.cc
@@ -41,7 +41,7 @@ TEST(HttpVaryDataTest, IsInvalid) {
for (size_t i = 0; i < arraysize(kTestResponses); ++i) {
TestTransaction t;
- t.Init(std::string(), kTestResponses[i]);
+ t.Init("", kTestResponses[i]);
net::HttpVaryData v;
EXPECT_FALSE(v.is_valid());
diff --git a/net/proxy/dhcp_proxy_script_fetcher.cc b/net/proxy/dhcp_proxy_script_fetcher.cc
index 1771be0..4771d9d 100644
--- a/net/proxy/dhcp_proxy_script_fetcher.cc
+++ b/net/proxy/dhcp_proxy_script_fetcher.cc
@@ -9,7 +9,7 @@
namespace net {
std::string DhcpProxyScriptFetcher::GetFetcherName() const {
- return std::string();
+ return "";
}
DhcpProxyScriptFetcher::DhcpProxyScriptFetcher() {}
diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
index 5e0e108..b5503e5 100644
--- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
@@ -282,8 +282,7 @@ TEST_F(ProxyResolverV8TracingTest, Dns) {
host_resolver.rules()->AddRuleForAddressFamily(
"host1", ADDRESS_FAMILY_IPV4, "166.155.144.44");
- host_resolver.rules()
- ->AddIPLiteralRule("host1", "::1,192.168.1.1", std::string());
+ host_resolver.rules()->AddIPLiteralRule("host1", "::1,192.168.1.1", "");
host_resolver.rules()->AddSimulatedFailure("host2");
host_resolver.rules()->AddRule("host3", "166.155.144.33");
host_resolver.rules()->AddRule("host5", "166.155.144.55");
@@ -996,8 +995,7 @@ TEST_F(ProxyResolverV8TracingTest, MultipleResolvers) {
MockHostResolver host_resolver0;
host_resolver0.rules()->AddRuleForAddressFamily(
"host1", ADDRESS_FAMILY_IPV4, "166.155.144.44");
- host_resolver0.rules()
- ->AddIPLiteralRule("host1", "::1,192.168.1.1", std::string());
+ host_resolver0.rules()->AddIPLiteralRule("host1", "::1,192.168.1.1", "");
host_resolver0.rules()->AddSimulatedFailure("host2");
host_resolver0.rules()->AddRule("host3", "166.155.144.33");
host_resolver0.rules()->AddRule("host5", "166.155.144.55");
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index 53cc326..ec4a0fa 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -1723,7 +1723,7 @@ TEST_F(ProxyServiceTest, FallbackFromAutodetectToCustomPac) {
// the script download.
EXPECT_TRUE(fetcher->has_pending_request());
EXPECT_EQ(GURL("http://wpad/wpad.dat"), fetcher->pending_request_url());
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
// Next it should be trying the custom PAC url.
EXPECT_TRUE(fetcher->has_pending_request());
@@ -1872,12 +1872,12 @@ TEST_F(ProxyServiceTest, FallbackFromAutodetectToCustomToManual) {
// It should be trying to auto-detect first -- fail the download.
EXPECT_TRUE(fetcher->has_pending_request());
EXPECT_EQ(GURL("http://wpad/wpad.dat"), fetcher->pending_request_url());
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
// Next it should be trying the custom PAC url -- fail the download.
EXPECT_TRUE(fetcher->has_pending_request());
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
// Since we never managed to initialize a ProxyResolver, nothing should have
// been sent to it.
@@ -2251,7 +2251,7 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterFailure) {
//
// We simulate a failed download attempt, the proxy service should now
// fall-back to DIRECT connections.
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
ASSERT_TRUE(resolver->pending_requests().empty());
@@ -2604,7 +2604,7 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterSuccess) {
// to download the script.
EXPECT_TRUE(fetcher->has_pending_request());
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
MessageLoop::current()->RunUntilIdle();
@@ -2771,7 +2771,7 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterActivity) {
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
// This time we will fail the download, to simulate a PAC script change.
- fetcher->NotifyFetchCompletion(ERR_FAILED, std::string());
+ fetcher->NotifyFetchCompletion(ERR_FAILED, "");
// Drain the message loop, so ProxyService is notified of the change
// and has a chance to re-configure itself.
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index 1370ced..f3f4c33 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -348,7 +348,7 @@ TEST_F(QuicHttpStreamTest, GetRequest) {
stream_->ReadResponseHeaders(callback_.callback()));
// Send the response without a body.
- SetResponseString("404 Not Found", std::string());
+ SetResponseString("404 Not Found", "");
scoped_ptr<QuicEncryptedPacket> resp(
ConstructDataPacket(2, false, kFin, 0, response_data_));
ProcessPacket(*resp);
@@ -440,7 +440,7 @@ TEST_F(QuicHttpStreamTest, SendPostRequest) {
ProcessPacket(*ack);
// Send the response headers (but not the body).
- SetResponseString("200 OK", std::string());
+ SetResponseString("200 OK", "");
scoped_ptr<QuicEncryptedPacket> resp(
ConstructDataPacket(2, false, !kFin, 0, response_data_));
ProcessPacket(*resp);
@@ -502,7 +502,7 @@ TEST_F(QuicHttpStreamTest, SendChunkedPostRequest) {
ProcessPacket(*ack);
// Send the response headers (but not the body).
- SetResponseString("200 OK", std::string());
+ SetResponseString("200 OK", "");
scoped_ptr<QuicEncryptedPacket> resp(
ConstructDataPacket(2, false, !kFin, 0, response_data_));
ProcessPacket(*resp);
diff --git a/net/quic/quic_packet_creator_test.cc b/net/quic/quic_packet_creator_test.cc
index 2f4e2e9..5e7ed61 100644
--- a/net/quic/quic_packet_creator_test.cc
+++ b/net/quic/quic_packet_creator_test.cc
@@ -180,7 +180,7 @@ TEST_F(QuicPacketCreatorTest, CreateStreamFrameFinOnly) {
QuicFrame frame;
size_t consumed = creator_.CreateStreamFrame(1u, "", 0u, true, &frame);
EXPECT_EQ(0u, consumed);
- CheckStreamFrame(frame, 1u, std::string(), 0u, true);
+ CheckStreamFrame(frame, 1u, "", 0u, true);
delete frame.stream_frame;
}
diff --git a/net/quic/quic_packet_generator_test.cc b/net/quic/quic_packet_generator_test.cc
index 4e84d0b..c7e2918 100644
--- a/net/quic/quic_packet_generator_test.cc
+++ b/net/quic/quic_packet_generator_test.cc
@@ -120,7 +120,7 @@ class QuicPacketGeneratorTest : public ::testing::Test {
}
QuicGoAwayFrame* CreateGoAwayFrame() {
- return new QuicGoAwayFrame(QUIC_NO_ERROR, 1, std::string());
+ return new QuicGoAwayFrame(QUIC_NO_ERROR, 1, "");
}
void CheckPacketContains(const PacketContents& contents,
diff --git a/net/server/http_server.cc b/net/server/http_server.cc
index a0c9a3a..4f1fb08 100644
--- a/net/server/http_server.cc
+++ b/net/server/http_server.cc
@@ -62,7 +62,7 @@ void HttpServer::Send200(int connection_id,
}
void HttpServer::Send404(int connection_id) {
- Send(connection_id, HTTP_NOT_FOUND, std::string(), "text/html");
+ Send(connection_id, HTTP_NOT_FOUND, "", "text/html");
}
void HttpServer::Send500(int connection_id, const std::string& message) {
diff --git a/net/server/http_server_request_info.cc b/net/server/http_server_request_info.cc
index 08b925f..eda597a 100644
--- a/net/server/http_server_request_info.cc
+++ b/net/server/http_server_request_info.cc
@@ -16,7 +16,7 @@ std::string HttpServerRequestInfo::GetHeaderValue(
headers.find(header_name);
if (it != headers.end())
return it->second;
- return std::string();
+ return "";
}
} // namespace net
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index bc64306..0628d91 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -274,7 +274,7 @@ class TestConnectJob : public ConnectJob {
// Set all of the additional error state fields in some way.
handle->set_is_ssl_error(true);
HttpResponseInfo info;
- info.headers = new HttpResponseHeaders(std::string());
+ info.headers = new HttpResponseHeaders("");
handle->set_ssl_error_response_info(info);
}
}
@@ -846,7 +846,7 @@ TEST_F(ClientSocketPoolBaseTest, InitConnectionFailure) {
// Set the additional error state members to ensure that they get cleared.
handle.set_is_ssl_error(true);
HttpResponseInfo info;
- info.headers = new HttpResponseHeaders(std::string());
+ info.headers = new HttpResponseHeaders("");
handle.set_ssl_error_response_info(info);
EXPECT_EQ(ERR_CONNECTION_FAILED,
handle.Init("a",
@@ -1720,7 +1720,7 @@ TEST_F(ClientSocketPoolBaseTest,
// Set the additional error state members to ensure that they get cleared.
handle.set_is_ssl_error(true);
HttpResponseInfo info;
- info.headers = new HttpResponseHeaders(std::string());
+ info.headers = new HttpResponseHeaders("");
handle.set_ssl_error_response_info(info);
EXPECT_EQ(ERR_IO_PENDING, handle.Init("a",
params_,
diff --git a/net/socket/deterministic_socket_data_unittest.cc b/net/socket/deterministic_socket_data_unittest.cc
index aea8160..a007e36 100644
--- a/net/socket/deterministic_socket_data_unittest.cc
+++ b/net/socket/deterministic_socket_data_unittest.cc
@@ -77,8 +77,9 @@ DeterministicSocketDataTest::DeterministicSocketDataTest()
false,
false,
OnHostResolutionCallback())),
- histograms_(std::string()),
- socket_pool_(10, 10, &histograms_, &socket_factory_) {}
+ histograms_(""),
+ socket_pool_(10, 10, &histograms_, &socket_factory_) {
+}
void DeterministicSocketDataTest::TearDown() {
// Empty the current queue.
diff --git a/net/socket/ssl_client_socket_pool_unittest.cc b/net/socket/ssl_client_socket_pool_unittest.cc
index fe7e3d2..c188a80 100644
--- a/net/socket/ssl_client_socket_pool_unittest.cc
+++ b/net/socket/ssl_client_socket_pool_unittest.cc
@@ -79,54 +79,46 @@ class SSLClientSocketPoolTest : public testing::Test {
SSLClientSocketPoolTest()
: proxy_service_(ProxyService::CreateDirect()),
ssl_config_service_(new SSLConfigServiceDefaults),
- http_auth_handler_factory_(
- HttpAuthHandlerFactory::CreateDefault(&host_resolver_)),
+ http_auth_handler_factory_(HttpAuthHandlerFactory::CreateDefault(
+ &host_resolver_)),
session_(CreateNetworkSession()),
- direct_transport_socket_params_(
- new TransportSocketParams(HostPortPair("host", 443),
- MEDIUM,
- false,
- false,
- OnHostResolutionCallback())),
+ direct_transport_socket_params_(new TransportSocketParams(
+ HostPortPair("host", 443), MEDIUM, false, false,
+ OnHostResolutionCallback())),
transport_histograms_("MockTCP"),
- transport_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
- &transport_histograms_,
- &socket_factory_),
- proxy_transport_socket_params_(
- new TransportSocketParams(HostPortPair("proxy", 443),
- MEDIUM,
- false,
- false,
- OnHostResolutionCallback())),
- socks_socket_params_(
- new SOCKSSocketParams(proxy_transport_socket_params_,
- true,
- HostPortPair("sockshost", 443),
- MEDIUM)),
+ transport_socket_pool_(
+ kMaxSockets,
+ kMaxSocketsPerGroup,
+ &transport_histograms_,
+ &socket_factory_),
+ proxy_transport_socket_params_(new TransportSocketParams(
+ HostPortPair("proxy", 443), MEDIUM, false, false,
+ OnHostResolutionCallback())),
+ socks_socket_params_(new SOCKSSocketParams(
+ proxy_transport_socket_params_, true,
+ HostPortPair("sockshost", 443), MEDIUM)),
socks_histograms_("MockSOCKS"),
- socks_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
- &socks_histograms_,
- &transport_socket_pool_),
- http_proxy_socket_params_(
- new HttpProxySocketParams(proxy_transport_socket_params_,
- NULL,
- GURL("http://host"),
- std::string(),
- HostPortPair("host", 80),
- session_->http_auth_cache(),
- session_->http_auth_handler_factory(),
- session_->spdy_session_pool(),
- true)),
+ socks_socket_pool_(
+ kMaxSockets,
+ kMaxSocketsPerGroup,
+ &socks_histograms_,
+ &transport_socket_pool_),
+ http_proxy_socket_params_(new HttpProxySocketParams(
+ proxy_transport_socket_params_, NULL, GURL("http://host"), "",
+ HostPortPair("host", 80),
+ session_->http_auth_cache(),
+ session_->http_auth_handler_factory(),
+ session_->spdy_session_pool(),
+ true)),
http_proxy_histograms_("MockHttpProxy"),
- http_proxy_socket_pool_(kMaxSockets,
- kMaxSocketsPerGroup,
- &http_proxy_histograms_,
- &host_resolver_,
- &transport_socket_pool_,
- NULL,
- NULL) {
+ http_proxy_socket_pool_(
+ kMaxSockets,
+ kMaxSocketsPerGroup,
+ &http_proxy_histograms_,
+ &host_resolver_,
+ &transport_socket_pool_,
+ NULL,
+ NULL) {
scoped_refptr<SSLConfigService> ssl_config_service(
new SSLConfigServiceDefaults);
ssl_config_service->GetSSLConfig(&ssl_config_);
@@ -142,7 +134,7 @@ class SSLClientSocketPoolTest : public testing::Test {
NULL /* cert_verifier */,
NULL /* server_bound_cert_service */,
NULL /* transport_security_state */,
- std::string() /* ssl_session_cache_shard */,
+ "" /* ssl_session_cache_shard */,
&socket_factory_,
transport_pool ? &transport_socket_pool_ : NULL,
socks_pool ? &socks_socket_pool_ : NULL,
@@ -730,8 +722,8 @@ TEST_F(SSLClientSocketPoolTest, IPPooling) {
host_resolver_.set_synchronous_mode(true);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) {
- host_resolver_.rules()->AddIPLiteralRule(
- test_hosts[i].name, test_hosts[i].iplist, std::string());
+ host_resolver_.rules()->AddIPLiteralRule(test_hosts[i].name,
+ test_hosts[i].iplist, "");
// This test requires that the HostResolver cache be populated. Normal
// code would have done this already, but we do it manually.
@@ -813,8 +805,8 @@ void SSLClientSocketPoolTest::TestIPPoolingDisabled(
TestCompletionCallback callback;
int rv;
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) {
- host_resolver_.rules()->AddIPLiteralRule(
- test_hosts[i].name, test_hosts[i].iplist, std::string());
+ host_resolver_.rules()->AddIPLiteralRule(test_hosts[i].name,
+ test_hosts[i].iplist, "");
// This test requires that the HostResolver cache be populated. Normal
// code would have done this already, but we do it manually.
diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc
index 9d95a1b..eba7c26 100644
--- a/net/socket/transport_client_socket_pool_unittest.cc
+++ b/net/socket/transport_client_socket_pool_unittest.cc
@@ -1210,8 +1210,8 @@ TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv4FinishesFirst) {
client_socket_factory_.set_client_socket_types(case_types, 2);
// Resolve an AddressList with a IPv6 address first and then a IPv4 address.
- host_resolver_->rules()
- ->AddIPLiteralRule("*", "2:abcd::3:4:ff,2.2.2.2", std::string());
+ host_resolver_->rules()->AddIPLiteralRule(
+ "*", "2:abcd::3:4:ff,2.2.2.2", "");
TestCompletionCallback callback;
ClientSocketHandle handle;
@@ -1255,8 +1255,8 @@ TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv6FinishesFirst) {
TransportConnectJob::kIPv6FallbackTimerInMs + 50));
// Resolve an AddressList with a IPv6 address first and then a IPv4 address.
- host_resolver_->rules()
- ->AddIPLiteralRule("*", "2:abcd::3:4:ff,2.2.2.2", std::string());
+ host_resolver_->rules()->AddIPLiteralRule(
+ "*", "2:abcd::3:4:ff,2.2.2.2", "");
TestCompletionCallback callback;
ClientSocketHandle handle;
@@ -1289,8 +1289,8 @@ TEST_F(TransportClientSocketPoolTest, IPv6NoIPv4AddressesToFallbackTo) {
MockClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
// Resolve an AddressList with only IPv6 addresses.
- host_resolver_->rules()
- ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string());
+ host_resolver_->rules()->AddIPLiteralRule(
+ "*", "2:abcd::3:4:ff,3:abcd::3:4:ff", "");
TestCompletionCallback callback;
ClientSocketHandle handle;
@@ -1323,7 +1323,8 @@ TEST_F(TransportClientSocketPoolTest, IPv4HasNoFallback) {
MockClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
// Resolve an AddressList with only IPv4 addresses.
- host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string());
+ host_resolver_->rules()->AddIPLiteralRule(
+ "*", "1.1.1.1", "");
TestCompletionCallback callback;
ClientSocketHandle handle;
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc
index 3ae8871a..46d44c9 100644
--- a/net/spdy/spdy_framer_test.cc
+++ b/net/spdy/spdy_framer_test.cc
@@ -1826,7 +1826,7 @@ TEST_P(SpdyFramerTest, CreateSynStreamUncompressed) {
"max stream ID";
SpdyHeaderBlock headers;
- headers[std::string()] = "foo";
+ headers[""] = "foo";
headers["foo"] = "bar";
const unsigned char kV2FrameData[] = {
@@ -2103,7 +2103,7 @@ TEST_P(SpdyFramerTest, CreateSynReplyUncompressed) {
"SYN_REPLY frame with a 0-length header name, FIN, max stream ID";
SpdyHeaderBlock headers;
- headers[std::string()] = "foo";
+ headers[""] = "foo";
headers["foo"] = "bar";
const unsigned char kV2FrameData[] = {
@@ -2619,7 +2619,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
"HEADERS frame with a 0-length header name, FIN, max stream ID";
SpdyHeaderBlock headers;
- headers[std::string()] = "foo";
+ headers[""] = "foo";
headers["foo"] = "bar";
const unsigned char kV2FrameData[] = {
diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc
index 49fb8ca..41647c1 100644
--- a/net/spdy/spdy_http_utils.cc
+++ b/net/spdy/spdy_http_utils.cc
@@ -188,9 +188,8 @@ GURL GetUrlFromHeaderBlock(const SpdyHeaderBlock& headers,
if (it != headers.end())
path = it->second;
- std::string url = (scheme.empty() || host_port.empty() || path.empty())
- ? std::string()
- : scheme + "://" + host_port + path;
+ std::string url = (scheme.empty() || host_port.empty() || path.empty())
+ ? "" : scheme + "://" + host_port + path;
return GURL(url);
}
diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc
index 1d7026f..0b93815 100644
--- a/net/spdy/spdy_session_spdy2_unittest.cc
+++ b/net/spdy/spdy_session_spdy2_unittest.cc
@@ -678,8 +678,8 @@ void IPPoolingTest(SpdyPoolCloseSessionsType close_sessions_type) {
SpdySessionDependencies session_deps;
session_deps.host_resolver->set_synchronous_mode(true);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) {
- session_deps.host_resolver->rules()->AddIPLiteralRule(
- test_hosts[i].name, test_hosts[i].iplist, std::string());
+ session_deps.host_resolver->rules()->AddIPLiteralRule(test_hosts[i].name,
+ test_hosts[i].iplist, "");
// This test requires that the HostResolver cache be populated. Normal
// code would have done this already, but we do it manually.
@@ -1139,7 +1139,7 @@ TEST_F(SpdySessionSpdy2Test, CloseSessionWithTwoCreatedStreams) {
EXPECT_EQ(0u, spdy_stream2->stream_id());
// Ensure we don't crash while closing the session.
- session->CloseSessionOnError(ERR_ABORTED, true, std::string());
+ session->CloseSessionOnError(ERR_ABORTED, true, "");
EXPECT_TRUE(spdy_stream1->closed());
EXPECT_TRUE(spdy_stream2->closed());
diff --git a/net/spdy/spdy_session_spdy3_unittest.cc b/net/spdy/spdy_session_spdy3_unittest.cc
index eaf23ffe..c790251 100644
--- a/net/spdy/spdy_session_spdy3_unittest.cc
+++ b/net/spdy/spdy_session_spdy3_unittest.cc
@@ -704,8 +704,8 @@ void IPPoolingTest(SpdyPoolCloseSessionsType close_sessions_type) {
SpdySessionDependencies session_deps;
session_deps.host_resolver->set_synchronous_mode(true);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) {
- session_deps.host_resolver->rules()->AddIPLiteralRule(
- test_hosts[i].name, test_hosts[i].iplist, std::string());
+ session_deps.host_resolver->rules()->AddIPLiteralRule(test_hosts[i].name,
+ test_hosts[i].iplist, "");
// This test requires that the HostResolver cache be populated. Normal
// code would have done this already, but we do it manually.
@@ -1140,7 +1140,7 @@ TEST_F(SpdySessionSpdy3Test, CloseSessionWithTwoCreatedStreams) {
EXPECT_EQ(0u, spdy_stream2->stream_id());
// Ensure we don't crash while closing the session.
- session->CloseSessionOnError(ERR_ABORTED, true, std::string());
+ session->CloseSessionOnError(ERR_ABORTED, true, "");
EXPECT_TRUE(spdy_stream1->closed());
EXPECT_TRUE(spdy_stream2->closed());
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index 70412dd..5725253 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -534,7 +534,7 @@ void SpdyStream::Cancel() {
cancelled_ = true;
if (session_->IsStreamActive(stream_id_))
- session_->ResetStream(stream_id_, RST_STREAM_CANCEL, std::string());
+ session_->ResetStream(stream_id_, RST_STREAM_CANCEL, "");
else if (stream_id_ == 0)
session_->CloseCreatedStream(this, RST_STREAM_CANCEL);
}
diff --git a/net/spdy/spdy_stream_test_util.cc b/net/spdy/spdy_stream_test_util.cc
index 00a58df..3b2235f 100644
--- a/net/spdy/spdy_stream_test_util.cc
+++ b/net/spdy/spdy_stream_test_util.cc
@@ -101,7 +101,7 @@ int StreamDelegateBase::WaitForClose() {
std::string StreamDelegateBase::GetResponseHeaderValue(
const std::string& name) const {
SpdyHeaderBlock::const_iterator it = response_.find(name);
- return (it == response_.end()) ? std::string() : it->second;
+ return (it == response_.end()) ? "" : it->second;
}
StreamDelegateSendImmediate::StreamDelegateSendImmediate(
diff --git a/net/spdy/spdy_write_queue_unittest.cc b/net/spdy/spdy_write_queue_unittest.cc
index 26029e4..c295db8 100644
--- a/net/spdy/spdy_write_queue_unittest.cc
+++ b/net/spdy/spdy_write_queue_unittest.cc
@@ -60,8 +60,7 @@ int ProducerToInt(scoped_ptr<SpdyFrameProducer> producer) {
// -- be careful to not call any functions that expect the session to
// be there.
SpdyStream* MakeTestStream(RequestPriority priority) {
- return new SpdyStream(
- NULL, std::string(), priority, 0, 0, false, BoundNetLog());
+ return new SpdyStream(NULL, "", priority, 0, 0, false, BoundNetLog());
}
// Add some frame producers of different priority. The producers
diff --git a/net/ssl/server_bound_cert_service.cc b/net/ssl/server_bound_cert_service.cc
index 3a50ed6..bed97cf 100644
--- a/net/ssl/server_bound_cert_service.cc
+++ b/net/ssl/server_bound_cert_service.cc
@@ -579,11 +579,8 @@ void ServerBoundCertService::GotServerBoundCert(
delete worker;
// TODO(rkn): Log to the NetLog.
LOG(ERROR) << "ServerBoundCertServiceWorker couldn't be started.";
- HandleResult(ERR_INSUFFICIENT_RESOURCES,
- server_identifier,
- CLIENT_CERT_INVALID_TYPE,
- std::string(),
- std::string());
+ HandleResult(ERR_INSUFFICIENT_RESOURCES, server_identifier,
+ CLIENT_CERT_INVALID_TYPE, "", "");
return;
}
}
@@ -613,11 +610,7 @@ void ServerBoundCertService::GeneratedServerBoundCert(
HandleResult(error, server_identifier, cert->type(), cert->private_key(),
cert->cert());
} else {
- HandleResult(error,
- server_identifier,
- CLIENT_CERT_INVALID_TYPE,
- std::string(),
- std::string());
+ HandleResult(error, server_identifier, CLIENT_CERT_INVALID_TYPE, "", "");
}
}
diff --git a/net/test/base_test_server.cc b/net/test/base_test_server.cc
index ab9b121..3a2dc11 100644
--- a/net/test/base_test_server.cc
+++ b/net/test/base_test_server.cc
@@ -92,7 +92,7 @@ base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const {
std::string BaseTestServer::SSLOptions::GetOCSPArgument() const {
if (server_certificate != CERT_AUTO)
- return std::string();
+ return "";
switch (ocsp_status) {
case OCSP_OK:
@@ -107,7 +107,7 @@ std::string BaseTestServer::SSLOptions::GetOCSPArgument() const {
return "unknown";
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
diff --git a/net/tools/dump_cache/url_to_filename_encoder_unittest.cc b/net/tools/dump_cache/url_to_filename_encoder_unittest.cc
index 23bbc6d..2e09e0b 100644
--- a/net/tools/dump_cache/url_to_filename_encoder_unittest.cc
+++ b/net/tools/dump_cache/url_to_filename_encoder_unittest.cc
@@ -57,8 +57,7 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
void Validate(const string& in_word, const string& gold_word) {
string escaped_word, url;
- UrlToFilenameEncoder::EncodeSegment(
- std::string(), in_word, '/', &escaped_word);
+ UrlToFilenameEncoder::EncodeSegment("", in_word, '/', &escaped_word);
EXPECT_EQ(gold_word, escaped_word);
CheckSegmentLength(escaped_word);
CheckValidChars(escaped_word, '\\');
@@ -68,8 +67,7 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
void ValidateAllSegmentsSmall(const string& in_word) {
string escaped_word, url;
- UrlToFilenameEncoder::EncodeSegment(
- std::string(), in_word, '/', &escaped_word);
+ UrlToFilenameEncoder::EncodeSegment("", in_word, '/', &escaped_word);
CheckSegmentLength(escaped_word);
CheckValidChars(escaped_word, '\\');
UrlToFilenameEncoder::Decode(escaped_word, '/', &url);
@@ -108,13 +106,13 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
void ValidateUrlOldNew(const string& url, const string& gold_old_filename,
const string& gold_new_filename) {
- ValidateUrl(url, std::string(), true, gold_old_filename);
- ValidateUrl(url, std::string(), false, gold_new_filename);
+ ValidateUrl(url, "", true, gold_old_filename);
+ ValidateUrl(url, "", false, gold_new_filename);
}
void ValidateEncodeSame(const string& url1, const string& url2) {
- string filename1 = UrlToFilenameEncoder::Encode(url1, std::string(), false);
- string filename2 = UrlToFilenameEncoder::Encode(url2, std::string(), false);
+ string filename1 = UrlToFilenameEncoder::Encode(url1, "", false);
+ string filename2 = UrlToFilenameEncoder::Encode(url2, "", false);
EXPECT_EQ(filename1, filename2);
}
@@ -123,7 +121,7 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
};
TEST_F(UrlToFilenameEncoderTest, DoesNotEscape) {
- ValidateNoChange(std::string());
+ ValidateNoChange("");
ValidateNoChange("abcdefg");
ValidateNoChange("abcdefghijklmnopqrstuvwxyz");
ValidateNoChange("ZYXWVUT");
@@ -195,8 +193,7 @@ TEST_F(UrlToFilenameEncoderTest, EncodeUrlCorrectly) {
// From bug: Double slash preserved.
ValidateUrl("http://www.foo.com/u?site=http://www.google.com/index.html",
- std::string(),
- false,
+ "", false,
"www.foo.com" + dir_sep_ + "u" + escape_ + "3Fsite=http" +
escape_ + "3A" + dir_sep_ + escape_ + "2Fwww.google.com" +
dir_sep_ + "index.html" + escape_);
@@ -329,8 +326,7 @@ TEST_F(UrlToFilenameEncoderTest, BackslashSeparator) {
string long_word;
string escaped_word;
long_word.append(UrlToFilenameEncoder::kMaximumSubdirectoryLength + 1, 'x');
- UrlToFilenameEncoder::EncodeSegment(
- std::string(), long_word, '\\', &escaped_word);
+ UrlToFilenameEncoder::EncodeSegment("", long_word, '\\', &escaped_word);
// check that one backslash, plus the escape ",-", and the ending , got added.
EXPECT_EQ(long_word.size() + 4, escaped_word.size());
diff --git a/net/tools/fetch/fetch_server.cc b/net/tools/fetch/fetch_server.cc
index 34c7c83..830cd18 100644
--- a/net/tools/fetch/fetch_server.cc
+++ b/net/tools/fetch/fetch_server.cc
@@ -36,8 +36,7 @@ int main(int argc, char**argv) {
// Do work here.
MessageLoop loop;
- HttpServer server(std::string(),
- 80); // TODO(mbelshe): make port configurable
+ HttpServer server("", 80); // TODO(mbelshe): make port configurable
MessageLoop::current()->Run();
if (parsed_command_line.HasSwitch("stats")) {
diff --git a/net/tools/flip_server/acceptor_thread.cc b/net/tools/flip_server/acceptor_thread.cc
index ed8a3ec..b16d181 100644
--- a/net/tools/flip_server/acceptor_thread.cc
+++ b/net/tools/flip_server/acceptor_thread.cc
@@ -105,9 +105,7 @@ void SMAcceptorThread::HandleConnection(int server_fd,
NULL,
&epoll_server_,
server_fd,
- std::string(),
- std::string(),
- remote_ip,
+ "", "", remote_ip,
use_ssl_);
if (server_connection->initialized())
active_server_connections_.push_back(server_connection);
diff --git a/net/tools/flip_server/flip_in_mem_edsm_server.cc b/net/tools/flip_server/flip_in_mem_edsm_server.cc
index 15fb9644..8ba1505 100644
--- a/net/tools/flip_server/flip_in_mem_edsm_server.cc
+++ b/net/tools/flip_server/flip_in_mem_edsm_server.cc
@@ -335,16 +335,11 @@ int main (int argc, char**argv)
std::string value = cl.GetSwitchValueASCII("spdy-server");
std::vector<std::string> valueArgs = split(value, ',');
while (valueArgs.size() < 4)
- valueArgs.push_back(std::string());
+ valueArgs.push_back("");
g_proxy_config.AddAcceptor(net::FLIP_HANDLER_SPDY_SERVER,
- valueArgs[0],
- valueArgs[1],
- valueArgs[2],
- valueArgs[3],
- std::string(),
- std::string(),
- std::string(),
- std::string(),
+ valueArgs[0], valueArgs[1],
+ valueArgs[2], valueArgs[3],
+ "", "", "", "",
0,
FLAGS_accept_backlog_size,
FLAGS_disable_nagle,
@@ -361,16 +356,11 @@ int main (int argc, char**argv)
std::string value = cl.GetSwitchValueASCII("http-server");
std::vector<std::string> valueArgs = split(value, ',');
while (valueArgs.size() < 4)
- valueArgs.push_back(std::string());
+ valueArgs.push_back("");
g_proxy_config.AddAcceptor(net::FLIP_HANDLER_HTTP_SERVER,
- valueArgs[0],
- valueArgs[1],
- valueArgs[2],
- valueArgs[3],
- std::string(),
- std::string(),
- std::string(),
- std::string(),
+ valueArgs[0], valueArgs[1],
+ valueArgs[2], valueArgs[3],
+ "", "", "", "",
0,
FLAGS_accept_backlog_size,
FLAGS_disable_nagle,
diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc
index 649e99e..1c34e79 100644
--- a/net/tools/flip_server/spdy_interface.cc
+++ b/net/tools/flip_server/spdy_interface.cc
@@ -112,14 +112,9 @@ SMInterface* SpdySM::FindOrMakeNewSMConnectionInterface(
}
sm_http_interface->InitSMInterface(this, server_idx);
- sm_http_interface->InitSMConnection(NULL,
- sm_http_interface,
- epoll_server_,
- -1,
- server_ip,
- server_port,
- std::string(),
- false);
+ sm_http_interface->InitSMConnection(NULL, sm_http_interface,
+ epoll_server_, -1,
+ server_ip, server_port, "", false);
return sm_http_interface;
}
diff --git a/net/tools/flip_server/streamer_interface.cc b/net/tools/flip_server/streamer_interface.cc
index b1612e7..9e6e6c8 100644
--- a/net/tools/flip_server/streamer_interface.cc
+++ b/net/tools/flip_server/streamer_interface.cc
@@ -131,13 +131,11 @@ int StreamerSM::PostAcceptHook() {
}
// The Streamer interface is used to stream HTTPS connections, so we
// will always use the https_server_ip/port here.
- sm_other_interface_->InitSMConnection(NULL,
- sm_other_interface_,
- epoll_server_,
- -1,
+ sm_other_interface_->InitSMConnection(NULL, sm_other_interface_,
+ epoll_server_, -1,
acceptor_->https_server_ip_,
acceptor_->https_server_port_,
- std::string(),
+ "",
false);
return 1;
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index cb14db8..e98c4ea 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -234,7 +234,7 @@ TEST_F(EndToEndTest, SeparateFinPacket) {
client_->SendMessage(request);
- client_->SendData(std::string(), true);
+ client_->SendData("", true);
client_->WaitForResponse();
EXPECT_EQ(kFooResponseBody, client_->response_body());
@@ -243,7 +243,7 @@ TEST_F(EndToEndTest, SeparateFinPacket) {
request.AddBody("foo", true);
client_->SendMessage(request);
- client_->SendData(std::string(), true);
+ client_->SendData("", true);
client_->WaitForResponse();
EXPECT_EQ(kFooResponseBody, client_->response_body());
EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code());
diff --git a/net/tools/quic/quic_client.cc b/net/tools/quic/quic_client.cc
index 8acb85a..4a61ab4 100644
--- a/net/tools/quic/quic_client.cc
+++ b/net/tools/quic/quic_client.cc
@@ -43,8 +43,8 @@ QuicClient::QuicClient(IPEndPoint server_address,
QuicClient::~QuicClient() {
if (connected()) {
- session()->connection()
- ->SendConnectionClosePacket(QUIC_PEER_GOING_AWAY, std::string());
+ session()->connection()->SendConnectionClosePacket(
+ QUIC_PEER_GOING_AWAY, "");
}
}
diff --git a/net/tools/quic/test_tools/quic_test_client.cc b/net/tools/quic/test_tools/quic_test_client.cc
index 843af2f..53bc057 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -85,7 +85,7 @@ string QuicTestClient::SendCustomSynchronousRequest(
string QuicTestClient::SendSynchronousRequest(const string& uri) {
if (SendRequest(uri) == 0) {
DLOG(ERROR) << "Failed to the request for uri:" << uri;
- return std::string();
+ return "";
}
WaitForResponse();
return response_;
diff --git a/net/udp/udp_socket_unittest.cc b/net/udp/udp_socket_unittest.cc
index 09a2806..c2085ad 100644
--- a/net/udp/udp_socket_unittest.cc
+++ b/net/udp/udp_socket_unittest.cc
@@ -38,7 +38,7 @@ class UDPSocketTest : public PlatformTest {
if (rv == ERR_IO_PENDING)
rv = callback.WaitForResult();
if (rv < 0)
- return std::string(); // error!
+ return ""; // error!
return std::string(buffer_->data(), rv);
}
@@ -82,7 +82,7 @@ class UDPSocketTest : public PlatformTest {
if (rv == ERR_IO_PENDING)
rv = callback.WaitForResult();
if (rv < 0)
- return std::string(); // error!
+ return ""; // error!
return std::string(buffer_->data(), rv);
}
diff --git a/net/url_request/url_fetcher_impl_unittest.cc b/net/url_request/url_fetcher_impl_unittest.cc
index c8cbd1a..98a3a11 100644
--- a/net/url_request/url_fetcher_impl_unittest.cc
+++ b/net/url_request/url_fetcher_impl_unittest.cc
@@ -441,16 +441,11 @@ class CancelTestURLRequestContextGetter
// The initial backoff is 2 seconds and maximum backoff is 4 seconds.
// Maximum retries allowed is set to 2.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(context_->throttler_manager(),
- std::string(),
- 200,
- 3,
- 2000,
- 2.0,
- 0.0,
- 4000));
- context_->throttler_manager()
- ->OverrideEntryForTests(throttle_for_url_, entry);
+ new URLRequestThrottlerEntry(
+ context_->throttler_manager(),
+ "", 200, 3, 2000, 2.0, 0.0, 4000));
+ context_->throttler_manager()->OverrideEntryForTests(
+ throttle_for_url_, entry);
context_created_.Signal();
}
@@ -558,7 +553,7 @@ void URLFetcherEmptyPostTest::CreateFetcher(const GURL& url) {
fetcher_ = new URLFetcherImpl(url, URLFetcher::POST, this);
fetcher_->SetRequestContext(new TestURLRequestContextGetter(
io_message_loop_proxy()));
- fetcher_->SetUploadData("text/plain", std::string());
+ fetcher_->SetUploadData("text/plain", "");
fetcher_->Start();
}
@@ -1168,14 +1163,9 @@ TEST_F(URLFetcherProtectTest, Overload) {
// Registers an entry for test url. It only allows 3 requests to be sent
// in 200 milliseconds.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(request_context()->throttler_manager(),
- std::string(),
- 200,
- 3,
- 1,
- 2.0,
- 0.0,
- 256));
+ new URLRequestThrottlerEntry(
+ request_context()->throttler_manager(),
+ "", 200, 3, 1, 2.0, 0.0, 256));
request_context()->throttler_manager()->OverrideEntryForTests(url, entry);
CreateFetcher(url);
@@ -1196,14 +1186,9 @@ TEST_F(URLFetcherProtectTest, ServerUnavailable) {
// and maximum backoff time is 256 milliseconds.
// Maximum retries allowed is set to 11.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(request_context()->throttler_manager(),
- std::string(),
- 200,
- 3,
- 1,
- 2.0,
- 0.0,
- 256));
+ new URLRequestThrottlerEntry(
+ request_context()->throttler_manager(),
+ "", 200, 3, 1, 2.0, 0.0, 256));
request_context()->throttler_manager()->OverrideEntryForTests(url, entry);
CreateFetcher(url);
@@ -1224,14 +1209,9 @@ TEST_F(URLFetcherProtectTestPassedThrough, ServerUnavailablePropagateResponse) {
// and maximum backoff time is 150000 milliseconds.
// Maximum retries allowed is set to 11.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(request_context()->throttler_manager(),
- std::string(),
- 200,
- 3,
- 100,
- 2.0,
- 0.0,
- 150000));
+ new URLRequestThrottlerEntry(
+ request_context()->throttler_manager(),
+ "", 200, 3, 100, 2.0, 0.0, 150000));
// Total time if *not* for not doing automatic backoff would be 150s.
// In reality it should be "as soon as server responds".
request_context()->throttler_manager()->OverrideEntryForTests(url, entry);
@@ -1288,14 +1268,9 @@ TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) {
// Using a sliding window of 4 seconds, and max of 1 request, under a fast
// run we expect to have a 4 second delay when posting the Start task.
scoped_refptr<URLRequestThrottlerEntry> entry(
- new URLRequestThrottlerEntry(request_context()->throttler_manager(),
- std::string(),
- 4000,
- 1,
- 2000,
- 2.0,
- 0.0,
- 4000));
+ new URLRequestThrottlerEntry(
+ request_context()->throttler_manager(),
+ "", 4000, 1, 2000, 2.0, 0.0, 4000));
request_context()->throttler_manager()->OverrideEntryForTests(url, entry);
// Fake that a request has just started.
entry->ReserveSendingTimeForNextRequest(base::TimeTicks());
diff --git a/net/url_request/url_request_throttler_simulation_unittest.cc b/net/url_request/url_request_throttler_simulation_unittest.cc
index cbb8be8..3a5a399 100644
--- a/net/url_request/url_request_throttler_simulation_unittest.cc
+++ b/net/url_request/url_request_throttler_simulation_unittest.cc
@@ -297,9 +297,11 @@ class Server : public DiscreteTimeSimulation::Actor {
// Mock throttler entry used by Requester class.
class MockURLRequestThrottlerEntry : public URLRequestThrottlerEntry {
public:
- explicit MockURLRequestThrottlerEntry(URLRequestThrottlerManager* manager)
- : URLRequestThrottlerEntry(manager, std::string()),
- mock_backoff_entry_(&backoff_policy_) {}
+ explicit MockURLRequestThrottlerEntry(
+ URLRequestThrottlerManager* manager)
+ : URLRequestThrottlerEntry(manager, ""),
+ mock_backoff_entry_(&backoff_policy_) {
+ }
virtual const BackoffEntry* GetBackoffEntry() const OVERRIDE {
return &mock_backoff_entry_;
@@ -431,7 +433,7 @@ class Requester : public DiscreteTimeSimulation::Actor {
if (!throttler_entry_->ShouldRejectRequest(server_->mock_request())) {
int status_code = server_->HandleRequest();
MockURLRequestThrottlerHeaderAdapter response_headers(status_code);
- throttler_entry_->UpdateWithResponse(std::string(), &response_headers);
+ throttler_entry_->UpdateWithResponse("", &response_headers);
if (status_code == 200) {
if (results_)
diff --git a/net/url_request/url_request_throttler_test_support.cc b/net/url_request/url_request_throttler_test_support.cc
index 9d3f4e2..b6088ec 100644
--- a/net/url_request/url_request_throttler_test_support.cc
+++ b/net/url_request/url_request_throttler_test_support.cc
@@ -48,7 +48,7 @@ std::string MockURLRequestThrottlerHeaderAdapter::GetNormalizedValue(
return fake_opt_out_value_;
}
- return std::string();
+ return "";
}
int MockURLRequestThrottlerHeaderAdapter::GetResponseCode() const {
diff --git a/net/url_request/url_request_throttler_unittest.cc b/net/url_request/url_request_throttler_unittest.cc
index ed3eb87..cb20a95 100644
--- a/net/url_request/url_request_throttler_unittest.cc
+++ b/net/url_request/url_request_throttler_unittest.cc
@@ -37,7 +37,7 @@ class MockURLRequestThrottlerEntry : public URLRequestThrottlerEntry {
public:
explicit MockURLRequestThrottlerEntry(
net::URLRequestThrottlerManager* manager)
- : net::URLRequestThrottlerEntry(manager, std::string()),
+ : net::URLRequestThrottlerEntry(manager, ""),
mock_backoff_entry_(&backoff_policy_) {
InitPolicy();
}
@@ -46,7 +46,7 @@ class MockURLRequestThrottlerEntry : public URLRequestThrottlerEntry {
const TimeTicks& exponential_backoff_release_time,
const TimeTicks& sliding_window_release_time,
const TimeTicks& fake_now)
- : net::URLRequestThrottlerEntry(manager, std::string()),
+ : net::URLRequestThrottlerEntry(manager, ""),
fake_time_now_(fake_now),
mock_backoff_entry_(&backoff_policy_) {
InitPolicy();
@@ -279,14 +279,14 @@ TEST_F(URLRequestThrottlerEntryTest, InterfaceNotDuringExponentialBackoff) {
TEST_F(URLRequestThrottlerEntryTest, InterfaceUpdateFailure) {
MockURLRequestThrottlerHeaderAdapter failure_response(503);
- entry_->UpdateWithResponse(std::string(), &failure_response);
+ entry_->UpdateWithResponse("", &failure_response);
EXPECT_GT(entry_->GetExponentialBackoffReleaseTime(), entry_->fake_time_now_)
<< "A failure should increase the release_time";
}
TEST_F(URLRequestThrottlerEntryTest, InterfaceUpdateSuccess) {
MockURLRequestThrottlerHeaderAdapter success_response(200);
- entry_->UpdateWithResponse(std::string(), &success_response);
+ entry_->UpdateWithResponse("", &success_response);
EXPECT_EQ(entry_->GetExponentialBackoffReleaseTime(), entry_->fake_time_now_)
<< "A success should not add any delay";
}
@@ -294,11 +294,11 @@ TEST_F(URLRequestThrottlerEntryTest, InterfaceUpdateSuccess) {
TEST_F(URLRequestThrottlerEntryTest, InterfaceUpdateSuccessThenFailure) {
MockURLRequestThrottlerHeaderAdapter failure_response(503);
MockURLRequestThrottlerHeaderAdapter success_response(200);
- entry_->UpdateWithResponse(std::string(), &success_response);
- entry_->UpdateWithResponse(std::string(), &failure_response);
+ entry_->UpdateWithResponse("", &success_response);
+ entry_->UpdateWithResponse("", &failure_response);
EXPECT_GT(entry_->GetExponentialBackoffReleaseTime(), entry_->fake_time_now_)
<< "This scenario should add delay";
- entry_->UpdateWithResponse(std::string(), &success_response);
+ entry_->UpdateWithResponse("", &success_response);
}
TEST_F(URLRequestThrottlerEntryTest, IsEntryReallyOutdated) {
@@ -324,7 +324,7 @@ TEST_F(URLRequestThrottlerEntryTest, IsEntryReallyOutdated) {
TEST_F(URLRequestThrottlerEntryTest, MaxAllowedBackoff) {
for (int i = 0; i < 30; ++i) {
MockURLRequestThrottlerHeaderAdapter response_adapter(503);
- entry_->UpdateWithResponse(std::string(), &response_adapter);
+ entry_->UpdateWithResponse("", &response_adapter);
}
TimeDelta delay = entry_->GetExponentialBackoffReleaseTime() - now_;
@@ -335,7 +335,7 @@ TEST_F(URLRequestThrottlerEntryTest, MaxAllowedBackoff) {
TEST_F(URLRequestThrottlerEntryTest, MalformedContent) {
MockURLRequestThrottlerHeaderAdapter response_adapter(503);
for (int i = 0; i < 5; ++i)
- entry_->UpdateWithResponse(std::string(), &response_adapter);
+ entry_->UpdateWithResponse("", &response_adapter);
TimeTicks release_after_failures = entry_->GetExponentialBackoffReleaseTime();
@@ -346,7 +346,7 @@ TEST_F(URLRequestThrottlerEntryTest, MalformedContent) {
// response must also have been received).
entry_->ReceivedContentWasMalformed(200);
MockURLRequestThrottlerHeaderAdapter success_adapter(200);
- entry_->UpdateWithResponse(std::string(), &success_adapter);
+ entry_->UpdateWithResponse("", &success_adapter);
EXPECT_GT(entry_->GetExponentialBackoffReleaseTime(), release_after_failures);
}
@@ -475,7 +475,7 @@ void ExpectEntryAllowsAllOnErrorIfOptedOut(
MockURLRequestThrottlerHeaderAdapter failure_adapter(503);
for (int i = 0; i < 10; ++i) {
// Host doesn't really matter in this scenario so we skip it.
- entry->UpdateWithResponse(std::string(), &failure_adapter);
+ entry->UpdateWithResponse("", &failure_adapter);
}
EXPECT_NE(opted_out, entry->ShouldRejectRequest(request));
@@ -500,7 +500,7 @@ TEST_F(URLRequestThrottlerManagerTest, OptOutHeader) {
// Fake a response with the opt-out header.
MockURLRequestThrottlerHeaderAdapter response_adapter(
- std::string(),
+ "",
MockURLRequestThrottlerEntry::kExponentialThrottlingDisableValue,
200);
entry->UpdateWithResponse("www.google.com", &response_adapter);
@@ -517,8 +517,7 @@ TEST_F(URLRequestThrottlerManagerTest, OptOutHeader) {
// Fake a response with the opt-out header incorrectly specified.
scoped_refptr<net::URLRequestThrottlerEntryInterface> no_opt_out_entry =
manager.RegisterRequestUrl(GURL("http://www.nike.com/justdoit"));
- MockURLRequestThrottlerHeaderAdapter wrong_adapter(
- std::string(), "yesplease", 200);
+ MockURLRequestThrottlerHeaderAdapter wrong_adapter("", "yesplease", 200);
no_opt_out_entry->UpdateWithResponse("www.nike.com", &wrong_adapter);
ExpectEntryAllowsAllOnErrorIfOptedOut(no_opt_out_entry, false, request_);
@@ -536,7 +535,7 @@ TEST_F(URLRequestThrottlerManagerTest, ClearOnNetworkChange) {
MockURLRequestThrottlerHeaderAdapter failure_adapter(503);
for (int j = 0; j < 10; ++j) {
// Host doesn't really matter in this scenario so we skip it.
- entry_before->UpdateWithResponse(std::string(), &failure_adapter);
+ entry_before->UpdateWithResponse("", &failure_adapter);
}
EXPECT_TRUE(entry_before->ShouldRejectRequest(request_));
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index c3c68a1..494e6b3 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -2577,7 +2577,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequest) {
&network_delegate);
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -2626,21 +2626,21 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestSynchronously1) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::SYNCHRONOUS,
BlockingNetworkDelegate::ON_BEFORE_URL_REQUEST,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestSynchronously2) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::SYNCHRONOUS,
BlockingNetworkDelegate::ON_BEFORE_SEND_HEADERS,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestSynchronously3) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::SYNCHRONOUS,
BlockingNetworkDelegate::ON_HEADERS_RECEIVED,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
// The following 3 tests check that the network delegate can cancel a request
@@ -2649,21 +2649,21 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestAsynchronously1) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::AUTO_CALLBACK,
BlockingNetworkDelegate::ON_BEFORE_URL_REQUEST,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestAsynchronously2) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::AUTO_CALLBACK,
BlockingNetworkDelegate::ON_BEFORE_SEND_HEADERS,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequestAsynchronously3) {
ASSERT_TRUE(test_server_.Start());
NetworkDelegateCancelRequest(BlockingNetworkDelegate::AUTO_CALLBACK,
BlockingNetworkDelegate::ON_HEADERS_RECEIVED,
- test_server_.GetURL(std::string()));
+ test_server_.GetURL(""));
}
// Tests that the network delegate can block and redirect a request to a new
@@ -2992,7 +2992,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting1) {
context.Init();
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -3028,7 +3028,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting2) {
context.Init();
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -3063,7 +3063,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting3) {
context.Init();
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -3147,7 +3147,7 @@ TEST_F(URLRequestTestHTTP, GetTest_NoCache) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3213,7 +3213,7 @@ TEST_F(URLRequestTestHTTP, GetTest) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3235,7 +3235,7 @@ TEST_F(URLRequestTestHTTP, GetTestLoadTiming) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3319,7 +3319,7 @@ TEST_F(URLRequestTestHTTP, HTTPSToHTTPRedirectNoRefererTest) {
// An https server is sent a request with an https referer,
// and responds with a redirect to an http url. The http
// server should not be sent the referer.
- GURL http_destination = test_server_.GetURL(std::string());
+ GURL http_destination = test_server_.GetURL("");
TestDelegate d;
URLRequest req(https_test_server.GetURL(
"server-redirect?" + http_destination.spec()), &d, &default_context_);
@@ -3336,9 +3336,9 @@ TEST_F(URLRequestTestHTTP, HTTPSToHTTPRedirectNoRefererTest) {
TEST_F(URLRequestTestHTTP, RedirectLoadTiming) {
ASSERT_TRUE(test_server_.Start());
- GURL destination_url = test_server_.GetURL(std::string());
- GURL original_url =
- test_server_.GetURL("server-redirect?" + destination_url.spec());
+ GURL destination_url = test_server_.GetURL("");
+ GURL original_url = test_server_.GetURL(
+ "server-redirect?" + destination_url.spec());
TestDelegate d;
URLRequest req(original_url, &d, &default_context_);
req.Start();
@@ -3374,9 +3374,9 @@ TEST_F(URLRequestTestHTTP, RedirectLoadTiming) {
TEST_F(URLRequestTestHTTP, MultipleRedirectTest) {
ASSERT_TRUE(test_server_.Start());
- GURL destination_url = test_server_.GetURL(std::string());
- GURL middle_redirect_url =
- test_server_.GetURL("server-redirect?" + destination_url.spec());
+ GURL destination_url = test_server_.GetURL("");
+ GURL middle_redirect_url = test_server_.GetURL(
+ "server-redirect?" + destination_url.spec());
GURL original_url = test_server_.GetURL(
"server-redirect?" + middle_redirect_url.spec());
TestDelegate d;
@@ -3492,7 +3492,7 @@ TEST_F(URLRequestTestHTTP, CancelTest2) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
d.set_cancel_in_response_started(true);
@@ -3513,7 +3513,7 @@ TEST_F(URLRequestTestHTTP, CancelTest3) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
d.set_cancel_in_received_data(true);
@@ -3537,7 +3537,7 @@ TEST_F(URLRequestTestHTTP, CancelTest4) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4496,7 +4496,7 @@ TEST_F(HTTPSRequestTest, HTTPSGetTest) {
TestDelegate d;
{
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4526,7 +4526,7 @@ TEST_F(HTTPSRequestTest, HTTPSMismatchedTest) {
TestDelegate d;
{
d.set_allow_certificate_errors(err_allowed);
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4561,7 +4561,7 @@ TEST_F(HTTPSRequestTest, HTTPSExpiredTest) {
TestDelegate d;
{
d.set_allow_certificate_errors(err_allowed);
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4605,7 +4605,7 @@ TEST_F(HTTPSRequestTest, TLSv1Fallback) {
TestURLRequestContext context(true);
context.Init();
d.set_allow_certificate_errors(true);
- URLRequest r(test_server.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -4784,7 +4784,7 @@ TEST_F(HTTPSRequestTest, SSLv3Fallback) {
TestURLRequestContext context(true);
context.Init();
d.set_allow_certificate_errors(true);
- URLRequest r(test_server.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server.GetURL(""), &d, &context);
r.Start();
MessageLoop::current()->Run();
@@ -4832,7 +4832,7 @@ TEST_F(HTTPSRequestTest, ClientAuthTest) {
SSLClientAuthTestDelegate d;
{
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(""), &d, &default_context_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -5072,7 +5072,7 @@ class HTTPSOCSPTest : public HTTPSRequestTest {
TestDelegate d;
d.set_allow_certificate_errors(true);
- URLRequest r(test_server.GetURL(std::string()), &d, &context_);
+ URLRequest r(test_server.GetURL(""), &d, &context_);
r.Start();
MessageLoop::current()->Run();
diff --git a/net/websockets/websocket_net_log_params_unittest.cc b/net/websockets/websocket_net_log_params_unittest.cc
index 0519390f..e3c92a9 100644
--- a/net/websockets/websocket_net_log_params_unittest.cc
+++ b/net/websockets/websocket_net_log_params_unittest.cc
@@ -21,7 +21,7 @@ TEST(NetLogWebSocketHandshakeParameterTest, ToValue) {
list->Append(new StringValue("Upgrade: WebSocket"));
list->Append(new StringValue("Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5"));
list->Append(new StringValue("Origin: http://example.com"));
- list->Append(new StringValue(std::string()));
+ list->Append(new StringValue(""));
list->Append(new StringValue("\\x00\\x01\\x0a\\x0d\\xff\\xfe\\x0d\\x0a"));
DictionaryValue expected;
diff --git a/ppapi/cpp/dev/text_input_dev.cc b/ppapi/cpp/dev/text_input_dev.cc
index 657a0b3..3b38df8 100644
--- a/ppapi/cpp/dev/text_input_dev.cc
+++ b/ppapi/cpp/dev/text_input_dev.cc
@@ -54,7 +54,7 @@ TextInput_Dev::~TextInput_Dev() {
void TextInput_Dev::RequestSurroundingText(uint32_t) {
// Default implementation. Send a null range.
- UpdateSurroundingText(std::string(), 0, 0);
+ UpdateSurroundingText("", 0, 0);
}
void TextInput_Dev::SetTextInputType(PP_TextInput_Type type) {
diff --git a/ppapi/examples/ime/ime.cc b/ppapi/examples/ime/ime.cc
index 6f3e655..f5e2e44 100644
--- a/ppapi/examples/ime/ime.cc
+++ b/ppapi/examples/ime/ime.cc
@@ -245,7 +245,7 @@ class MyTextField {
int32_t target_segment,
const std::pair<uint32_t, uint32_t>& selection) {
if (HasSelection() && !text.empty())
- InsertText(std::string());
+ InsertText("");
composition_ = text;
segments_ = segments;
target_segment_ = target_segment;
@@ -344,7 +344,7 @@ class MyTextField {
if (!Focused())
return;
if (HasSelection()) {
- InsertText(std::string());
+ InsertText("");
} else {
size_t i = GetNextCharOffsetUtf8(utf8_text_, caret_pos_);
utf8_text_.erase(caret_pos_, i - caret_pos_);
@@ -356,7 +356,7 @@ class MyTextField {
if (!Focused())
return;
if (HasSelection()) {
- InsertText(std::string());
+ InsertText("");
} else if (caret_pos_ != 0) {
size_t i = GetPrevCharOffsetUtf8(utf8_text_, caret_pos_);
utf8_text_.erase(i, caret_pos_ - i);
@@ -565,10 +565,8 @@ class MyInstance : public pp::Instance {
it != textfield_.end();
++it) {
if (it->Focused()) {
- it->SetComposition(std::string(),
- std::vector<std::pair<uint32_t, uint32_t> >(),
- 0,
- std::make_pair(0, 0));
+ it->SetComposition("", std::vector< std::pair<uint32_t, uint32_t> >(),
+ 0, std::make_pair(0, 0));
return true;
}
}
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 7b2f0a9..e1f3ad9 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -677,6 +677,7 @@ bool Plugin::Init(uint32_t argc, const char* argn[], const char* argv[]) {
return status;
}
+
Plugin::Plugin(PP_Instance pp_instance)
: pp::InstancePrivate(pp_instance),
scriptable_plugin_(NULL),
@@ -687,6 +688,7 @@ Plugin::Plugin(PP_Instance pp_instance)
nacl_ready_state_(UNSENT),
nexe_error_reported_(false),
wrapper_factory_(NULL),
+ last_error_string_(""),
enable_dev_interfaces_(false),
is_installed_(false),
init_time_(0),
diff --git a/ppapi/native_client/src/trusted/plugin/plugin_error.h b/ppapi/native_client/src/trusted/plugin/plugin_error.h
index f02ef83..90c0284 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin_error.h
+++ b/ppapi/native_client/src/trusted/plugin/plugin_error.h
@@ -109,7 +109,7 @@ class ErrorInfo {
}
void Reset() {
- SetReport(ERROR_UNKNOWN, std::string());
+ SetReport(ERROR_UNKNOWN, "");
}
void SetReport(PluginErrorCode error_code, const std::string& message) {
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
index ff0982e..a7d3f24 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
@@ -224,7 +224,9 @@ void PnaclTranslateThread::DoTranslate() {
}
PLUGIN_PRINTF(("PnaclTranslateThread done with chunks\n"));
// Finish llc.
- if (!llc_subprocess_->InvokeSrpcMethod("StreamEnd", std::string(), &params)) {
+ if(!llc_subprocess_->InvokeSrpcMethod("StreamEnd",
+ "",
+ &params)) {
PLUGIN_PRINTF(("PnaclTranslateThread StreamEnd failed\n"));
if (llc_subprocess_->srpc_client()->GetLastError() ==
NACL_SRPC_RESULT_APP_ERROR) {
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
index 68a50d3..00f64c7 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
@@ -846,7 +846,7 @@ nacl::string ServiceRuntime::GetCrashLogOutput() {
if (NULL != subprocess_.get()) {
return subprocess_->GetCrashLogOutput();
} else {
- return std::string();
+ return "";
}
}
diff --git a/ppapi/proxy/audio_input_resource.cc b/ppapi/proxy/audio_input_resource.cc
index 4f321c2..5f700ec 100644
--- a/ppapi/proxy/audio_input_resource.cc
+++ b/ppapi/proxy/audio_input_resource.cc
@@ -217,10 +217,7 @@ void AudioInputResource::SetStreamInfo(
shared_memory_size_ = shared_memory_size;
if (!shared_memory_->Map(shared_memory_size_)) {
- PpapiGlobals::Get()->LogWithSource(
- pp_instance(),
- PP_LOGLEVEL_WARNING,
- std::string(),
+ PpapiGlobals::Get()->LogWithSource(pp_instance(), PP_LOGLEVEL_WARNING, "",
"Failed to map shared memory for PPB_AudioInput_Shared.");
}
diff --git a/ppapi/shared_impl/ppb_audio_shared.cc b/ppapi/shared_impl/ppb_audio_shared.cc
index f6d0cac..f275559 100644
--- a/ppapi/shared_impl/ppb_audio_shared.cc
+++ b/ppapi/shared_impl/ppb_audio_shared.cc
@@ -80,11 +80,8 @@ void PPB_Audio_Shared::SetStreamInfo(
if (!shared_memory_->Map(
media::TotalSharedMemorySizeInBytes(shared_memory_size_))) {
- PpapiGlobals::Get()->LogWithSource(
- instance,
- PP_LOGLEVEL_WARNING,
- std::string(),
- "Failed to map shared memory for PPB_Audio_Shared.");
+ PpapiGlobals::Get()->LogWithSource(instance, PP_LOGLEVEL_WARNING, "",
+ "Failed to map shared memory for PPB_Audio_Shared.");
} else {
audio_bus_ = media::AudioBus::WrapMemory(
kChannels, sample_frame_count, shared_memory_->memory());
diff --git a/ppapi/tests/test_file_ref.cc b/ppapi/tests/test_file_ref.cc
index f3217f9..2dfea85 100644
--- a/ppapi/tests/test_file_ref.cc
+++ b/ppapi/tests/test_file_ref.cc
@@ -85,7 +85,7 @@ void TestFileRef::RunTests(const std::string& filter) {
std::string TestFileRef::TestCreate() {
std::vector<std::string> invalid_paths;
invalid_paths.push_back("invalid_path"); // no '/' at the first character
- invalid_paths.push_back(std::string()); // empty path
+ invalid_paths.push_back(""); // empty path
// The following are directory traversal checks
invalid_paths.push_back("..");
invalid_paths.push_back("/../invalid_path");
diff --git a/ppapi/tests/test_flash_clipboard.cc b/ppapi/tests/test_flash_clipboard.cc
index 8eb756b..e38c145 100644
--- a/ppapi/tests/test_flash_clipboard.cc
+++ b/ppapi/tests/test_flash_clipboard.cc
@@ -253,7 +253,7 @@ std::string TestFlashClipboard::TestInvalidFormat() {
std::string TestFlashClipboard::TestRegisterCustomFormat() {
// Test an empty name is rejected.
uint32_t format_id =
- pp::flash::Clipboard::RegisterCustomFormat(instance_, std::string());
+ pp::flash::Clipboard::RegisterCustomFormat(instance_, "");
ASSERT_EQ(format_id, PP_FLASH_CLIPBOARD_FORMAT_INVALID);
// Test a valid format name.
diff --git a/ppapi/tests/test_flash_file.cc b/ppapi/tests/test_flash_file.cc
index e5a8ee9..86100d9 100644
--- a/ppapi/tests/test_flash_file.cc
+++ b/ppapi/tests/test_flash_file.cc
@@ -285,10 +285,12 @@ std::string TestFlashFile::TestGetDirContents() {
CloseFileHandle(file_handle);
ASSERT_TRUE(FileModuleLocal::CreateDir(instance_, dirname));
- ASSERT_TRUE(
- FileModuleLocal::GetDirContents(instance_, std::string(), &result));
- FileModuleLocal::DirEntry expected[] = { { "..", true }, { filename, false },
- { dirname, true } };
+ ASSERT_TRUE(FileModuleLocal::GetDirContents(instance_, "", &result));
+ FileModuleLocal::DirEntry expected[] =
+ { {"..", true},
+ {filename, false},
+ {dirname, true}
+ };
size_t expected_size = sizeof(expected) / sizeof(expected[0]);
std::sort(expected, expected + expected_size, DirEntryLessThan);
@@ -327,8 +329,7 @@ std::string TestFlashFile::TestCreateTemporaryFile() {
std::string TestFlashFile::GetItemCountUnderModuleLocalRoot(
size_t* item_count) {
std::vector<FileModuleLocal::DirEntry> contents;
- ASSERT_TRUE(
- FileModuleLocal::GetDirContents(instance_, std::string(), &contents));
+ ASSERT_TRUE(FileModuleLocal::GetDirContents(instance_, "", &contents));
*item_count = contents.size();
PASS();
}
diff --git a/ppapi/tests/test_ime_input_event.cc b/ppapi/tests/test_ime_input_event.cc
index 500fcbb..804e17d7a 100644
--- a/ppapi/tests/test_ime_input_event.cc
+++ b/ppapi/tests/test_ime_input_event.cc
@@ -357,11 +357,11 @@ std::string TestImeInputEvent::TestImeCancel() {
expected_events_.clear();
expected_events_.push_back(CreateImeCompositionStartEvent());
expected_events_.push_back(update_event);
- expected_events_.push_back(CreateImeCompositionEndEvent(std::string()));
+ expected_events_.push_back(CreateImeCompositionEndEvent(""));
// Simulate the case when IME canceled composition.
ASSERT_TRUE(SimulateInputEvent(update_event));
- ASSERT_TRUE(SimulateInputEvent(CreateImeCompositionEndEvent(std::string())));
+ ASSERT_TRUE(SimulateInputEvent(CreateImeCompositionEndEvent("")));
ASSERT_TRUE(expected_events_.empty());
PASS();
@@ -417,7 +417,7 @@ std::string TestImeInputEvent::TestImeUnawareCancel() {
// Test for IME-unaware plugins. Cancel won't issue any events.
ASSERT_TRUE(SimulateInputEvent(update_event));
- ASSERT_TRUE(SimulateInputEvent(CreateImeCompositionEndEvent(std::string())));
+ ASSERT_TRUE(SimulateInputEvent(CreateImeCompositionEndEvent("")));
ASSERT_TRUE(expected_events_.empty());
PASS();
diff --git a/ppapi/tests/test_url_loader.cc b/ppapi/tests/test_url_loader.cc
index 320167a..112a483 100644
--- a/ppapi/tests/test_url_loader.cc
+++ b/ppapi/tests/test_url_loader.cc
@@ -375,7 +375,7 @@ std::string TestURLLoader::TestEmptyDataPOST() {
request.SetURL("/echo");
request.SetMethod("POST");
request.AppendDataToBody("", 0);
- return LoadAndCompareBody(request, std::string());
+ return LoadAndCompareBody(request, "");
}
std::string TestURLLoader::TestBinaryDataPOST() {
@@ -558,12 +558,11 @@ std::string TestURLLoader::TestUntrustedHttpRequests() {
// valid token (containing special characters like CR, LF).
// http://www.w3.org/TR/XMLHttpRequest/
{
- ASSERT_EQ(OpenUntrusted("cOnNeCt", std::string()), PP_ERROR_NOACCESS);
- ASSERT_EQ(OpenUntrusted("tRaCk", std::string()), PP_ERROR_NOACCESS);
- ASSERT_EQ(OpenUntrusted("tRaCe", std::string()), PP_ERROR_NOACCESS);
- ASSERT_EQ(
- OpenUntrusted("POST\x0d\x0ax-csrf-token:\x20test1234", std::string()),
- PP_ERROR_NOACCESS);
+ ASSERT_EQ(OpenUntrusted("cOnNeCt", ""), PP_ERROR_NOACCESS);
+ ASSERT_EQ(OpenUntrusted("tRaCk", ""), PP_ERROR_NOACCESS);
+ ASSERT_EQ(OpenUntrusted("tRaCe", ""), PP_ERROR_NOACCESS);
+ ASSERT_EQ(OpenUntrusted("POST\x0d\x0ax-csrf-token:\x20test1234", ""),
+ PP_ERROR_NOACCESS);
}
// HTTP methods are restricted only for untrusted loaders. Try all headers
// that are forbidden by http://www.w3.org/TR/XMLHttpRequest/.
@@ -620,9 +619,9 @@ std::string TestURLLoader::TestUntrustedHttpRequests() {
std::string TestURLLoader::TestTrustedHttpRequests() {
// Trusted requests can use restricted methods.
{
- ASSERT_EQ(OpenTrusted("cOnNeCt", std::string()), PP_OK);
- ASSERT_EQ(OpenTrusted("tRaCk", std::string()), PP_OK);
- ASSERT_EQ(OpenTrusted("tRaCe", std::string()), PP_OK);
+ ASSERT_EQ(OpenTrusted("cOnNeCt", ""), PP_OK);
+ ASSERT_EQ(OpenTrusted("tRaCk", ""), PP_OK);
+ ASSERT_EQ(OpenTrusted("tRaCe", ""), PP_OK);
}
// Trusted requests can use restricted headers.
{
diff --git a/ppapi/tests/test_websocket.cc b/ppapi/tests/test_websocket.cc
index 61a8e19..e61185d 100644
--- a/ppapi/tests/test_websocket.cc
+++ b/ppapi/tests/test_websocket.cc
@@ -350,18 +350,18 @@ std::string TestWebSocket::TestUninitializedPropertiesAccess() {
ASSERT_EQ(0U, close_code);
PP_Var close_reason = websocket_interface_->GetCloseReason(ws);
- ASSERT_TRUE(AreEqualWithString(close_reason, std::string()));
+ ASSERT_TRUE(AreEqualWithString(close_reason, ""));
ReleaseVar(close_reason);
PP_Bool close_was_clean = websocket_interface_->GetCloseWasClean(ws);
ASSERT_EQ(PP_FALSE, close_was_clean);
PP_Var extensions = websocket_interface_->GetExtensions(ws);
- ASSERT_TRUE(AreEqualWithString(extensions, std::string()));
+ ASSERT_TRUE(AreEqualWithString(extensions, ""));
ReleaseVar(extensions);
PP_Var protocol = websocket_interface_->GetProtocol(ws);
- ASSERT_TRUE(AreEqualWithString(protocol, std::string()));
+ ASSERT_TRUE(AreEqualWithString(protocol, ""));
ReleaseVar(protocol);
PP_WebSocketReadyState ready_state =
@@ -369,7 +369,7 @@ std::string TestWebSocket::TestUninitializedPropertiesAccess() {
ASSERT_EQ(PP_WEBSOCKETREADYSTATE_INVALID, ready_state);
PP_Var url = websocket_interface_->GetURL(ws);
- ASSERT_TRUE(AreEqualWithString(url, std::string()));
+ ASSERT_TRUE(AreEqualWithString(url, ""));
ReleaseVar(url);
core_interface_->ReleaseResource(ws);
@@ -398,7 +398,7 @@ std::string TestWebSocket::TestInvalidConnect() {
for (int i = 0; kInvalidURLs[i]; ++i) {
int32_t result;
- ws = Connect(kInvalidURLs[i], &result, std::string());
+ ws = Connect(kInvalidURLs[i], &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_ERROR_BADARGUMENT, result);
@@ -448,7 +448,7 @@ std::string TestWebSocket::TestProtocols() {
std::string TestWebSocket::TestGetURL() {
for (int i = 0; kInvalidURLs[i]; ++i) {
int32_t result;
- PP_Resource ws = Connect(kInvalidURLs[i], &result, std::string());
+ PP_Resource ws = Connect(kInvalidURLs[i], &result, "");
ASSERT_TRUE(ws);
PP_Var url = websocket_interface_->GetURL(ws);
ASSERT_TRUE(AreEqualWithString(url, kInvalidURLs[i]));
@@ -463,11 +463,11 @@ std::string TestWebSocket::TestGetURL() {
std::string TestWebSocket::TestValidConnect() {
int32_t result;
- PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
PP_Var extensions = websocket_interface_->GetExtensions(ws);
- ASSERT_TRUE(AreEqualWithString(extensions, std::string()));
+ ASSERT_TRUE(AreEqualWithString(extensions, ""));
core_interface_->ReleaseResource(ws);
ReleaseVar(extensions);
@@ -489,7 +489,7 @@ std::string TestWebSocket::TestInvalidClose() {
// Close with bad arguments.
int32_t result;
- ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
callback.WaitForResult(websocket_interface_->Close(
@@ -498,7 +498,7 @@ std::string TestWebSocket::TestInvalidClose() {
core_interface_->ReleaseResource(ws);
// Close with PP_VARTYPE_NULL.
- ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
callback.WaitForResult(websocket_interface_->Close(
@@ -508,7 +508,7 @@ std::string TestWebSocket::TestInvalidClose() {
core_interface_->ReleaseResource(ws);
// Close with PP_VARTYPE_NULL and ongoing receive message.
- ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
PP_Var receive_message_var;
@@ -532,7 +532,7 @@ std::string TestWebSocket::TestInvalidClose() {
core_interface_->ReleaseResource(ws);
// Close twice.
- ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
result = websocket_interface_->Close(
@@ -569,7 +569,7 @@ std::string TestWebSocket::TestValidClose() {
// Close.
int32_t result;
- PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
callback.WaitForResult(websocket_interface_->Close(
@@ -580,7 +580,7 @@ std::string TestWebSocket::TestValidClose() {
core_interface_->ReleaseResource(ws);
// Close without code and reason.
- ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
callback.WaitForResult(websocket_interface_->Close(
@@ -590,7 +590,7 @@ std::string TestWebSocket::TestValidClose() {
core_interface_->ReleaseResource(ws);
// Close with PP_VARTYPE_UNDEFINED.
- ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
callback.WaitForResult(websocket_interface_->Close(
@@ -620,7 +620,7 @@ std::string TestWebSocket::TestValidClose() {
// Close in closing.
// The first close will be done successfully, then the second one failed with
// with PP_ERROR_INPROGRESS immediately.
- ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
result = websocket_interface_->Close(
@@ -636,7 +636,7 @@ std::string TestWebSocket::TestValidClose() {
core_interface_->ReleaseResource(ws);
// Close with ongoing receive message.
- ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
PP_Var receive_message_var;
@@ -655,7 +655,7 @@ std::string TestWebSocket::TestValidClose() {
core_interface_->ReleaseResource(ws);
// Close with PP_VARTYPE_UNDEFINED and ongoing receive message.
- ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kEchoServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
result = websocket_interface_->ReceiveMessage(
@@ -673,8 +673,7 @@ std::string TestWebSocket::TestValidClose() {
core_interface_->ReleaseResource(ws);
// Server initiated closing handshake.
- ws = Connect(
- GetFullURL(kCloseWithCodeAndReasonServerURL), &result, std::string());
+ ws = Connect(GetFullURL(kCloseWithCodeAndReasonServerURL), &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
// Text messsage "1000 bye" requests the server to initiate closing handshake
@@ -721,8 +720,7 @@ std::string TestWebSocket::TestGetProtocol() {
std::string TestWebSocket::TestTextSendReceive() {
// Connect to test echo server.
int32_t connect_result;
- PP_Resource ws =
- Connect(GetFullURL(kEchoServerURL), &connect_result, std::string());
+ PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &connect_result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, connect_result);
@@ -749,8 +747,7 @@ std::string TestWebSocket::TestTextSendReceive() {
std::string TestWebSocket::TestBinarySendReceive() {
// Connect to test echo server.
int32_t connect_result;
- PP_Resource ws =
- Connect(GetFullURL(kEchoServerURL), &connect_result, std::string());
+ PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &connect_result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, connect_result);
@@ -779,8 +776,7 @@ std::string TestWebSocket::TestBinarySendReceive() {
std::string TestWebSocket::TestStressedSendReceive() {
// Connect to test echo server.
int32_t connect_result;
- PP_Resource ws =
- Connect(GetFullURL(kEchoServerURL), &connect_result, std::string());
+ PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &connect_result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, connect_result);
@@ -840,8 +836,7 @@ std::string TestWebSocket::TestStressedSendReceive() {
std::string TestWebSocket::TestBufferedAmount() {
// Connect to test echo server.
int32_t connect_result;
- PP_Resource ws =
- Connect(GetFullURL(kEchoServerURL), &connect_result, std::string());
+ PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &connect_result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, connect_result);
@@ -881,7 +876,7 @@ std::string TestWebSocket::TestBufferedAmount() {
// After connection closure, all sending requests fail and just increase
// the bufferedAmount property.
- PP_Var empty_string = CreateVarString(std::string());
+ PP_Var empty_string = CreateVarString("");
result = websocket_interface_->SendMessage(ws, empty_string);
ASSERT_EQ(PP_ERROR_FAILED, result);
buffered_amount = websocket_interface_->GetBufferedAmount(ws);
@@ -924,7 +919,7 @@ std::string TestWebSocket::TestAbortCallsWithCallback() {
ASSERT_EQ(PP_ERROR_ABORTED, connect_callback.result());
// Test the behavior for Close().
- ws = Connect(url, &result, std::string());
+ ws = Connect(url, &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
PP_Var reason_var = CreateVarString("abort");
@@ -941,7 +936,7 @@ std::string TestWebSocket::TestAbortCallsWithCallback() {
// Test the behavior for ReceiveMessage().
// Make sure the simplest case to wait for data which never arrives, here.
- ws = Connect(url, &result, std::string());
+ ws = Connect(url, &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
PP_Var receive_var;
@@ -957,7 +952,7 @@ std::string TestWebSocket::TestAbortCallsWithCallback() {
// Release the resource in the aborting receive completion callback which is
// introduced by calling Close().
- ws = Connect(url, &result, std::string());
+ ws = Connect(url, &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
result = websocket_interface_->ReceiveMessage(
@@ -991,7 +986,7 @@ std::string TestWebSocket::TestAbortSendMessageCall() {
int32_t result;
std::string url = GetFullURL(kEchoServerURL);
- PP_Resource ws = Connect(url, &result, std::string());
+ PP_Resource ws = Connect(url, &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
result = websocket_interface_->SendMessage(ws, large_var);
@@ -1006,7 +1001,7 @@ std::string TestWebSocket::TestAbortCloseCall() {
// Release the resource in the close completion callback.
int32_t result;
std::string url = GetFullURL(kEchoServerURL);
- PP_Resource ws = Connect(url, &result, std::string());
+ PP_Resource ws = Connect(url, &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
TestCompletionCallback close_callback(
@@ -1039,7 +1034,7 @@ std::string TestWebSocket::TestAbortReceiveMessageCall() {
// released while the next message is going to be received.
const int trial_count = 8;
for (int trial = 1; trial <= trial_count; trial++) {
- ws = Connect(url, &result, std::string());
+ ws = Connect(url, &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
for (int i = 0; i <= trial_count; ++i) {
@@ -1065,7 +1060,7 @@ std::string TestWebSocket::TestAbortReceiveMessageCall() {
}
// Same test, but the last receiving message is large message over 64KiB.
for (int trial = 1; trial <= trial_count; trial++) {
- ws = Connect(url, &result, std::string());
+ ws = Connect(url, &result, "");
ASSERT_TRUE(ws);
ASSERT_EQ(PP_OK, result);
for (int i = 0; i <= trial_count; ++i) {
@@ -1107,12 +1102,12 @@ std::string TestWebSocket::TestCcInterfaces() {
// Check uninitialized properties access.
ASSERT_EQ(0, ws.GetBufferedAmount());
ASSERT_EQ(0, ws.GetCloseCode());
- ASSERT_TRUE(AreEqualWithString(ws.GetCloseReason().pp_var(), std::string()));
+ ASSERT_TRUE(AreEqualWithString(ws.GetCloseReason().pp_var(), ""));
ASSERT_EQ(false, ws.GetCloseWasClean());
- ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), std::string()));
- ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), std::string()));
+ ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), ""));
+ ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), ""));
ASSERT_EQ(PP_WEBSOCKETREADYSTATE_INVALID, ws.GetReadyState());
- ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), std::string()));
+ ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), ""));
// Check communication interfaces (connect, send, receive, and close).
TestCompletionCallback connect_callback(
@@ -1168,7 +1163,7 @@ std::string TestWebSocket::TestCcInterfaces() {
ASSERT_TRUE(
AreEqualWithString(ws.GetCloseReason().pp_var(), reason.c_str()));
ASSERT_EQ(true, ws.GetCloseWasClean());
- ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), std::string()));
+ ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), ""));
ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED, ws.GetReadyState());
ASSERT_TRUE(AreEqualWithString(
ws.GetURL().pp_var(), GetFullURL(kCloseServerURL).c_str()));
@@ -1273,8 +1268,7 @@ std::string TestWebSocket::TestUtilityValidConnect() {
const std::vector<WebSocketEvent>& events = websocket.GetSeenEvents();
ASSERT_EQ(1U, events.size());
ASSERT_EQ(WebSocketEvent::EVENT_OPEN, events[0].event_type);
- ASSERT_TRUE(
- AreEqualWithString(websocket.GetExtensions().pp_var(), std::string()));
+ ASSERT_TRUE(AreEqualWithString(websocket.GetExtensions().pp_var(), ""));
PASS();
}
@@ -1502,7 +1496,7 @@ std::string TestWebSocket::TestUtilityBufferedAmount() {
// After connection closure, all sending requests fail and just increase
// the bufferedAmount property.
- result = websocket.Send(pp::Var(std::string()));
+ result = websocket.Send(pp::Var(std::string("")));
ASSERT_EQ(PP_ERROR_FAILED, result);
buffered_amount = websocket.GetBufferedAmount();
ASSERT_EQ(base_buffered_amount + kMessageFrameOverhead, buffered_amount);
diff --git a/ppapi/tests/test_x509_certificate_private.cc b/ppapi/tests/test_x509_certificate_private.cc
index fab2f21..6aee30f 100644
--- a/ppapi/tests/test_x509_certificate_private.cc
+++ b/ppapi/tests/test_x509_certificate_private.cc
@@ -166,30 +166,22 @@ std::string TestX509CertificatePrivate::TestValidCertificate() {
PP_X509CERTIFICATE_PRIVATE_SUBJECT_COUNTRY_NAME, "US"));
ASSERT_TRUE(FieldMatchesString(certificate,
PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME, "Google Inc"));
- ASSERT_TRUE(FieldMatchesString(
- certificate,
- PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME,
- std::string()));
+ ASSERT_TRUE(FieldMatchesString(certificate,
+ PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME, ""));
ASSERT_TRUE(FieldMatchesString(certificate,
PP_X509CERTIFICATE_PRIVATE_ISSUER_COMMON_NAME, "Thawte SGC CA"));
- ASSERT_TRUE(
- FieldMatchesString(certificate,
- PP_X509CERTIFICATE_PRIVATE_ISSUER_LOCALITY_NAME,
- std::string()));
- ASSERT_TRUE(FieldMatchesString(
- certificate,
- PP_X509CERTIFICATE_PRIVATE_ISSUER_STATE_OR_PROVINCE_NAME,
- std::string()));
- ASSERT_TRUE(FieldMatchesString(
- certificate, PP_X509CERTIFICATE_PRIVATE_ISSUER_COUNTRY_NAME, "ZA"));
+ ASSERT_TRUE(FieldMatchesString(certificate,
+ PP_X509CERTIFICATE_PRIVATE_ISSUER_LOCALITY_NAME, ""));
+ ASSERT_TRUE(FieldMatchesString(certificate,
+ PP_X509CERTIFICATE_PRIVATE_ISSUER_STATE_OR_PROVINCE_NAME, ""));
+ ASSERT_TRUE(FieldMatchesString(certificate,
+ PP_X509CERTIFICATE_PRIVATE_ISSUER_COUNTRY_NAME, "ZA"));
ASSERT_TRUE(FieldMatchesString(certificate,
PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_NAME,
"Thawte Consulting (Pty) Ltd."));
- ASSERT_TRUE(FieldMatchesString(
- certificate,
- PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_UNIT_NAME,
- std::string()));
+ ASSERT_TRUE(FieldMatchesString(certificate,
+ PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_UNIT_NAME, ""));
ASSERT_FALSE(FieldIsNull(certificate,
PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER));
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 057c4a1..aff8c10 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -81,7 +81,7 @@ std::string ConnectionStateToString(protocol::ConnectionToHost::State state) {
return "FAILED";
}
NOTREACHED();
- return std::string();
+ return "";
}
// TODO(sergeyu): Ideally we should just pass ErrorCode to the webapp
@@ -115,7 +115,7 @@ std::string ConnectionErrorToString(protocol::ErrorCode error) {
return "NETWORK_FAILURE";
}
DLOG(FATAL) << "Unknown error code" << error;
- return std::string();
+ return "";
}
// This flag blocks LOGs to the UI if we're already in the middle of logging
diff --git a/remoting/client/plugin/pepper_port_allocator.cc b/remoting/client/plugin/pepper_port_allocator.cc
index 423102a..62a5822 100644
--- a/remoting/client/plugin/pepper_port_allocator.cc
+++ b/remoting/client/plugin/pepper_port_allocator.cc
@@ -82,15 +82,9 @@ PepperPortAllocatorSession::PepperPortAllocatorSession(
const std::vector<std::string>& relay_hosts,
const std::string& relay_token,
const pp::InstanceHandle& instance)
- : HttpPortAllocatorSessionBase(allocator,
- content_name,
- component,
- ice_username_fragment,
- ice_password,
- stun_hosts,
- relay_hosts,
- relay_token,
- std::string()),
+ : HttpPortAllocatorSessionBase(
+ allocator, content_name, component, ice_username_fragment, ice_password,
+ stun_hosts, relay_hosts, relay_token, ""),
instance_(instance),
stun_address_resolver_(instance_),
stun_port_(0),
@@ -135,7 +129,7 @@ void PepperPortAllocatorSession::GetPortConfigurations() {
// Add an empty configuration synchronously, so a local connection
// can be started immediately.
ConfigReady(new cricket::PortConfiguration(
- talk_base::SocketAddress(), std::string(), std::string()));
+ talk_base::SocketAddress(), "", ""));
ResolveStunServerAddress();
TryCreateRelaySession();
@@ -201,8 +195,7 @@ void PepperPortAllocatorSession::OnStunAddressResolved(int32_t result) {
ReceiveSessionResponse(std::string(relay_response_body_.begin(),
relay_response_body_.end()));
} else {
- ConfigReady(new cricket::PortConfiguration(
- stun_address_, std::string(), std::string()));
+ ConfigReady(new cricket::PortConfiguration(stun_address_, "", ""));
}
}
@@ -311,9 +304,7 @@ PepperPortAllocator::PepperPortAllocator(
const pp::InstanceHandle& instance,
scoped_ptr<talk_base::NetworkManager> network_manager,
scoped_ptr<talk_base::PacketSocketFactory> socket_factory)
- : HttpPortAllocatorBase(network_manager.get(),
- socket_factory.get(),
- std::string()),
+ : HttpPortAllocatorBase(network_manager.get(), socket_factory.get(), ""),
instance_(instance),
network_manager_(network_manager.Pass()),
socket_factory_(socket_factory.Pass()) {
diff --git a/remoting/host/desktop_process_unittest.cc b/remoting/host/desktop_process_unittest.cc
index bc50988..b861cf0 100644
--- a/remoting/host/desktop_process_unittest.cc
+++ b/remoting/host/desktop_process_unittest.cc
@@ -172,7 +172,7 @@ void DesktopProcessTest::ConnectNetworkChannel(
IPC::PlatformFileForTransit desktop_process) {
#if defined(OS_POSIX)
- IPC::ChannelHandle channel_handle(std::string(), desktop_process);
+ IPC::ChannelHandle channel_handle("", desktop_process);
#elif defined(OS_WIN)
IPC::ChannelHandle channel_handle(desktop_process);
#endif // defined(OS_WIN)
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc
index 04add54..05a8188 100644
--- a/remoting/host/desktop_session_proxy.cc
+++ b/remoting/host/desktop_session_proxy.cc
@@ -143,7 +143,7 @@ bool DesktopSessionProxy::AttachToDesktop(
// On posix: |desktop_pipe| is a valid file descriptor.
DCHECK(desktop_pipe.auto_close);
- IPC::ChannelHandle desktop_channel_handle(std::string(), desktop_pipe);
+ IPC::ChannelHandle desktop_channel_handle("", desktop_pipe);
#else
#error Unsupported platform.
diff --git a/remoting/host/heartbeat_sender_unittest.cc b/remoting/host/heartbeat_sender_unittest.cc
index ea5eeb8..99880b4 100644
--- a/remoting/host/heartbeat_sender_unittest.cc
+++ b/remoting/host/heartbeat_sender_unittest.cc
@@ -176,9 +176,9 @@ TEST_F(HeartbeatSenderTest, DoSendStanzaWithExpectedSequenceId) {
.WillOnce(DoAll(SaveArg<0>(&sent_iq2), Return(true)));
scoped_ptr<XmlElement> response(new XmlElement(buzz::QN_IQ));
- response->AddAttr(QName(std::string(), "type"), "result");
- XmlElement* result =
- new XmlElement(QName(kChromotingXmlNamespace, "heartbeat-result"));
+ response->AddAttr(QName("", "type"), "result");
+ XmlElement* result = new XmlElement(
+ QName(kChromotingXmlNamespace, "heartbeat-result"));
response->AddElement(result);
XmlElement* expected_sequence_id = new XmlElement(
QName(kChromotingXmlNamespace, "expected-sequence-id"));
@@ -200,7 +200,7 @@ TEST_F(HeartbeatSenderTest, DoSendStanzaWithExpectedSequenceId) {
// Verify that ProcessResponse parses set-interval result.
TEST_F(HeartbeatSenderTest, ProcessResponseSetInterval) {
scoped_ptr<XmlElement> response(new XmlElement(buzz::QN_IQ));
- response->AddAttr(QName(std::string(), "type"), "result");
+ response->AddAttr(QName("", "type"), "result");
XmlElement* result = new XmlElement(
QName(kChromotingXmlNamespace, "heartbeat-result"));
@@ -221,9 +221,9 @@ TEST_F(HeartbeatSenderTest, ProcessResponseSetInterval) {
// Validate a heartbeat stanza.
void HeartbeatSenderTest::ValidateHeartbeatStanza(
XmlElement* stanza, const char* expectedSequenceId) {
- EXPECT_EQ(stanza->Attr(buzz::QName(std::string(), "to")),
+ EXPECT_EQ(stanza->Attr(buzz::QName("", "to")),
std::string(kTestBotJid));
- EXPECT_EQ(stanza->Attr(buzz::QName(std::string(), "type")), "set");
+ EXPECT_EQ(stanza->Attr(buzz::QName("", "type")), "set");
XmlElement* heartbeat_stanza =
stanza->FirstNamed(QName(kChromotingXmlNamespace, "heartbeat"));
ASSERT_TRUE(heartbeat_stanza != NULL);
diff --git a/remoting/host/host_change_notification_listener_unittest.cc b/remoting/host/host_change_notification_listener_unittest.cc
index 5ec6ff8..1f9305e 100644
--- a/remoting/host/host_change_notification_listener_unittest.cc
+++ b/remoting/host/host_change_notification_listener_unittest.cc
@@ -69,9 +69,9 @@ class HostChangeNotificationListenerTest : public testing::Test {
std::string hostId,
std::string botJid) {
scoped_ptr<XmlElement> stanza(new XmlElement(buzz::QN_IQ));
- stanza->AddAttr(QName(std::string(), "type"), "set");
- XmlElement* host_changed =
- new XmlElement(QName(kChromotingXmlNamespace, "host-changed"));
+ stanza->AddAttr(QName("", "type"), "set");
+ XmlElement* host_changed = new XmlElement(
+ QName(kChromotingXmlNamespace, "host-changed"));
host_changed->AddAttr(QName(kChromotingXmlNamespace, "operation"),
operation);
host_changed->AddAttr(QName(kChromotingXmlNamespace, "hostid"), hostId);
diff --git a/remoting/host/host_port_allocator.cc b/remoting/host/host_port_allocator.cc
index cf8a84c..ba53322 100644
--- a/remoting/host/host_port_allocator.cc
+++ b/remoting/host/host_port_allocator.cc
@@ -59,16 +59,11 @@ HostPortAllocatorSession::HostPortAllocatorSession(
const std::vector<std::string>& relay_hosts,
const std::string& relay,
const scoped_refptr<net::URLRequestContextGetter>& url_context)
- : HttpPortAllocatorSessionBase(allocator,
- content_name,
- component,
- ice_username_fragment,
- ice_password,
- stun_hosts,
- relay_hosts,
- relay,
- std::string()),
- url_context_(url_context) {}
+ : HttpPortAllocatorSessionBase(
+ allocator, content_name, component, ice_username_fragment, ice_password,
+ stun_hosts, relay_hosts, relay, ""),
+ url_context_(url_context) {
+}
HostPortAllocatorSession::~HostPortAllocatorSession() {
STLDeleteElements(&url_fetchers_);
@@ -162,12 +157,11 @@ HostPortAllocator::HostPortAllocator(
const scoped_refptr<net::URLRequestContextGetter>& url_context,
scoped_ptr<talk_base::NetworkManager> network_manager,
scoped_ptr<talk_base::PacketSocketFactory> socket_factory)
- : HttpPortAllocatorBase(network_manager.get(),
- socket_factory.get(),
- std::string()),
+ : HttpPortAllocatorBase(network_manager.get(), socket_factory.get(), ""),
url_context_(url_context),
network_manager_(network_manager.Pass()),
- socket_factory_(socket_factory.Pass()) {}
+ socket_factory_(socket_factory.Pass()) {
+}
HostPortAllocator::~HostPortAllocator() {
}
diff --git a/remoting/host/log_to_server_unittest.cc b/remoting/host/log_to_server_unittest.cc
index 99a51ec..1fb0500 100644
--- a/remoting/host/log_to_server_unittest.cc
+++ b/remoting/host/log_to_server_unittest.cc
@@ -36,12 +36,11 @@ const char kHostJid[] = "host@domain.com/1234";
bool IsLogEntryForConnection(XmlElement* node, const char* connection_type) {
return (node->Name() == QName(kChromotingNamespace, "entry") &&
- node->Attr(QName(std::string(), "event-name")) == "session-state" &&
- node->Attr(QName(std::string(), "session-state")) == "connected" &&
- node->Attr(QName(std::string(), "role")) == "host" &&
- node->Attr(QName(std::string(), "mode")) == "me2me" &&
- node->Attr(QName(std::string(), "connection-type")) ==
- connection_type);
+ node->Attr(QName("", "event-name")) == "session-state" &&
+ node->Attr(QName("", "session-state")) == "connected" &&
+ node->Attr(QName("", "role")) == "host" &&
+ node->Attr(QName("", "mode")) == "me2me" &&
+ node->Attr(QName("", "connection-type")) == connection_type);
}
MATCHER_P(IsClientConnected, connection_type, "") {
@@ -92,10 +91,10 @@ MATCHER_P2(IsTwoClientsConnected, connection_type1, connection_type2, "") {
bool IsLogEntryForDisconnection(XmlElement* node) {
return (node->Name() == QName(kChromotingNamespace, "entry") &&
- node->Attr(QName(std::string(), "event-name")) == "session-state" &&
- node->Attr(QName(std::string(), "session-state")) == "closed" &&
- node->Attr(QName(std::string(), "role")) == "host" &&
- node->Attr(QName(std::string(), "mode")) == "me2me");
+ node->Attr(QName("", "event-name")) == "session-state" &&
+ node->Attr(QName("", "session-state")) == "closed" &&
+ node->Attr(QName("", "role")) == "host" &&
+ node->Attr(QName("", "mode")) == "me2me");
}
MATCHER(IsClientDisconnected, "") {
diff --git a/remoting/host/policy_hack/policy_watcher_unittest.cc b/remoting/host/policy_hack/policy_watcher_unittest.cc
index ff1aa8a..d323718 100644
--- a/remoting/host/policy_hack/policy_watcher_unittest.cc
+++ b/remoting/host/policy_hack/policy_watcher_unittest.cc
@@ -29,8 +29,7 @@ class PolicyWatcherTest : public testing::Test {
nat_true_.SetBoolean(PolicyWatcher::kNatPolicyName, true);
nat_false_.SetBoolean(PolicyWatcher::kNatPolicyName, false);
nat_one_.SetInteger(PolicyWatcher::kNatPolicyName, 1);
- domain_empty_.SetString(PolicyWatcher::kHostDomainPolicyName,
- std::string());
+ domain_empty_.SetString(PolicyWatcher::kHostDomainPolicyName, "");
domain_full_.SetString(PolicyWatcher::kHostDomainPolicyName, kHostDomain);
SetDefaults(nat_true_others_default_);
nat_true_others_default_.SetBoolean(PolicyWatcher::kNatPolicyName, true);
@@ -38,19 +37,17 @@ class PolicyWatcherTest : public testing::Test {
nat_false_others_default_.SetBoolean(PolicyWatcher::kNatPolicyName, false);
SetDefaults(domain_empty_others_default_);
domain_empty_others_default_.SetString(PolicyWatcher::kHostDomainPolicyName,
- std::string());
+ "");
SetDefaults(domain_full_others_default_);
domain_full_others_default_.SetString(PolicyWatcher::kHostDomainPolicyName,
kHostDomain);
nat_true_domain_empty_.SetBoolean(PolicyWatcher::kNatPolicyName, true);
- nat_true_domain_empty_.SetString(PolicyWatcher::kHostDomainPolicyName,
- std::string());
+ nat_true_domain_empty_.SetString(PolicyWatcher::kHostDomainPolicyName, "");
nat_true_domain_full_.SetBoolean(PolicyWatcher::kNatPolicyName, true);
nat_true_domain_full_.SetString(PolicyWatcher::kHostDomainPolicyName,
kHostDomain);
nat_false_domain_empty_.SetBoolean(PolicyWatcher::kNatPolicyName, false);
- nat_false_domain_empty_.SetString(PolicyWatcher::kHostDomainPolicyName,
- std::string());
+ nat_false_domain_empty_.SetString(PolicyWatcher::kHostDomainPolicyName, "");
nat_false_domain_full_.SetBoolean(PolicyWatcher::kNatPolicyName, false);
nat_false_domain_full_.SetString(PolicyWatcher::kHostDomainPolicyName,
kHostDomain);
@@ -58,9 +55,9 @@ class PolicyWatcherTest : public testing::Test {
nat_true_domain_empty_others_default_.SetBoolean(
PolicyWatcher::kNatPolicyName, true);
nat_true_domain_empty_others_default_.SetString(
- PolicyWatcher::kHostDomainPolicyName, std::string());
- unknown_policies_.SetString("UnknownPolicyOne", std::string());
- unknown_policies_.SetString("UnknownPolicyTwo", std::string());
+ PolicyWatcher::kHostDomainPolicyName, "");
+ unknown_policies_.SetString("UnknownPolicyOne", "");
+ unknown_policies_.SetString("UnknownPolicyTwo", "");
const char kOverrideNatTraversalToFalse[] =
"{ \"RemoteAccessHostFirewallTraversal\": false }";
@@ -120,14 +117,13 @@ class PolicyWatcherTest : public testing::Test {
void SetDefaults(base::DictionaryValue& dict) {
dict.SetBoolean(PolicyWatcher::kNatPolicyName, true);
dict.SetBoolean(PolicyWatcher::kHostRequireTwoFactorPolicyName, false);
- dict.SetString(PolicyWatcher::kHostDomainPolicyName, std::string());
+ dict.SetString(PolicyWatcher::kHostDomainPolicyName, "");
dict.SetBoolean(PolicyWatcher::kHostMatchUsernamePolicyName, false);
dict.SetString(PolicyWatcher::kHostTalkGadgetPrefixPolicyName,
kDefaultHostTalkGadgetPrefix);
dict.SetBoolean(PolicyWatcher::kHostRequireCurtainPolicyName, false);
- dict.SetString(PolicyWatcher::kHostTokenUrlPolicyName, std::string());
- dict.SetString(PolicyWatcher::kHostTokenValidationUrlPolicyName,
- std::string());
+ dict.SetString(PolicyWatcher::kHostTokenUrlPolicyName, "");
+ dict.SetString(PolicyWatcher::kHostTokenValidationUrlPolicyName, "");
#if !defined(NDEBUG)
dict.SetString(PolicyWatcher::kHostDebugOverridePoliciesName, "");
#endif
diff --git a/remoting/host/register_support_host_request_unittest.cc b/remoting/host/register_support_host_request_unittest.cc
index 6080304..cd5da6e 100644
--- a/remoting/host/register_support_host_request_unittest.cc
+++ b/remoting/host/register_support_host_request_unittest.cc
@@ -99,9 +99,9 @@ TEST_F(RegisterSupportHostRequestTest, Send) {
scoped_ptr<XmlElement> stanza(sent_iq);
ASSERT_TRUE(stanza != NULL);
- EXPECT_EQ(stanza->Attr(buzz::QName(std::string(), "to")),
+ EXPECT_EQ(stanza->Attr(buzz::QName("", "to")),
std::string(kTestBotJid));
- EXPECT_EQ(stanza->Attr(buzz::QName(std::string(), "type")), "set");
+ EXPECT_EQ(stanza->Attr(buzz::QName("", "type")), "set");
EXPECT_EQ(QName(kChromotingXmlNamespace, "register-support-host"),
stanza->FirstElement()->Name());
@@ -131,9 +131,9 @@ TEST_F(RegisterSupportHostRequestTest, Send) {
base::TimeDelta::FromSeconds(300)));
scoped_ptr<XmlElement> response(new XmlElement(buzz::QN_IQ));
- response->AddAttr(QName(std::string(), "from"), kTestBotJid);
- response->AddAttr(QName(std::string(), "type"), "result");
- response->AddAttr(QName(std::string(), "id"), kStanzaId);
+ response->AddAttr(QName("", "from"), kTestBotJid);
+ response->AddAttr(QName("", "type"), "result");
+ response->AddAttr(QName("", "id"), kStanzaId);
XmlElement* result = new XmlElement(
QName(kChromotingXmlNamespace, "register-support-host-result"));
diff --git a/remoting/host/server_log_entry.cc b/remoting/host/server_log_entry.cc
index f18b2378..cf6f861 100644
--- a/remoting/host/server_log_entry.cc
+++ b/remoting/host/server_log_entry.cc
@@ -140,7 +140,7 @@ scoped_ptr<XmlElement> ServerLogEntry::ToStanza() const {
kChromotingXmlNamespace, kLogEntry)));
ValuesMap::const_iterator iter;
for (iter = values_map_.begin(); iter != values_map_.end(); ++iter) {
- stanza->AddAttr(QName(std::string(), iter->first), iter->second);
+ stanza->AddAttr(QName("", iter->first), iter->second);
}
return stanza.Pass();
}
diff --git a/remoting/host/service_client.cc b/remoting/host/service_client.cc
index d487a97..6db1c6e 100644
--- a/remoting/host/service_client.cc
+++ b/remoting/host/service_client.cc
@@ -78,10 +78,7 @@ void ServiceClient::Core::RegisterHost(
post_body.SetString("data.publicKey", public_key);
std::string post_body_str;
base::JSONWriter::Write(&post_body, &post_body_str);
- MakeGaiaRequest(net::URLFetcher::POST,
- std::string(),
- post_body_str,
- oauth_access_token,
+ MakeGaiaRequest(net::URLFetcher::POST, "", post_body_str, oauth_access_token,
delegate);
}
@@ -91,11 +88,8 @@ void ServiceClient::Core::UnregisterHost(
Delegate* delegate) {
DCHECK(pending_request_type_ == PENDING_REQUEST_NONE);
pending_request_type_ = PENDING_REQUEST_UNREGISTER_HOST;
- MakeGaiaRequest(net::URLFetcher::DELETE_REQUEST,
- host_id,
- std::string(),
- oauth_access_token,
- delegate);
+ MakeGaiaRequest(net::URLFetcher::DELETE_REQUEST, host_id, "",
+ oauth_access_token, delegate);
}
void ServiceClient::Core::MakeGaiaRequest(
diff --git a/remoting/host/setup/daemon_controller_linux.cc b/remoting/host/setup/daemon_controller_linux.cc
index 216572f..f5076d4 100644
--- a/remoting/host/setup/daemon_controller_linux.cc
+++ b/remoting/host/setup/daemon_controller_linux.cc
@@ -318,7 +318,7 @@ void DaemonControllerLinux::DoGetVersion(
const GetVersionCallback& done_callback) {
base::FilePath script_path;
if (!GetScriptPath(&script_path)) {
- done_callback.Run(std::string());
+ done_callback.Run("");
return;
}
CommandLine command_line(script_path);
@@ -331,14 +331,14 @@ void DaemonControllerLinux::DoGetVersion(
if (!result || exit_code != 0) {
LOG(ERROR) << "Failed to run \"" << command_line.GetCommandLineString()
<< "\". Exit code: " << exit_code;
- done_callback.Run(std::string());
+ done_callback.Run("");
return;
}
TrimWhitespaceASCII(version, TRIM_ALL, &version);
if (!ContainsOnlyChars(version, "0123456789.")) {
LOG(ERROR) << "Received invalid host version number: " << version;
- done_callback.Run(std::string());
+ done_callback.Run("");
return;
}
diff --git a/remoting/host/setup/oauth_helper.cc b/remoting/host/setup/oauth_helper.cc
index 6ea46d5..6f110f6 100644
--- a/remoting/host/setup/oauth_helper.cc
+++ b/remoting/host/setup/oauth_helper.cc
@@ -14,7 +14,7 @@ namespace {
std::string GetComponent(const std::string& url,
const url_parse::Component component) {
if (component.len < 0) {
- return std::string();
+ return "";
}
return url.substr(component.begin, component.len);
}
@@ -60,11 +60,11 @@ std::string GetOauthCodeInUrl(const std::string& url,
&redirect_url_parsed);
if (GetComponent(url, url_parsed.scheme) !=
GetComponent(redirect_url, redirect_url_parsed.scheme)) {
- return std::string();
+ return "";
}
if (GetComponent(url, url_parsed.host) !=
GetComponent(redirect_url, redirect_url_parsed.host)) {
- return std::string();
+ return "";
}
url_parse::Component query = url_parsed.query;
url_parse::Component key;
@@ -74,7 +74,7 @@ std::string GetOauthCodeInUrl(const std::string& url,
return GetComponent(url, value);
}
}
- return std::string();
+ return "";
}
} // namespace remoting
diff --git a/remoting/host/setup/start_host.cc b/remoting/host/setup/start_host.cc
index 256fb3c..4d8ba75 100644
--- a/remoting/host/setup/start_host.cc
+++ b/remoting/host/setup/start_host.cc
@@ -53,7 +53,7 @@ std::string ReadString(bool no_echo) {
SetEcho(true);
}
if (!result)
- return std::string();
+ return "";
size_t newline_index = str.find('\n');
if (newline_index != std::string::npos)
str[newline_index] = '\0';
diff --git a/remoting/jingle_glue/iq_sender_unittest.cc b/remoting/jingle_glue/iq_sender_unittest.cc
index 2876735..b09f114 100644
--- a/remoting/jingle_glue/iq_sender_unittest.cc
+++ b/remoting/jingle_glue/iq_sender_unittest.cc
@@ -91,9 +91,9 @@ TEST_F(IqSenderTest, SendIq) {
});
scoped_ptr<XmlElement> response(new XmlElement(buzz::QN_IQ));
- response->AddAttr(QName(std::string(), "type"), "result");
- response->AddAttr(QName(std::string(), "id"), kStanzaId);
- response->AddAttr(QName(std::string(), "from"), kTo);
+ response->AddAttr(QName("", "type"), "result");
+ response->AddAttr(QName("", "id"), kStanzaId);
+ response->AddAttr(QName("", "from"), kTo);
XmlElement* result = new XmlElement(
QName("test:namespace", "response-body"));
@@ -123,9 +123,9 @@ TEST_F(IqSenderTest, InvalidFrom) {
});
scoped_ptr<XmlElement> response(new XmlElement(buzz::QN_IQ));
- response->AddAttr(QName(std::string(), "type"), "result");
- response->AddAttr(QName(std::string(), "id"), kStanzaId);
- response->AddAttr(QName(std::string(), "from"), "different_user@domain.com");
+ response->AddAttr(QName("", "type"), "result");
+ response->AddAttr(QName("", "id"), kStanzaId);
+ response->AddAttr(QName("", "from"), "different_user@domain.com");
XmlElement* result = new XmlElement(
QName("test:namespace", "response-body"));
@@ -143,9 +143,9 @@ TEST_F(IqSenderTest, IdMatchingHack) {
});
scoped_ptr<XmlElement> response(new XmlElement(buzz::QN_IQ));
- response->AddAttr(QName(std::string(), "type"), "result");
- response->AddAttr(QName(std::string(), "id"), "DIFFERENT_ID");
- response->AddAttr(QName(std::string(), "from"), kTo);
+ response->AddAttr(QName("", "type"), "result");
+ response->AddAttr(QName("", "id"), "DIFFERENT_ID");
+ response->AddAttr(QName("", "from"), kTo);
XmlElement* result = new XmlElement(
QName("test:namespace", "response-body"));
diff --git a/remoting/jingle_glue/xmpp_signal_strategy.cc b/remoting/jingle_glue/xmpp_signal_strategy.cc
index 88fc9f3..51bbade 100644
--- a/remoting/jingle_glue/xmpp_signal_strategy.cc
+++ b/remoting/jingle_glue/xmpp_signal_strategy.cc
@@ -91,10 +91,9 @@ void XmppSignalStrategy::Connect() {
task_runner_.reset(new jingle_glue::TaskPump());
xmpp_client_ = new buzz::XmppClient(task_runner_.get());
- xmpp_client_->Connect(
- settings, std::string(), socket, CreatePreXmppAuth(settings));
- xmpp_client_->SignalStateChange
- .connect(this, &XmppSignalStrategy::OnConnectionStateChanged);
+ xmpp_client_->Connect(settings, "", socket, CreatePreXmppAuth(settings));
+ xmpp_client_->SignalStateChange.connect(
+ this, &XmppSignalStrategy::OnConnectionStateChanged);
xmpp_client_->engine()->AddStanzaHandler(this, buzz::XmppEngine::HL_TYPE);
xmpp_client_->Start();
@@ -157,7 +156,7 @@ std::string XmppSignalStrategy::GetNextId() {
if (!xmpp_client_) {
// If the connection has been terminated then it doesn't matter
// what Id we return.
- return std::string();
+ return "";
}
return xmpp_client_->NextId();
}
diff --git a/remoting/protocol/jingle_messages.cc b/remoting/protocol/jingle_messages.cc
index e2408e0..7d82443 100644
--- a/remoting/protocol/jingle_messages.cc
+++ b/remoting/protocol/jingle_messages.cc
@@ -124,9 +124,10 @@ JingleMessage::NamedCandidate::NamedCandidate(
// static
bool JingleMessage::IsJingleMessage(const buzz::XmlElement* stanza) {
- return stanza->Name() == QName(kJabberNamespace, "iq") &&
- stanza->Attr(QName(std::string(), "type")) == "set" &&
- stanza->FirstNamed(QName(kJingleNamespace, "jingle")) != NULL;
+ return
+ stanza->Name() == QName(kJabberNamespace, "iq") &&
+ stanza->Attr(QName("", "type")) == "set" &&
+ stanza->FirstNamed(QName(kJingleNamespace, "jingle")) != NULL;
}
// static
@@ -372,7 +373,7 @@ scoped_ptr<buzz::XmlElement> JingleMessageReply::ToXml(
std::string type;
std::string error_text;
- QName name;
+ QName name("");
switch (error_type) {
case BAD_REQUEST:
type = "modify";
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index 72985c2..c6a4f22 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -323,8 +323,7 @@ void JingleSession::OnMessageResponse(
CloseInternal(SIGNALING_TIMEOUT);
return;
} else {
- const std::string& type =
- response->Attr(buzz::QName(std::string(), "type"));
+ const std::string& type = response->Attr(buzz::QName("", "type"));
if (type != "result") {
LOG(ERROR) << "Received error in response to " << type_str
<< " message: \"" << response->Str()
@@ -384,7 +383,7 @@ void JingleSession::OnTransportInfoResponse(IqRequest* request,
return;
}
- const std::string& type = response->Attr(buzz::QName(std::string(), "type"));
+ const std::string& type = response->Attr(buzz::QName("", "type"));
if (type != "result") {
LOG(ERROR) << "Received error in response to transport-info message: \""
<< response->Str() << "\". Terminating the session.";
diff --git a/remoting/protocol/jingle_session_unittest.cc b/remoting/protocol/jingle_session_unittest.cc
index 76aee23..433356b 100644
--- a/remoting/protocol/jingle_session_unittest.cc
+++ b/remoting/protocol/jingle_session_unittest.cc
@@ -323,7 +323,7 @@ TEST_F(JingleSessionTest, Connect) {
initiate_xml->FirstNamed(buzz::QName(kJingleNamespace, "jingle"));
ASSERT_TRUE(jingle_element);
ASSERT_EQ(kClientJid,
- jingle_element->Attr(buzz::QName(std::string(), "initiator")));
+ jingle_element->Attr(buzz::QName("", "initiator")));
}
// Verify that we can connect two endpoints with multi-step authentication.
diff --git a/remoting/protocol/libjingle_transport_factory.cc b/remoting/protocol/libjingle_transport_factory.cc
index 7a09d09..e27b619 100644
--- a/remoting/protocol/libjingle_transport_factory.cc
+++ b/remoting/protocol/libjingle_transport_factory.cc
@@ -139,7 +139,7 @@ void LibjingleStreamTransport::Connect(
// Create P2PTransportChannel, attach signal handlers and connect it.
// TODO(sergeyu): Specify correct component ID for the channel.
channel_.reset(new cricket::P2PTransportChannel(
- std::string(), 0, NULL, port_allocator_));
+ "", 0, NULL, port_allocator_));
channel_->SetIceCredentials(ice_username_fragment_, ice_password_);
channel_->SignalRequestSignaling.connect(
this, &LibjingleStreamTransport::OnRequestSignaling);
diff --git a/remoting/protocol/third_party_authenticator_unittest.cc b/remoting/protocol/third_party_authenticator_unittest.cc
index 0298877..b787a62 100644
--- a/remoting/protocol/third_party_authenticator_unittest.cc
+++ b/remoting/protocol/third_party_authenticator_unittest.cc
@@ -153,8 +153,7 @@ TEST_F(ThirdPartyAuthenticatorTest, ClientNoSecret) {
ASSERT_NO_FATAL_FAILURE(InitAuthenticators());
ASSERT_NO_FATAL_FAILURE(RunHostInitiatedAuthExchange());
ASSERT_EQ(Authenticator::PROCESSING_MESSAGE, client_->state());
- ASSERT_NO_FATAL_FAILURE(
- token_fetcher_->OnTokenFetched(kToken, std::string()));
+ ASSERT_NO_FATAL_FAILURE(token_fetcher_->OnTokenFetched(kToken, ""));
// The end result is that the client rejected the connection, since it
// couldn't fetch the secret.
@@ -168,7 +167,7 @@ TEST_F(ThirdPartyAuthenticatorTest, InvalidToken) {
ASSERT_NO_FATAL_FAILURE(token_fetcher_->OnTokenFetched(
kToken, kSharedSecret));
ASSERT_EQ(Authenticator::PROCESSING_MESSAGE, host_->state());
- ASSERT_NO_FATAL_FAILURE(token_validator_->OnTokenValidated(std::string()));
+ ASSERT_NO_FATAL_FAILURE(token_validator_->OnTokenValidated(""));
// The end result is that the host rejected the token.
ASSERT_EQ(Authenticator::REJECTED, host_->state());
@@ -178,8 +177,7 @@ TEST_F(ThirdPartyAuthenticatorTest, CannotFetchToken) {
ASSERT_NO_FATAL_FAILURE(InitAuthenticators());
ASSERT_NO_FATAL_FAILURE(RunHostInitiatedAuthExchange());
ASSERT_EQ(Authenticator::PROCESSING_MESSAGE, client_->state());
- ASSERT_NO_FATAL_FAILURE(
- token_fetcher_->OnTokenFetched(std::string(), std::string()));
+ ASSERT_NO_FATAL_FAILURE(token_fetcher_->OnTokenFetched("", ""));
// The end result is that the client rejected the connection, since it
// couldn't fetch the token.
diff --git a/remoting/protocol/transport.cc b/remoting/protocol/transport.cc
index 13ed29f..4ccbcde 100644
--- a/remoting/protocol/transport.cc
+++ b/remoting/protocol/transport.cc
@@ -20,7 +20,7 @@ std::string TransportRoute::GetTypeString(RouteType type) {
return "relay";
}
NOTREACHED();
- return std::string();
+ return "";
}
TransportRoute::TransportRoute() : type(DIRECT) {
diff --git a/sandbox/linux/tests/unit_tests.cc b/sandbox/linux/tests/unit_tests.cc
index 5d6cf30..63fbb2b 100644
--- a/sandbox/linux/tests/unit_tests.cc
+++ b/sandbox/linux/tests/unit_tests.cc
@@ -16,7 +16,7 @@
namespace {
std::string TestFailedMessage(const std::string& msg) {
- return msg.empty() ? std::string() : "Actual test failure: " + msg;
+ return msg.empty() ? "" : "Actual test failure: " + msg;
}
int GetSubProcessTimeoutTimeInSeconds() {
diff --git a/sql/statement.cc b/sql/statement.cc
index fe0accb..d92be01 100644
--- a/sql/statement.cc
+++ b/sql/statement.cc
@@ -210,7 +210,7 @@ double Statement::ColumnDouble(int col) const {
std::string Statement::ColumnString(int col) const {
if (!CheckValid())
- return std::string();
+ return "";
const char* str = reinterpret_cast<const char*>(
sqlite3_column_text(ref_->stmt(), col));
diff --git a/sync/api/sync_data.cc b/sync/api/sync_data.cc
index e0b6f1a..b9e2ca9 100644
--- a/sync/api/sync_data.cc
+++ b/sync/api/sync_data.cc
@@ -59,7 +59,7 @@ SyncData SyncData::CreateLocalDelete(
ModelType datatype) {
sync_pb::EntitySpecifics specifics;
AddDefaultFieldValue(datatype, &specifics);
- return CreateLocalData(sync_tag, std::string(), specifics);
+ return CreateLocalData(sync_tag, "", specifics);
}
// Static.
diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc
index 2dcc4b7..5ee9e47 100644
--- a/sync/engine/syncer_unittest.cc
+++ b/sync/engine/syncer_unittest.cc
@@ -1641,15 +1641,15 @@ TEST_F(SyncerTest, TestCommitListOrderingAndNewParentAndChild) {
TEST_F(SyncerTest, UpdateWithZeroLengthName) {
// One illegal update
- mock_server_->AddUpdateDirectory(
- 1, 0, std::string(), 1, 10, foreign_cache_guid(), "-1");
+ mock_server_->AddUpdateDirectory(1, 0, "", 1, 10,
+ foreign_cache_guid(), "-1");
// And one legal one that we're going to delete.
mock_server_->AddUpdateDirectory(2, 0, "FOO", 1, 10,
foreign_cache_guid(), "-2");
SyncShareNudge();
// Delete the legal one. The new update has a null name.
- mock_server_->AddUpdateDirectory(
- 2, 0, std::string(), 2, 20, foreign_cache_guid(), "-2");
+ mock_server_->AddUpdateDirectory(2, 0, "", 2, 20,
+ foreign_cache_guid(), "-2");
mock_server_->SetLastUpdateDeleted();
SyncShareNudge();
}
@@ -4044,11 +4044,9 @@ TEST_F(SyncerTest, UniqueServerTagUpdates) {
}
// Now download some tagged items as updates.
- mock_server_->AddUpdateDirectory(
- 1, 0, "update1", 1, 10, std::string(), std::string());
+ mock_server_->AddUpdateDirectory(1, 0, "update1", 1, 10, "", "");
mock_server_->SetLastUpdateServerTag("alpha");
- mock_server_->AddUpdateDirectory(
- 2, 0, "update2", 2, 20, std::string(), std::string());
+ mock_server_->AddUpdateDirectory(2, 0, "update2", 2, 20, "", "");
mock_server_->SetLastUpdateServerTag("bob");
SyncShareNudge();
@@ -4254,7 +4252,7 @@ TEST_F(SyncerTest, GetKeyEmpty) {
EXPECT_TRUE(directory()->GetNigoriHandler()->NeedKeystoreKey(&rtrans));
}
- mock_server_->SetKeystoreKey(std::string());
+ mock_server_->SetKeystoreKey("");
SyncShareConfigure();
EXPECT_NE(session_->status_controller().last_get_key_result(), SYNCER_OK);
diff --git a/sync/engine/syncer_util.cc b/sync/engine/syncer_util.cc
index d1bde98..c571b10 100644
--- a/sync/engine/syncer_util.cc
+++ b/sync/engine/syncer_util.cc
@@ -633,7 +633,7 @@ VerifyResult VerifyUndelete(syncable::WriteTransaction* trans,
DCHECK(target->Get(UNIQUE_CLIENT_TAG).empty())
<< "Doing move-aside undeletion on client-tagged item.";
target->Put(ID, trans->directory()->NextId());
- target->Put(UNIQUE_CLIENT_TAG, std::string());
+ target->Put(UNIQUE_CLIENT_TAG, "");
target->Put(BASE_VERSION, CHANGES_VERSION);
target->Put(SERVER_VERSION, 0);
return VERIFY_SUCCESS;
diff --git a/sync/internal_api/public/base/model_type_invalidation_map_unittest.cc b/sync/internal_api/public/base/model_type_invalidation_map_unittest.cc
index 772ee7e..f051479 100644
--- a/sync/internal_api/public/base/model_type_invalidation_map_unittest.cc
+++ b/sync/internal_api/public/base/model_type_invalidation_map_unittest.cc
@@ -35,7 +35,7 @@ TEST_F(ModelTypeInvalidationMapTest, TypeInvalidationMapToValue) {
scoped_ptr<DictionaryValue> value(ModelTypeInvalidationMapToValue(states));
EXPECT_EQ(2u, value->size());
ExpectDictStringValue(states[BOOKMARKS].payload, *value, "Bookmarks");
- ExpectDictStringValue(std::string(), *value, "Apps");
+ ExpectDictStringValue("", *value, "Apps");
EXPECT_FALSE(value->HasKey("Preferences"));
}
diff --git a/sync/internal_api/public/base/ordinal_unittest.cc b/sync/internal_api/public/base/ordinal_unittest.cc
index 8c77d6d..20a6d19 100644
--- a/sync/internal_api/public/base/ordinal_unittest.cc
+++ b/sync/internal_api/public/base/ordinal_unittest.cc
@@ -87,7 +87,7 @@ COMPILE_ASSERT(LargeOrdinal::kRadix == 256,
// IsValid() should return false for all of them.
TEST(Ordinal, Invalid) {
// Length criterion.
- EXPECT_FALSE(TestOrdinal(std::string()).IsValid());
+ EXPECT_FALSE(TestOrdinal("").IsValid());
EXPECT_FALSE(LongOrdinal("0001").IsValid());
const char kBeforeZero[] = { '0' - 1, '\0' };
diff --git a/sync/internal_api/public/base/unique_position.cc b/sync/internal_api/public/base/unique_position.cc
index b6c18ef..a47d42b 100644
--- a/sync/internal_api/public/base/unique_position.cc
+++ b/sync/internal_api/public/base/unique_position.cc
@@ -61,7 +61,7 @@ UniquePosition UniquePosition::FromInt64(
UniquePosition UniquePosition::InitialPosition(
const std::string& suffix) {
DCHECK(IsValidSuffix(suffix));
- return UniquePosition(std::string(), suffix);
+ return UniquePosition("", suffix);
}
// static.
@@ -175,7 +175,7 @@ std::string UniquePosition::FindSmallerWithSuffix(
if (suffix_zeroes > ref_zeroes) {
// Implies suffix < ref.
- return std::string();
+ return "";
}
if (suffix.substr(suffix_zeroes) < reference.substr(ref_zeroes)) {
@@ -210,7 +210,7 @@ std::string UniquePosition::FindGreaterWithSuffix(
if (suffix_FFs > ref_FFs) {
// Implies suffix > reference.
- return std::string();
+ return "";
}
if (suffix.substr(suffix_FFs) > reference.substr(ref_FFs)) {
@@ -244,7 +244,7 @@ std::string UniquePosition::FindBetweenWithSuffix(
// Sometimes our suffix puts us where we want to be.
if (before < suffix && suffix < after) {
- return std::string();
+ return "";
}
size_t i = 0;
diff --git a/sync/internal_api/sync_encryption_handler_impl.cc b/sync/internal_api/sync_encryption_handler_impl.cc
index 655feb2..1a645bf 100644
--- a/sync/internal_api/sync_encryption_handler_impl.cc
+++ b/sync/internal_api/sync_encryption_handler_impl.cc
@@ -136,7 +136,7 @@ std::string PackKeystoreBootstrapToken(
const std::string& current_keystore_key,
Encryptor* encryptor) {
if (current_keystore_key.empty())
- return std::string();
+ return "";
base::ListValue keystore_key_values;
for (size_t i = 0; i < old_keystore_keys.size(); ++i)
@@ -1112,7 +1112,7 @@ void SyncEncryptionHandlerImpl::SetCustomPassphrase(
if (passphrase_type_ != KEYSTORE_PASSPHRASE) {
DVLOG(1) << "Failing to set a custom passphrase because one has already "
<< "been set.";
- FinishSetPassphrase(false, std::string(), trans, nigori_node);
+ FinishSetPassphrase(false, "", trans, nigori_node);
return;
}
@@ -1125,7 +1125,7 @@ void SyncEncryptionHandlerImpl::SetCustomPassphrase(
// if statement above. For the sake of safety though, we check for it in
// case a client is misbehaving.
LOG(ERROR) << "Failing to set custom passphrase because of pending keys.";
- FinishSetPassphrase(false, std::string(), trans, nigori_node);
+ FinishSetPassphrase(false, "", trans, nigori_node);
return;
}
diff --git a/sync/internal_api/sync_encryption_handler_impl_unittest.cc b/sync/internal_api/sync_encryption_handler_impl_unittest.cc
index 919a65d..8abbd7e 100644
--- a/sync/internal_api/sync_encryption_handler_impl_unittest.cc
+++ b/sync/internal_api/sync_encryption_handler_impl_unittest.cc
@@ -91,8 +91,7 @@ class SyncEncryptionHandlerImplTest : public ::testing::Test {
encryption_handler_.reset(
new SyncEncryptionHandlerImpl(user_share(),
&encryptor_,
- std::string(),
- std::string() /* bootstrap tokens */));
+ "", "" /* bootstrap tokens */));
encryption_handler_->AddObserver(&observer_);
}
@@ -348,8 +347,7 @@ TEST_F(SyncEncryptionHandlerImplTest, NigoriEncryptionTypes) {
StrictMock<SyncEncryptionHandlerObserverMock> observer2;
SyncEncryptionHandlerImpl handler2(user_share(),
&encryptor_,
- std::string(),
- std::string() /* bootstrap tokens */);
+ "", "" /* bootstrap tokens */);
handler2.AddObserver(&observer2);
// Just set the sensitive types (shouldn't trigger any notifications).
@@ -613,8 +611,9 @@ TEST_F(SyncEncryptionHandlerImplTest, SetKeystoreMigratesAndUpdatesBootstrap) {
WriteTransaction trans(FROM_HERE, user_share());
EXPECT_FALSE(GetCryptographer()->is_initialized());
EXPECT_TRUE(encryption_handler()->NeedKeystoreKey(trans.GetWrappedTrans()));
- EXPECT_FALSE(encryption_handler()->SetKeystoreKeys(
- BuildEncryptionKeyProto(std::string()), trans.GetWrappedTrans()));
+ EXPECT_FALSE(
+ encryption_handler()->SetKeystoreKeys(BuildEncryptionKeyProto(""),
+ trans.GetWrappedTrans()));
EXPECT_TRUE(encryption_handler()->NeedKeystoreKey(trans.GetWrappedTrans()));
}
Mock::VerifyAndClearExpectations(observer());
@@ -680,7 +679,7 @@ TEST_F(SyncEncryptionHandlerImplTest, SetKeystoreMigratesAndUpdatesBootstrap) {
// token.
SyncEncryptionHandlerImpl handler2(user_share(),
&encryptor_,
- std::string(), // Cryptographer bootstrap.
+ "", // Cryptographer bootstrap.
keystore_bootstrap);
{
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 7413b71..97d03ba 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -1289,7 +1289,7 @@ void SyncManagerImpl::OnIncomingInvalidation(
void SyncManagerImpl::RefreshTypes(ModelTypeSet types) {
DCHECK(thread_checker_.CalledOnValidThread());
const ModelTypeInvalidationMap& type_invalidation_map =
- ModelTypeSetToInvalidationMap(types, std::string());
+ ModelTypeSetToInvalidationMap(types, "");
if (type_invalidation_map.empty()) {
LOG(WARNING) << "Sync received refresh request with no types specified.";
} else {
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc
index 7f96f49..9a6ddee 100644
--- a/sync/internal_api/sync_manager_impl_unittest.cc
+++ b/sync/internal_api/sync_manager_impl_unittest.cc
@@ -723,7 +723,7 @@ class TestHttpPostProviderInterface : public HttpPostProviderInterface {
}
virtual const std::string GetResponseHeaderValue(
const std::string& name) const OVERRIDE {
- return std::string();
+ return "";
}
virtual void Abort() OVERRIDE {}
};
@@ -820,25 +820,20 @@ class SyncManagerTest : public testing::Test,
GetModelSafeRoutingInfo(&routing_info);
// Takes ownership of |fake_invalidator_|.
- sync_manager_.Init(
- temp_dir_.path(),
- WeakHandle<JsEventHandler>(),
- "bogus",
- 0,
- false,
- scoped_ptr<HttpPostProviderFactory>(new TestHttpPostProviderFactory()),
- workers,
- &extensions_activity_monitor_,
- this,
- credentials,
- scoped_ptr<Invalidator>(fake_invalidator_),
- "fake_invalidator_client_id",
- std::string(),
- std::string(), // bootstrap tokens
- scoped_ptr<InternalComponentsFactory>(GetFactory()),
- &encryptor_,
- &handler_,
- NULL);
+ sync_manager_.Init(temp_dir_.path(),
+ WeakHandle<JsEventHandler>(),
+ "bogus", 0, false,
+ scoped_ptr<HttpPostProviderFactory>(
+ new TestHttpPostProviderFactory()),
+ workers, &extensions_activity_monitor_, this,
+ credentials,
+ scoped_ptr<Invalidator>(fake_invalidator_),
+ "fake_invalidator_client_id",
+ "", "", // bootstrap tokens
+ scoped_ptr<InternalComponentsFactory>(GetFactory()),
+ &encryptor_,
+ &handler_,
+ NULL);
sync_manager_.GetEncryptionHandler()->AddObserver(&encryption_observer_);
@@ -1186,9 +1181,9 @@ class SyncManagerGetNodesByIdTest : public SyncManagerTest {
base::ListValue args;
base::ListValue* ids = new base::ListValue();
args.Append(ids);
- ids->Append(new base::StringValue(std::string()));
- SendJsMessage(
- message_name, JsArgList(&args), reply_handler.AsWeakHandle());
+ ids->Append(new base::StringValue(""));
+ SendJsMessage(message_name,
+ JsArgList(&args), reply_handler.AsWeakHandle());
}
{
@@ -1278,9 +1273,9 @@ TEST_F(SyncManagerTest, GetChildNodeIdsFailure) {
{
base::ListValue args;
- args.Append(new base::StringValue(std::string()));
- SendJsMessage(
- "getChildNodeIds", JsArgList(&args), reply_handler.AsWeakHandle());
+ args.Append(new base::StringValue(""));
+ SendJsMessage("getChildNodeIds",
+ JsArgList(&args), reply_handler.AsWeakHandle());
}
{
diff --git a/sync/internal_api/syncapi_server_connection_manager_unittest.cc b/sync/internal_api/syncapi_server_connection_manager_unittest.cc
index a0fe420..f90c5e8 100644
--- a/sync/internal_api/syncapi_server_connection_manager_unittest.cc
+++ b/sync/internal_api/syncapi_server_connection_manager_unittest.cc
@@ -45,7 +45,7 @@ class BlockingHttpPost : public HttpPostProviderInterface {
}
virtual const std::string GetResponseHeaderValue(
const std::string& name) const OVERRIDE {
- return std::string();
+ return "";
}
virtual void Abort() OVERRIDE {
wait_for_abort_.Signal();
diff --git a/sync/notifier/p2p_invalidator.cc b/sync/notifier/p2p_invalidator.cc
index 7825757..dd9a34d 100644
--- a/sync/notifier/p2p_invalidator.cc
+++ b/sync/notifier/p2p_invalidator.cc
@@ -40,7 +40,7 @@ std::string P2PNotificationTargetToString(P2PNotificationTarget target) {
return kNotifyAll;
default:
NOTREACHED();
- return std::string();
+ return "";
}
}
@@ -171,9 +171,8 @@ void P2PInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
ObjectIdLessThan());
registrar_.UpdateRegisteredIds(handler, ids);
const P2PNotificationData notification_data(
- invalidator_client_id_,
- NOTIFY_SELF,
- ObjectIdSetToInvalidationMap(new_ids, std::string()));
+ invalidator_client_id_, NOTIFY_SELF,
+ ObjectIdSetToInvalidationMap(new_ids, ""));
SendNotificationData(notification_data);
}
@@ -225,10 +224,8 @@ void P2PInvalidator::OnNotificationsEnabled() {
registrar_.UpdateInvalidatorState(INVALIDATIONS_ENABLED);
if (just_turned_on) {
const P2PNotificationData notification_data(
- invalidator_client_id_,
- NOTIFY_SELF,
- ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(),
- std::string()));
+ invalidator_client_id_, NOTIFY_SELF,
+ ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), ""));
SendNotificationData(notification_data);
}
}
@@ -259,11 +256,10 @@ void P2PInvalidator::OnIncomingNotification(
if (!notification_data.ResetFromString(notification.data)) {
LOG(WARNING) << "Could not parse notification data from "
<< notification.data;
- notification_data = P2PNotificationData(
- invalidator_client_id_,
- NOTIFY_ALL,
- ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(),
- std::string()));
+ notification_data =
+ P2PNotificationData(
+ invalidator_client_id_, NOTIFY_ALL,
+ ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), ""));
}
if (!notification_data.IsTargeted(invalidator_client_id_)) {
DVLOG(1) << "Not a target of the notification -- "
diff --git a/sync/notifier/p2p_invalidator_unittest.cc b/sync/notifier/p2p_invalidator_unittest.cc
index 6acc3d1..1b7aad4 100644
--- a/sync/notifier/p2p_invalidator_unittest.cc
+++ b/sync/notifier/p2p_invalidator_unittest.cc
@@ -69,7 +69,7 @@ class P2PInvalidatorTestDelegate {
void TriggerOnIncomingInvalidation(
const ObjectIdInvalidationMap& invalidation_map) {
const P2PNotificationData notification_data(
- std::string(), NOTIFY_ALL, invalidation_map);
+ "", NOTIFY_ALL, invalidation_map);
notifier::Notification notification;
notification.channel = kSyncP2PNotificationChannel;
notification.data = notification_data.ToString();
@@ -160,7 +160,7 @@ TEST_F(P2PInvalidatorTest, P2PNotificationDataIsTargeted) {
// default-constructed P2PNotificationData.
TEST_F(P2PInvalidatorTest, P2PNotificationDataDefault) {
const P2PNotificationData notification_data;
- EXPECT_TRUE(notification_data.IsTargeted(std::string()));
+ EXPECT_TRUE(notification_data.IsTargeted(""));
EXPECT_FALSE(notification_data.IsTargeted("other1"));
EXPECT_FALSE(notification_data.IsTargeted("other2"));
EXPECT_TRUE(notification_data.GetIdInvalidationMap().empty());
@@ -179,8 +179,7 @@ TEST_F(P2PInvalidatorTest, P2PNotificationDataDefault) {
TEST_F(P2PInvalidatorTest, P2PNotificationDataNonDefault) {
const ObjectIdInvalidationMap& invalidation_map =
ObjectIdSetToInvalidationMap(
- ModelTypeSetToObjectIdSet(ModelTypeSet(BOOKMARKS, THEMES)),
- std::string());
+ ModelTypeSetToObjectIdSet(ModelTypeSet(BOOKMARKS, THEMES)), "");
const P2PNotificationData notification_data(
"sender", NOTIFY_ALL, invalidation_map);
EXPECT_TRUE(notification_data.IsTargeted("sender"));
@@ -248,8 +247,7 @@ TEST_F(P2PInvalidatorTest, NotificationsBasic) {
{
const ObjectIdInvalidationMap& invalidation_map =
ObjectIdSetToInvalidationMap(
- ModelTypeSetToObjectIdSet(ModelTypeSet(THEMES, APPS)),
- std::string());
+ ModelTypeSetToObjectIdSet(ModelTypeSet(THEMES, APPS)), "");
invalidator->SendInvalidation(invalidation_map);
}
@@ -266,8 +264,8 @@ TEST_F(P2PInvalidatorTest, SendNotificationData) {
const ModelTypeSet expected_types(THEMES);
const ObjectIdInvalidationMap& invalidation_map =
- ObjectIdSetToInvalidationMap(ModelTypeSetToObjectIdSet(changed_types),
- std::string());
+ ObjectIdSetToInvalidationMap(
+ ModelTypeSetToObjectIdSet(changed_types), "");
P2PInvalidator* const invalidator = delegate_.GetInvalidator();
notifier::FakePushClient* const push_client = delegate_.GetPushClient();
diff --git a/sync/notifier/push_client_channel_unittest.cc b/sync/notifier/push_client_channel_unittest.cc
index d017e1b..ffe90e7 100644
--- a/sync/notifier/push_client_channel_unittest.cc
+++ b/sync/notifier/push_client_channel_unittest.cc
@@ -73,7 +73,7 @@ TEST_F(PushClientChannelTest, EncodeDecode) {
TEST_F(PushClientChannelTest, EncodeDecodeNoContext) {
const notifier::Notification& notification =
PushClientChannel::EncodeMessageForTest(
- kMessage, std::string(), kSchedulingHash);
+ kMessage, "", kSchedulingHash);
std::string message;
std::string service_context = kServiceContext;
int64 scheduling_hash = kSchedulingHash + 1;
diff --git a/sync/notifier/sync_invalidation_listener_unittest.cc b/sync/notifier/sync_invalidation_listener_unittest.cc
index dba4728..8177327 100644
--- a/sync/notifier/sync_invalidation_listener_unittest.cc
+++ b/sync/notifier/sync_invalidation_listener_unittest.cc
@@ -148,7 +148,7 @@ class FakeDelegate : public SyncInvalidationListener::Delegate {
std::string GetPayload(const ObjectId& id) const {
ObjectIdInvalidationMap::const_iterator it = invalidations_.find(id);
- return (it == invalidations_.end()) ? std::string() : it->second.payload;
+ return (it == invalidations_.end()) ? "" : it->second.payload;
}
InvalidatorState GetInvalidatorState() const {
diff --git a/sync/notifier/sync_system_resources.cc b/sync/notifier/sync_system_resources.cc
index 3fc31fc..5328657 100644
--- a/sync/notifier/sync_system_resources.cc
+++ b/sync/notifier/sync_system_resources.cc
@@ -181,15 +181,14 @@ void SyncStorage::SetSystemResources(
void SyncStorage::RunAndDeleteWriteKeyCallback(
invalidation::WriteKeyCallback* callback) {
- callback->Run(
- invalidation::Status(invalidation::Status::SUCCESS, std::string()));
+ callback->Run(invalidation::Status(invalidation::Status::SUCCESS, ""));
delete callback;
}
void SyncStorage::RunAndDeleteReadKeyCallback(
invalidation::ReadKeyCallback* callback, const std::string& value) {
callback->Run(std::make_pair(
- invalidation::Status(invalidation::Status::SUCCESS, std::string()),
+ invalidation::Status(invalidation::Status::SUCCESS, ""),
value));
delete callback;
}
diff --git a/sync/notifier/sync_system_resources_unittest.cc b/sync/notifier/sync_system_resources_unittest.cc
index cb406da..77423b3 100644
--- a/sync/notifier/sync_system_resources_unittest.cc
+++ b/sync/notifier/sync_system_resources_unittest.cc
@@ -168,10 +168,9 @@ TEST_F(SyncSystemResourcesTest, WriteState) {
EXPECT_CALL(mock_storage_callback, Run(_))
.WillOnce(SaveArg<0>(&results));
sync_system_resources_.storage()->WriteKey(
- std::string(), "state", mock_storage_callback.CreateCallback());
+ "", "state", mock_storage_callback.CreateCallback());
message_loop_.RunUntilIdle();
- EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, std::string()),
- results);
+ EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, ""), results);
}
} // namespace
diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc
index 6d11e7f..f0b87be 100644
--- a/sync/syncable/directory_backing_store.cc
+++ b/sync/syncable/directory_backing_store.cc
@@ -1269,7 +1269,7 @@ bool DirectoryBackingStore::CreateTables() {
"?);")); // bag_of_chips
s.BindString(0, dir_name_); // id
s.BindString(1, dir_name_); // name
- s.BindString(2, std::string()); // store_birthday
+ s.BindString(2, ""); // store_birthday
// TODO(akalin): Remove this unused db_create_version field. (Or
// actually use it for something.) http://crbug.com/118356
s.BindString(3, "Unknown"); // db_create_version
diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc
index eb28f37..2657ebc 100644
--- a/sync/syncable/model_type.cc
+++ b/sync/syncable/model_type.cc
@@ -523,7 +523,7 @@ base::StringValue* ModelTypeToValue(ModelType model_type) {
return new base::StringValue("Unspecified");
}
NOTREACHED();
- return new base::StringValue(std::string());
+ return new base::StringValue("");
}
ModelType ModelTypeFromValue(const base::Value& value) {
diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc
index affaeb4..f99ad23 100644
--- a/sync/syncable/syncable_unittest.cc
+++ b/sync/syncable/syncable_unittest.cc
@@ -2253,7 +2253,7 @@ TEST_F(SyncableClientTagTest, TestClientTagClear) {
WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
MutableEntry me(&trans, GET_BY_CLIENT_TAG, test_tag_);
EXPECT_TRUE(me.good());
- me.Put(UNIQUE_CLIENT_TAG, std::string());
+ me.Put(UNIQUE_CLIENT_TAG, "");
}
{
ReadTransaction trans(FROM_HERE, dir_.get());
diff --git a/sync/syncable/syncable_write_transaction.cc b/sync/syncable/syncable_write_transaction.cc
index 5b884e7..788d922 100644
--- a/sync/syncable/syncable_write_transaction.cc
+++ b/sync/syncable/syncable_write_transaction.cc
@@ -175,7 +175,7 @@ std::string WriterTagToString(WriterTag writer_tag) {
ENUM_CASE(SYNCAPI);
};
NOTREACHED();
- return std::string();
+ return "";
}
#undef ENUM_CASE
diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc
index 6ddd866..e5fd452 100644
--- a/sync/test/engine/mock_connection_manager.cc
+++ b/sync/test/engine/mock_connection_manager.cc
@@ -43,6 +43,7 @@ MockConnectionManager::MockConnectionManager(syncable::Directory* directory)
store_birthday_("Store BDay!"),
store_birthday_sent_(false),
client_stuck_(false),
+ commit_time_rename_prepended_string_(""),
countdown_to_postbuffer_fail_(0),
directory_(directory),
mid_commit_observer_(NULL),
diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc
index 0fed51e..61b5e63 100644
--- a/sync/util/cryptographer.cc
+++ b/sync/util/cryptographer.cc
@@ -110,12 +110,12 @@ std::string Cryptographer::DecryptToString(
NigoriMap::const_iterator it = nigoris_.find(encrypted.key_name());
if (nigoris_.end() == it) {
NOTREACHED() << "Cannot decrypt message";
- return std::string(); // Caller should have called CanDecrypt(encrypt).
+ return std::string(""); // Caller should have called CanDecrypt(encrypt).
}
std::string plaintext;
if (!it->second->Decrypt(encrypted.blob(), &plaintext)) {
- return std::string();
+ return std::string("");
}
return plaintext;
@@ -271,18 +271,18 @@ bool Cryptographer::GetBootstrapToken(std::string* token) const {
std::string Cryptographer::UnpackBootstrapToken(
const std::string& token) const {
if (token.empty())
- return std::string();
+ return "";
std::string encrypted_data;
if (!base::Base64Decode(token, &encrypted_data)) {
DLOG(WARNING) << "Could not decode token.";
- return std::string();
+ return "";
}
std::string unencrypted_token;
if (!encryptor_->DecryptString(encrypted_data, &unencrypted_token)) {
DLOG(WARNING) << "Decryption of bootstrap token failed.";
- return std::string();
+ return "";
}
return unencrypted_token;
}
@@ -328,15 +328,15 @@ bool Cryptographer::KeybagIsStale(
std::string Cryptographer::GetDefaultNigoriKey() const {
if (!is_initialized())
- return std::string();
+ return "";
NigoriMap::const_iterator iter = nigoris_.find(default_nigori_name_);
if (iter == nigoris_.end())
- return std::string();
+ return "";
sync_pb::NigoriKey key;
if (!iter->second->ExportKeys(key.mutable_user_key(),
key.mutable_encryption_key(),
key.mutable_mac_key()))
- return std::string();
+ return "";
return key.SerializeAsString();
}
diff --git a/ui/base/gtk/menu_label_accelerator_util.cc b/ui/base/gtk/menu_label_accelerator_util.cc
index 507bf99..f8192c5 100644
--- a/ui/base/gtk/menu_label_accelerator_util.cc
+++ b/ui/base/gtk/menu_label_accelerator_util.cc
@@ -46,7 +46,7 @@ std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label) {
}
std::string RemoveWindowsStyleAccelerators(const std::string& label) {
- return ConvertAmpersandsTo(label, std::string());
+ return ConvertAmpersandsTo(label, "");
}
// Replaces all ampersands in |label| with two ampersands. This effectively
diff --git a/ui/base/l10n/l10n_util_unittest.cc b/ui/base/l10n/l10n_util_unittest.cc
index 1fce2e2..085f2d6 100644
--- a/ui/base/l10n/l10n_util_unittest.cc
+++ b/ui/base/l10n/l10n_util_unittest.cc
@@ -124,59 +124,59 @@ TEST_F(L10nUtilTest, GetAppLocale) {
// Test the support of LANGUAGE environment variable.
base::i18n::SetICUDefaultLocale("en-US");
env->SetVar("LANGUAGE", "xx:fr_CA");
- EXPECT_EQ("fr", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("fr", l10n_util::GetApplicationLocale(""));
env->SetVar("LANGUAGE", "xx:yy:en_gb.utf-8@quot");
- EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(""));
env->SetVar("LANGUAGE", "xx:zh-hk");
- EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(""));
// We emulate gettext's behavior here, which ignores LANG/LC_MESSAGES/LC_ALL
// when LANGUAGE is specified. If no language specified in LANGUAGE is valid,
// then just fallback to the default language, which is en-US for us.
base::i18n::SetICUDefaultLocale("fr-FR");
env->SetVar("LANGUAGE", "xx:yy");
- EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(""));
env->SetVar("LANGUAGE", "/fr:zh_CN");
- EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale(""));
// Test prioritization of the different environment variables.
env->SetVar("LANGUAGE", "fr");
env->SetVar("LC_ALL", "es");
env->SetVar("LC_MESSAGES", "he");
env->SetVar("LANG", "nb");
- EXPECT_EQ("fr", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("fr", l10n_util::GetApplicationLocale(""));
env->UnSetVar("LANGUAGE");
- EXPECT_EQ("es", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("es", l10n_util::GetApplicationLocale(""));
env->UnSetVar("LC_ALL");
- EXPECT_EQ("he", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("he", l10n_util::GetApplicationLocale(""));
env->UnSetVar("LC_MESSAGES");
- EXPECT_EQ("nb", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("nb", l10n_util::GetApplicationLocale(""));
env->UnSetVar("LANG");
SetDefaultLocaleForTest("ca", env.get());
- EXPECT_EQ("ca", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("ca", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("ca-ES", env.get());
- EXPECT_EQ("ca", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("ca", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("ca@valencia", env.get());
- EXPECT_EQ("ca@valencia", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("ca@valencia", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("ca_ES@valencia", env.get());
- EXPECT_EQ("ca@valencia", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("ca@valencia", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("ca_ES.UTF8@valencia", env.get());
- EXPECT_EQ("ca@valencia", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("ca@valencia", l10n_util::GetApplicationLocale(""));
#endif // defined(OS_POSIX) && !defined(OS_CHROMEOS)
SetDefaultLocaleForTest("en-US", env.get());
- EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("xx", env.get());
- EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(""));
#if defined(OS_CHROMEOS)
// ChromeOS honors preferred locale first in GetApplicationLocale(),
@@ -200,43 +200,43 @@ TEST_F(L10nUtilTest, GetAppLocale) {
EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale("en-ZA"));
#else // !defined(OS_CHROMEOS)
SetDefaultLocaleForTest("en-GB", env.get());
- EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("fr-CA", env.get());
- EXPECT_EQ("fr", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("fr", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("es-MX", env.get());
- EXPECT_EQ("es-419", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("es-419", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("es-AR", env.get());
- EXPECT_EQ("es-419", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("es-419", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("es-ES", env.get());
- EXPECT_EQ("es", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("es", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("es", env.get());
- EXPECT_EQ("es", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("es", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("zh-HK", env.get());
- EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("zh-MO", env.get());
- EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("zh-SG", env.get());
- EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("en-CA", env.get());
- EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("en-AU", env.get());
- EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("en-NZ", env.get());
- EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(""));
SetDefaultLocaleForTest("en-ZA", env.get());
- EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(std::string()));
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(""));
#endif // defined(OS_CHROMEOS)
#if defined(OS_WIN)
@@ -437,7 +437,7 @@ TEST_F(L10nUtilTest, IsValidLocaleSyntax) {
"sr_Latn_RS_REVISED@currency=USD"));
// Test invalid locales.
- EXPECT_FALSE(l10n_util::IsValidLocaleSyntax(std::string()));
+ EXPECT_FALSE(l10n_util::IsValidLocaleSyntax(""));
EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("x"));
EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("12"));
EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("456"));
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc
index 0feeb34..2e945ed 100644
--- a/ui/gl/gl_surface.cc
+++ b/ui/gl/gl_surface.cc
@@ -89,7 +89,7 @@ bool GLSurface::DeferDraws() {
}
std::string GLSurface::GetExtensions() {
- return std::string();
+ return std::string("");
}
bool GLSurface::HasExtension(const char* name) {
diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc
index b90e783..86b3df6 100644
--- a/webkit/appcache/appcache_update_job_unittest.cc
+++ b/webkit/appcache/appcache_update_job_unittest.cc
@@ -2649,7 +2649,7 @@ class AppCacheUpdateJobTest : public testing::Test,
// First test against a cache attempt. Will start manifest fetch
// synchronously.
- HttpHeadersRequestTestJob::Initialize(std::string(), std::string());
+ HttpHeadersRequestTestJob::Initialize("", "");
MockFrontend mock_frontend;
AppCacheHost host(1, &mock_frontend, service_.get());
update->StartUpdate(&host, GURL());
@@ -2666,7 +2666,7 @@ class AppCacheUpdateJobTest : public testing::Test,
net::HttpResponseInfo* response_info = new net::HttpResponseInfo();
response_info->headers = headers; // adds ref to headers
- HttpHeadersRequestTestJob::Initialize(std::string(), std::string());
+ HttpHeadersRequestTestJob::Initialize("", "");
update = new AppCacheUpdateJob(service_.get(), group_);
group_->update_job_ = update;
group_->update_status_ = AppCacheGroup::DOWNLOADING;
@@ -2687,8 +2687,7 @@ class AppCacheUpdateJobTest : public testing::Test,
response_info = new net::HttpResponseInfo();
response_info->headers = headers2;
- HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT",
- std::string());
+ HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT", "");
update = new AppCacheUpdateJob(service_.get(), group_);
group_->update_job_ = update;
group_->update_status_ = AppCacheGroup::DOWNLOADING;
@@ -2704,8 +2703,7 @@ class AppCacheUpdateJobTest : public testing::Test,
void IfModifiedSinceUpgradeTest() {
ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type());
- HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT",
- std::string());
+ HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT", "");
net::URLRequestJobFactoryImpl* new_factory(
new net::URLRequestJobFactoryImpl);
new_factory->SetProtocolHandler("http", new IfModifiedSinceJobFactory);
@@ -2767,7 +2765,7 @@ class AppCacheUpdateJobTest : public testing::Test,
void IfNoneMatchUpgradeTest() {
ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type());
- HttpHeadersRequestTestJob::Initialize(std::string(), "\"LadeDade\"");
+ HttpHeadersRequestTestJob::Initialize("", "\"LadeDade\"");
net::URLRequestJobFactoryImpl* new_factory(
new net::URLRequestJobFactoryImpl);
new_factory->SetProtocolHandler("http", new IfModifiedSinceJobFactory);
@@ -2829,7 +2827,7 @@ class AppCacheUpdateJobTest : public testing::Test,
void IfNoneMatchRefetchTest() {
ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type());
- HttpHeadersRequestTestJob::Initialize(std::string(), "\"LadeDade\"");
+ HttpHeadersRequestTestJob::Initialize("", "\"LadeDade\"");
net::URLRequestJobFactoryImpl* new_factory(
new net::URLRequestJobFactoryImpl);
new_factory->SetProtocolHandler("http", new IfModifiedSinceJobFactory);
diff --git a/webkit/fileapi/copy_or_move_file_validator_unittest.cc b/webkit/fileapi/copy_or_move_file_validator_unittest.cc
index 6aafa88..7abc628 100644
--- a/webkit/fileapi/copy_or_move_file_validator_unittest.cc
+++ b/webkit/fileapi/copy_or_move_file_validator_unittest.cc
@@ -58,7 +58,8 @@ class CopyOrMoveFileValidatorTestHelper {
FileSystemMountPointProvider* mount_point_provider =
file_system_context_->GetMountPointProvider(src_type_);
mount_point_provider->GetFileSystemRootPathOnFileThread(
- SourceURL(std::string()), true /* create */);
+ SourceURL(""),
+ true /* create */);
}
DCHECK_EQ(kFileSystemTypeNativeMedia, dest_type_);
base::FilePath dest_path = base_dir.Append(FILE_PATH_LITERAL("dest_media"));
diff --git a/webkit/fileapi/external_mount_points_unittest.cc b/webkit/fileapi/external_mount_points_unittest.cc
index 8c012fa..4b2ce6cb 100644
--- a/webkit/fileapi/external_mount_points_unittest.cc
+++ b/webkit/fileapi/external_mount_points_unittest.cc
@@ -154,7 +154,7 @@ TEST(ExternalMountPointsTest, GetVirtualPath) {
// A mount point with an empty path.
mount_points->RegisterFileSystem("empty_path",
fileapi::kFileSystemTypeNativeLocal,
- base::FilePath(FPL(std::string())));
+ base::FilePath(FPL("")));
struct TestCase {
const base::FilePath::CharType* const local_path;
@@ -271,7 +271,7 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) {
base::FilePath(DRIVE FPL("/a/b/c(1)")));
mount_points->RegisterFileSystem("empty_path",
fileapi::kFileSystemTypeSyncable,
- base::FilePath(FPL(std::string())));
+ base::FilePath(FPL("")));
mount_points->RegisterFileSystem("mount",
fileapi::kFileSystemTypeDrive,
base::FilePath(DRIVE FPL("/root")));
@@ -382,7 +382,7 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) {
base::FilePath(DRIVE FPL("/a/b/c(1)")));
mount_points->RegisterFileSystem("empty_path",
fileapi::kFileSystemTypeSyncable,
- base::FilePath(FPL(std::string())));
+ base::FilePath(FPL("")));
mount_points->RegisterFileSystem("mount",
fileapi::kFileSystemTypeDrive,
base::FilePath(DRIVE FPL("/root")));
diff --git a/webkit/fileapi/file_system_directory_database_unittest.cc b/webkit/fileapi/file_system_directory_database_unittest.cc
index 5a4b889..b612669 100644
--- a/webkit/fileapi/file_system_directory_database_unittest.cc
+++ b/webkit/fileapi/file_system_directory_database_unittest.cc
@@ -569,7 +569,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_OrphanFile) {
TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_RootLoop) {
EXPECT_TRUE(db()->IsFileSystemConsistent());
- MakeHierarchyLink(0, 0, FPL(std::string()));
+ MakeHierarchyLink(0, 0, FPL(""));
EXPECT_FALSE(db()->IsFileSystemConsistent());
}
diff --git a/webkit/fileapi/file_system_origin_database.cc b/webkit/fileapi/file_system_origin_database.cc
index a7405d9..1026418 100644
--- a/webkit/fileapi/file_system_origin_database.cc
+++ b/webkit/fileapi/file_system_origin_database.cc
@@ -265,7 +265,7 @@ bool FileSystemOriginDatabase::ListAllOrigins(
return false;
DCHECK(origins);
scoped_ptr<leveldb::Iterator> iter(db_->NewIterator(leveldb::ReadOptions()));
- std::string origin_key_prefix = OriginToOriginKey(std::string());
+ std::string origin_key_prefix = OriginToOriginKey("");
iter->Seek(origin_key_prefix);
origins->clear();
while (iter->Valid() &&
diff --git a/webkit/fileapi/file_system_util_unittest.cc b/webkit/fileapi/file_system_util_unittest.cc
index 1c129bd..7c946cc 100644
--- a/webkit/fileapi/file_system_util_unittest.cc
+++ b/webkit/fileapi/file_system_util_unittest.cc
@@ -115,7 +115,7 @@ TEST_F(FileSystemUtilTest, GetNormalizedFilePath) {
TEST_F(FileSystemUtilTest, IsAbsolutePath) {
EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/")));
EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/foo/bar")));
- EXPECT_FALSE(VirtualPath::IsAbsolute(base::FilePath::StringType()));
+ EXPECT_FALSE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("")));
EXPECT_FALSE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("foo/bar")));
}
diff --git a/webkit/fileapi/local_file_stream_writer_unittest.cc b/webkit/fileapi/local_file_stream_writer_unittest.cc
index 41c547e..d67a7da 100644
--- a/webkit/fileapi/local_file_stream_writer_unittest.cc
+++ b/webkit/fileapi/local_file_stream_writer_unittest.cc
@@ -77,7 +77,7 @@ void NeverCalled(int unused) {
} // namespace
TEST_F(LocalFileStreamWriterTest, Write) {
- base::FilePath path = CreateFileWithContent("file_a", std::string());
+ base::FilePath path = CreateFileWithContent("file_a", "");
scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 0));
EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "foo"));
EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "bar"));
@@ -126,7 +126,7 @@ TEST_F(LocalFileStreamWriterTest, CancelBeforeOperation) {
}
TEST_F(LocalFileStreamWriterTest, CancelAfterFinishedOperation) {
- base::FilePath path = CreateFileWithContent("file_a", std::string());
+ base::FilePath path = CreateFileWithContent("file_a", "");
scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 0));
EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "foo"));
diff --git a/webkit/fileapi/local_file_system_cross_operation_unittest.cc b/webkit/fileapi/local_file_system_cross_operation_unittest.cc
index 5466069..2929b93 100644
--- a/webkit/fileapi/local_file_system_cross_operation_unittest.cc
+++ b/webkit/fileapi/local_file_system_cross_operation_unittest.cc
@@ -71,11 +71,13 @@ class CrossOperationTestHelper {
FileSystemMountPointProvider* mount_point_provider =
file_system_context_->GetMountPointProvider(src_type_);
mount_point_provider->GetFileSystemRootPathOnFileThread(
- SourceURL(std::string()), true /* create */);
+ SourceURL(""),
+ true /* create */);
mount_point_provider =
file_system_context_->GetMountPointProvider(dest_type_);
mount_point_provider->GetFileSystemRootPathOnFileThread(
- DestURL(std::string()), true /* create */);
+ DestURL(""),
+ true /* create */);
// Grant relatively big quota initially.
quota_manager_->SetQuota(origin_,
diff --git a/webkit/fileapi/obfuscated_file_util_unittest.cc b/webkit/fileapi/obfuscated_file_util_unittest.cc
index 6a6d4a6..387f28e 100644
--- a/webkit/fileapi/obfuscated_file_util_unittest.cc
+++ b/webkit/fileapi/obfuscated_file_util_unittest.cc
@@ -941,7 +941,7 @@ TEST_F(ObfuscatedFileUtilTest, TestDirectoryOps) {
EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND,
ofu()->DeleteDirectory(context.get(), url));
- FileSystemURL root = CreateURLFromUTF8(std::string());
+ FileSystemURL root = CreateURLFromUTF8("");
EXPECT_FALSE(DirectoryExists(url));
EXPECT_FALSE(PathExists(url));
context.reset(NewContext(NULL));
@@ -1081,7 +1081,7 @@ TEST_F(ObfuscatedFileUtilTest, TestReadDirectory) {
}
TEST_F(ObfuscatedFileUtilTest, TestReadRootWithSlash) {
- TestReadDirectoryHelper(CreateURLFromUTF8(std::string()));
+ TestReadDirectoryHelper(CreateURLFromUTF8(""));
}
TEST_F(ObfuscatedFileUtilTest, TestReadRootWithEmptyString) {
diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.cc b/webkit/fileapi/syncable/canned_syncable_file_system.cc
index f323a1a..954d6a5 100644
--- a/webkit/fileapi/syncable/canned_syncable_file_system.cc
+++ b/webkit/fileapi/syncable/canned_syncable_file_system.cc
@@ -445,8 +445,7 @@ void CannedSyncableFileSystem::ClearChangeForURLInTracker(
}
FileSystemOperation* CannedSyncableFileSystem::NewOperation() {
- return file_system_context_->CreateFileSystemOperation(URL(std::string()),
- NULL);
+ return file_system_context_->CreateFileSystemOperation(URL(""), NULL);
}
void CannedSyncableFileSystem::OnSyncEnabled(const FileSystemURL& url) {
diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc
index 302c81e..3cbe45c 100644
--- a/webkit/glue/webclipboard_impl.cc
+++ b/webkit/glue/webclipboard_impl.cc
@@ -201,7 +201,7 @@ void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title) {
ScopedClipboardWriterGlue scw(client_);
scw.WriteBookmark(title, url.spec());
- scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), std::string());
+ scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), "");
scw.WriteText(UTF8ToUTF16(std::string(url.spec())));
}
@@ -225,7 +225,7 @@ void WebClipboardImpl::writeImage(
// We also don't want to write HTML on a Mac, since Mail.app prefers to use
// the image markup over attaching the actual image. See
// http://crbug.com/33016 for details.
- scw.WriteHTML(UTF8ToUTF16(URLToImageMarkup(url, title)), std::string());
+ scw.WriteHTML(UTF8ToUTF16(URLToImageMarkup(url, title)), "");
#endif
}
}
@@ -238,7 +238,7 @@ void WebClipboardImpl::writeDataObject(const WebDragData& data) {
if (!data_object.text.is_null())
scw.WriteText(data_object.text.string());
if (!data_object.html.is_null())
- scw.WriteHTML(data_object.html.string(), std::string());
+ scw.WriteHTML(data_object.html.string(), "");
// If there is no custom data, avoid calling WritePickledData. This ensures
// that ScopedClipboardWriterGlue's dtor remains a no-op if the page didn't
// modify the DataTransfer object, which is important to avoid stomping on
diff --git a/webkit/media/crypto/key_systems.cc b/webkit/media/crypto/key_systems.cc
index 0ffe951..b9c79d0 100644
--- a/webkit/media/crypto/key_systems.cc
+++ b/webkit/media/crypto/key_systems.cc
@@ -66,7 +66,7 @@ KeySystems::KeySystems() {
for (size_t j = 0; j < mime_type_codecs.size(); ++j)
codecs.insert(mime_type_codecs[j]);
// Support the MIME type string alone, without codec(s) specified.
- codecs.insert(std::string());
+ codecs.insert("");
// Key systems can be repeated, so there may already be an entry.
KeySystemMappings::iterator key_system_iter =
@@ -113,8 +113,7 @@ bool KeySystems::IsSupportedKeySystemWithMediaMimeType(
const std::vector<std::string>& codecs,
const std::string& key_system) {
if (codecs.empty())
- return IsSupportedKeySystemWithContainerAndCodec(
- mime_type, std::string(), key_system);
+ return IsSupportedKeySystemWithContainerAndCodec(mime_type, "", key_system);
for (size_t i = 0; i < codecs.size(); ++i) {
if (!IsSupportedKeySystemWithContainerAndCodec(
diff --git a/webkit/media/crypto/key_systems_unittest.cc b/webkit/media/crypto/key_systems_unittest.cc
index 4b28ec9..0c25196 100644
--- a/webkit/media/crypto/key_systems_unittest.cc
+++ b/webkit/media/crypto/key_systems_unittest.cc
@@ -233,14 +233,14 @@ TEST_F(KeySystemsTest, ClearKey_IsSupportedKeySystem_InvalidVariants) {
TEST_F(KeySystemsTest, IsSupportedKeySystemWithMediaMimeType_ClearKey_NoType) {
// These two should be true. See http://crbug.com/164303.
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), kClearKey));
+ "", no_codecs(), kClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), "webkit-org.w3"));
+ "", no_codecs(), "webkit-org.w3"));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), "webkit-org.w3.foo"));
+ "", no_codecs(), "webkit-org.w3.foo"));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), "webkit-org.w3.clearkey.foo"));
+ "", no_codecs(), "webkit-org.w3.clearkey.foo"));
}
TEST_F(KeySystemsTest, IsSupportedKeySystemWithMediaMimeType_ClearKey_WebM) {
@@ -419,14 +419,14 @@ TEST_F(KeySystemsTest,
IsSupportedKeySystemWithMediaMimeType_ExternalClearKey_NoType) {
// These two should be true. See http://crbug.com/164303.
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), kExternalClearKey));
+ "", no_codecs(), kExternalClearKey));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), "org.chromium"));
+ "", no_codecs(), "org.chromium"));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), "org.chromium.foo"));
+ "", no_codecs(), "org.chromium.foo"));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), "org.chromium.externalclearkey.foo"));
+ "", no_codecs(), "org.chromium.externalclearkey.foo"));
}
TEST_F(KeySystemsTest,
@@ -606,14 +606,14 @@ TEST_F(KeySystemsTest, Widevine_IsSupportedKeySystem_InvalidVariants) {
TEST_F(KeySystemsTest, IsSupportedKeySystemWithMediaMimeType_Widevine_NoType) {
// These two should be true. See http://crbug.com/164303.
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), kWidevineAlpha));
+ "", no_codecs(), kWidevineAlpha));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), kWidevine));
+ "", no_codecs(), kWidevine));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), "com.widevine.foo"));
+ "", no_codecs(), "com.widevine.foo"));
EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
- std::string(), no_codecs(), "com.widevine.alpha.foo"));
+ "", no_codecs(), "com.widevine.alpha.foo"));
}
TEST_F(KeySystemsTest, IsSupportedKeySystemWithMediaMimeType_Widevine_WebM) {
diff --git a/webkit/media/crypto/ppapi/cdm_wrapper.cc b/webkit/media/crypto/ppapi/cdm_wrapper.cc
index cd5b917..25eadb0 100644
--- a/webkit/media/crypto/ppapi/cdm_wrapper.cc
+++ b/webkit/media/crypto/ppapi/cdm_wrapper.cc
@@ -652,7 +652,7 @@ void CdmWrapper::GenerateKeyRequest(const std::string& key_system,
if (!cdm_) {
if (!CreateCdmInstance(key_system)) {
- SendUnknownKeyError(key_system, std::string());
+ SendUnknownKeyError(key_system, "");
return;
}
}
diff --git a/webkit/media/crypto/ppapi/clear_key_cdm.cc b/webkit/media/crypto/ppapi/clear_key_cdm.cc
index faa6635..4c0e2d5 100644
--- a/webkit/media/crypto/ppapi/clear_key_cdm.cc
+++ b/webkit/media/crypto/ppapi/clear_key_cdm.cc
@@ -249,11 +249,7 @@ cdm::Status ClearKeyCdm::AddKey(const char* session_id,
DVLOG(1) << "AddKey()";
base::AutoLock auto_lock(client_lock_);
ScopedResetter<Client> auto_resetter(&client_);
- decryptor_.AddKey(std::string(),
- key,
- key_size,
- key_id,
- key_id_size,
+ decryptor_.AddKey("", key, key_size, key_id, key_id_size,
std::string(session_id, session_id_size));
if (client_.status() != Client::kKeyAdded)
@@ -272,8 +268,7 @@ cdm::Status ClearKeyCdm::CancelKeyRequest(const char* session_id,
DVLOG(1) << "CancelKeyRequest()";
base::AutoLock auto_lock(client_lock_);
ScopedResetter<Client> auto_resetter(&client_);
- decryptor_.CancelKeyRequest(std::string(),
- std::string(session_id, session_id_size));
+ decryptor_.CancelKeyRequest("", std::string(session_id, session_id_size));
return cdm::kSuccess;
}
diff --git a/webkit/media/crypto/ppapi_decryptor.cc b/webkit/media/crypto/ppapi_decryptor.cc
index 7b9c334..580c5a3 100644
--- a/webkit/media/crypto/ppapi_decryptor.cc
+++ b/webkit/media/crypto/ppapi_decryptor.cc
@@ -68,7 +68,7 @@ bool PpapiDecryptor::GenerateKeyRequest(const std::string& key_system,
if (!plugin_cdm_delegate_->GenerateKeyRequest(
key_system, type, init_data, init_data_length)) {
- ReportFailureToCallPlugin(key_system, std::string());
+ ReportFailureToCallPlugin(key_system, "");
return false;
}
diff --git a/webkit/media/crypto/proxy_decryptor.cc b/webkit/media/crypto/proxy_decryptor.cc
index dafc955..bd0328a 100644
--- a/webkit/media/crypto/proxy_decryptor.cc
+++ b/webkit/media/crypto/proxy_decryptor.cc
@@ -117,8 +117,7 @@ bool ProxyDecryptor::GenerateKeyRequest(const std::string& key_system,
if (!decryptor_) {
decryptor_ = CreateDecryptor(key_system);
if (!decryptor_) {
- key_error_cb_.Run(
- key_system, std::string(), media::Decryptor::kClientError, 0);
+ key_error_cb_.Run(key_system, "", media::Decryptor::kClientError, 0);
return false;
}
}
diff --git a/webkit/plugins/ppapi/content_decryptor_delegate.cc b/webkit/plugins/ppapi/content_decryptor_delegate.cc
index 5e3a649..8515531 100644
--- a/webkit/plugins/ppapi/content_decryptor_delegate.cc
+++ b/webkit/plugins/ppapi/content_decryptor_delegate.cc
@@ -627,8 +627,7 @@ void ContentDecryptorDelegate::KeyAdded(PP_Var key_system_var,
StringVar* key_system_string = StringVar::FromPPVar(key_system_var);
StringVar* session_id_string = StringVar::FromPPVar(session_id_var);
if (!key_system_string || !session_id_string) {
- key_error_cb_.Run(
- std::string(), std::string(), media::Decryptor::kUnknownError, 0);
+ key_error_cb_.Run("", "", media::Decryptor::kUnknownError, 0);
return;
}
@@ -657,8 +656,7 @@ void ContentDecryptorDelegate::KeyMessage(PP_Var key_system_var,
StringVar* default_url_string = StringVar::FromPPVar(default_url_var);
if (!key_system_string || !session_id_string || !default_url_string) {
- key_error_cb_.Run(
- std::string(), std::string(), media::Decryptor::kUnknownError, 0);
+ key_error_cb_.Run("", "", media::Decryptor::kUnknownError, 0);
return;
}
@@ -678,8 +676,7 @@ void ContentDecryptorDelegate::KeyError(PP_Var key_system_var,
StringVar* key_system_string = StringVar::FromPPVar(key_system_var);
StringVar* session_id_string = StringVar::FromPPVar(session_id_var);
if (!key_system_string || !session_id_string) {
- key_error_cb_.Run(
- std::string(), std::string(), media::Decryptor::kUnknownError, 0);
+ key_error_cb_.Run("", "", media::Decryptor::kUnknownError, 0);
return;
}
diff --git a/webkit/quota/quota_manager_unittest.cc b/webkit/quota/quota_manager_unittest.cc
index c814dbc..ccbc826 100644
--- a/webkit/quota/quota_manager_unittest.cc
+++ b/webkit/quota/quota_manager_unittest.cc
@@ -1368,7 +1368,7 @@ TEST_F(QuotaManagerTest, DeleteHostDataSimple) {
MessageLoop::current()->RunUntilIdle();
int64 predelete_host_pers = usage();
- DeleteHostData(std::string(), kTemp, kAllClients);
+ DeleteHostData("", kTemp, kAllClients);
MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kQuotaStatusOk, status());
diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h
index 2640224..5b85305 100644
--- a/webkit/tools/test_shell/test_shell.h
+++ b/webkit/tools/test_shell/test_shell.h
@@ -243,8 +243,7 @@ public:
// Get the JavaScript flags for a specific load
static std::string GetJSFlagsForLoad(size_t load) {
- if (load >= js_flags_.size())
- return std::string();
+ if (load >= js_flags_.size()) return "";
return js_flags_[load];
}