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

Side by Side Diff: chrome/browser/signin/signin_names_io_thread.h

Issue 649313004: Standardize usage of virtual/override/final in chrome/browser/signin/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « chrome/browser/signin/signin_manager_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 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_ 5 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_
6 #define CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_ 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 12 matching lines...) Expand all
23 // Instance of this class are created and initialized on the UI 23 // Instance of this class are created and initialized on the UI
24 // thread as part of the creation of ProfileIOData, and destroyed along with 24 // thread as part of the creation of ProfileIOData, and destroyed along with
25 // ProfileIOData. 25 // ProfileIOData.
26 class SigninNamesOnIOThread : public SigninManagerBase::Observer, 26 class SigninNamesOnIOThread : public SigninManagerBase::Observer,
27 public SigninManagerFactory::Observer { 27 public SigninManagerFactory::Observer {
28 public: 28 public:
29 typedef std::set<base::string16> EmailSet; 29 typedef std::set<base::string16> EmailSet;
30 30
31 // Objects should only be created on UI thread. 31 // Objects should only be created on UI thread.
32 SigninNamesOnIOThread(); 32 SigninNamesOnIOThread();
33 virtual ~SigninNamesOnIOThread(); 33 ~SigninNamesOnIOThread() override;
34 34
35 // Gets the set of email addresses of connected profiles. This method should 35 // Gets the set of email addresses of connected profiles. This method should
36 // only be called on the IO thread. 36 // only be called on the IO thread.
37 const EmailSet& GetEmails() const; 37 const EmailSet& GetEmails() const;
38 38
39 // Releases all resource held by object. Once released, GetEmails() no 39 // Releases all resource held by object. Once released, GetEmails() no
40 // longer works. 40 // longer works.
41 void ReleaseResourcesOnUIThread(); 41 void ReleaseResourcesOnUIThread();
42 42
43 private: 43 private:
44 // SigninManagerBase::Observer: 44 // SigninManagerBase::Observer:
45 virtual void GoogleSigninSucceeded(const std::string& account_id, 45 void GoogleSigninSucceeded(const std::string& account_id,
46 const std::string& username, 46 const std::string& username,
47 const std::string& password) override; 47 const std::string& password) override;
48 virtual void GoogleSignedOut(const std::string& account_id, 48 void GoogleSignedOut(const std::string& account_id,
49 const std::string& username) override; 49 const std::string& username) override;
50 50
51 // SigninManagerFactory::Observer: 51 // SigninManagerFactory::Observer:
52 virtual void SigninManagerCreated(SigninManagerBase* manager) override; 52 void SigninManagerCreated(SigninManagerBase* manager) override;
53 virtual void SigninManagerShutdown(SigninManagerBase* manager) override; 53 void SigninManagerShutdown(SigninManagerBase* manager) override;
54 54
55 // Checks whether the current thread is the IO thread. 55 // Checks whether the current thread is the IO thread.
56 void CheckOnIOThread() const; 56 void CheckOnIOThread() const;
57 57
58 // Checks whether the current thread is the UI thread. 58 // Checks whether the current thread is the UI thread.
59 void CheckOnUIThread() const; 59 void CheckOnUIThread() const;
60 60
61 // Posts a task to the I/O thread to add or remove the email address from 61 // Posts a task to the I/O thread to add or remove the email address from
62 // the set. 62 // the set.
63 void PostTaskToIOThread(bool add, const base::string16& email); 63 void PostTaskToIOThread(bool add, const base::string16& email);
64 64
65 // Updates the email set on the I/O thread. Protected for testing. 65 // Updates the email set on the I/O thread. Protected for testing.
66 void UpdateOnIOThread(bool add, const base::string16& email); 66 void UpdateOnIOThread(bool add, const base::string16& email);
67 67
68 EmailSet emails_; 68 EmailSet emails_;
69 69
70 // The set of SigninManagerBase instances that this instance is currently 70 // The set of SigninManagerBase instances that this instance is currently
71 // observing. Can only be accessed on the UI thread. 71 // observing. Can only be accessed on the UI thread.
72 std::set<SigninManagerBase*> observed_managers_; 72 std::set<SigninManagerBase*> observed_managers_;
73 bool resources_released_; 73 bool resources_released_;
74 74
75 DISALLOW_COPY_AND_ASSIGN(SigninNamesOnIOThread); 75 DISALLOW_COPY_AND_ASSIGN(SigninNamesOnIOThread);
76 }; 76 };
77 77
78 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_ 78 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698