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

Side by Side Diff: extensions/common/manifest_handler.cc

Issue 2831183003: Fix loading success.html at the end of chrome://chrome-signin flow (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "extensions/common/manifest_handler.h" 5 #include "extensions/common/manifest_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 void ManifestHandlerRegistry::RegisterManifestHandler( 126 void ManifestHandlerRegistry::RegisterManifestHandler(
127 const std::string& key, linked_ptr<ManifestHandler> handler) { 127 const std::string& key, linked_ptr<ManifestHandler> handler) {
128 CHECK(!is_finalized_); 128 CHECK(!is_finalized_);
129 handlers_[key] = handler; 129 handlers_[key] = handler;
130 } 130 }
131 131
132 bool ManifestHandlerRegistry::ParseExtension(Extension* extension, 132 bool ManifestHandlerRegistry::ParseExtension(Extension* extension,
133 base::string16* error) { 133 base::string16* error) {
134 LOG(ERROR) << "ParseExtension " << extension->id();
134 std::map<int, ManifestHandler*> handlers_by_priority; 135 std::map<int, ManifestHandler*> handlers_by_priority;
135 for (ManifestHandlerMap::iterator iter = handlers_.begin(); 136 for (ManifestHandlerMap::iterator iter = handlers_.begin();
136 iter != handlers_.end(); ++iter) { 137 iter != handlers_.end(); ++iter) {
137 ManifestHandler* handler = iter->second.get(); 138 ManifestHandler* handler = iter->second.get();
138 if (extension->manifest()->HasPath(iter->first) || 139 if (extension->manifest()->HasPath(iter->first) ||
139 handler->AlwaysParseForType(extension->GetType())) { 140 handler->AlwaysParseForType(extension->GetType())) {
141 LOG(ERROR) << "ParseExtension " << extension->id() << " using handler "
142 << iter->first;
140 handlers_by_priority[priority_map_[handler]] = handler; 143 handlers_by_priority[priority_map_[handler]] = handler;
144 } else {
145 LOG(ERROR) << "ParseExtension " << extension->id() << " skip handler "
146 << iter->first;
141 } 147 }
142 } 148 }
143 for (std::map<int, ManifestHandler*>::iterator iter = 149 for (std::map<int, ManifestHandler*>::iterator iter =
144 handlers_by_priority.begin(); 150 handlers_by_priority.begin();
145 iter != handlers_by_priority.end(); ++iter) { 151 iter != handlers_by_priority.end(); ++iter) {
146 if (!(iter->second)->Parse(extension, error)) 152 if (!(iter->second)->Parse(extension, error))
147 return false; 153 return false;
148 } 154 }
149 return true; 155 return true;
150 } 156 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 unsorted_handlers.swap(next_unsorted_handlers); 249 unsorted_handlers.swap(next_unsorted_handlers);
244 } 250 }
245 251
246 // If there are any leftover unsorted handlers, they must have had 252 // If there are any leftover unsorted handlers, they must have had
247 // circular dependencies. 253 // circular dependencies.
248 CHECK_EQ(unsorted_handlers.size(), std::set<ManifestHandler*>::size_type(0)) 254 CHECK_EQ(unsorted_handlers.size(), std::set<ManifestHandler*>::size_type(0))
249 << "Extension manifest handlers have circular dependencies!"; 255 << "Extension manifest handlers have circular dependencies!";
250 } 256 }
251 257
252 } // namespace extensions 258 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/url_request_util.cc ('k') | extensions/common/manifest_handlers/webview_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698