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

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

Issue 573113002: Relax shared module whitelist restriction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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 | chrome/browser/extensions/shared_module_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shared_module_service.h" 5 #include "chrome/browser/extensions/shared_module_service.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/version.h" 10 #include "base/version.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 ExtensionRegistry::EVERYTHING); 54 ExtensionRegistry::EVERYTHING);
55 if (!imported_module) { 55 if (!imported_module) {
56 if (extension->from_webstore()) { 56 if (extension->from_webstore()) {
57 status = IMPORT_STATUS_UNSATISFIED; 57 status = IMPORT_STATUS_UNSATISFIED;
58 missing_modules->push_back(*iter); 58 missing_modules->push_back(*iter);
59 } else { 59 } else {
60 return IMPORT_STATUS_UNRECOVERABLE; 60 return IMPORT_STATUS_UNRECOVERABLE;
61 } 61 }
62 } else if (!SharedModuleInfo::IsSharedModule(imported_module)) { 62 } else if (!SharedModuleInfo::IsSharedModule(imported_module)) {
63 return IMPORT_STATUS_UNRECOVERABLE; 63 return IMPORT_STATUS_UNRECOVERABLE;
64 } else if (!SharedModuleInfo::IsExportAllowedByWhitelist(imported_module,
65 extension->id())) {
66 return IMPORT_STATUS_UNRECOVERABLE;
67 } else if (version_required.IsValid() && 64 } else if (version_required.IsValid() &&
68 imported_module->version()->CompareTo(version_required) < 0) { 65 imported_module->version()->CompareTo(version_required) < 0) {
69 if (imported_module->from_webstore()) { 66 if (imported_module->from_webstore()) {
70 outdated_modules->push_back(*iter); 67 outdated_modules->push_back(*iter);
71 status = IMPORT_STATUS_UNSATISFIED; 68 status = IMPORT_STATUS_UNSATISFIED;
72 } else { 69 } else {
73 return IMPORT_STATUS_UNRECOVERABLE; 70 return IMPORT_STATUS_UNRECOVERABLE;
74 } 71 }
75 } 72 }
76 } 73 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 179 }
183 180
184 void SharedModuleService::OnExtensionUninstalled( 181 void SharedModuleService::OnExtensionUninstalled(
185 content::BrowserContext* browser_context, 182 content::BrowserContext* browser_context,
186 const Extension* extension, 183 const Extension* extension,
187 extensions::UninstallReason reason) { 184 extensions::UninstallReason reason) {
188 PruneSharedModules(); 185 PruneSharedModules();
189 } 186 }
190 187
191 } // namespace extensions 188 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/shared_module_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698