From e3c4d1a1228e00b190ad743a83f88a2266f45238 Mon Sep 17 00:00:00 2001 From: Brett Wilson Date: Tue, 7 Jul 2015 16:38:09 -0700 Subject: Move WriteInto to base namespace. Update all callers. De-inlines the template. For some reason touching the namespaces started givin errors about DCHECK not being defined. Indeed, this header does not include logging.h. Rather than include logging in this very common header, it seems preferable to move the implementation to the .cc file. This removes support for the wstring variant and updates the callers that used it. R=ben@chromium.org, ben TBR=jschuh (sandbox_win.cc) NOPRESUBMIT=true (this patch touches code using legacy wstrings) Review URL: https://codereview.chromium.org/1223983002. Cr-Commit-Position: refs/heads/master@{#337703} --- pdf/pdfium/pdfium_api_string_buffer_adapter.cc | 2 +- pdf/pdfium/pdfium_engine.cc | 4 ++-- pdf/pdfium/pdfium_page.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'pdf') diff --git a/pdf/pdfium/pdfium_api_string_buffer_adapter.cc b/pdf/pdfium/pdfium_api_string_buffer_adapter.cc index 92b46d2..c5be302 100644 --- a/pdf/pdfium/pdfium_api_string_buffer_adapter.cc +++ b/pdf/pdfium/pdfium_api_string_buffer_adapter.cc @@ -19,7 +19,7 @@ PDFiumAPIStringBufferAdapter::PDFiumAPIStringBufferAdapter( size_t expected_size, bool check_expected_size) : str_(str), - data_(WriteInto(str, expected_size + 1)), + data_(base::WriteInto(str, expected_size + 1)), expected_size_(expected_size), check_expected_size_(check_expected_size), is_closed_(false) { diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index 026eeb4..0cc8b26 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc @@ -3913,8 +3913,8 @@ bool PDFiumEngineExports::RenderPDFPageToDC(const void* pdf_buffer, base::string16 creator; size_t buffer_bytes = FPDF_GetMetaText(doc, "Creator", NULL, 0); if (buffer_bytes > 1) { - FPDF_GetMetaText( - doc, "Creator", WriteInto(&creator, buffer_bytes + 1), buffer_bytes); + FPDF_GetMetaText(doc, "Creator", + base::WriteInto(&creator, buffer_bytes + 1), buffer_bytes); } bool use_bitmap = false; if (base::StartsWith(creator, L"cairo", base::CompareCase::INSENSITIVE_ASCII)) diff --git a/pdf/pdfium/pdfium_page.cc b/pdf/pdfium/pdfium_page.cc index e514af3..a7912a6 100644 --- a/pdf/pdfium/pdfium_page.cc +++ b/pdf/pdfium/pdfium_page.cc @@ -157,7 +157,7 @@ base::Value* PDFiumPage::GetTextBoxAsValue(double page_height, FPDFText_GetBoundedText(GetTextPage(), left, top, right, bottom, NULL, 0); if (char_count > 0) { unsigned short* data = reinterpret_cast( - WriteInto(&text_utf16, char_count + 1)); + base::WriteInto(&text_utf16, char_count + 1)); FPDFText_GetBoundedText(GetTextPage(), left, top, right, bottom, data, char_count); -- cgit v1.1