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 17 matching lines...) Expand all Loading... |
28 #include "components/tracing/child_trace_message_filter.h" | 28 #include "components/tracing/child_trace_message_filter.h" |
29 #include "content/child/child_gpu_memory_buffer_manager.h" | 29 #include "content/child/child_gpu_memory_buffer_manager.h" |
30 #include "content/child/child_histogram_message_filter.h" | 30 #include "content/child/child_histogram_message_filter.h" |
31 #include "content/child/child_process.h" | 31 #include "content/child/child_process.h" |
32 #include "content/child/child_resource_message_filter.h" | 32 #include "content/child/child_resource_message_filter.h" |
33 #include "content/child/child_shared_bitmap_manager.h" | 33 #include "content/child/child_shared_bitmap_manager.h" |
34 #include "content/child/fileapi/file_system_dispatcher.h" | 34 #include "content/child/fileapi/file_system_dispatcher.h" |
35 #include "content/child/fileapi/webfilesystem_impl.h" | 35 #include "content/child/fileapi/webfilesystem_impl.h" |
36 #include "content/child/geofencing/geofencing_message_filter.h" | 36 #include "content/child/geofencing/geofencing_message_filter.h" |
37 #include "content/child/mojo/mojo_application.h" | 37 #include "content/child/mojo/mojo_application.h" |
| 38 #include "content/child/notifications/notification_dispatcher.h" |
38 #include "content/child/power_monitor_broadcast_source.h" | 39 #include "content/child/power_monitor_broadcast_source.h" |
39 #include "content/child/quota_dispatcher.h" | 40 #include "content/child/quota_dispatcher.h" |
40 #include "content/child/quota_message_filter.h" | 41 #include "content/child/quota_message_filter.h" |
41 #include "content/child/resource_dispatcher.h" | 42 #include "content/child/resource_dispatcher.h" |
42 #include "content/child/service_worker/service_worker_message_filter.h" | 43 #include "content/child/service_worker/service_worker_message_filter.h" |
43 #include "content/child/socket_stream_dispatcher.h" | 44 #include "content/child/socket_stream_dispatcher.h" |
44 #include "content/child/thread_safe_sender.h" | 45 #include "content/child/thread_safe_sender.h" |
45 #include "content/child/websocket_dispatcher.h" | 46 #include "content/child/websocket_dispatcher.h" |
46 #include "content/common/child_process_messages.h" | 47 #include "content/common/child_process_messages.h" |
47 #include "content/public/common/content_switches.h" | 48 #include "content/public/common/content_switches.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 resource_message_filter_ = | 283 resource_message_filter_ = |
283 new ChildResourceMessageFilter(resource_dispatcher()); | 284 new ChildResourceMessageFilter(resource_dispatcher()); |
284 | 285 |
285 service_worker_message_filter_ = | 286 service_worker_message_filter_ = |
286 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); | 287 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); |
287 | 288 |
288 quota_message_filter_ = | 289 quota_message_filter_ = |
289 new QuotaMessageFilter(thread_safe_sender_.get()); | 290 new QuotaMessageFilter(thread_safe_sender_.get()); |
290 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), | 291 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), |
291 quota_message_filter_.get())); | 292 quota_message_filter_.get())); |
292 | |
293 geofencing_message_filter_ = | 293 geofencing_message_filter_ = |
294 new GeofencingMessageFilter(thread_safe_sender_.get()); | 294 new GeofencingMessageFilter(thread_safe_sender_.get()); |
295 | 295 notification_dispatcher_ = |
| 296 new NotificationDispatcher(thread_safe_sender_.get()); |
296 channel_->AddFilter(histogram_message_filter_.get()); | 297 channel_->AddFilter(histogram_message_filter_.get()); |
297 channel_->AddFilter(sync_message_filter_.get()); | 298 channel_->AddFilter(sync_message_filter_.get()); |
298 channel_->AddFilter(resource_message_filter_.get()); | 299 channel_->AddFilter(resource_message_filter_.get()); |
299 channel_->AddFilter(quota_message_filter_->GetFilter()); | 300 channel_->AddFilter(quota_message_filter_->GetFilter()); |
| 301 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
300 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 302 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
301 channel_->AddFilter(geofencing_message_filter_->GetFilter()); | 303 channel_->AddFilter(geofencing_message_filter_->GetFilter()); |
302 | 304 |
303 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 305 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
304 switches::kSingleProcess)) { | 306 switches::kSingleProcess)) { |
305 // In single process mode, browser-side tracing will cover the whole | 307 // In single process mode, browser-side tracing will cover the whole |
306 // process including renderers. | 308 // process including renderers. |
307 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 309 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
308 ChildProcess::current()->io_message_loop_proxy())); | 310 ChildProcess::current()->io_message_loop_proxy())); |
309 } | 311 } |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 | 597 |
596 void ChildThread::OnProcessBackgrounded(bool background) { | 598 void ChildThread::OnProcessBackgrounded(bool background) { |
597 // Set timer slack to maximum on main thread when in background. | 599 // Set timer slack to maximum on main thread when in background. |
598 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 600 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
599 if (background) | 601 if (background) |
600 timer_slack = base::TIMER_SLACK_MAXIMUM; | 602 timer_slack = base::TIMER_SLACK_MAXIMUM; |
601 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 603 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
602 } | 604 } |
603 | 605 |
604 } // namespace content | 606 } // namespace content |
OLD | NEW |