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 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 #include "third_party/skia/include/core/SkBitmap.h" | 114 #include "third_party/skia/include/core/SkBitmap.h" |
115 | 115 |
116 using content::BrowserMessageFilter; | 116 using content::BrowserMessageFilter; |
117 using content::BrowserThread; | 117 using content::BrowserThread; |
118 using content::ChildProcessHost; | 118 using content::ChildProcessHost; |
119 using content::ChildProcessHostImpl; | 119 using content::ChildProcessHostImpl; |
120 using content::UserMetricsAction; | 120 using content::UserMetricsAction; |
121 using content::WebUIControllerFactory; | 121 using content::WebUIControllerFactory; |
122 | 122 |
123 extern bool g_exited_main_message_loop; | |
124 | |
125 // This class creates the IO thread for the renderer when running in | 123 // This class creates the IO thread for the renderer when running in |
126 // single-process mode. It's not used in multi-process mode. | 124 // single-process mode. It's not used in multi-process mode. |
127 class RendererMainThread : public base::Thread { | 125 class RendererMainThread : public base::Thread { |
128 public: | 126 public: |
129 explicit RendererMainThread(const std::string& channel_id) | 127 explicit RendererMainThread(const std::string& channel_id) |
130 : base::Thread("Chrome_InProcRendererThread"), | 128 : base::Thread("Chrome_InProcRendererThread"), |
131 channel_id_(channel_id), | 129 channel_id_(channel_id), |
132 render_process_(NULL) { | 130 render_process_(NULL) { |
133 } | 131 } |
134 | 132 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE | | 307 base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE | |
310 base::PLATFORM_FILE_WRITE_ATTRIBUTES | base::PLATFORM_FILE_ENUMERATE); | 308 base::PLATFORM_FILE_WRITE_ATTRIBUTES | base::PLATFORM_FILE_ENUMERATE); |
311 // This is so that we can rename the old sandbox out of the way so that we | 309 // This is so that we can rename the old sandbox out of the way so that we |
312 // know we've taken care of it. | 310 // know we've taken care of it. |
313 ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile( | 311 ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile( |
314 GetID(), browser_context->GetPath().Append( | 312 GetID(), browser_context->GetPath().Append( |
315 fileapi::SandboxMountPointProvider::kRenamedOldFileSystemDirectory), | 313 fileapi::SandboxMountPointProvider::kRenamedOldFileSystemDirectory), |
316 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_CREATE_ALWAYS | | 314 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_CREATE_ALWAYS | |
317 base::PLATFORM_FILE_WRITE); | 315 base::PLATFORM_FILE_WRITE); |
318 | 316 |
319 CHECK(!g_exited_main_message_loop); | 317 CHECK(!content::ExitedMainMessageLoop()); |
320 RegisterHost(GetID(), this); | 318 RegisterHost(GetID(), this); |
321 g_all_hosts.Get().set_check_on_null_data(true); | 319 g_all_hosts.Get().set_check_on_null_data(true); |
322 // Initialize |child_process_activity_time_| to a reasonable value. | 320 // Initialize |child_process_activity_time_| to a reasonable value. |
323 mark_child_process_activity_time(); | 321 mark_child_process_activity_time(); |
324 // Note: When we create the RenderProcessHostImpl, it's technically | 322 // Note: When we create the RenderProcessHostImpl, it's technically |
325 // backgrounded, because it has no visible listeners. But the process | 323 // backgrounded, because it has no visible listeners. But the process |
326 // doesn't actually exist yet, so we'll Background it later, after | 324 // doesn't actually exist yet, so we'll Background it later, after |
327 // creation. | 325 // creation. |
328 } | 326 } |
329 | 327 |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 // Only honor the request if appropriate persmissions are granted. | 1293 // Only honor the request if appropriate persmissions are granted. |
1296 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), | 1294 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), |
1297 path)) | 1295 path)) |
1298 content::GetContentClient()->browser()->OpenItem(path); | 1296 content::GetContentClient()->browser()->OpenItem(path); |
1299 } | 1297 } |
1300 | 1298 |
1301 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 1299 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
1302 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> | 1300 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> |
1303 MHTMLGenerated(job_id, data_size); | 1301 MHTMLGenerated(job_id, data_size); |
1304 } | 1302 } |
OLD | NEW |