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

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

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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 | « pdf/out_of_process_instance.cc ('k') | printing/printed_document.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 (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 #include "pdf/pdfium/pdfium_engine.h" 5 #include "pdf/pdfium/pdfium_engine.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 HasPermission(PERMISSION_COPY_ACCESSIBLE))) { 2433 HasPermission(PERMISSION_COPY_ACCESSIBLE))) {
2434 return "{}"; 2434 return "{}";
2435 } 2435 }
2436 2436
2437 if (index < 0 || static_cast<size_t>(index) > pages_.size() - 1) 2437 if (index < 0 || static_cast<size_t>(index) > pages_.size() - 1)
2438 return "{}"; 2438 return "{}";
2439 2439
2440 scoped_ptr<base::Value> node( 2440 scoped_ptr<base::Value> node(
2441 pages_[index]->GetAccessibleContentAsValue(current_rotation_)); 2441 pages_[index]->GetAccessibleContentAsValue(current_rotation_));
2442 std::string page_json; 2442 std::string page_json;
2443 base::JSONWriter::Write(node.get(), &page_json); 2443 base::JSONWriter::Write(*node, &page_json);
2444 return page_json; 2444 return page_json;
2445 } 2445 }
2446 2446
2447 bool PDFiumEngine::GetPrintScaling() { 2447 bool PDFiumEngine::GetPrintScaling() {
2448 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); 2448 return !!FPDF_VIEWERREF_GetPrintScaling(doc_);
2449 } 2449 }
2450 2450
2451 int PDFiumEngine::GetCopiesToPrint() { 2451 int PDFiumEngine::GetCopiesToPrint() {
2452 return FPDF_VIEWERREF_GetNumCopies(doc_); 2452 return FPDF_VIEWERREF_GetNumCopies(doc_);
2453 } 2453 }
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
4011 double* height) { 4011 double* height) {
4012 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); 4012 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL);
4013 if (!doc) 4013 if (!doc)
4014 return false; 4014 return false;
4015 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; 4015 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0;
4016 FPDF_CloseDocument(doc); 4016 FPDF_CloseDocument(doc);
4017 return success; 4017 return success;
4018 } 4018 }
4019 4019
4020 } // namespace chrome_pdf 4020 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « pdf/out_of_process_instance.cc ('k') | printing/printed_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698