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

Side by Side Diff: chrome/utility/profile_import_handler.cc

Issue 12670013: Out-of-process import on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on top of https://codereview.chromium.org/15736014/ Created 7 years, 7 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/common/switch_utils_unittest.cc ('k') | no next file » | 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) 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 "chrome/utility/profile_import_handler.h" 5 #include "chrome/utility/profile_import_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 if (!importer_) { 42 if (!importer_) {
43 Send(new ProfileImportProcessHostMsg_Import_Finished(false, 43 Send(new ProfileImportProcessHostMsg_Import_Finished(false,
44 "Importer could not be created.")); 44 "Importer could not be created."));
45 return; 45 return;
46 } 46 }
47 47
48 items_to_import_ = items; 48 items_to_import_ = items;
49 49
50 // Create worker thread in which importer runs. 50 // Create worker thread in which importer runs.
51 import_thread_.reset(new base::Thread("import_thread")); 51 import_thread_.reset(new base::Thread("import_thread"));
52 base::Thread::Options options; 52 #if defined(OS_WIN)
53 options.message_loop_type = base::MessageLoop::TYPE_IO; 53 import_thread_->init_com_with_mta(false);
54 if (!import_thread_->StartWithOptions(options)) { 54 #endif
55 if (!import_thread_->Start()) {
55 NOTREACHED(); 56 NOTREACHED();
56 ImporterCleanup(); 57 ImporterCleanup();
57 } 58 }
58 import_thread_->message_loop()->PostTask( 59 import_thread_->message_loop()->PostTask(
59 FROM_HERE, base::Bind(&Importer::StartImport, importer_.get(), 60 FROM_HERE, base::Bind(&Importer::StartImport, importer_.get(),
60 source_profile, items, bridge_)); 61 source_profile, items, bridge_));
61 } 62 }
62 63
63 void ProfileImportHandler::OnImportCancel() { 64 void ProfileImportHandler::OnImportCancel() {
64 ImporterCleanup(); 65 ImporterCleanup();
(...skipping 15 matching lines...) Expand all
80 import_thread_.reset(); 81 import_thread_.reset();
81 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); 82 content::UtilityThread::Get()->ReleaseProcessIfNeeded();
82 } 83 }
83 84
84 // static 85 // static
85 bool ProfileImportHandler::Send(IPC::Message* message) { 86 bool ProfileImportHandler::Send(IPC::Message* message) {
86 return content::UtilityThread::Get()->Send(message); 87 return content::UtilityThread::Get()->Send(message);
87 } 88 }
88 89
89 } // namespace chrome 90 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/switch_utils_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698