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

Side by Side Diff: components/leveldb_proto/proto_database_impl.h

Issue 593113002: Reusing the base::StringPairs in src/components/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | components/policy/core/common/cloud/device_management_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_ 5 #ifndef COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_
6 #define COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_ 6 #define COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "base/sequenced_task_runner.h" 15 #include "base/sequenced_task_runner.h"
16 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "base/threading/sequenced_worker_pool.h" 17 #include "base/threading/sequenced_worker_pool.h"
18 #include "base/threading/thread_checker.h" 18 #include "base/threading/thread_checker.h"
19 #include "base/strings/string_split.h"
19 #include "components/leveldb_proto/leveldb_database.h" 20 #include "components/leveldb_proto/leveldb_database.h"
20 #include "components/leveldb_proto/proto_database.h" 21 #include "components/leveldb_proto/proto_database.h"
21 22
22 namespace leveldb_proto { 23 namespace leveldb_proto {
23 24
24 typedef std::vector<std::pair<std::string, std::string> > KeyValueVector; 25 typedef base::StringPairs KeyValueVector;
25 typedef std::vector<std::string> KeyVector; 26 typedef std::vector<std::string> KeyVector;
26 27
27 // When the ProtoDatabaseImpl instance is deleted, in-progress asynchronous 28 // When the ProtoDatabaseImpl instance is deleted, in-progress asynchronous
28 // operations will be completed and the corresponding callbacks will be called. 29 // operations will be completed and the corresponding callbacks will be called.
29 // Construction/calls/destruction should all happen on the same thread. 30 // Construction/calls/destruction should all happen on the same thread.
30 template <typename T> 31 template <typename T>
31 class ProtoDatabaseImpl : public ProtoDatabase<T> { 32 class ProtoDatabaseImpl : public ProtoDatabase<T> {
32 public: 33 public:
33 // All blocking calls/disk access will happen on the provided |task_runner|. 34 // All blocking calls/disk access will happen on the provided |task_runner|.
34 explicit ProtoDatabaseImpl( 35 explicit ProtoDatabaseImpl(
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 task_runner_->PostTaskAndReply( 196 task_runner_->PostTaskAndReply(
196 FROM_HERE, base::Bind(LoadEntriesFromTaskRunner<T>, 197 FROM_HERE, base::Bind(LoadEntriesFromTaskRunner<T>,
197 base::Unretained(db_.get()), entries_ptr, success), 198 base::Unretained(db_.get()), entries_ptr, success),
198 base::Bind(RunLoadCallback<T>, callback, base::Owned(success), 199 base::Bind(RunLoadCallback<T>, callback, base::Owned(success),
199 base::Passed(&entries))); 200 base::Passed(&entries)));
200 } 201 }
201 202
202 } // namespace leveldb_proto 203 } // namespace leveldb_proto
203 204
204 #endif // COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_ 205 #endif // COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | components/policy/core/common/cloud/device_management_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698