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

Side by Side Diff: chrome/browser/extensions/extension_service.h

Issue 829583002: Validate hash_sha256 checksum on .crx update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add histogram description. Created 5 years, 11 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // the install can be started. Sets |out_crx_installer| to the installer if 80 // the install can be started. Sets |out_crx_installer| to the installer if
81 // one was started. 81 // one was started.
82 // TODO(aa): This method can be removed. ExtensionUpdater could use 82 // TODO(aa): This method can be removed. ExtensionUpdater could use
83 // CrxInstaller directly instead. 83 // CrxInstaller directly instead.
84 virtual bool UpdateExtension( 84 virtual bool UpdateExtension(
85 const std::string& id, 85 const std::string& id,
86 const base::FilePath& path, 86 const base::FilePath& path,
87 bool file_ownership_passed, 87 bool file_ownership_passed,
88 extensions::CrxInstaller** out_crx_installer) = 0; 88 extensions::CrxInstaller** out_crx_installer) = 0;
89 89
90 // Same as above, but checks .crx file hash sum as well.
91 virtual bool CheckAndUpdateExtension(
92 const std::string& id,
93 const base::FilePath& path,
94 const std::string& hash,
95 bool file_ownership_passed,
96 extensions::CrxInstaller** out_crx_installer) = 0;
97
90 // DEPRECATED. Use ExtensionRegistry instead. 98 // DEPRECATED. Use ExtensionRegistry instead.
91 // 99 //
92 // Looks up an extension by its ID. 100 // Looks up an extension by its ID.
93 // 101 //
94 // If |include_disabled| is false then this will only include enabled 102 // If |include_disabled| is false then this will only include enabled
95 // extensions. Use instead: 103 // extensions. Use instead:
96 // 104 //
97 // ExtensionRegistry::enabled_extensions().GetByID(id). 105 // ExtensionRegistry::enabled_extensions().GetByID(id).
98 // 106 //
99 // If |include_disabled| is true then this will also include disabled and 107 // If |include_disabled| is true then this will also include disabled and
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 extensions::PendingExtensionManager* pending_extension_manager() override; 211 extensions::PendingExtensionManager* pending_extension_manager() override;
204 const extensions::Extension* GetExtensionById( 212 const extensions::Extension* GetExtensionById(
205 const std::string& id, 213 const std::string& id,
206 bool include_disabled) const override; 214 bool include_disabled) const override;
207 const extensions::Extension* GetInstalledExtension( 215 const extensions::Extension* GetInstalledExtension(
208 const std::string& id) const override; 216 const std::string& id) const override;
209 bool UpdateExtension(const std::string& id, 217 bool UpdateExtension(const std::string& id,
210 const base::FilePath& extension_path, 218 const base::FilePath& extension_path,
211 bool file_ownership_passed, 219 bool file_ownership_passed,
212 extensions::CrxInstaller** out_crx_installer) override; 220 extensions::CrxInstaller** out_crx_installer) override;
221 bool CheckAndUpdateExtension(
222 const std::string& id,
223 const base::FilePath& extension_path,
224 const std::string& package_hash,
225 bool file_ownership_passed,
226 extensions::CrxInstaller** out_crx_installer) override;
213 bool IsExtensionEnabled(const std::string& extension_id) const override; 227 bool IsExtensionEnabled(const std::string& extension_id) const override;
214 void UnloadExtension( 228 void UnloadExtension(
215 const std::string& extension_id, 229 const std::string& extension_id,
216 extensions::UnloadedExtensionInfo::Reason reason) override; 230 extensions::UnloadedExtensionInfo::Reason reason) override;
217 void RemoveComponentExtension(const std::string& extension_id) override; 231 void RemoveComponentExtension(const std::string& extension_id) override;
218 void AddExtension(const extensions::Extension* extension) override; 232 void AddExtension(const extensions::Extension* extension) override;
219 void AddComponentExtension(const extensions::Extension* extension) override; 233 void AddComponentExtension(const extensions::Extension* extension) override;
220 const extensions::Extension* GetPendingExtensionUpdate( 234 const extensions::Extension* GetPendingExtensionUpdate(
221 const std::string& extension_id) const override; 235 const std::string& extension_id) const override;
222 void FinishDelayedInstallation(const std::string& extension_id) override; 236 void FinishDelayedInstallation(const std::string& extension_id) override;
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 GreylistUnknownDontChange); 765 GreylistUnknownDontChange);
752 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 766 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
753 ManagementPolicyProhibitsEnableOnInstalled); 767 ManagementPolicyProhibitsEnableOnInstalled);
754 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 768 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
755 BlockAndUnblockBlacklistedExtension); 769 BlockAndUnblockBlacklistedExtension);
756 770
757 DISALLOW_COPY_AND_ASSIGN(ExtensionService); 771 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
758 }; 772 };
759 773
760 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 774 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698