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

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

Issue 666153002: Standardize usage of virtual/override/final in chrome/browser/extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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_SANDBOXED_UNPACKER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_SANDBOXED_UNPACKER_H_
6 #define CHROME_BROWSER_EXTENSIONS_SANDBOXED_UNPACKER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_SANDBOXED_UNPACKER_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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 INVALID_PATH_FOR_CATALOG, 147 INVALID_PATH_FOR_CATALOG,
148 ERROR_SERIALIZING_CATALOG, 148 ERROR_SERIALIZING_CATALOG,
149 ERROR_SAVING_CATALOG, 149 ERROR_SAVING_CATALOG,
150 150
151 NUM_FAILURE_REASONS 151 NUM_FAILURE_REASONS
152 }; 152 };
153 153
154 friend class ProcessHostClient; 154 friend class ProcessHostClient;
155 friend class SandboxedUnpackerTest; 155 friend class SandboxedUnpackerTest;
156 156
157 virtual ~SandboxedUnpacker(); 157 ~SandboxedUnpacker() override;
158 158
159 // Set |temp_dir_| as a temporary directory to unpack the extension in. 159 // Set |temp_dir_| as a temporary directory to unpack the extension in.
160 // Return true on success. 160 // Return true on success.
161 virtual bool CreateTempDirectory(); 161 virtual bool CreateTempDirectory();
162 162
163 // Validates the signature of the extension and extract the key to 163 // Validates the signature of the extension and extract the key to
164 // |public_key_|. Returns true if the signature validates, false otherwise. 164 // |public_key_|. Returns true if the signature validates, false otherwise.
165 // 165 //
166 // NOTE: Having this method here is a bit ugly. This code should really live 166 // NOTE: Having this method here is a bit ugly. This code should really live
167 // in extensions::Unpacker as it is not specific to sandboxed unpacking. It 167 // in extensions::Unpacker as it is not specific to sandboxed unpacking. It
168 // was put here because we cannot run windows crypto code in the sandbox. But 168 // was put here because we cannot run windows crypto code in the sandbox. But
169 // we could still have this method statically on extensions::Unpacker so that 169 // we could still have this method statically on extensions::Unpacker so that
170 // code just for unpacking is there and code just for sandboxing of unpacking 170 // code just for unpacking is there and code just for sandboxing of unpacking
171 // is here. 171 // is here.
172 bool ValidateSignature(); 172 bool ValidateSignature();
173 173
174 // Starts the utility process that unpacks our extension. 174 // Starts the utility process that unpacks our extension.
175 void StartProcessOnIOThread(const base::FilePath& temp_crx_path); 175 void StartProcessOnIOThread(const base::FilePath& temp_crx_path);
176 176
177 // UtilityProcessHostClient 177 // UtilityProcessHostClient
178 virtual bool OnMessageReceived(const IPC::Message& message) override; 178 bool OnMessageReceived(const IPC::Message& message) override;
179 virtual void OnProcessCrashed(int exit_code) override; 179 void OnProcessCrashed(int exit_code) override;
180 180
181 // IPC message handlers. 181 // IPC message handlers.
182 void OnUnpackExtensionSucceeded(const base::DictionaryValue& manifest); 182 void OnUnpackExtensionSucceeded(const base::DictionaryValue& manifest);
183 void OnUnpackExtensionFailed(const base::string16& error_message); 183 void OnUnpackExtensionFailed(const base::string16& error_message);
184 184
185 void ReportFailure(FailureReason reason, const base::string16& message); 185 void ReportFailure(FailureReason reason, const base::string16& message);
186 void ReportSuccess(const base::DictionaryValue& original_manifest, 186 void ReportSuccess(const base::DictionaryValue& original_manifest,
187 const SkBitmap& install_icon); 187 const SkBitmap& install_icon);
188 188
189 // Overwrites original manifest with safe result from utility process. 189 // Overwrites original manifest with safe result from utility process.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // when calling Extenion::Create() by the crx installer. 237 // when calling Extenion::Create() by the crx installer.
238 int creation_flags_; 238 int creation_flags_;
239 239
240 // Sequenced task runner where file I/O operations will be performed at. 240 // Sequenced task runner where file I/O operations will be performed at.
241 scoped_refptr<base::SequencedTaskRunner> unpacker_io_task_runner_; 241 scoped_refptr<base::SequencedTaskRunner> unpacker_io_task_runner_;
242 }; 242 };
243 243
244 } // namespace extensions 244 } // namespace extensions
245 245
246 #endif // CHROME_BROWSER_EXTENSIONS_SANDBOXED_UNPACKER_H_ 246 #endif // CHROME_BROWSER_EXTENSIONS_SANDBOXED_UNPACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698