Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/profile_import/profile_import_thread.cc

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/profile_import/profile_import_thread.h ('k') | chrome/renderer/command_buffer_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16 matching lines...) Expand all
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() {} 35 ProfileImportThread::~ProfileImportThread() {}
36 36
37 void ProfileImportThread::OnControlMessageReceived(const IPC::Message& msg) { 37 bool ProfileImportThread::OnControlMessageReceived(const IPC::Message& msg) {
38 bool handled = true;
38 IPC_BEGIN_MESSAGE_MAP(ProfileImportThread, msg) 39 IPC_BEGIN_MESSAGE_MAP(ProfileImportThread, msg)
39 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_StartImport, 40 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_StartImport,
40 OnImportStart) 41 OnImportStart)
41 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_CancelImport, 42 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_CancelImport,
42 OnImportCancel) 43 OnImportCancel)
43 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_ReportImportItemFinished, 44 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_ReportImportItemFinished,
44 OnImportItemFinished) 45 OnImportItemFinished)
46 IPC_MESSAGE_UNHANDLED(handled = false)
45 IPC_END_MESSAGE_MAP() 47 IPC_END_MESSAGE_MAP()
48 return handled;
46 } 49 }
47 50
48 void ProfileImportThread::OnImportStart( 51 void ProfileImportThread::OnImportStart(
49 const ProfileInfo& profile_info, 52 const ProfileInfo& profile_info,
50 int items, 53 int items,
51 const DictionaryValue& localized_strings, 54 const DictionaryValue& localized_strings,
52 bool import_to_bookmark_bar) { 55 bool import_to_bookmark_bar) {
53 bridge_ = new ExternalProcessImporterBridge(this, localized_strings); 56 bridge_ = new ExternalProcessImporterBridge(this, localized_strings);
54 57
55 scoped_refptr<ImporterList> importer_list(new ImporterList); 58 scoped_refptr<ImporterList> importer_list(new ImporterList);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 Send(new ProfileImportProcessHostMsg_NotifyKeywordsReady(urls, 189 Send(new ProfileImportProcessHostMsg_NotifyKeywordsReady(urls,
187 default_keyword_index, unique_on_host_and_path)); 190 default_keyword_index, unique_on_host_and_path));
188 } 191 }
189 192
190 void ProfileImportThread::Cleanup() { 193 void ProfileImportThread::Cleanup() {
191 importer_->Cancel(); 194 importer_->Cancel();
192 importer_ = NULL; 195 importer_ = NULL;
193 bridge_ = NULL; 196 bridge_ = NULL;
194 ChildProcess::current()->ReleaseProcess(); 197 ChildProcess::current()->ReleaseProcess();
195 } 198 }
OLDNEW
« no previous file with comments | « chrome/profile_import/profile_import_thread.h ('k') | chrome/renderer/command_buffer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698