From 8153561249b45ba45f6e393cc081eb1101f3f7a6 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 9 Oct 2018 21:15:17 +0000 Subject: Do IWYU for cpdf_dictionary.h. Move some method implementations out of headers in the process. Change-Id: I8701e360d4addd9aec39fe887d932209985d2443 Reviewed-on: https://pdfium-review.googlesource.com/c/43608 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- core/fpdfapi/parser/cpdf_object_walker.h | 6 ++++-- core/fpdfapi/parser/cpdf_stream.h | 1 - core/fpdfapi/parser/cpdf_stream_acc.cpp | 1 + core/fpdfapi/parser/cpdf_stream_acc.h | 3 ++- core/fpdfapi/parser/cpdf_stream_acc_unittest.cpp | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) (limited to 'core/fpdfapi/parser') diff --git a/core/fpdfapi/parser/cpdf_object_walker.h b/core/fpdfapi/parser/cpdf_object_walker.h index e0fd35de29..0af683c01c 100644 --- a/core/fpdfapi/parser/cpdf_object_walker.h +++ b/core/fpdfapi/parser/cpdf_object_walker.h @@ -8,9 +8,11 @@ #include #include -#include "core/fpdfapi/parser/cpdf_dictionary.h" +#include "core/fxcrt/fx_string.h" #include "core/fxcrt/unowned_ptr.h" +class CPDF_Object; + // Walk on all non-null sub-objects in an object in depth, include itself, // like in flat list. class CPDF_ObjectWalker { @@ -42,7 +44,7 @@ class CPDF_ObjectWalker { size_t current_depth() const { return current_depth_; } const CPDF_Object* GetParent() const { return parent_object_.Get(); } - ByteString dictionary_key() const { return dict_key_; } + const ByteString& dictionary_key() const { return dict_key_; } private: static std::unique_ptr MakeIterator( diff --git a/core/fpdfapi/parser/cpdf_stream.h b/core/fpdfapi/parser/cpdf_stream.h index aada80e35c..4f1eb05478 100644 --- a/core/fpdfapi/parser/cpdf_stream.h +++ b/core/fpdfapi/parser/cpdf_stream.h @@ -11,7 +11,6 @@ #include #include -#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_object.h" #include "core/fxcrt/fx_stream.h" diff --git a/core/fpdfapi/parser/cpdf_stream_acc.cpp b/core/fpdfapi/parser/cpdf_stream_acc.cpp index 7956124c62..c87e404186 100644 --- a/core/fpdfapi/parser/cpdf_stream_acc.cpp +++ b/core/fpdfapi/parser/cpdf_stream_acc.cpp @@ -8,6 +8,7 @@ #include +#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/fpdf_parser_decode.h" CPDF_StreamAcc::CPDF_StreamAcc(const CPDF_Stream* pStream) diff --git a/core/fpdfapi/parser/cpdf_stream_acc.h b/core/fpdfapi/parser/cpdf_stream_acc.h index e725041e80..37e21d26d8 100644 --- a/core/fpdfapi/parser/cpdf_stream_acc.h +++ b/core/fpdfapi/parser/cpdf_stream_acc.h @@ -9,7 +9,6 @@ #include -#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_stream.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" @@ -17,6 +16,8 @@ #include "core/fxcrt/retain_ptr.h" #include "third_party/base/span.h" +class CPDF_Dictionary; + class CPDF_StreamAcc final : public Retainable { public: template diff --git a/core/fpdfapi/parser/cpdf_stream_acc_unittest.cpp b/core/fpdfapi/parser/cpdf_stream_acc_unittest.cpp index 1fbb342548..146bd4b77b 100644 --- a/core/fpdfapi/parser/cpdf_stream_acc_unittest.cpp +++ b/core/fpdfapi/parser/cpdf_stream_acc_unittest.cpp @@ -4,8 +4,8 @@ #include "core/fpdfapi/parser/cpdf_stream_acc.h" +#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_stream.h" - #include "core/fxcrt/cfx_memorystream.h" #include "core/fxcrt/fx_stream.h" #include "testing/gtest/include/gtest/gtest.h" -- cgit v1.2.3