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

Side by Side Diff: services/catalog/reader.cc

Issue 1982553002: Fix manifest loading for catalog and shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client2
Patch Set: Created 4 years, 7 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #include "services/catalog/reader.h" 5 #include "services/catalog/reader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_enumerator.h" 8 #include "base/files/file_enumerator.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 base::FilePath manifest_path = path.AppendASCII("manifest.json"); 100 base::FilePath manifest_path = path.AppendASCII("manifest.json");
101 std::unique_ptr<Entry> entry = 101 std::unique_ptr<Entry> entry =
102 CreateEntryForManifestAt(manifest_path, package_dir); 102 CreateEntryForManifestAt(manifest_path, package_dir);
103 if (!entry) 103 if (!entry)
104 continue; 104 continue;
105 105
106 // Skip over subdirs that contain only manifests, they're artifacts of the 106 // Skip over subdirs that contain only manifests, they're artifacts of the
107 // build (e.g. for applications that are packaged into others) and are not 107 // build (e.g. for applications that are packaged into others) and are not
108 // valid standalone packages. 108 // valid standalone packages.
109 base::FilePath package_path = GetPackagePath(package_dir, entry->name()); 109 base::FilePath package_path = GetPackagePath(package_dir, entry->name());
110 if (!base::PathExists(package_path)) 110 if (entry->name() != "mojo:shell" && entry->name() != "mojo:catalog" &&
111 !base::PathExists(package_path)) {
111 continue; 112 continue;
113 }
112 114
113 original_thread_task_runner->PostTask( 115 original_thread_task_runner->PostTask(
114 FROM_HERE, 116 FROM_HERE,
115 base::Bind(read_manifest_callback, base::Passed(&entry))); 117 base::Bind(read_manifest_callback, base::Passed(&entry)));
116 } 118 }
117 119
118 original_thread_task_runner->PostTask(FROM_HERE, read_complete_closure); 120 original_thread_task_runner->PostTask(FROM_HERE, read_complete_closure);
119 } 121 }
120 122
121 std::unique_ptr<Entry> ReadManifest(const base::FilePath& package_dir, 123 std::unique_ptr<Entry> ReadManifest(const base::FilePath& package_dir,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 EntryCache* cache, 207 EntryCache* cache,
206 const CreateEntryForNameCallback& entry_created_callback, 208 const CreateEntryForNameCallback& entry_created_callback,
207 std::unique_ptr<Entry> entry) { 209 std::unique_ptr<Entry> entry) {
208 shell::mojom::ResolveResultPtr result = 210 shell::mojom::ResolveResultPtr result =
209 shell::mojom::ResolveResult::From(*entry); 211 shell::mojom::ResolveResult::From(*entry);
210 AddEntryToCache(cache, std::move(entry)); 212 AddEntryToCache(cache, std::move(entry));
211 entry_created_callback.Run(std::move(result)); 213 entry_created_callback.Run(std::move(result));
212 } 214 }
213 215
214 } // namespace catalog 216 } // namespace catalog
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698