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

Side by Side Diff: components/sync/core/model_type_store_backend.h

Issue 2389063002: [Sync] Fixing easy lint violations. (Closed)
Patch Set: Updated for Max's comments. Created 4 years, 2 months 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_SYNC_CORE_MODEL_TYPE_STORE_BACKEND_H_ 5 #ifndef COMPONENTS_SYNC_CORE_MODEL_TYPE_STORE_BACKEND_H_
6 #define COMPONENTS_SYNC_CORE_MODEL_TYPE_STORE_BACKEND_H_ 6 #define COMPONENTS_SYNC_CORE_MODEL_TYPE_STORE_BACKEND_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <unordered_map> 10 #include <unordered_map>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 ModelTypeStore::RecordList* record_list); 60 ModelTypeStore::RecordList* record_list);
61 61
62 // Writes modifications accumulated in |write_batch| to database. 62 // Writes modifications accumulated in |write_batch| to database.
63 ModelTypeStore::Result WriteModifications( 63 ModelTypeStore::Result WriteModifications(
64 std::unique_ptr<leveldb::WriteBatch> write_batch); 64 std::unique_ptr<leveldb::WriteBatch> write_batch);
65 65
66 private: 66 private:
67 friend class base::RefCountedThreadSafe<ModelTypeStoreBackend>; 67 friend class base::RefCountedThreadSafe<ModelTypeStoreBackend>;
68 friend class ModelTypeStoreBackendTest; 68 friend class ModelTypeStoreBackendTest;
69 69
70 ModelTypeStoreBackend(const std::string& path); 70 explicit ModelTypeStoreBackend(const std::string& path);
71 ~ModelTypeStoreBackend(); 71 ~ModelTypeStoreBackend();
72 72
73 // In some scenarios ModelTypeStoreBackend holds ownership of env. Typical 73 // In some scenarios ModelTypeStoreBackend holds ownership of env. Typical
74 // example is when test creates in memory environment with CreateInMemoryEnv 74 // example is when test creates in memory environment with CreateInMemoryEnv
75 // and wants it to be destroyed along with backend. This is achieved by 75 // and wants it to be destroyed along with backend. This is achieved by
76 // passing ownership of env to TakeEnvOwnership function. 76 // passing ownership of env to TakeEnvOwnership function.
77 // 77 //
78 // env_ declaration should appear before declaration of db_ because 78 // env_ declaration should appear before declaration of db_ because
79 // environment object should still be valid when db_'s destructor is called. 79 // environment object should still be valid when db_'s destructor is called.
80 std::unique_ptr<leveldb::Env> env_; 80 std::unique_ptr<leveldb::Env> env_;
(...skipping 18 matching lines...) Expand all
99 99
100 // Macro wrapped mutex to guard against concurrent calls in debug builds. 100 // Macro wrapped mutex to guard against concurrent calls in debug builds.
101 DFAKE_MUTEX(push_pop_); 101 DFAKE_MUTEX(push_pop_);
102 102
103 DISALLOW_COPY_AND_ASSIGN(ModelTypeStoreBackend); 103 DISALLOW_COPY_AND_ASSIGN(ModelTypeStoreBackend);
104 }; 104 };
105 105
106 } // namespace syncer 106 } // namespace syncer
107 107
108 #endif // COMPONENTS_SYNC_CORE_MODEL_TYPE_STORE_BACKEND_H_ 108 #endif // COMPONENTS_SYNC_CORE_MODEL_TYPE_STORE_BACKEND_H_
OLDNEW
« no previous file with comments | « components/sync/core/internal_components_factory_impl.h ('k') | components/sync/core/model_type_store_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698