Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: pdf/pdfium/pdfium_api_string_buffer_adapter.cc

Issue 1223983002: Move WriteInto to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/crypto/channel_id_chromium.cc ('k') | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "pdf/pdfium/pdfium_api_string_buffer_adapter.h" 5 #include "pdf/pdfium/pdfium_api_string_buffer_adapter.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/numerics/safe_math.h" 10 #include "base/numerics/safe_math.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 13
14 namespace chrome_pdf { 14 namespace chrome_pdf {
15 15
16 template <class StringType> 16 template <class StringType>
17 PDFiumAPIStringBufferAdapter<StringType>::PDFiumAPIStringBufferAdapter( 17 PDFiumAPIStringBufferAdapter<StringType>::PDFiumAPIStringBufferAdapter(
18 StringType* str, 18 StringType* str,
19 size_t expected_size, 19 size_t expected_size,
20 bool check_expected_size) 20 bool check_expected_size)
21 : str_(str), 21 : str_(str),
22 data_(WriteInto(str, expected_size + 1)), 22 data_(base::WriteInto(str, expected_size + 1)),
23 expected_size_(expected_size), 23 expected_size_(expected_size),
24 check_expected_size_(check_expected_size), 24 check_expected_size_(check_expected_size),
25 is_closed_(false) { 25 is_closed_(false) {
26 } 26 }
27 27
28 template <class StringType> 28 template <class StringType>
29 PDFiumAPIStringBufferAdapter<StringType>::~PDFiumAPIStringBufferAdapter() { 29 PDFiumAPIStringBufferAdapter<StringType>::~PDFiumAPIStringBufferAdapter() {
30 DCHECK(is_closed_); 30 DCHECK(is_closed_);
31 } 31 }
32 32
(...skipping 23 matching lines...) Expand all
56 } else { 56 } else {
57 str_->clear(); 57 str_->clear();
58 } 58 }
59 } 59 }
60 60
61 // explicit instantiations 61 // explicit instantiations
62 template class PDFiumAPIStringBufferAdapter<std::string>; 62 template class PDFiumAPIStringBufferAdapter<std::string>;
63 template class PDFiumAPIStringBufferAdapter<base::string16>; 63 template class PDFiumAPIStringBufferAdapter<base::string16>;
64 64
65 } // namespace chrome_pdf 65 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « net/quic/crypto/channel_id_chromium.cc ('k') | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698