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

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

Issue 1345393005: Cleanup: Pass std::string as const reference from pdf/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/pdfium/pdfium_page.h ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_page.h" 5 #include "pdf/pdfium/pdfium_page.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 if (before_text.size() > 0) 233 if (before_text.size() > 0)
234 text_nodes->Append(CreateTextNode(before_text)); 234 text_nodes->Append(CreateTextNode(before_text));
235 } else { 235 } else {
236 text_nodes->Append(CreateTextNode(text_utf8)); 236 text_nodes->Append(CreateTextNode(text_utf8));
237 } 237 }
238 238
239 node->Set(kTextBoxNodes, text_nodes); // Takes ownership of |text_nodes|. 239 node->Set(kTextBoxNodes, text_nodes); // Takes ownership of |text_nodes|.
240 return node; 240 return node;
241 } 241 }
242 242
243 base::Value* PDFiumPage::CreateTextNode(std::string text) { 243 base::Value* PDFiumPage::CreateTextNode(const std::string& text) {
244 base::DictionaryValue* node = new base::DictionaryValue(); 244 base::DictionaryValue* node = new base::DictionaryValue();
245 node->SetString(kTextNodeType, kTextNodeTypeText); 245 node->SetString(kTextNodeType, kTextNodeTypeText);
246 node->SetString(kTextNodeText, text); 246 node->SetString(kTextNodeText, text);
247 return node; 247 return node;
248 } 248 }
249 249
250 base::Value* PDFiumPage::CreateURLNode(std::string text, std::string url) { 250 base::Value* PDFiumPage::CreateURLNode(const std::string& text,
251 const std::string& url) {
251 base::DictionaryValue* node = new base::DictionaryValue(); 252 base::DictionaryValue* node = new base::DictionaryValue();
252 node->SetString(kTextNodeType, kTextNodeTypeURL); 253 node->SetString(kTextNodeType, kTextNodeTypeURL);
253 node->SetString(kTextNodeText, text); 254 node->SetString(kTextNodeText, text);
254 node->SetString(kTextNodeURL, url); 255 node->SetString(kTextNodeURL, url);
255 return node; 256 return node;
256 } 257 }
257 258
258 PDFiumPage::Area PDFiumPage::GetCharIndex(const pp::Point& point, 259 PDFiumPage::Area PDFiumPage::GetCharIndex(const pp::Point& point,
259 int rotation, 260 int rotation,
260 int* char_index, 261 int* char_index,
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 page_->loading_count_--; 527 page_->loading_count_--;
527 } 528 }
528 529
529 PDFiumPage::Link::Link() { 530 PDFiumPage::Link::Link() {
530 } 531 }
531 532
532 PDFiumPage::Link::~Link() { 533 PDFiumPage::Link::~Link() {
533 } 534 }
534 535
535 } // namespace chrome_pdf 536 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « pdf/pdfium/pdfium_page.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698