| 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 #include "chrome/browser/importer/profile_import_process_host.h" | 5 #include "chrome/browser/importer/profile_import_process_host.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool ProfileImportProcessHost::ReportImportItemFinished( | 71 bool ProfileImportProcessHost::ReportImportItemFinished( |
| 72 importer::ImportItem item) { | 72 importer::ImportItem item) { |
| 73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 74 Send(new ProfileImportProcessMsg_ReportImportItemFinished(item)); | 74 Send(new ProfileImportProcessMsg_ReportImportItemFinished(item)); |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 | 77 |
| 78 FilePath ProfileImportProcessHost::GetProfileImportProcessCmd() { | 78 FilePath ProfileImportProcessHost::GetProfileImportProcessCmd() { |
| 79 return GetChildPath(true); | 79 #if defined(OS_LINUX) |
| 80 int flags = CHILD_ALLOW_SELF; |
| 81 #else |
| 82 int flags = CHILD_NORMAL; |
| 83 #endif |
| 84 return GetChildPath(flags); |
| 80 } | 85 } |
| 81 | 86 |
| 82 bool ProfileImportProcessHost::StartProcess() { | 87 bool ProfileImportProcessHost::StartProcess() { |
| 83 set_name(ASCIIToUTF16("profile import process")); | 88 set_name(ASCIIToUTF16("profile import process")); |
| 84 | 89 |
| 85 if (!CreateChannel()) | 90 if (!CreateChannel()) |
| 86 return false; | 91 return false; |
| 87 | 92 |
| 88 FilePath exe_path = GetProfileImportProcessCmd(); | 93 FilePath exe_path = GetProfileImportProcessCmd(); |
| 89 if (exe_path.empty()) { | 94 if (exe_path.empty()) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 BrowserThread::PostTask( | 140 BrowserThread::PostTask( |
| 136 thread_id_, FROM_HERE, | 141 thread_id_, FROM_HERE, |
| 137 NewRunnableMethod(import_process_client_.get(), | 142 NewRunnableMethod(import_process_client_.get(), |
| 138 &ProfileImportProcessClient::OnProcessCrashed, | 143 &ProfileImportProcessClient::OnProcessCrashed, |
| 139 exit_code)); | 144 exit_code)); |
| 140 } | 145 } |
| 141 | 146 |
| 142 bool ProfileImportProcessHost::CanShutdown() { | 147 bool ProfileImportProcessHost::CanShutdown() { |
| 143 return true; | 148 return true; |
| 144 } | 149 } |
| OLD | NEW |