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