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

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

Issue 2284843002: Fix nullptr dereference in service catalog (Closed)
Patch Set: Created 4 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 | 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 Reader::Reader(ManifestProvider* manifest_provider) 202 Reader::Reader(ManifestProvider* manifest_provider)
203 : manifest_provider_(manifest_provider), weak_factory_(this) { 203 : manifest_provider_(manifest_provider), weak_factory_(this) {
204 PathService::Get(base::DIR_MODULE, &system_package_dir_); 204 PathService::Get(base::DIR_MODULE, &system_package_dir_);
205 } 205 }
206 206
207 void Reader::OnReadManifest( 207 void Reader::OnReadManifest(
208 EntryCache* cache, 208 EntryCache* cache,
209 const CreateEntryForNameCallback& entry_created_callback, 209 const CreateEntryForNameCallback& entry_created_callback,
210 std::unique_ptr<Entry> entry) { 210 std::unique_ptr<Entry> entry) {
211 if (!entry)
212 return;
211 shell::mojom::ResolveResultPtr result = 213 shell::mojom::ResolveResultPtr result =
212 shell::mojom::ResolveResult::From(*entry); 214 shell::mojom::ResolveResult::From(*entry);
213 AddEntryToCache(cache, std::move(entry)); 215 AddEntryToCache(cache, std::move(entry));
214 entry_created_callback.Run(std::move(result)); 216 entry_created_callback.Run(std::move(result));
215 } 217 }
216 218
217 } // namespace catalog 219 } // 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