| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 #include "third_party/WebKit/public/web/WebView.h" | 108 #include "third_party/WebKit/public/web/WebView.h" |
| 109 #include "ui/base/layout.h" | 109 #include "ui/base/layout.h" |
| 110 #include "ui/base/ui_base_switches.h" | 110 #include "ui/base/ui_base_switches.h" |
| 111 #include "v8/include/v8.h" | 111 #include "v8/include/v8.h" |
| 112 #include "webkit/child/worker_task_runner.h" | 112 #include "webkit/child/worker_task_runner.h" |
| 113 #include "webkit/renderer/compositor_bindings/web_external_bitmap_impl.h" | 113 #include "webkit/renderer/compositor_bindings/web_external_bitmap_impl.h" |
| 114 | 114 |
| 115 #if defined(OS_WIN) | 115 #if defined(OS_WIN) |
| 116 #include <windows.h> | 116 #include <windows.h> |
| 117 #include <objbase.h> | 117 #include <objbase.h> |
| 118 #include "base/win/scoped_com_initializer.h" | |
| 119 #else | 118 #else |
| 120 // TODO(port) | 119 // TODO(port) |
| 121 #include "base/memory/scoped_handle.h" | 120 #include "base/memory/scoped_handle.h" |
| 122 #include "content/child/npapi/np_channel_base.h" | 121 #include "content/child/npapi/np_channel_base.h" |
| 123 #endif | 122 #endif |
| 124 | 123 |
| 125 #if defined(OS_MACOSX) | 124 #if defined(OS_MACOSX) |
| 126 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" | 125 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" |
| 127 #endif | 126 #endif |
| 128 | 127 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 v8::V8::SetCreateHistogramFunction(CreateHistogram); | 313 v8::V8::SetCreateHistogramFunction(CreateHistogram); |
| 315 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); | 314 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); |
| 316 | 315 |
| 317 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 316 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 318 // On Mac and Android, the select popups are rendered by the browser. | 317 // On Mac and Android, the select popups are rendered by the browser. |
| 319 blink::WebView::setUseExternalPopupMenus(true); | 318 blink::WebView::setUseExternalPopupMenus(true); |
| 320 #endif | 319 #endif |
| 321 | 320 |
| 322 lazy_tls.Pointer()->Set(this); | 321 lazy_tls.Pointer()->Set(this); |
| 323 | 322 |
| 324 #if defined(OS_WIN) | |
| 325 // If you are running plugins in this thread you need COM active but in | |
| 326 // the normal case you don't. | |
| 327 if (RenderProcessImpl::InProcessPlugins()) | |
| 328 initialize_com_.reset(new base::win::ScopedCOMInitializer()); | |
| 329 #endif | |
| 330 | |
| 331 // Register this object as the main thread. | 323 // Register this object as the main thread. |
| 332 ChildProcess::current()->set_main_thread(this); | 324 ChildProcess::current()->set_main_thread(this); |
| 333 | 325 |
| 334 // In single process the single process is all there is. | 326 // In single process the single process is all there is. |
| 335 suspend_webkit_shared_timer_ = true; | 327 suspend_webkit_shared_timer_ = true; |
| 336 notify_webkit_of_modal_loop_ = true; | 328 notify_webkit_of_modal_loop_ = true; |
| 337 widget_count_ = 0; | 329 widget_count_ = 0; |
| 338 hidden_widget_count_ = 0; | 330 hidden_widget_count_ = 0; |
| 339 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; | 331 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; |
| 340 idle_notifications_to_skip_ = 0; | 332 idle_notifications_to_skip_ = 0; |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 if (!gamepad_shared_memory_reader_) | 1351 if (!gamepad_shared_memory_reader_) |
| 1360 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); | 1352 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); |
| 1361 gamepad_shared_memory_reader_->SampleGamepads(*data); | 1353 gamepad_shared_memory_reader_->SampleGamepads(*data); |
| 1362 } | 1354 } |
| 1363 | 1355 |
| 1364 base::ProcessId RenderThreadImpl::renderer_process_id() const { | 1356 base::ProcessId RenderThreadImpl::renderer_process_id() const { |
| 1365 return renderer_process_id_; | 1357 return renderer_process_id_; |
| 1366 } | 1358 } |
| 1367 | 1359 |
| 1368 } // namespace content | 1360 } // namespace content |
| OLD | NEW |