| 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/browser_render_process_host.h" | 8 #include "content/browser/renderer_host/browser_render_process_host.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 // Spawn the child process asynchronously to avoid blocking the UI thread. | 323 // Spawn the child process asynchronously to avoid blocking the UI thread. |
| 324 // As long as there's no renderer prefix, we can use the zygote process | 324 // As long as there's no renderer prefix, we can use the zygote process |
| 325 // at this stage. | 325 // at this stage. |
| 326 child_process_launcher_.reset(new ChildProcessLauncher( | 326 child_process_launcher_.reset(new ChildProcessLauncher( |
| 327 #if defined(OS_WIN) | 327 #if defined(OS_WIN) |
| 328 FilePath(), | 328 FilePath(), |
| 329 #elif defined(OS_POSIX) | 329 #elif defined(OS_POSIX) |
| 330 renderer_prefix.empty(), | 330 renderer_prefix.empty(), |
| 331 base::environment_vector(), | 331 base::environment_vector(), |
| 332 channel_->GetClientFileDescriptor(), | 332 channel_->TakeClientFileDescriptor(), |
| 333 #endif | 333 #endif |
| 334 cmd_line, | 334 cmd_line, |
| 335 this)); | 335 this)); |
| 336 | 336 |
| 337 fast_shutdown_started_ = false; | 337 fast_shutdown_started_ = false; |
| 338 } | 338 } |
| 339 | 339 |
| 340 is_initialized_ = true; | 340 is_initialized_ = true; |
| 341 return true; | 341 return true; |
| 342 } | 342 } |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 // since some clients might expect a RENDERER_PROCESS_TERMINATED afterwards to | 902 // since some clients might expect a RENDERER_PROCESS_TERMINATED afterwards to |
| 903 // properly cleanup. | 903 // properly cleanup. |
| 904 if (deleting_soon_) | 904 if (deleting_soon_) |
| 905 return; | 905 return; |
| 906 | 906 |
| 907 if (child_process_launcher_.get()) { | 907 if (child_process_launcher_.get()) { |
| 908 if (!child_process_launcher_->GetHandle()) { | 908 if (!child_process_launcher_->GetHandle()) { |
| 909 OnChannelError(); | 909 OnChannelError(); |
| 910 return; | 910 return; |
| 911 } | 911 } |
| 912 |
| 912 child_process_launcher_->SetProcessBackgrounded(backgrounded_); | 913 child_process_launcher_->SetProcessBackgrounded(backgrounded_); |
| 913 } | 914 } |
| 914 | 915 |
| 915 if (max_page_id_ != -1) | 916 if (max_page_id_ != -1) |
| 916 Send(new ViewMsg_SetNextPageID(max_page_id_ + 1)); | 917 Send(new ViewMsg_SetNextPageID(max_page_id_ + 1)); |
| 917 | 918 |
| 918 // NOTE: This needs to be before sending queued messages because | 919 // NOTE: This needs to be before sending queued messages because |
| 919 // ExtensionService uses this notification to initialize the renderer process | 920 // ExtensionService uses this notification to initialize the renderer process |
| 920 // with state that must be there before any JavaScript executes. | 921 // with state that must be there before any JavaScript executes. |
| 921 // | 922 // |
| (...skipping 18 matching lines...) Expand all Loading... |
| 940 void BrowserRenderProcessHost::OnRevealFolderInOS(const FilePath& path) { | 941 void BrowserRenderProcessHost::OnRevealFolderInOS(const FilePath& path) { |
| 941 // Only honor the request if appropriate persmissions are granted. | 942 // Only honor the request if appropriate persmissions are granted. |
| 942 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) | 943 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) |
| 943 content::GetContentClient()->browser()->OpenItem(path); | 944 content::GetContentClient()->browser()->OpenItem(path); |
| 944 } | 945 } |
| 945 | 946 |
| 946 void BrowserRenderProcessHost::OnSavedPageAsMHTML(int job_id, bool success) { | 947 void BrowserRenderProcessHost::OnSavedPageAsMHTML(int job_id, bool success) { |
| 947 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> | 948 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> |
| 948 MHTMLGenerated(job_id, success); | 949 MHTMLGenerated(job_id, success); |
| 949 } | 950 } |
| OLD | NEW |