| Index: pdf/pdfium/pdfium_api_string_buffer_adapter.cc
|
| diff --git a/pdf/pdfium/pdfium_api_string_buffer_adapter.cc b/pdf/pdfium/pdfium_api_string_buffer_adapter.cc
|
| index c5be3021d5b367ca3c5f122b1d97be58b24a9db9..c5819f39efed4b97f40788ee293746e4e36681a8 100644
|
| --- a/pdf/pdfium/pdfium_api_string_buffer_adapter.cc
|
| +++ b/pdf/pdfium/pdfium_api_string_buffer_adapter.cc
|
| @@ -58,8 +58,43 @@ void PDFiumAPIStringBufferAdapter<StringType>::Close(size_t actual_size) {
|
| }
|
| }
|
|
|
| +template <class StringType>
|
| +PDFiumAPIStringBufferSizeInBytesAdapter<StringType>::
|
| + PDFiumAPIStringBufferSizeInBytesAdapter(StringType* str,
|
| + size_t expected_size,
|
| + bool check_expected_size)
|
| + : adapter_(str,
|
| + expected_size / sizeof(typename StringType::value_type),
|
| + check_expected_size) {
|
| + DCHECK(expected_size % sizeof(typename StringType::value_type) == 0);
|
| +}
|
| +
|
| +template <class StringType>
|
| +PDFiumAPIStringBufferSizeInBytesAdapter<
|
| + StringType>::~PDFiumAPIStringBufferSizeInBytesAdapter() = default;
|
| +
|
| +template <class StringType>
|
| +void* PDFiumAPIStringBufferSizeInBytesAdapter<StringType>::GetData() {
|
| + return adapter_.GetData();
|
| +}
|
| +
|
| +template <class StringType>
|
| +void PDFiumAPIStringBufferSizeInBytesAdapter<StringType>::Close(
|
| + int actual_size) {
|
| + DCHECK(actual_size % sizeof(typename StringType::value_type) == 0);
|
| + adapter_.Close(actual_size / sizeof(typename StringType::value_type));
|
| +}
|
| +
|
| +template <class StringType>
|
| +void PDFiumAPIStringBufferSizeInBytesAdapter<StringType>::Close(
|
| + size_t actual_size) {
|
| + DCHECK(actual_size % sizeof(typename StringType::value_type) == 0);
|
| + adapter_.Close(actual_size / sizeof(typename StringType::value_type));
|
| +}
|
| +
|
| // explicit instantiations
|
| template class PDFiumAPIStringBufferAdapter<std::string>;
|
| template class PDFiumAPIStringBufferAdapter<base::string16>;
|
| +template class PDFiumAPIStringBufferSizeInBytesAdapter<base::string16>;
|
|
|
| } // namespace chrome_pdf
|
|
|