| Index: components/crx_file/crx_file.cc
|
| diff --git a/components/crx_file/crx_file.cc b/components/crx_file/crx_file.cc
|
| index 7a6240d265a1ff1997e9d70c4ef7271f5920f5c1..7a310aca98828693d9b2bc4e235fbb76b7b7b36f 100644
|
| --- a/components/crx_file/crx_file.cc
|
| +++ b/components/crx_file/crx_file.cc
|
| @@ -9,7 +9,7 @@
|
| #include "base/files/file_util.h"
|
| #include "base/files/scoped_file.h"
|
| #include "base/macros.h"
|
| -#include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/numerics/safe_math.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_util.h"
|
| @@ -77,24 +77,24 @@ CrxFile::ValidateError FinalizeHash(const std::string& extension_id,
|
| const char kCrxFileHeaderMagic[] = "Cr24";
|
| const char kCrxDiffFileHeaderMagic[] = "CrOD";
|
|
|
| -scoped_ptr<CrxFile> CrxFile::Parse(const CrxFile::Header& header,
|
| - CrxFile::Error* error) {
|
| +std::unique_ptr<CrxFile> CrxFile::Parse(const CrxFile::Header& header,
|
| + CrxFile::Error* error) {
|
| if (HeaderIsValid(header, error))
|
| - return scoped_ptr<CrxFile>(new CrxFile(header));
|
| - return scoped_ptr<CrxFile>();
|
| + return base::WrapUnique(new CrxFile(header));
|
| + return nullptr;
|
| }
|
|
|
| -scoped_ptr<CrxFile> CrxFile::Create(const uint32_t key_size,
|
| - const uint32_t signature_size,
|
| - CrxFile::Error* error) {
|
| +std::unique_ptr<CrxFile> CrxFile::Create(const uint32_t key_size,
|
| + const uint32_t signature_size,
|
| + CrxFile::Error* error) {
|
| CrxFile::Header header;
|
| memcpy(&header.magic, kCrxFileHeaderMagic, kCrxFileHeaderMagicSize);
|
| header.version = kCurrentVersion;
|
| header.key_size = key_size;
|
| header.signature_size = signature_size;
|
| if (HeaderIsValid(header, error))
|
| - return scoped_ptr<CrxFile>(new CrxFile(header));
|
| - return scoped_ptr<CrxFile>();
|
| + return base::WrapUnique(new CrxFile(header));
|
| + return nullptr;
|
| }
|
|
|
| bool CrxFile::HeaderIsDelta(const CrxFile::Header& header) {
|
| @@ -109,7 +109,7 @@ CrxFile::ValidateError CrxFile::ValidateSignature(
|
| std::string* extension_id,
|
| CrxFile::Header* header_out) {
|
| base::ScopedFILE file(base::OpenFile(crx_path, "rb"));
|
| - scoped_ptr<crypto::SecureHash> hash;
|
| + std::unique_ptr<crypto::SecureHash> hash;
|
| if (!expected_hash.empty())
|
| hash.reset(crypto::SecureHash::Create(crypto::SecureHash::SHA256));
|
|
|
| @@ -124,7 +124,7 @@ CrxFile::ValidateError CrxFile::ValidateSignature(
|
| *header_out = header;
|
|
|
| CrxFile::Error error;
|
| - scoped_ptr<CrxFile> crx(CrxFile::Parse(header, &error));
|
| + std::unique_ptr<CrxFile> crx(CrxFile::Parse(header, &error));
|
| if (!crx) {
|
| switch (error) {
|
| case CrxFile::kWrongMagic:
|
|
|