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

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

Issue 11360151: Move common cloud print methods from service/cloud_print to common/cloud_print. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 #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"
10 #include "base/threading/non_thread_safe.h"
9 11
10 // This class serves as the single repository for cloud print auth tokens. This 12 // This class serves as the single repository for cloud print auth tokens. This
11 // is only used within the CloudPrintProxyCoreThread. 13 // is only used within the CloudPrintProxyCoreThread.
12 14
13 #include "base/logging.h" 15 namespace cloud_print {
14 #include "base/threading/non_thread_safe.h"
15 16
16 class CloudPrintTokenStore : public base::NonThreadSafe { 17 class CloudPrintTokenStore : public base::NonThreadSafe {
17 public: 18 public:
18 // Returns the CloudPrintTokenStore instance for this thread. Will be NULL 19 // Returns the CloudPrintTokenStore instance for this thread. Will be NULL
19 // if no instance was created in this thread before. 20 // if no instance was created in this thread before.
20 static CloudPrintTokenStore* current(); 21 static CloudPrintTokenStore* current();
21 22
22 CloudPrintTokenStore(); 23 CloudPrintTokenStore();
23 ~CloudPrintTokenStore(); 24 ~CloudPrintTokenStore();
24 25
25 void SetToken(const std::string& token); 26 void SetToken(const std::string& token);
26 std::string token() const { 27 std::string token() const {
27 DCHECK(CalledOnValidThread()); 28 DCHECK(CalledOnValidThread());
28 return token_; 29 return token_;
29 } 30 }
30 31
31 private: 32 private:
32 std::string token_; 33 std::string token_;
33 34
34 DISALLOW_COPY_AND_ASSIGN(CloudPrintTokenStore); 35 DISALLOW_COPY_AND_ASSIGN(CloudPrintTokenStore);
35 }; 36 };
36 37
38 } // namespace cloud_print
39
37 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_ 40 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_
OLDNEW
« no previous file with comments | « chrome/service/cloud_print/cloud_print_proxy_backend.cc ('k') | chrome/service/cloud_print/cloud_print_token_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698