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 // An implementation of GCM Store that uses LevelDB for persistence. | 21 // An implementation of GCM Store that uses LevelDB for persistence. |
22 // It performs all blocking operations on the blocking task runner, and posts | 22 // It performs all blocking operations on the blocking task runner, and posts |
23 // all callbacks to the thread on which the GCMStoreImpl is created. | 23 // all callbacks to the thread on which the GCMStoreImpl is created. |
24 class GCM_EXPORT GCMStoreImpl : public GCMStore { | 24 class GCM_EXPORT GCMStoreImpl : public GCMStore { |
25 public: | 25 public: |
26 GCMStoreImpl(const base::FilePath& path, | 26 GCMStoreImpl(bool use_mock_keychain, |
| 27 const base::FilePath& path, |
27 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); | 28 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); |
28 virtual ~GCMStoreImpl(); | 29 virtual ~GCMStoreImpl(); |
29 | 30 |
30 // Load the directory and pass the initial state back to caller. | 31 // Load the directory and pass the initial state back to caller. |
31 virtual void Load(const LoadCallback& callback) OVERRIDE; | 32 virtual void Load(const LoadCallback& callback) OVERRIDE; |
32 | 33 |
33 // Closes the GCM store. | 34 // Closes the GCM store. |
34 virtual void Close() OVERRIDE; | 35 virtual void Close() OVERRIDE; |
35 | 36 |
36 // Clears the GCM store of all data and destroys any LevelDB files associated | 37 // Clears the GCM store of all data and destroys any LevelDB files associated |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 109 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
109 | 110 |
110 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; | 111 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; |
111 | 112 |
112 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); | 113 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); |
113 }; | 114 }; |
114 | 115 |
115 } // namespace gcm | 116 } // namespace gcm |
116 | 117 |
117 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ | 118 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ |
OLD | NEW |