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

Side by Side Diff: mojo/services/catalog/reader.h

Issue 1846953004: Reader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@60subdir
Patch Set: . Created 4 years, 8 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 | « mojo/services/catalog/factory.cc ('k') | mojo/services/catalog/reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SERVICES_CATALOG_READER_H_
6 #define MOJO_SERVICES_CATALOG_READER_H_
7
8 #include "base/files/file_path.h"
9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h"
12 #include "mojo/services/catalog/types.h"
13
14 namespace base {
15 class TaskRunner;
16 }
17
18 namespace catalog {
19
20 class Reader {
21 public:
22 Reader(EntryCache* entry_cache,
23 base::TaskRunner* file_task_runner,
24 const base::FilePath& package_dir,
25 const base::Closure& read_complete_closure);
26 ~Reader();
27
28 // Scans |package_dir_| and reads every manifest it finds within on
29 // |file_task_runner_|, populating |entry_cache_| on the calling thread. When
30 // the read operation is complete, runs |read_complete_closure_|.
31 void ReadAllManifests();
32
33 // Reads the manifest for |mojo_name|.
34 void ReadManifestForName(const std::string& mojo_name);
35
36 private:
37 EntryCache* entry_cache_;
38 scoped_refptr<base::TaskRunner> original_task_runner_;
39 base::TaskRunner* file_task_runner_;
40 base::FilePath package_dir_;
41 base::Closure read_complete_closure_;
42
43 base::WeakPtrFactory<Reader> weak_factory_;
44
45 DISALLOW_COPY_AND_ASSIGN(Reader);
46 };
47
48 } // namespace catalog
49
50 #endif // MOJO_SERVICES_CATALOG_READER_H_
OLDNEW
« no previous file with comments | « mojo/services/catalog/factory.cc ('k') | mojo/services/catalog/reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698