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> |
11 | 11 |
12 #include "base/allocator/allocator_extension.h" | 12 #include "base/allocator/allocator_extension.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/memory/discardable_memory.h" | 17 #include "base/memory/discardable_memory.h" |
18 #include "base/memory/shared_memory.h" | 18 #include "base/memory/shared_memory.h" |
19 #include "base/metrics/field_trial.h" | 19 #include "base/metrics/field_trial.h" |
20 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
21 #include "base/metrics/stats_table.h" | 21 #include "base/metrics/stats_table.h" |
22 #include "base/path_service.h" | 22 #include "base/path_service.h" |
23 #include "base/strings/string16.h" | 23 #include "base/strings/string16.h" |
24 #include "base/strings/string_tokenizer.h" | 24 #include "base/strings/string_tokenizer.h" |
25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
26 #include "base/threading/thread_local.h" | 26 #include "base/threading/thread_local.h" |
27 #include "base/threading/thread_restrictions.h" | 27 #include "base/threading/thread_restrictions.h" |
28 #include "base/values.h" | 28 #include "base/values.h" |
29 #include "content/child/appcache_dispatcher.h" | 29 #include "content/child/appcache_dispatcher.h" |
| 30 #include "content/child/appcache_frontend_impl.h" |
30 #include "content/child/child_histogram_message_filter.h" | 31 #include "content/child/child_histogram_message_filter.h" |
31 #include "content/child/db_message_filter.h" | 32 #include "content/child/db_message_filter.h" |
32 #include "content/child/indexed_db/indexed_db_dispatcher.h" | 33 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
33 #include "content/child/indexed_db/indexed_db_message_filter.h" | 34 #include "content/child/indexed_db/indexed_db_message_filter.h" |
34 #include "content/child/npapi/npobject_util.h" | 35 #include "content/child/npapi/npobject_util.h" |
35 #include "content/child/plugin_messages.h" | 36 #include "content/child/plugin_messages.h" |
36 #include "content/child/resource_dispatcher.h" | 37 #include "content/child/resource_dispatcher.h" |
37 #include "content/child/runtime_features.h" | 38 #include "content/child/runtime_features.h" |
38 #include "content/child/thread_safe_sender.h" | 39 #include "content/child/thread_safe_sender.h" |
39 #include "content/child/web_database_observer_impl.h" | 40 #include "content/child/web_database_observer_impl.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 103 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
103 #include "third_party/WebKit/public/web/WebScriptController.h" | 104 #include "third_party/WebKit/public/web/WebScriptController.h" |
104 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 105 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
105 #include "third_party/WebKit/public/web/WebSharedWorkerRepository.h" | 106 #include "third_party/WebKit/public/web/WebSharedWorkerRepository.h" |
106 #include "third_party/WebKit/public/web/WebView.h" | 107 #include "third_party/WebKit/public/web/WebView.h" |
107 #include "ui/base/layout.h" | 108 #include "ui/base/layout.h" |
108 #include "ui/base/ui_base_switches.h" | 109 #include "ui/base/ui_base_switches.h" |
109 #include "v8/include/v8.h" | 110 #include "v8/include/v8.h" |
110 #include "webkit/child/worker_task_runner.h" | 111 #include "webkit/child/worker_task_runner.h" |
111 #include "webkit/glue/webkit_glue.h" | 112 #include "webkit/glue/webkit_glue.h" |
112 #include "webkit/renderer/appcache/appcache_frontend_impl.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" | 118 #include "base/win/scoped_com_initializer.h" |
119 #else | 119 #else |
120 // TODO(port) | 120 // TODO(port) |
121 #include "base/memory/scoped_handle.h" | 121 #include "base/memory/scoped_handle.h" |
122 #include "content/child/npapi/np_channel_base.h" | 122 #include "content/child/npapi/np_channel_base.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 suspend_webkit_shared_timer_ = true; | 341 suspend_webkit_shared_timer_ = true; |
342 notify_webkit_of_modal_loop_ = true; | 342 notify_webkit_of_modal_loop_ = true; |
343 widget_count_ = 0; | 343 widget_count_ = 0; |
344 hidden_widget_count_ = 0; | 344 hidden_widget_count_ = 0; |
345 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; | 345 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; |
346 idle_notifications_to_skip_ = 0; | 346 idle_notifications_to_skip_ = 0; |
347 layout_test_mode_ = false; | 347 layout_test_mode_ = false; |
348 shutdown_event_ = NULL; | 348 shutdown_event_ = NULL; |
349 | 349 |
350 appcache_dispatcher_.reset( | 350 appcache_dispatcher_.reset( |
351 new AppCacheDispatcher(Get(), new appcache::AppCacheFrontendImpl())); | 351 new AppCacheDispatcher(Get(), new AppCacheFrontendImpl())); |
352 dom_storage_dispatcher_.reset(new DomStorageDispatcher()); | 352 dom_storage_dispatcher_.reset(new DomStorageDispatcher()); |
353 main_thread_indexed_db_dispatcher_.reset(new IndexedDBDispatcher( | 353 main_thread_indexed_db_dispatcher_.reset(new IndexedDBDispatcher( |
354 thread_safe_sender())); | 354 thread_safe_sender())); |
355 | 355 |
356 media_stream_center_ = NULL; | 356 media_stream_center_ = NULL; |
357 | 357 |
358 db_message_filter_ = new DBMessageFilter(); | 358 db_message_filter_ = new DBMessageFilter(); |
359 AddFilter(db_message_filter_.get()); | 359 AddFilter(db_message_filter_.get()); |
360 | 360 |
361 #if defined(ENABLE_WEBRTC) | 361 #if defined(ENABLE_WEBRTC) |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 | 1304 |
1305 } | 1305 } |
1306 | 1306 |
1307 void RenderThreadImpl::SampleGamepads(WebKit::WebGamepads* data) { | 1307 void RenderThreadImpl::SampleGamepads(WebKit::WebGamepads* data) { |
1308 if (!gamepad_shared_memory_reader_) | 1308 if (!gamepad_shared_memory_reader_) |
1309 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); | 1309 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); |
1310 gamepad_shared_memory_reader_->SampleGamepads(*data); | 1310 gamepad_shared_memory_reader_->SampleGamepads(*data); |
1311 } | 1311 } |
1312 | 1312 |
1313 } // namespace content | 1313 } // namespace content |
OLD | NEW |