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/child/child_thread.h" | 5 #include "content/child/child_thread.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "content/child/child_discardable_shared_memory_manager.h" | 30 #include "content/child/child_discardable_shared_memory_manager.h" |
31 #include "content/child/child_gpu_memory_buffer_manager.h" | 31 #include "content/child/child_gpu_memory_buffer_manager.h" |
32 #include "content/child/child_histogram_message_filter.h" | 32 #include "content/child/child_histogram_message_filter.h" |
33 #include "content/child/child_process.h" | 33 #include "content/child/child_process.h" |
34 #include "content/child/child_resource_message_filter.h" | 34 #include "content/child/child_resource_message_filter.h" |
35 #include "content/child/child_shared_bitmap_manager.h" | 35 #include "content/child/child_shared_bitmap_manager.h" |
36 #include "content/child/fileapi/file_system_dispatcher.h" | 36 #include "content/child/fileapi/file_system_dispatcher.h" |
37 #include "content/child/fileapi/webfilesystem_impl.h" | 37 #include "content/child/fileapi/webfilesystem_impl.h" |
38 #include "content/child/geofencing/geofencing_message_filter.h" | 38 #include "content/child/geofencing/geofencing_message_filter.h" |
39 #include "content/child/mojo/mojo_application.h" | 39 #include "content/child/mojo/mojo_application.h" |
| 40 #include "content/child/navigator_connect/navigator_connect_dispatcher.h" |
40 #include "content/child/notifications/notification_dispatcher.h" | 41 #include "content/child/notifications/notification_dispatcher.h" |
41 #include "content/child/power_monitor_broadcast_source.h" | 42 #include "content/child/power_monitor_broadcast_source.h" |
42 #include "content/child/push_messaging/push_dispatcher.h" | 43 #include "content/child/push_messaging/push_dispatcher.h" |
43 #include "content/child/quota_dispatcher.h" | 44 #include "content/child/quota_dispatcher.h" |
44 #include "content/child/quota_message_filter.h" | 45 #include "content/child/quota_message_filter.h" |
45 #include "content/child/resource_dispatcher.h" | 46 #include "content/child/resource_dispatcher.h" |
46 #include "content/child/service_worker/service_worker_message_filter.h" | 47 #include "content/child/service_worker/service_worker_message_filter.h" |
47 #include "content/child/thread_safe_sender.h" | 48 #include "content/child/thread_safe_sender.h" |
48 #include "content/child/websocket_dispatcher.h" | 49 #include "content/child/websocket_dispatcher.h" |
49 #include "content/common/child_process_messages.h" | 50 #include "content/common/child_process_messages.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 new QuotaMessageFilter(thread_safe_sender_.get()); | 292 new QuotaMessageFilter(thread_safe_sender_.get()); |
292 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), | 293 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), |
293 quota_message_filter_.get())); | 294 quota_message_filter_.get())); |
294 geofencing_message_filter_ = | 295 geofencing_message_filter_ = |
295 new GeofencingMessageFilter(thread_safe_sender_.get()); | 296 new GeofencingMessageFilter(thread_safe_sender_.get()); |
296 bluetooth_message_filter_ = | 297 bluetooth_message_filter_ = |
297 new BluetoothMessageFilter(thread_safe_sender_.get()); | 298 new BluetoothMessageFilter(thread_safe_sender_.get()); |
298 notification_dispatcher_ = | 299 notification_dispatcher_ = |
299 new NotificationDispatcher(thread_safe_sender_.get()); | 300 new NotificationDispatcher(thread_safe_sender_.get()); |
300 push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); | 301 push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); |
| 302 navigator_connect_dispatcher_ = |
| 303 new NavigatorConnectDispatcher(thread_safe_sender_.get()); |
301 | 304 |
302 channel_->AddFilter(histogram_message_filter_.get()); | 305 channel_->AddFilter(histogram_message_filter_.get()); |
303 channel_->AddFilter(sync_message_filter_.get()); | 306 channel_->AddFilter(sync_message_filter_.get()); |
304 channel_->AddFilter(resource_message_filter_.get()); | 307 channel_->AddFilter(resource_message_filter_.get()); |
305 channel_->AddFilter(quota_message_filter_->GetFilter()); | 308 channel_->AddFilter(quota_message_filter_->GetFilter()); |
306 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 309 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
307 channel_->AddFilter(push_dispatcher_->GetFilter()); | 310 channel_->AddFilter(push_dispatcher_->GetFilter()); |
308 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 311 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
309 channel_->AddFilter(geofencing_message_filter_->GetFilter()); | 312 channel_->AddFilter(geofencing_message_filter_->GetFilter()); |
310 channel_->AddFilter(bluetooth_message_filter_->GetFilter()); | 313 channel_->AddFilter(bluetooth_message_filter_->GetFilter()); |
| 314 channel_->AddFilter(navigator_connect_dispatcher_->GetFilter()); |
311 | 315 |
312 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 316 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
313 switches::kSingleProcess)) { | 317 switches::kSingleProcess)) { |
314 // In single process mode, browser-side tracing will cover the whole | 318 // In single process mode, browser-side tracing will cover the whole |
315 // process including renderers. | 319 // process including renderers. |
316 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 320 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
317 ChildProcess::current()->io_message_loop_proxy())); | 321 ChildProcess::current()->io_message_loop_proxy())); |
318 } | 322 } |
319 | 323 |
320 // In single process mode we may already have a power monitor | 324 // In single process mode we may already have a power monitor |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 | 607 |
604 void ChildThread::OnProcessBackgrounded(bool background) { | 608 void ChildThread::OnProcessBackgrounded(bool background) { |
605 // Set timer slack to maximum on main thread when in background. | 609 // Set timer slack to maximum on main thread when in background. |
606 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 610 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
607 if (background) | 611 if (background) |
608 timer_slack = base::TIMER_SLACK_MAXIMUM; | 612 timer_slack = base::TIMER_SLACK_MAXIMUM; |
609 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 613 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
610 } | 614 } |
611 | 615 |
612 } // namespace content | 616 } // namespace content |
OLD | NEW |