Cleanup: Pass std::string as const reference from pdf/
Passing std::string by reference can prevent extra copying of object. BUG=367418 TEST= R=jam@chromium.org,jochen@chromium.org Review URL: https://codereview.chromium.org/1345393005 Cr-Commit-Position: refs/heads/master@{#350044}
This commit is contained in:
pdf/pdfium
@ -240,14 +240,15 @@ base::Value* PDFiumPage::GetTextBoxAsValue(double page_height,
|
||||
return node;
|
||||
}
|
||||
|
||||
base::Value* PDFiumPage::CreateTextNode(std::string text) {
|
||||
base::Value* PDFiumPage::CreateTextNode(const std::string& text) {
|
||||
base::DictionaryValue* node = new base::DictionaryValue();
|
||||
node->SetString(kTextNodeType, kTextNodeTypeText);
|
||||
node->SetString(kTextNodeText, text);
|
||||
return node;
|
||||
}
|
||||
|
||||
base::Value* PDFiumPage::CreateURLNode(std::string text, std::string url) {
|
||||
base::Value* PDFiumPage::CreateURLNode(const std::string& text,
|
||||
const std::string& url) {
|
||||
base::DictionaryValue* node = new base::DictionaryValue();
|
||||
node->SetString(kTextNodeType, kTextNodeTypeURL);
|
||||
node->SetString(kTextNodeText, text);
|
||||
|
@ -109,8 +109,8 @@ class PDFiumPage {
|
||||
base::Value* GetTextBoxAsValue(double page_height, double left, double top,
|
||||
double right, double bottom, int rotation);
|
||||
// Helper functions for JSON generation
|
||||
base::Value* CreateTextNode(std::string text);
|
||||
base::Value* CreateURLNode(std::string text, std::string url);
|
||||
base::Value* CreateTextNode(const std::string& text);
|
||||
base::Value* CreateURLNode(const std::string& text, const std::string& url);
|
||||
|
||||
class ScopedLoadCounter {
|
||||
public:
|
||||
|
Reference in New Issue
Block a user