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

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

Issue 12255041: Extension BaseFeatureProvider minor cleanups. Don't crash in release mode if we failed to parse a p… (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
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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 FeatureProvider* permission_features = 614 FeatureProvider* permission_features =
615 BaseFeatureProvider::GetPermissionFeatures(); 615 BaseFeatureProvider::GetPermissionFeatures();
616 for (APIPermissionSet::const_iterator it = api_permissions->begin(); 616 for (APIPermissionSet::const_iterator it = api_permissions->begin();
617 it != api_permissions->end(); ++it) { 617 it != api_permissions->end(); ++it) {
618 extensions::Feature* feature = 618 extensions::Feature* feature =
619 permission_features->GetFeature(it->name()); 619 permission_features->GetFeature(it->name());
620 620
621 // The feature should exist since we just got an APIPermission 621 // The feature should exist since we just got an APIPermission
622 // for it. The two systems should be updated together whenever a 622 // for it. The two systems should be updated together whenever a
623 // permission is added. 623 // permission is added.
624 CHECK(feature); 624 DCHECK(feature);
625 // This might happen if we have trouble loading the manifest files, but we
626 // don't want to crash the whole browser in release mode.
not at google - send to devlin 2013/02/15 16:33:34 Link to bug instead of this.
justinlin 2013/02/21 09:18:23 Done.
627 if (!feature)
628 continue;
625 629
626 Feature::Availability availability = 630 Feature::Availability availability =
627 feature->IsAvailableToManifest( 631 feature->IsAvailableToManifest(
628 id(), 632 id(),
629 GetType(), 633 GetType(),
630 Feature::ConvertLocation(location()), 634 Feature::ConvertLocation(location()),
631 manifest_version()); 635 manifest_version());
632 if (!availability.is_available()) { 636 if (!availability.is_available()) {
633 // Don't fail, but warn the developer that the manifest contains 637 // Don't fail, but warn the developer that the manifest contains
634 // unrecognized permissions. This may happen legitimately if the 638 // unrecognized permissions. This may happen legitimately if the
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after
2794 2798
2795 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 2799 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
2796 const Extension* extension, 2800 const Extension* extension,
2797 const PermissionSet* permissions, 2801 const PermissionSet* permissions,
2798 Reason reason) 2802 Reason reason)
2799 : reason(reason), 2803 : reason(reason),
2800 extension(extension), 2804 extension(extension),
2801 permissions(permissions) {} 2805 permissions(permissions) {}
2802 2806
2803 } // namespace extensions 2807 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698