| 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 18 matching lines...) Expand all Loading... |
| 29 #include "content/child/child_discardable_shared_memory_manager.h" | 29 #include "content/child/child_discardable_shared_memory_manager.h" |
| 30 #include "content/child/child_gpu_memory_buffer_manager.h" | 30 #include "content/child/child_gpu_memory_buffer_manager.h" |
| 31 #include "content/child/child_histogram_message_filter.h" | 31 #include "content/child/child_histogram_message_filter.h" |
| 32 #include "content/child/child_process.h" | 32 #include "content/child/child_process.h" |
| 33 #include "content/child/child_resource_message_filter.h" | 33 #include "content/child/child_resource_message_filter.h" |
| 34 #include "content/child/child_shared_bitmap_manager.h" | 34 #include "content/child/child_shared_bitmap_manager.h" |
| 35 #include "content/child/fileapi/file_system_dispatcher.h" | 35 #include "content/child/fileapi/file_system_dispatcher.h" |
| 36 #include "content/child/fileapi/webfilesystem_impl.h" | 36 #include "content/child/fileapi/webfilesystem_impl.h" |
| 37 #include "content/child/geofencing/geofencing_message_filter.h" | 37 #include "content/child/geofencing/geofencing_message_filter.h" |
| 38 #include "content/child/mojo/mojo_application.h" | 38 #include "content/child/mojo/mojo_application.h" |
| 39 #include "content/child/notifications/notification_dispatcher.h" |
| 39 #include "content/child/power_monitor_broadcast_source.h" | 40 #include "content/child/power_monitor_broadcast_source.h" |
| 40 #include "content/child/quota_dispatcher.h" | 41 #include "content/child/quota_dispatcher.h" |
| 41 #include "content/child/quota_message_filter.h" | 42 #include "content/child/quota_message_filter.h" |
| 42 #include "content/child/resource_dispatcher.h" | 43 #include "content/child/resource_dispatcher.h" |
| 43 #include "content/child/service_worker/service_worker_message_filter.h" | 44 #include "content/child/service_worker/service_worker_message_filter.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" |
| 48 #include "ipc/ipc_logging.h" | 49 #include "ipc/ipc_logging.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 resource_message_filter_ = | 282 resource_message_filter_ = |
| 282 new ChildResourceMessageFilter(resource_dispatcher()); | 283 new ChildResourceMessageFilter(resource_dispatcher()); |
| 283 | 284 |
| 284 service_worker_message_filter_ = | 285 service_worker_message_filter_ = |
| 285 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); | 286 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); |
| 286 | 287 |
| 287 quota_message_filter_ = | 288 quota_message_filter_ = |
| 288 new QuotaMessageFilter(thread_safe_sender_.get()); | 289 new QuotaMessageFilter(thread_safe_sender_.get()); |
| 289 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), | 290 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), |
| 290 quota_message_filter_.get())); | 291 quota_message_filter_.get())); |
| 291 | |
| 292 geofencing_message_filter_ = | 292 geofencing_message_filter_ = |
| 293 new GeofencingMessageFilter(thread_safe_sender_.get()); | 293 new GeofencingMessageFilter(thread_safe_sender_.get()); |
| 294 | 294 notification_dispatcher_ = |
| 295 new NotificationDispatcher(thread_safe_sender_.get()); |
| 295 channel_->AddFilter(histogram_message_filter_.get()); | 296 channel_->AddFilter(histogram_message_filter_.get()); |
| 296 channel_->AddFilter(sync_message_filter_.get()); | 297 channel_->AddFilter(sync_message_filter_.get()); |
| 297 channel_->AddFilter(resource_message_filter_.get()); | 298 channel_->AddFilter(resource_message_filter_.get()); |
| 298 channel_->AddFilter(quota_message_filter_->GetFilter()); | 299 channel_->AddFilter(quota_message_filter_->GetFilter()); |
| 300 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
| 299 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 301 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
| 300 channel_->AddFilter(geofencing_message_filter_->GetFilter()); | 302 channel_->AddFilter(geofencing_message_filter_->GetFilter()); |
| 301 | 303 |
| 302 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 304 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 303 switches::kSingleProcess)) { | 305 switches::kSingleProcess)) { |
| 304 // In single process mode, browser-side tracing will cover the whole | 306 // In single process mode, browser-side tracing will cover the whole |
| 305 // process including renderers. | 307 // process including renderers. |
| 306 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 308 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
| 307 ChildProcess::current()->io_message_loop_proxy())); | 309 ChildProcess::current()->io_message_loop_proxy())); |
| 308 } | 310 } |
| (...skipping 286 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 |