OLD | NEW |
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 EXTENSIONS_COMMON_CRX_FILE_H_ | 5 #ifndef EXTENSIONS_COMMON_CRX_FILE_H_ |
6 #define EXTENSIONS_COMMON_CRX_FILE_H_ | 6 #define EXTENSIONS_COMMON_CRX_FILE_H_ |
7 | 7 |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // additional information. | 53 // additional information. |
54 // Use this constructor and then .header() to obtain the Header | 54 // Use this constructor and then .header() to obtain the Header |
55 // for writing out to a CRX file. | 55 // for writing out to a CRX file. |
56 static scoped_ptr<CrxFile> Create(const uint32 key_size, | 56 static scoped_ptr<CrxFile> Create(const uint32 key_size, |
57 const uint32 signature_size, | 57 const uint32 signature_size, |
58 Error* error); | 58 Error* error); |
59 | 59 |
60 // Returns the header structure for writing out to a CRX file. | 60 // Returns the header structure for writing out to a CRX file. |
61 const Header& header() const { return header_; } | 61 const Header& header() const { return header_; } |
62 | 62 |
| 63 // Checks a valid |header| to determine whether or not the CRX represents a |
| 64 // differential CRX. |
| 65 static bool HeaderIsDelta(const Header& header); |
| 66 |
63 private: | 67 private: |
64 Header header_; | 68 Header header_; |
65 | 69 |
66 // Constructor is private. Clients should use static factory methods above. | 70 // Constructor is private. Clients should use static factory methods above. |
67 explicit CrxFile(const Header& header); | 71 explicit CrxFile(const Header& header); |
68 | 72 |
69 // Checks the |header| for validity and returns true if the values are valid. | 73 // Checks the |header| for validity and returns true if the values are valid. |
70 // If false is returned, more detailed error code is returned in |error|. | 74 // If false is returned, more detailed error code is returned in |error|. |
71 static bool HeaderIsValid(const Header& header, Error* error); | 75 static bool HeaderIsValid(const Header& header, Error* error); |
72 }; | 76 }; |
73 | 77 |
74 } // namespace extensions | 78 } // namespace extensions |
75 | 79 |
76 #endif // EXTENSIONS_COMMON_CRX_FILE_H_ | 80 #endif // EXTENSIONS_COMMON_CRX_FILE_H_ |
OLD | NEW |