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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_external_update_validator.h

Issue 829583002: Validate hash_sha256 checksum on .crx update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix histogram value. Created 5 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
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 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATE_VALIDATOR_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATE_VALIDATOR_H_
6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATE_VALIDATOR_H_ 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATE_VALIDATOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 21 matching lines...) Expand all
32 protected: 32 protected:
33 virtual ~KioskExternalUpdateValidatorDelegate() {} 33 virtual ~KioskExternalUpdateValidatorDelegate() {}
34 }; 34 };
35 35
36 // Unpacks the crx file of the kiosk app and validates its signature. 36 // Unpacks the crx file of the kiosk app and validates its signature.
37 class KioskExternalUpdateValidator 37 class KioskExternalUpdateValidator
38 : public extensions::SandboxedUnpackerClient { 38 : public extensions::SandboxedUnpackerClient {
39 public: 39 public:
40 KioskExternalUpdateValidator( 40 KioskExternalUpdateValidator(
41 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner, 41 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner,
42 const std::string& app_id, 42 const extensions::CRXFileInfo& file,
43 const base::FilePath& crx_path,
44 const base::FilePath& crx_unpack_dir, 43 const base::FilePath& crx_unpack_dir,
45 const base::WeakPtr<KioskExternalUpdateValidatorDelegate>& delegate); 44 const base::WeakPtr<KioskExternalUpdateValidatorDelegate>& delegate);
46 45
47 // Starts validating the external crx file. 46 // Starts validating the external crx file.
48 void Start(); 47 void Start();
49 48
50 private: 49 private:
51 ~KioskExternalUpdateValidator() override; 50 ~KioskExternalUpdateValidator() override;
52 51
53 // SandboxedUnpackerClient overrides. 52 // SandboxedUnpackerClient overrides.
54 void OnUnpackFailure(const base::string16& error_message) override; 53 void OnUnpackFailure(const base::string16& error_message) override;
55 void OnUnpackSuccess(const base::FilePath& temp_dir, 54 void OnUnpackSuccess(const base::FilePath& temp_dir,
56 const base::FilePath& extension_dir, 55 const base::FilePath& extension_dir,
57 const base::DictionaryValue* original_manifest, 56 const base::DictionaryValue* original_manifest,
58 const extensions::Extension* extension, 57 const extensions::Extension* extension,
59 const SkBitmap& install_icon) override; 58 const SkBitmap& install_icon) override;
60 59
61 // Task runner for executing file I/O tasks. 60 // Task runner for executing file I/O tasks.
62 const scoped_refptr<base::SequencedTaskRunner> backend_task_runner_; 61 const scoped_refptr<base::SequencedTaskRunner> backend_task_runner_;
63 std::string app_id_;
64 62
65 // The directory where the external crx file resides. 63 // Information about the external crx file.
66 base::FilePath crx_dir_; 64 extensions::CRXFileInfo crx_file_;
65
67 // The temporary directory used by SandBoxedUnpacker for unpacking extensions. 66 // The temporary directory used by SandBoxedUnpacker for unpacking extensions.
68 const base::FilePath crx_unpack_dir_; 67 const base::FilePath crx_unpack_dir_;
69 68
70 base::WeakPtr<KioskExternalUpdateValidatorDelegate> delegate_; 69 base::WeakPtr<KioskExternalUpdateValidatorDelegate> delegate_;
71 70
72 DISALLOW_COPY_AND_ASSIGN(KioskExternalUpdateValidator); 71 DISALLOW_COPY_AND_ASSIGN(KioskExternalUpdateValidator);
73 }; 72 };
74 73
75 } // namespace chromeos 74 } // namespace chromeos
76 75
77 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATE_VALIDATOR_H_ 76 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATE_VALIDATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698