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

Side by Side Diff: chrome/browser/extensions/extension_info_map.cc

Issue 8789018: Revert 113047 - Make ExtensionService use ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | Annotate | Revision Log
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_info_map.h" 5 #include "chrome/browser/extensions/extension_info_map.h"
6 6
7 #include "chrome/common/extensions/extension.h" 7 #include "chrome/common/extensions/extension.h"
8 #include "chrome/common/extensions/extension_set.h" 8 #include "chrome/common/extensions/extension_set.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 bool ExtensionInfoMap::SecurityOriginHasAPIPermission( 132 bool ExtensionInfoMap::SecurityOriginHasAPIPermission(
133 const GURL& origin, int process_id, 133 const GURL& origin, int process_id,
134 ExtensionAPIPermission::ID permission) const { 134 ExtensionAPIPermission::ID permission) const {
135 if (origin.SchemeIs(chrome::kExtensionScheme)) { 135 if (origin.SchemeIs(chrome::kExtensionScheme)) {
136 const std::string& id = origin.host(); 136 const std::string& id = origin.host();
137 return extensions_.GetByID(id)->HasAPIPermission(permission) && 137 return extensions_.GetByID(id)->HasAPIPermission(permission) &&
138 process_map_.Contains(id, process_id); 138 process_map_.Contains(id, process_id);
139 } 139 }
140 140
141 ExtensionSet::const_iterator i = extensions_.begin(); 141 ExtensionSet::ExtensionMap::const_iterator i = extensions_.begin();
142 for (; i != extensions_.end(); ++i) { 142 for (; i != extensions_.end(); ++i) {
143 if ((*i)->web_extent().MatchesSecurityOrigin(origin) && 143 if (i->second->web_extent().MatchesSecurityOrigin(origin) &&
144 process_map_.Contains((*i)->id(), process_id) && 144 process_map_.Contains(i->first, process_id) &&
145 (*i)->HasAPIPermission(permission)) { 145 i->second->HasAPIPermission(permission)) {
146 return true; 146 return true;
147 } 147 }
148 } 148 }
149 return false; 149 return false;
150 } 150 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_file_browser_private_api.cc ('k') | chrome/browser/extensions/extension_management_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698