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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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
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 18 matching lines...) Expand all
29 IPC_MESSAGE_UNHANDLED(handled = false) 29 IPC_MESSAGE_UNHANDLED(handled = false)
30 IPC_END_MESSAGE_MAP() 30 IPC_END_MESSAGE_MAP()
31 return handled; 31 return handled;
32 } 32 }
33 33
34 void ProfileImportHandler::OnImportStart( 34 void ProfileImportHandler::OnImportStart(
35 const importer::SourceProfile& source_profile, 35 const importer::SourceProfile& source_profile,
36 uint16 items, 36 uint16 items,
37 const base::DictionaryValue& localized_strings) { 37 const base::DictionaryValue& localized_strings) {
38 bridge_ = new ExternalProcessImporterBridge( 38 bridge_ = new ExternalProcessImporterBridge(
39 localized_strings, content::UtilityThread::Get(), 39 localized_strings,
40 base::MessageLoopProxy::current()); 40 content::UtilityThread::Get(),
41 base::MessageLoopProxy::current().get());
41 importer_ = importer::CreateImporterByType(source_profile.importer_type); 42 importer_ = importer::CreateImporterByType(source_profile.importer_type);
42 if (!importer_.get()) { 43 if (!importer_.get()) {
43 Send(new ProfileImportProcessHostMsg_Import_Finished( 44 Send(new ProfileImportProcessHostMsg_Import_Finished(
44 false, "Importer could not be created.")); 45 false, "Importer could not be created."));
45 return; 46 return;
46 } 47 }
47 48
48 items_to_import_ = items; 49 items_to_import_ = items;
49 50
50 // Create worker thread in which importer runs. 51 // Create worker thread in which importer runs.
(...skipping 30 matching lines...) Expand all
81 import_thread_.reset(); 82 import_thread_.reset();
82 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); 83 content::UtilityThread::Get()->ReleaseProcessIfNeeded();
83 } 84 }
84 85
85 // static 86 // static
86 bool ProfileImportHandler::Send(IPC::Message* message) { 87 bool ProfileImportHandler::Send(IPC::Message* message) {
87 return content::UtilityThread::Get()->Send(message); 88 return content::UtilityThread::Get()->Send(message);
88 } 89 }
89 90
90 } // namespace chrome 91 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/test/reliability/page_load_test.cc ('k') | components/webdata/common/web_data_service_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698