| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_WEBCRYPTO_CRYPTO_DATA_H_ | 5 #ifndef COMPONENTS_WEBCRYPTO_CRYPTO_DATA_H_ |
| 6 #define COMPONENTS_WEBCRYPTO_CRYPTO_DATA_H_ | 6 #define COMPONENTS_WEBCRYPTO_CRYPTO_DATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | |
| 12 #include "third_party/WebKit/public/platform/WebVector.h" | 11 #include "third_party/WebKit/public/platform/WebVector.h" |
| 13 | 12 |
| 14 namespace webcrypto { | 13 namespace webcrypto { |
| 15 | 14 |
| 16 // Helper to pass around a range of immutable bytes. This is conceptually | 15 // Helper to pass around a range of immutable bytes. This is conceptually |
| 17 // similar to base::StringPiece, but for crypto byte data. | 16 // similar to base::StringPiece, but for crypto byte data. |
| 18 // | 17 // |
| 19 // The data used at construction is NOT owned, and should remain valid as long | 18 // The data used at construction is NOT owned, and should remain valid as long |
| 20 // as the CryptoData is being used. | 19 // as the CryptoData is being used. |
| 21 class CryptoData { | 20 class CryptoData { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 35 unsigned int byte_length() const { return byte_length_; } | 34 unsigned int byte_length() const { return byte_length_; } |
| 36 | 35 |
| 37 private: | 36 private: |
| 38 const unsigned char* const bytes_; | 37 const unsigned char* const bytes_; |
| 39 const unsigned int byte_length_; | 38 const unsigned int byte_length_; |
| 40 }; | 39 }; |
| 41 | 40 |
| 42 } // namespace webcrypto | 41 } // namespace webcrypto |
| 43 | 42 |
| 44 #endif // COMPONENTS_WEBCRYPTO_CRYPTO_DATA_H_ | 43 #endif // COMPONENTS_WEBCRYPTO_CRYPTO_DATA_H_ |
| OLD | NEW |