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

Unified Diff: chrome/browser/extensions/extension_creator.cc

Issue 2874503002: Refactor CRX verification in preparation to support CRX₃ files. (Closed)
Patch Set: No subclass Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/crx_file/BUILD.gn » ('j') | components/crx_file/crx2_file.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_creator.cc
diff --git a/chrome/browser/extensions/extension_creator.cc b/chrome/browser/extensions/extension_creator.cc
index 5255007a76c2212de59fd907c8a73c8a6fd35881..0dc0621acfbb7d1b4487b31058b5e290c9f00e3a 100644
--- a/chrome/browser/extensions/extension_creator.cc
+++ b/chrome/browser/extensions/extension_creator.cc
@@ -17,7 +17,7 @@
#include "base/strings/string_util.h"
#include "chrome/browser/extensions/extension_creator_filter.h"
#include "chrome/grit/generated_resources.h"
-#include "components/crx_file/crx_file.h"
+#include "components/crx_file/crx2_file.h"
#include "components/crx_file/id_util.h"
#include "crypto/rsa_private_key.h"
#include "crypto/signature_creator.h"
@@ -252,13 +252,13 @@ bool ExtensionCreator::WriteCRX(const base::FilePath& zip_path,
std::vector<uint8_t> public_key;
CHECK(private_key->ExportPublicKey(&public_key));
- crx_file::CrxFile::Error error;
- std::unique_ptr<crx_file::CrxFile> crx(
- crx_file::CrxFile::Create(public_key.size(), signature.size(), &error));
+ crx_file::Crx2File::Error error;
Sorin Jianu 2017/05/15 19:49:51 initialize?
waffles 2017/05/16 00:29:01 Done.
+ std::unique_ptr<crx_file::Crx2File> crx(
Sorin Jianu 2017/05/15 19:49:51 consider using the assignment syntax for initializ
Sorin Jianu 2017/05/15 19:49:51 Could use auto.
waffles 2017/05/16 00:29:01 Done.
waffles 2017/05/16 00:29:01 Done.
+ crx_file::Crx2File::Create(public_key.size(), signature.size(), &error));
if (!crx) {
- LOG(ERROR) << "cannot create CrxFileHeader: " << error;
+ LOG(ERROR) << "cannot create Crx2FileHeader: " << error;
Sorin Jianu 2017/05/15 19:49:51 If this error handling sufficient? It looks to me
waffles 2017/05/16 00:29:01 Hm, I agree. Seems strange. PTAL?
}
- const crx_file::CrxFile::Header header = crx->header();
+ const crx_file::Crx2File::Header header = crx->header();
if (fwrite(&header, sizeof(header), 1, crx_handle.get()) != 1) {
PLOG(ERROR) << "fwrite failed to write header";
« no previous file with comments | « no previous file | components/crx_file/BUILD.gn » ('j') | components/crx_file/crx2_file.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698