OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ |
6 #define GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "google_apis/gcm/base/gcm_export.h" | 11 #include "google_apis/gcm/base/gcm_export.h" |
12 #include "google_apis/gcm/engine/gcm_store.h" | 12 #include "google_apis/gcm/engine/gcm_store.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class FilePath; | 15 class FilePath; |
16 class SequencedTaskRunner; | 16 class SequencedTaskRunner; |
17 } // namespace base | 17 } // namespace base |
18 | 18 |
19 namespace gcm { | 19 namespace gcm { |
20 | 20 |
| 21 class Encryptor; |
| 22 |
21 // An implementation of GCM Store that uses LevelDB for persistence. | 23 // An implementation of GCM Store that uses LevelDB for persistence. |
22 // It performs all blocking operations on the blocking task runner, and posts | 24 // It performs all blocking operations on the blocking task runner, and posts |
23 // all callbacks to the thread on which the GCMStoreImpl is created. | 25 // all callbacks to the thread on which the GCMStoreImpl is created. |
24 class GCM_EXPORT GCMStoreImpl : public GCMStore { | 26 class GCM_EXPORT GCMStoreImpl : public GCMStore { |
25 public: | 27 public: |
26 GCMStoreImpl(const base::FilePath& path, | 28 GCMStoreImpl(const base::FilePath& path, |
27 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); | 29 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner, |
| 30 scoped_ptr<Encryptor> encryptor); |
28 virtual ~GCMStoreImpl(); | 31 virtual ~GCMStoreImpl(); |
29 | 32 |
30 // Load the directory and pass the initial state back to caller. | 33 // Load the directory and pass the initial state back to caller. |
31 virtual void Load(const LoadCallback& callback) OVERRIDE; | 34 virtual void Load(const LoadCallback& callback) OVERRIDE; |
32 | 35 |
33 // Closes the GCM store. | 36 // Closes the GCM store. |
34 virtual void Close() OVERRIDE; | 37 virtual void Close() OVERRIDE; |
35 | 38 |
36 // Clears the GCM store of all data and destroys any LevelDB files associated | 39 // Clears the GCM store of all data and destroys any LevelDB files associated |
37 // with this store. | 40 // with this store. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 117 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
115 | 118 |
116 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; | 119 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; |
117 | 120 |
118 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); | 121 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); |
119 }; | 122 }; |
120 | 123 |
121 } // namespace gcm | 124 } // namespace gcm |
122 | 125 |
123 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ | 126 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ |
OLD | NEW |