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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 12326054: *Not* allow extension features if json file fails to load (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« 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 (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 "chrome/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 for (APIPermissionSet::const_iterator it = api_permissions->begin(); 596 for (APIPermissionSet::const_iterator it = api_permissions->begin();
597 it != api_permissions->end(); ++it) { 597 it != api_permissions->end(); ++it) {
598 extensions::Feature* feature = 598 extensions::Feature* feature =
599 permission_features->GetFeature(it->name()); 599 permission_features->GetFeature(it->name());
600 600
601 // The feature should exist since we just got an APIPermission 601 // The feature should exist since we just got an APIPermission
602 // for it. The two systems should be updated together whenever a 602 // for it. The two systems should be updated together whenever a
603 // permission is added. 603 // permission is added.
604 DCHECK(feature); 604 DCHECK(feature);
605 // http://crbug.com/176381 605 // http://crbug.com/176381
606 if (!feature) 606 if (!feature) {
607 to_remove.push_back(it->id());
607 continue; 608 continue;
609 }
608 610
609 Feature::Availability availability = 611 Feature::Availability availability =
610 feature->IsAvailableToManifest( 612 feature->IsAvailableToManifest(
611 id(), 613 id(),
612 GetType(), 614 GetType(),
613 Feature::ConvertLocation(location()), 615 Feature::ConvertLocation(location()),
614 manifest_version()); 616 manifest_version());
615 if (!availability.is_available()) { 617 if (!availability.is_available()) {
616 // Don't fail, but warn the developer that the manifest contains 618 // Don't fail, but warn the developer that the manifest contains
617 // unrecognized permissions. This may happen legitimately if the 619 // unrecognized permissions. This may happen legitimately if the
(...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2730 2732
2731 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 2733 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
2732 const Extension* extension, 2734 const Extension* extension,
2733 const PermissionSet* permissions, 2735 const PermissionSet* permissions,
2734 Reason reason) 2736 Reason reason)
2735 : reason(reason), 2737 : reason(reason),
2736 extension(extension), 2738 extension(extension),
2737 permissions(permissions) {} 2739 permissions(permissions) {}
2738 2740
2739 } // namespace extensions 2741 } // namespace extensions
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