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

Unified Diff: core/fpdfapi/parser/cpdf_string.cpp

Issue 2510223002: Make CPDF_Dictionary use unique pointers. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_string.h ('k') | core/fpdfapi/parser/cpdf_syntax_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_string.cpp
diff --git a/core/fpdfapi/parser/cpdf_string.cpp b/core/fpdfapi/parser/cpdf_string.cpp
index fd4ff04ff747eec3e2de322db174de3cc9b09c2b..06bae54916ed75f8a45f627a62a7f823ec86aa2b 100644
--- a/core/fpdfapi/parser/cpdf_string.cpp
+++ b/core/fpdfapi/parser/cpdf_string.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfapi/parser/cpdf_string.h"
+#include <utility>
+
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "third_party/base/ptr_util.h"
@@ -19,8 +21,11 @@ CPDF_String::CPDF_String(CFX_WeakPtr<CFX_ByteStringPool> pPool,
m_String = pPool->Intern(m_String);
}
-CPDF_String::CPDF_String(const CFX_WideString& str) : m_bHex(false) {
- m_String = PDF_EncodeText(str);
+CPDF_String::CPDF_String(CFX_WeakPtr<CFX_ByteStringPool> pPool,
+ const CFX_WideString& str)
+ : m_String(PDF_EncodeText(str)), m_bHex(false) {
+ if (pPool)
+ m_String = pPool->Intern(m_String);
}
CPDF_String::~CPDF_String() {}
« no previous file with comments | « core/fpdfapi/parser/cpdf_string.h ('k') | core/fpdfapi/parser/cpdf_syntax_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698