Roll PDFium 6f34355..bca779d
[chromium-blink-merge.git] / chrome / service / cloud_print / cloud_print_token_store.h
blob0a8e91a4cfc33dbe74166f5dd210937c8bd28235
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
3 // found in the LICENSE file.
5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_
6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_
8 #include <string>
9 #include "base/logging.h"
10 #include "base/threading/non_thread_safe.h"
12 // This class serves as the single repository for cloud print auth tokens. This
13 // is only used within the CloudPrintProxyCoreThread.
15 namespace cloud_print {
17 class CloudPrintTokenStore : public base::NonThreadSafe {
18 public:
19 // Returns the CloudPrintTokenStore instance for this thread. Will be NULL
20 // if no instance was created in this thread before.
21 static CloudPrintTokenStore* current();
23 CloudPrintTokenStore();
24 ~CloudPrintTokenStore();
26 void SetToken(const std::string& token);
27 std::string token() const {
28 DCHECK(CalledOnValidThread());
29 return token_;
32 private:
33 std::string token_;
35 DISALLOW_COPY_AND_ASSIGN(CloudPrintTokenStore);
38 } // namespace cloud_print
40 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_TOKEN_STORE_H_