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(bool use_mock_keychain, | 26 GCMStoreImpl(const base::FilePath& path, |
27 const base::FilePath& path, | |
28 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); | 27 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); |
29 virtual ~GCMStoreImpl(); | 28 virtual ~GCMStoreImpl(); |
30 | 29 |
31 // Load the directory and pass the initial state back to caller. | 30 // Load the directory and pass the initial state back to caller. |
32 virtual void Load(const LoadCallback& callback) OVERRIDE; | 31 virtual void Load(const LoadCallback& callback) OVERRIDE; |
33 | 32 |
34 // Closes the GCM store. | 33 // Closes the GCM store. |
35 virtual void Close() OVERRIDE; | 34 virtual void Close() OVERRIDE; |
36 | 35 |
37 // Clears the GCM store of all data and destroys any LevelDB files associated | 36 // 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... |
109 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 108 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
110 | 109 |
111 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; | 110 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; |
112 | 111 |
113 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); | 112 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); |
114 }; | 113 }; |
115 | 114 |
116 } // namespace gcm | 115 } // namespace gcm |
117 | 116 |
118 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ | 117 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ |
OLD | NEW |