OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/profile_import_process_host.h" | 5 #include "chrome/browser/profile_import_process_host.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 void ProfileImportProcessHost::OnMessageReceived(const IPC::Message& message) { | 118 void ProfileImportProcessHost::OnMessageReceived(const IPC::Message& message) { |
119 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 119 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
120 ChromeThread::PostTask( | 120 ChromeThread::PostTask( |
121 thread_id_, FROM_HERE, | 121 thread_id_, FROM_HERE, |
122 NewRunnableMethod(import_process_client_.get(), | 122 NewRunnableMethod(import_process_client_.get(), |
123 &ImportProcessClient::OnMessageReceived, | 123 &ImportProcessClient::OnMessageReceived, |
124 message)); | 124 message)); |
125 } | 125 } |
126 | 126 |
127 void ProfileImportProcessHost::OnProcessCrashed() { | 127 void ProfileImportProcessHost::OnProcessCrashed(int exit_code) { |
128 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 128 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
129 ChromeThread::PostTask( | 129 ChromeThread::PostTask( |
130 thread_id_, FROM_HERE, | 130 thread_id_, FROM_HERE, |
131 NewRunnableMethod(import_process_client_.get(), | 131 NewRunnableMethod(import_process_client_.get(), |
132 &ImportProcessClient::OnProcessCrashed)); | 132 &ImportProcessClient::OnProcessCrashed, |
| 133 exit_code)); |
133 } | 134 } |
134 | 135 |
135 void ProfileImportProcessHost::ImportProcessClient::OnMessageReceived( | 136 void ProfileImportProcessHost::ImportProcessClient::OnMessageReceived( |
136 const IPC::Message& message) { | 137 const IPC::Message& message) { |
137 IPC_BEGIN_MESSAGE_MAP(ProfileImportProcessHost, message) | 138 IPC_BEGIN_MESSAGE_MAP(ProfileImportProcessHost, message) |
138 // Notification messages about the state of the import process. | 139 // Notification messages about the state of the import process. |
139 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_Import_Started, | 140 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_Import_Started, |
140 ImportProcessClient::OnImportStart) | 141 ImportProcessClient::OnImportStart) |
141 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_Import_Finished, | 142 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_Import_Finished, |
142 ImportProcessClient::OnImportFinished) | 143 ImportProcessClient::OnImportFinished) |
(...skipping 16 matching lines...) Expand all Loading... |
159 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyFavIconsImportStart, | 160 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyFavIconsImportStart, |
160 ImportProcessClient::OnFavIconsImportStart) | 161 ImportProcessClient::OnFavIconsImportStart) |
161 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyFavIconsImportGroup, | 162 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyFavIconsImportGroup, |
162 ImportProcessClient::OnFavIconsImportGroup) | 163 ImportProcessClient::OnFavIconsImportGroup) |
163 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyPasswordFormReady, | 164 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyPasswordFormReady, |
164 ImportProcessClient::OnPasswordFormImportReady) | 165 ImportProcessClient::OnPasswordFormImportReady) |
165 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyKeywordsReady, | 166 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyKeywordsReady, |
166 ImportProcessClient::OnKeywordsImportReady) | 167 ImportProcessClient::OnKeywordsImportReady) |
167 IPC_END_MESSAGE_MAP_EX() | 168 IPC_END_MESSAGE_MAP_EX() |
168 } | 169 } |
OLD | NEW |