| OLD | NEW |
| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 notify_webkit_of_modal_loop_ = true; | 190 notify_webkit_of_modal_loop_ = true; |
| 191 plugin_refresh_allowed_ = true; | 191 plugin_refresh_allowed_ = true; |
| 192 widget_count_ = 0; | 192 widget_count_ = 0; |
| 193 hidden_widget_count_ = 0; | 193 hidden_widget_count_ = 0; |
| 194 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; | 194 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; |
| 195 idle_notifications_to_skip_ = 0; | 195 idle_notifications_to_skip_ = 0; |
| 196 compositor_initialized_ = false; | 196 compositor_initialized_ = false; |
| 197 task_factory_.reset(new ScopedRunnableMethodFactory<RenderThreadImpl>(this)); | 197 task_factory_.reset(new ScopedRunnableMethodFactory<RenderThreadImpl>(this)); |
| 198 | 198 |
| 199 appcache_dispatcher_.reset(new AppCacheDispatcher(Get())); | 199 appcache_dispatcher_.reset(new AppCacheDispatcher(Get())); |
| 200 indexed_db_dispatcher_.reset(new IndexedDBDispatcher()); | |
| 201 | 200 |
| 202 db_message_filter_ = new DBMessageFilter(); | 201 db_message_filter_ = new DBMessageFilter(); |
| 203 AddFilter(db_message_filter_.get()); | 202 AddFilter(db_message_filter_.get()); |
| 204 | 203 |
| 205 vc_manager_ = new VideoCaptureImplManager(); | 204 vc_manager_ = new VideoCaptureImplManager(); |
| 206 AddFilter(vc_manager_->video_capture_message_filter()); | 205 AddFilter(vc_manager_->video_capture_message_filter()); |
| 207 | 206 |
| 208 audio_input_message_filter_ = new AudioInputMessageFilter(); | 207 audio_input_message_filter_ = new AudioInputMessageFilter(); |
| 209 AddFilter(audio_input_message_filter_.get()); | 208 AddFilter(audio_input_message_filter_.get()); |
| 210 | 209 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 | 481 |
| 483 WebRuntimeFeatures::enableNotifications( | 482 WebRuntimeFeatures::enableNotifications( |
| 484 !command_line.HasSwitch(switches::kDisableDesktopNotifications)); | 483 !command_line.HasSwitch(switches::kDisableDesktopNotifications)); |
| 485 | 484 |
| 486 WebRuntimeFeatures::enableLocalStorage( | 485 WebRuntimeFeatures::enableLocalStorage( |
| 487 !command_line.HasSwitch(switches::kDisableLocalStorage)); | 486 !command_line.HasSwitch(switches::kDisableLocalStorage)); |
| 488 WebRuntimeFeatures::enableSessionStorage( | 487 WebRuntimeFeatures::enableSessionStorage( |
| 489 !command_line.HasSwitch(switches::kDisableSessionStorage)); | 488 !command_line.HasSwitch(switches::kDisableSessionStorage)); |
| 490 | 489 |
| 491 WebRuntimeFeatures::enableIndexedDatabase( | 490 WebRuntimeFeatures::enableIndexedDatabase( |
| 492 !command_line.HasSwitch(switches::kDisableIndexedDatabase)); | 491 command_line.HasSwitch(switches::kEnableIndexedDatabaseOnWorkers)); |
| 493 | 492 |
| 494 WebRuntimeFeatures::enableGeolocation( | 493 WebRuntimeFeatures::enableGeolocation( |
| 495 !command_line.HasSwitch(switches::kDisableGeolocation)); | 494 !command_line.HasSwitch(switches::kDisableGeolocation)); |
| 496 | 495 |
| 497 WebKit::WebRuntimeFeatures::enableMediaSource( | 496 WebKit::WebRuntimeFeatures::enableMediaSource( |
| 498 command_line.HasSwitch(switches::kEnableMediaSource)); | 497 command_line.HasSwitch(switches::kEnableMediaSource)); |
| 499 | 498 |
| 500 WebKit::WebRuntimeFeatures::enableMediaStream( | 499 WebKit::WebRuntimeFeatures::enableMediaStream( |
| 501 command_line.HasSwitch(switches::kEnableMediaStream)); | 500 command_line.HasSwitch(switches::kEnableMediaStream)); |
| 502 | 501 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 ObserverListBase<RenderProcessObserver>::Iterator it(observers_); | 699 ObserverListBase<RenderProcessObserver>::Iterator it(observers_); |
| 701 RenderProcessObserver* observer; | 700 RenderProcessObserver* observer; |
| 702 while ((observer = it.GetNext()) != NULL) { | 701 while ((observer = it.GetNext()) != NULL) { |
| 703 if (observer->OnControlMessageReceived(msg)) | 702 if (observer->OnControlMessageReceived(msg)) |
| 704 return true; | 703 return true; |
| 705 } | 704 } |
| 706 | 705 |
| 707 // Some messages are handled by delegates. | 706 // Some messages are handled by delegates. |
| 708 if (appcache_dispatcher_->OnMessageReceived(msg)) | 707 if (appcache_dispatcher_->OnMessageReceived(msg)) |
| 709 return true; | 708 return true; |
| 710 if (indexed_db_dispatcher_->OnMessageReceived(msg)) | |
| 711 return true; | |
| 712 | 709 |
| 713 bool handled = true; | 710 bool handled = true; |
| 714 IPC_BEGIN_MESSAGE_MAP(RenderThreadImpl, msg) | 711 IPC_BEGIN_MESSAGE_MAP(RenderThreadImpl, msg) |
| 715 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForCurrentURL, | 712 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForCurrentURL, |
| 716 OnSetZoomLevelForCurrentURL) | 713 OnSetZoomLevelForCurrentURL) |
| 717 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) | 714 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) |
| 718 IPC_MESSAGE_HANDLER(ViewMsg_SetCSSColors, OnSetCSSColors) | 715 IPC_MESSAGE_HANDLER(ViewMsg_SetCSSColors, OnSetCSSColors) |
| 719 // TODO(port): removed from render_messages_internal.h; | 716 // TODO(port): removed from render_messages_internal.h; |
| 720 // is there a new non-windows message I should add here? | 717 // is there a new non-windows message I should add here? |
| 721 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) | 718 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 | 842 |
| 846 scoped_refptr<base::MessageLoopProxy> | 843 scoped_refptr<base::MessageLoopProxy> |
| 847 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 844 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 848 DCHECK(message_loop() == MessageLoop::current()); | 845 DCHECK(message_loop() == MessageLoop::current()); |
| 849 if (!file_thread_.get()) { | 846 if (!file_thread_.get()) { |
| 850 file_thread_.reset(new base::Thread("Renderer::FILE")); | 847 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 851 file_thread_->Start(); | 848 file_thread_->Start(); |
| 852 } | 849 } |
| 853 return file_thread_->message_loop_proxy(); | 850 return file_thread_->message_loop_proxy(); |
| 854 } | 851 } |
| OLD | NEW |