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

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

Issue 3581008: Fix instances of passing raw pointers to RefCounted objects in tasks. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Merge Created 10 years, 2 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
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 #ifndef CHROME_PROFILE_IMPORT_PROFILE_IMPORT_THREAD_H_ 5 #ifndef CHROME_PROFILE_IMPORT_PROFILE_IMPORT_THREAD_H_
6 #define CHROME_PROFILE_IMPORT_PROFILE_IMPORT_THREAD_H_ 6 #define CHROME_PROFILE_IMPORT_PROFILE_IMPORT_THREAD_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 10 matching lines...) Expand all
21 class DictionaryValue; 21 class DictionaryValue;
22 class ExternalProcessImporterBridge; 22 class ExternalProcessImporterBridge;
23 class Importer; 23 class Importer;
24 class InProcessImporterBridge; 24 class InProcessImporterBridge;
25 25
26 // This class represents the background thread which communicates with the 26 // This class represents the background thread which communicates with the
27 // importer work thread in the importer process. 27 // importer work thread in the importer process.
28 class ProfileImportThread : public ChildThread { 28 class ProfileImportThread : public ChildThread {
29 public: 29 public:
30 ProfileImportThread(); 30 ProfileImportThread();
31 virtual ~ProfileImportThread() {} 31 virtual ~ProfileImportThread();
32 32
33 // Returns the one profile import thread. 33 // Returns the one profile import thread.
34 static ProfileImportThread* current() { 34 static ProfileImportThread* current() {
35 return static_cast<ProfileImportThread*>(ChildThread::current()); 35 return static_cast<ProfileImportThread*>(ChildThread::current());
36 } 36 }
37 37
38 // Bridging methods, called from importer_bridge tasks posted here. 38 // Bridging methods, called from importer_bridge tasks posted here.
39 void NotifyItemStarted(importer::ImportItem item); 39 void NotifyItemStarted(importer::ImportItem item);
40 void NotifyItemEnded(importer::ImportItem item); 40 void NotifyItemEnded(importer::ImportItem item);
41 void NotifyStarted(); 41 void NotifyStarted();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 // Release the process and ourselves. 78 // Release the process and ourselves.
79 void Cleanup(); 79 void Cleanup();
80 80
81 // Thread that importer runs on, while ProfileImportThread handles messages 81 // Thread that importer runs on, while ProfileImportThread handles messages
82 // from the browser process. 82 // from the browser process.
83 scoped_ptr<base::Thread> import_thread_; 83 scoped_ptr<base::Thread> import_thread_;
84 84
85 // Bridge object is passed to importer, so that it can send IPC calls 85 // Bridge object is passed to importer, so that it can send IPC calls
86 // directly back to the ProfileImportProcessHost. 86 // directly back to the ProfileImportProcessHost.
87 ExternalProcessImporterBridge* bridge_; 87 scoped_refptr<ExternalProcessImporterBridge> bridge_;
88 88
89 // importer::ProfileType enum from importer_list, stored in ProfileInfo 89 // importer::ProfileType enum from importer_list, stored in ProfileInfo
90 // struct in importer. 90 // struct in importer.
91 int browser_type_; 91 int browser_type_;
92 92
93 // A mask of importer::ImportItems. 93 // A mask of importer::ImportItems.
94 uint16 items_to_import_; 94 uint16 items_to_import_;
95 95
96 // Importer of the appropriate type (Firefox, Safari, IE, etc.) 96 // Importer of the appropriate type (Firefox, Safari, IE, etc.)
97 Importer* importer_; 97 scoped_refptr<Importer> importer_;
98 98
99 DISALLOW_COPY_AND_ASSIGN(ProfileImportThread); 99 DISALLOW_COPY_AND_ASSIGN(ProfileImportThread);
100 }; 100 };
101 101
102 #endif // CHROME_PROFILE_IMPORT_PROFILE_IMPORT_THREAD_H_ 102 #endif // CHROME_PROFILE_IMPORT_PROFILE_IMPORT_THREAD_H_
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.cc ('k') | chrome/profile_import/profile_import_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698