summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-31 20:02:16 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-31 20:02:16 +0000
commitce072a7181ea5d58133e33654133236f5d9f5551 (patch)
tree1b1c903fec3fd27038cd17cb4ae9ca17d3736e40 /chrome_frame
parenta8e2058011129cbef38bf89834ee01715556b392 (diff)
downloadchromium_src-ce072a7181ea5d58133e33654133236f5d9f5551.zip
chromium_src-ce072a7181ea5d58133e33654133236f5d9f5551.tar.gz
chromium_src-ce072a7181ea5d58133e33654133236f5d9f5551.tar.bz2
Move platform_thread to base/threading and put in the base namespace. I left a
stub and "using" declarations in the old location to avoid having to change the entire project at once. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6001010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70342 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/bind_status_callback_impl.cc25
-rw-r--r--chrome_frame/cfproxy_private.h2
-rw-r--r--chrome_frame/chrome_frame_automation.cc28
-rw-r--r--chrome_frame/chrome_frame_automation.h8
-rw-r--r--chrome_frame/test/mock_ie_event_sink_actions.h6
-rw-r--r--chrome_frame/test/perf/chrome_frame_perftest.cc10
-rw-r--r--chrome_frame/test/run_all_unittests.cc5
-rw-r--r--chrome_frame/urlmon_bind_status_callback.cc10
-rw-r--r--chrome_frame/urlmon_url_request.cc31
-rw-r--r--chrome_frame/urlmon_url_request_private.h3
10 files changed, 67 insertions, 61 deletions
diff --git a/chrome_frame/bind_status_callback_impl.cc b/chrome_frame/bind_status_callback_impl.cc
index c85825d2..9e535e5 100644
--- a/chrome_frame/bind_status_callback_impl.cc
+++ b/chrome_frame/bind_status_callback_impl.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
+#include "base/threading/platform_thread.h"
BSCBImpl::BSCBImpl() {
DVLOG(1) << __FUNCTION__ << me();
@@ -76,7 +77,7 @@ HRESULT BSCBImpl::QueryService(REFGUID service, REFIID iid, void** object) {
// IBindStatusCallback
HRESULT BSCBImpl::OnStartBinding(DWORD reserved, IBinding* binding) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
hr = delegate_->OnStartBinding(reserved, binding);
@@ -85,7 +86,7 @@ HRESULT BSCBImpl::OnStartBinding(DWORD reserved, IBinding* binding) {
HRESULT BSCBImpl::GetPriority(LONG* priority) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
hr = delegate_->GetPriority(priority);
@@ -94,7 +95,7 @@ HRESULT BSCBImpl::GetPriority(LONG* priority) {
HRESULT BSCBImpl::OnLowResource(DWORD reserved) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
hr = delegate_->OnLowResource(reserved);
@@ -105,7 +106,8 @@ HRESULT BSCBImpl::OnProgress(ULONG progress, ULONG progress_max,
ULONG status_code, LPCWSTR status_text) {
DVLOG(1) << __FUNCTION__ << me()
<< base::StringPrintf(" status=%i tid=%i %ls", status_code,
- PlatformThread::CurrentId(), status_text);
+ base::PlatformThread::CurrentId(),
+ status_text);
HRESULT hr = S_OK;
if (delegate_)
delegate_->OnProgress(progress, progress_max, status_code, status_text);
@@ -115,7 +117,7 @@ HRESULT BSCBImpl::OnProgress(ULONG progress, ULONG progress_max,
HRESULT BSCBImpl::OnStopBinding(HRESULT hresult, LPCWSTR error) {
DVLOG(1) << __FUNCTION__ << me()
<< base::StringPrintf(" hr=0x%08X '%ls' tid=%i", hresult, error,
- PlatformThread::CurrentId());
+ base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
delegate_->OnStopBinding(hresult, error);
@@ -124,7 +126,7 @@ HRESULT BSCBImpl::OnStopBinding(HRESULT hresult, LPCWSTR error) {
HRESULT BSCBImpl::GetBindInfo(DWORD* bindf, BINDINFO* bind_info) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
delegate_->GetBindInfo(bindf, bind_info);
@@ -134,7 +136,7 @@ HRESULT BSCBImpl::GetBindInfo(DWORD* bindf, BINDINFO* bind_info) {
HRESULT BSCBImpl::OnDataAvailable(DWORD bscf, DWORD size,
FORMATETC* format_etc, STGMEDIUM* stgmed) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
hr = delegate_->OnDataAvailable(bscf, size, format_etc, stgmed);
@@ -143,7 +145,7 @@ HRESULT BSCBImpl::OnDataAvailable(DWORD bscf, DWORD size,
HRESULT BSCBImpl::OnObjectAvailable(REFIID iid, IUnknown* unk) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_)
delegate_->OnObjectAvailable(iid, unk);
@@ -154,7 +156,7 @@ HRESULT BSCBImpl::OnObjectAvailable(REFIID iid, IUnknown* unk) {
HRESULT BSCBImpl::GetBindInfoEx(DWORD* bindf, BINDINFO* bind_info,
DWORD* bindf2, DWORD* reserved) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_) {
ScopedComPtr<IBindStatusCallbackEx> bscbex;
@@ -169,7 +171,7 @@ HRESULT BSCBImpl::BeginningTransaction(LPCWSTR url, LPCWSTR headers,
DWORD reserved,
LPWSTR* additional_headers) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_) {
@@ -189,7 +191,7 @@ HRESULT BSCBImpl::OnResponse(DWORD response_code, LPCWSTR response_headers,
LPCWSTR request_headers,
LPWSTR* additional_headers) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
HRESULT hr = S_OK;
if (delegate_) {
@@ -229,4 +231,3 @@ HRESULT BSCBImpl::GetSerializedClientCertContext(BYTE** cert,
}
return hr;
}
-
diff --git a/chrome_frame/cfproxy_private.h b/chrome_frame/cfproxy_private.h
index 165e231..796ed4a 100644
--- a/chrome_frame/cfproxy_private.h
+++ b/chrome_frame/cfproxy_private.h
@@ -168,7 +168,7 @@ class CFProxy : public Interface2IPCMessage,
virtual void OnChannelError();
bool CalledOnIpcThread() const {
- return PlatformThread::CurrentId() == ipc_thread_.thread_id();
+ return base::PlatformThread::CurrentId() == ipc_thread_.thread_id();
}
base::Thread ipc_thread_;
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 72dae1e..dc17a6b 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -256,7 +256,7 @@ void AutomationProxyCacheEntry::StartSendUmaInterval(
void AutomationProxyCacheEntry::CreateProxy(ChromeFrameLaunchParams* params,
LaunchDelegate* delegate) {
- DCHECK(IsSameThread(PlatformThread::CurrentId()));
+ DCHECK(IsSameThread(base::PlatformThread::CurrentId()));
DCHECK(delegate);
DCHECK(params);
DCHECK(proxy_.get() == NULL);
@@ -378,7 +378,7 @@ void AutomationProxyCacheEntry::CreateProxy(ChromeFrameLaunchParams* params,
void AutomationProxyCacheEntry::RemoveDelegate(LaunchDelegate* delegate,
base::WaitableEvent* done,
bool* was_last_delegate) {
- DCHECK(IsSameThread(PlatformThread::CurrentId()));
+ DCHECK(IsSameThread(base::PlatformThread::CurrentId()));
DCHECK(delegate);
DCHECK(done);
DCHECK(was_last_delegate);
@@ -412,7 +412,7 @@ void AutomationProxyCacheEntry::RemoveDelegate(LaunchDelegate* delegate,
}
void AutomationProxyCacheEntry::AddDelegate(LaunchDelegate* delegate) {
- DCHECK(IsSameThread(PlatformThread::CurrentId()));
+ DCHECK(IsSameThread(base::PlatformThread::CurrentId()));
DCHECK(std::find(launch_delegates_.begin(),
launch_delegates_.end(),
delegate) == launch_delegates_.end())
@@ -424,7 +424,7 @@ void AutomationProxyCacheEntry::AddDelegate(LaunchDelegate* delegate) {
}
void AutomationProxyCacheEntry::OnChannelError() {
- DCHECK(IsSameThread(PlatformThread::CurrentId()));
+ DCHECK(IsSameThread(base::PlatformThread::CurrentId()));
launch_result_ = AUTOMATION_SERVER_CRASHED;
LaunchDelegates::const_iterator it = launch_delegates_.begin();
for (; it != launch_delegates_.end(); ++it) {
@@ -433,7 +433,7 @@ void AutomationProxyCacheEntry::OnChannelError() {
}
void AutomationProxyCacheEntry::SendUMAData() {
- DCHECK(IsSameThread(PlatformThread::CurrentId()));
+ DCHECK(IsSameThread(base::PlatformThread::CurrentId()));
DCHECK(snapshots_);
// IE uses the chrome frame provided UMA data uploading scheme. NPAPI
// continues to use Chrome to upload UMA data.
@@ -509,7 +509,7 @@ void ProxyFactory::GetAutomationServer(
}
DCHECK(automation_server_id != NULL);
- DCHECK(!entry->IsSameThread(PlatformThread::CurrentId()));
+ DCHECK(!entry->IsSameThread(base::PlatformThread::CurrentId()));
*automation_server_id = entry;
}
@@ -530,7 +530,7 @@ bool ProxyFactory::ReleaseAutomationServer(void* server_id,
proxies_.container().end(),
entry);
DCHECK(it != proxies_.container().end());
- DCHECK(!entry->IsSameThread(PlatformThread::CurrentId()));
+ DCHECK(!entry->IsSameThread(base::PlatformThread::CurrentId()));
lock_.Release();
#endif
@@ -613,7 +613,7 @@ bool ChromeFrameAutomationClient::Initialize(
chrome_launch_params_ = chrome_launch_params;
- ui_thread_id_ = PlatformThread::CurrentId();
+ ui_thread_id_ = base::PlatformThread::CurrentId();
#ifndef NDEBUG
// In debug mode give more time to work with a debugger.
if (IsDebuggerPresent()) {
@@ -868,7 +868,7 @@ void ChromeFrameAutomationClient::InstallExtensionComplete(
const FilePath& crx_path,
void* user_data,
AutomationMsg_ExtensionResponseValues res) {
- DCHECK_EQ(PlatformThread::CurrentId(), ui_thread_id_);
+ DCHECK_EQ(base::PlatformThread::CurrentId(), ui_thread_id_);
if (chrome_frame_delegate_) {
chrome_frame_delegate_->OnExtensionInstalled(crx_path, user_data, res);
@@ -894,7 +894,7 @@ void ChromeFrameAutomationClient::GetEnabledExtensions(void* user_data) {
void ChromeFrameAutomationClient::GetEnabledExtensionsComplete(
void* user_data,
std::vector<FilePath>* extension_directories) {
- DCHECK_EQ(PlatformThread::CurrentId(), ui_thread_id_);
+ DCHECK_EQ(base::PlatformThread::CurrentId(), ui_thread_id_);
if (chrome_frame_delegate_) {
chrome_frame_delegate_->OnGetEnabledExtensionsComplete(
@@ -1064,7 +1064,7 @@ void ChromeFrameAutomationClient::AutomationServerDied() {
void ChromeFrameAutomationClient::InitializeComplete(
AutomationLaunchResult result) {
- DCHECK_EQ(PlatformThread::CurrentId(), ui_thread_id_);
+ DCHECK_EQ(base::PlatformThread::CurrentId(), ui_thread_id_);
if (result != AUTOMATION_SUCCESS) {
DLOG(WARNING) << "InitializeComplete: failure " << result;
ReleaseAutomationServer();
@@ -1197,14 +1197,14 @@ void ChromeFrameAutomationClient::OnChannelError(TabProxy* tab) {
void ChromeFrameAutomationClient::OnMessageReceivedUIThread(
const IPC::Message& msg) {
- DCHECK_EQ(PlatformThread::CurrentId(), ui_thread_id_);
+ DCHECK_EQ(base::PlatformThread::CurrentId(), ui_thread_id_);
// Forward to the delegate.
if (chrome_frame_delegate_)
chrome_frame_delegate_->OnMessageReceived(msg);
}
void ChromeFrameAutomationClient::OnChannelErrorUIThread() {
- DCHECK_EQ(PlatformThread::CurrentId(), ui_thread_id_);
+ DCHECK_EQ(base::PlatformThread::CurrentId(), ui_thread_id_);
// Report a metric that something went wrong unexpectedly.
CrashMetricsReporter::GetInstance()->IncrementMetric(
@@ -1221,7 +1221,7 @@ void ChromeFrameAutomationClient::ReportNavigationError(
if (!chrome_frame_delegate_)
return;
- if (ui_thread_id_ == PlatformThread::CurrentId()) {
+ if (ui_thread_id_ == base::PlatformThread::CurrentId()) {
chrome_frame_delegate_->OnLoadFailed(error_code, url);
} else {
PostTask(FROM_HERE, NewRunnableMethod(this,
diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h
index 5b7ec85..73d4f1d 100644
--- a/chrome_frame/chrome_frame_automation.h
+++ b/chrome_frame/chrome_frame_automation.h
@@ -16,8 +16,8 @@
#include "base/scoped_handle.h"
#include "base/stack_container.h"
#include "base/task.h"
-#include "base/timer.h"
#include "base/thread.h"
+#include "base/timer.h"
#include "chrome/common/page_zoom.h"
#include "chrome/test/automation/automation_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
@@ -251,12 +251,12 @@ class AutomationProxyCacheEntry
return thread_->message_loop();
}
- bool IsSameThread(PlatformThreadId id) const {
+ bool IsSameThread(base::PlatformThreadId id) const {
return thread_->thread_id() == id;
}
ChromeFrameAutomationProxyImpl* proxy() const {
- DCHECK(IsSameThread(PlatformThread::CurrentId()));
+ DCHECK(IsSameThread(base::PlatformThread::CurrentId()));
return proxy_.get();
}
@@ -509,7 +509,7 @@ class ChromeFrameAutomationClient
}
HWND parent_window_;
- PlatformThreadId ui_thread_id_;
+ base::PlatformThreadId ui_thread_id_;
void* automation_server_id_;
ChromeFrameAutomationProxy* automation_server_;
diff --git a/chrome_frame/test/mock_ie_event_sink_actions.h b/chrome_frame/test/mock_ie_event_sink_actions.h
index 9e9dc3b..a3dc60c 100644
--- a/chrome_frame/test/mock_ie_event_sink_actions.h
+++ b/chrome_frame/test/mock_ie_event_sink_actions.h
@@ -9,7 +9,7 @@
#include <string>
#include "base/basictypes.h"
-#include "base/platform_thread.h"
+#include "base/threading/platform_thread.h"
#include "base/time.h"
#include "chrome/common/chrome_switches.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
@@ -341,7 +341,7 @@ ACTION_P(VerifySelectedText, expected_text) {
ACTION_P3(CloseWhenFileSaved, mock, file, timeout_ms) {
base::Time start = base::Time::Now();
while (!file_util::PathExists(file)) {
- PlatformThread::Sleep(200);
+ base::PlatformThread::Sleep(200);
if ((base::Time::Now() - start).InMilliseconds() > timeout_ms) {
ADD_FAILURE() << "File was not saved within timeout";
break;
@@ -353,7 +353,7 @@ ACTION_P3(CloseWhenFileSaved, mock, file, timeout_ms) {
ACTION_P2(WaitForFileSave, file, timeout_ms) {
base::Time start = base::Time::Now();
while (!file_util::PathExists(file)) {
- PlatformThread::Sleep(200);
+ base::PlatformThread::Sleep(200);
if ((base::Time::Now() - start).InMilliseconds() > timeout_ms) {
ADD_FAILURE() << "File was not saved within timeout";
break;
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc
index 67220aa..f589146 100644
--- a/chrome_frame/test/perf/chrome_frame_perftest.cc
+++ b/chrome_frame/test/perf/chrome_frame_perftest.cc
@@ -11,6 +11,7 @@
#include "chrome_tab.h" // Generated from chrome_tab.idl.
+#include "base/debug/trace_event_win.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
@@ -18,11 +19,11 @@
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
+#include "base/threading/platform_thread.h"
#include "base/time.h"
-#include "base/debug/trace_event_win.h"
#include "base/utf_string_conversions.h"
-#include "base/win/event_trace_controller.h"
#include "base/win/event_trace_consumer.h"
+#include "base/win/event_trace_controller.h"
#include "base/win/registry.h"
#include "base/win/scoped_bstr.h"
#include "base/win/scoped_comptr.h"
@@ -32,7 +33,6 @@
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/test/chrome_process_util.h"
#include "chrome/test/ui/ui_perf_test.h"
-
#include "chrome_frame/test_utils.h"
#include "chrome_frame/utils.h"
@@ -343,7 +343,7 @@ class ChromeFrameStartupTest : public ChromeFramePerfTestBase {
// TODO(beng): Can't shut down so quickly. Figure out why, and fix. If we
// do, we crash.
- PlatformThread::Sleep(50);
+ base::PlatformThread::Sleep(50);
}
std::string times;
@@ -810,7 +810,7 @@ class ChromeFrameActiveXMemoryTest : public MemoryTestBase {
PrintResults(test_name_.c_str());
CoFreeUnusedLibraries();
- PlatformThread::Sleep(100);
+ base::PlatformThread::Sleep(100);
}
void NavigateImpl(const std::string& url) {
diff --git a/chrome_frame/test/run_all_unittests.cc b/chrome_frame/test/run_all_unittests.cc
index 92edb2f..694c6c0 100644
--- a/chrome_frame/test/run_all_unittests.cc
+++ b/chrome_frame/test/run_all_unittests.cc
@@ -4,9 +4,10 @@
#include <atlbase.h>
+#include "base/command_line.h"
#include "base/process_util.h"
#include "base/test/test_suite.h"
-#include "base/command_line.h"
+#include "base/threading/platform_thread.h"
#include "chrome/common/chrome_paths.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/chrome_frame_ui_test_utils.h"
@@ -32,7 +33,7 @@ void PureCall() {
int main(int argc, char **argv) {
base::EnableTerminationOnHeapCorruption();
- PlatformThread::SetName("ChromeFrame tests");
+ base::PlatformThread::SetName("ChromeFrame tests");
_set_purecall_handler(PureCall);
diff --git a/chrome_frame/urlmon_bind_status_callback.cc b/chrome_frame/urlmon_bind_status_callback.cc
index 474f8f3..34520ef 100644
--- a/chrome_frame/urlmon_bind_status_callback.cc
+++ b/chrome_frame/urlmon_bind_status_callback.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
+#include "base/threading/platform_thread.h"
#include "base/utf_string_conversions.h"
#include "chrome_frame/bind_context_info.h"
#include "chrome_frame/exception_barrier.h"
@@ -213,7 +214,7 @@ BSCBStorageBind::~BSCBStorageBind() {
HRESULT BSCBStorageBind::Initialize(IMoniker* moniker, IBindCtx* bind_ctx) {
DVLOG(1) << __FUNCTION__ << me()
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId());
std::wstring url = GetActualUrlFromMoniker(moniker, bind_ctx,
std::wstring());
@@ -239,7 +240,8 @@ STDMETHODIMP BSCBStorageBind::OnProgress(ULONG progress, ULONG progress_max,
ULONG status_code, LPCWSTR status_text) {
DVLOG(1) << __FUNCTION__ << me()
<< base::StringPrintf(" status=%i tid=%i %ls", status_code,
- PlatformThread::CurrentId(), status_text);
+ base::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.
@@ -273,7 +275,7 @@ STDMETHODIMP BSCBStorageBind::OnDataAvailable(DWORD flags, DWORD size,
FORMATETC* format_etc,
STGMEDIUM* stgmed) {
DVLOG(1) << __FUNCTION__
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::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
// the chain handles the exception.
@@ -316,7 +318,7 @@ STDMETHODIMP BSCBStorageBind::OnDataAvailable(DWORD flags, DWORD size,
STDMETHODIMP BSCBStorageBind::OnStopBinding(HRESULT hresult, LPCWSTR error) {
DVLOG(1) << __FUNCTION__
- << base::StringPrintf(" tid=%i", PlatformThread::CurrentId());
+ << base::StringPrintf(" tid=%i", base::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
// the chain handles the exception.
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index d191515..7f3c8e9 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -12,6 +12,7 @@
#include "base/scoped_ptr.h"
#include "base/string_number_conversions.h"
#include "base/stringprintf.h"
+#include "base/threading/platform_thread.h"
#include "base/utf_string_conversions.h"
#include "chrome_frame/bind_context_info.h"
#include "chrome_frame/chrome_frame_activex_base.h"
@@ -47,8 +48,8 @@ std::string UrlmonUrlRequest::me() const {
bool UrlmonUrlRequest::Start() {
DVLOG(1) << __FUNCTION__ << me() << url();
- DCHECK(thread_ == 0 || thread_ == PlatformThread::CurrentId());
- thread_ = PlatformThread::CurrentId();
+ DCHECK(thread_ == 0 || thread_ == base::PlatformThread::CurrentId());
+ thread_ = base::PlatformThread::CurrentId();
status_.Start();
// The UrlmonUrlRequest instance can get destroyed in the context of
// StartAsyncDownload if BindToStorage finishes synchronously with an error.
@@ -64,7 +65,7 @@ bool UrlmonUrlRequest::Start() {
}
void UrlmonUrlRequest::Stop() {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
DCHECK((status_.get_state() != Status::DONE) == (binding_ != NULL));
Status::State state = status_.get_state();
delegate_ = NULL;
@@ -92,7 +93,7 @@ void UrlmonUrlRequest::Stop() {
}
bool UrlmonUrlRequest::Read(int bytes_to_read) {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
DCHECK_GE(bytes_to_read, 0);
DCHECK_EQ(0, calling_delegate_);
DVLOG(1) << __FUNCTION__ << me();
@@ -136,8 +137,8 @@ HRESULT UrlmonUrlRequest::InitPending(const GURL& url, IMoniker* moniker,
DCHECK(bind_context_ == NULL);
DCHECK(moniker_ == NULL);
DCHECK(cache_ == NULL);
- DCHECK(thread_ == 0 || thread_ == PlatformThread::CurrentId());
- thread_ = PlatformThread::CurrentId();
+ DCHECK(thread_ == 0 || thread_ == base::PlatformThread::CurrentId());
+ thread_ = base::PlatformThread::CurrentId();
bind_context_ = bind_context;
moniker_ = moniker;
enable_frame_busting_ = enable_frame_busting;
@@ -156,7 +157,7 @@ HRESULT UrlmonUrlRequest::InitPending(const GURL& url, IMoniker* moniker,
}
void UrlmonUrlRequest::TerminateBind(TerminateBindCallback* callback) {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
DVLOG(1) << __FUNCTION__ << me();
cleanup_transaction_ = false;
if (status_.get_state() == Status::DONE) {
@@ -190,7 +191,7 @@ void UrlmonUrlRequest::TerminateBind(TerminateBindCallback* callback) {
}
size_t UrlmonUrlRequest::SendDataToDelegate(size_t bytes_to_read) {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
DCHECK_NE(id(), -1);
DCHECK_GT(bytes_to_read, 0U);
size_t bytes_copied = 0;
@@ -242,7 +243,7 @@ size_t UrlmonUrlRequest::SendDataToDelegate(size_t bytes_to_read) {
STDMETHODIMP UrlmonUrlRequest::OnStartBinding(DWORD reserved,
IBinding* binding) {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
binding_ = binding;
if (pending_) {
response_headers_ = GetHttpHeadersFromBinding(binding_);
@@ -264,7 +265,7 @@ STDMETHODIMP UrlmonUrlRequest::OnLowResource(DWORD reserved) {
STDMETHODIMP UrlmonUrlRequest::OnProgress(ULONG progress, ULONG max_progress,
ULONG status_code, LPCWSTR status_text) {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
if (status_.get_state() != Status::WORKING)
return S_OK;
@@ -341,7 +342,7 @@ STDMETHODIMP UrlmonUrlRequest::OnProgress(ULONG progress, ULONG max_progress,
}
STDMETHODIMP UrlmonUrlRequest::OnStopBinding(HRESULT result, LPCWSTR error) {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
DVLOG(1) << __FUNCTION__ << me()
<< "- Request stopped, Result: " << std::hex << result;
DCHECK(status_.get_state() == Status::WORKING ||
@@ -485,7 +486,7 @@ STDMETHODIMP UrlmonUrlRequest::GetBindInfo(DWORD* bind_flags,
STDMETHODIMP UrlmonUrlRequest::OnDataAvailable(DWORD flags, DWORD size,
FORMATETC* formatetc,
STGMEDIUM* storage) {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
DVLOG(1) << __FUNCTION__ << me() << "bytes available: " << size;
if (terminate_requested()) {
@@ -538,7 +539,7 @@ STDMETHODIMP UrlmonUrlRequest::OnObjectAvailable(REFIID iid, IUnknown* object) {
STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url,
const wchar_t* current_headers, DWORD reserved,
wchar_t** additional_headers) {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
if (!additional_headers) {
NOTREACHED();
return E_POINTER;
@@ -614,7 +615,7 @@ STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url,
STDMETHODIMP UrlmonUrlRequest::OnResponse(DWORD dwResponseCode,
const wchar_t* response_headers, const wchar_t* request_headers,
wchar_t** additional_headers) {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
DVLOG(1) << __FUNCTION__ << me() << "headers: \n" << response_headers;
if (!delegate_) {
@@ -829,7 +830,7 @@ HRESULT UrlmonUrlRequest::StartAsyncDownload() {
}
void UrlmonUrlRequest::NotifyDelegateAndDie() {
- DCHECK_EQ(thread_, PlatformThread::CurrentId());
+ DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
DVLOG(1) << __FUNCTION__ << me();
PluginUrlRequestDelegate* delegate = delegate_;
diff --git a/chrome_frame/urlmon_url_request_private.h b/chrome_frame/urlmon_url_request_private.h
index cdd5419..ebe027c 100644
--- a/chrome_frame/urlmon_url_request_private.h
+++ b/chrome_frame/urlmon_url_request_private.h
@@ -10,6 +10,7 @@
#include <string>
#include "base/callback.h"
+#include "base/threading/platform_thread.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_status.h"
@@ -233,7 +234,7 @@ class UrlmonUrlRequest
ScopedComPtr<IStream> pending_data_;
size_t pending_read_size_;
- PlatformThreadId thread_;
+ base::PlatformThreadId thread_;
HWND parent_window_;
bool headers_received_;
int calling_delegate_; // re-entrancy protection.