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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/catalog/factory.cc ('k') | mojo/services/catalog/reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/catalog/reader.h
diff --git a/mojo/services/catalog/reader.h b/mojo/services/catalog/reader.h
new file mode 100644
index 0000000000000000000000000000000000000000..25bc410877fd60055b054be3c89a4681d4a90b56
--- /dev/null
+++ b/mojo/services/catalog/reader.h
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_CATALOG_READER_H_
+#define MOJO_SERVICES_CATALOG_READER_H_
+
+#include "base/files/file_path.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "mojo/services/catalog/types.h"
+
+namespace base {
+class TaskRunner;
+}
+
+namespace catalog {
+
+class Reader {
+ public:
+ Reader(EntryCache* entry_cache,
+ base::TaskRunner* file_task_runner,
+ const base::FilePath& package_dir,
+ const base::Closure& read_complete_closure);
+ ~Reader();
+
+ // Scans |package_dir_| and reads every manifest it finds within on
+ // |file_task_runner_|, populating |entry_cache_| on the calling thread. When
+ // the read operation is complete, runs |read_complete_closure_|.
+ void ReadAllManifests();
+
+ // Reads the manifest for |mojo_name|.
+ void ReadManifestForName(const std::string& mojo_name);
+
+ private:
+ EntryCache* entry_cache_;
+ scoped_refptr<base::TaskRunner> original_task_runner_;
+ base::TaskRunner* file_task_runner_;
+ base::FilePath package_dir_;
+ base::Closure read_complete_closure_;
+
+ base::WeakPtrFactory<Reader> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(Reader);
+};
+
+} // namespace catalog
+
+#endif // MOJO_SERVICES_CATALOG_READER_H_
« 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