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/profile_import/profile_import_thread.h" | 5 #include "chrome/profile_import/profile_import_thread.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/importer/importer.h" | 10 #include "chrome/browser/importer/importer.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 ProfileImportThread::ProfileImportThread() | 27 ProfileImportThread::ProfileImportThread() |
28 : bridge_(NULL), | 28 : bridge_(NULL), |
29 browser_type_(0), | 29 browser_type_(0), |
30 items_to_import_(0), | 30 items_to_import_(0), |
31 importer_(NULL) { | 31 importer_(NULL) { |
32 ChildProcess::current()->AddRefProcess(); // Balanced in Cleanup(). | 32 ChildProcess::current()->AddRefProcess(); // Balanced in Cleanup(). |
33 } | 33 } |
34 | 34 |
| 35 ProfileImportThread::~ProfileImportThread() {} |
| 36 |
35 void ProfileImportThread::OnControlMessageReceived(const IPC::Message& msg) { | 37 void ProfileImportThread::OnControlMessageReceived(const IPC::Message& msg) { |
36 IPC_BEGIN_MESSAGE_MAP(ProfileImportThread, msg) | 38 IPC_BEGIN_MESSAGE_MAP(ProfileImportThread, msg) |
37 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_StartImport, | 39 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_StartImport, |
38 OnImportStart) | 40 OnImportStart) |
39 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_CancelImport, | 41 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_CancelImport, |
40 OnImportCancel) | 42 OnImportCancel) |
41 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_ReportImportItemFinished, | 43 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_ReportImportItemFinished, |
42 OnImportItemFinished) | 44 OnImportItemFinished) |
43 IPC_END_MESSAGE_MAP() | 45 IPC_END_MESSAGE_MAP() |
44 } | 46 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 Send(new ProfileImportProcessHostMsg_NotifyKeywordsReady(urls, | 183 Send(new ProfileImportProcessHostMsg_NotifyKeywordsReady(urls, |
182 default_keyword_index, unique_on_host_and_path)); | 184 default_keyword_index, unique_on_host_and_path)); |
183 } | 185 } |
184 | 186 |
185 void ProfileImportThread::Cleanup() { | 187 void ProfileImportThread::Cleanup() { |
186 importer_->Cancel(); | 188 importer_->Cancel(); |
187 importer_->Release(); | 189 importer_->Release(); |
188 bridge_->Release(); | 190 bridge_->Release(); |
189 ChildProcess::current()->ReleaseProcess(); | 191 ChildProcess::current()->ReleaseProcess(); |
190 } | 192 } |
OLD | NEW |