diff options
191 files changed, 757 insertions, 695 deletions
diff --git a/android_webview/browser/aw_devtools_delegate.cc b/android_webview/browser/aw_devtools_delegate.cc index cfac7f7..889352d 100644 --- a/android_webview/browser/aw_devtools_delegate.cc +++ b/android_webview/browser/aw_devtools_delegate.cc @@ -26,7 +26,7 @@ AwDevToolsDelegate::AwDevToolsDelegate(content::BrowserContext* browser_context) : browser_context_(browser_context) { devtools_http_handler_ = content::DevToolsHttpHandler::Start( new net::UnixDomainSocketWithAbstractNamespaceFactory( - StringPrintf(kSocketNameFormat, getpid()), + base::StringPrintf(kSocketNameFormat, getpid()), base::Bind(&content::CanUserConnectToDevTools)), "", this); diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc index 47cd665..2db32f7 100644 --- a/ash/display/display_controller.cc +++ b/ash/display/display_controller.cc @@ -249,7 +249,7 @@ bool DisplayLayout::ConvertToValue(const DisplayLayout& layout, std::string DisplayLayout::ToString() const { const std::string position_str = GetStringFromPosition(position); - return StringPrintf("%s, %d", position_str.c_str(), offset); + return base::StringPrintf("%s, %d", position_str.c_str(), offset); } // static @@ -768,7 +768,8 @@ aura::RootWindow* DisplayController::CreateRootWindowForDisplay( params.initial_insets = display_info.GetOverscanInsetsInPixel(); params.initial_root_window_scale = display_info.ui_scale(); aura::RootWindow* root_window = new aura::RootWindow(params); - root_window->SetName(StringPrintf("RootWindow-%d", root_window_count++)); + root_window->SetName( + base::StringPrintf("RootWindow-%d", root_window_count++)); // No need to remove RootWindowObserver because // the DisplayManager object outlives RootWindow objects. diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc index 257e62b..ad92a5e 100644 --- a/ash/display/display_manager.cc +++ b/ash/display/display_manager.cc @@ -526,7 +526,8 @@ void DisplayManager::CycleDisplayImpl() { gfx::Rect host_bounds = gfx::Rect(primary->GetHostOrigin(), primary->GetHostSize()); new_display_info_list.push_back(DisplayInfo::CreateFromSpec( - StringPrintf("%d+%d-500x400", host_bounds.x(), host_bounds.bottom()))); + base::StringPrintf( + "%d+%d-500x400", host_bounds.x(), host_bounds.bottom()))); } UpdateDisplays(new_display_info_list); } diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 2b53645..e4305fa 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc @@ -23,6 +23,8 @@ namespace internal { using std::vector; using std::string; +using base::StringPrintf; + class DisplayManagerTest : public test::AshTestBase, public gfx::DisplayObserver, public aura::WindowObserver { diff --git a/ash/magnifier/magnification_controller_unittest.cc b/ash/magnifier/magnification_controller_unittest.cc index bc2c5ad..2060df4 100644 --- a/ash/magnifier/magnification_controller_unittest.cc +++ b/ash/magnifier/magnification_controller_unittest.cc @@ -28,7 +28,7 @@ class MagnificationControllerTest: public test::AshTestBase { virtual void SetUp() OVERRIDE { AshTestBase::SetUp(); - UpdateDisplay(StringPrintf("%dx%d", kRootWidth, kRootHeight)); + UpdateDisplay(base::StringPrintf("%dx%d", kRootWidth, kRootHeight)); aura::RootWindow* root = GetRootWindow(); gfx::Rect root_bounds(root->bounds()); diff --git a/ash/system/monitor/tray_monitor.cc b/ash/system/monitor/tray_monitor.cc index b6f134a..e34ffb5 100644 --- a/ash/system/monitor/tray_monitor.cc +++ b/ash/system/monitor/tray_monitor.cc @@ -65,12 +65,12 @@ void TrayMonitor::OnGotHandles(const std::list<base::ProcessHandle>& handles) { std::string output; string16 free_bytes = ui::FormatBytes(static_cast<int64>(mem_info.free) * 1024); - output = StringPrintf("free: %s", UTF16ToUTF8(free_bytes).c_str()); + output = base::StringPrintf("free: %s", UTF16ToUTF8(free_bytes).c_str()); if (mem_info.gem_size != -1) { string16 gem_size = ui::FormatBytes(mem_info.gem_size); - output += StringPrintf(" gmem: %s", UTF16ToUTF8(gem_size).c_str()); + output += base::StringPrintf(" gmem: %s", UTF16ToUTF8(gem_size).c_str()); if (mem_info.gem_objects != -1) - output += StringPrintf(" gobjects: %d", mem_info.gem_objects); + output += base::StringPrintf(" gobjects: %d", mem_info.gem_objects); } size_t total_private_bytes = 0, total_shared_bytes = 0; for (std::list<base::ProcessHandle>::const_iterator i = handles.begin(); @@ -85,9 +85,9 @@ void TrayMonitor::OnGotHandles(const std::list<base::ProcessHandle>& handles) { string16 private_size = ui::FormatBytes(total_private_bytes); string16 shared_size = ui::FormatBytes(total_shared_bytes); - output += StringPrintf("\nGPU private: %s shared: %s", - UTF16ToUTF8(private_size).c_str(), - UTF16ToUTF8(shared_size).c_str()); + output += base::StringPrintf("\nGPU private: %s shared: %s", + UTF16ToUTF8(private_size).c_str(), + UTF16ToUTF8(shared_size).c_str()); label_->SetText(UTF8ToUTF16(output)); refresh_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kRefreshTimeoutMs), diff --git a/ash/system/web_notification/web_notification_tray_unittest.cc b/ash/system/web_notification/web_notification_tray_unittest.cc index a53f970..d5aba2d 100644 --- a/ash/system/web_notification/web_notification_tray_unittest.cc +++ b/ash/system/web_notification/web_notification_tray_unittest.cc @@ -196,7 +196,7 @@ TEST_F(WebNotificationTrayTest, ManyMessageCenterNotifications) { size_t notifications_to_add = NotificationList::kMaxVisibleMessageCenterNotifications + 1; for (size_t i = 0; i < notifications_to_add; ++i) { - std::string id = StringPrintf("test_id%d", static_cast<int>(i)); + std::string id = base::StringPrintf("test_id%d", static_cast<int>(i)); delegate->AddNotification(tray, id); } bool shown = tray->message_center_tray_->ShowMessageCenterBubble(); @@ -217,7 +217,7 @@ TEST_F(WebNotificationTrayTest, ManyPopupNotifications) { size_t notifications_to_add = NotificationList::kMaxVisiblePopupNotifications + 1; for (size_t i = 0; i < notifications_to_add; ++i) { - std::string id = StringPrintf("test_id%d", static_cast<int>(i)); + std::string id = base::StringPrintf("test_id%d", static_cast<int>(i)); delegate->AddNotification(tray, id); } // Hide and reshow the bubble so that it is updated immediately, not delayed. diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc index 29e166a..49fe58e 100644 --- a/ash/wm/drag_window_resizer_unittest.cc +++ b/ash/wm/drag_window_resizer_unittest.cc @@ -37,7 +37,7 @@ class DragWindowResizerTest : public test::AshTestBase { virtual void SetUp() OVERRIDE { AshTestBase::SetUp(); - UpdateDisplay(StringPrintf("800x%d", kRootHeight)); + UpdateDisplay(base::StringPrintf("800x%d", kRootHeight)); aura::RootWindow* root = Shell::GetPrimaryRootWindow(); gfx::Rect root_bounds(root->bounds()); diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index 8ffa088..a1d27e3 100644 --- a/ash/wm/workspace/workspace_window_resizer_unittest.cc +++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc @@ -70,7 +70,7 @@ class WorkspaceWindowResizerTest : public test::AshTestBase { virtual void SetUp() OVERRIDE { AshTestBase::SetUp(); - UpdateDisplay(StringPrintf("800x%d", kRootHeight)); + UpdateDisplay(base::StringPrintf("800x%d", kRootHeight)); aura::RootWindow* root = Shell::GetPrimaryRootWindow(); gfx::Rect root_bounds(root->bounds()); diff --git a/base/debug/trace_event_android.cc b/base/debug/trace_event_android.cc index c04ed91..70e377b 100644 --- a/base/debug/trace_event_android.cc +++ b/base/debug/trace_event_android.cc @@ -25,7 +25,7 @@ void WriteEvent(char phase, const unsigned char* arg_types, const unsigned long long* arg_values, unsigned char flags) { - std::string out = StringPrintf("%c|%d|%s", phase, getpid(), name); + std::string out = base::StringPrintf("%c|%d|%s", phase, getpid(), name); if (flags & TRACE_EVENT_FLAG_HAS_ID) base::StringAppendF(&out, "-%" PRIx64, static_cast<uint64>(id)); out += '|'; @@ -109,7 +109,7 @@ void TraceLog::SendToATrace(char phase, case TRACE_EVENT_PHASE_COUNTER: for (int i = 0; i < num_args; ++i) { DCHECK(arg_types[i] == TRACE_VALUE_TYPE_INT); - std::string out = StringPrintf("C|%d|%s-%s", + std::string out = base::StringPrintf("C|%d|%s-%s", getpid(), name, arg_names[i]); if (flags & TRACE_EVENT_FLAG_HAS_ID) StringAppendF(&out, "-%" PRIx64, static_cast<uint64>(id)); diff --git a/base/file_util.cc b/base/file_util.cc index f951e3b..5567f74 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -278,7 +278,8 @@ int GetUniquePathNumber( FilePath new_path; for (int count = 1; count <= kMaxUniqueFiles; ++count) { - new_path = path.InsertBeforeExtensionASCII(StringPrintf(" (%d)", count)); + new_path = + path.InsertBeforeExtensionASCII(base::StringPrintf(" (%d)", count)); if (!PathExists(new_path) && (!have_suffix || !PathExists(FilePath(new_path.value() + suffix)))) { return count; diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index 8b01412..c7014b6 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -140,7 +140,7 @@ bool VerifySpecificPathControlledByUser(const FilePath& path, static std::string TempFileName() { #if defined(OS_MACOSX) - return StringPrintf(".%s.XXXXXX", base::mac::BaseBundleID()); + return base::StringPrintf(".%s.XXXXXX", base::mac::BaseBundleID()); #endif #if defined(GOOGLE_CHROME_BUILD) diff --git a/base/os_compat_android.cc b/base/os_compat_android.cc index d434c5b..118ad5e 100644 --- a/base/os_compat_android.cc +++ b/base/os_compat_android.cc @@ -18,7 +18,7 @@ extern "C" { int futimes(int fd, const struct timeval tv[2]) { - const std::string fd_path = StringPrintf("/proc/self/fd/%d", fd); + const std::string fd_path = base::StringPrintf("/proc/self/fd/%d", fd); return utimes(fd_path.c_str(), tv); } diff --git a/base/process_linux.cc b/base/process_linux.cc index 83d9649..b7764fc 100644 --- a/base/process_linux.cc +++ b/base/process_linux.cc @@ -42,8 +42,10 @@ struct CGroups { base::FilePath background_file; CGroups() { - foreground_file = base::FilePath(StringPrintf(kControlPath, kForeground)); - background_file = base::FilePath(StringPrintf(kControlPath, kBackground)); + foreground_file = + base::FilePath(base::StringPrintf(kControlPath, kForeground)); + background_file = + base::FilePath(base::StringPrintf(kControlPath, kBackground)); file_util::FileSystemType foreground_type; file_util::FileSystemType background_type; enabled = diff --git a/base/stringprintf.h b/base/stringprintf.h index 9a99237..3946f3d 100644 --- a/base/stringprintf.h +++ b/base/stringprintf.h @@ -59,10 +59,4 @@ BASE_EXPORT void StringAppendV(std::wstring* dst, } // namespace base -// Don't require the namespace for legacy code. New code should use "base::" or -// have its own using decl. -// -// TODO(brettw) remove these when calling code is converted. -using base::StringPrintf; - #endif // BASE_STRINGPRINTF_H_ diff --git a/cc/base/worker_pool.cc b/cc/base/worker_pool.cc index cc828a8..caa3159 100644 --- a/cc/base/worker_pool.cc +++ b/cc/base/worker_pool.cc @@ -183,7 +183,7 @@ WorkerPool::Inner::Inner(WorkerPool* worker_pool, new base::DelegateSimpleThread( this, thread_name_prefix + - StringPrintf("Worker%lu", workers_.size() + 1).c_str())); + base::StringPrintf("Worker%lu", workers_.size() + 1).c_str())); worker->Start(); workers_.push_back(worker.Pass()); } diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index d3079d2..990c32b 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1909,7 +1909,7 @@ scoped_ptr<base::Value> LayerTreeHostImpl::AsValue() const { scoped_ptr<base::Value> LayerTreeHostImpl::ActivationStateAsValue() const { scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); - state->SetString("lthi_id", StringPrintf("%p", this)); + state->SetString("lthi_id", base::StringPrintf("%p", this)); state->SetBoolean("visible_resources_ready", pending_tree_->AreVisibleResourcesReady()); state->Set("tile_manager", tile_manager_->BasicStateAsValue().release()); @@ -1918,7 +1918,7 @@ scoped_ptr<base::Value> LayerTreeHostImpl::ActivationStateAsValue() const { scoped_ptr<base::Value> LayerTreeHostImpl::FrameStateAsValue() const { scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); - state->SetString("lthi_id", StringPrintf("%p", this)); + state->SetString("lthi_id", base::StringPrintf("%p", this)); state->Set("device_viewport_size", MathUtil::AsValue(device_viewport_size_).release()); if (tile_manager_) diff --git a/chrome/browser/android/dev_tools_server.cc b/chrome/browser/android/dev_tools_server.cc index 8af3124..f56abc6 100644 --- a/chrome/browser/android/dev_tools_server.cc +++ b/chrome/browser/android/dev_tools_server.cc @@ -129,7 +129,8 @@ void DevToolsServer::Start() { socket_name_, base::Bind(&content::CanUserConnectToDevTools)), use_bundled_frontend_resources_ ? - "" : StringPrintf(kFrontEndURL, version_info.Version().c_str()), + "" : + base::StringPrintf(kFrontEndURL, version_info.Version().c_str()), new DevToolsServerDelegate(use_bundled_frontend_resources_)); } diff --git a/chrome/browser/autocomplete/autocomplete_match.cc b/chrome/browser/autocomplete/autocomplete_match.cc index eeec15d..77041f2 100644 --- a/chrome/browser/autocomplete/autocomplete_match.cc +++ b/chrome/browser/autocomplete/autocomplete_match.cc @@ -450,7 +450,7 @@ void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, int value) { - RecordAdditionalInfo(property, StringPrintf("%d", value)); + RecordAdditionalInfo(property, base::StringPrintf("%d", value)); } void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index 0a9c83aa..1906110 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -357,8 +357,8 @@ void NavigationNotificationObserver::ConditionMet( &dict); } else { AutomationJSONReply(automation_, reply_message_.release()).SendError( - StringPrintf("Navigation failed with error code=%d.", - navigation_result)); + base::StringPrintf("Navigation failed with error code=%d.", + navigation_result)); } } else { IPC::ParamTraits<int>::Write( diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 9261d38..65b3d60 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -210,7 +210,7 @@ void DidEnablePlugin(base::WeakPtr<AutomationProvider> automation, } else { if (automation) { AutomationJSONReply(automation.get(), reply_message).SendError( - StringPrintf(error_msg.c_str(), path.c_str())); + base::StringPrintf(error_msg.c_str(), path.c_str())); } } } @@ -1160,7 +1160,7 @@ void TestingAutomationProvider::OpenProfileWindow( Profile* profile = profile_manager->GetProfileByPath(base::FilePath(path)); if (!profile) { AutomationJSONReply(this, reply_message).SendError( - StringPrintf("Invalid profile path: %s", path.c_str())); + base::StringPrintf("Invalid profile path: %s", path.c_str())); return; } int num_loads; @@ -1991,8 +1991,8 @@ void TestingAutomationProvider::SendJSONRequestWithBrowserIndex( IPC::Message* reply_message) { Browser* browser = index < 0 ? NULL : automation_util::GetBrowserAt(index); if (!browser && index >= 0) { - AutomationJSONReply(this, reply_message).SendError( - StringPrintf("Browser window with index=%d does not exist.", index)); + AutomationJSONReply(this, reply_message).SendError(base::StringPrintf( + "Browser window with index=%d does not exist.", index)); } else { SendJSONRequest(browser, json_request, reply_message); } @@ -2022,8 +2022,8 @@ void TestingAutomationProvider::SendJSONRequest(Browser* browser, (this->*handler_map_[command])(dict_value.get(), reply_message); // Command has no handler. } else { - error_string = StringPrintf("Unknown command '%s'. Options: ", - command.c_str()); + error_string = base::StringPrintf("Unknown command '%s'. Options: ", + command.c_str()); for (std::map<std::string, JsonHandler>::const_iterator it = handler_map_.begin(); it != handler_map_.end(); ++it) { error_string += it->first + ", "; @@ -2151,7 +2151,7 @@ void TestingAutomationProvider::PerformActionOnInfobar( WebContents* web_contents = browser->tab_strip_model()->GetWebContentsAt(tab_index); if (!web_contents) { - reply.SendError(StringPrintf("No such tab at index %d", tab_index)); + reply.SendError(base::StringPrintf("No such tab at index %d", tab_index)); return; } InfoBarService* infobar_service = @@ -2160,8 +2160,8 @@ void TestingAutomationProvider::PerformActionOnInfobar( InfoBarDelegate* infobar = NULL; size_t infobar_index = static_cast<size_t>(infobar_index_int); if (infobar_index >= infobar_service->GetInfoBarCount()) { - reply.SendError(StringPrintf("No such infobar at index %" PRIuS, - infobar_index)); + reply.SendError(base::StringPrintf("No such infobar at index %" PRIuS, + infobar_index)); return; } infobar = infobar_service->GetInfoBarDelegateAt(infobar_index); @@ -2560,7 +2560,8 @@ void TestingAutomationProvider::WaitForAllDownloadsToComplete( if (!args->GetList("pre_download_ids", &pre_download_ids)) { AutomationJSONReply(this, reply_message) - .SendError(StringPrintf("List of IDs of previous downloads required.")); + .SendError( + base::StringPrintf("List of IDs of previous downloads required.")); return; } @@ -2605,7 +2606,7 @@ void TestingAutomationProvider::PerformActionOnDownload( DownloadItem* selected_item = download_manager->GetDownload(id); if (!selected_item) { AutomationJSONReply(this, reply_message) - .SendError(StringPrintf("No download with an id of %d\n", id)); + .SendError(base::StringPrintf("No download with an id of %d\n", id)); return; } @@ -2680,7 +2681,8 @@ void TestingAutomationProvider::PerformActionOnDownload( selected_item->Cancel(true); } else { AutomationJSONReply(this, reply_message) - .SendError(StringPrintf("Invalid action '%s' given.", action.c_str())); + .SendError( + base::StringPrintf("Invalid action '%s' given.", action.c_str())); } } @@ -3457,7 +3459,7 @@ WebContents* GetWebContentsFromDict(const Browser* browser, WebContents* web_contents = browser->tab_strip_model()->GetWebContentsAt(tab_index); if (!web_contents) { - *error_message = StringPrintf("No tab at index %d.", tab_index); + *error_message = base::StringPrintf("No tab at index %d.", tab_index); return NULL; } return web_contents; @@ -3904,7 +3906,7 @@ void TestingAutomationProvider::TriggerBrowserActionById( // TODO(kkania): Implement the platform-specific GetExtensionId() in // BrowserActionTestUtil. if (num_browser_actions != 1) { - AutomationJSONReply(this, reply_message).SendError(StringPrintf( + AutomationJSONReply(this, reply_message).SendError(base::StringPrintf( "Found %d browser actions. Only one browser action must be active.", num_browser_actions)); return; @@ -4150,7 +4152,7 @@ void TestingAutomationProvider::CloseNotification( int balloon_count = static_cast<int>(balloons.size()); if (index < 0 || index >= balloon_count) { AutomationJSONReply(this, reply_message) - .SendError(StringPrintf("No notification at index %d", index)); + .SendError(base::StringPrintf("No notification at index %d", index)); return; } std::vector<const Notification*> queued_notes; @@ -4600,8 +4602,9 @@ void TestingAutomationProvider::LaunchApp( id, false /* do not include disabled extensions */); if (!extension) { AutomationJSONReply(this, reply_message).SendError( - StringPrintf("Extension with ID '%s' doesn't exist or is disabled.", - id.c_str())); + base::StringPrintf( + "Extension with ID '%s' doesn't exist or is disabled.", + id.c_str())); return; } @@ -4652,8 +4655,8 @@ void TestingAutomationProvider::SetAppLaunchType( const Extension* extension = service->GetExtensionById( id, true /* include disabled extensions */); if (!extension) { - reply.SendError( - StringPrintf("Extension with ID '%s' doesn't exist.", id.c_str())); + reply.SendError(base::StringPrintf( + "Extension with ID '%s' doesn't exist.", id.c_str())); return; } @@ -4667,8 +4670,8 @@ void TestingAutomationProvider::SetAppLaunchType( } else if (launch_type_str == "window") { launch_type = extensions::ExtensionPrefs::LAUNCH_WINDOW; } else { - reply.SendError( - StringPrintf("Unexpected launch type '%s'.", launch_type_str.c_str())); + reply.SendError(base::StringPrintf( + "Unexpected launch type '%s'.", launch_type_str.c_str())); return; } @@ -4696,8 +4699,8 @@ void TestingAutomationProvider::GetV8HeapStats( web_contents = browser->tab_strip_model()->GetWebContentsAt(tab_index); if (!web_contents) { - AutomationJSONReply(this, reply_message).SendError( - StringPrintf("Could not get WebContents at tab index %d", tab_index)); + AutomationJSONReply(this, reply_message).SendError(base::StringPrintf( + "Could not get WebContents at tab index %d", tab_index)); return; } @@ -4730,8 +4733,8 @@ void TestingAutomationProvider::GetFPS( web_contents = browser->tab_strip_model()->GetWebContentsAt(tab_index); if (!web_contents) { - AutomationJSONReply(this, reply_message).SendError( - StringPrintf("Could not get WebContents at tab index %d", tab_index)); + AutomationJSONReply(this, reply_message).SendError(base::StringPrintf( + "Could not get WebContents at tab index %d", tab_index)); return; } @@ -5262,12 +5265,13 @@ void TestingAutomationProvider::ExecuteBrowserCommandAsyncJSON( return; } if (!chrome::SupportsCommand(browser, command)) { - reply.SendError(StringPrintf("Browser does not support command=%d.", - command)); + reply.SendError(base::StringPrintf("Browser does not support command=%d.", + command)); return; } if (!chrome::IsCommandEnabled(browser, command)) { - reply.SendError(StringPrintf("Browser command=%d not enabled.", command)); + reply.SendError(base::StringPrintf( + "Browser command=%d not enabled.", command)); return; } chrome::ExecuteCommand(browser, command); @@ -5291,12 +5295,12 @@ void TestingAutomationProvider::ExecuteBrowserCommandJSON( } if (!chrome::SupportsCommand(browser, command)) { AutomationJSONReply(this, reply_message).SendError( - StringPrintf("Browser does not support command=%d.", command)); + base::StringPrintf("Browser does not support command=%d.", command)); return; } if (!chrome::IsCommandEnabled(browser, command)) { AutomationJSONReply(this, reply_message).SendError( - StringPrintf("Browser command=%d not enabled.", command)); + base::StringPrintf("Browser command=%d not enabled.", command)); return; } // First check if we can handle the command without using an observer. @@ -5313,9 +5317,8 @@ void TestingAutomationProvider::ExecuteBrowserCommandJSON( chrome::ExecuteCommand(browser, command); return; } - AutomationJSONReply(this, reply_message).SendError( - StringPrintf("Unable to register observer for browser command=%d.", - command)); + AutomationJSONReply(this, reply_message).SendError(base::StringPrintf( + "Unable to register observer for browser command=%d.", command)); } void TestingAutomationProvider::IsMenuCommandEnabledJSON( @@ -5494,8 +5497,8 @@ void TestingAutomationProvider::GetCookiesInBrowserContext( automation_util::GetCookies(url, web_contents, &value_size, &value); if (value_size == -1) { reply.SendError( - StringPrintf("Unable to retrieve cookies for url=%s.", - url_string.c_str())); + base::StringPrintf("Unable to retrieve cookies for url=%s.", + url_string.c_str())); return; } DictionaryValue dict; @@ -5536,8 +5539,8 @@ void TestingAutomationProvider::DeleteCookieInBrowserContext( automation_util::DeleteCookie(url, cookie_name, web_contents, &success); if (!success) { reply.SendError( - StringPrintf("Failed to delete cookie with name=%s for url=%s.", - cookie_name.c_str(), url_string.c_str())); + base::StringPrintf("Failed to delete cookie with name=%s for url=%s.", + cookie_name.c_str(), url_string.c_str())); return; } reply.SendSuccess(NULL); @@ -5574,8 +5577,8 @@ void TestingAutomationProvider::SetCookieInBrowserContext( } automation_util::SetCookie(url, value, web_contents, &response_value); if (response_value != 1) { - reply.SendError( - StringPrintf("Unable set cookie for url=%s.", url_string.c_str())); + reply.SendError(base::StringPrintf( + "Unable set cookie for url=%s.", url_string.c_str())); return; } reply.SendSuccess(NULL); diff --git a/chrome/browser/automation/testing_automation_provider_chromeos.cc b/chrome/browser/automation/testing_automation_provider_chromeos.cc index 34f785f..999c28a 100644 --- a/chrome/browser/automation/testing_automation_provider_chromeos.cc +++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc @@ -1067,8 +1067,8 @@ void TestingAutomationProvider::ConnectToPrivateNetwork( chromeos::VirtualNetwork* network = network_library->FindVirtualNetworkByPath(service_path); if (!network) { - reply.SendError(StringPrintf("No virtual network found: %s", - service_path.c_str())); + reply.SendError(base::StringPrintf("No virtual network found: %s", + service_path.c_str())); return; } if (network->NeedMoreInfoToConnect()) { diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc index e793013..9beb318 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -359,7 +359,7 @@ void BootTimesLoader::WriteTimes( name = tm.name(); } output += - StringPrintf( + base::StringPrintf( "\n%.2f +%.4f %s", since_first.InSecondsF(), since_prev.InSecondsF(), diff --git a/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc b/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc index e1173e0..8351cc7 100644 --- a/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc +++ b/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc @@ -46,12 +46,11 @@ class SetInputMethodListener : public content::NotificationObserver { const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE { const std::string& content = *content::Details<std::string>(details).ptr(); - const std::string expected_message = StringPrintf("%s:%s", - kSetInputMethodMessage, - kNewInputMethod); + const std::string expected_message = + base::StringPrintf("%s:%s", kSetInputMethodMessage, kNewInputMethod); if (content == expected_message) { chromeos::input_method::GetInputMethodManager()-> - ChangeInputMethod(StringPrintf("xkb:%s", kNewInputMethod)); + ChangeInputMethod(base::StringPrintf("xkb:%s", kNewInputMethod)); extensions::TestSendMessageFunction* function = content::Source<extensions::TestSendMessageFunction>( diff --git a/chrome/browser/chromeos/login/default_user_images.cc b/chrome/browser/chromeos/login/default_user_images.cc index d2b395b..0c90f13 100644 --- a/chrome/browser/chromeos/login/default_user_images.cc +++ b/chrome/browser/chromeos/login/default_user_images.cc @@ -76,7 +76,7 @@ std::string GetDefaultImageString(int index, const std::string& prefix) { NOTREACHED(); return std::string(); } - return StringPrintf("%s%d", prefix.c_str(), index); + return base::StringPrintf("%s%d", prefix.c_str(), index); } // Returns true if the string specified consists of the prefix and one of diff --git a/chrome/browser/chromeos/login/screen_locker_tester.cc b/chrome/browser/chromeos/login/screen_locker_tester.cc index 620b26b..10c6d18 100644 --- a/chrome/browser/chromeos/login/screen_locker_tester.cc +++ b/chrome/browser/chromeos/login/screen_locker_tester.cc @@ -120,7 +120,7 @@ class WebUIScreenLockerTester : public ScreenLockerTester { void WebUIScreenLockerTester::SetPassword(const std::string& password) { RenderViewHost()->ExecuteJavascriptInWebFrame( string16(), - ASCIIToUTF16(StringPrintf( + ASCIIToUTF16(base::StringPrintf( "$('pod-row').pods[0].passwordElement.value = '%s';", password.c_str()))); } diff --git a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc index a2d11d1..f74df30 100644 --- a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc +++ b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc @@ -345,7 +345,7 @@ class ProxyConfigServiceImplTest TEST_F(ProxyConfigServiceImplTest, NetworkProxy) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { - SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i, + SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, tests[i].description.c_str())); ProxyConfigServiceImpl::ProxyConfig test_config; @@ -363,7 +363,7 @@ TEST_F(ProxyConfigServiceImplTest, NetworkProxy) { TEST_F(ProxyConfigServiceImplTest, ModifyFromUI) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { - SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i, + SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, tests[i].description.c_str())); // Init with direct. @@ -484,7 +484,7 @@ TEST_F(ProxyConfigServiceImplTest, DynamicPrefsOverride) { const TestParams& recommended_params = tests[proxies[i][1]]; const TestParams& network_params = tests[proxies[i][2]]; - SCOPED_TRACE(StringPrintf( + SCOPED_TRACE(base::StringPrintf( "Test[%" PRIuS "] managed=[%s], recommended=[%s], network=[%s]", i, managed_params.description.c_str(), recommended_params.description.c_str(), diff --git a/chrome/browser/chromeos/sim_dialog_delegate.cc b/chrome/browser/chromeos/sim_dialog_delegate.cc index 7ca79eae..61ed45b 100644 --- a/chrome/browser/chromeos/sim_dialog_delegate.cc +++ b/chrome/browser/chromeos/sim_dialog_delegate.cc @@ -76,7 +76,8 @@ GURL SimDialogDelegate::GetDialogContentURL() const { mode_value = kSimDialogSetLockOnMode; else mode_value = kSimDialogSetLockOffMode; - return GURL(StringPrintf(kSimDialogSpecialModeURL, mode_value.c_str())); + return GURL( + base::StringPrintf(kSimDialogSpecialModeURL, mode_value.c_str())); } } diff --git a/chrome/browser/chromeos/status/network_menu.cc b/chrome/browser/chromeos/status/network_menu.cc index 28d7365..8669ec5 100644 --- a/chrome/browser/chromeos/status/network_menu.cc +++ b/chrome/browser/chromeos/status/network_menu.cc @@ -938,7 +938,7 @@ void NetworkMenu::ShowTabbedNetworkSettings(const Network* network) const { network_name = l10n_util::GetStringUTF8( IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); } - std::string page = StringPrintf( + std::string page = base::StringPrintf( "%s?servicePath=%s&networkType=%d&networkName=%s", chrome::kInternetOptionsSubPage, net::EscapeUrlEncodedData(network->service_path(), true).c_str(), diff --git a/chrome/browser/chromeos/system/input_device_settings.cc b/chrome/browser/chromeos/system/input_device_settings.cc index f5a74fd..14f8378 100644 --- a/chrome/browser/chromeos/system/input_device_settings.cc +++ b/chrome/browser/chromeos/system/input_device_settings.cc @@ -65,7 +65,8 @@ void ExecuteScript(int argc, ...) { void SetPointerSensitivity(const char* script, int value) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK(value > 0 && value < 6); - ExecuteScript(3, script, "sensitivity", StringPrintf("%d", value).c_str()); + ExecuteScript( + 3, script, "sensitivity", base::StringPrintf("%d", value).c_str()); } void SetTPControl(const char* control, bool enabled) { diff --git a/chrome/browser/component_updater/component_unpacker.cc b/chrome/browser/component_updater/component_unpacker.cc index c9d4409..9fa9a9c 100644 --- a/chrome/browser/component_updater/component_unpacker.cc +++ b/chrome/browser/component_updater/component_unpacker.cc @@ -136,7 +136,8 @@ ComponentUnpacker::ComponentUnpacker(const std::vector<uint8>& pk_hash, } // We want the temporary directory to be unique and yet predictable, so // we can easily find the package in a end user machine. - std::string dir(StringPrintf("CRX_%s", base::HexEncode(hash, 6).c_str())); + std::string dir( + base::StringPrintf("CRX_%s", base::HexEncode(hash, 6).c_str())); unpack_path_ = path.DirName().AppendASCII(dir.c_str()); if (file_util::DirectoryExists(unpack_path_)) { if (!file_util::Delete(unpack_path_, true)) { diff --git a/chrome/browser/component_updater/pepper_flash_component_installer.cc b/chrome/browser/component_updater/pepper_flash_component_installer.cc index 71edeef..40b3f9c 100644 --- a/chrome/browser/component_updater/pepper_flash_component_installer.cc +++ b/chrome/browser/component_updater/pepper_flash_component_installer.cc @@ -150,7 +150,7 @@ bool MakePepperFlashPluginInfo(const base::FilePath& flash_path, plugin_info->permissions = kPepperFlashPermissions; // The description is like "Shockwave Flash 10.2 r154". - plugin_info->description = StringPrintf("%s %d.%d r%d", + plugin_info->description = base::StringPrintf("%s %d.%d r%d", kFlashPluginName, ver_nums[0], ver_nums[1], ver_nums[2]); plugin_info->version = flash_version.GetString(); diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index e95c54b..976148c 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc @@ -611,7 +611,7 @@ void DevToolsWindow::DoAction() { std::string SkColorToRGBAString(SkColor color) { // We convert the alpha using DoubleToString because StringPrintf will use // locale specific formatters (e.g., use , instead of . in German). - return StringPrintf("rgba(%d,%d,%d,%s)", SkColorGetR(color), + return base::StringPrintf("rgba(%d,%d,%d,%s)", SkColorGetR(color), SkColorGetG(color), SkColorGetB(color), base::DoubleToString(SkColorGetA(color) / 255.0).c_str()); } @@ -632,7 +632,7 @@ GURL DevToolsWindow::GetDevToolsUrl(Profile* profile, bool experiments_enabled = command_line.HasSwitch(switches::kEnableDevToolsExperiments); - std::string url_string = StringPrintf("%sdevtools.html?" + std::string url_string = base::StringPrintf("%sdevtools.html?" "dockSide=%s&toolbarColor=%s&textColor=%s%s%s", chrome::kChromeUIDevToolsURL, SideToString(dock_side).c_str(), @@ -651,7 +651,7 @@ void DevToolsWindow::UpdateTheme() { tp->GetColor(ThemeProperties::COLOR_TOOLBAR); SkColor color_tab_text = tp->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT); - std::string command = StringPrintf( + std::string command = base::StringPrintf( "InspectorFrontendAPI.setToolbarColors(\"%s\", \"%s\")", SkColorToRGBAString(color_toolbar).c_str(), SkColorToRGBAString(color_tab_text).c_str()); diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc index 20823dc..93defb3 100644 --- a/chrome/browser/download/download_browsertest.cc +++ b/chrome/browser/download/download_browsertest.cc @@ -2723,8 +2723,9 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_Renaming) { ASSERT_TRUE(item); ASSERT_TRUE(item->IsComplete()); base::FilePath full_path(item->GetFullPath()); - EXPECT_EQ(std::string("a_zip_file") + (index == 0 ? std::string(".zip") : - StringPrintf(" (%d).zip", index)), + EXPECT_EQ(std::string("a_zip_file") + + (index == 0 ? std::string(".zip") : + base::StringPrintf(" (%d).zip", index)), full_path.BaseName().AsUTF8Unsafe()); ASSERT_TRUE(file_util::PathExists(full_path)); ASSERT_TRUE(VerifyFile(full_path, origin_contents, origin_contents.size())); diff --git a/chrome/browser/download/download_path_reservation_tracker_unittest.cc b/chrome/browser/download/download_path_reservation_tracker_unittest.cc index 6022931..4209317 100644 --- a/chrome/browser/download/download_path_reservation_tracker_unittest.cc +++ b/chrome/browser/download/download_path_reservation_tracker_unittest.cc @@ -340,10 +340,12 @@ TEST_F(DownloadPathReservationTrackerTest, UnresolvedConflicts) { base::FilePath reserved_path; base::FilePath expected_path; bool verified = false; - if (i > 0) - expected_path = path.InsertBeforeExtensionASCII(StringPrintf(" (%d)", i)); - else + if (i > 0) { + expected_path = + path.InsertBeforeExtensionASCII(base::StringPrintf(" (%d)", i)); + } else { expected_path = path; + } items[i].reset(CreateDownloadItem(i)); EXPECT_FALSE(IsPathInUse(expected_path)); CallGetReservedPath(*items[i], path, true, &reserved_path, &verified); diff --git a/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc b/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc index 4ecaf23..0074233 100644 --- a/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc +++ b/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc @@ -10,7 +10,7 @@ namespace { std::string ToId(int identifier) { - return StringPrintf("_%d_", identifier); + return base::StringPrintf("_%d_", identifier); } } // namespace diff --git a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc index b95bc7c..53bcd1f 100644 --- a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc +++ b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc @@ -41,7 +41,7 @@ std::string RulesRegistryWithCache::AddRules( const RuleId& rule_id = *((*i)->id); RulesDictionaryKey key(extension_id, rule_id); if (rules_.find(key) != rules_.end()) - return StringPrintf(kDuplicateRuleId, rule_id.c_str()); + return base::StringPrintf(kDuplicateRuleId, rule_id.c_str()); } std::string error = AddRulesImpl(extension_id, rules); diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.cc b/chrome/browser/extensions/api/font_settings/font_settings_api.cc index d56ff7fc..0c2b0cb 100644 --- a/chrome/browser/extensions/api/font_settings/font_settings_api.cc +++ b/chrome/browser/extensions/api/font_settings/font_settings_api.cc @@ -67,9 +67,9 @@ std::string GetFontNamePrefPath(fonts::GenericFamily generic_family_enum, if (script.empty()) script = prefs::kWebKitCommonScript; std::string generic_family = fonts::ToString(generic_family_enum); - return StringPrintf(kWebKitFontPrefFormat, - generic_family.c_str(), - script.c_str()); + return base::StringPrintf(kWebKitFontPrefFormat, + generic_family.c_str(), + script.c_str()); } // Returns the localized name of a font so that it can be matched within the diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc index 45c25bc..e0eeefa 100644 --- a/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc @@ -93,7 +93,7 @@ class PushMessagingCanaryTest : public ExtensionApiTest { const std::string& refresh_token = sync_setup_helper_->refresh_token(); // Construct a JS string to pass in the parameters and start the test. - std::string script_string = StringPrintf( + std::string script_string = base::StringPrintf( "startTestWithCredentials('%s', '%s', '%s');", client_id.c_str(), client_secret.c_str(), refresh_token.c_str()); string16 script16 = UTF8ToUTF16(script_string); diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc index 0b52d78..259b0f2 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc @@ -68,7 +68,7 @@ IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, GetUserMediaTest) { int render_process_id = rvh->GetProcess()->GetID(); int routing_id = rvh->GetRoutingID(); - listener.Reply(StringPrintf("%i:%i", render_process_id, routing_id)); + listener.Reply(base::StringPrintf("%i:%i", render_process_id, routing_id)); ResultCatcher catcher; catcher.RestrictToProfile(browser()->profile()); diff --git a/chrome/browser/extensions/convert_web_app.cc b/chrome/browser/extensions/convert_web_app.cc index dc65e33..d818a74 100644 --- a/chrome/browser/extensions/convert_web_app.cc +++ b/chrome/browser/extensions/convert_web_app.cc @@ -122,9 +122,9 @@ scoped_refptr<Extension> ConvertWebAppToExtension( DictionaryValue* icons = new DictionaryValue(); root->Set(keys::kIcons, icons); for (size_t i = 0; i < web_app.icons.size(); ++i) { - std::string size = StringPrintf("%i", web_app.icons[i].width); - std::string icon_path = StringPrintf("%s/%s.png", kIconsDirName, - size.c_str()); + std::string size = base::StringPrintf("%i", web_app.icons[i].width); + std::string icon_path = base::StringPrintf("%s/%s.png", kIconsDirName, + size.c_str()); icons->SetString(size, icon_path); } @@ -163,7 +163,7 @@ scoped_refptr<Extension> ConvertWebAppToExtension( continue; base::FilePath icon_file = icons_dir.AppendASCII( - StringPrintf("%i.png", web_app.icons[i].width)); + base::StringPrintf("%i.png", web_app.icons[i].width)); std::vector<unsigned char> image_data; if (!gfx::PNGCodec::EncodeBGRASkBitmap(web_app.icons[i].data, false, diff --git a/chrome/browser/extensions/convert_web_app_unittest.cc b/chrome/browser/extensions/convert_web_app_unittest.cc index 3305597..5da7064 100644 --- a/chrome/browser/extensions/convert_web_app_unittest.cc +++ b/chrome/browser/extensions/convert_web_app_unittest.cc @@ -44,7 +44,7 @@ WebApplicationInfo::IconInfo GetIconInfo(const GURL& url, int size) { icon_file = icon_file.AppendASCII("extensions") .AppendASCII("convert_web_app") - .AppendASCII(StringPrintf("%i.png", size)); + .AppendASCII(base::StringPrintf("%i.png", size)); result.url = url; result.width = size; @@ -120,7 +120,8 @@ TEST_F(ExtensionFromWebApp, Basic) { const int sizes[] = {16, 48, 128}; for (size_t i = 0; i < arraysize(sizes); ++i) { - GURL icon_url(web_app.app_url.Resolve(StringPrintf("%i.png", sizes[i]))); + GURL icon_url( + web_app.app_url.Resolve(base::StringPrintf("%i.png", sizes[i]))); web_app.icons.push_back(GetIconInfo(icon_url, sizes[i])); } @@ -152,7 +153,7 @@ TEST_F(ExtensionFromWebApp, Basic) { EXPECT_EQ(web_app.icons.size(), IconsInfo::GetIcons(extension).map().size()); for (size_t i = 0; i < web_app.icons.size(); ++i) { - EXPECT_EQ(StringPrintf("icons/%i.png", web_app.icons[i].width), + EXPECT_EQ(base::StringPrintf("icons/%i.png", web_app.icons[i].width), IconsInfo::GetIcons(extension).Get( web_app.icons[i].width, ExtensionIconSet::MATCH_EXACTLY)); ExtensionResource resource = IconsInfo::GetIconResource( diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index 9a08f1a..bd255b0 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -137,7 +137,7 @@ const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( const std::vector<extensions::InstallWarning>& install_warnings = extension->install_warnings(); if (!install_warnings.empty()) { - std::string install_warnings_message = StringPrintf( + std::string install_warnings_message = base::StringPrintf( "Unexpected warnings when loading test extension %s:\n", path.AsUTF8Unsafe().c_str()); diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc index 1278371..356659c 100644 --- a/chrome/browser/extensions/webstore_inline_installer.cc +++ b/chrome/browser/extensions/webstore_inline_installer.cc @@ -147,7 +147,8 @@ bool WebstoreInlineInstaller::IsRequestorURLInVerifiedSite( // Turn the verified site (which may be a bare domain, or have a port and/or a // path) into a URL that can be parsed by URLPattern. std::string verified_site_url = - StringPrintf("http://*.%s%s", + base::StringPrintf( + "http://*.%s%s", verified_site.c_str(), verified_site.find('/') == std::string::npos ? "/*" : "*"); diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index 2b5bde6..81db7ed 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -126,8 +126,10 @@ void GetDownloadFilePath( directory.AppendASCII(id + "_" + random_number + ".crx"); int uniquifier = file_util::GetUniquePathNumber(file, FILE_PATH_LITERAL("")); - if (uniquifier > 0) - file = file.InsertBeforeExtensionASCII(StringPrintf(" (%d)", uniquifier)); + if (uniquifier > 0) { + file = file.InsertBeforeExtensionASCII( + base::StringPrintf(" (%d)", uniquifier)); + } BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(callback, file)); diff --git a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc index 0afb3ca..62ac4f9c 100644 --- a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc +++ b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc @@ -82,7 +82,8 @@ class WebstoreStartupInstallerTest : public InProcessBrowserTest { void RunTest(const std::string& test_function_name) { bool result = false; - std::string script = StringPrintf("%s('%s')", test_function_name.c_str(), + std::string script = base::StringPrintf( + "%s('%s')", test_function_name.c_str(), test_gallery_url_.c_str()); ASSERT_TRUE(content::ExecuteScriptAndExtractBool( browser()->tab_strip_model()->GetActiveWebContents(), @@ -100,7 +101,7 @@ class WebstoreStartupInstallerTest : public InProcessBrowserTest { bool RunIndexedTest(const std::string& test_function_name, int i) { std::string result = "FAILED"; - std::string script = StringPrintf("%s('%s', %d)", + std::string script = base::StringPrintf("%s('%s', %d)", test_function_name.c_str(), test_gallery_url_.c_str(), i); EXPECT_TRUE(content::ExecuteScriptAndExtractString( browser()->tab_strip_model()->GetActiveWebContents(), diff --git a/chrome/browser/extensions/window_open_apitest.cc b/chrome/browser/extensions/window_open_apitest.cc index 0a3c8cb..978f77c 100644 --- a/chrome/browser/extensions/window_open_apitest.cc +++ b/chrome/browser/extensions/window_open_apitest.cc @@ -63,8 +63,8 @@ bool WaitForTabsAndPopups(Browser* browser, int num_popups, int num_panels) { SCOPED_TRACE( - StringPrintf("WaitForTabsAndPopups tabs:%d, popups:%d, panels:%d", - num_tabs, num_popups, num_panels)); + base::StringPrintf("WaitForTabsAndPopups tabs:%d, popups:%d, panels:%d", + num_tabs, num_popups, num_panels)); // We start with one tab and one browser already open. ++num_tabs; size_t num_browsers = static_cast<size_t>(num_popups) + 1; diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index fcb8aca..374a6cb 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -130,7 +130,8 @@ class HistoryBackendDBTest : public HistoryUnitTestBase { base::FilePath data_path; ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); data_path = data_path.AppendASCII("History"); - data_path = data_path.AppendASCII(StringPrintf("history.%d.sql", version)); + data_path = + data_path.AppendASCII(base::StringPrintf("history.%d.sql", version)); ASSERT_NO_FATAL_FAILURE( ExecuteSQLScript(data_path, history_dir_.Append( chrome::kHistoryFilename))); diff --git a/chrome/browser/history/redirect_browsertest.cc b/chrome/browser/history/redirect_browsertest.cc index b0547de..0f56a71 100644 --- a/chrome/browser/history/redirect_browsertest.cc +++ b/chrome/browser/history/redirect_browsertest.cc @@ -122,7 +122,7 @@ IN_PROC_BROWSER_TEST_F(RedirectTest, ClientEmptyReferer) { // test server. GURL final_url = test_server()->GetURL(std::string()); ASSERT_TRUE(final_url.is_valid()); - std::string file_redirect_contents = StringPrintf( + std::string file_redirect_contents = base::StringPrintf( "<html>" "<head></head>" "<body onload=\"document.location='%s'\"></body>" diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc index bc86d95..0535cf6 100644 --- a/chrome/browser/importer/firefox_importer_utils.cc +++ b/chrome/browser/importer/firefox_importer_utils.cc @@ -56,7 +56,7 @@ base::FilePath GetFirefoxProfilePath() { base::FilePath source_path; for (int i = 0; ; ++i) { - std::string current_profile = StringPrintf("Profile%d", i); + std::string current_profile = base::StringPrintf("Profile%d", i); if (!root.HasKey(current_profile)) { // Profiles are continuously numbered. So we exit when we can't // find the i-th one. diff --git a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc index 97d3fdd..5657f00 100644 --- a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc +++ b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc @@ -511,7 +511,7 @@ void ProfileState::CheckGalleries( registry->GetMediaFileSystemsForExtension( rvh, no_permissions_extension_.get(), base::Bind(&ProfileState::CompareResults, base::Unretained(this), - StringPrintf("%s (no permission)", test.c_str()), + base::StringPrintf("%s (no permission)", test.c_str()), base::ConstRef(empty_expectation))); MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1, GetAndClearComparisonCount()); @@ -520,7 +520,7 @@ void ProfileState::CheckGalleries( registry->GetMediaFileSystemsForExtension( rvh, regular_permission_extension_.get(), base::Bind(&ProfileState::CompareResults, base::Unretained(this), - StringPrintf("%s (regular permission)", test.c_str()), + base::StringPrintf("%s (regular permission)", test.c_str()), base::ConstRef(regular_extension_galleries))); MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1, GetAndClearComparisonCount()); @@ -529,7 +529,7 @@ void ProfileState::CheckGalleries( registry->GetMediaFileSystemsForExtension( rvh, all_permission_extension_.get(), base::Bind(&ProfileState::CompareResults, base::Unretained(this), - StringPrintf("%s (all permission)", test.c_str()), + base::StringPrintf("%s (all permission)", test.c_str()), base::ConstRef(all_extension_galleries))); MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1, GetAndClearComparisonCount()); diff --git a/chrome/browser/notifications/notification_object_proxy.cc b/chrome/browser/notifications/notification_object_proxy.cc index f918724..dd07b51 100644 --- a/chrome/browser/notifications/notification_object_proxy.cc +++ b/chrome/browser/notifications/notification_object_proxy.cc @@ -46,8 +46,8 @@ void NotificationObjectProxy::Click() { } std::string NotificationObjectProxy::id() const { - return StringPrintf("%d:%d:%d:%d", process_id_, route_id_, - notification_id_, worker_); + return base::StringPrintf("%d:%d:%d:%d", process_id_, route_id_, + notification_id_, worker_); } RenderViewHost* NotificationObjectProxy::GetRenderViewHost() const { diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc index ff974cb..5a0b688 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x.cc +++ b/chrome/browser/password_manager/native_backend_gnome_x.cc @@ -695,7 +695,7 @@ std::string NativeBackendGnome::GetProfileSpecificAppString() const { // Originally, the application string was always just "chrome" and used only // so that we had *something* to search for since GNOME Keyring won't search // for nothing. Now we use it to distinguish passwords for different profiles. - return StringPrintf("%s-%d", kGnomeKeyringAppString, profile_id_); + return base::StringPrintf("%s-%d", kGnomeKeyringAppString, profile_id_); } void NativeBackendGnome::MigrateToProfileSpecificLogins() { diff --git a/chrome/browser/performance_monitor/key_builder.cc b/chrome/browser/performance_monitor/key_builder.cc index 53b46cd..df740bb 100644 --- a/chrome/browser/performance_monitor/key_builder.cc +++ b/chrome/browser/performance_monitor/key_builder.cc @@ -174,46 +174,46 @@ void KeyBuilder::PopulateKeyMaps() { } std::string KeyBuilder::CreateActiveIntervalKey(const base::Time& time) { - return StringPrintf("%016" PRId64, time.ToInternalValue()); + return base::StringPrintf("%016" PRId64, time.ToInternalValue()); } std::string KeyBuilder::CreateMetricKey(const base::Time& time, const MetricType type, const std::string& activity) { - return StringPrintf("%c%c%016" PRId64 "%c%s", - metric_type_to_metric_key_char_[type], - kDelimiter, time.ToInternalValue(), - kDelimiter, activity.c_str()); + return base::StringPrintf("%c%c%016" PRId64 "%c%s", + metric_type_to_metric_key_char_[type], + kDelimiter, time.ToInternalValue(), + kDelimiter, activity.c_str()); } std::string KeyBuilder::CreateEventKey(const base::Time& time, const EventType type) { - return StringPrintf("%016" PRId64 "%c%c", - time.ToInternalValue(), kDelimiter, - event_type_to_event_key_char_[type]); + return base::StringPrintf("%016" PRId64 "%c%c", + time.ToInternalValue(), kDelimiter, + event_type_to_event_key_char_[type]); } std::string KeyBuilder::CreateRecentKey(const base::Time& time, const MetricType type, const std::string& activity) { - return StringPrintf("%016" PRId64 "%c%c%c%s", - time.ToInternalValue(), - kDelimiter, metric_type_to_metric_key_char_[type], - kDelimiter, activity.c_str()); + return base::StringPrintf("%016" PRId64 "%c%c%c%s", + time.ToInternalValue(), + kDelimiter, metric_type_to_metric_key_char_[type], + kDelimiter, activity.c_str()); } std::string KeyBuilder::CreateRecentMapKey(const MetricType type, const std::string& activity) { - return StringPrintf("%s%c%c", - activity.c_str(), - kDelimiter, metric_type_to_metric_key_char_[type]); + return base::StringPrintf("%s%c%c", + activity.c_str(), + kDelimiter, metric_type_to_metric_key_char_[type]); } std::string KeyBuilder::CreateMaxValueKey(const MetricType type, const std::string& activity) { - return StringPrintf("%c%c%s", - metric_type_to_metric_key_char_[type], - kDelimiter, activity.c_str()); + return base::StringPrintf("%c%c%s", + metric_type_to_metric_key_char_[type], + kDelimiter, activity.c_str()); } EventType KeyBuilder::EventKeyToEventType(const std::string& event_key) { diff --git a/chrome/browser/policy/cloud/user_info_fetcher.cc b/chrome/browser/policy/cloud/user_info_fetcher.cc index 536e788..b51b511 100644 --- a/chrome/browser/policy/cloud/user_info_fetcher.cc +++ b/chrome/browser/policy/cloud/user_info_fetcher.cc @@ -22,7 +22,7 @@ static const char kAuthorizationHeaderFormat[] = "Authorization: Bearer %s"; static std::string MakeAuthorizationHeader(const std::string& auth_token) { - return StringPrintf(kAuthorizationHeaderFormat, auth_token.c_str()); + return base::StringPrintf(kAuthorizationHeaderFormat, auth_token.c_str()); } } // namespace diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index 8aad6b1..ab39a6b 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc @@ -1274,7 +1274,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionInstallForcelist) { // Setting the forcelist extension should install "good.crx". base::ListValue forcelist; - forcelist.Append(base::Value::CreateStringValue(StringPrintf( + forcelist.Append(base::Value::CreateStringValue(base::StringPrintf( "%s;%s", kGoodCrxId, url.spec().c_str()))); PolicyMap policies; policies.Set(key::kExtensionInstallForcelist, POLICY_LEVEL_MANDATORY, diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc index c991975..cc183c36 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor.cc @@ -330,8 +330,8 @@ void AutocompleteActionPredictor::OnOmniboxOpenedUrl( const AutocompleteMatch& match = log.result.match_at(log.selected_index); UMA_HISTOGRAM_BOOLEAN( - StringPrintf("Prerender.OmniboxNavigationsCouldPrerender%s", - prerender::PrerenderManager::GetModeString()).c_str(), + base::StringPrintf("Prerender.OmniboxNavigationsCouldPrerender%s", + prerender::PrerenderManager::GetModeString()).c_str(), prerender::IsOmniboxEnabled(profile_)); const GURL& opened_url = match.destination_url; diff --git a/chrome/browser/prerender/prerender_histograms.cc b/chrome/browser/prerender/prerender_histograms.cc index 73061c3..d836cf8 100644 --- a/chrome/browser/prerender/prerender_histograms.cc +++ b/chrome/browser/prerender/prerender_histograms.cc @@ -162,8 +162,8 @@ void PrerenderHistograms::RecordPrerender(Origin origin, const GURL& url) { void PrerenderHistograms::RecordPrerenderStarted(Origin origin) const { if (OriginIsOmnibox(origin)) { UMA_HISTOGRAM_ENUMERATION( - StringPrintf("Prerender.OmniboxPrerenderCount%s", - PrerenderManager::GetModeString()), 1, 2); + base::StringPrintf("Prerender.OmniboxPrerenderCount%s", + PrerenderManager::GetModeString()), 1, 2); } } @@ -171,16 +171,16 @@ void PrerenderHistograms::RecordConcurrency(size_t prerender_count) const { static const size_t kMaxRecordableConcurrency = 20; DCHECK_GE(kMaxRecordableConcurrency, Config().max_link_concurrency); UMA_HISTOGRAM_ENUMERATION( - StringPrintf("Prerender.PrerenderCountOf%" PRIuS "Max", - kMaxRecordableConcurrency), + base::StringPrintf("Prerender.PrerenderCountOf%" PRIuS "Max", + kMaxRecordableConcurrency), prerender_count, kMaxRecordableConcurrency + 1); } void PrerenderHistograms::RecordUsedPrerender(Origin origin) const { if (OriginIsOmnibox(origin)) { UMA_HISTOGRAM_ENUMERATION( - StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s", - PrerenderManager::GetModeString()), 1, 2); + base::StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s", + PrerenderManager::GetModeString()), 1, 2); } } diff --git a/chrome/browser/printing/cloud_print/cloud_print_url.cc b/chrome/browser/printing/cloud_print/cloud_print_url.cc index f710380..ce133f6 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_url.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_url.cc @@ -90,7 +90,7 @@ GURL CloudPrintURL::GetCloudPrintServiceEnableURL( "/enable_chrome_connector/enable.html"); GURL::Replacements replacements; replacements.SetPathStr(path); - std::string query = StringPrintf("proxy=%s", proxy_id.c_str()); + std::string query = base::StringPrintf("proxy=%s", proxy_id.c_str()); replacements.SetQueryStr(query); GURL cloud_print_enable_url = cloud_print_service_url.ReplaceComponents( replacements); diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc index 8770f10..18c56a2 100644 --- a/chrome/browser/profiles/profile_info_cache.cc +++ b/chrome/browser/profiles/profile_info_cache.cc @@ -710,7 +710,7 @@ int ProfileInfoCache::GetDefaultAvatarIconResourceIDAtIndex(size_t index) { // static std::string ProfileInfoCache::GetDefaultAvatarIconUrl(size_t index) { DCHECK(IsDefaultAvatarIconIndex(index)); - return StringPrintf("%s%" PRIuS, kDefaultUrlPrefix, index); + return base::StringPrintf("%s%" PRIuS, kDefaultUrlPrefix, index); } // static diff --git a/chrome/browser/profiles/profile_info_cache_unittest.cc b/chrome/browser/profiles/profile_info_cache_unittest.cc index e7b7fef..b907e35 100644 --- a/chrome/browser/profiles/profile_info_cache_unittest.cc +++ b/chrome/browser/profiles/profile_info_cache_unittest.cc @@ -119,8 +119,9 @@ TEST_F(ProfileInfoCacheTest, AddProfiles) { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); for (uint32 i = 0; i < 4; ++i) { - base::FilePath profile_path = GetProfilePath(StringPrintf("path_%ud", i)); - string16 profile_name = ASCIIToUTF16(StringPrintf("name_%ud", i)); + base::FilePath profile_path = + GetProfilePath(base::StringPrintf("path_%ud", i)); + string16 profile_name = ASCIIToUTF16(base::StringPrintf("name_%ud", i)); const SkBitmap* icon = rb.GetImageNamed( ProfileInfoCache::GetDefaultAvatarIconResourceIDAtIndex( i)).ToSkBitmap(); @@ -128,7 +129,7 @@ TEST_F(ProfileInfoCacheTest, AddProfiles) { GetCache()->AddProfileToCache(profile_path, profile_name, string16(), i, false); GetCache()->SetBackgroundStatusOfProfileAtIndex(i, true); - string16 gaia_name = ASCIIToUTF16(StringPrintf("gaia_%ud", i)); + string16 gaia_name = ASCIIToUTF16(base::StringPrintf("gaia_%ud", i)); GetCache()->SetGAIANameOfProfileAtIndex(i, gaia_name); EXPECT_EQ(i + 1, GetCache()->GetNumberOfProfiles()); @@ -145,13 +146,14 @@ TEST_F(ProfileInfoCacheTest, AddProfiles) { EXPECT_EQ(4u, GetCache()->GetNumberOfProfiles()); for (uint32 i = 0; i < 4; ++i) { - base::FilePath profile_path = GetProfilePath(StringPrintf("path_%ud", i)); + base::FilePath profile_path = + GetProfilePath(base::StringPrintf("path_%ud", i)); EXPECT_EQ(i, GetCache()->GetIndexOfProfileWithPath(profile_path)); - string16 profile_name = ASCIIToUTF16(StringPrintf("name_%ud", i)); + string16 profile_name = ASCIIToUTF16(base::StringPrintf("name_%ud", i)); EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(i)); EXPECT_EQ(i, GetCache()->GetAvatarIconIndexOfProfileAtIndex(i)); EXPECT_EQ(true, GetCache()->GetBackgroundStatusOfProfileAtIndex(i)); - string16 gaia_name = ASCIIToUTF16(StringPrintf("gaia_%ud", i)); + string16 gaia_name = ASCIIToUTF16(base::StringPrintf("gaia_%ud", i)); EXPECT_EQ(gaia_name, GetCache()->GetGAIANameOfProfileAtIndex(i)); } } diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index 1449f54..35f0a2f 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc @@ -606,7 +606,7 @@ std::string ProfileIOData::GetSSLSessionCacheShard() { // new profile, we'll get a fresh SSL session cache which is separate from // the other profiles. static unsigned ssl_session_cache_instance = 0; - return StringPrintf("profile/%u", ssl_session_cache_instance++); + return base::StringPrintf("profile/%u", ssl_session_cache_instance++); } void ProfileIOData::Init(content::ProtocolHandlerMap* protocol_handlers) const { diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc index c00d714..9433f89 100644 --- a/chrome/browser/safe_browsing/browser_feature_extractor.cc +++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc @@ -59,10 +59,10 @@ static void AddNavigationFeatures( NavigationEntry* entry = controller.GetEntryAtIndex(index); bool is_secure_referrer = entry->GetReferrer().url.SchemeIsSecure(); if (!is_secure_referrer) { - AddFeature(StringPrintf("%s%s=%s", - feature_prefix.c_str(), - features::kReferrer, - entry->GetReferrer().url.spec().c_str()), + AddFeature(base::StringPrintf("%s%s=%s", + feature_prefix.c_str(), + features::kReferrer, + entry->GetReferrer().url.spec().c_str()), 1.0, request); } @@ -102,11 +102,11 @@ static void AddNavigationFeatures( if (redirect_chain[i].SchemeIsSecure()) { printable_redirect = features::kSecureRedirectValue; } - AddFeature(StringPrintf("%s%s[%"PRIuS"]=%s", - feature_prefix.c_str(), - features::kRedirect, - i, - printable_redirect.c_str()), + AddFeature(base::StringPrintf("%s%s[%"PRIuS"]=%s", + feature_prefix.c_str(), + features::kRedirect, + i, + printable_redirect.c_str()), 1.0, request); } diff --git a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc index c31887e..a9e962a 100644 --- a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc +++ b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc @@ -302,19 +302,19 @@ TEST_F(BrowserFeatureExtractorTest, BrowseFeatures) { GetFeatureMap(request, &features); EXPECT_EQ(1.0, - features[StringPrintf("%s=%s", - features::kReferrer, - "http://google.com/")]); + features[base::StringPrintf("%s=%s", + features::kReferrer, + "http://google.com/")]); EXPECT_EQ(1.0, - features[StringPrintf("%s[0]=%s", - features::kRedirect, - "http://somerandomwebsite.com/")]); + features[base::StringPrintf("%s[0]=%s", + features::kRedirect, + "http://somerandomwebsite.com/")]); // We shouldn't have a feature for the last redirect in the chain, since it // should always be the URL that we navigated to. EXPECT_EQ(0.0, - features[StringPrintf("%s[1]=%s", - features::kRedirect, - "http://foo.com/")]); + features[base::StringPrintf("%s[1]=%s", + features::kRedirect, + "http://foo.com/")]); EXPECT_EQ(0.0, features[features::kHasSSLReferrer]); EXPECT_EQ(2.0, features[features::kPageTransitionType]); EXPECT_EQ(1.0, features[features::kIsFirstNavigation]); @@ -341,38 +341,38 @@ TEST_F(BrowserFeatureExtractorTest, BrowseFeatures) { GetFeatureMap(request, &features); EXPECT_EQ(1, - features[StringPrintf("%s=%s", - features::kReferrer, - "http://www.foo.com/")]); + features[base::StringPrintf("%s=%s", + features::kReferrer, + "http://www.foo.com/")]); EXPECT_EQ(1.0, - features[StringPrintf("%s[0]=%s", - features::kRedirect, - "http://www.foo.com/redirect")]); + features[base::StringPrintf("%s[0]=%s", + features::kRedirect, + "http://www.foo.com/redirect")]); EXPECT_EQ(1.0, - features[StringPrintf("%s[1]=%s", - features::kRedirect, - "http://www.foo.com/second_redirect")]); + features[base::StringPrintf("%s[1]=%s", + features::kRedirect, + "http://www.foo.com/second_redirect")]); EXPECT_EQ(0.0, features[features::kHasSSLReferrer]); EXPECT_EQ(1.0, features[features::kPageTransitionType]); EXPECT_EQ(0.0, features[features::kIsFirstNavigation]); EXPECT_EQ(1.0, - features[StringPrintf("%s%s=%s", - features::kHostPrefix, - features::kReferrer, - "http://google.com/")]); + features[base::StringPrintf("%s%s=%s", + features::kHostPrefix, + features::kReferrer, + "http://google.com/")]); EXPECT_EQ(1.0, - features[StringPrintf("%s%s[0]=%s", - features::kHostPrefix, - features::kRedirect, - "http://somerandomwebsite.com/")]); + features[base::StringPrintf("%s%s[0]=%s", + features::kHostPrefix, + features::kRedirect, + "http://somerandomwebsite.com/")]); EXPECT_EQ(2.0, - features[StringPrintf("%s%s", - features::kHostPrefix, - features::kPageTransitionType)]); + features[base::StringPrintf("%s%s", + features::kHostPrefix, + features::kPageTransitionType)]); EXPECT_EQ(1.0, - features[StringPrintf("%s%s", - features::kHostPrefix, - features::kIsFirstNavigation)]); + features[base::StringPrintf("%s%s", + features::kHostPrefix, + features::kIsFirstNavigation)]); EXPECT_EQ(404.0, features[features::kHttpStatusCode]); request.Clear(); @@ -394,26 +394,26 @@ TEST_F(BrowserFeatureExtractorTest, BrowseFeatures) { GetFeatureMap(request, &features); EXPECT_EQ(1.0, - features[StringPrintf("%s=%s", - features::kReferrer, - "http://www.foo.com/page.html")]); + features[base::StringPrintf("%s=%s", + features::kReferrer, + "http://www.foo.com/page.html")]); EXPECT_EQ(1.0, - features[StringPrintf("%s[0]=%s", - features::kRedirect, - "http://www.foo.com/page.html")]); + features[base::StringPrintf("%s[0]=%s", + features::kRedirect, + "http://www.foo.com/page.html")]); EXPECT_EQ(0.0, features[features::kHasSSLReferrer]); EXPECT_EQ(0.0, features[features::kPageTransitionType]); EXPECT_EQ(0.0, features[features::kIsFirstNavigation]); // Should not have host features. EXPECT_EQ(0U, - features.count(StringPrintf("%s%s", - features::kHostPrefix, - features::kPageTransitionType))); + features.count(base::StringPrintf("%s%s", + features::kHostPrefix, + features::kPageTransitionType))); EXPECT_EQ(0U, - features.count(StringPrintf("%s%s", - features::kHostPrefix, - features::kIsFirstNavigation))); + features.count(base::StringPrintf("%s%s", + features::kHostPrefix, + features::kIsFirstNavigation))); request.Clear(); request.set_url("http://www.bar.com/other_page.html"); @@ -430,30 +430,30 @@ TEST_F(BrowserFeatureExtractorTest, BrowseFeatures) { GetFeatureMap(request, &features); EXPECT_EQ(1.0, - features[StringPrintf("%s=%s", - features::kReferrer, - "http://www.bar.com/")]); + features[base::StringPrintf("%s=%s", + features::kReferrer, + "http://www.bar.com/")]); EXPECT_EQ(0.0, features[features::kHasSSLReferrer]); EXPECT_EQ(0.0, features[features::kPageTransitionType]); EXPECT_EQ(0.0, features[features::kIsFirstNavigation]); EXPECT_EQ(1.0, - features[StringPrintf("%s%s=%s", - features::kHostPrefix, - features::kReferrer, - "http://www.foo.com/page.html")]); + features[base::StringPrintf("%s%s=%s", + features::kHostPrefix, + features::kReferrer, + "http://www.foo.com/page.html")]); EXPECT_EQ(1.0, - features[StringPrintf("%s%s[0]=%s", - features::kHostPrefix, - features::kRedirect, - "http://www.foo.com/page.html")]); + features[base::StringPrintf("%s%s[0]=%s", + features::kHostPrefix, + features::kRedirect, + "http://www.foo.com/page.html")]); EXPECT_EQ(0.0, - features[StringPrintf("%s%s", - features::kHostPrefix, - features::kPageTransitionType)]); + features[base::StringPrintf("%s%s", + features::kHostPrefix, + features::kPageTransitionType)]); EXPECT_EQ(0.0, - features[StringPrintf("%s%s", - features::kHostPrefix, - features::kIsFirstNavigation)]); + features[base::StringPrintf("%s%s", + features::kHostPrefix, + features::kIsFirstNavigation)]); request.Clear(); request.set_url("http://www.baz.com/"); request.set_client_score(0.5); @@ -475,20 +475,20 @@ TEST_F(BrowserFeatureExtractorTest, BrowseFeatures) { GetFeatureMap(request, &features); EXPECT_EQ(1.0, - features[StringPrintf("%s[0]=%s", - features::kRedirect, - features::kSecureRedirectValue)]); + features[base::StringPrintf("%s[0]=%s", + features::kRedirect, + features::kSecureRedirectValue)]); EXPECT_EQ(1.0, features[features::kHasSSLReferrer]); EXPECT_EQ(5.0, features[features::kPageTransitionType]); // Should not have redirect or host features. EXPECT_EQ(0U, - features.count(StringPrintf("%s%s", - features::kHostPrefix, - features::kPageTransitionType))); + features.count(base::StringPrintf("%s%s", + features::kHostPrefix, + features::kPageTransitionType))); EXPECT_EQ(0U, - features.count(StringPrintf("%s%s", - features::kHostPrefix, - features::kIsFirstNavigation))); + features.count(base::StringPrintf("%s%s", + features::kHostPrefix, + features::kIsFirstNavigation))); EXPECT_EQ(5.0, features[features::kPageTransitionType]); EXPECT_EQ(1.0, features[std::string(features::kBadIpFetch) + "193.5.163.8"]); EXPECT_FALSE(features.count(std::string(features::kBadIpFetch) + @@ -511,12 +511,14 @@ TEST_F(BrowserFeatureExtractorTest, SafeBrowsingFeatures) { ExtractFeatures(&request); std::map<std::string, double> features; GetFeatureMap(request, &features); - EXPECT_TRUE(features.count(StringPrintf("%s%s", - features::kSafeBrowsingMaliciousUrl, - "http://www.malware.com/"))); - EXPECT_TRUE(features.count(StringPrintf("%s%s", - features::kSafeBrowsingOriginalUrl, - "http://www.good.com/"))); + EXPECT_TRUE(features.count(base::StringPrintf( + "%s%s", + features::kSafeBrowsingMaliciousUrl, + "http://www.malware.com/"))); + EXPECT_TRUE(features.count(base::StringPrintf( + "%s%s", + features::kSafeBrowsingOriginalUrl, + "http://www.good.com/"))); EXPECT_DOUBLE_EQ(1.0, features[features::kSafeBrowsingIsSubresource]); EXPECT_DOUBLE_EQ(2.0, features[features::kSafeBrowsingThreatType]); } diff --git a/chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc b/chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc index c39742a..1c6675c 100644 --- a/chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc +++ b/chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc @@ -592,8 +592,8 @@ TEST_F(PersistentTabRestoreServiceTest, PruneEntries) { for (size_t i = 0; i < max_entries + 5; i++) { TabNavigation navigation = SessionTypesTestHelper::CreateNavigation( - StringPrintf("http://%d", static_cast<int>(i)), - StringPrintf("%d", static_cast<int>(i))); + base::StringPrintf("http://%d", static_cast<int>(i)), + base::StringPrintf("%d", static_cast<int>(i))); Tab* tab = new Tab(); tab->navigations.push_back(navigation); @@ -683,7 +683,8 @@ TEST_F(PersistentTabRestoreServiceTest, PruneIsCalled) { const size_t max_entries = kMaxEntries; for (size_t i = 0; i < max_entries + 5; i++) { - NavigateAndCommit(GURL(StringPrintf("http://%d", static_cast<int>(i)))); + NavigateAndCommit( + GURL(base::StringPrintf("http://%d", static_cast<int>(i)))); service_->CreateHistoricalTab(web_contents(), -1); } diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index ef253aa..9ead4e6 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -576,11 +576,11 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestWSSInvalidCertAndClose) { watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); // Create GURLs to test pages. - std::string masterUrlPath = StringPrintf("%s?%d", + std::string masterUrlPath = base::StringPrintf("%s?%d", test_server()->GetURL("files/ssl/wss_close.html").spec().c_str(), wss_server_expired_.host_port_pair().port()); GURL masterUrl(masterUrlPath); - std::string slaveUrlPath = StringPrintf("%s?%d", + std::string slaveUrlPath = base::StringPrintf("%s?%d", test_server()->GetURL("files/ssl/wss_close_slave.html").spec().c_str(), wss_server_expired_.host_port_pair().port()); GURL slaveUrl(slaveUrlPath); diff --git a/chrome/browser/sync/test/integration/bookmarks_helper.cc b/chrome/browser/sync/test/integration/bookmarks_helper.cc index 49ca45d..cf4d9dd 100644 --- a/chrome/browser/sync/test/integration/bookmarks_helper.cc +++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc @@ -736,23 +736,23 @@ gfx::Image Create1xFaviconFromPNGFile(const std::string& path) { } std::string IndexedURL(int i) { - return StringPrintf("http://www.host.ext:1234/path/filename/%d", i); + return base::StringPrintf("http://www.host.ext:1234/path/filename/%d", i); } std::wstring IndexedURLTitle(int i) { - return StringPrintf(L"URL Title %d", i); + return base::StringPrintf(L"URL Title %d", i); } std::wstring IndexedFolderName(int i) { - return StringPrintf(L"Folder Name %d", i); + return base::StringPrintf(L"Folder Name %d", i); } std::wstring IndexedSubfolderName(int i) { - return StringPrintf(L"Subfolder Name %d", i); + return base::StringPrintf(L"Subfolder Name %d", i); } std::wstring IndexedSubsubfolderName(int i) { - return StringPrintf(L"Subsubfolder Name %d", i); + return base::StringPrintf(L"Subsubfolder Name %d", i); } } // namespace bookmarks_helper diff --git a/chrome/browser/sync/test/integration/multiple_client_bookmarks_sync_test.cc b/chrome/browser/sync/test/integration/multiple_client_bookmarks_sync_test.cc index f51e8dc..cb6f8ae 100644 --- a/chrome/browser/sync/test/integration/multiple_client_bookmarks_sync_test.cc +++ b/chrome/browser/sync/test/integration/multiple_client_bookmarks_sync_test.cc @@ -24,7 +24,7 @@ IN_PROC_BROWSER_TEST_F(MultipleClientBookmarksSyncTest, Sanity) { DisableVerifier(); for (int i = 0; i < num_clients(); ++i) { ASSERT_TRUE(AddURL(i, base::StringPrintf(L"Google URL %d", i), - GURL(StringPrintf("http://www.google.com/%d", i))) != NULL); + GURL(base::StringPrintf("http://www.google.com/%d", i))) != NULL); } ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(AllModelsMatch()); diff --git a/chrome/browser/sync/test/integration/multiple_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/multiple_client_sessions_sync_test.cc index a9a4272..ec2b8bb 100644 --- a/chrome/browser/sync/test/integration/multiple_client_sessions_sync_test.cc +++ b/chrome/browser/sync/test/integration/multiple_client_sessions_sync_test.cc @@ -46,7 +46,7 @@ IN_PROC_BROWSER_TEST_F(MultipleClientSessionsSyncTest, MAYBE_AllChanged) { for (int i = 0; i < num_clients(); ++i) { SessionWindowMap windows; ASSERT_TRUE(OpenTabAndGetLocalWindows( - i, GURL(StringPrintf("http://127.0.0.1/bubba%i", i)), &windows)); + i, GURL(base::StringPrintf("http://127.0.0.1/bubba%i", i)), &windows)); client_windows[i].Reset(&windows); } @@ -82,7 +82,7 @@ IN_PROC_BROWSER_TEST_F(MultipleClientSessionsSyncTest, for (int i = 0; i < num_clients(); ++i) { SessionWindowMap windows; ASSERT_TRUE(OpenTabAndGetLocalWindows( - i, GURL(StringPrintf("http://127.0.0.1/bubba%i", i)), &windows)); + i, GURL(base::StringPrintf("http://127.0.0.1/bubba%i", i)), &windows)); client_windows[i].Reset(&windows); } diff --git a/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc index eae7eef..5168a59 100644 --- a/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc @@ -135,7 +135,7 @@ const std::string AutofillSyncPerfTest::NextGUID() { } const std::string AutofillSyncPerfTest::IntToGUID(int n) { - return StringPrintf("00000000-0000-0000-0000-%012X", n); + return base::StringPrintf("00000000-0000-0000-0000-%012X", n); } const std::string AutofillSyncPerfTest::NextName() { @@ -143,7 +143,7 @@ const std::string AutofillSyncPerfTest::NextName() { } const std::string AutofillSyncPerfTest::IntToName(int n) { - return StringPrintf("Name%d", n); + return base::StringPrintf("Name%d", n); } const std::string AutofillSyncPerfTest::NextValue() { @@ -151,7 +151,7 @@ const std::string AutofillSyncPerfTest::NextValue() { } const std::string AutofillSyncPerfTest::IntToValue(int n) { - return StringPrintf("Value%d", n); + return base::StringPrintf("Value%d", n); } void ForceSync(int profile) { diff --git a/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc index 36e6952..affcf86 100644 --- a/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc @@ -112,7 +112,7 @@ GURL SessionsSyncPerfTest::NextURL() { } GURL SessionsSyncPerfTest::IntToURL(int n) { - return GURL(StringPrintf("http://localhost/%d", n)); + return GURL(base::StringPrintf("http://localhost/%d", n)); } // TODO(lipalani): Re-enable after crbug.com/96921 is fixed. diff --git a/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc index af0466d..49e4d8e 100644 --- a/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc @@ -91,7 +91,7 @@ GURL TypedUrlsSyncPerfTest::NextURL() { } GURL TypedUrlsSyncPerfTest::IntToURL(int n) { - return GURL(StringPrintf("http://history%d.google.com/", n)); + return GURL(base::StringPrintf("http://history%d.google.com/", n)); } IN_PROC_BROWSER_TEST_F(TypedUrlsSyncPerfTest, P0) { diff --git a/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc b/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc index 15683b5..4ff23557 100644 --- a/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc @@ -31,27 +31,27 @@ void MutateSomeSettings( { // Write to extension0 from profile 0 but not profile 1. DictionaryValue settings; - settings.SetString("asdf", StringPrintf("asdfasdf-%d", seed)); + settings.SetString("asdf", base::StringPrintf("asdfasdf-%d", seed)); SetExtensionSettings(test()->verifier(), extension0, settings); SetExtensionSettings(test()->GetProfile(0), extension0, settings); } { // Write the same data to extension1 from both profiles. DictionaryValue settings; - settings.SetString("asdf", StringPrintf("asdfasdf-%d", seed)); - settings.SetString("qwer", StringPrintf("qwerqwer-%d", seed)); + settings.SetString("asdf", base::StringPrintf("asdfasdf-%d", seed)); + settings.SetString("qwer", base::StringPrintf("qwerqwer-%d", seed)); SetExtensionSettingsForAllProfiles(extension1, settings); } { // Write different data to extension2 from each profile. DictionaryValue settings0; - settings0.SetString("zxcv", StringPrintf("zxcvzxcv-%d", seed)); + settings0.SetString("zxcv", base::StringPrintf("zxcvzxcv-%d", seed)); SetExtensionSettings(test()->verifier(), extension2, settings0); SetExtensionSettings(test()->GetProfile(0), extension2, settings0); DictionaryValue settings1; - settings1.SetString("1324", StringPrintf("12341234-%d", seed)); - settings1.SetString("5687", StringPrintf("56785678-%d", seed)); + settings1.SetString("1324", base::StringPrintf("12341234-%d", seed)); + settings1.SetString("5687", base::StringPrintf("56785678-%d", seed)); SetExtensionSettings(test()->verifier(), extension2, settings1); SetExtensionSettings(test()->GetProfile(1), extension2, settings1); } diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc index 45db9f0..69d671d 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc @@ -188,13 +188,15 @@ class DriveFileSyncServiceSyncTest : public testing::Test { typedef ResourceIdByTitle::iterator iterator; std::pair<iterator, bool> inserted = resources_.insert(std::make_pair(title, std::string())); - if (inserted.second) - inserted.first->second = StringPrintf("%" PRId64, ++resource_count_); + if (inserted.second) { + inserted.first->second = + base::StringPrintf("%" PRId64, ++resource_count_); + } std::string resource_id = inserted.first->second; fake_sync_client_->PushRemoteChange( kParentResourceId, kAppId, title, resource_id, - StringPrintf("%" PRIx64, base::RandUint64()), + base::StringPrintf("%" PRIx64, base::RandUint64()), false /* deleted */); message_loop_.RunUntilIdle(); } diff --git a/chrome/browser/themes/theme_syncable_service.cc b/chrome/browser/themes/theme_syncable_service.cc index a9b2f5c..db3cb96 100644 --- a/chrome/browser/themes/theme_syncable_service.cc +++ b/chrome/browser/themes/theme_syncable_service.cc @@ -76,8 +76,8 @@ syncer::SyncMergeResult ThemeSyncableService::MergeDataAndStartSyncing( if (initial_sync_data.size() > 1) { sync_error_handler_->CreateAndUploadError( FROM_HERE, - StringPrintf("Received %d theme specifics.", - static_cast<int>(initial_sync_data.size()))); + base::StringPrintf("Received %d theme specifics.", + static_cast<int>(initial_sync_data.size()))); } sync_pb::ThemeSpecifics current_specifics; diff --git a/chrome/browser/ui/ash/event_rewriter_unittest.cc b/chrome/browser/ui/ash/event_rewriter_unittest.cc index 0dd9308..b785f85 100644 --- a/chrome/browser/ui/ash/event_rewriter_unittest.cc +++ b/chrome/browser/ui/ash/event_rewriter_unittest.cc @@ -52,7 +52,7 @@ std::string GetRewrittenEventAsString(EventRewriter* rewriter, InitXKeyEvent(ui_keycode, ui_flags, ui_type, x_keycode, x_state, &xev); ui::KeyEvent keyevent(&xev, false /* is_char */); rewriter->RewriteForTesting(&keyevent); - return StringPrintf( + return base::StringPrintf( "ui_keycode=%d ui_flags=%d ui_type=%d x_keycode=%u x_state=%u x_type=%d", keyevent.key_code(), keyevent.flags(), keyevent.type(), xev.xkey.keycode, xev.xkey.state, xev.xkey.type); @@ -64,7 +64,7 @@ std::string GetExpectedResultAsString(ui::KeyboardCode ui_keycode, KeyCode x_keycode, unsigned int x_state, int x_type) { - return StringPrintf( + return base::StringPrintf( "ui_keycode=%d ui_flags=%d ui_type=%d x_keycode=%u x_state=%u x_type=%d", ui_keycode, ui_flags, ui_type, x_keycode, x_state, x_type); } @@ -2354,7 +2354,7 @@ TEST_F(EventRewriterTest, TestRewriteKeyEventSentByXSendEvent) { xev.xkey.send_event = True; // XSendEvent() always does this. ui::KeyEvent keyevent(&xev, false /* is_char */); rewriter.RewriteForTesting(&keyevent); - rewritten_event = StringPrintf( + rewritten_event = base::StringPrintf( "ui_keycode=%d ui_flags=%d ui_type=%d " "x_keycode=%u x_state=%u x_type=%d", keyevent.key_code(), keyevent.flags(), keyevent.type(), diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc index 8b7a5d7..be483c1 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc @@ -810,7 +810,7 @@ IN_PROC_BROWSER_TEST_F(LauncherAppBrowserTest, OverflowBubble) { int items_added = 0; while (!test.IsOverflowButtonVisible()) { - std::string fake_app_id = StringPrintf("fake_app_%d", items_added); + std::string fake_app_id = base::StringPrintf("fake_app_%d", items_added); PinFakeApp(fake_app_id); ++items_added; diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc index bf73768..205079f 100644 --- a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc @@ -17,7 +17,7 @@ namespace { std::string GetAppLauncherId(ShellWindow* shell_window) { if (shell_window->window_type_is_panel()) - return StringPrintf("panel:%d", shell_window->session_id().id()); + return base::StringPrintf("panel:%d", shell_window->session_id().id()); return shell_window->extension()->id(); } diff --git a/chrome/browser/ui/autofill/autofill_dialog_models.cc b/chrome/browser/ui/autofill/autofill_dialog_models.cc index 65e6c8c..bce0eda 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_models.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_models.cc @@ -190,7 +190,7 @@ int MonthComboboxModel::GetItemCount() const { // static string16 MonthComboboxModel::FormatMonth(int index) { - return ASCIIToUTF16(StringPrintf("%2d", index)); + return ASCIIToUTF16(base::StringPrintf("%2d", index)); } string16 MonthComboboxModel::GetItemAt(int index) { diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc index b7430330..8d84264 100644 --- a/chrome/browser/ui/chrome_pages.cc +++ b/chrome/browser/ui/chrome_pages.cc @@ -42,8 +42,8 @@ void OpenBookmarkManagerWithHash(Browser* browser, NavigateParams params(GetSingletonTabNavigateParams( browser, GURL(kChromeUIBookmarksURL).Resolve( - StringPrintf("/#%s%s", action.c_str(), - base::Int64ToString(node_id).c_str())))); + base::StringPrintf("/#%s%s", action.c_str(), + base::Int64ToString(node_id).c_str())))); params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; ShowSingletonTabOverwritingNTP(browser, params); } diff --git a/chrome/browser/ui/views/about_ipc_dialog.cc b/chrome/browser/ui/views/about_ipc_dialog.cc index 25b100f..f9121db 100644 --- a/chrome/browser/ui/views/about_ipc_dialog.cc +++ b/chrome/browser/ui/views/about_ipc_dialog.cc @@ -296,7 +296,7 @@ void AboutIPCDialog::Log(const IPC::LogData& data) { if (exploded.hour > 12) exploded.hour -= 12; - std::wstring sent_str = StringPrintf(L"%02d:%02d:%02d.%03d", + std::wstring sent_str = base::StringPrintf(L"%02d:%02d:%02d.%03d", exploded.hour, exploded.minute, exploded.second, exploded.millisecond); int count = message_list_.GetItemCount(); @@ -317,13 +317,13 @@ void AboutIPCDialog::Log(const IPC::LogData& data) { sent).InMilliseconds(); // time can go backwards by a few ms (see Time), don't show that. time_to_send = std::max(static_cast<int>(time_to_send), 0); - std::wstring temp = StringPrintf(L"%d", time_to_send); + std::wstring temp = base::StringPrintf(L"%d", time_to_send); message_list_.SetItemText(index, kDispatchColumn, temp.c_str()); int64 time_to_process = (base::Time::FromInternalValue(data.dispatch) - base::Time::FromInternalValue(data.receive)).InMilliseconds(); time_to_process = std::max(static_cast<int>(time_to_process), 0); - temp = StringPrintf(L"%d", time_to_process); + temp = base::StringPrintf(L"%d", time_to_process); message_list_.SetItemText(index, kProcessColumn, temp.c_str()); message_list_.SetItemText(index, kParamsColumn, diff --git a/chrome/browser/ui/views/message_center/web_notification_tray_win_browsertest.cc b/chrome/browser/ui/views/message_center/web_notification_tray_win_browsertest.cc index fb5b995..a7eaf45 100644 --- a/chrome/browser/ui/views/message_center/web_notification_tray_win_browsertest.cc +++ b/chrome/browser/ui/views/message_center/web_notification_tray_win_browsertest.cc @@ -176,7 +176,7 @@ IN_PROC_BROWSER_TEST_F(WebNotificationTrayWinTest, size_t notifications_to_add = NotificationList::kMaxVisibleMessageCenterNotifications + 1; for (size_t i = 0; i < notifications_to_add; ++i) { - std::string id = StringPrintf("test_id%d", static_cast<int>(i)); + std::string id = base::StringPrintf("test_id%d", static_cast<int>(i)); delegate->AddNotification(id); } bool shown = tray->message_center_tray_->ShowMessageCenterBubble(); @@ -200,7 +200,7 @@ IN_PROC_BROWSER_TEST_F(WebNotificationTrayWinTest, ManyPopupNotifications) { size_t notifications_to_add = NotificationList::kMaxVisiblePopupNotifications + 1; for (size_t i = 0; i < notifications_to_add; ++i) { - std::string id = StringPrintf("test_id%d", static_cast<int>(i)); + std::string id = base::StringPrintf("test_id%d", static_cast<int>(i)); delegate->AddNotification(id); } // Hide and reshow the bubble so that it is updated immediately, not delayed. diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc index c3dfe87..5694110 100644 --- a/chrome/browser/ui/webui/about_ui.cc +++ b/chrome/browser/ui/webui/about_ui.cc @@ -108,8 +108,8 @@ const char kStringsJsPath[] = "strings.js"; // redirect solves the problem by eliminating the process transition during the // time that about memory is being computed. std::string GetAboutMemoryRedirectResponse(Profile* profile) { - return StringPrintf("<meta http-equiv=\"refresh\" content=\"0;%s\">", - chrome::kChromeUIMemoryRedirectURL); + return base::StringPrintf("<meta http-equiv=\"refresh\" content=\"0;%s\">", + chrome::kChromeUIMemoryRedirectURL); } // Handling about:memory is complicated enough to encapsulate its related @@ -183,10 +183,10 @@ class ChromeOSTermsHandler } } else { std::string file_path = - StringPrintf(chrome::kEULAPathFormat, locale_.c_str()); + base::StringPrintf(chrome::kEULAPathFormat, locale_.c_str()); if (!file_util::ReadFileToString(base::FilePath(file_path), &contents_)) { // No EULA for given language - try en-US as default. - file_path = StringPrintf(chrome::kEULAPathFormat, "en-US"); + file_path = base::StringPrintf(chrome::kEULAPathFormat, "en-US"); if (!file_util::ReadFileToString(base::FilePath(file_path), &contents_)) { // File with EULA not found, ResponseOnUIThread will load EULA from @@ -315,8 +315,9 @@ std::string AddStringRow(const std::string& name, const std::string& value) { std::string AboutDiscardsRun() { std::string output; AppendHeader(&output, 0, "About discards"); - output.append(StringPrintf("<meta http-equiv=\"refresh\" content=\"2;%s\">", - chrome::kChromeUIDiscardsURL)); + output.append( + base::StringPrintf("<meta http-equiv=\"refresh\" content=\"2;%s\">", + chrome::kChromeUIDiscardsURL)); output.append(WrapWithTag("p", "Discarding a tab...")); g_browser_process->oom_priority_manager()->LogMemoryAndDiscardTab(); AppendFooter(&output); @@ -348,11 +349,11 @@ std::string AboutDiscards(const std::string& path) { } else { output.append("<p>None found. Wait 10 seconds, then refresh.</p>"); } - output.append(StringPrintf("%d discards this session. ", + output.append(base::StringPrintf("%d discards this session. ", oom->discard_count())); - output.append(StringPrintf("<a href='%s%s'>Discard tab now</a>", - chrome::kChromeUIDiscardsURL, - kRunCommand)); + output.append(base::StringPrintf("<a href='%s%s'>Discard tab now</a>", + chrome::kChromeUIDiscardsURL, + kRunCommand)); base::SystemMemoryInfoKB meminfo; base::GetSystemMemoryInfo(&meminfo); @@ -404,7 +405,7 @@ std::string AboutDiscards(const std::string& path) { std::string TransparencyLink(const std::string& label, int value, const std::string& key) { - return StringPrintf("<p>%s</p>" + return base::StringPrintf("<p>%s</p>" "<p>" "<a href='%s%s=%d'>--</a> " "<a href='%s%s=%d'>-</a> " @@ -473,7 +474,7 @@ std::string AboutTransparency(const std::string& path) { output.append(TransparencyLink("Solo window:", TransparencyFromOpacity(ash::FramePainter::kSoloWindowOpacity), kSolo)); - output.append(StringPrintf( + output.append(base::StringPrintf( "<p>Share: %s%s=%d&%s=%d&%s=%d</p>", chrome::kChromeUITransparencyURL, kActive, @@ -688,7 +689,7 @@ std::string AboutStats(const std::string& query) { } else if (query == "raw") { // Dump the raw counters which have changed in text format. data = "<pre>"; - data.append(StringPrintf("Counter changes in the last %ldms\n", + data.append(base::StringPrintf("Counter changes in the last %ldms\n", static_cast<long int>(time_since_last_sample.InMilliseconds()))); for (size_t i = 0; i < counters->GetSize(); ++i) { Value* entry = NULL; diff --git a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc index 7c43efb..f9c2106 100644 --- a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc +++ b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc @@ -97,7 +97,7 @@ void OmniboxUIHandler::AddResultToDictionary(const std::string& prefix, base::DictionaryValue* output) { int i = 0; for (; it != end; ++it, ++i) { - std::string item_prefix(prefix + StringPrintf(".item_%d", i)); + std::string item_prefix(prefix + base::StringPrintf(".item_%d", i)); if (it->provider != NULL) { output->SetString(item_prefix + ".provider_name", it->provider->GetName()); diff --git a/chrome/browser/ui/webui/welcome_ui_android.cc b/chrome/browser/ui/webui/welcome_ui_android.cc index 525284e..0646233 100644 --- a/chrome/browser/ui/webui/welcome_ui_android.cc +++ b/chrome/browser/ui/webui/welcome_ui_android.cc @@ -34,7 +34,7 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui) html_source->AddLocalizedString("settings", IDS_FIRSTRUN_SETTINGS_LINK); std::string locale = g_browser_process->GetApplicationLocale(); - std::string product_tour_url = StringPrintf( + std::string product_tour_url = base::StringPrintf( kProductTourBaseURL, locale.c_str()); html_source->AddString("productTourUrl", product_tour_url); diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc index 399b086..64b667f 100644 --- a/chrome/browser/web_applications/web_app_win.cc +++ b/chrome/browser/web_applications/web_app_win.cc @@ -154,7 +154,7 @@ std::vector<base::FilePath> MatchingShortcutsForProfileAndExtension( base::FilePath shortcut_file = base_path; if (i) { shortcut_file = shortcut_file.InsertBeforeExtensionASCII( - StringPrintf(" (%d)", i)); + base::StringPrintf(" (%d)", i)); } if (file_util::PathExists(shortcut_file) && ShortcutIsForProfile(shortcut_file, profile_path)) { @@ -281,7 +281,7 @@ bool CreatePlatformShortcuts( continue; } else if (unique_number > 0) { shortcut_file = shortcut_file.InsertBeforeExtensionASCII( - StringPrintf(" (%d)", unique_number)); + base::StringPrintf(" (%d)", unique_number)); } base::win::ShortcutProperties shortcut_properties; diff --git a/chrome/common/cloud_print/cloud_print_helpers.cc b/chrome/common/cloud_print/cloud_print_helpers.cc index 84e4320..28096c8 100644 --- a/chrome/common/cloud_print/cloud_print_helpers.cc +++ b/chrome/common/cloud_print/cloud_print_helpers.cc @@ -76,7 +76,7 @@ GURL GetUrlForPrinterList(const GURL& cloud_print_server_url, std::string path(AppendPathToUrl(cloud_print_server_url, "list")); GURL::Replacements replacements; replacements.SetPathStr(path); - std::string query = StringPrintf("proxy=%s", proxy_id.c_str()); + std::string query = base::StringPrintf("proxy=%s", proxy_id.c_str()); replacements.SetQueryStr(query); return cloud_print_server_url.ReplaceComponents(replacements); } @@ -93,7 +93,7 @@ GURL GetUrlForPrinterUpdate(const GURL& cloud_print_server_url, std::string path(AppendPathToUrl(cloud_print_server_url, "update")); GURL::Replacements replacements; replacements.SetPathStr(path); - std::string query = StringPrintf("printerid=%s", printer_id.c_str()); + std::string query = base::StringPrintf("printerid=%s", printer_id.c_str()); replacements.SetQueryStr(query); return cloud_print_server_url.ReplaceComponents(replacements); } @@ -104,7 +104,7 @@ GURL GetUrlForPrinterDelete(const GURL& cloud_print_server_url, std::string path(AppendPathToUrl(cloud_print_server_url, "delete")); GURL::Replacements replacements; replacements.SetPathStr(path); - std::string query = StringPrintf( + std::string query = base::StringPrintf( "printerid=%s&reason=%s", printer_id.c_str(), reason.c_str()); replacements.SetQueryStr(query); return cloud_print_server_url.ReplaceComponents(replacements); @@ -116,7 +116,7 @@ GURL GetUrlForJobFetch(const GURL& cloud_print_server_url, std::string path(AppendPathToUrl(cloud_print_server_url, "fetch")); GURL::Replacements replacements; replacements.SetPathStr(path); - std::string query = StringPrintf( + std::string query = base::StringPrintf( "printerid=%s&deb=%s", printer_id.c_str(), reason.c_str()); replacements.SetQueryStr(query); return cloud_print_server_url.ReplaceComponents(replacements); @@ -128,7 +128,7 @@ GURL GetUrlForJobDelete(const GURL& cloud_print_server_url, std::string path(AppendPathToUrl(cloud_print_server_url, "deletejob")); GURL::Replacements replacements; replacements.SetPathStr(path); - std::string query = StringPrintf("jobid=%s", job_id.c_str()); + std::string query = base::StringPrintf("jobid=%s", job_id.c_str()); replacements.SetQueryStr(query); return cloud_print_server_url.ReplaceComponents(replacements); } @@ -139,7 +139,7 @@ GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, std::string path(AppendPathToUrl(cloud_print_server_url, "control")); GURL::Replacements replacements; replacements.SetPathStr(path); - std::string query = StringPrintf( + std::string query = base::StringPrintf( "jobid=%s&status=%s", job_id.c_str(), status_string.c_str()); replacements.SetQueryStr(query); return cloud_print_server_url.ReplaceComponents(replacements); @@ -150,7 +150,7 @@ GURL GetUrlForUserMessage(const GURL& cloud_print_server_url, std::string path(AppendPathToUrl(cloud_print_server_url, "message")); GURL::Replacements replacements; replacements.SetPathStr(path); - std::string query = StringPrintf("code=%s", message_id.c_str()); + std::string query = base::StringPrintf("code=%s", message_id.c_str()); replacements.SetQueryStr(query); return cloud_print_server_url.ReplaceComponents(replacements); } @@ -163,9 +163,9 @@ GURL GetUrlForGetAuthCode(const GURL& cloud_print_server_url, std::string path(AppendPathToUrl(cloud_print_server_url, "createrobot")); GURL::Replacements replacements; replacements.SetPathStr(path); - std::string query = StringPrintf("oauth_client_id=%s&proxy=%s", - oauth_client_id.c_str(), - proxy_id.c_str()); + std::string query = base::StringPrintf("oauth_client_id=%s&proxy=%s", + oauth_client_id.c_str(), + proxy_id.c_str()); replacements.SetQueryStr(query); return cloud_print_server_url.ReplaceComponents(replacements); } @@ -197,15 +197,15 @@ void AddMultipartValueForUpload(const std::string& value_name, // First line is the boundary post_data->append("--" + mime_boundary + "\r\n"); // Next line is the Content-disposition - post_data->append(StringPrintf("Content-Disposition: form-data; " + post_data->append(base::StringPrintf("Content-Disposition: form-data; " "name=\"%s\"\r\n", value_name.c_str())); if (!content_type.empty()) { // If Content-type is specified, the next line is that - post_data->append(StringPrintf("Content-Type: %s\r\n", + post_data->append(base::StringPrintf("Content-Type: %s\r\n", content_type.c_str())); } // Leave an empty line and append the value. - post_data->append(StringPrintf("\r\n%s\r\n", value.c_str())); + post_data->append(base::StringPrintf("\r\n%s\r\n", value.c_str())); } std::string GetMultipartMimeType(const std::string& mime_boundary) { @@ -239,12 +239,12 @@ std::string GetPostDataForPrinterTags( NOTREACHED(); } // All our tags have a special prefix to identify them as such. - std::string msg = StringPrintf("%s%s=%s", + std::string msg = base::StringPrintf("%s%s=%s", proxy_tag_prefix.c_str(), it->first.c_str(), it->second.c_str()); AddMultipartValueForUpload(kPrinterTagValue, msg, mime_boundary, std::string(), &post_data); } - std::string tags_hash_msg = StringPrintf("%s=%s", + std::string tags_hash_msg = base::StringPrintf("%s=%s", tags_hash_tag_name.c_str(), HashPrinterTags(printer_tags_prepared).c_str()); AddMultipartValueForUpload(kPrinterTagValue, tags_hash_msg, mime_boundary, @@ -253,7 +253,7 @@ std::string GetPostDataForPrinterTags( } std::string GetCloudPrintAuthHeader(const std::string& auth_token) { - return StringPrintf("Authorization: OAuth %s", auth_token.c_str()); + return base::StringPrintf("Authorization: OAuth %s", auth_token.c_str()); } } // namespace cloud_print diff --git a/chrome/common/cloud_print/cloud_print_helpers_unittest.cc b/chrome/common/cloud_print/cloud_print_helpers_unittest.cc index cc0f995..abfd001 100644 --- a/chrome/common/cloud_print/cloud_print_helpers_unittest.cc +++ b/chrome/common/cloud_print/cloud_print_helpers_unittest.cc @@ -83,7 +83,7 @@ TEST(CloudPrintHelpersTest, GetHashOfPrinterTags) { printer_tags["tag2"] = std::string("value2"); chrome::VersionInfo version_info; - std::string expected_list_string = StringPrintf( + std::string expected_list_string = base::StringPrintf( "chrome_version%ssystem_name%ssystem_version%stag1value1tag2value2", version_info.CreateVersionString().c_str(), base::SysInfo::OperatingSystemName().c_str(), diff --git a/chrome/common/metrics/variations/uniformity_field_trials.cc b/chrome/common/metrics/variations/uniformity_field_trials.cc index f208794..b529431 100644 --- a/chrome/common/metrics/variations/uniformity_field_trials.cc +++ b/chrome/common/metrics/variations/uniformity_field_trials.cc @@ -28,8 +28,8 @@ void SetupSingleUniformityFieldTrial( DCHECK_EQ(100 % num_trial_groups, 0); const int group_percent = 100 / num_trial_groups; - const std::string trial_name = StringPrintf(trial_name_string.c_str(), - group_percent); + const std::string trial_name = base::StringPrintf(trial_name_string.c_str(), + group_percent); DVLOG(1) << "Trial name = " << trial_name; @@ -48,7 +48,8 @@ void SetupSingleUniformityFieldTrial( // Loop starts with group 1 because the field trial automatically creates a // default group, which would be group 0. for (int group_number = 1; group_number < num_trial_groups; ++group_number) { - const std::string group_name = StringPrintf("group_%02d", group_number); + const std::string group_name = + base::StringPrintf("group_%02d", group_number); DVLOG(1) << " Group name = " << group_name; trial->AppendGroup(group_name, kProbabilityPerGroup); chrome_variations::AssociateGoogleVariationID( diff --git a/chrome/common/omaha_query_params.cc b/chrome/common/omaha_query_params.cc index fe59e1c..c13aeda 100644 --- a/chrome/common/omaha_query_params.cc +++ b/chrome/common/omaha_query_params.cc @@ -91,12 +91,13 @@ const char* GetChannelString() { namespace chrome { std::string OmahaQueryParams::Get(ProdId prod) { - return StringPrintf("os=%s&arch=%s&prod=%s&prodchannel=%s&prodversion=%s", - kOs, - kArch, - GetProdIdString(prod), - GetChannelString(), - chrome::VersionInfo().Version().c_str()); + return base::StringPrintf( + "os=%s&arch=%s&prod=%s&prodchannel=%s&prodversion=%s", + kOs, + kArch, + GetProdIdString(prod), + GetChannelString(), + chrome::VersionInfo().Version().c_str()); } } // namespace chrome diff --git a/chrome/common/thumbnail_score.cc b/chrome/common/thumbnail_score.cc index e2f41a0..ee9a031 100644 --- a/chrome/common/thumbnail_score.cc +++ b/chrome/common/thumbnail_score.cc @@ -70,15 +70,16 @@ bool ThumbnailScore::Equals(const ThumbnailScore& rhs) const { } std::string ThumbnailScore::ToString() const { - return StringPrintf("boring_score: %f, at_top %d, good_clipping %d, " - "load_completed: %d, " - "time_at_snapshot: %f, redirect_hops_from_dest: %d", - boring_score, - at_top, - good_clipping, - load_completed, - time_at_snapshot.ToDoubleT(), - redirect_hops_from_dest); + return base::StringPrintf( + "boring_score: %f, at_top %d, good_clipping %d, " + "load_completed: %d, " + "time_at_snapshot: %f, redirect_hops_from_dest: %d", + boring_score, + at_top, + good_clipping, + load_completed, + time_at_snapshot.ToDoubleT(), + redirect_hops_from_dest); } bool ShouldReplaceThumbnailWith(const ThumbnailScore& current, diff --git a/chrome/renderer/autofill/form_autofill_browsertest.cc b/chrome/renderer/autofill/form_autofill_browsertest.cc index 17c91eb..b59850a 100644 --- a/chrome/renderer/autofill/form_autofill_browsertest.cc +++ b/chrome/renderer/autofill/form_autofill_browsertest.cc @@ -95,7 +95,7 @@ class FormAutofillTest : public ChromeRenderViewTest { expected.value = values[i]; expected.form_control_type = control_types[i]; expected.max_length = max_length; - SCOPED_TRACE(StringPrintf("i: %" PRIuS, i)); + SCOPED_TRACE(base::StringPrintf("i: %" PRIuS, i)); EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[i]); } } diff --git a/chrome/renderer/autofill/password_generation_manager_browsertest.cc b/chrome/renderer/autofill/password_generation_manager_browsertest.cc index 11747ba..e71b609 100644 --- a/chrome/renderer/autofill/password_generation_manager_browsertest.cc +++ b/chrome/renderer/autofill/password_generation_manager_browsertest.cc @@ -82,7 +82,7 @@ class PasswordGenerationManagerTest : public ChromeRenderViewTest { void SetNotBlacklistedMessage(const char* form_str) { content::PasswordForm form; form.origin = - GURL(StringPrintf("data:text/html;charset=utf-8,%s", form_str)); + GURL(base::StringPrintf("data:text/html;charset=utf-8,%s", form_str)); AutofillMsg_FormNotBlacklisted msg(0, form); generation_manager_->OnMessageReceived(msg); } diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc index 6c7e00f..f7526be 100644 --- a/chrome/renderer/printing/print_web_view_helper.cc +++ b/chrome/renderer/printing/print_web_view_helper.cc @@ -63,7 +63,7 @@ void ExecuteScript(WebKit::WebFrame* frame, const base::Value& parameters) { std::string json; base::JSONWriter::Write(¶meters, &json); - std::string script = StringPrintf(script_format, json.c_str()); + std::string script = base::StringPrintf(script_format, json.c_str()); frame->executeScript(WebKit::WebString(UTF8ToUTF16(script))); } @@ -438,7 +438,7 @@ void PrintWebViewHelper::PrintHeaderAndFooter( options->SetDouble("topMargin", page_layout.margin_top); options->SetDouble("bottomMargin", page_layout.margin_bottom); options->SetString("pageNumber", - StringPrintf("%d/%d", page_number, total_pages)); + base::StringPrintf("%d/%d", page_number, total_pages)); ExecuteScript(frame, kPageSetupScriptFormat, *options); diff --git a/chrome/renderer/safe_browsing/phishing_term_feature_extractor_unittest.cc b/chrome/renderer/safe_browsing/phishing_term_feature_extractor_unittest.cc index 4bd5e90..55d3c12 100644 --- a/chrome/renderer/safe_browsing/phishing_term_feature_extractor_unittest.cc +++ b/chrome/renderer/safe_browsing/phishing_term_feature_extractor_unittest.cc @@ -206,7 +206,7 @@ TEST_F(PhishingTermFeatureExtractorTest, Continuation) { // correctly, the extractor has to process the entire string of text. string16 page_text(ASCIIToUTF16("one ")); for (int i = 0; i < 28; ++i) { - page_text.append(ASCIIToUTF16(StringPrintf("%d ", i))); + page_text.append(ASCIIToUTF16(base::StringPrintf("%d ", i))); } page_text.append(ASCIIToUTF16("two")); @@ -274,7 +274,7 @@ TEST_F(PhishingTermFeatureExtractorTest, Continuation) { TEST_F(PhishingTermFeatureExtractorTest, PartialExtractionTest) { scoped_ptr<string16> page_text(new string16(ASCIIToUTF16("one "))); for (int i = 0; i < 28; ++i) { - page_text->append(ASCIIToUTF16(StringPrintf("%d ", i))); + page_text->append(ASCIIToUTF16(base::StringPrintf("%d ", i))); } base::TimeTicks now = base::TimeTicks::Now(); @@ -295,7 +295,7 @@ TEST_F(PhishingTermFeatureExtractorTest, PartialExtractionTest) { page_text.reset(new string16()); for (int i = 30; i < 58; ++i) { - page_text->append(ASCIIToUTF16(StringPrintf("%d ", i))); + page_text->append(ASCIIToUTF16(base::StringPrintf("%d ", i))); } page_text->append(ASCIIToUTF16("multi word test ")); features.Clear(); diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc index 9f5126d..a31b7de 100644 --- a/chrome/renderer/searchbox/searchbox_extension.cc +++ b/chrome/renderer/searchbox/searchbox_extension.cc @@ -66,14 +66,14 @@ void Dispatch(WebKit::WebFrame* frame, const WebKit::WebString& script) { v8::Handle<v8::String> GenerateThumbnailURL(uint64 most_visited_item_id) { return UTF8ToV8String( - StringPrintf("chrome-search://thumb/%s", - base::Uint64ToString(most_visited_item_id).c_str())); + base::StringPrintf("chrome-search://thumb/%s", + base::Uint64ToString(most_visited_item_id).c_str())); } v8::Handle<v8::String> GenerateFaviconURL(uint64 most_visited_item_id) { return UTF8ToV8String( - StringPrintf("chrome-search://favicon/%s", - base::Uint64ToString(most_visited_item_id).c_str())); + base::StringPrintf("chrome-search://favicon/%s", + base::Uint64ToString(most_visited_item_id).c_str())); } const GURL MostVisitedItemIDToURL( diff --git a/chrome/service/cloud_print/cloud_print_helpers.cc b/chrome/service/cloud_print/cloud_print_helpers.cc index 6c38a65..3e03e57 100644 --- a/chrome/service/cloud_print/cloud_print_helpers.cc +++ b/chrome/service/cloud_print/cloud_print_helpers.cc @@ -52,14 +52,14 @@ GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, GURL::Replacements replacements; replacements.SetPathStr(path); std::string query = - StringPrintf("jobid=%s&status=%s&code=%d&message=%s" - "&numpages=%d&pagesprinted=%d", - job_id.c_str(), - status_string.c_str(), - details.platform_status_flags, - details.status_message.c_str(), - details.total_pages, - details.pages_printed); + base::StringPrintf("jobid=%s&status=%s&code=%d&message=%s" + "&numpages=%d&pagesprinted=%d", + job_id.c_str(), + status_string.c_str(), + details.platform_status_flags, + details.status_message.c_str(), + details.total_pages, + details.pages_printed); replacements.SetQueryStr(query); return cloud_print_server_url.ReplaceComponents(replacements); } diff --git a/chrome/service/cloud_print/cloud_print_helpers_unittest.cc b/chrome/service/cloud_print/cloud_print_helpers_unittest.cc index a4d7ca0..436a4c9 100644 --- a/chrome/service/cloud_print/cloud_print_helpers_unittest.cc +++ b/chrome/service/cloud_print/cloud_print_helpers_unittest.cc @@ -53,7 +53,7 @@ TEST(CloudPrintServiceHelpersTest, GetHashOfPrinterInfo) { printer_info.options["tag2"] = std::string("value2"); chrome::VersionInfo version_info; - std::string expected_list_string = StringPrintf( + std::string expected_list_string = base::StringPrintf( "chrome_version%ssystem_name%ssystem_version%stag1value1tag2value2", version_info.CreateVersionString().c_str(), base::SysInfo::OperatingSystemName().c_str(), diff --git a/chrome/service/cloud_print/printer_job_handler_unittest.cc b/chrome/service/cloud_print/printer_job_handler_unittest.cc index b682944..9e19519 100644 --- a/chrome/service/cloud_print/printer_job_handler_unittest.cc +++ b/chrome/service/cloud_print/printer_job_handler_unittest.cc @@ -38,6 +38,8 @@ namespace cloud_print { namespace { +using base::StringPrintf; + const char kExampleCloudPrintServerURL[] = "https://www.google.com/cloudprint/"; const char kExamplePrintTicket[] = "{\"MediaType\":\"plain\"," diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index 8a08b1d..98ba947 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -55,7 +55,7 @@ void UpdateHistoryDates(const base::FilePath& user_data_dir) { ASSERT_TRUE(db.Open(history)); base::Time yesterday = base::Time::Now() - base::TimeDelta::FromDays(1); std::string yesterday_str = base::Int64ToString(yesterday.ToInternalValue()); - std::string query = StringPrintf( + std::string query = base::StringPrintf( "UPDATE segment_usage " "SET time_slot = %s " "WHERE id IN (SELECT id FROM segment_usage WHERE time_slot > 0);", @@ -155,8 +155,9 @@ void ProxyLauncher::CloseBrowserAndServer() { // the UI tests in single-process mode. // TODO(jhughes): figure out why this is necessary at all, and fix it AssertAppNotRunning( - StringPrintf("Unable to quit all browser processes. Original PID %d", - process_id_)); + base::StringPrintf( + "Unable to quit all browser processes. Original PID %d", + process_id_)); DisconnectFromRunningBrowser(); } @@ -315,7 +316,7 @@ void ProxyLauncher::AssertAppNotRunning(const std::string& error_message) { final_error_message += " Leftover PIDs: ["; for (ChromeProcessList::const_iterator it = processes.begin(); it != processes.end(); ++it) { - final_error_message += StringPrintf(" %d", *it); + final_error_message += base::StringPrintf(" %d", *it); } final_error_message += " ]"; } diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc index 0a2b555..ccd9bdd 100644 --- a/chrome/test/base/ui_test_utils.cc +++ b/chrome/test/base/ui_test_utils.cc @@ -158,7 +158,7 @@ base::FilePath GetSnapshotFileName(const base::FilePath& snapshot_directory) { base::Time::Exploded the_time; base::Time::Now().LocalExplode(&the_time); - std::string filename(StringPrintf("%s%04d%02d%02d%02d%02d%02d%s", + std::string filename(base::StringPrintf("%s%04d%02d%02d%02d%02d%02d%s", kSnapshotBaseName, the_time.year, the_time.month, the_time.day_of_month, the_time.hour, the_time.minute, the_time.second, kSnapshotExtension)); @@ -168,7 +168,7 @@ base::FilePath GetSnapshotFileName(const base::FilePath& snapshot_directory) { std::string suffix; base::FilePath trial_file; do { - suffix = StringPrintf(" (%d)", ++index); + suffix = base::StringPrintf(" (%d)", ++index); trial_file = snapshot_file.InsertBeforeExtensionASCII(suffix); } while (file_util::PathExists(trial_file)); snapshot_file = trial_file; diff --git a/chrome/test/perf/url_fetch_test.cc b/chrome/test/perf/url_fetch_test.cc index 4a88f29..6c8712f 100644 --- a/chrome/test/perf/url_fetch_test.cc +++ b/chrome/test/perf/url_fetch_test.cc @@ -73,7 +73,7 @@ class UrlFetchTest : public UIPerfTest { ASSERT_TRUE(completed); } if (var_to_fetch) { - std::string script = StringPrintf( + std::string script = base::StringPrintf( "window.domAutomationController.send(%s);", var_to_fetch); std::wstring value; diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc index fd35776..beecb98 100644 --- a/chrome/test/ppapi/ppapi_test.cc +++ b/chrome/test/ppapi/ppapi_test.cc @@ -200,7 +200,7 @@ void PPAPITestBase::RunTestWithSSLServer(const std::string& test_case) { uint16_t port = ssl_server.host_port_pair().port(); RunTestURL(GetTestURL(http_server, test_case, - StringPrintf("ssl_server_port=%d", port))); + base::StringPrintf("ssl_server_port=%d", port))); } void PPAPITestBase::RunTestWithWebSocketServer(const std::string& test_case) { @@ -223,9 +223,10 @@ void PPAPITestBase::RunTestWithWebSocketServer(const std::string& test_case) { uint16_t port = ws_server.host_port_pair().port(); RunTestURL(GetTestURL(http_server, test_case, - StringPrintf("websocket_host=%s&websocket_port=%d", - host.c_str(), - port))); + base::StringPrintf( + "websocket_host=%s&websocket_port=%d", + host.c_str(), + port))); } void PPAPITestBase::RunTestIfAudioOutputAvailable( @@ -270,7 +271,7 @@ GURL PPAPITestBase::GetTestURL( const std::string& extra_params) { std::string query = BuildQuery("files/test_case.html?", test_case); if (!extra_params.empty()) - query = StringPrintf("%s&%s", query.c_str(), extra_params.c_str()); + query = base::StringPrintf("%s&%s", query.c_str(), extra_params.c_str()); return http_server.GetURL(query); } @@ -301,7 +302,7 @@ void PPAPITest::SetUpCommandLine(CommandLine* command_line) { std::string PPAPITest::BuildQuery(const std::string& base, const std::string& test_case){ - return StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); + return base::StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); } OutOfProcessPPAPITest::OutOfProcessPPAPITest() { @@ -328,22 +329,22 @@ void PPAPINaClTest::SetUpCommandLine(CommandLine* command_line) { // Append the correct mode and testcase string std::string PPAPINaClNewlibTest::BuildQuery(const std::string& base, const std::string& test_case) { - return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), - test_case.c_str()); + return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), + test_case.c_str()); } // Append the correct mode and testcase string std::string PPAPINaClGLibcTest::BuildQuery(const std::string& base, const std::string& test_case) { - return StringPrintf("%smode=nacl_glibc&testcase=%s", base.c_str(), - test_case.c_str()); + return base::StringPrintf("%smode=nacl_glibc&testcase=%s", base.c_str(), + test_case.c_str()); } // Append the correct mode and testcase string std::string PPAPINaClPNaClTest::BuildQuery(const std::string& base, const std::string& test_case) { - return StringPrintf("%smode=nacl_pnacl&testcase=%s", base.c_str(), - test_case.c_str()); + return base::StringPrintf("%smode=nacl_pnacl&testcase=%s", base.c_str(), + test_case.c_str()); } void PPAPINaClTestDisallowedSockets::SetUpCommandLine( @@ -363,8 +364,8 @@ void PPAPINaClTestDisallowedSockets::SetUpCommandLine( std::string PPAPINaClTestDisallowedSockets::BuildQuery( const std::string& base, const std::string& test_case) { - return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), - test_case.c_str()); + return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), + test_case.c_str()); } void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { diff --git a/chrome/test/pyautolib/pyautolib.cc b/chrome/test/pyautolib/pyautolib.cc index 7724f6f..1822906 100644 --- a/chrome/test/pyautolib/pyautolib.cc +++ b/chrome/test/pyautolib/pyautolib.cc @@ -134,8 +134,8 @@ void PyUITestBase::ErrorResponse( bool is_timeout, std::string* response) { base::DictionaryValue error_dict; - std::string error_msg = StringPrintf("%s for %s", error_string.c_str(), - request.c_str()); + std::string error_msg = base::StringPrintf("%s for %s", error_string.c_str(), + request.c_str()); LOG(ERROR) << "Error during automation: " << error_msg; error_dict.SetString("error", error_msg); error_dict.SetBoolean("is_interface_error", true); @@ -151,8 +151,8 @@ void PyUITestBase::RequestFailureResponse( // TODO(craigdh): Determine timeout directly from IPC's Send(). if (duration >= timeout) { ErrorResponse( - StringPrintf("Chrome automation timed out after %d seconds", - static_cast<int>(duration.InSeconds())), + base::StringPrintf("Chrome automation timed out after %d seconds", + static_cast<int>(duration.InSeconds())), request, true, response); } else { // TODO(craigdh): Determine specific cause. diff --git a/chrome/test/reliability/automated_ui_tests.cc b/chrome/test/reliability/automated_ui_tests.cc index 22266c4..fd50b23 100644 --- a/chrome/test/reliability/automated_ui_tests.cc +++ b/chrome/test/reliability/automated_ui_tests.cc @@ -259,7 +259,7 @@ void AutomatedUITest::RunReproduction() { LogSuccessResult(); } - AppendToTestLog(StringPrintf("total_duration_seconds=%f", + AppendToTestLog(base::StringPrintf("total_duration_seconds=%f", CalculateTestDuration(test_start_time_))); WriteReportToFile(); } @@ -360,7 +360,7 @@ void AutomatedUITest::RunAutomatedUITest() { } } - AppendToTestLog(StringPrintf("total_duration_seconds=%f", + AppendToTestLog(base::StringPrintf("total_duration_seconds=%f", CalculateTestDuration(test_start_time_))); // The test is finished so write our report. diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index 617ff40..9e6cf7f 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -458,7 +458,7 @@ class PageLoadTest : public UITest { const char* server = g_server_url.empty() ? kDefaultServerUrl : g_server_url.c_str(); std::string test_page_url( - StringPrintf("%s/page?id=%d", server, i)); + base::StringPrintf("%s/page?id=%d", server, i)); NavigateToURLLogResult( test_page_url, log_file, NULL, g_continuous_load, false); } diff --git a/chrome/test/webdriver/webdriver_key_converter.cc b/chrome/test/webdriver/webdriver_key_converter.cc index 25c8957..e19e9dc 100644 --- a/chrome/test/webdriver/webdriver_key_converter.cc +++ b/chrome/test/webdriver/webdriver_key_converter.cc @@ -251,7 +251,7 @@ bool ConvertKeysToWebKeyEvents(const string16& client_keys, if (should_skip) continue; if (key_code == ui::VKEY_UNKNOWN) { - *error_msg = StringPrintf( + *error_msg = base::StringPrintf( "Unknown WebDriver key(%d) at string index (%" PRIuS ")", static_cast<int>(key), i); diff --git a/chrome_frame/metrics_service.cc b/chrome_frame/metrics_service.cc index 73c93b2..cc5e38d 100644 --- a/chrome_frame/metrics_service.cc +++ b/chrome_frame/metrics_service.cc @@ -180,12 +180,13 @@ class ChromeFrameMetricsDataUploader : public BSCBImpl { LPWSTR* additional_headers) { std::string new_headers; new_headers = - StringPrintf("Content-Length: %s\r\n" - "Content-Type: %s\r\n" - "%s\r\n", - base::Int64ToString(upload_data_size_).c_str(), - mime_type_.c_str(), - http_utils::GetDefaultUserAgentHeaderWithCFTag().c_str()); + base::StringPrintf( + "Content-Length: %s\r\n" + "Content-Type: %s\r\n" + "%s\r\n", + base::Int64ToString(upload_data_size_).c_str(), + mime_type_.c_str(), + http_utils::GetDefaultUserAgentHeaderWithCFTag().c_str()); *additional_headers = reinterpret_cast<wchar_t*>( CoTaskMemAlloc((new_headers.size() + 1) * sizeof(wchar_t))); diff --git a/chrome_frame/test/navigation_test.cc b/chrome_frame/test/navigation_test.cc index a8f3d40..d59494e 100644 --- a/chrome_frame/test/navigation_test.cc +++ b/chrome_frame/test/navigation_test.cc @@ -881,7 +881,7 @@ class HttpHeaderTest : public MockIEEventSinkTest, public testing::Test { "Connection: close\r\n" "Content-Type: %s\r\n" "X-UA-Compatible: chrome=1\r\n"; - std::string header = StringPrintf(kHeaderFormat, content_type); + std::string header = base::StringPrintf(kHeaderFormat, content_type); std::wstring url = server_mock_.Resolve(relative_url); EXPECT_CALL(server_mock_, Get(_, StrEq(relative_url), _)) .WillRepeatedly(SendFast(header, data)); diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc index 4f786dc..ecb01a7 100644 --- a/chrome_frame/test/test_with_web_server.cc +++ b/chrome_frame/test/test_with_web_server.cc @@ -1018,7 +1018,7 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestDownloadFromForm) { virtual bool GetCustomHeaders(std::string* headers) const { if (!is_post_) return false; - *headers = StringPrintf( + *headers = base::StringPrintf( "HTTP/1.1 200 OK\r\n" "Content-Disposition: attachment;filename=\"test.txt\"\r\n" "Content-Type: application/text\r\n" diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index c5a0a25..a6251bb 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -1083,7 +1083,7 @@ void UrlmonUrlRequestManager::StartRequestHelper( for (size_t i = 0; i < elements->size(); ++i) { net::UploadElement* element = (*elements)[i]; DCHECK(element->type() == net::UploadElement::TYPE_BYTES); - std::string chunk_length = StringPrintf( + std::string chunk_length = base::StringPrintf( "%X\r\n", static_cast<unsigned int>(element->bytes_length())); std::vector<char> bytes; bytes.insert(bytes.end(), chunk_length.data(), diff --git a/chromeos/network/geolocation_handler_unittest.cc b/chromeos/network/geolocation_handler_unittest.cc index dc2cab0..74e86cd 100644 --- a/chromeos/network/geolocation_handler_unittest.cc +++ b/chromeos/network/geolocation_handler_unittest.cc @@ -49,8 +49,8 @@ class GeolocationHandlerTest : public testing::Test { std::string mac_address = base::StringPrintf("%02X:%02X:%02X:%02X:%02X:%02X", idx, 0, 0, 0, 0, 0); - std::string channel = StringPrintf("%d", idx); - std::string strength = StringPrintf("%d", idx * 10); + std::string channel = base::StringPrintf("%d", idx); + std::string strength = base::StringPrintf("%d", idx * 10); properties.SetStringWithoutPathExpansion( shill::kGeoMacAddressProperty, mac_address); properties.SetStringWithoutPathExpansion( diff --git a/chromeos/network/network_event_log.cc b/chromeos/network/network_event_log.cc index 84d6079..be8d0cb 100644 --- a/chromeos/network/network_event_log.cc +++ b/chromeos/network/network_event_log.cc @@ -49,7 +49,7 @@ std::string LogEntry::ToString() const { if (!description.empty()) line += ": " + description; if (count > 1) - line += StringPrintf(" (%d)", count); + line += base::StringPrintf(" (%d)", count); line += "\n"; return line; } diff --git a/chromeos/network/network_event_log_unittest.cc b/chromeos/network/network_event_log_unittest.cc index 0f20a11..8654bb3 100644 --- a/chromeos/network/network_event_log_unittest.cc +++ b/chromeos/network/network_event_log_unittest.cc @@ -98,7 +98,8 @@ TEST_F(NetworkEventLogTest, TestMaxNetworkEvents) { const size_t entries_to_add = network_event_log::kMaxNetworkEventLogEntries + 3; for (size_t i = 0; i < entries_to_add; ++i) - network_event_log::AddEntry("test", StringPrintf("event_%"PRIuS, i), ""); + network_event_log::AddEntry("test", + base::StringPrintf("event_%"PRIuS, i), ""); std::string output = GetAsString(network_event_log::OLDEST_FIRST, 0); size_t output_lines = CountLines(output); diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc index d8e0432..d1ca44f 100644 --- a/chromeos/network/network_state_handler.cc +++ b/chromeos/network/network_state_handler.cc @@ -57,11 +57,11 @@ std::string ValueAsString(const base::Value& value) { } else if (value.GetType() == base::Value::TYPE_INTEGER) { int intval = 0; value.GetAsInteger(&intval); - return StringPrintf("%d", intval); + return base::StringPrintf("%d", intval); } else if (value.GetType() == base::Value::TYPE_DOUBLE) { double dval = 0; value.GetAsDouble(&dval); - return StringPrintf("%g", dval); + return base::StringPrintf("%g", dval); } else if (value.GetType() == base::Value::TYPE_STRING) { std::string vstr; value.GetAsString(&vstr); @@ -380,7 +380,7 @@ void NetworkStateHandler::UpdateManagedStateProperties( } network_event_log::AddEntry( kLogModule, "PropertiesReceived", - StringPrintf("%s (%s)", path.c_str(), managed->name().c_str())); + base::StringPrintf("%s (%s)", path.c_str(), managed->name().c_str())); } void NetworkStateHandler::UpdateNetworkServiceProperty( @@ -447,7 +447,7 @@ void NetworkStateHandler::ManagedStateListChanged( // Notify observers that the list of networks has changed. network_event_log::AddEntry( kLogModule, "NetworkListChanged", - StringPrintf("Size: %"PRIuS, network_list_.size())); + base::StringPrintf("Size: %"PRIuS, network_list_.size())); FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_, NetworkListChanged()); // The list order may have changed, so check if the default network changed. @@ -456,7 +456,7 @@ void NetworkStateHandler::ManagedStateListChanged( } else if (type == ManagedState::MANAGED_TYPE_DEVICE) { network_event_log::AddEntry( kLogModule, "DeviceListChanged", - StringPrintf("Size: %"PRIuS, device_list_.size())); + base::StringPrintf("Size: %"PRIuS, device_list_.size())); FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_, DeviceListChanged()); } else { @@ -511,7 +511,7 @@ NetworkStateHandler::ManagedStateList* NetworkStateHandler::GetManagedList( void NetworkStateHandler::OnNetworkConnectionStateChanged( NetworkState* network) { DCHECK(network); - std::string desc = StringPrintf( + std::string desc = base::StringPrintf( "%s: %s", network->path().c_str(), network->connection_state().c_str()); network_event_log::AddEntry( kLogModule, "NetworkConnectionStateChanged", desc); diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc index c0497ad6..fa74068 100644 --- a/chromeos/network/network_util.cc +++ b/chromeos/network/network_util.cc @@ -43,7 +43,7 @@ std::string PrefixLengthToNetmask(int32 prefix_length) { netmask += "."; int value = remainder == 0 ? 0 : ((2L << (remainder - 1)) - 1) << (8 - remainder); - netmask += StringPrintf("%d", value); + netmask += base::StringPrintf("%d", value); } return netmask; } diff --git a/chromeos/network/shill_property_handler.cc b/chromeos/network/shill_property_handler.cc index fa01cc9..0e3c77a8 100644 --- a/chromeos/network/shill_property_handler.cc +++ b/chromeos/network/shill_property_handler.cc @@ -320,7 +320,7 @@ void ShillPropertyHandler::UpdateAvailableTechnologies( available_technologies_.clear(); network_event_log::AddEntry( kLogModule, "AvailableTechnologiesChanged", - StringPrintf("Size: %"PRIuS, technologies.GetSize())); + base::StringPrintf("Size: %"PRIuS, technologies.GetSize())); for (base::ListValue::const_iterator iter = technologies.begin(); iter != technologies.end(); ++iter) { std::string technology; @@ -335,7 +335,7 @@ void ShillPropertyHandler::UpdateEnabledTechnologies( enabled_technologies_.clear(); network_event_log::AddEntry( kLogModule, "EnabledTechnologiesChanged", - StringPrintf("Size: %"PRIuS, technologies.GetSize())); + base::StringPrintf("Size: %"PRIuS, technologies.GetSize())); for (base::ListValue::const_iterator iter = technologies.begin(); iter != technologies.end(); ++iter) { std::string technology; @@ -350,7 +350,7 @@ void ShillPropertyHandler::UpdateUninitializedTechnologies( uninitialized_technologies_.clear(); network_event_log::AddEntry( kLogModule, "UninitializedTechnologiesChanged", - StringPrintf("Size: %"PRIuS, technologies.GetSize())); + base::StringPrintf("Size: %"PRIuS, technologies.GetSize())); for (base::ListValue::const_iterator iter = technologies.begin(); iter != technologies.end(); ++iter) { std::string technology; diff --git a/components/autofill/browser/autofill_manager_unittest.cc b/components/autofill/browser/autofill_manager_unittest.cc index 52d3225..2ab780d 100644 --- a/components/autofill/browser/autofill_manager_unittest.cc +++ b/components/autofill/browser/autofill_manager_unittest.cc @@ -305,7 +305,7 @@ void ExpectSuggestions(int page_id, ASSERT_EQ(expected_num_suggestions, icons.size()); ASSERT_EQ(expected_num_suggestions, unique_ids.size()); for (size_t i = 0; i < expected_num_suggestions; ++i) { - SCOPED_TRACE(StringPrintf("i: %" PRIuS, i)); + SCOPED_TRACE(base::StringPrintf("i: %" PRIuS, i)); EXPECT_EQ(expected_values[i], values[i]); EXPECT_EQ(expected_labels[i], labels[i]); EXPECT_EQ(expected_icons[i], icons[i]); @@ -511,8 +511,9 @@ class TestAutofillManager : public AutofillManager { submitted_form->field_count()); for (size_t i = 0; i < expected_submitted_field_types_.size(); ++i) { SCOPED_TRACE( - StringPrintf("Field %d with value %s", static_cast<int>(i), - UTF16ToUTF8(submitted_form->field(i)->value).c_str())); + base::StringPrintf( + "Field %d with value %s", static_cast<int>(i), + UTF16ToUTF8(submitted_form->field(i)->value).c_str())); const FieldTypeSet& possible_types = submitted_form->field(i)->possible_types(); EXPECT_EQ(expected_submitted_field_types_[i].size(), diff --git a/components/autofill/browser/wallet/encryption_escrow_client.cc b/components/autofill/browser/wallet/encryption_escrow_client.cc index e41014d..cf7d21d 100644 --- a/components/autofill/browser/wallet/encryption_escrow_client.cc +++ b/components/autofill/browser/wallet/encryption_escrow_client.cc @@ -60,7 +60,7 @@ void EncryptionEscrowClient::EncryptOneTimePad( request_type_ = ENCRYPT_ONE_TIME_PAD; - std::string post_body = StringPrintf( + std::string post_body = base::StringPrintf( kEncryptOtpBodyFormat, base::HexEncode(&num_bits, 1).c_str(), base::HexEncode(&(one_time_pad[0]), one_time_pad.size()).c_str()); @@ -81,7 +81,7 @@ void EncryptionEscrowClient::EscrowInstrumentInformation( net::EscapeUrlEncodedData( UTF16ToUTF8(new_instrument.card_verification_number()), true); - std::string post_body = StringPrintf( + std::string post_body = base::StringPrintf( kEscrowInstrumentInformationFormat, obfuscated_gaia_id.c_str(), primary_account_number.c_str(), @@ -96,7 +96,7 @@ void EncryptionEscrowClient::EscrowCardVerificationNumber( DCHECK_EQ(NO_PENDING_REQUEST, request_type_); request_type_ = ESCROW_CARD_VERIFICATION_NUMBER; - std::string post_body = StringPrintf( + std::string post_body = base::StringPrintf( kEscrowCardVerficationNumberFormat, obfuscated_gaia_id.c_str(), card_verification_number.c_str()); diff --git a/components/visitedlink/test/visitedlink_unittest.cc b/components/visitedlink/test/visitedlink_unittest.cc index ff54743..4bdadf4 100644 --- a/components/visitedlink/test/visitedlink_unittest.cc +++ b/components/visitedlink/test/visitedlink_unittest.cc @@ -44,7 +44,7 @@ const int g_test_count = 1000; // Returns a test URL for index |i| GURL TestURL(int i) { - return GURL(StringPrintf("%s%d", g_test_prefix, i)); + return GURL(base::StringPrintf("%s%d", g_test_prefix, i)); } std::vector<VisitedLinkSlave*> g_slaves; diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc index e0a5a99..50930fa 100644 --- a/content/app/content_main_runner.cc +++ b/content/app/content_main_runner.cc @@ -196,8 +196,9 @@ void SendTaskPortToParentProcess() { base::MachPortSender child_sender(mach_port_name.c_str()); kern_return_t err = child_sender.SendMessage(child_message, kTimeoutMs); if (err != KERN_SUCCESS) { - LOG(ERROR) << StringPrintf("child SendMessage() failed: 0x%x %s", err, - mach_error_string(err)); + LOG(ERROR) << + base::StringPrintf("child SendMessage() failed: 0x%x %s", err, + mach_error_string(err)); } } diff --git a/content/browser/accessibility/accessibility_tree_formatter_win.cc b/content/browser/accessibility/accessibility_tree_formatter_win.cc index bf7495f..389c0e5 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_win.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_win.cc @@ -90,13 +90,13 @@ string16 AccessibilityTreeFormatter::ToString( Add(false, L"role_name='" + acc_obj->role_name() + L"'"); VARIANT currentValue; if (acc_obj->get_currentValue(¤tValue) == S_OK) - Add(false, StringPrintf(L"currentValue=%.2f", V_R8(¤tValue))); + Add(false, base::StringPrintf(L"currentValue=%.2f", V_R8(¤tValue))); VARIANT minimumValue; if (acc_obj->get_minimumValue(&minimumValue) == S_OK) - Add(false, StringPrintf(L"minimumValue=%.2f", V_R8(&minimumValue))); + Add(false, base::StringPrintf(L"minimumValue=%.2f", V_R8(&minimumValue))); VARIANT maximumValue; if (acc_obj->get_maximumValue(&maximumValue) == S_OK) - Add(false, StringPrintf(L"maximumValue=%.2f", V_R8(&maximumValue))); + Add(false, base::StringPrintf(L"maximumValue=%.2f", V_R8(&maximumValue))); Add(false, L"description='" + description + L"'"); Add(false, L"default_action='" + default_action + L"'"); Add(false, L"keyboard_shortcut='" + keyboard_shortcut + L"'"); @@ -107,51 +107,51 @@ string16 AccessibilityTreeFormatter::ToString( &left, &top, &width, &height, variant_self) && S_FALSE != root->ToBrowserAccessibilityWin()->accLocation( &root_left, &root_top, &root_width, &root_height, variant_self)) { - Add(false, StringPrintf(L"location=(%d, %d)", + Add(false, base::StringPrintf(L"location=(%d, %d)", left - root_left, top - root_top)); - Add(false, StringPrintf(L"size=(%d, %d)", width, height)); + Add(false, base::StringPrintf(L"size=(%d, %d)", width, height)); } LONG index_in_parent; if (acc_obj->get_indexInParent(&index_in_parent) == S_OK) - Add(false, StringPrintf(L"index_in_parent=%d", index_in_parent)); + Add(false, base::StringPrintf(L"index_in_parent=%d", index_in_parent)); LONG n_relations; if (acc_obj->get_nRelations(&n_relations) == S_OK) - Add(false, StringPrintf(L"n_relations=%d", n_relations)); + Add(false, base::StringPrintf(L"n_relations=%d", n_relations)); LONG group_level, similar_items_in_group, position_in_group; if (acc_obj->get_groupPosition(&group_level, &similar_items_in_group, &position_in_group) == S_OK) { - Add(false, StringPrintf(L"group_level=%d", group_level)); - Add(false, StringPrintf(L"similar_items_in_group=%d", + Add(false, base::StringPrintf(L"group_level=%d", group_level)); + Add(false, base::StringPrintf(L"similar_items_in_group=%d", similar_items_in_group)); - Add(false, StringPrintf(L"position_in_group=%d", position_in_group)); + Add(false, base::StringPrintf(L"position_in_group=%d", position_in_group)); } LONG table_rows; if (acc_obj->get_nRows(&table_rows) == S_OK) - Add(false, StringPrintf(L"table_rows=%d", table_rows)); + Add(false, base::StringPrintf(L"table_rows=%d", table_rows)); LONG table_columns; if (acc_obj->get_nRows(&table_columns) == S_OK) - Add(false, StringPrintf(L"table_columns=%d", table_columns)); + Add(false, base::StringPrintf(L"table_columns=%d", table_columns)); LONG row_index; if (acc_obj->get_rowIndex(&row_index) == S_OK) - Add(false, StringPrintf(L"row_index=%d", row_index)); + Add(false, base::StringPrintf(L"row_index=%d", row_index)); LONG column_index; if (acc_obj->get_columnIndex(&column_index) == S_OK) - Add(false, StringPrintf(L"column_index=%d", column_index)); + Add(false, base::StringPrintf(L"column_index=%d", column_index)); LONG n_characters; if (acc_obj->get_nCharacters(&n_characters) == S_OK) - Add(false, StringPrintf(L"n_characters=%d", n_characters)); + Add(false, base::StringPrintf(L"n_characters=%d", n_characters)); LONG caret_offset; if (acc_obj->get_caretOffset(&caret_offset) == S_OK) - Add(false, StringPrintf(L"caret_offset=%d", caret_offset)); + Add(false, base::StringPrintf(L"caret_offset=%d", caret_offset)); LONG n_selections; if (acc_obj->get_nSelections(&n_selections) == S_OK) { - Add(false, StringPrintf(L"n_selections=%d", n_selections)); + Add(false, base::StringPrintf(L"n_selections=%d", n_selections)); if (n_selections > 0) { LONG start, end; if (acc_obj->get_selection(0, &start, &end) == S_OK) { - Add(false, StringPrintf(L"selection_start=%d", start)); - Add(false, StringPrintf(L"selection_end=%d", end)); + Add(false, base::StringPrintf(L"selection_start=%d", start)); + Add(false, base::StringPrintf(L"selection_end=%d", end)); } } } diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc index 25ca4e6..66dd8aa 100644 --- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc +++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc @@ -95,7 +95,7 @@ const char kHTMLForGuestWithSize[] = "</html>"; std::string GetHTMLForGuestWithTitle(const std::string& title) { - return StringPrintf(kHTMLForGuestWithTitle, title.c_str()); + return base::StringPrintf(kHTMLForGuestWithTitle, title.c_str()); } } // namespace @@ -327,10 +327,10 @@ class BrowserPluginHostTest : public ContentBrowserTest { if (!is_guest_data_url) { test_url = test_server()->GetURL(guest_url); ExecuteSyncJSFunction( - rvh, StringPrintf("SetSrc('%s');", test_url.spec().c_str())); + rvh, base::StringPrintf("SetSrc('%s');", test_url.spec().c_str())); } else { ExecuteSyncJSFunction( - rvh, StringPrintf("SetSrc('%s');", guest_url.c_str())); + rvh, base::StringPrintf("SetSrc('%s');", guest_url.c_str())); } // Wait to make sure embedder is created/attached to WebContents. @@ -397,7 +397,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, int spin_time = 10 * TestTimeouts::tiny_timeout().InMilliseconds(); ExecuteSyncJSFunction( test_guest()->web_contents()->GetRenderViewHost(), - StringPrintf("StartPauseMs(%d);", spin_time).c_str()); + base::StringPrintf("StartPauseMs(%d);", spin_time).c_str()); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); @@ -439,8 +439,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, // sample guest. In the end we verify that the correct size has been set. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, NavigateAfterResize) { const gfx::Size nxt_size = gfx::Size(100, 200); - const std::string embedder_code = - StringPrintf("SetSize(%d, %d);", nxt_size.width(), nxt_size.height()); + const std::string embedder_code = base::StringPrintf( + "SetSize(%d, %d);", nxt_size.width(), nxt_size.height()); const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, embedder_code); @@ -626,7 +626,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) { ExecuteSyncJSFunction( rvh, - StringPrintf("SetSrc('%s');", GetHTMLForGuestWithTitle("P2").c_str())); + base::StringPrintf( + "SetSrc('%s');", GetHTMLForGuestWithTitle("P2").c_str())); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); @@ -640,7 +641,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) { ExecuteSyncJSFunction( rvh, - StringPrintf("SetSrc('%s');", GetHTMLForGuestWithTitle("P3").c_str())); + base::StringPrintf( + "SetSrc('%s');", GetHTMLForGuestWithTitle("P3").c_str())); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); @@ -719,7 +721,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) { content::TitleWatcher title_watcher(test_embedder()->web_contents(), expected_title); - ExecuteSyncJSFunction(rvh, StringPrintf("SetTitle('%s');", "modified")); + ExecuteSyncJSFunction(rvh, + base::StringPrintf("SetTitle('%s');", "modified")); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); @@ -738,7 +741,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) { ExecuteSyncJSFunction( test_embedder()->web_contents()->GetRenderViewHost(), - StringPrintf("SetSrc('%s');", kHTMLForGuest)); + base::StringPrintf("SetSrc('%s');", kHTMLForGuest)); test_guest_manager()->WaitForGuestAdded(); const TestBrowserPluginGuestManager::GuestInstanceMap& instance_map = @@ -784,7 +787,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BackAfterTerminateGuest) { ExecuteSyncJSFunction( rvh, - StringPrintf("SetSrc('%s');", GetHTMLForGuestWithTitle("P2").c_str())); + base::StringPrintf( + "SetSrc('%s');", GetHTMLForGuestWithTitle("P2").c_str())); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); @@ -821,7 +825,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStart) { // Renavigate the guest to |kHTMLForGuest|. RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); - ExecuteSyncJSFunction(rvh, StringPrintf("SetSrc('%s');", kHTMLForGuest)); + ExecuteSyncJSFunction(rvh, + base::StringPrintf("SetSrc('%s');", kHTMLForGuest)); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); @@ -840,7 +845,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadAbort) { test_embedder()->web_contents()->GetRenderViewHost()); GURL test_url = test_server()->GetURL("close-socket"); ExecuteSyncJSFunction( - rvh, StringPrintf("SetSrc('%s');", test_url.spec().c_str())); + rvh, base::StringPrintf("SetSrc('%s');", test_url.spec().c_str())); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); } @@ -854,7 +859,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadAbort) { test_embedder()->web_contents()->GetRenderViewHost()); GURL test_url("chrome://newtab"); ExecuteSyncJSFunction( - rvh, StringPrintf("SetSrc('%s');", test_url.spec().c_str())); + rvh, base::StringPrintf("SetSrc('%s');", test_url.spec().c_str())); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); } @@ -868,7 +873,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadAbort) { test_embedder()->web_contents()->GetRenderViewHost()); GURL test_url("file://foo"); ExecuteSyncJSFunction( - rvh, StringPrintf("SetSrc('%s');", test_url.spec().c_str())); + rvh, base::StringPrintf("SetSrc('%s');", test_url.spec().c_str())); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); } @@ -888,7 +893,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) { RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); ExecuteSyncJSFunction( - rvh, StringPrintf("SetSrc('%s');", redirect_url.spec().c_str())); + rvh, base::StringPrintf("SetSrc('%s');", redirect_url.spec().c_str())); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); @@ -983,7 +988,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, PostMessage) { // By the time we get here 'contentWindow' should be ready because the // guest has completed loading. ExecuteSyncJSFunction( - rvh, StringPrintf("PostMessage('%s, false');", kTesting)); + rvh, base::StringPrintf("PostMessage('%s, false');", kTesting)); // The title will be updated to "main guest" at the last stage of the // process described above. @@ -1009,7 +1014,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) { expected_title); ExecuteSyncJSFunction( - rvh, StringPrintf("PostMessage('%s, false');", kTesting)); + rvh, base::StringPrintf("PostMessage('%s, false');", kTesting)); // The title will be updated to "main guest" at the last stage of the // process described above. @@ -1026,7 +1031,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) { "files/browser_plugin_post_message_guest.html"); ExecuteSyncJSFunction( guest_rvh, - StringPrintf("CreateChildFrame('%s');", test_url.spec().c_str())); + base::StringPrintf( + "CreateChildFrame('%s');", test_url.spec().c_str())); string16 actual_title = ready_watcher.WaitAndGetTitle(); EXPECT_EQ(ASCIIToUTF16("ready"), actual_title); @@ -1034,7 +1040,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) { content::TitleWatcher iframe_watcher(test_embedder()->web_contents(), ASCIIToUTF16("iframe")); ExecuteSyncJSFunction( - rvh, StringPrintf("PostMessage('%s', true);", kTesting)); + rvh, base::StringPrintf("PostMessage('%s', true);", kTesting)); // The title will be updated to "iframe" at the last stage of the // process described above. @@ -1053,7 +1059,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) { // Renavigate the guest to |kHTMLForGuest|. RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); - ExecuteSyncJSFunction(rvh, StringPrintf("SetSrc('%s');", kHTMLForGuest)); + ExecuteSyncJSFunction(rvh, + base::StringPrintf("SetSrc('%s');", kHTMLForGuest)); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); @@ -1064,13 +1071,14 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadCommit) { StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); const string16 expected_title = ASCIIToUTF16( - StringPrintf("loadCommit:%s", kHTMLForGuest)); + base::StringPrintf("loadCommit:%s", kHTMLForGuest)); content::TitleWatcher title_watcher( test_embedder()->web_contents(), expected_title); // Renavigate the guest to |kHTMLForGuest|. RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); - ExecuteSyncJSFunction(rvh, StringPrintf("SetSrc('%s');", kHTMLForGuest)); + ExecuteSyncJSFunction(rvh, + base::StringPrintf("SetSrc('%s');", kHTMLForGuest)); string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); @@ -1259,7 +1267,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AutoSizeAfterNavigation) { // Test for regression http://crbug.com/162961. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, GetRenderViewHostAtPositionTest) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - const std::string embedder_code = StringPrintf("SetSize(%d, %d);", 100, 100); + const std::string embedder_code = + base::StringPrintf("SetSize(%d, %d);", 100, 100); StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestWithSize, true, embedder_code); // Check for render view host at position (150, 150) that is outside the diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc index 5f705cd..fa0ca6d 100644 --- a/content/browser/devtools/devtools_http_handler_impl.cc +++ b/content/browser/devtools/devtools_http_handler_impl.cc @@ -704,7 +704,7 @@ void DevToolsHttpHandlerImpl::SendJson(int connection_id, std::string response; std::string mime_type = "application/json; charset=UTF-8"; - response = StringPrintf("%s%s", json_value.c_str(), message.c_str()); + response = base::StringPrintf("%s%s", json_value.c_str(), message.c_str()); thread_->message_loop()->PostTask( FROM_HERE, diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc index a62cd89..b602497 100644 --- a/content/browser/download/download_browsertest.cc +++ b/content/browser/download/download_browsertest.cc @@ -957,7 +957,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeInterruptedDownload) { ASSERT_TRUE(test_server()->Start()); GURL url = test_server()->GetURL( - StringPrintf("rangereset?size=%d&rst_boundary=%d", + base::StringPrintf("rangereset?size=%d&rst_boundary=%d", GetSafeBufferChunk() * 3, GetSafeBufferChunk())); DownloadItem* download(StartDownloadAndReturnItem(url)); @@ -1018,7 +1018,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeInterruptedDownloadNoRange) { // Auto-restart if server doesn't handle ranges. GURL url = test_server()->GetURL( - StringPrintf( + base::StringPrintf( // First download hits an RST, rest don't, no ranges. "rangereset?size=%d&rst_boundary=%d&" "token=NoRange&rst_limit=1&bounce_range", @@ -1066,7 +1066,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ASSERT_TRUE(test_server()->Start()); GURL url = test_server()->GetURL( - StringPrintf( + base::StringPrintf( // First download hits an RST, rest don't, precondition fail. "rangereset?size=%d&rst_boundary=%d&" "token=NoRange&rst_limit=1&fail_precondition=2", @@ -1116,7 +1116,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ASSERT_TRUE(test_server()->Start()); GURL url = test_server()->GetURL( - StringPrintf( + base::StringPrintf( // First download hits an RST, rest don't, no verifiers. "rangereset?size=%d&rst_boundary=%d&" "token=NoRange&rst_limit=1&no_verifiers", @@ -1160,7 +1160,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithDeletedFile) { ASSERT_TRUE(test_server()->Start()); GURL url = test_server()->GetURL( - StringPrintf( + base::StringPrintf( // First download hits an RST, rest don't "rangereset?size=%d&rst_boundary=%d&" "token=NoRange&rst_limit=1", diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc index 5ee2187..fb6b095 100644 --- a/content/browser/download/download_file_impl.cc +++ b/content/browser/download/download_file_impl.cc @@ -112,7 +112,7 @@ void DownloadFileImpl::RenameAndUniquify( file_util::GetUniquePathNumber(new_path, FILE_PATH_LITERAL("")); if (uniquifier > 0) { new_path = new_path.InsertBeforeExtensionASCII( - StringPrintf(" (%d)", uniquifier)); + base::StringPrintf(" (%d)", uniquifier)); } DownloadInterruptReason reason = file_.Rename(new_path); diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc index c9fe58c..752f16d 100644 --- a/content/browser/download/download_manager_impl.cc +++ b/content/browser/download/download_manager_impl.cc @@ -95,7 +95,7 @@ void BeginDownload(scoped_ptr<DownloadUrlParameters> params, if (params->offset() > 0) { request->SetExtraRequestHeaderByName( "Range", - StringPrintf("bytes=%" PRId64 "-", params->offset()), + base::StringPrintf("bytes=%" PRId64 "-", params->offset()), true); if (has_last_modified) { diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc index 45195e0..c5171ee 100644 --- a/content/browser/download/save_package.cc +++ b/content/browser/download/save_package.cc @@ -515,7 +515,7 @@ bool SavePackage::GenerateFileName(const std::string& disposition, } else { for (int i = ordinal_number; i < kMaxFileOrdinalNumber; ++i) { base::FilePath::StringType new_name = base_file_name + - StringPrintf(FILE_PATH_LITERAL("(%d)"), i) + file_name_ext; + base::StringPrintf(FILE_PATH_LITERAL("(%d)"), i) + file_name_ext; if (file_name_set_.find(new_name) == file_name_set_.end()) { // Resolved name conflict. file_name = new_name; diff --git a/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc b/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc index e6e6404..8fcb6c5 100644 --- a/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc +++ b/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc @@ -46,8 +46,8 @@ class GeolocationChromeOsWifiDataProviderTest : public testing::Test { std::string mac_address = base::StringPrintf("%02X:%02X:%02X:%02X:%02X:%02X", i, j, 3, 4, 5, 6); - std::string channel = StringPrintf("%d", i * 10 + j); - std::string strength = StringPrintf("%d", i * 100 + j); + std::string channel = base::StringPrintf("%d", i * 10 + j); + std::string strength = base::StringPrintf("%d", i * 100 + j); properties.SetStringWithoutPathExpansion( shill::kGeoMacAddressProperty, mac_address); properties.SetStringWithoutPathExpansion( diff --git a/content/browser/renderer_host/java/java_bound_object.cc b/content/browser/renderer_host/java/java_bound_object.cc index 5d50948..4a239a5 100644 --- a/content/browser/renderer_host/java/java_bound_object.cc +++ b/content/browser/renderer_host/java/java_bound_object.cc @@ -271,9 +271,9 @@ jvalue CoerceJavaScriptNumberToJavaValue(const NPVariant& variant, result.l = coerce_to_string ? ConvertUTF8ToJavaString( AttachCurrentThread(), - is_double ? StringPrintf("%.6lg", NPVARIANT_TO_DOUBLE(variant)) : - base::Int64ToString(NPVARIANT_TO_INT32(variant))). - Release() : + is_double ? + base::StringPrintf("%.6lg", NPVARIANT_TO_DOUBLE(variant)) : + base::Int64ToString(NPVARIANT_TO_INT32(variant))).Release() : NULL; break; case JavaType::TypeBoolean: diff --git a/content/browser/renderer_host/java/java_bridge_channel_host.cc b/content/browser/renderer_host/java/java_bridge_channel_host.cc index 20039e8..5b40ab4 100644 --- a/content/browser/renderer_host/java/java_bridge_channel_host.cc +++ b/content/browser/renderer_host/java/java_bridge_channel_host.cc @@ -39,7 +39,7 @@ JavaBridgeChannelHost::~JavaBridgeChannelHost() { JavaBridgeChannelHost* JavaBridgeChannelHost::GetJavaBridgeChannelHost( int renderer_id, base::MessageLoopProxy* ipc_message_loop) { - std::string channel_name(StringPrintf("r%d.javabridge", renderer_id)); + std::string channel_name(base::StringPrintf("r%d.javabridge", renderer_id)); // There's no need for a shutdown event here. If the browser is terminated // while the JavaBridgeChannelHost is blocked on a synchronous IPC call, the // renderer's shutdown event will cause the underlying channel to shut down, diff --git a/content/browser/renderer_host/media/video_capture_host_unittest.cc b/content/browser/renderer_host/media/video_capture_host_unittest.cc index 89bdf36..4c6334f 100644 --- a/content/browser/renderer_host/media/video_capture_host_unittest.cc +++ b/content/browser/renderer_host/media/video_capture_host_unittest.cc @@ -53,8 +53,8 @@ class DumpVideo { public: DumpVideo() : expected_size_(0) {} void StartDump(int width, int height) { - base::FilePath file_name = base::FilePath( - StringPrintf(FILE_PATH_LITERAL("dump_w%d_h%d.yuv"), width, height)); + base::FilePath file_name = base::FilePath(base::StringPrintf( + FILE_PATH_LITERAL("dump_w%d_h%d.yuv"), width, height)); file_.reset(file_util::OpenFile(file_name, "wb")); expected_size_ = width * height * 3 / 2; } diff --git a/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc b/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc index 8bb0e35..b53eadd 100644 --- a/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc +++ b/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc @@ -490,8 +490,9 @@ TEST_F(WebContentsVideoCaptureDeviceTest, GoesThroughAllTheMotions) { bool use_video_frames = false; for (int i = 0; i < 4; i++, use_video_frames = !use_video_frames) { - SCOPED_TRACE(StringPrintf("Using %s copy path, iteration #%d", - use_video_frames ? "VideoFrame" : "SkBitmap", i)); + SCOPED_TRACE(base::StringPrintf( + "Using %s copy path, iteration #%d", + use_video_frames ? "VideoFrame" : "SkBitmap", i)); source()->SetCanCopyToVideoFrame(use_video_frames); source()->SetSolidColor(SK_ColorRED); ASSERT_NO_FATAL_FAILURE(source()->WaitForNextBackingStoreCopy()); diff --git a/content/browser/web_contents/navigation_controller_impl_unittest.cc b/content/browser/web_contents/navigation_controller_impl_unittest.cc index 22b55a8..1d698b3 100644 --- a/content/browser/web_contents/navigation_controller_impl_unittest.cc +++ b/content/browser/web_contents/navigation_controller_impl_unittest.cc @@ -1985,7 +1985,7 @@ TEST_F(NavigationControllerTest, EnforceMaxNavigationCount) { int url_index; // Load up to the max count, all entries should be there. for (url_index = 0; url_index < kMaxEntryCount; url_index++) { - GURL url(StringPrintf("http://www.a.com/%d", url_index)); + GURL url(base::StringPrintf("http://www.a.com/%d", url_index)); controller.LoadURL( url, Referrer(), PAGE_TRANSITION_TYPED, std::string()); test_rvh()->SendNavigate(url_index, url); @@ -1997,7 +1997,7 @@ TEST_F(NavigationControllerTest, EnforceMaxNavigationCount) { PrunedListener listener(&controller); // Navigate some more. - GURL url(StringPrintf("http://www.a.com/%d", url_index)); + GURL url(base::StringPrintf("http://www.a.com/%d", url_index)); controller.LoadURL( url, Referrer(), PAGE_TRANSITION_TYPED, std::string()); test_rvh()->SendNavigate(url_index, url); @@ -2015,7 +2015,7 @@ TEST_F(NavigationControllerTest, EnforceMaxNavigationCount) { // More navigations. for (int i = 0; i < 3; i++) { - url = GURL(StringPrintf("http:////www.a.com/%d", url_index)); + url = GURL(base::StringPrintf("http:////www.a.com/%d", url_index)); controller.LoadURL( url, Referrer(), PAGE_TRANSITION_TYPED, std::string()); test_rvh()->SendNavigate(url_index, url); diff --git a/content/browser/worker_host/test/worker_browsertest.cc b/content/browser/worker_host/test/worker_browsertest.cc index 0c335b6..6ef70b6 100644 --- a/content/browser/worker_host/test/worker_browsertest.cc +++ b/content/browser/worker_host/test/worker_browsertest.cc @@ -351,7 +351,7 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_LimitPerPage) { IN_PROC_BROWSER_TEST_F(WorkerTest, LimitPerPage) { #endif int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; - std::string query = StringPrintf("?count=%d", max_workers_per_tab + 1); + std::string query = base::StringPrintf("?count=%d", max_workers_per_tab + 1); GURL url = GetTestURL("many_shared_workers.html", query); NavigateToURL(shell(), url); @@ -374,15 +374,17 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, LimitTotal) { int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; int total_workers = WorkerServiceImpl::kMaxWorkersWhenSeparate; - std::string query = StringPrintf("?count=%d", max_workers_per_tab); + std::string query = base::StringPrintf("?count=%d", max_workers_per_tab); GURL url = GetTestURL("many_shared_workers.html", query); - NavigateToURL(shell(), GURL(url.spec() + StringPrintf("&client_id=0"))); + NavigateToURL(shell(), + GURL(url.spec() + base::StringPrintf("&client_id=0"))); // Adding 1 so that we cause some workers to be queued. int tab_count = (total_workers / max_workers_per_tab) + 1; for (int i = 1; i < tab_count; ++i) { NavigateToURL( - CreateBrowser(), GURL(url.spec() + StringPrintf("&client_id=%d", i))); + CreateBrowser(), + GURL(url.spec() + base::StringPrintf("&client_id=%d", i))); } // Check that we didn't create more than the max number of workers. @@ -406,7 +408,7 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, QueuedSharedWorkerShutdown) { // Tests to make sure that queued shared workers are started up when shared // workers shut down. int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; - std::string query = StringPrintf("?count=%d", max_workers_per_tab); + std::string query = base::StringPrintf("?count=%d", max_workers_per_tab); RunTest("queued_shared_worker_shutdown.html", query); ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); } @@ -418,7 +420,7 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_MultipleTabsQueuedSharedWorker) { // Tests to make sure that only one instance of queued shared workers are // started up even when those instances are on multiple tabs. int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; - std::string query = StringPrintf("?count=%d", max_workers_per_tab + 1); + std::string query = base::StringPrintf("?count=%d", max_workers_per_tab + 1); GURL url = GetTestURL("many_shared_workers.html", query); NavigateToURL(shell(), url); ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); @@ -441,7 +443,7 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_QueuedSharedWorkerStartedFromOtherTa // Tests to make sure that queued shared workers are started up when // an instance is launched from another tab. int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; - std::string query = StringPrintf("?count=%d", max_workers_per_tab + 1); + std::string query = base::StringPrintf("?count=%d", max_workers_per_tab + 1); GURL url = GetTestURL("many_shared_workers.html", query); NavigateToURL(shell(), url); ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); @@ -449,7 +451,7 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_QueuedSharedWorkerStartedFromOtherTa // First window has hit its limit. Now launch second window which creates // the same worker that was queued in the first window, to ensure it gets // connected to the first window too. - query = StringPrintf("?id=%d", max_workers_per_tab); + query = base::StringPrintf("?id=%d", max_workers_per_tab); url = GetTestURL("single_shared_worker.html", query); NavigateToURL(CreateBrowser(), url); diff --git a/content/common/content_param_traits.cc b/content/common/content_param_traits.cc index f080331..63f8468 100644 --- a/content/common/content_param_traits.cc +++ b/content/common/content_param_traits.cc @@ -129,7 +129,8 @@ bool ParamTraits<NPVariant_Param>::Read(const Message* m, } void ParamTraits<NPVariant_Param>::Log(const param_type& p, std::string* l) { - l->append(StringPrintf("NPVariant_Param(%d, ", static_cast<int>(p.type))); + l->append( + base::StringPrintf("NPVariant_Param(%d, ", static_cast<int>(p.type))); if (p.type == content::NPVARIANT_PARAM_BOOL) { LogParam(p.bool_value, l); } else if (p.type == content::NPVARIANT_PARAM_INT) { diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc index f1d5516..54ac7c1 100644 --- a/content/gpu/gpu_info_collector_win.cc +++ b/content/gpu/gpu_info_collector_win.cc @@ -498,13 +498,13 @@ bool CollectContextGraphicsInfo(content::GPUInfo* gpu_info) { &pixel_shader_minor_version)) { gpu_info->can_lose_context = direct3d_version == "9"; gpu_info->vertex_shader_version = - StringPrintf("%d.%d", - vertex_shader_major_version, - vertex_shader_minor_version); + base::StringPrintf("%d.%d", + vertex_shader_major_version, + vertex_shader_minor_version); gpu_info->pixel_shader_version = - StringPrintf("%d.%d", - pixel_shader_major_version, - pixel_shader_minor_version); + base::StringPrintf("%d.%d", + pixel_shader_major_version, + pixel_shader_minor_version); // DirectX diagnostics are collected asynchronously because it takes a // couple of seconds. Do not mark gpu_info as complete until that is done. diff --git a/content/plugin/plugin_channel.cc b/content/plugin/plugin_channel.cc index 79754fa..8569a3d 100644 --- a/content/plugin/plugin_channel.cc +++ b/content/plugin/plugin_channel.cc @@ -143,7 +143,7 @@ class PluginChannel::MessageFilter : public IPC::ChannelProxy::MessageFilter { PluginChannel* PluginChannel::GetPluginChannel( int renderer_id, base::MessageLoopProxy* ipc_message_loop) { // Map renderer ID to a (single) channel to that process. - std::string channel_key = StringPrintf( + std::string channel_key = base::StringPrintf( "%d.r%d", base::GetCurrentProcId(), renderer_id); PluginChannel* channel = diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index bed78b8..373e7cce 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -410,7 +410,8 @@ bool PpapiThread::SetupRendererChannel(base::ProcessId renderer_pid, DCHECK(is_broker_ == (connect_instance_func_ != NULL)); IPC::ChannelHandle plugin_handle; plugin_handle.name = IPC::Channel::GenerateVerifiedChannelID( - StringPrintf("%d.r%d", base::GetCurrentProcId(), renderer_child_id)); + base::StringPrintf( + "%d.r%d", base::GetCurrentProcId(), renderer_child_id)); ppapi::proxy::ProxyChannel* dispatcher = NULL; bool init_result = false; diff --git a/content/public/test/render_widget_test.cc b/content/public/test/render_widget_test.cc index 260776d..8d8e897 100644 --- a/content/public/test/render_widget_test.cc +++ b/content/public/test/render_widget_test.cc @@ -74,7 +74,7 @@ void RenderWidgetTest::ResizeAndPaint(const gfx::Size& page_size, void RenderWidgetTest::TestResizeAndPaint() { // Hello World message is only visible if the view size is at least // kTextPositionX x kTextPositionY - LoadHTML(StringPrintf( + LoadHTML(base::StringPrintf( "<html><body><div style='position: absolute; top: %d; left: " "%d; background-color: red;'>Hello World</div></body></html>", kTextPositionY, kTextPositionX).c_str()); diff --git a/content/renderer/browser_plugin/browser_plugin_browsertest.cc b/content/renderer/browser_plugin/browser_plugin_browsertest.cc index 723ef18..e8f38ee 100644 --- a/content/renderer/browser_plugin/browser_plugin_browsertest.cc +++ b/content/renderer/browser_plugin/browser_plugin_browsertest.cc @@ -47,8 +47,8 @@ const char kHTMLForPartitionedPersistedPluginObject[] = " src='foo' type='%s' partition='persist:someid'>"; std::string GetHTMLForBrowserPluginObject() { - return StringPrintf(kHTMLForBrowserPluginObject, - content::kBrowserPluginMimeType); + return base::StringPrintf(kHTMLForBrowserPluginObject, + content::kBrowserPluginMimeType); } } // namespace @@ -198,8 +198,8 @@ TEST_F(BrowserPluginTest, InitialResize) { // parsed on initialization. However, this test does minimal checking of // correct behavior. TEST_F(BrowserPluginTest, ParseAllAttributes) { - std::string html = StringPrintf(kHTMLForBrowserPluginWithAllAttributes, - content::kBrowserPluginMimeType); + std::string html = base::StringPrintf(kHTMLForBrowserPluginWithAllAttributes, + content::kBrowserPluginMimeType); LoadHTML(html.c_str()); bool result; bool has_value = ExecuteScriptAndReturnBool( @@ -448,8 +448,8 @@ TEST_F(BrowserPluginTest, RemovePlugin) { // This test verifies that PluginDestroyed messages do not get sent from a // BrowserPlugin that has never navigated. TEST_F(BrowserPluginTest, RemovePluginBeforeNavigation) { - std::string html = StringPrintf(kHTMLForSourcelessPluginObject, - content::kBrowserPluginMimeType); + std::string html = base::StringPrintf(kHTMLForSourcelessPluginObject, + content::kBrowserPluginMimeType); LoadHTML(html.c_str()); EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching( BrowserPluginHostMsg_PluginDestroyed::ID)); @@ -544,15 +544,15 @@ TEST_F(BrowserPluginTest, ReloadMethod) { // Verify that the 'partition' attribute on the browser plugin is parsed // correctly. TEST_F(BrowserPluginTest, PartitionAttribute) { - std::string html = StringPrintf(kHTMLForPartitionedPluginObject, - content::kBrowserPluginMimeType); + std::string html = base::StringPrintf(kHTMLForPartitionedPluginObject, + content::kBrowserPluginMimeType); LoadHTML(html.c_str()); std::string partition_value = ExecuteScriptAndReturnString( "document.getElementById('browserplugin').partition"); EXPECT_STREQ("someid", partition_value.c_str()); - html = StringPrintf(kHTMLForPartitionedPersistedPluginObject, - content::kBrowserPluginMimeType); + html = base::StringPrintf(kHTMLForPartitionedPersistedPluginObject, + content::kBrowserPluginMimeType); LoadHTML(html.c_str()); partition_value = ExecuteScriptAndReturnString( "document.getElementById('browserplugin').partition"); @@ -571,8 +571,8 @@ TEST_F(BrowserPluginTest, PartitionAttribute) { title.c_str()); // Load a browser tag without 'src' defined. - html = StringPrintf(kHTMLForSourcelessPluginObject, - content::kBrowserPluginMimeType); + html = base::StringPrintf(kHTMLForSourcelessPluginObject, + content::kBrowserPluginMimeType); LoadHTML(html.c_str()); // Ensure we don't parse just "persist:" string and return exception. @@ -588,8 +588,8 @@ TEST_F(BrowserPluginTest, PartitionAttribute) { // This test verifies that BrowserPlugin enters an error state when the // partition attribute is invalid. TEST_F(BrowserPluginTest, InvalidPartition) { - std::string html = StringPrintf(kHTMLForInvalidPartitionedPluginObject, - content::kBrowserPluginMimeType); + std::string html = base::StringPrintf(kHTMLForInvalidPartitionedPluginObject, + content::kBrowserPluginMimeType); LoadHTML(html.c_str()); // Attempt to navigate with an invalid partition. { @@ -634,8 +634,8 @@ TEST_F(BrowserPluginTest, InvalidPartition) { // Test to verify that after the first navigation, the partition attribute // cannot be modified. TEST_F(BrowserPluginTest, ImmutableAttributesAfterNavigation) { - std::string html = StringPrintf(kHTMLForSourcelessPluginObject, - content::kBrowserPluginMimeType); + std::string html = base::StringPrintf(kHTMLForSourcelessPluginObject, + content::kBrowserPluginMimeType); LoadHTML(html.c_str()); ExecuteJavaScript( @@ -828,8 +828,8 @@ TEST_F(BrowserPluginTest, RemoveBrowserPluginOnExit) { } TEST_F(BrowserPluginTest, AutoSizeAttributes) { - std::string html = StringPrintf(kHTMLForSourcelessPluginObject, - content::kBrowserPluginMimeType); + std::string html = base::StringPrintf(kHTMLForSourcelessPluginObject, + content::kBrowserPluginMimeType); LoadHTML(html.c_str()); const char* kSetAutoSizeParametersAndNavigate = "var browserplugin = document.getElementById('browserplugin');" diff --git a/content/renderer/media/media_stream_impl.cc b/content/renderer/media/media_stream_impl.cc index e89a9ac..c9a225d 100644 --- a/content/renderer/media/media_stream_impl.cc +++ b/content/renderer/media/media_stream_impl.cc @@ -84,9 +84,9 @@ void CreateWebKitSourceVector( for (size_t i = 0; i < devices.size(); ++i) { const char* track_type = (type == WebKit::WebMediaStreamSource::TypeAudio) ? "a" : "v"; - std::string source_id = StringPrintf("%s%s%u", label.c_str(), - track_type, - static_cast<unsigned int>(i)); + std::string source_id = base::StringPrintf("%s%s%u", label.c_str(), + track_type, + static_cast<unsigned int>(i)); webkit_sources[i].initialize( UTF8ToUTF16(source_id), type, diff --git a/content/renderer/media/mock_media_stream_dispatcher.cc b/content/renderer/media/mock_media_stream_dispatcher.cc index ac8963a..09858c1 100644 --- a/content/renderer/media/mock_media_stream_dispatcher.cc +++ b/content/renderer/media/mock_media_stream_dispatcher.cc @@ -26,7 +26,7 @@ void MockMediaStreamDispatcher::GenerateStream( const GURL& url) { request_id_ = request_id; - stream_label_ = StringPrintf("%s%d","local_stream",request_id); + stream_label_ = base::StringPrintf("%s%d","local_stream",request_id); audio_array_.clear(); video_array_.clear(); diff --git a/content/test/layout_browsertest.cc b/content/test/layout_browsertest.cc index 0140aff..4c34a38 100644 --- a/content/test/layout_browsertest.cc +++ b/content/test/layout_browsertest.cc @@ -140,7 +140,7 @@ void InProcessBrowserLayoutTest::RunLayoutTest( void InProcessBrowserLayoutTest::RunHttpLayoutTest( const std::string& test_case_file_name) { DCHECK(test_http_server_.get()); - GURL url(StringPrintf( + GURL url(base::StringPrintf( "http://127.0.0.1:%d/%s/%s", port_, test_case_dir_.MaybeAsASCII().c_str(), test_case_file_name.c_str())); RunLayoutTestInternal(test_case_file_name, url); @@ -205,9 +205,9 @@ std::string InProcessBrowserLayoutTest::SaveResults(const std::string& expected, EXPECT_NE(-1, file_util::WriteFile(actual_filename, actual.c_str(), actual.size())); - return StringPrintf("Wrote %"PRFilePath" %"PRFilePath, - expected_filename.value().c_str(), - actual_filename.value().c_str()); + return base::StringPrintf("Wrote %"PRFilePath" %"PRFilePath, + expected_filename.value().c_str(), + actual_filename.value().c_str()); } } // namespace content diff --git a/courgette/adjustment_method.cc b/courgette/adjustment_method.cc index 53745d7..ac0f0a1 100644 --- a/courgette/adjustment_method.cc +++ b/courgette/adjustment_method.cc @@ -169,7 +169,7 @@ static std::string ToString(Node* node) { prefix.pop_back(); } - s += StringPrintf("%u", node->count_); + s += base::StringPrintf("%u", node->count_); s += " @"; s += base::Uint64ToString(node->edges_in_frequency_order.size()); s += "}"; diff --git a/courgette/memory_monitor.cc b/courgette/memory_monitor.cc index dba8a88..89f82fb 100644 --- a/courgette/memory_monitor.cc +++ b/courgette/memory_monitor.cc @@ -16,17 +16,17 @@ struct H { int i = 0; for (M::iterator p = m_.begin(); p != m_.end(); ++p, ++i) { size_t s = p->first; - LOG(INFO) << StringPrintf("%3d %8u: %8u %8u %8u %8u", i, s, + LOG(INFO) << base::StringPrintf("%3d %8u: %8u %8u %8u %8u", i, s, m_[s], c_[s], h_[s], h_[s] * s); } LOG(INFO) << "Peak " << fmt(high_); } std::string fmt(size_t s) { - if (s > 1000000000) return StringPrintf("%.3gG", s/(1000000000.0)); - if (s > 1000000) return StringPrintf("%.3gM", s/(1000000.)); - if (s > 9999) return StringPrintf("%.3gk", s/(1000.)); - return StringPrintf("%d", (int)s); + if (s > 1000000000) return base::StringPrintf("%.3gG", s/(1000000000.0)); + if (s > 1000000) return base::StringPrintf("%.3gM", s/(1000000.)); + if (s > 9999) return base::StringPrintf("%.3gk", s/(1000.)); + return base::StringPrintf("%d", (int)s); } void tick(size_t w, char sign) { diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc index a53fa40..0d4b1141 100644 --- a/crypto/nss_util.cc +++ b/crypto/nss_util.cc @@ -73,7 +73,7 @@ std::string GetNSSErrorMessage() { PRInt32 copied = PR_GetErrorText(error_text.get()); result = std::string(error_text.get(), copied); } else { - result = StringPrintf("NSS error code: %d", PR_GetError()); + result = base::StringPrintf("NSS error code: %d", PR_GetError()); } return result; } @@ -482,7 +482,7 @@ class NSSInitSingleton { // Initialize with a persistent database (likely, ~/.pki/nssdb). // Use "sql:" which can be shared by multiple processes safely. std::string nss_config_dir = - StringPrintf("sql:%s", database_dir.value().c_str()); + base::StringPrintf("sql:%s", database_dir.value().c_str()); #if defined(OS_CHROMEOS) status = NSS_Init(nss_config_dir.c_str()); #else @@ -586,7 +586,7 @@ class NSSInitSingleton { SECMODModule* LoadModule(const char* name, const char* library_path, const char* params) { - std::string modparams = StringPrintf( + std::string modparams = base::StringPrintf( "name=\"%s\" library=\"%s\" %s", name, library_path, params ? params : ""); @@ -608,8 +608,8 @@ class NSSInitSingleton { static PK11SlotInfo* OpenUserDB(const base::FilePath& path, const char* description) { const std::string modspec = - StringPrintf("configDir='sql:%s' tokenDescription='%s'", - path.value().c_str(), description); + base::StringPrintf("configDir='sql:%s' tokenDescription='%s'", + path.value().c_str(), description); PK11SlotInfo* db_slot = SECMOD_OpenUserDB(modspec.c_str()); if (db_slot) { if (PK11_NeedUserInit(db_slot)) diff --git a/dbus/dbus_statistics.cc b/dbus/dbus_statistics.cc index 8368c4c..eeb2f0ac 100644 --- a/dbus/dbus_statistics.cc +++ b/dbus/dbus_statistics.cc @@ -220,34 +220,35 @@ std::string GetAsString(ShowInString show, FormatString format) { if (show >= SHOW_METHOD) line += "." + stat->method; } - line += StringPrintf(":"); + line += base::StringPrintf(":"); if (sent_blocking) { - line += StringPrintf(" Sent (BLOCKING):"); + line += base::StringPrintf(" Sent (BLOCKING):"); if (format == FORMAT_TOTALS) - line += StringPrintf(" %d", sent_blocking); + line += base::StringPrintf(" %d", sent_blocking); else if (format == FORMAT_PER_MINUTE) - line += StringPrintf(" %d/min", sent_blocking / dminutes); + line += base::StringPrintf(" %d/min", sent_blocking / dminutes); else if (format == FORMAT_ALL) - line += StringPrintf(" %d (%d/min)", - sent_blocking, sent_blocking / dminutes); + line += base::StringPrintf(" %d (%d/min)", + sent_blocking, sent_blocking / dminutes); } if (sent) { - line += StringPrintf(" Sent:"); + line += base::StringPrintf(" Sent:"); if (format == FORMAT_TOTALS) - line += StringPrintf(" %d", sent); + line += base::StringPrintf(" %d", sent); else if (format == FORMAT_PER_MINUTE) - line += StringPrintf(" %d/min", sent / dminutes); + line += base::StringPrintf(" %d/min", sent / dminutes); else if (format == FORMAT_ALL) - line += StringPrintf(" %d (%d/min)", sent, sent / dminutes); + line += base::StringPrintf(" %d (%d/min)", sent, sent / dminutes); } if (received) { - line += StringPrintf(" Received:"); + line += base::StringPrintf(" Received:"); if (format == FORMAT_TOTALS) - line += StringPrintf(" %d", received); + line += base::StringPrintf(" %d", received); else if (format == FORMAT_PER_MINUTE) - line += StringPrintf(" %d/min", received / dminutes); + line += base::StringPrintf(" %d/min", received / dminutes); else if (format == FORMAT_ALL) - line += StringPrintf(" %d (%d/min)", received, received / dminutes); + line += base::StringPrintf( + " %d (%d/min)", received, received / dminutes); } result += line + "\n"; sent = 0; diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc index c40a3be..822fc98 100644 --- a/google_apis/gaia/gaia_auth_fetcher.cc +++ b/google_apis/gaia/gaia_auth_fetcher.cc @@ -306,9 +306,9 @@ std::string GaiaAuthFetcher::MakeGetAuthCodeBody() { GaiaUrls::GetInstance()->oauth1_login_scope(), true); std::string encoded_client_id = net::EscapeUrlEncodedData( GaiaUrls::GetInstance()->oauth2_chrome_client_id(), true); - return StringPrintf(kClientLoginToOAuth2BodyFormat, - encoded_scope.c_str(), - encoded_client_id.c_str()); + return base::StringPrintf(kClientLoginToOAuth2BodyFormat, + encoded_scope.c_str(), + encoded_client_id.c_str()); } // static @@ -321,11 +321,11 @@ std::string GaiaAuthFetcher::MakeGetTokenPairBody( std::string encoded_client_secret = net::EscapeUrlEncodedData( GaiaUrls::GetInstance()->oauth2_chrome_client_secret(), true); std::string encoded_auth_code = net::EscapeUrlEncodedData(auth_code, true); - return StringPrintf(kOAuth2CodeToTokenPairBodyFormat, - encoded_scope.c_str(), - encoded_client_id.c_str(), - encoded_client_secret.c_str(), - encoded_auth_code.c_str()); + return base::StringPrintf(kOAuth2CodeToTokenPairBodyFormat, + encoded_scope.c_str(), + encoded_client_id.c_str(), + encoded_client_secret.c_str(), + encoded_auth_code.c_str()); } // static @@ -352,7 +352,7 @@ std::string GaiaAuthFetcher::MakeMergeSessionBody( // static std::string GaiaAuthFetcher::MakeGetAuthCodeHeader( const std::string& auth_token) { - return StringPrintf(kAuthHeaderFormat, auth_token.c_str()); + return base::StringPrintf(kAuthHeaderFormat, auth_token.c_str()); } // Helper method that extracts tokens from a successful reply. @@ -450,9 +450,9 @@ std::string GaiaAuthFetcher::MakeOAuthLoginBody(const std::string& service, const std::string& source) { std::string encoded_service = net::EscapeUrlEncodedData(service, true); std::string encoded_source = net::EscapeUrlEncodedData(source, true); - return StringPrintf(kOAuthLoginFormat, - encoded_service.c_str(), - encoded_source.c_str()); + return base::StringPrintf(kOAuthLoginFormat, + encoded_service.c_str(), + encoded_source.c_str()); } // static diff --git a/google_apis/gaia/oauth2_access_token_fetcher.cc b/google_apis/gaia/oauth2_access_token_fetcher.cc index 0cd4456..edefa7e 100644 --- a/google_apis/gaia/oauth2_access_token_fetcher.cc +++ b/google_apis/gaia/oauth2_access_token_fetcher.cc @@ -188,14 +188,14 @@ std::string OAuth2AccessTokenFetcher::MakeGetAccessTokenBody( std::string enc_refresh_token = net::EscapeUrlEncodedData(refresh_token, true); if (scopes.empty()) { - return StringPrintf( + return base::StringPrintf( kGetAccessTokenBodyFormat, enc_client_id.c_str(), enc_client_secret.c_str(), enc_refresh_token.c_str()); } else { std::string scopes_string = JoinString(scopes, ' '); - return StringPrintf( + return base::StringPrintf( kGetAccessTokenBodyWithScopeFormat, enc_client_id.c_str(), enc_client_secret.c_str(), diff --git a/google_apis/gaia/oauth2_api_call_flow.cc b/google_apis/gaia/oauth2_api_call_flow.cc index f8a804d..a6a267c 100644 --- a/google_apis/gaia/oauth2_api_call_flow.cc +++ b/google_apis/gaia/oauth2_api_call_flow.cc @@ -28,7 +28,7 @@ static const char kAuthorizationHeaderFormat[] = "Authorization: Bearer %s"; static std::string MakeAuthorizationHeader(const std::string& auth_token) { - return StringPrintf(kAuthorizationHeaderFormat, auth_token.c_str()); + return base::StringPrintf(kAuthorizationHeaderFormat, auth_token.c_str()); } } // namespace diff --git a/google_apis/gaia/oauth2_mint_token_fetcher.cc b/google_apis/gaia/oauth2_mint_token_fetcher.cc index 051f9ab..c5dfc05 100644 --- a/google_apis/gaia/oauth2_mint_token_fetcher.cc +++ b/google_apis/gaia/oauth2_mint_token_fetcher.cc @@ -163,7 +163,7 @@ GURL OAuth2MintTokenFetcher::MakeMintTokenUrl() { // static std::string OAuth2MintTokenFetcher::MakeMintTokenHeader( const std::string& access_token) { - return StringPrintf(kAuthorizationHeaderFormat, access_token.c_str()); + return base::StringPrintf(kAuthorizationHeaderFormat, access_token.c_str()); } // static @@ -171,7 +171,7 @@ std::string OAuth2MintTokenFetcher::MakeMintTokenBody( const std::string& client_id, const std::vector<std::string>& scopes, const std::string& origin) { - return StringPrintf( + return base::StringPrintf( kOAuth2IssueTokenBodyFormat, net::EscapeUrlEncodedData(JoinString(scopes, ','), true).c_str(), net::EscapeUrlEncodedData(client_id, true).c_str(), diff --git a/google_apis/gaia/oauth2_mint_token_flow.cc b/google_apis/gaia/oauth2_mint_token_flow.cc index 88f2878a..42fc4ef 100644 --- a/google_apis/gaia/oauth2_mint_token_flow.cc +++ b/google_apis/gaia/oauth2_mint_token_flow.cc @@ -139,7 +139,7 @@ std::string OAuth2MintTokenFlow::CreateApiCallBody() { (parameters_.mode == MODE_MINT_TOKEN_NO_FORCE || parameters_.mode == MODE_MINT_TOKEN_FORCE) ? kResponseTypeValueToken : kResponseTypeValueNone; - return StringPrintf( + return base::StringPrintf( kOAuth2IssueTokenBodyFormat, net::EscapeUrlEncodedData(force_value, true).c_str(), net::EscapeUrlEncodedData(response_type_value, true).c_str(), diff --git a/google_apis/gaia/oauth2_revocation_fetcher.cc b/google_apis/gaia/oauth2_revocation_fetcher.cc index f5c7df1..eeec213 100644 --- a/google_apis/gaia/oauth2_revocation_fetcher.cc +++ b/google_apis/gaia/oauth2_revocation_fetcher.cc @@ -154,7 +154,7 @@ GURL OAuth2RevocationFetcher::MakeRevocationUrl() { // static std::string OAuth2RevocationFetcher::MakeRevocationHeader( const std::string& access_token) { - return StringPrintf(kAuthorizationHeaderFormat, access_token.c_str()); + return base::StringPrintf(kAuthorizationHeaderFormat, access_token.c_str()); } // static @@ -163,7 +163,7 @@ std::string OAuth2RevocationFetcher::MakeRevocationBody( const std::string& origin) { std::string enc_client_id = net::EscapeUrlEncodedData(client_id, true); std::string enc_origin = net::EscapeUrlEncodedData(origin, true); - return StringPrintf( + return base::StringPrintf( kRevocationBodyFormat, enc_client_id.c_str(), enc_origin.c_str()); diff --git a/google_apis/gaia/oauth_request_signer.cc b/google_apis/gaia/oauth_request_signer.cc index 8e90ac8..b5d138f 100644 --- a/google_apis/gaia/oauth_request_signer.cc +++ b/google_apis/gaia/oauth_request_signer.cc @@ -79,12 +79,12 @@ const std::string SignatureMethodName( std::string BuildBaseString(const GURL& request_base_url, OAuthRequestSigner::HttpMethod http_method, const std::string& base_parameters) { - return StringPrintf("%s&%s&%s", - HttpMethodName(http_method).c_str(), - OAuthRequestSigner::Encode( - request_base_url.spec()).c_str(), - OAuthRequestSigner::Encode( - base_parameters).c_str()); + return base::StringPrintf("%s&%s&%s", + HttpMethodName(http_method).c_str(), + OAuthRequestSigner::Encode( + request_base_url.spec()).c_str(), + OAuthRequestSigner::Encode( + base_parameters).c_str()); } std::string BuildBaseStringParameters( @@ -448,9 +448,10 @@ bool OAuthRequestSigner::SignAuthHeader( else signed_text += ", "; signed_text += - StringPrintf("%s=\"%s\"", - OAuthRequestSigner::Encode(param->first).c_str(), - OAuthRequestSigner::Encode(param->second).c_str()); + base::StringPrintf( + "%s=\"%s\"", + OAuthRequestSigner::Encode(param->first).c_str(), + OAuthRequestSigner::Encode(param->second).c_str()); } *signed_text_return = signed_text; } diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc index 21f14c1..0691a9a 100644 --- a/ipc/ipc_logging.cc +++ b/ipc/ipc_logging.cc @@ -241,7 +241,7 @@ void Logging::Log(const LogData& data) { if (enabled_on_stderr_) { std::string message_name; if (data.message_name.empty()) { - message_name = StringPrintf("[unknown type %d]", data.type); + message_name = base::StringPrintf("[unknown type %d]", data.type); } else { message_name = data.message_name; } diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc index 718e759..f3e40fa 100644 --- a/ipc/ipc_message_utils.cc +++ b/ipc/ipc_message_utils.cc @@ -39,11 +39,12 @@ void LogBytes(const std::vector<CharType>& data, std::string* out) { if (isprint(data[i])) out->push_back(data[i]); else - out->append(StringPrintf("[%02X]", static_cast<unsigned char>(data[i]))); + out->append( + base::StringPrintf("[%02X]", static_cast<unsigned char>(data[i]))); } if (data.size() > kMaxBytesToLog) { out->append( - StringPrintf(" and %u more bytes", + base::StringPrintf(" and %u more bytes", static_cast<unsigned>(data.size() - kMaxBytesToLog))); } #endif @@ -309,7 +310,7 @@ bool ParamTraits<float>::Read(const Message* m, PickleIterator* iter, } void ParamTraits<float>::Log(const param_type& p, std::string* l) { - l->append(StringPrintf("%e", p)); + l->append(base::StringPrintf("%e", p)); } void ParamTraits<double>::Write(Message* m, const param_type& p) { @@ -330,7 +331,7 @@ bool ParamTraits<double>::Read(const Message* m, PickleIterator* iter, } void ParamTraits<double>::Log(const param_type& p, std::string* l) { - l->append(StringPrintf("%e", p)); + l->append(base::StringPrintf("%e", p)); } @@ -481,9 +482,9 @@ bool ParamTraits<base::FileDescriptor>::Read(const Message* m, void ParamTraits<base::FileDescriptor>::Log(const param_type& p, std::string* l) { if (p.auto_close) { - l->append(StringPrintf("FD(%d auto-close)", p.fd)); + l->append(base::StringPrintf("FD(%d auto-close)", p.fd)); } else { - l->append(StringPrintf("FD(%d)", p.fd)); + l->append(base::StringPrintf("FD(%d)", p.fd)); } } #endif // defined(OS_POSIX) @@ -668,7 +669,7 @@ bool ParamTraits<IPC::ChannelHandle>::Read(const Message* m, void ParamTraits<IPC::ChannelHandle>::Log(const param_type& p, std::string* l) { - l->append(StringPrintf("ChannelHandle(%s", p.name.c_str())); + l->append(base::StringPrintf("ChannelHandle(%s", p.name.c_str())); #if defined(OS_POSIX) l->append(", "); ParamTraits<base::FileDescriptor>::Log(p.socket, l); @@ -768,7 +769,7 @@ bool ParamTraits<HANDLE>::Read(const Message* m, PickleIterator* iter, } void ParamTraits<HANDLE>::Log(const param_type& p, std::string* l) { - l->append(StringPrintf("0x%X", p)); + l->append(base::StringPrintf("0x%X", p)); } void ParamTraits<LOGFONT>::Write(Message* m, const param_type& p) { @@ -792,7 +793,7 @@ bool ParamTraits<LOGFONT>::Read(const Message* m, PickleIterator* iter, } void ParamTraits<LOGFONT>::Log(const param_type& p, std::string* l) { - l->append(StringPrintf("<LOGFONT>")); + l->append(base::StringPrintf("<LOGFONT>")); } void ParamTraits<MSG>::Write(Message* m, const param_type& p) { diff --git a/media/video/capture/android/video_capture_device_android.cc b/media/video/capture/android/video_capture_device_android.cc index d837b24..20601eb 100644 --- a/media/video/capture/android/video_capture_device_android.cc +++ b/media/video/capture/android/video_capture_device_android.cc @@ -52,7 +52,7 @@ void VideoCaptureDevice::GetDeviceNames(Names* device_names) { Java_ChromiumCameraInfo_getAt(env, camera_id); Name name; - name.unique_id = StringPrintf( + name.unique_id = base::StringPrintf( "%d", Java_ChromiumCameraInfo_getId(env, ci.obj())); name.device_name = base::android::ConvertJavaStringToUTF8( Java_ChromiumCameraInfo_getDeviceName(env, ci.obj())); diff --git a/media/video/capture/fake_video_capture_device.cc b/media/video/capture/fake_video_capture_device.cc index 8ca6860..addd172 100644 --- a/media/video/capture/fake_video_capture_device.cc +++ b/media/video/capture/fake_video_capture_device.cc @@ -28,8 +28,8 @@ void FakeVideoCaptureDevice::GetDeviceNames(Names* const device_names) { for (int n = 0; n < kNumberOfFakeDevices; n++) { Name name; - name.unique_id = StringPrintf("/dev/video%d", n); - name.device_name = StringPrintf("fake_device_%d", n); + name.unique_id = base::StringPrintf("/dev/video%d", n); + name.device_name = base::StringPrintf("fake_device_%d", n); device_names->push_back(name); } } @@ -40,7 +40,7 @@ VideoCaptureDevice* FakeVideoCaptureDevice::Create(const Name& device_name) { return NULL; } for (int n = 0; n < kNumberOfFakeDevices; ++n) { - std::string possible_id = StringPrintf("/dev/video%d", n); + std::string possible_id = base::StringPrintf("/dev/video%d", n); if (device_name.unique_id.compare(possible_id) == 0) { return new FakeVideoCaptureDevice(device_name); } diff --git a/media/video/capture/linux/video_capture_device_linux.cc b/media/video/capture/linux/video_capture_device_linux.cc index d4db951..d3655db 100644 --- a/media/video/capture/linux/video_capture_device_linux.cc +++ b/media/video/capture/linux/video_capture_device_linux.cc @@ -126,7 +126,7 @@ void VideoCaptureDevice::GetDeviceNames(Names* device_names) { !(cap.capabilities & V4L2_CAP_VIDEO_OUTPUT)) { // This is a V4L2 video capture device if (HasUsableFormats(fd)) { - name.device_name = StringPrintf("%s", cap.card); + name.device_name = base::StringPrintf("%s", cap.card); device_names->push_back(name); } else { DVLOG(1) << "No usable formats reported by " << info.filename; @@ -418,8 +418,8 @@ void VideoCaptureDeviceLinux::OnCaptureTask() { // Enqueue the buffer again. if (ioctl(device_fd_, VIDIOC_QBUF, &buffer) == -1) { - SetErrorState( - StringPrintf("Failed to enqueue capture buffer errno %d", errno)); + SetErrorState(base::StringPrintf( + "Failed to enqueue capture buffer errno %d", errno)); } } // Else wait for next event. } diff --git a/net/base/crl_set.cc b/net/base/crl_set.cc index dd73c7e..735bb5e 100644 --- a/net/base/crl_set.cc +++ b/net/base/crl_set.cc @@ -459,7 +459,7 @@ bool CRLSet::GetIsDeltaUpdate(const base::StringPiece& in_data, } std::string CRLSet::Serialize() const { - std::string header = StringPrintf( + std::string header = base::StringPrintf( "{" "\"Version\":0," "\"ContentType\":\"CRLSet\"," @@ -481,7 +481,7 @@ std::string CRLSet::Serialize() const { } header += "]"; if (not_after_ != 0) - header += StringPrintf(",\"NotAfter\":%" PRIu64, not_after_); + header += base::StringPrintf(",\"NotAfter\":%" PRIu64, not_after_); header += "}"; size_t len = 2 /* header len */ + header.size(); diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc index 1e8d83a..116d486 100644 --- a/net/cookies/cookie_monster_unittest.cc +++ b/net/cookies/cookie_monster_unittest.cc @@ -357,7 +357,7 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> { CookieMonster* CreateMonsterForGC(int num_cookies) { CookieMonster* cm(new CookieMonster(NULL, NULL)); for (int i = 0; i < num_cookies; i++) { - SetCookie(cm, GURL(StringPrintf("http://h%05d.izzle", i)), "a=1"); + SetCookie(cm, GURL(base::StringPrintf("http://h%05d.izzle", i)), "a=1"); } return cm; } diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index db33c8e..824a048 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -649,7 +649,7 @@ TEST_F(DiskCacheBackendTest, NewEvictionTrim) { disk_cache::Entry* entry; for (int i = 0; i < 100; i++) { - std::string name(StringPrintf("Key %d", i)); + std::string name(base::StringPrintf("Key %d", i)); ASSERT_EQ(net::OK, CreateEntry(name, &entry)); entry->Close(); if (i < 90) { @@ -2652,7 +2652,7 @@ TEST_F(DiskCacheBackendTest, UpdateRankForExternalCacheHit) { disk_cache::Entry* entry; for (int i = 0; i < 2; ++i) { - std::string key = StringPrintf("key%d", i); + std::string key = base::StringPrintf("key%d", i); ASSERT_EQ(net::OK, CreateEntry(key, &entry)); entry->Close(); } @@ -2676,7 +2676,7 @@ TEST_F(DiskCacheBackendTest, ShaderCacheUpdateRankForExternalCacheHit) { disk_cache::Entry* entry; for (int i = 0; i < 2; ++i) { - std::string key = StringPrintf("key%d", i); + std::string key = base::StringPrintf("key%d", i); ASSERT_EQ(net::OK, CreateEntry(key, &entry)); entry->Close(); } diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc index 8dfa363..9f5c91b 100644 --- a/net/disk_cache/simple/simple_synchronous_entry.cc +++ b/net/disk_cache/simple/simple_synchronous_entry.cc @@ -41,12 +41,12 @@ namespace { std::string GetFilenameForKeyAndIndex(const std::string& key, int index) { const std::string sha_hash = base::SHA1HashString(key); - return StringPrintf("%02x%02x%02x%02x%02x_%1d", - implicit_cast<unsigned char>(sha_hash[0]), - implicit_cast<unsigned char>(sha_hash[1]), - implicit_cast<unsigned char>(sha_hash[2]), - implicit_cast<unsigned char>(sha_hash[3]), - implicit_cast<unsigned char>(sha_hash[4]), index); + return base::StringPrintf("%02x%02x%02x%02x%02x_%1d", + implicit_cast<unsigned char>(sha_hash[0]), + implicit_cast<unsigned char>(sha_hash[1]), + implicit_cast<unsigned char>(sha_hash[2]), + implicit_cast<unsigned char>(sha_hash[3]), + implicit_cast<unsigned char>(sha_hash[4]), index); } int32 DataSizeFromKeyAndFileSize(size_t key_size, int64 file_size) { diff --git a/net/http/http_pipelined_network_transaction_unittest.cc b/net/http/http_pipelined_network_transaction_unittest.cc index 2fe20f4..a2e9337 100644 --- a/net/http/http_pipelined_network_transaction_unittest.cc +++ b/net/http/http_pipelined_network_transaction_unittest.cc @@ -112,7 +112,7 @@ class HttpPipelinedNetworkTransactionTest : public testing::Test { HttpRequestInfo* GetRequestInfo( const char* filename, RequestInfoOptions options = REQUEST_DEFAULT) { - std::string url = StringPrintf("http://localhost/%s", filename); + std::string url = base::StringPrintf("http://localhost/%s", filename); HttpRequestInfo* request_info = new HttpRequestInfo; request_info->url = GURL(url); request_info->method = "GET"; diff --git a/net/http/proxy_client_socket.cc b/net/http/proxy_client_socket.cc index 8882f42..b892479 100644 --- a/net/http/proxy_client_socket.cc +++ b/net/http/proxy_client_socket.cc @@ -27,7 +27,7 @@ void ProxyClientSocket::BuildTunnelRequest( // RFC 2616 Section 9 says the Host request-header field MUST accompany all // HTTP/1.1 requests. Add "Proxy-Connection: keep-alive" for compat with // HTTP/1.0 proxies such as Squid (required for NTLM authentication). - *request_line = StringPrintf( + *request_line = base::StringPrintf( "CONNECT %s HTTP/1.1\r\n", endpoint.ToString().c_str()); request_headers->SetHeader(HttpRequestHeaders::kHost, GetHostAndOptionalPort(request_info.url)); diff --git a/net/proxy/proxy_resolver_v8_tracing.cc b/net/proxy/proxy_resolver_v8_tracing.cc index 608d3cb..198418f 100644 --- a/net/proxy/proxy_resolver_v8_tracing.cc +++ b/net/proxy/proxy_resolver_v8_tracing.cc @@ -953,7 +953,7 @@ HostResolver::RequestInfo ProxyResolverV8Tracing::Job::MakeDnsRequestInfo( std::string ProxyResolverV8Tracing::Job::MakeDnsCacheKey( const std::string& host, ResolveDnsOperation op) { - return StringPrintf("%d:%s", op, host.c_str()); + return base::StringPrintf("%d:%s", op, host.c_str()); } void ProxyResolverV8Tracing::Job::HandleAlertOrError(bool is_alert, diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc index 1c6aa13..e0162d4 100644 --- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc +++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc @@ -74,8 +74,8 @@ class MockErrorObserver : public ProxyResolverErrorObserver { const string16& error) OVERRIDE { { base::AutoLock l(lock_); - output += StringPrintf("Error: line %d: %s\n", line_number, - UTF16ToASCII(error).c_str()); + output += base::StringPrintf("Error: line %d: %s\n", line_number, + UTF16ToASCII(error).c_str()); } event_.Signal(); } diff --git a/net/test/python_utils_unittest.cc b/net/test/python_utils_unittest.cc index 6d5a041..09f6630 100644 --- a/net/test/python_utils_unittest.cc +++ b/net/test/python_utils_unittest.cc @@ -52,7 +52,7 @@ TEST(PythonUtils, PythonRunTime) { // we want. cmd_line.AppendArg("-c"); std::string input("PythonUtilsTest"); - std::string python_cmd = StringPrintf("print '%s';", input.c_str()); + std::string python_cmd = base::StringPrintf("print '%s';", input.c_str()); cmd_line.AppendArg(python_cmd); std::string output; EXPECT_TRUE(base::GetAppOutput(cmd_line, &output)); diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 269e86c..32b99ac 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -4253,8 +4253,8 @@ TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) { context.Init(); TestDelegate d; - URLRequest r(GURL(StringPrintf("https://www.google.com:%d", - test_server.host_port_pair().port())), + URLRequest r(GURL(base::StringPrintf("https://www.google.com:%d", + test_server.host_port_pair().port())), &d, &context); @@ -4300,8 +4300,8 @@ TEST_F(HTTPSRequestTest, HTTPSErrorsNoClobberTSSTest) { context.Init(); TestDelegate d; - URLRequest r(GURL(StringPrintf("https://www.google.com:%d", - test_server.host_port_pair().port())), + URLRequest r(GURL(base::StringPrintf("https://www.google.com:%d", + test_server.host_port_pair().port())), &d, &context); @@ -4366,8 +4366,8 @@ TEST_F(HTTPSRequestTest, HSTSPreservesPosts) { // cause a certificate error. Ignore the error. d.set_allow_certificate_errors(true); - URLRequest req(GURL(StringPrintf("http://www.somewhere.com:%d/echo", - test_server.host_port_pair().port())), + URLRequest req(GURL(base::StringPrintf("http://www.somewhere.com:%d/echo", + test_server.host_port_pair().port())), &d, &context); req.set_method("POST"); diff --git a/net/websockets/websocket_frame_unittest.cc b/net/websockets/websocket_frame_unittest.cc index 6934fad..800ae42 100644 --- a/net/websockets/websocket_frame_unittest.cc +++ b/net/websockets/websocket_frame_unittest.cc @@ -402,8 +402,8 @@ class WebSocketFrameTestMaskBenchmark : public testing::Test { 1000 * (TimeTicks::HighResNow() - start).InMillisecondsF() / iterations_; LOG(INFO) << "Payload size " << size - << StringPrintf(" took %.03f microseconds per iteration", - total_time_ms); + << base::StringPrintf(" took %.03f microseconds per iteration", + total_time_ms); } private: diff --git a/printing/printed_document.cc b/printing/printed_document.cc index 714f13d..22e0fd6 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc @@ -179,7 +179,7 @@ void PrintedDocument::DebugDump(const PrintedPage& page) { string16 filename; filename += name(); filename += ASCIIToUTF16("_"); - filename += ASCIIToUTF16(StringPrintf("%02d", page.page_number())); + filename += ASCIIToUTF16(base::StringPrintf("%02d", page.page_number())); #if defined(OS_WIN) filename += ASCIIToUTF16("_.emf"); page.metafile()->SaveTo( diff --git a/remoting/base/util.cc b/remoting/base/util.cc index 31dda25..5873422 100644 --- a/remoting/base/util.cc +++ b/remoting/base/util.cc @@ -25,9 +25,9 @@ std::string GetTimestampString() { base::Time t = base::Time::NowFromSystemTime(); base::Time::Exploded tex; t.LocalExplode(&tex); - return StringPrintf("%02d%02d/%02d%02d%02d:", - tex.month, tex.day_of_month, - tex.hour, tex.minute, tex.second); + return base::StringPrintf("%02d%02d/%02d%02d%02d:", + tex.month, tex.day_of_month, + tex.hour, tex.minute, tex.second); } int CalculateRGBOffset(int x, int y, int stride) { diff --git a/remoting/host/setup/daemon_installer_win.cc b/remoting/host/setup/daemon_installer_win.cc index 67c30a4..bc914b4 100644 --- a/remoting/host/setup/daemon_installer_win.cc +++ b/remoting/host/setup/daemon_installer_win.cc @@ -295,10 +295,10 @@ void DaemonCommandLineInstallerWin::Install() { // Launch the updater process and wait for its termination. string16 command_line = WideToUTF16( - StringPrintf(kGoogleUpdateCommandLineFormat, - google_update.c_str(), - kHostOmahaAppid, - kOmahaLanguage)); + base::StringPrintf(kGoogleUpdateCommandLineFormat, + google_update.c_str(), + kHostOmahaAppid, + kOmahaLanguage)); base::LaunchOptions options; if (!base::LaunchProcess(command_line, options, process_.Receive())) { diff --git a/remoting/host/usage_stats_consent_win.cc b/remoting/host/usage_stats_consent_win.cc index fa7345b..fea3853 100644 --- a/remoting/host/usage_stats_consent_win.cc +++ b/remoting/host/usage_stats_consent_win.cc @@ -25,9 +25,9 @@ const wchar_t kOmahaUsagestatsValue[] = L"usagestats"; LONG ReadUsageStatsValue(const wchar_t* state_key, DWORD* usagestats_out) { // presubmit: allow wstring - std::wstring client_state = StringPrintf(kOmahaClientStateKeyFormat, - state_key, - remoting::kHostOmahaAppid); + std::wstring client_state = base::StringPrintf(kOmahaClientStateKeyFormat, + state_key, + remoting::kHostOmahaAppid); base::win::RegKey key; LONG result = key.Open(HKEY_LOCAL_MACHINE, client_state.c_str(), KEY_READ); if (result != ERROR_SUCCESS) { @@ -73,9 +73,9 @@ bool IsUsageStatsAllowed() { bool SetUsageStatsConsent(bool allowed) { DWORD value = allowed; // presubmit: allow wstring - std::wstring client_state = StringPrintf(kOmahaClientStateKeyFormat, - kOmahaClientStateMedium, - kHostOmahaAppid); + std::wstring client_state = base::StringPrintf(kOmahaClientStateKeyFormat, + kOmahaClientStateMedium, + kHostOmahaAppid); base::win::RegKey key; LONG result = key.Create(HKEY_LOCAL_MACHINE, client_state.c_str(), KEY_SET_VALUE); diff --git a/remoting/host/win/launch_process_with_token.cc b/remoting/host/win/launch_process_with_token.cc index fffa983..167ca9a 100644 --- a/remoting/host/win/launch_process_with_token.cc +++ b/remoting/host/win/launch_process_with_token.cc @@ -87,7 +87,7 @@ bool ConnectToExecutionServer(uint32 session_id, // Use the default pipe name if we couldn't query its name. if (pipe_name.empty()) { pipe_name = UTF8ToUTF16( - StringPrintf(kCreateProcessDefaultPipeNameFormat, session_id)); + base::StringPrintf(kCreateProcessDefaultPipeNameFormat, session_id)); } // Try to connect to the named pipe. diff --git a/sql/connection.cc b/sql/connection.cc index 0fda72e..5f6b590 100644 --- a/sql/connection.cc +++ b/sql/connection.cc @@ -240,7 +240,8 @@ bool Connection::Raze() { << " page_size_ " << page_size_ << " is not a power of two."; const int kSqliteMaxPageSize = 32768; // from sqliteLimit.h DCHECK_LE(page_size_, kSqliteMaxPageSize); - const std::string sql = StringPrintf("PRAGMA page_size=%d", page_size_); + const std::string sql = + base::StringPrintf("PRAGMA page_size=%d", page_size_); if (!null_db.Execute(sql.c_str())) return false; } @@ -666,13 +667,15 @@ bool Connection::OpenInternal(const std::string& file_name) { << " page_size_ " << page_size_ << " is not a power of two."; const int kSqliteMaxPageSize = 32768; // from sqliteLimit.h DCHECK_LE(page_size_, kSqliteMaxPageSize); - const std::string sql = StringPrintf("PRAGMA page_size=%d", page_size_); + const std::string sql = + base::StringPrintf("PRAGMA page_size=%d", page_size_); if (!ExecuteWithTimeout(sql.c_str(), kBusyTimeout)) DLOG(FATAL) << "Could not set page size: " << GetErrorMessage(); } if (cache_size_ != 0) { - const std::string sql = StringPrintf("PRAGMA cache_size=%d", cache_size_); + const std::string sql = + base::StringPrintf("PRAGMA cache_size=%d", cache_size_); if (!ExecuteWithTimeout(sql.c_str(), kBusyTimeout)) DLOG(FATAL) << "Could not set cache size: " << GetErrorMessage(); } diff --git a/testing/android/native_test_launcher.cc b/testing/android/native_test_launcher.cc index 57a918b..2fde7351 100644 --- a/testing/android/native_test_launcher.cc +++ b/testing/android/native_test_launcher.cc @@ -142,9 +142,9 @@ static void RunTests(JNIEnv* env, dup2(STDOUT_FILENO, STDERR_FILENO); if (command_line.HasSwitch(switches::kWaitForDebugger)) { - std::string msg = StringPrintf("Native test waiting for GDB because " - "flag %s was supplied", - switches::kWaitForDebugger); + std::string msg = base::StringPrintf("Native test waiting for GDB because " + "flag %s was supplied", + switches::kWaitForDebugger); __android_log_write(ANDROID_LOG_VERBOSE, kLogTag, msg.c_str()); base::debug::WaitForDebugger(24 * 60 * 60, false); } diff --git a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/string_util.h b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/string_util.h index 80e894a..bae09a4 100644 --- a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/string_util.h +++ b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/string_util.h @@ -11,6 +11,7 @@ namespace invalidation { using base::StringAppendV; +using base::StringPrintf; inline std::string SimpleItoa(int v) { return base::IntToString(v); diff --git a/ui/app_list/pagination_model_unittest.cc b/ui/app_list/pagination_model_unittest.cc index a8ebe7c..cfb2d48 100644 --- a/ui/app_list/pagination_model_unittest.cc +++ b/ui/app_list/pagination_model_unittest.cc @@ -57,7 +57,7 @@ class TestPaginationModelObserver : public PaginationModelObserver { void AppendSelectedPage(int page) { if (selected_pages_.length()) selected_pages_.append(std::string(" ")); - selected_pages_.append(StringPrintf("%d", page)); + selected_pages_.append(base::StringPrintf("%d", page)); } // PaginationModelObserver overrides: diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc index 22c8ada..a32b25c 100644 --- a/ui/aura/root_window_host_linux.cc +++ b/ui/aura/root_window_host_linux.cc @@ -329,7 +329,7 @@ RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds) // window to broadcast. // TODO(jhorwich) Remove this once Chrome supports window-based broadcasting. static int root_window_number = 0; - std::string name = StringPrintf("aura_root_%d", root_window_number++); + std::string name = base::StringPrintf("aura_root_%d", root_window_number++); XStoreName(xdisplay_, xwindow_, name.c_str()); XRRSelectInput(xdisplay_, x_root_window_, RRScreenChangeNotifyMask | RROutputChangeNotifyMask); diff --git a/ui/aura/test/test_window_delegate.cc b/ui/aura/test/test_window_delegate.cc index 462cd70..f75d827 100644 --- a/ui/aura/test/test_window_delegate.cc +++ b/ui/aura/test/test_window_delegate.cc @@ -182,10 +182,10 @@ void EventCountDelegate::OnMouseEvent(ui::MouseEvent* event) { } std::string EventCountDelegate::GetMouseMotionCountsAndReset() { - std::string result = StringPrintf("%d %d %d", - mouse_enter_count_, - mouse_move_count_, - mouse_leave_count_); + std::string result = base::StringPrintf("%d %d %d", + mouse_enter_count_, + mouse_move_count_, + mouse_leave_count_); mouse_enter_count_ = 0; mouse_move_count_ = 0; mouse_leave_count_ = 0; @@ -193,9 +193,9 @@ std::string EventCountDelegate::GetMouseMotionCountsAndReset() { } std::string EventCountDelegate::GetMouseButtonCountsAndReset() { - std::string result = StringPrintf("%d %d", - mouse_press_count_, - mouse_release_count_); + std::string result = base::StringPrintf("%d %d", + mouse_press_count_, + mouse_release_count_); mouse_press_count_ = 0; mouse_release_count_ = 0; return result; @@ -203,9 +203,9 @@ std::string EventCountDelegate::GetMouseButtonCountsAndReset() { std::string EventCountDelegate::GetKeyCountsAndReset() { - std::string result = StringPrintf("%d %d", - key_press_count_, - key_release_count_); + std::string result = base::StringPrintf("%d %d", + key_press_count_, + key_release_count_); key_press_count_ = 0; key_release_count_ = 0; return result; diff --git a/ui/aura/window.cc b/ui/aura/window.cc index beb12cf..eef013c 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -628,7 +628,7 @@ void Window::OnDeviceScaleFactorChanged(float device_scale_factor) { #ifndef NDEBUG std::string Window::GetDebugInfo() const { - return StringPrintf( + return base::StringPrintf( "%s<%d> bounds(%d, %d, %d, %d) %s %s opacity=%.1f", name().empty() ? "Unknown" : name().c_str(), id(), bounds().x(), bounds().y(), bounds().width(), bounds().height(), diff --git a/ui/base/keycodes/keyboard_code_conversion_x.cc b/ui/base/keycodes/keyboard_code_conversion_x.cc index 9d79faf..7b75233 100644 --- a/ui/base/keycodes/keyboard_code_conversion_x.cc +++ b/ui/base/keycodes/keyboard_code_conversion_x.cc @@ -424,7 +424,7 @@ KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym) { // TODO(sad): some keycodes are still missing. } - DLOG(WARNING) << "Unknown keysym: " << StringPrintf("0x%x", keysym); + DLOG(WARNING) << "Unknown keysym: " << base::StringPrintf("0x%x", keysym); return VKEY_UNKNOWN; } diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc index 38f0929..ffa9baf 100644 --- a/ui/base/x/x11_util.cc +++ b/ui/base/x/x11_util.cc @@ -1793,7 +1793,7 @@ void LogErrorEventDescription(Display* dpy, int ext_code, first_event, first_error; XQueryExtension(dpy, ext_list[i], &ext_code, &first_event, &first_error); if (error_event.request_code == ext_code) { - std::string msg = StringPrintf( + std::string msg = base::StringPrintf( "%s.%d", ext_list[i], error_event.minor_code); XGetErrorDatabaseText( dpy, "XRequest", msg.c_str(), "Unknown", request_str, diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc index 6efe3a5..aaba292 100644 --- a/ui/compositor/layer_unittest.cc +++ b/ui/compositor/layer_unittest.cc @@ -169,7 +169,7 @@ class TestLayerDelegate : public LayerDelegate { int color_index() const { return color_index_; } std::string ToScaleString() const { - return StringPrintf("%.1f %.1f", scale_x_, scale_y_); + return base::StringPrintf("%.1f %.1f", scale_x_, scale_y_); } float device_scale_factor() const { diff --git a/ui/message_center/notification_list_unittest.cc b/ui/message_center/notification_list_unittest.cc index aa4ab66..6d4b551 100644 --- a/ui/message_center/notification_list_unittest.cc +++ b/ui/message_center/notification_list_unittest.cc @@ -59,8 +59,8 @@ class NotificationListTest : public testing::Test { std::string new_id = base::StringPrintf(kIdFormat, counter_); notification_list_->AddNotification( message_center::NOTIFICATION_TYPE_SIMPLE, new_id, - UTF8ToUTF16(StringPrintf(kTitleFormat, counter_)), - UTF8ToUTF16(StringPrintf(kMessageFormat, counter_)), + UTF8ToUTF16(base::StringPrintf(kTitleFormat, counter_)), + UTF8ToUTF16(base::StringPrintf(kMessageFormat, counter_)), UTF8ToUTF16(kDisplaySource), kExtensionId, optional_fields); counter_++; diff --git a/ui/surface/accelerated_surface_transformer_win_unittest.cc b/ui/surface/accelerated_surface_transformer_win_unittest.cc index e911281..1265e6e 100644 --- a/ui/surface/accelerated_surface_transformer_win_unittest.cc +++ b/ui/surface/accelerated_surface_transformer_win_unittest.cc @@ -124,7 +124,8 @@ class AcceleratedSurfaceTransformerTest : public testing::TestWithParam<int> { EXPECT_HRESULT_SUCCEEDED(device()->GetDirect3D(d3d.Receive())); D3DADAPTER_IDENTIFIER9 info; EXPECT_HRESULT_SUCCEEDED(d3d->GetAdapterIdentifier(0, 0, &info)); - return StringPrintf("Running on graphics hardware: %s", info.Description); + return base::StringPrintf( + "Running on graphics hardware: %s", info.Description); } void SeedRandom(const char* seed) { @@ -228,9 +229,9 @@ class AcceleratedSurfaceTransformerTest : public testing::TestWithParam<int> { return true; std::string expected_color = - StringPrintf("%3d, %3d, %3d, %3d", a[0], a[1], a[2], a[3]); + base::StringPrintf("%3d, %3d, %3d, %3d", a[0], a[1], a[2], a[3]); std::string actual_color = - StringPrintf("%3d, %3d, %3d, %3d", b[0], b[1], b[2], b[3]); + base::StringPrintf("%3d, %3d, %3d, %3d", b[0], b[1], b[2], b[3]); EXPECT_EQ(expected_color, actual_color) << "Componentwise color difference was " << max_error << "; max allowed is " << color_error_tolerance(); @@ -244,8 +245,9 @@ bool AssertSameColor(uint8 color_a, uint8 color_b) { int max_error = std::abs((int) color_a - (int) color_b); if (max_error <= color_error_tolerance()) return true; - ADD_FAILURE() << "Colors not equal: " << StringPrintf("0x%x", color_a) - << " vs. " << StringPrintf("0x%x", color_b); + ADD_FAILURE() << "Colors not equal: " + << base::StringPrintf("0x%x", color_a) + << " vs. " << base::StringPrintf("0x%x", color_b); return false; } @@ -338,10 +340,11 @@ bool AssertSameColor(uint8 color_a, uint8 color_b) { int checkerboard_size) { SCOPED_TRACE( - StringPrintf("Resizing %dx%d -> %dx%d at checkerboard size of %d", - src_size.width(), src_size.height(), - dst_size.width(), dst_size.height(), - checkerboard_size)); + base::StringPrintf( + "Resizing %dx%d -> %dx%d at checkerboard size of %d", + src_size.width(), src_size.height(), + dst_size.width(), dst_size.height(), + checkerboard_size)); set_color_error_tolerance(4); @@ -400,8 +403,8 @@ bool AssertSameColor(uint8 color_a, uint8 color_b) { void DoCopyInvertedTest(AcceleratedSurfaceTransformer* gpu_ops, const gfx::Size& size) { - SCOPED_TRACE( - StringPrintf("CopyInverted @ %dx%d", size.width(), size.height())); + SCOPED_TRACE(base::StringPrintf( + "CopyInverted @ %dx%d", size.width(), size.height())); set_color_error_tolerance(0); @@ -459,10 +462,11 @@ bool AssertSameColor(uint8 color_a, uint8 color_b) { int checkerboard_size, boolean use_multi_render_targets) { SCOPED_TRACE( - StringPrintf("YUV Converting %dx%d at checkerboard size of %d; MRT %s", - src_size.width(), src_size.height(), - checkerboard_size, - use_multi_render_targets ? "enabled" : "disabled")); + base::StringPrintf( + "YUV Converting %dx%d at checkerboard size of %d; MRT %s", + src_size.width(), src_size.height(), + checkerboard_size, + use_multi_render_targets ? "enabled" : "disabled")); base::win::ScopedComPtr<IDirect3DTexture9> src; @@ -686,7 +690,8 @@ TEST_P(AcceleratedSurfaceTransformerTest, LargeSurfaces) { ASSERT_HRESULT_SUCCEEDED( device()->GetDeviceCaps(&caps)); - SCOPED_TRACE(StringPrintf("max texture size: %dx%d, max texture aspect: %d", + SCOPED_TRACE(base::StringPrintf( + "max texture size: %dx%d, max texture aspect: %d", caps.MaxTextureWidth, caps.MaxTextureHeight, caps.MaxTextureAspectRatio)); const int w = caps.MaxTextureWidth; diff --git a/webkit/fileapi/file_system_origin_database.cc b/webkit/fileapi/file_system_origin_database.cc index 0300da2..ef0df54 100644 --- a/webkit/fileapi/file_system_origin_database.cc +++ b/webkit/fileapi/file_system_origin_database.cc @@ -229,7 +229,7 @@ bool FileSystemOriginDatabase::GetPathForOrigin( int last_path_number; if (!GetLastPathNumber(&last_path_number)) return false; - path_string = StringPrintf("%03u", last_path_number + 1); + path_string = base::StringPrintf("%03u", last_path_number + 1); // store both back as a single transaction leveldb::WriteBatch batch; batch.Put(LastPathKey(), path_string); diff --git a/webkit/fileapi/obfuscated_file_util.cc b/webkit/fileapi/obfuscated_file_util.cc index 7031172..6f9a900 100644 --- a/webkit/fileapi/obfuscated_file_util.cc +++ b/webkit/fileapi/obfuscated_file_util.cc @@ -1323,14 +1323,15 @@ PlatformFileError ObfuscatedFileUtil::GenerateNewLocalPath( // We use the third- and fourth-to-last digits as the directory. int64 directory_number = number % 10000 / 100; new_local_path = new_local_path.AppendASCII( - StringPrintf("%02" PRId64, directory_number)); + base::StringPrintf("%02" PRId64, directory_number)); error = NativeFileUtil::CreateDirectory( new_local_path, false /* exclusive */, false /* recursive */); if (error != base::PLATFORM_FILE_OK) return error; - *local_path = new_local_path.AppendASCII(StringPrintf("%08" PRId64, number)); + *local_path = + new_local_path.AppendASCII(base::StringPrintf("%08" PRId64, number)); return base::PLATFORM_FILE_OK; } diff --git a/webkit/media/cache_util_unittest.cc b/webkit/media/cache_util_unittest.cc index bd2ff38..2703026 100644 --- a/webkit/media/cache_util_unittest.cc +++ b/webkit/media/cache_util_unittest.cc @@ -85,10 +85,10 @@ TEST(CacheUtilTest, GetReasonsForUncacheability) { }, }; for (size_t i = 0; i < arraysize(tests); ++i) { - SCOPED_TRACE(StringPrintf("case: %" PRIuS - ", version: %d, code: %d, headers: %s", - i, tests[i].version, tests[i].status_code, - tests[i].headers)); + SCOPED_TRACE(base::StringPrintf("case: %" PRIuS + ", version: %d, code: %d, headers: %s", + i, tests[i].version, tests[i].status_code, + tests[i].headers)); EXPECT_EQ(GetReasonsForUncacheability(CreateResponse(tests[i])), tests[i].expected_reasons); } |