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_impl.h" | 5 #include "content/child/child_thread_impl.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "content/child/child_discardable_shared_memory_manager.h" | 35 #include "content/child/child_discardable_shared_memory_manager.h" |
36 #include "content/child/child_gpu_memory_buffer_manager.h" | 36 #include "content/child/child_gpu_memory_buffer_manager.h" |
37 #include "content/child/child_histogram_message_filter.h" | 37 #include "content/child/child_histogram_message_filter.h" |
38 #include "content/child/child_process.h" | 38 #include "content/child/child_process.h" |
39 #include "content/child/child_resource_message_filter.h" | 39 #include "content/child/child_resource_message_filter.h" |
40 #include "content/child/child_shared_bitmap_manager.h" | 40 #include "content/child/child_shared_bitmap_manager.h" |
41 #include "content/child/fileapi/file_system_dispatcher.h" | 41 #include "content/child/fileapi/file_system_dispatcher.h" |
42 #include "content/child/fileapi/webfilesystem_impl.h" | 42 #include "content/child/fileapi/webfilesystem_impl.h" |
43 #include "content/child/geofencing/geofencing_message_filter.h" | 43 #include "content/child/geofencing/geofencing_message_filter.h" |
44 #include "content/child/mojo/mojo_application.h" | 44 #include "content/child/mojo/mojo_application.h" |
45 #include "content/child/navigator_connect/navigator_connect_dispatcher.h" | |
46 #include "content/child/notifications/notification_dispatcher.h" | 45 #include "content/child/notifications/notification_dispatcher.h" |
47 #include "content/child/power_monitor_broadcast_source.h" | 46 #include "content/child/power_monitor_broadcast_source.h" |
48 #include "content/child/push_messaging/push_dispatcher.h" | 47 #include "content/child/push_messaging/push_dispatcher.h" |
49 #include "content/child/quota_dispatcher.h" | 48 #include "content/child/quota_dispatcher.h" |
50 #include "content/child/quota_message_filter.h" | 49 #include "content/child/quota_message_filter.h" |
51 #include "content/child/resource_dispatcher.h" | 50 #include "content/child/resource_dispatcher.h" |
52 #include "content/child/service_worker/service_worker_message_filter.h" | 51 #include "content/child/service_worker/service_worker_message_filter.h" |
53 #include "content/child/thread_safe_sender.h" | 52 #include "content/child/thread_safe_sender.h" |
54 #include "content/child/websocket_dispatcher.h" | 53 #include "content/child/websocket_dispatcher.h" |
55 #include "content/common/child_process_messages.h" | 54 #include "content/common/child_process_messages.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 new QuotaMessageFilter(thread_safe_sender_.get()); | 392 new QuotaMessageFilter(thread_safe_sender_.get()); |
394 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), | 393 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), |
395 quota_message_filter_.get())); | 394 quota_message_filter_.get())); |
396 geofencing_message_filter_ = | 395 geofencing_message_filter_ = |
397 new GeofencingMessageFilter(thread_safe_sender_.get()); | 396 new GeofencingMessageFilter(thread_safe_sender_.get()); |
398 bluetooth_message_filter_ = | 397 bluetooth_message_filter_ = |
399 new BluetoothMessageFilter(thread_safe_sender_.get()); | 398 new BluetoothMessageFilter(thread_safe_sender_.get()); |
400 notification_dispatcher_ = | 399 notification_dispatcher_ = |
401 new NotificationDispatcher(thread_safe_sender_.get()); | 400 new NotificationDispatcher(thread_safe_sender_.get()); |
402 push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); | 401 push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); |
403 navigator_connect_dispatcher_ = | |
404 new NavigatorConnectDispatcher(thread_safe_sender_.get()); | |
405 | 402 |
406 channel_->AddFilter(histogram_message_filter_.get()); | 403 channel_->AddFilter(histogram_message_filter_.get()); |
407 channel_->AddFilter(sync_message_filter_.get()); | 404 channel_->AddFilter(sync_message_filter_.get()); |
408 channel_->AddFilter(resource_message_filter_.get()); | 405 channel_->AddFilter(resource_message_filter_.get()); |
409 channel_->AddFilter(quota_message_filter_->GetFilter()); | 406 channel_->AddFilter(quota_message_filter_->GetFilter()); |
410 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 407 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
411 channel_->AddFilter(push_dispatcher_->GetFilter()); | 408 channel_->AddFilter(push_dispatcher_->GetFilter()); |
412 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 409 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
413 channel_->AddFilter(geofencing_message_filter_->GetFilter()); | 410 channel_->AddFilter(geofencing_message_filter_->GetFilter()); |
414 channel_->AddFilter(bluetooth_message_filter_->GetFilter()); | 411 channel_->AddFilter(bluetooth_message_filter_->GetFilter()); |
415 channel_->AddFilter(navigator_connect_dispatcher_->GetFilter()); | |
416 | 412 |
417 if (!IsInBrowserProcess()) { | 413 if (!IsInBrowserProcess()) { |
418 // In single process mode, browser-side tracing will cover the whole | 414 // In single process mode, browser-side tracing will cover the whole |
419 // process including renderers. | 415 // process including renderers. |
420 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 416 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
421 ChildProcess::current()->io_task_runner())); | 417 ChildProcess::current()->io_task_runner())); |
422 } | 418 } |
423 | 419 |
424 // In single process mode we may already have a power monitor | 420 // In single process mode we may already have a power monitor |
425 if (!base::PowerMonitor::Get()) { | 421 if (!base::PowerMonitor::Get()) { |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 715 |
720 void ChildThreadImpl::OnProcessBackgrounded(bool background) { | 716 void ChildThreadImpl::OnProcessBackgrounded(bool background) { |
721 // Set timer slack to maximum on main thread when in background. | 717 // Set timer slack to maximum on main thread when in background. |
722 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 718 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
723 if (background) | 719 if (background) |
724 timer_slack = base::TIMER_SLACK_MAXIMUM; | 720 timer_slack = base::TIMER_SLACK_MAXIMUM; |
725 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 721 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
726 } | 722 } |
727 | 723 |
728 } // namespace content | 724 } // namespace content |
OLD | NEW |