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

Unified Diff: core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h

Issue 2345063002: Use string pools in some dictionaries (Closed)
Patch Set: windows compile Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cfdf_document.h ('k') | core/fpdfapi/fpdf_parser/include/cpdf_document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
index fc69ce2f4b6564995327ba0b4f3e9d5a4efb69b4..501b287dfc6415c1e9ca9533489741d0cfe13a66 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
@@ -11,6 +11,8 @@
#include <set>
#include "core/fpdfapi/fpdf_parser/include/cpdf_object.h"
+#include "core/fxcrt/include/cfx_string_pool_template.h"
+#include "core/fxcrt/include/cfx_weak_ptr.h"
#include "core/fxcrt/include/fx_coordinates.h"
#include "core/fxcrt/include/fx_string.h"
@@ -21,7 +23,7 @@ class CPDF_Dictionary : public CPDF_Object {
using iterator = std::map<CFX_ByteString, CPDF_Object*>::iterator;
using const_iterator = std::map<CFX_ByteString, CPDF_Object*>::const_iterator;
- CPDF_Dictionary();
+ explicit CPDF_Dictionary(const CFX_WeakPtr<CFX_ByteStringPool>& pPool);
// CPDF_Object.
Type GetType() const override;
@@ -78,13 +80,17 @@ class CPDF_Dictionary : public CPDF_Object {
const_iterator begin() const { return m_Map.begin(); }
const_iterator end() const { return m_Map.end(); }
+ CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const { return m_pPool; }
+
protected:
~CPDF_Dictionary() override;
+ CFX_ByteString MaybeIntern(const CFX_ByteString& str);
CPDF_Object* CloneNonCyclic(
bool bDirect,
std::set<const CPDF_Object*>* visited) const override;
+ CFX_WeakPtr<CFX_ByteStringPool> m_pPool;
std::map<CFX_ByteString, CPDF_Object*> m_Map;
};
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cfdf_document.h ('k') | core/fpdfapi/fpdf_parser/include/cpdf_document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698