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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 new ChildResourceMessageFilter(resource_dispatcher()); | 282 new ChildResourceMessageFilter(resource_dispatcher()); |
282 | 283 |
283 service_worker_message_filter_ = | 284 service_worker_message_filter_ = |
284 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); | 285 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); |
285 | 286 |
286 quota_message_filter_ = | 287 quota_message_filter_ = |
287 new QuotaMessageFilter(thread_safe_sender_.get()); | 288 new QuotaMessageFilter(thread_safe_sender_.get()); |
288 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), | 289 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), |
289 quota_message_filter_.get())); | 290 quota_message_filter_.get())); |
290 | 291 |
| 292 geofencing_message_filter_ = |
| 293 new GeofencingMessageFilter(thread_safe_sender_.get()); |
| 294 |
291 channel_->AddFilter(histogram_message_filter_.get()); | 295 channel_->AddFilter(histogram_message_filter_.get()); |
292 channel_->AddFilter(sync_message_filter_.get()); | 296 channel_->AddFilter(sync_message_filter_.get()); |
293 channel_->AddFilter(resource_message_filter_.get()); | 297 channel_->AddFilter(resource_message_filter_.get()); |
294 channel_->AddFilter(quota_message_filter_->GetFilter()); | 298 channel_->AddFilter(quota_message_filter_->GetFilter()); |
295 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 299 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
| 300 channel_->AddFilter(geofencing_message_filter_->GetFilter()); |
296 | 301 |
297 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 302 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
298 switches::kSingleProcess)) { | 303 switches::kSingleProcess)) { |
299 // In single process mode, browser-side tracing will cover the whole | 304 // In single process mode, browser-side tracing will cover the whole |
300 // process including renderers. | 305 // process including renderers. |
301 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 306 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
302 ChildProcess::current()->io_message_loop_proxy())); | 307 ChildProcess::current()->io_message_loop_proxy())); |
303 } | 308 } |
304 | 309 |
305 // In single process mode we may already have a power monitor | 310 // In single process mode we may already have a power monitor |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 | 591 |
587 void ChildThread::OnProcessBackgrounded(bool background) { | 592 void ChildThread::OnProcessBackgrounded(bool background) { |
588 // Set timer slack to maximum on main thread when in background. | 593 // Set timer slack to maximum on main thread when in background. |
589 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 594 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
590 if (background) | 595 if (background) |
591 timer_slack = base::TIMER_SLACK_MAXIMUM; | 596 timer_slack = base::TIMER_SLACK_MAXIMUM; |
592 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 597 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
593 } | 598 } |
594 | 599 |
595 } // namespace content | 600 } // namespace content |
OLD | NEW |