diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-07-14 17:41:05 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-04 12:37:36 +0000 |
commit | 399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (patch) | |
tree | 6b06b60ff365abef0e13b3503d593a0df48d20e8 /chromium/components/crx_file | |
parent | 7366110654eec46f21b6824f302356426f48cd74 (diff) | |
download | qtwebengine-chromium-399c965b6064c440ddcf4015f5f8e9d131c7a0a6.tar.gz |
BASELINE: Update Chromium to 52.0.2743.76 and Ninja to 1.7.1
Change-Id: I382f51b959689505a60f8b707255ecb344f7d8b4
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/components/crx_file')
-rw-r--r-- | chromium/components/crx_file/crx_file.cc | 24 | ||||
-rw-r--r-- | chromium/components/crx_file/crx_file.h | 16 |
2 files changed, 20 insertions, 20 deletions
diff --git a/chromium/components/crx_file/crx_file.cc b/chromium/components/crx_file/crx_file.cc index 7a6240d265a..7a310aca988 100644 --- a/chromium/components/crx_file/crx_file.cc +++ b/chromium/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: diff --git a/chromium/components/crx_file/crx_file.h b/chromium/components/crx_file/crx_file.h index bfd6000d08e..cf9bce8a81c 100644 --- a/chromium/components/crx_file/crx_file.h +++ b/chromium/components/crx_file/crx_file.h @@ -5,13 +5,13 @@ #ifndef COMPONENTS_CRX_FILE_CRX_FILE_H_ #define COMPONENTS_CRX_FILE_CRX_FILE_H_ -#include <string> -#include <vector> - #include <stddef.h> #include <stdint.h> #include <sys/types.h> -#include "base/memory/scoped_ptr.h" + +#include <memory> +#include <string> +#include <vector> namespace base { class FilePath; @@ -52,7 +52,7 @@ class CrxFile { // Construct a new CRX file header object with bytes of a header // read from a CRX file. If a null scoped_ptr is returned, |error| // contains an error code with additional information. - static scoped_ptr<CrxFile> Parse(const Header& header, Error* error); + static std::unique_ptr<CrxFile> Parse(const Header& header, Error* error); // Construct a new header for the given key and signature sizes. // Returns a null scoped_ptr if erroneous values of |key_size| and/or @@ -60,9 +60,9 @@ class CrxFile { // additional information. // Use this constructor and then .header() to obtain the Header // for writing out to a CRX file. - static scoped_ptr<CrxFile> Create(const uint32_t key_size, - const uint32_t signature_size, - Error* error); + static std::unique_ptr<CrxFile> Create(const uint32_t key_size, + const uint32_t signature_size, + Error* error); // Returns the header structure for writing out to a CRX file. const Header& header() const { return header_; } |