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

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

Issue 1828803002: Simplify resolve. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@61catalog
Patch Set: . Created 4 years, 9 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/callback.h"
9 #include "base/files/file_path.h"
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "base/values.h"
14
15 namespace base {
16 class TaskRunner;
17 }
18
19 namespace catalog {
20
21 class Entry;
22
23 // Encapsulates manifest reading.
24 class Reader {
25 public:
26 using ReadManifestCallback =
27 base::Callback<void(scoped_ptr<Entry> entry)>;
28
29 // Loads manifests relative to |package_path|. Performs file operations on
30 // |file_task_runner|.
31 Reader(const base::FilePath& package_path,
32 base::TaskRunner* file_task_runner);
33 ~Reader();
34
35 // Attempts to load a manifest for |name|, and returns an Entry built from the
36 // metadata it contains via |callback|.
37 void Read(const std::string& name,
38 const ReadManifestCallback& callback);
39
40 private:
41 // Construct a manifest path for the application named |name| within
42 // |package_path_|.
43 base::FilePath GetManifestPath(const std::string& name) const;
44
45 base::FilePath package_path_;
46 base::TaskRunner* file_task_runner_;
47 base::WeakPtrFactory<Reader> weak_factory_;
48
49 DISALLOW_COPY_AND_ASSIGN(Reader);
50 };
51
52 } // namespace catalog
53
54 #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