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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 } | 636 } |
637 | 637 |
638 if (!gpu_observer_registered_) { | 638 if (!gpu_observer_registered_) { |
639 gpu_observer_registered_ = true; | 639 gpu_observer_registered_ = true; |
640 GpuDataManagerImpl::GetInstance()->AddObserver(this); | 640 GpuDataManagerImpl::GetInstance()->AddObserver(this); |
641 } | 641 } |
642 | 642 |
643 power_monitor_broadcaster_.Init(); | 643 power_monitor_broadcaster_.Init(); |
644 | 644 |
645 is_initialized_ = true; | 645 is_initialized_ = true; |
| 646 init_time_ = base::TimeTicks::Now(); |
646 return true; | 647 return true; |
647 } | 648 } |
648 | 649 |
649 void RenderProcessHostImpl::MaybeActivateMojo() { | 650 void RenderProcessHostImpl::MaybeActivateMojo() { |
650 // TODO(darin): Following security review, we can unconditionally initialize | 651 // TODO(darin): Following security review, we can unconditionally initialize |
651 // Mojo in all renderers. We will then be able to directly call Activate() | 652 // Mojo in all renderers. We will then be able to directly call Activate() |
652 // from OnProcessLaunched. | 653 // from OnProcessLaunched. |
653 if (!mojo_activation_required_) | 654 if (!mojo_activation_required_) |
654 return; // Waiting on someone to require Mojo. | 655 return; // Waiting on someone to require Mojo. |
655 | 656 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 | 914 |
914 void RenderProcessHostImpl::NotifyTimezoneChange() { | 915 void RenderProcessHostImpl::NotifyTimezoneChange() { |
915 Send(new ViewMsg_TimezoneChange()); | 916 Send(new ViewMsg_TimezoneChange()); |
916 } | 917 } |
917 | 918 |
918 ServiceRegistry* RenderProcessHostImpl::GetServiceRegistry() { | 919 ServiceRegistry* RenderProcessHostImpl::GetServiceRegistry() { |
919 DCHECK(mojo_application_host_); | 920 DCHECK(mojo_application_host_); |
920 return mojo_application_host_->service_registry(); | 921 return mojo_application_host_->service_registry(); |
921 } | 922 } |
922 | 923 |
| 924 const base::TimeTicks& RenderProcessHostImpl::GetInitTime() const { |
| 925 return init_time_; |
| 926 } |
| 927 |
923 void RenderProcessHostImpl::AddRoute( | 928 void RenderProcessHostImpl::AddRoute( |
924 int32 routing_id, | 929 int32 routing_id, |
925 IPC::Listener* listener) { | 930 IPC::Listener* listener) { |
926 listeners_.AddWithID(listener, routing_id); | 931 listeners_.AddWithID(listener, routing_id); |
927 } | 932 } |
928 | 933 |
929 void RenderProcessHostImpl::RemoveRoute(int32 routing_id) { | 934 void RenderProcessHostImpl::RemoveRoute(int32 routing_id) { |
930 DCHECK(listeners_.Lookup(routing_id) != NULL); | 935 DCHECK(listeners_.Lookup(routing_id) != NULL); |
931 listeners_.Remove(routing_id); | 936 listeners_.Remove(routing_id); |
932 | 937 |
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2251 if (worker_ref_count_ == 0) | 2256 if (worker_ref_count_ == 0) |
2252 Cleanup(); | 2257 Cleanup(); |
2253 } | 2258 } |
2254 | 2259 |
2255 void RenderProcessHostImpl::EnsureMojoActivated() { | 2260 void RenderProcessHostImpl::EnsureMojoActivated() { |
2256 mojo_activation_required_ = true; | 2261 mojo_activation_required_ = true; |
2257 MaybeActivateMojo(); | 2262 MaybeActivateMojo(); |
2258 } | 2263 } |
2259 | 2264 |
2260 } // namespace content | 2265 } // namespace content |
OLD | NEW |