Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 namespace { 102 namespace {
103 static const double kInitialIdleHandlerDelayS = 1.0 /* seconds */; 103 static const double kInitialIdleHandlerDelayS = 1.0 /* seconds */;
104 104
105 #if defined(TOUCH_UI) 105 #if defined(TOUCH_UI)
106 static const int kPopupListBoxMinimumRowHeight = 60; 106 static const int kPopupListBoxMinimumRowHeight = 60;
107 #endif 107 #endif
108 108
109 // Keep the global RenderThreadImpl in a TLS slot so it is impossible to access 109 // Keep the global RenderThreadImpl in a TLS slot so it is impossible to access
110 // incorrectly from the wrong thread. 110 // incorrectly from the wrong thread.
111 static base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > lazy_tls( 111 static base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> >
112 base::LINKER_INITIALIZED); 112 lazy_tls = LAZY_INSTANCE_INITIALIZER;
113 113
114 class RenderViewZoomer : public content::RenderViewVisitor { 114 class RenderViewZoomer : public content::RenderViewVisitor {
115 public: 115 public:
116 RenderViewZoomer(const GURL& url, double zoom_level) 116 RenderViewZoomer(const GURL& url, double zoom_level)
117 : zoom_level_(zoom_level) { 117 : zoom_level_(zoom_level) {
118 host_ = net::GetHostOrSpecFromURL(url); 118 host_ = net::GetHostOrSpecFromURL(url);
119 } 119 }
120 120
121 virtual bool Visit(content::RenderView* render_view) { 121 virtual bool Visit(content::RenderView* render_view) {
122 WebView* webview = render_view->GetWebView(); 122 WebView* webview = render_view->GetWebView();
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 782
783 scoped_refptr<base::MessageLoopProxy> 783 scoped_refptr<base::MessageLoopProxy>
784 RenderThreadImpl::GetFileThreadMessageLoopProxy() { 784 RenderThreadImpl::GetFileThreadMessageLoopProxy() {
785 DCHECK(message_loop() == MessageLoop::current()); 785 DCHECK(message_loop() == MessageLoop::current());
786 if (!file_thread_.get()) { 786 if (!file_thread_.get()) {
787 file_thread_.reset(new base::Thread("Renderer::FILE")); 787 file_thread_.reset(new base::Thread("Renderer::FILE"));
788 file_thread_->Start(); 788 file_thread_->Start();
789 } 789 }
790 return file_thread_->message_loop_proxy(); 790 return file_thread_->message_loop_proxy();
791 } 791 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698