0

[Cleanup] Remove StringPrintf from global namespace

use of StringPrintf now requires prefixing with base:: or a per-scope using directive

TBR'd:
abodenha: chrome/service
brettw: content, third_party, webkit
darin: base, chrome/browser, chrome/renderer
dgarret: courgette
enne: cc
fischmann: media
gbillock: sql
joi: google_apis,components
rsleevi: net, crypto
sky: chrome/test
thestig: printing, chrome/common,
tsepez: ipc
wez: remoting
yfriedman: testing/android

NOTRY=true
R=brettw@chromium.org
TBR=joi@chromium.org, rsleevi@chromium.org, enne@chromium.org, thestig@chromium.org, darin@chromium.org, abodenha@chromium.org, sky@chromium.org, dgarret@chromium.org, tsepez@chromium.org, fishman@chromium.org, wez@chromium.org, gbillock@chromium.org, yfriedman@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188857 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
groby@chromium.org
2013-03-18 22:33:04 +00:00
parent bb192b8705
commit 7d3cbc90c0
191 changed files with 757 additions and 695 deletions
android_webview/browser
ash
base
cc
chrome
browser
android
autocomplete
automation
chromeos
component_updater
devtools
download
extensions
history
importer
media_galleries
notifications
password_manager
performance_monitor
policy
predictors
prerender
printing
profiles
safe_browsing
sessions
ssl
sync
sync_file_system
themes
ui
web_applications
common
renderer
service
test
chrome_frame
chromeos/network
components
content
courgette
crypto
dbus
google_apis/gaia
ipc
media/video/capture
net
printing
remoting
sql
testing/android
third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps
ui
webkit

@ -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);

@ -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.

@ -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);
}

@ -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 {

@ -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());

@ -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),

@ -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.

@ -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());

@ -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());

@ -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));

@ -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;

@ -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)

@ -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);
}

@ -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 =

@ -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_

@ -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());
}

@ -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_)

@ -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_));
}

@ -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,

@ -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(

@ -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);

@ -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()) {

@ -359,7 +359,7 @@ void BootTimesLoader::WriteTimes(
name = tm.name();
}
output +=
StringPrintf(
base::StringPrintf(
"\n%.2f +%.4f %s",
since_first.InSecondsF(),
since_prev.InSecondsF(),

@ -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>(

@ -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

@ -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())));
}

@ -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(),

@ -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()));
}
}

@ -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(),

@ -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) {

@ -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)) {

@ -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();

@ -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());

@ -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()));

@ -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);

@ -10,7 +10,7 @@
namespace {
std::string ToId(int identifier) {
return StringPrintf("_%d_", identifier);
return base::StringPrintf("_%d_", identifier);
}
} // namespace

@ -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);

@ -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

@ -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);

@ -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());

@ -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,

@ -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(

@ -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());

@ -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 ? "/*" : "*");

@ -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));

@ -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(),

@ -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;

@ -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)));

@ -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>"

@ -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.

@ -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());

@ -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 {

@ -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() {

@ -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) {

@ -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

@ -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,

@ -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;

@ -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);
}
}

@ -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);

@ -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

@ -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));
}
}

@ -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 {

@ -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);
}

@ -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]);
}

@ -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);
}

@ -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);

@ -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

@ -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());

@ -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);
}

@ -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) {

@ -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.

@ -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) {

@ -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);
}

@ -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();
}

@ -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;

@ -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(),

@ -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;

@ -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();
}

@ -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) {

@ -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);
}

@ -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,

@ -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.

@ -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;

@ -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());

@ -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);

@ -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;

@ -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

@ -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(),

@ -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(

@ -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

@ -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,

@ -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]);
}
}

@ -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);
}

@ -63,7 +63,7 @@ void ExecuteScript(WebKit::WebFrame* frame,
const base::Value& parameters) {
std::string json;
base::JSONWriter::Write(&parameters, &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);

@ -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();

@ -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(

@ -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);
}

@ -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(),

@ -38,6 +38,8 @@ namespace cloud_print {
namespace {
using base::StringPrintf;
const char kExampleCloudPrintServerURL[] = "https://www.google.com/cloudprint/";
const char kExamplePrintTicket[] = "{\"MediaType\":\"plain\","

@ -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 += " ]";
}

Some files were not shown because too many files have changed in this diff Show More