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 #include "content/browser/browser_child_process_host_impl.h" | 5 #include "content/browser/browser_child_process_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "content/public/browser/browser_child_process_host_delegate.h" | 23 #include "content/public/browser/browser_child_process_host_delegate.h" |
24 #include "content/public/browser/child_process_data.h" | 24 #include "content/public/browser/child_process_data.h" |
25 #include "content/public/browser/content_browser_client.h" | 25 #include "content/public/browser/content_browser_client.h" |
26 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
27 #include "content/public/browser/notification_types.h" | 27 #include "content/public/browser/notification_types.h" |
28 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
29 #include "content/public/common/result_codes.h" | 29 #include "content/public/common/result_codes.h" |
30 | 30 |
31 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
32 #include "base/synchronization/waitable_event.h" | 32 #include "base/synchronization/waitable_event.h" |
33 #else | |
34 #include "base/bind.h" | |
35 #endif | 33 #endif |
36 | 34 |
37 using content::BrowserChildProcessHostDelegate; | 35 using content::BrowserChildProcessHostDelegate; |
38 using content::BrowserThread; | 36 using content::BrowserThread; |
39 using content::ChildProcessData; | 37 using content::ChildProcessData; |
40 using content::ChildProcessHost; | 38 using content::ChildProcessHost; |
41 using content::ChildProcessHostImpl; | 39 using content::ChildProcessHostImpl; |
42 | 40 |
43 namespace { | 41 namespace { |
44 | 42 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // list. | 98 // list. |
101 BrowserChildProcessList copy = g_child_process_list.Get(); | 99 BrowserChildProcessList copy = g_child_process_list.Get(); |
102 STLDeleteElements(©); | 100 STLDeleteElements(©); |
103 } | 101 } |
104 | 102 |
105 void BrowserChildProcessHostImpl::Launch( | 103 void BrowserChildProcessHostImpl::Launch( |
106 #if defined(OS_WIN) | 104 #if defined(OS_WIN) |
107 const FilePath& exposed_dir, | 105 const FilePath& exposed_dir, |
108 #elif defined(OS_POSIX) | 106 #elif defined(OS_POSIX) |
109 bool use_zygote, | 107 bool use_zygote, |
110 const base::environment_vector& environ, | 108 const base::EnvironmentVector& environ, |
111 #endif | 109 #endif |
112 CommandLine* cmd_line) { | 110 CommandLine* cmd_line) { |
113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
114 | 112 |
115 content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( | 113 content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( |
116 cmd_line, data_.id); | 114 cmd_line, data_.id); |
117 | 115 |
118 child_process_.reset(new ChildProcessLauncher( | 116 child_process_.reset(new ChildProcessLauncher( |
119 #if defined(OS_WIN) | 117 #if defined(OS_WIN) |
120 exposed_dir, | 118 exposed_dir, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 309 |
312 | 310 |
313 void BrowserChildProcessHostImpl::OnProcessLaunched() { | 311 void BrowserChildProcessHostImpl::OnProcessLaunched() { |
314 if (!child_process_->GetHandle()) { | 312 if (!child_process_->GetHandle()) { |
315 delete delegate_; // Will delete us | 313 delete delegate_; // Will delete us |
316 return; | 314 return; |
317 } | 315 } |
318 data_.handle = child_process_->GetHandle(); | 316 data_.handle = child_process_->GetHandle(); |
319 delegate_->OnProcessLaunched(); | 317 delegate_->OnProcessLaunched(); |
320 } | 318 } |
OLD | NEW |