OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 #endif | 179 #endif |
180 | 180 |
181 lazy_tls.Pointer()->Set(this); | 181 lazy_tls.Pointer()->Set(this); |
182 #if defined(OS_WIN) | 182 #if defined(OS_WIN) |
183 // If you are running plugins in this thread you need COM active but in | 183 // If you are running plugins in this thread you need COM active but in |
184 // the normal case you don't. | 184 // the normal case you don't. |
185 if (RenderProcessImpl::InProcessPlugins()) | 185 if (RenderProcessImpl::InProcessPlugins()) |
186 initialize_com_.reset(new base::win::ScopedCOMInitializer()); | 186 initialize_com_.reset(new base::win::ScopedCOMInitializer()); |
187 #endif | 187 #endif |
188 | 188 |
189 // Register this object as the main thread. | |
190 ChildProcess::current()->set_main_thread(this); | |
jam
2012/01/30 19:46:12
nit: can we do this in ChildThread's constructor?
| |
191 | |
189 // In single process the single process is all there is. | 192 // In single process the single process is all there is. |
190 suspend_webkit_shared_timer_ = true; | 193 suspend_webkit_shared_timer_ = true; |
191 notify_webkit_of_modal_loop_ = true; | 194 notify_webkit_of_modal_loop_ = true; |
192 plugin_refresh_allowed_ = true; | 195 plugin_refresh_allowed_ = true; |
193 widget_count_ = 0; | 196 widget_count_ = 0; |
194 hidden_widget_count_ = 0; | 197 hidden_widget_count_ = 0; |
195 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; | 198 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; |
196 idle_notifications_to_skip_ = 0; | 199 idle_notifications_to_skip_ = 0; |
197 compositor_initialized_ = false; | 200 compositor_initialized_ = false; |
198 | 201 |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
850 | 853 |
851 scoped_refptr<base::MessageLoopProxy> | 854 scoped_refptr<base::MessageLoopProxy> |
852 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 855 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
853 DCHECK(message_loop() == MessageLoop::current()); | 856 DCHECK(message_loop() == MessageLoop::current()); |
854 if (!file_thread_.get()) { | 857 if (!file_thread_.get()) { |
855 file_thread_.reset(new base::Thread("Renderer::FILE")); | 858 file_thread_.reset(new base::Thread("Renderer::FILE")); |
856 file_thread_->Start(); | 859 file_thread_->Start(); |
857 } | 860 } |
858 return file_thread_->message_loop_proxy(); | 861 return file_thread_->message_loop_proxy(); |
859 } | 862 } |
OLD | NEW |