blob: a4fe8f311dab0e553cd0ca0548922bba18289deb [file] [log] [blame]
ginkage553af3202015-02-04 12:39:091// Copyright (c) 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "extensions/browser/crx_file_info.h"
6
7#include "base/logging.h"
Joshua Pawlickifd01b7c2019-01-17 16:18:348#include "components/crx_file/crx_verifier.h"
ginkage553af3202015-02-04 12:39:099
10namespace extensions {
11
12CRXFileInfo::CRXFileInfo() : path() {
13}
14
15CRXFileInfo::CRXFileInfo(const std::string& i,
16 const base::FilePath& p,
Joshua Pawlickifd01b7c2019-01-17 16:18:3417 const std::string& h,
18 const crx_file::VerifierFormat f)
19 : extension_id(i), path(p), expected_hash(h), required_format(f) {
ginkage553af3202015-02-04 12:39:0920 DCHECK(!path.empty());
21}
22
Joshua Pawlickifd01b7c2019-01-17 16:18:3423CRXFileInfo::CRXFileInfo(const std::string& i,
24 const crx_file::VerifierFormat f,
25 const base::FilePath& p)
26 : extension_id(i), path(p), expected_hash(), required_format(f) {
ginkage553af3202015-02-04 12:39:0927 DCHECK(!path.empty());
28}
29
Joshua Pawlickifd01b7c2019-01-17 16:18:3430CRXFileInfo::CRXFileInfo(const base::FilePath& p,
31 const crx_file::VerifierFormat f)
32 : extension_id(), path(p), expected_hash(), required_format(f) {
33 DCHECK(!path.empty());
34}
35
36CRXFileInfo::CRXFileInfo(const CRXFileInfo& other)
37 : extension_id(other.extension_id),
38 path(other.path),
39 expected_hash(other.expected_hash),
40 required_format(other.required_format) {
ginkage553af3202015-02-04 12:39:0941 DCHECK(!path.empty());
42}
43
44bool CRXFileInfo::operator==(const CRXFileInfo& that) const {
45 return extension_id == that.extension_id && path == that.path &&
46 expected_hash == that.expected_hash;
47}
48
49} // namespace extensions