summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 11:17:37 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 11:17:37 +0000
commitd3451d83da3c72c35c0c6b391833fe47f0b4236a (patch)
tree334d32cdf9874f6bbea3534b74f741f82907d30b
parent244f335890efb6fa0916b80afdecb80dcb3764a4 (diff)
downloadchromium_src-d3451d83da3c72c35c0c6b391833fe47f0b4236a.zip
chromium_src-d3451d83da3c72c35c0c6b391833fe47f0b4236a.tar.gz
chromium_src-d3451d83da3c72c35c0c6b391833fe47f0b4236a.tar.bz2
chrome_frame: Append base:: in the StringPrintf calls.
(Note: this is a TODO in string_util.h) BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3594002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61166 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome_frame/bho.cc5
-rw-r--r--chrome_frame/bind_status_callback_impl.cc31
-rw-r--r--chrome_frame/chrome_frame_activex.cc18
-rw-r--r--chrome_frame/chrome_frame_activex_base.h30
-rw-r--r--chrome_frame/chrome_frame_npapi.cc3
-rw-r--r--chrome_frame/com_message_event.cc5
-rw-r--r--chrome_frame/html_utils.cc3
-rw-r--r--chrome_frame/http_negotiate.cc17
-rw-r--r--chrome_frame/metrics_service.cc8
-rw-r--r--chrome_frame/protocol_sink_wrap.cc8
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.cc12
-rw-r--r--chrome_frame/test/chrome_frame_ui_test_utils.cc5
-rw-r--r--chrome_frame/test/ie_event_sink.cc9
-rw-r--r--chrome_frame/test/mock_ie_event_sink_test.h3
-rw-r--r--chrome_frame/test/net/fake_external_tab.cc7
-rw-r--r--chrome_frame/test/perf/chrome_frame_perftest.cc3
-rw-r--r--chrome_frame/test/policy_settings_unittest.cc2
-rw-r--r--chrome_frame/test/test_server.cc41
-rw-r--r--chrome_frame/test/test_with_web_server.cc3
-rw-r--r--chrome_frame/test/test_with_web_server.h7
-rw-r--r--chrome_frame/urlmon_bind_status_callback.cc17
-rw-r--r--chrome_frame/urlmon_moniker.cc10
-rw-r--r--chrome_frame/urlmon_url_request.cc22
-rw-r--r--chrome_frame/utils.cc24
24 files changed, 163 insertions, 130 deletions
diff --git a/chrome_frame/bho.cc b/chrome_frame/bho.cc
index 58c5dc5..68342b9 100644
--- a/chrome_frame/bho.cc
+++ b/chrome_frame/bho.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,6 +11,7 @@
#include "base/path_service.h"
#include "base/scoped_bstr_win.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "chrome_tab.h" // NOLINT
#include "chrome_frame/crash_reporting/crash_metrics.h"
#include "chrome_frame/extra_system_apis.h"
@@ -265,7 +266,7 @@ HRESULT Bho::OnHttpEquiv(IBrowserService_OnHttpEquiv_Fn original_httpequiv,
NavigationManager* mgr = NavigationManager::GetThreadInstance();
DCHECK(mgr);
DLOG(INFO) << "Found tag in page. Marking browser." <<
- StringPrintf(" tid=0x%08X", ::GetCurrentThreadId());
+ base::StringPrintf(" tid=0x%08X", ::GetCurrentThreadId());
if (mgr) {
// TODO(tommi): See if we can't figure out a cleaner way to avoid
// this. For some documents we can hit a problem here. When we
diff --git a/chrome_frame/bind_status_callback_impl.cc b/chrome_frame/bind_status_callback_impl.cc
index 3b7ff04..b9fa0c0 100644
--- a/chrome_frame/bind_status_callback_impl.cc
+++ b/chrome_frame/bind_status_callback_impl.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
BSCBImpl::BSCBImpl() {
DLOG(INFO) << __FUNCTION__ << me();
@@ -16,8 +17,7 @@ BSCBImpl::~BSCBImpl() {
}
std::string BSCBImpl::me() {
- return StringPrintf(" obj=0x%08X",
- static_cast<BSCBImpl*>(this));
+ return base::StringPrintf(" obj=0x%08X", static_cast<BSCBImpl*>(this));
}
HRESULT BSCBImpl::DelegateQI(void* obj, REFIID iid, void** ret, DWORD cookie) {
@@ -75,7 +75,7 @@ HRESULT BSCBImpl::QueryService(REFGUID service, REFIID iid, void** object) {
// IBindStatusCallback
HRESULT BSCBImpl::OnStartBinding(DWORD reserved, IBinding* binding) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
@@ -84,7 +84,7 @@ HRESULT BSCBImpl::OnStartBinding(DWORD reserved, IBinding* binding) {
}
HRESULT BSCBImpl::GetPriority(LONG* priority) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
@@ -93,7 +93,7 @@ HRESULT BSCBImpl::GetPriority(LONG* priority) {
}
HRESULT BSCBImpl::OnLowResource(DWORD reserved) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
@@ -103,8 +103,9 @@ HRESULT BSCBImpl::OnLowResource(DWORD reserved) {
HRESULT BSCBImpl::OnProgress(ULONG progress, ULONG progress_max,
ULONG status_code, LPCWSTR status_text) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" status=%i tid=%i %ls",
- status_code, PlatformThread::CurrentId(), status_text);
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(
+ " status=%i tid=%i %ls", status_code, PlatformThread::CurrentId(),
+ status_text);
HRESULT hr = S_OK;
if (delegate_)
delegate_->OnProgress(progress, progress_max, status_code, status_text);
@@ -112,8 +113,8 @@ HRESULT BSCBImpl::OnProgress(ULONG progress, ULONG progress_max,
}
HRESULT BSCBImpl::OnStopBinding(HRESULT hresult, LPCWSTR error) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" hr=0x%08X '%ls' tid=%i",
- hresult, error, PlatformThread::CurrentId());
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(
+ " hr=0x%08X '%ls' tid=%i", hresult, error, PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
delegate_->OnStopBinding(hresult, error);
@@ -121,7 +122,7 @@ HRESULT BSCBImpl::OnStopBinding(HRESULT hresult, LPCWSTR error) {
}
HRESULT BSCBImpl::GetBindInfo(DWORD* bindf, BINDINFO* bind_info) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
@@ -131,7 +132,7 @@ HRESULT BSCBImpl::GetBindInfo(DWORD* bindf, BINDINFO* bind_info) {
HRESULT BSCBImpl::OnDataAvailable(DWORD bscf, DWORD size,
FORMATETC* format_etc, STGMEDIUM* stgmed) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
@@ -140,7 +141,7 @@ HRESULT BSCBImpl::OnDataAvailable(DWORD bscf, DWORD size,
}
HRESULT BSCBImpl::OnObjectAvailable(REFIID iid, IUnknown* unk) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
@@ -151,7 +152,7 @@ HRESULT BSCBImpl::OnObjectAvailable(REFIID iid, IUnknown* unk) {
// IBindStatusCallbackEx
HRESULT BSCBImpl::GetBindInfoEx(DWORD* bindf, BINDINFO* bind_info,
DWORD* bindf2, DWORD* reserved) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_) {
@@ -166,7 +167,7 @@ HRESULT BSCBImpl::GetBindInfoEx(DWORD* bindf, BINDINFO* bind_info,
HRESULT BSCBImpl::BeginningTransaction(LPCWSTR url, LPCWSTR headers,
DWORD reserved,
LPWSTR* additional_headers) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
HRESULT hr = S_OK;
@@ -186,7 +187,7 @@ HRESULT BSCBImpl::BeginningTransaction(LPCWSTR url, LPCWSTR headers,
HRESULT BSCBImpl::OnResponse(DWORD response_code, LPCWSTR response_headers,
LPCWSTR request_headers,
LPWSTR* additional_headers) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
HRESULT hr = S_OK;
diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc
index 5da61f5..5aa9294 100644
--- a/chrome_frame/chrome_frame_activex.cc
+++ b/chrome_frame/chrome_frame_activex.cc
@@ -19,6 +19,7 @@
#include "base/singleton.h"
#include "base/string_split.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/trace_event.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_constants.h"
@@ -330,10 +331,11 @@ STDMETHODIMP ChromeFrameActivex::Load(IPropertyBag* bag, IErrorLog* error_log) {
FAILED(hr = CreateScriptBlockForEvent(element, object_id,
V_BSTR(&value), prop))) {
DLOG(ERROR) << "Failed to create script block for " << prop
- << StringPrintf(L"hr=0x%08X, vt=%i", hr, value.type());
+ << base::StringPrintf(L"hr=0x%08X, vt=%i", hr,
+ value.type());
} else {
DLOG(INFO) << "script block created for event " << prop <<
- StringPrintf(" (0x%08X)", hr) << " connections: " <<
+ base::StringPrintf(" (0x%08X)", hr) << " connections: " <<
ProxyDIChromeFrameEvents<ChromeFrameActivex>::m_vec.GetSize();
}
} else {
@@ -362,7 +364,7 @@ STDMETHODIMP ChromeFrameActivex::Load(IPropertyBag* bag, IErrorLog* error_log) {
}
DLOG_IF(ERROR, FAILED(hr))
- << StringPrintf("Failed to load property bag: 0x%08X", hr);
+ << base::StringPrintf("Failed to load property bag: 0x%08X", hr);
return hr;
}
@@ -574,7 +576,7 @@ void ChromeFrameActivex::FireEvent(const EventHandlers& handlers,
// 0x80020101 == SCRIPT_E_REPORTED.
// When the script we're invoking has an error, we get this error back.
DLOG_IF(ERROR, FAILED(hr) && hr != 0x80020101)
- << StringPrintf(L"Failed to invoke script: 0x%08X", hr);
+ << base::StringPrintf(L"Failed to invoke script: 0x%08X", hr);
}
}
@@ -595,7 +597,7 @@ void ChromeFrameActivex::FireEvent(const EventHandlers& handlers,
// 0x80020101 == SCRIPT_E_REPORTED.
// When the script we're invoking has an error, we get this error back.
DLOG_IF(ERROR, FAILED(hr) && hr != 0x80020101)
- << StringPrintf(L"Failed to invoke script: 0x%08X", hr);
+ << base::StringPrintf(L"Failed to invoke script: 0x%08X", hr);
}
}
@@ -636,7 +638,7 @@ HRESULT ChromeFrameActivex::registerBhoIfNeeded() {
web_browser2.Receive());
if (FAILED(hr) || web_browser2.get() == NULL) {
DLOG(WARNING) << "Failed to get IWebBrowser2 from client site. Error:"
- << StringPrintf(" 0x%08X", hr);
+ << base::StringPrintf(" 0x%08X", hr);
return hr;
}
@@ -648,14 +650,14 @@ HRESULT ChromeFrameActivex::registerBhoIfNeeded() {
hr = bho.CreateInstance(CLSID_ChromeFrameBHO, NULL, CLSCTX_INPROC_SERVER);
if (FAILED(hr)) {
NOTREACHED() << "Failed to register ChromeFrame BHO. Error:"
- << StringPrintf(" 0x%08X", hr);
+ << base::StringPrintf(" 0x%08X", hr);
return hr;
}
hr = bho->SetSite(web_browser2);
if (FAILED(hr)) {
NOTREACHED() << "ChromeFrame BHO SetSite failed. Error:"
- << StringPrintf(" 0x%08X", hr);
+ << base::StringPrintf(" 0x%08X", hr);
return hr;
}
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h
index 611f3ae..84fccd5 100644
--- a/chrome_frame/chrome_frame_activex_base.h
+++ b/chrome_frame/chrome_frame_activex_base.h
@@ -21,6 +21,7 @@
#include "base/scoped_comptr_win.h"
#include "base/scoped_variant_win.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "grit/chrome_frame_resources.h"
#include "chrome/common/url_constants.h"
@@ -70,7 +71,7 @@ class ATL_NO_VTABLE ProxyDIChromeFrameEvents
LOCALE_USER_DEFAULT, DISPATCH_METHOD,
&disp_params, NULL, NULL, NULL);
DLOG_IF(ERROR, FAILED(hr)) << "invoke(" << dispid << ") failed" <<
- StringPrintf("0x%08X", hr);
+ base::StringPrintf("0x%08X", hr);
}
}
}
@@ -489,17 +490,17 @@ END_MSG_MAP()
host = "local_host";
}
- std::string url =
- StringPrintf("%hs:%hs?attach_external_tab&%I64u&%d&%d&%d&%d&%d&%hs",
- scheme.c_str(),
- host.c_str(),
- params.cookie,
- params.disposition,
- params.dimensions.x(),
- params.dimensions.y(),
- params.dimensions.width(),
- params.dimensions.height(),
- params.profile_name.c_str());
+ std::string url = base::StringPrintf(
+ "%hs:%hs?attach_external_tab&%I64u&%d&%d&%d&%d&%d&%hs",
+ scheme.c_str(),
+ host.c_str(),
+ params.cookie,
+ params.disposition,
+ params.dimensions.x(),
+ params.dimensions.y(),
+ params.dimensions.width(),
+ params.dimensions.height(),
+ params.profile_name.c_str());
HostNavigate(GURL(url), GURL(), params.disposition);
}
@@ -912,7 +913,8 @@ END_MSG_MAP()
hr = E_ACCESSDENIED;
}
} else {
- Error(StringPrintf("Event type '%ls' not found", event_type).c_str());
+ Error(base::StringPrintf(
+ "Event type '%ls' not found", event_type).c_str());
hr = E_INVALIDARG;
}
@@ -1074,7 +1076,7 @@ END_MSG_MAP()
hr = AllowFrameToTranslateAccelerator(accel_message);
DLOG(INFO) << __FUNCTION__ << " browser response: "
- << StringPrintf("0x%08x", hr);
+ << base::StringPrintf("0x%08x", hr);
if (hr != S_OK) {
// The WM_SYSCHAR message is not processed by the IOleControlSite
diff --git a/chrome_frame/chrome_frame_npapi.cc b/chrome_frame/chrome_frame_npapi.cc
index f0874e2..3524335 100644
--- a/chrome_frame/chrome_frame_npapi.cc
+++ b/chrome_frame/chrome_frame_npapi.cc
@@ -9,6 +9,7 @@
#include "base/message_loop.h"
#include "base/string_split.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome_frame/ff_privilege_check.h"
@@ -425,7 +426,7 @@ void ChromeFrameNPAPI::UrlNotify(const char* url, NPReason reason,
void ChromeFrameNPAPI::OnAcceleratorPressed(int tab_handle,
const MSG& accel_message) {
DLOG(INFO) << __FUNCTION__ << " msg:"
- << StringPrintf("0x%04X", accel_message.message) << " key:"
+ << base::StringPrintf("0x%04X", accel_message.message) << " key:"
<< accel_message.wParam;
// The host browser does call TranslateMessage on messages like WM_KEYDOWN
diff --git a/chrome_frame/com_message_event.cc b/chrome_frame/com_message_event.cc
index ce4f016..8535999 100644
--- a/chrome_frame/com_message_event.cc
+++ b/chrome_frame/com_message_event.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
ComMessageEvent::ComMessageEvent() {
@@ -93,7 +94,7 @@ STDMETHODIMP ComMessageEvent::GetIDsOfNames(REFIID iid, LPOLESTR* names,
if (FAILED(hr)) {
DLOG(WARNING) << "member not found: " << names[i]
- << StringPrintf(L"0x%08X", hr);
+ << base::StringPrintf(L"0x%08X", hr);
}
}
}
diff --git a/chrome_frame/html_utils.cc b/chrome_frame/html_utils.cc
index afe4378..7e41210 100644
--- a/chrome_frame/html_utils.cc
+++ b/chrome_frame/html_utils.cc
@@ -9,6 +9,7 @@
#include "base/string_util.h"
#include "base/string_tokenizer.h"
+#include "base/stringprintf.h"
#include "chrome_frame/utils.h"
#include "net/base/net_util.h"
#include "webkit/glue/user_agent.h"
@@ -365,7 +366,7 @@ std::string GetDefaultUserAgent() {
}
if (FAILED(hr)) {
- NOTREACHED() << StringPrintf("ObtainUserAgentString==0x%08X", hr);
+ NOTREACHED() << base::StringPrintf("ObtainUserAgentString==0x%08X", hr);
return std::string();
}
diff --git a/chrome_frame/http_negotiate.cc b/chrome_frame/http_negotiate.cc
index 8a1146e..f68e4ff 100644
--- a/chrome_frame/http_negotiate.cc
+++ b/chrome_frame/http_negotiate.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,8 +11,8 @@
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
-
#include "chrome_frame/bho.h"
#include "chrome_frame/exception_barrier.h"
#include "chrome_frame/html_utils.h"
@@ -20,7 +20,6 @@
#include "chrome_frame/urlmon_moniker.h"
#include "chrome_frame/utils.h"
#include "chrome_frame/vtable_patch_manager.h"
-
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
@@ -242,10 +241,10 @@ HRESULT HttpNegotiatePatch::PatchHttpNegotiate(IUnknown* to_patch) {
if (http) {
hr = vtable_patch::PatchInterfaceMethods(http, IHttpNegotiate_PatchInfo);
DLOG_IF(ERROR, FAILED(hr))
- << StringPrintf("HttpNegotiate patch failed 0x%08X", hr);
+ << base::StringPrintf("HttpNegotiate patch failed 0x%08X", hr);
} else {
DLOG(WARNING)
- << StringPrintf("IHttpNegotiate not supported 0x%08X", hr);
+ << base::StringPrintf("IHttpNegotiate not supported 0x%08X", hr);
}
ScopedComPtr<IBindStatusCallback> bscb;
@@ -255,10 +254,10 @@ HRESULT HttpNegotiatePatch::PatchHttpNegotiate(IUnknown* to_patch) {
hr = vtable_patch::PatchInterfaceMethods(bscb,
IBindStatusCallback_PatchInfo);
DLOG_IF(ERROR, FAILED(hr))
- << StringPrintf("BindStatusCallback patch failed 0x%08X", hr);
+ << base::StringPrintf("BindStatusCallback patch failed 0x%08X", hr);
} else {
- DLOG(WARNING) << StringPrintf("IBindStatusCallback not supported 0x%08X",
- hr);
+ DLOG(WARNING) << base::StringPrintf(
+ "IBindStatusCallback not supported 0x%08X", hr);
}
return hr;
}
@@ -347,7 +346,7 @@ HRESULT HttpNegotiatePatch::ReportProgress(
IInternetProtocolSink_ReportProgress_Fn original, IInternetProtocolSink* me,
ULONG status_code, LPCWSTR status_text) {
DLOG(INFO) << __FUNCTION__
- << StringPrintf(" %i %ls", status_code, status_text);
+ << base::StringPrintf(" %i %ls", status_code, status_text);
bool updated_mime_type = false;
if (status_code == BINDSTATUS_MIMETYPEAVAILABLE ||
diff --git a/chrome_frame/metrics_service.cc b/chrome_frame/metrics_service.cc
index 46b4f1c..577ac82 100644
--- a/chrome_frame/metrics_service.cc
+++ b/chrome_frame/metrics_service.cc
@@ -55,6 +55,7 @@
#include "base/lock.h"
#include "base/string_split.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/thread.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
@@ -329,9 +330,10 @@ class ChromeFrameMetricsDataUploader
const ResponseCookies& cookies,
const std::string& data) {
DLOG(INFO) << __FUNCTION__
- << StringPrintf(": url : %hs, status:%d, response code: %d\n",
- url.spec().c_str(), status.status(),
- response_code);
+ << base::StringPrintf(
+ ": url : %hs, status:%d, response code: %d\n",
+ url.spec().c_str(), status.status(),
+ response_code);
delete fetcher_;
fetcher_ = NULL;
diff --git a/chrome_frame/protocol_sink_wrap.cc b/chrome_frame/protocol_sink_wrap.cc
index 15d74e7..ad46ca2 100644
--- a/chrome_frame/protocol_sink_wrap.cc
+++ b/chrome_frame/protocol_sink_wrap.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,8 +11,8 @@
#include "base/scoped_bstr_win.h"
#include "base/singleton.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
-
#include "chrome_frame/bho.h"
#include "chrome_frame/bind_context_info.h"
#include "chrome_frame/exception_barrier.h"
@@ -85,11 +85,11 @@ ProtData::ProtocolDataMap ProtData::datamap_;
Lock ProtData::datamap_lock_;
ProtocolSinkWrap::ProtocolSinkWrap() {
- DLOG(INFO) << __FUNCTION__ << StringPrintf(" 0x%08X", this);
+ DLOG(INFO) << __FUNCTION__ << base::StringPrintf(" 0x%08X", this);
}
ProtocolSinkWrap::~ProtocolSinkWrap() {
- DLOG(INFO) << __FUNCTION__ << StringPrintf(" 0x%08X", this);
+ DLOG(INFO) << __FUNCTION__ << base::StringPrintf(" 0x%08X", this);
}
ScopedComPtr<IInternetProtocolSink> ProtocolSinkWrap::CreateNewSink(
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index 3b0c132..a9645ec 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.cc
@@ -18,6 +18,7 @@
#include "base/scoped_handle.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "base/win_util.h"
#include "chrome/common/chrome_switches.h"
@@ -55,12 +56,12 @@ BOOL CALLBACK CloseWindowsThreadCallback(HWND hwnd, LPARAM param) {
DWORD results = 0;
if (!::SendMessageTimeout(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0, SMTO_BLOCK,
10000, &results)) {
- LOG(WARNING) << "Window hung: " << StringPrintf(L"%08X", hwnd);
+ LOG(WARNING) << "Window hung: " << base::StringPrintf(L"%08X", hwnd);
}
count++;
} else {
DLOG(WARNING) << "Skipping disabled window: "
- << StringPrintf(L"%08X", hwnd);
+ << base::StringPrintf(L"%08X", hwnd);
}
}
return TRUE; // continue enumeration
@@ -124,8 +125,9 @@ std::wstring GetExecutableAppPath(const std::wstring& file) {
std::wstring FormatCommandForApp(const std::wstring& exe_name,
const std::wstring& argument) {
- std::wstring reg_path(StringPrintf(L"Applications\\%ls\\shell\\open\\command",
- exe_name.c_str()));
+ std::wstring reg_path(
+ base::StringPrintf(L"Applications\\%ls\\shell\\open\\command",
+ exe_name.c_str()));
RegKey key(HKEY_CLASSES_ROOT, reg_path.c_str(), KEY_READ);
std::wstring command;
@@ -216,7 +218,7 @@ base::ProcessHandle LaunchIEOnVista(const std::wstring& url) {
if (SUCCEEDED(hr)) {
CloseHandle(pi.hThread);
} else {
- LOG(ERROR) << ::StringPrintf("IELaunchURL failed: 0x%08X", hr);
+ LOG(ERROR) << base::StringPrintf("IELaunchURL failed: 0x%08X", hr);
}
return pi.hProcess;
}
diff --git a/chrome_frame/test/chrome_frame_ui_test_utils.cc b/chrome_frame/test/chrome_frame_ui_test_utils.cc
index b0ff727..709d06c 100644
--- a/chrome_frame/test/chrome_frame_ui_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_ui_test_utils.cc
@@ -13,6 +13,7 @@
#include "base/scoped_bstr_win.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "gfx/point.h"
#include "gfx/rect.h"
@@ -380,8 +381,8 @@ std::wstring AccObject::GetDescription() {
value = L"'" + value + L"'";
int state = 0;
GetState(&state);
- return StringPrintf(L"[%ls, %ls, %ls, 0x%x]", name.c_str(), role_text.c_str(),
- value.c_str(), state);
+ return base::StringPrintf(L"[%ls, %ls, %ls, 0x%x]", name.c_str(),
+ role_text.c_str(), value.c_str(), state);
}
std::wstring AccObject::GetTree() {
diff --git a/chrome_frame/test/ie_event_sink.cc b/chrome_frame/test/ie_event_sink.cc
index ec0fc5d..9848dcc 100644
--- a/chrome_frame/test/ie_event_sink.cc
+++ b/chrome_frame/test/ie_event_sink.cc
@@ -8,6 +8,7 @@
#include "base/scoped_handle.h"
#include "base/scoped_variant_win.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -144,7 +145,7 @@ void IEEventSink::Uninitialize() {
if (!process.IsValid()) {
DLOG_IF(WARNING, !process.IsValid())
- << StringPrintf("OpenProcess failed: %i", ::GetLastError());
+ << base::StringPrintf("OpenProcess failed: %i", ::GetLastError());
return;
}
// IE may not have closed yet. Wait here for the process to finish.
@@ -430,7 +431,7 @@ STDMETHODIMP IEEventSink::OnBeforeNavigate2(
VARIANT* target_frame_name, VARIANT* post_data, VARIANT* headers,
VARIANT_BOOL* cancel) {
DLOG(INFO) << __FUNCTION__
- << StringPrintf("%ls - 0x%08X", url->bstrVal, this);
+ << base::StringPrintf("%ls - 0x%08X", url->bstrVal, this);
// Reset any existing reference to chrome frame since this is a new
// navigation.
DisconnectFromChromeFrame();
@@ -460,8 +461,8 @@ STDMETHODIMP_(void) IEEventSink::OnDocumentComplete(
STDMETHODIMP_(void) IEEventSink::OnFileDownload(
VARIANT_BOOL active_doc, VARIANT_BOOL* cancel) {
- DLOG(INFO) << __FUNCTION__ << StringPrintf(" 0x%08X ad=%i", this,
- active_doc);
+ DLOG(INFO) << __FUNCTION__ << base::StringPrintf(" 0x%08X ad=%i", this,
+ active_doc);
if (listener_)
listener_->OnFileDownload(active_doc, cancel);
// Always cancel file downloads in tests.
diff --git a/chrome_frame/test/mock_ie_event_sink_test.h b/chrome_frame/test/mock_ie_event_sink_test.h
index 74be974..898d14e 100644
--- a/chrome_frame/test/mock_ie_event_sink_test.h
+++ b/chrome_frame/test/mock_ie_event_sink_test.h
@@ -12,6 +12,7 @@
#include "base/file_path.h"
#include "base/string_number_conversions.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/chrome_frame_ui_test_utils.h"
@@ -182,7 +183,7 @@ class MockPropertyNotifySinkListener : public PropertyNotifySinkListener {
if (SUCCEEDED(hr)) {
event_source_ = obj;
} else {
- LOG(ERROR) << StringPrintf("AtlAdvise: 0x%08X", hr);
+ LOG(ERROR) << base::StringPrintf("AtlAdvise: 0x%08X", hr);
cookie_ = 0;
}
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc
index 59d4f84..867f156 100644
--- a/chrome_frame/test/net/fake_external_tab.cc
+++ b/chrome_frame/test/net/fake_external_tab.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,6 +19,7 @@
#include "base/path_service.h"
#include "base/scoped_comptr_win.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "chrome/browser/automation/automation_provider_list.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/prefs/browser_prefs.h"
@@ -273,8 +274,8 @@ void CFUrlRequestUnittestRunner::StartChromeFrameInHostBrowser() {
test_http_server_.reset(new test_server::SimpleWebServer(kTestServerPort));
test_http_server_->AddResponse(&chrome_frame_html_);
- std::wstring url(StringPrintf(L"http://localhost:%i/chrome_frame",
- kTestServerPort).c_str());
+ std::wstring url(base::StringPrintf(L"http://localhost:%i/chrome_frame",
+ kTestServerPort).c_str());
// Launch IE. This launches IE correctly on Vista too.
ScopedHandle ie_process(chrome_frame_test::LaunchIE(url));
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc
index 1e6bb72..729f787 100644
--- a/chrome_frame/test/perf/chrome_frame_perftest.cc
+++ b/chrome_frame/test/perf/chrome_frame_perftest.cc
@@ -23,6 +23,7 @@
#include "base/scoped_comptr_win.h"
#include "base/scoped_variant_win.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/time.h"
#include "base/trace_event_win.h"
#include "base/utf_string_conversions.h"
@@ -174,7 +175,7 @@ class ChromeFrameActiveXContainer
HRESULT hr = tab_->put_src(ScopedBstr(UTF8ToWide(url).c_str()));
DCHECK(hr == S_OK) << "Chrome frame NavigateToURL(" << url
- << StringPrintf(L") failed 0x%08X", hr);
+ << base::StringPrintf(L") failed 0x%08X", hr);
}
void SetupEventSinks() {
diff --git a/chrome_frame/test/policy_settings_unittest.cc b/chrome_frame/test/policy_settings_unittest.cc
index 9dee3d6..185ab23 100644
--- a/chrome_frame/test/policy_settings_unittest.cc
+++ b/chrome_frame/test/policy_settings_unittest.cc
@@ -87,7 +87,7 @@ bool SetRendererSettings(HKEY policy_root,
EXPECT_TRUE(exclusion_key.Create(policy_key.Handle(), exclusion_list.c_str(),
KEY_ALL_ACCESS));
for (int i = 0; i < exclusion_count; ++i) {
- EXPECT_TRUE(exclusion_key.WriteValue(StringPrintf(L"%i", i).c_str(),
+ EXPECT_TRUE(exclusion_key.WriteValue(base::StringPrintf(L"%i", i).c_str(),
exclusions[i]));
}
diff --git a/chrome_frame/test/test_server.cc b/chrome_frame/test/test_server.cc
index 2a535d1..4493300 100644
--- a/chrome_frame/test/test_server.cc
+++ b/chrome_frame/test/test_server.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,10 +9,9 @@
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
-
#include "chrome_frame/test/test_server.h"
-
#include "net/base/winsock_init.h"
#include "net/http/http_util.h"
@@ -116,11 +115,12 @@ size_t FileResponse::ContentLength() const {
}
bool RedirectResponse::GetCustomHeaders(std::string* headers) const {
- *headers = StringPrintf("HTTP/1.1 302 Found\r\n"
- "Connection: close\r\n"
- "Content-Length: 0\r\n"
- "Content-Type: text/html\r\n"
- "Location: %hs\r\n\r\n", redirect_url_.c_str());
+ *headers = base::StringPrintf("HTTP/1.1 302 Found\r\n"
+ "Connection: close\r\n"
+ "Content-Length: 0\r\n"
+ "Content-Type: text/html\r\n"
+ "Location: %hs\r\n\r\n",
+ redirect_url_.c_str());
return true;
}
@@ -195,8 +195,9 @@ void SimpleWebServer::DidRead(ListenSocket* connection,
std::string content_type;
if (!response->GetContentType(&content_type))
content_type = kDefaultContentType;
- headers = StringPrintf(kDefaultHeaderTemplate, kStatusOk,
- content_type.c_str(), response->ContentLength());
+ headers = base::StringPrintf(kDefaultHeaderTemplate, kStatusOk,
+ content_type.c_str(),
+ response->ContentLength());
}
connection->Send(headers, false);
@@ -204,8 +205,10 @@ void SimpleWebServer::DidRead(ListenSocket* connection,
response->IncrementAccessCounter();
} else {
std::string payload = "sorry, I can't find " + request.path();
- std::string headers(StringPrintf(kDefaultHeaderTemplate, kStatusNotFound,
- kDefaultContentType, payload.length()));
+ std::string headers(base::StringPrintf(kDefaultHeaderTemplate,
+ kStatusNotFound,
+ kDefaultContentType,
+ payload.length()));
connection->Send(headers, false);
connection->Send(payload, false);
}
@@ -290,17 +293,17 @@ std::wstring HTTPTestServer::Resolve(const std::wstring& path) {
if (port_ == 80) {
if (stripped_path.empty()) {
- return StringPrintf(L"http://%ls", address_.c_str());
+ return base::StringPrintf(L"http://%ls", address_.c_str());
} else {
- return StringPrintf(L"http://%ls/%ls", address_.c_str(),
+ return base::StringPrintf(L"http://%ls/%ls", address_.c_str(),
stripped_path.c_str());
}
} else {
if (stripped_path.empty()) {
- return StringPrintf(L"http://%ls:%d", address_.c_str(), port_);
+ return base::StringPrintf(L"http://%ls:%d", address_.c_str(), port_);
} else {
- return StringPrintf(L"http://%ls:%d/%ls", address_.c_str(), port_,
- stripped_path.c_str());
+ return base::StringPrintf(L"http://%ls:%d/%ls", address_.c_str(), port_,
+ stripped_path.c_str());
}
}
}
@@ -335,8 +338,8 @@ void ConfigurableConnection::SendWithOptions(const std::string& headers,
std::string content_length_header;
if (!content.empty() &&
std::string::npos == headers.find("Context-Length:")) {
- content_length_header = StringPrintf("Content-Length: %u\r\n",
- content.size());
+ content_length_header = base::StringPrintf("Content-Length: %u\r\n",
+ content.size());
}
// Save the options.
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc
index bedbba4..178d073 100644
--- a/chrome_frame/test/test_with_web_server.cc
+++ b/chrome_frame/test/test_with_web_server.cc
@@ -7,6 +7,7 @@
#include "base/base_paths.h"
#include "base/file_version_info.h"
#include "base/path_service.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "base/win_util.h"
#include "chrome/common/chrome_switches.h"
@@ -1061,7 +1062,7 @@ class UaTemplateFileResponse : public test_server::FileResponse {
i = content_.find(kRequestIdTemplate);
if (i != std::string::npos) {
content_.replace(i, arraysize(kRequestIdTemplate) - 1,
- StringPrintf("%i", request_id_));
+ base::StringPrintf("%i", request_id_));
}
return content_.length();
}
diff --git a/chrome_frame/test/test_with_web_server.h b/chrome_frame/test/test_with_web_server.h
index 97a3a8d..5c87791 100644
--- a/chrome_frame/test/test_with_web_server.h
+++ b/chrome_frame/test/test_with_web_server.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/http_server.h"
@@ -232,12 +233,14 @@ class SimpleWebServerTest {
const FilePath& directory) {
for (int i = 0; i < count; ++i) {
server_.AddResponse(new ResponseClass(
- StringPrintf("/%ls", pages[i]).c_str(), directory.Append(pages[i])));
+ base::StringPrintf("/%ls", pages[i]).c_str(),
+ directory.Append(pages[i])));
}
}
std::wstring FormatHttpPath(const wchar_t* document_path) {
- return StringPrintf(L"http://localhost:%i/%ls", port_, document_path);
+ return base::StringPrintf(L"http://localhost:%i/%ls", port_,
+ document_path);
}
// Returns the last client request object.
diff --git a/chrome_frame/urlmon_bind_status_callback.cc b/chrome_frame/urlmon_bind_status_callback.cc
index 5faf05a..bfc41f9 100644
--- a/chrome_frame/urlmon_bind_status_callback.cc
+++ b/chrome_frame/urlmon_bind_status_callback.cc
@@ -9,8 +9,8 @@
#include "base/logging.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
-
#include "chrome_frame/bind_context_info.h"
#include "chrome_frame/exception_barrier.h"
#include "chrome_frame/urlmon_moniker.h"
@@ -197,8 +197,8 @@ void SniffData::DetermineRendererType(bool last_chance) {
}
}
DLOG(INFO) << __FUNCTION__ << "Url: " << url_ <<
- StringPrintf("Renderer type: %s",
- renderer_type_ == CHROME ? "CHROME" : "OTHER");
+ base::StringPrintf("Renderer type: %s",
+ renderer_type_ == CHROME ? "CHROME" : "OTHER");
}
}
@@ -213,7 +213,7 @@ BSCBStorageBind::~BSCBStorageBind() {
}
HRESULT BSCBStorageBind::Initialize(IMoniker* moniker, IBindCtx* bind_ctx) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
std::wstring url = GetActualUrlFromMoniker(moniker, bind_ctx,
@@ -238,8 +238,9 @@ HRESULT BSCBStorageBind::Initialize(IMoniker* moniker, IBindCtx* bind_ctx) {
STDMETHODIMP BSCBStorageBind::OnProgress(ULONG progress, ULONG progress_max,
ULONG status_code, LPCWSTR status_text) {
- DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" status=%i tid=%i %ls",
- status_code, PlatformThread::CurrentId(), status_text);
+ DLOG(INFO) << __FUNCTION__ << me() << base::StringPrintf(
+ " status=%i tid=%i %ls", status_code, PlatformThread::CurrentId(),
+ status_text);
// Report all crashes in the exception handler if we wrap the callback.
// Note that this avoids having the VEH report a crash if an SEH earlier in
// the chain handles the exception.
@@ -272,7 +273,7 @@ STDMETHODIMP BSCBStorageBind::OnProgress(ULONG progress, ULONG progress_max,
STDMETHODIMP BSCBStorageBind::OnDataAvailable(DWORD flags, DWORD size,
FORMATETC* format_etc,
STGMEDIUM* stgmed) {
- DLOG(INFO) << __FUNCTION__ << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
// Report all crashes in the exception handler if we wrap the callback.
// Note that this avoids having the VEH report a crash if an SEH earlier in
@@ -315,7 +316,7 @@ STDMETHODIMP BSCBStorageBind::OnDataAvailable(DWORD flags, DWORD size,
}
STDMETHODIMP BSCBStorageBind::OnStopBinding(HRESULT hresult, LPCWSTR error) {
- DLOG(INFO) << __FUNCTION__ << StringPrintf(" tid=%i",
+ DLOG(INFO) << __FUNCTION__ << base::StringPrintf(" tid=%i",
PlatformThread::CurrentId());
// Report all crashes in the exception handler if we wrap the callback.
// Note that this avoids having the VEH report a crash if an SEH earlier in
diff --git a/chrome_frame/urlmon_moniker.cc b/chrome_frame/urlmon_moniker.cc
index 452a9a6..f13acb5 100644
--- a/chrome_frame/urlmon_moniker.cc
+++ b/chrome_frame/urlmon_moniker.cc
@@ -7,6 +7,7 @@
#include <shlguid.h>
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome_frame/bho.h"
#include "chrome_frame/bind_context_info.h"
@@ -50,7 +51,7 @@ HRESULT NavigationManager::NavigateToCurrentUrlInCF(IBrowserService* browser) {
// If there's a referrer, preserve it.
std::wstring headers;
if (!referrer_.empty()) {
- headers = StringPrintf(L"Referer: %ls\r\n\r\n",
+ headers = base::StringPrintf(L"Referer: %ls\r\n\r\n",
ASCIIToWide(referrer_).c_str());
}
@@ -63,7 +64,7 @@ HRESULT NavigationManager::NavigateToCurrentUrlInCF(IBrowserService* browser) {
hr = NavigateBrowserToMoniker(browser, moniker, headers.c_str(),
bind_context, fragment.c_str());
- DLOG(INFO) << StringPrintf("NavigateBrowserToMoniker: 0x%08X", hr);
+ DLOG(INFO) << base::StringPrintf("NavigateBrowserToMoniker: 0x%08X", hr);
}
}
@@ -105,7 +106,8 @@ bool MonikerPatch::Initialize() {
DCHECK(SUCCEEDED(hr));
if (SUCCEEDED(hr)) {
hr = vtable_patch::PatchInterfaceMethods(moniker, IMoniker_PatchInfo);
- DLOG_IF(ERROR, FAILED(hr)) << StringPrintf("patch failed 0x%08X", hr);
+ DLOG_IF(ERROR, FAILED(hr)) << base::StringPrintf(
+ "patch failed 0x%08X", hr);
}
return SUCCEEDED(hr);
@@ -120,7 +122,7 @@ bool ShouldWrapCallback(IMoniker* moniker, REFIID iid, IBindCtx* bind_context) {
CComHeapPtr<WCHAR> url;
HRESULT hr = moniker->GetDisplayName(bind_context, NULL, &url);
if (!url) {
- DLOG(INFO) << __FUNCTION__ << StringPrintf(
+ DLOG(INFO) << __FUNCTION__ << base::StringPrintf(
" GetDisplayName failed. Error: 0x%x", hr);
return false;
}
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index ea064e3..6f3e7cb 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -11,6 +11,7 @@
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/string_number_conversions.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome_frame/bind_context_info.h"
#include "chrome_frame/chrome_frame_activex_base.h"
@@ -38,7 +39,7 @@ UrlmonUrlRequest::~UrlmonUrlRequest() {
}
std::string UrlmonUrlRequest::me() const {
- return StringPrintf(" id: %i Obj: %X ", id(), this);
+ return base::StringPrintf(" id: %i Obj: %X ", id(), this);
}
bool UrlmonUrlRequest::Start() {
@@ -177,7 +178,7 @@ void UrlmonUrlRequest::TerminateBind(TerminateBindCallback* callback) {
// Just drop the data.
}
DLOG_IF(WARNING, hr != E_PENDING) << __FUNCTION__ <<
- StringPrintf(" expected E_PENDING but got 0x%08X", hr);
+ base::StringPrintf(" expected E_PENDING but got 0x%08X", hr);
}
}
}
@@ -325,7 +326,8 @@ STDMETHODIMP UrlmonUrlRequest::OnProgress(ULONG progress, ULONG max_progress,
default:
DLOG(INFO) << __FUNCTION__ << me()
- << StringPrintf(L"code: %i status: %ls", status_code, status_text);
+ << base::StringPrintf(L"code: %i status: %ls", status_code,
+ status_text);
break;
}
@@ -545,8 +547,9 @@ STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url,
if (post_data_len() > 0) {
// Tack on the Content-Length header since when using an IStream type
// STGMEDIUM, it looks like it doesn't get set for us :(
- new_headers = StringPrintf("Content-Length: %s\r\n",
- base::Int64ToString(post_data_len()).c_str());
+ new_headers = base::StringPrintf(
+ "Content-Length: %s\r\n",
+ base::Int64ToString(post_data_len()).c_str());
}
if (!extra_headers().empty()) {
@@ -556,7 +559,7 @@ STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url,
if (!referrer().empty()) {
// Referrer is famously misspelled in HTTP:
- new_headers += StringPrintf("Referer: %s\r\n", referrer().c_str());
+ new_headers += base::StringPrintf("Referer: %s\r\n", referrer().c_str());
}
// In the rare case if "User-Agent" string is already in |current_headers|.
@@ -785,7 +788,7 @@ HRESULT UrlmonUrlRequest::StartAsyncDownload() {
// http://user2:secret@localhost:1337/auth-basic?set-cookie-if-challenged
// when running the UrlRequest unit tests.
DLOG(ERROR) << __FUNCTION__ << me() <<
- StringPrintf("IUrlMoniker::BindToStorage failed 0x%08X.", hr);
+ base::StringPrintf("IUrlMoniker::BindToStorage failed 0x%08X.", hr);
// In most cases we'll get a MK_E_SYNTAX error here but if we abort
// the navigation ourselves such as in the case of seeing something
// else than ALLOWALL in X-Frame-Options.
@@ -793,7 +796,7 @@ HRESULT UrlmonUrlRequest::StartAsyncDownload() {
}
DLOG_IF(ERROR, FAILED(hr)) << me() <<
- StringPrintf(L"StartAsyncDownload failed: 0x%08X", hr);
+ base::StringPrintf(L"StartAsyncDownload failed: 0x%08X", hr);
return hr;
}
@@ -875,7 +878,8 @@ net::Error UrlmonUrlRequest::HresultToNetError(HRESULT hr) {
default:
DLOG(WARNING)
- << StringPrintf("TODO: translate HRESULT 0x%08X to net::Error", hr);
+ << base::StringPrintf("TODO: translate HRESULT 0x%08X to net::Error",
+ hr);
break;
}
return ret;
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index 8ed1d31..ba621a2 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -21,6 +21,7 @@
#include "base/string_number_conversions.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/thread_local.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_paths_internal.h"
@@ -324,10 +325,10 @@ void DisplayVersionMismatchWarning(HWND parent,
}
std::wstring title = SimpleResourceLoader::Get(IDS_VERSIONMISMATCH_HEADER);
std::wstring message;
- SStringPrintf(&message,
- SimpleResourceLoader::Get(IDS_VERSIONMISMATCH).c_str(),
- wide_server_version.c_str(),
- version_string.c_str());
+ base::SStringPrintf(&message,
+ SimpleResourceLoader::Get(IDS_VERSIONMISMATCH).c_str(),
+ wide_server_version.c_str(),
+ version_string.c_str());
::MessageBox(parent, message.c_str(), title.c_str(), MB_OK);
}
@@ -782,7 +783,8 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker,
HRESULT hr = DoQueryService(SID_SWebBrowserApp, browser,
web_browser2.Receive());
DCHECK(web_browser2);
- DLOG_IF(WARNING, FAILED(hr)) << StringPrintf(L"SWebBrowserApp 0x%08X", hr);
+ DLOG_IF(WARNING, FAILED(hr)) << base::StringPrintf(L"SWebBrowserApp 0x%08X",
+ hr);
if (FAILED(hr))
return hr;
@@ -835,7 +837,7 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker,
headers_var.AsInput(), bind_ctx,
const_cast<wchar_t*>(fragment));
DLOG_IF(WARNING, FAILED(hr))
- << StringPrintf(L"NavigateWithBindCtx2 0x%08X", hr);
+ << base::StringPrintf(L"NavigateWithBindCtx2 0x%08X", hr);
}
} else {
// IE6
@@ -865,13 +867,13 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker,
bind_ctx,
const_cast<wchar_t*>(fragment));
DLOG_IF(WARNING, FAILED(hr))
- << StringPrintf(L"NavigateWithBindCtx 0x%08X", hr);
+ << base::StringPrintf(L"NavigateWithBindCtx 0x%08X", hr);
} else {
NOTREACHED();
}
::CoTaskMemFree(url);
} else {
- DLOG(ERROR) << StringPrintf("GetDisplayName: 0x%08X", hr);
+ DLOG(ERROR) << base::StringPrintf("GetDisplayName: 0x%08X", hr);
}
}
@@ -1248,7 +1250,7 @@ std::string BindStatus2Str(ULONG bind_status) {
if (bind_status >= 1 && bind_status <= BINDSTATUS_64BIT_PROGRESS)
s = bindstatus_txt[bind_status - 1];
else
- s = StringPrintf("UnDoc[%#x]", bind_status);
+ s = base::StringPrintf("UnDoc[%#x]", bind_status);
return s;
}
@@ -1277,7 +1279,7 @@ std::string PiFlags2Str(DWORD flags) {
ADD_PI_FLAG(PI_PREFERDEFAULTHANDLER);
if (flags)
- s += StringPrintf("+UnDoc[%#x]", flags);
+ s += base::StringPrintf("+UnDoc[%#x]", flags);
return s;
#undef ADD_PI_FLAG
}
@@ -1299,7 +1301,7 @@ std::string Bscf2Str(DWORD flags) {
ADD_BSCF_FLAG(BSCF_64BITLENGTHDOWNLOAD)
if (flags)
- s += StringPrintf("+UnDoc[%#x]", flags);
+ s += base::StringPrintf("+UnDoc[%#x]", flags);
return s;
#undef ADD_BSCF_FLAG
}