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

Side by Side Diff: chrome/service/cloud_print/cloud_print_token_store.h

Issue 2916303002: ThreadChecker instead of SequenceChecker in classes that use TLS. (Closed)
Patch Set: fix compile Created 3 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
« no previous file with comments | « no previous file | chrome/service/cloud_print/cloud_print_token_store.cc » ('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) 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_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_ 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_
6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_ 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_
7 7
8 #include <string> 8 #include <string>
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/sequence_checker.h" 11 #include "base/threading/thread_checker.h"
12 12
13 // This class serves as the single repository for cloud print auth tokens. This 13 // This class serves as the single repository for cloud print auth tokens. This
14 // is only used within the CloudPrintProxyCoreThread. 14 // is only used within the CloudPrintProxyCoreThread.
15 15
16 namespace cloud_print { 16 namespace cloud_print {
17 17
18 class CloudPrintTokenStore { 18 class CloudPrintTokenStore {
19 public: 19 public:
20 // Returns the CloudPrintTokenStore instance for this thread. Will be NULL 20 // Returns the CloudPrintTokenStore instance for this thread. Will be NULL
21 // if no instance was created in this thread before. 21 // if no instance was created in this thread before.
22 static CloudPrintTokenStore* current(); 22 static CloudPrintTokenStore* current();
23 23
24 CloudPrintTokenStore(); 24 CloudPrintTokenStore();
25 ~CloudPrintTokenStore(); 25 ~CloudPrintTokenStore();
26 26
27 void SetToken(const std::string& token); 27 void SetToken(const std::string& token);
28 std::string token() const { 28 std::string token() const {
29 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 29 DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
30 return token_; 30 return token_;
31 } 31 }
32 32
33 private: 33 private:
34 std::string token_; 34 std::string token_;
35 35
36 SEQUENCE_CHECKER(sequence_checker_); 36 // Thread-affine per use of TLS in impl.
37 THREAD_CHECKER(thread_checker_);
37 38
38 DISALLOW_COPY_AND_ASSIGN(CloudPrintTokenStore); 39 DISALLOW_COPY_AND_ASSIGN(CloudPrintTokenStore);
39 }; 40 };
40 41
41 } // namespace cloud_print 42 } // namespace cloud_print
42 43
43 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_ 44 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/service/cloud_print/cloud_print_token_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698