OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 14 matching lines...) Expand all Loading... |
25 #include "base/metrics/field_trial.h" | 25 #include "base/metrics/field_trial.h" |
26 #include "base/metrics/histogram.h" | 26 #include "base/metrics/histogram.h" |
27 #include "base/path_service.h" | 27 #include "base/path_service.h" |
28 #include "base/platform_file.h" | 28 #include "base/platform_file.h" |
29 #include "base/rand_util.h" | 29 #include "base/rand_util.h" |
30 #include "base/stl_util.h" | 30 #include "base/stl_util.h" |
31 #include "base/string_util.h" | 31 #include "base/string_util.h" |
32 #include "base/sys_info.h" | 32 #include "base/sys_info.h" |
33 #include "base/threading/thread.h" | 33 #include "base/threading/thread.h" |
34 #include "base/threading/thread_restrictions.h" | 34 #include "base/threading/thread_restrictions.h" |
| 35 #include "base/tracked_objects.h" |
35 #include "content/browser/appcache/appcache_dispatcher_host.h" | 36 #include "content/browser/appcache/appcache_dispatcher_host.h" |
36 #include "content/browser/browser_child_process_host.h" | 37 #include "content/browser/browser_child_process_host.h" |
37 #include "content/browser/browser_context.h" | 38 #include "content/browser/browser_context.h" |
38 #include "content/browser/browser_main.h" | 39 #include "content/browser/browser_main.h" |
39 #include "content/browser/child_process_security_policy.h" | 40 #include "content/browser/child_process_security_policy.h" |
40 #include "content/browser/device_orientation/message_filter.h" | 41 #include "content/browser/device_orientation/message_filter.h" |
41 #include "content/browser/download/mhtml_generation_manager.h" | 42 #include "content/browser/download/mhtml_generation_manager.h" |
42 #include "content/browser/file_system/file_system_dispatcher_host.h" | 43 #include "content/browser/file_system/file_system_dispatcher_host.h" |
43 #include "content/browser/geolocation/geolocation_dispatcher_host.h" | 44 #include "content/browser/geolocation/geolocation_dispatcher_host.h" |
44 #include "content/browser/gpu/gpu_data_manager.h" | 45 #include "content/browser/gpu/gpu_data_manager.h" |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 } | 927 } |
927 return listener->OnMessageReceived(msg); | 928 return listener->OnMessageReceived(msg); |
928 } | 929 } |
929 | 930 |
930 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) { | 931 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) { |
931 #if defined(IPC_MESSAGE_LOG_ENABLED) | 932 #if defined(IPC_MESSAGE_LOG_ENABLED) |
932 Send(new ChildProcessMsg_SetIPCLoggingEnabled( | 933 Send(new ChildProcessMsg_SetIPCLoggingEnabled( |
933 IPC::Logging::GetInstance()->Enabled())); | 934 IPC::Logging::GetInstance()->Enabled())); |
934 #endif | 935 #endif |
935 | 936 |
| 937 bool enable = tracked_objects::ThreadData::tracking_status(); |
| 938 Send(new ChildProcessMsg_SetProfilerStatus(enable)); |
| 939 |
936 // Make sure the child checks with us before exiting, so that we do not try | 940 // Make sure the child checks with us before exiting, so that we do not try |
937 // to schedule a new navigation in a swapped out and exiting renderer. | 941 // to schedule a new navigation in a swapped out and exiting renderer. |
938 Send(new ChildProcessMsg_AskBeforeShutdown()); | 942 Send(new ChildProcessMsg_AskBeforeShutdown()); |
939 } | 943 } |
940 | 944 |
941 void RenderProcessHostImpl::OnChannelError() { | 945 void RenderProcessHostImpl::OnChannelError() { |
942 if (!channel_.get()) | 946 if (!channel_.get()) |
943 return; | 947 return; |
944 | 948 |
945 // Store the handle before it gets changed. | 949 // Store the handle before it gets changed. |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { | 1310 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { |
1307 // Only honor the request if appropriate persmissions are granted. | 1311 // Only honor the request if appropriate persmissions are granted. |
1308 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path)) | 1312 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path)) |
1309 content::GetContentClient()->browser()->OpenItem(path); | 1313 content::GetContentClient()->browser()->OpenItem(path); |
1310 } | 1314 } |
1311 | 1315 |
1312 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 1316 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
1313 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> | 1317 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> |
1314 MHTMLGenerated(job_id, data_size); | 1318 MHTMLGenerated(job_id, data_size); |
1315 } | 1319 } |
OLD | NEW |