summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 22:11:47 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 22:11:47 +0000
commitfa87a2527ca8c0bcef92d8e44791332782936911 (patch)
tree04dc5d1e6881f8356f91203a386648057b20d924 /chrome/renderer
parent4f64d0af5908e36d356c834005d08cca98d579fe (diff)
downloadchromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.zip
chromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.tar.gz
chromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.tar.bz2
Revert. Failing unit tests.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_thread.cc8
-rw-r--r--chrome/renderer/render_thread.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 14f9313..b37cf454 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -47,9 +47,8 @@ static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */;
// V8 needs a 1MB stack size.
static const size_t kStackSize = 1024 * 1024;
-// TODO(evanm): don't rely on static initialization.
-// static
-TLSSlot RenderThread::tls_index_;
+/*static*/
+DWORD RenderThread::tls_index_ = ThreadLocalStorage::Alloc();
//-----------------------------------------------------------------------------
// Methods below are only called on the owner's thread:
@@ -107,6 +106,7 @@ void RenderThread::RemoveRoute(int32 routing_id) {
}
void RenderThread::Init() {
+ DCHECK(tls_index_) << "static initializer failed";
DCHECK(!current()) << "should only have one RenderThread per thread";
notification_service_.reset(new NotificationService);
@@ -118,7 +118,7 @@ void RenderThread::Init() {
IPC::Channel::MODE_CLIENT, this, NULL, owner_loop_, true,
RenderProcess::GetShutDownEvent()));
- tls_index_.Set(this);
+ ThreadLocalStorage::Set(tls_index_, this);
// The renderer thread should wind-up COM.
CoInitialize(0);
diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h
index 5e4f336..9463a20 100644
--- a/chrome/renderer/render_thread.h
+++ b/chrome/renderer/render_thread.h
@@ -74,7 +74,7 @@ class RenderThread : public IPC::Channel::Listener,
// The RenderThread instance for the current thread.
static RenderThread* current() {
- return static_cast<RenderThread*>(tls_index_.Get());
+ return static_cast<RenderThread*>(ThreadLocalStorage::Get(tls_index_));
}
VisitedLinkSlave* visited_link_slave() const { return visited_link_slave_; }
@@ -119,7 +119,7 @@ class RenderThread : public IPC::Channel::Listener,
// decisions about how to allocation resources using current information.
void InformHostOfCacheStats();
- static TLSSlot tls_index_;
+ static DWORD tls_index_;
// The message loop used to run tasks on the thread that started this thread.
MessageLoop* owner_loop_;