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