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

Side by Side Diff: xfa/fde/css/fde_csscache.h

Issue 2072803002: Make code compile with clang_use_chrome_plugin (final) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 6 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 | « xfa/fde/css/fde_css.cpp ('k') | xfa/fde/css/fde_csscache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef XFA_FDE_CSS_FDE_CSSCACHE_H_ 7 #ifndef XFA_FDE_CSS_FDE_CSSCACHE_H_
8 #define XFA_FDE_CSS_FDE_CSSCACHE_H_ 8 #define XFA_FDE_CSS_FDE_CSSCACHE_H_
9 9
10 #include <map> 10 #include <map>
11 11
12 #include "xfa/fde/css/fde_css.h" 12 #include "xfa/fde/css/fde_css.h"
13 #include "xfa/fgas/crt/fgas_memory.h" 13 #include "xfa/fgas/crt/fgas_memory.h"
14 14
15 class FDE_CSSCacheItem : public CFX_Target { 15 class FDE_CSSCacheItem : public CFX_Target {
16 public: 16 public:
17 explicit FDE_CSSCacheItem(IFDE_CSSStyleSheet* p); 17 explicit FDE_CSSCacheItem(IFDE_CSSStyleSheet* p);
18 ~FDE_CSSCacheItem(); 18 ~FDE_CSSCacheItem() override;
19 19
20 IFDE_CSSStyleSheet* pStylesheet; 20 IFDE_CSSStyleSheet* pStylesheet;
21 uint32_t dwActivity; 21 uint32_t dwActivity;
22 }; 22 };
23 23
24 class FDE_CSSTagCache : public CFX_Target { 24 class FDE_CSSTagCache : public CFX_Target {
25 public: 25 public:
26 FDE_CSSTagCache(FDE_CSSTagCache* parent, CXFA_CSSTagProvider* tag); 26 FDE_CSSTagCache(FDE_CSSTagCache* parent, CXFA_CSSTagProvider* tag);
27 FDE_CSSTagCache(const FDE_CSSTagCache& it); 27 FDE_CSSTagCache(const FDE_CSSTagCache& it);
28 ~FDE_CSSTagCache() override;
28 29
29 FDE_CSSTagCache* GetParent() const { return pParent; } 30 FDE_CSSTagCache* GetParent() const { return pParent; }
30 CXFA_CSSTagProvider* GetTag() const { return pTag; } 31 CXFA_CSSTagProvider* GetTag() const { return pTag; }
31 32
32 uint32_t HashID() const { return dwIDHash; } 33 uint32_t HashID() const { return dwIDHash; }
33 uint32_t HashTag() const { return dwTagHash; } 34 uint32_t HashTag() const { return dwTagHash; }
34 int32_t CountHashClass() const { return dwClassHashs.GetSize(); } 35 int32_t CountHashClass() const { return dwClassHashs.GetSize(); }
35 36
36 void SetClassIndex(int32_t index) { iClassIndex = index; } 37 void SetClassIndex(int32_t index) { iClassIndex = index; }
37 uint32_t HashClass() const { 38 uint32_t HashClass() const {
38 return iClassIndex < dwClassHashs.GetSize() 39 return iClassIndex < dwClassHashs.GetSize()
39 ? dwClassHashs.GetAt(iClassIndex) 40 ? dwClassHashs.GetAt(iClassIndex)
40 : 0; 41 : 0;
41 } 42 }
42 43
43 protected: 44 protected:
44 CXFA_CSSTagProvider* pTag; 45 CXFA_CSSTagProvider* pTag;
45 FDE_CSSTagCache* pParent; 46 FDE_CSSTagCache* pParent;
46 uint32_t dwIDHash; 47 uint32_t dwIDHash;
47 uint32_t dwTagHash; 48 uint32_t dwTagHash;
48 int32_t iClassIndex; 49 int32_t iClassIndex;
49 CFX_BaseArrayTemplate<uint32_t> dwClassHashs; 50 CFX_BaseArrayTemplate<uint32_t> dwClassHashs;
50 }; 51 };
51 typedef CFX_ObjectStackTemplate<FDE_CSSTagCache> CFDE_CSSTagStack; 52 typedef CFX_ObjectStackTemplate<FDE_CSSTagCache> CFDE_CSSTagStack;
52 53
53 class CFDE_CSSAccelerator : public CFX_Target { 54 class CFDE_CSSAccelerator : public CFX_Target {
54 public: 55 public:
56 CFDE_CSSAccelerator();
57 ~CFDE_CSSAccelerator() override;
58
55 void OnEnterTag(CXFA_CSSTagProvider* pTag); 59 void OnEnterTag(CXFA_CSSTagProvider* pTag);
56 void OnLeaveTag(CXFA_CSSTagProvider* pTag); 60 void OnLeaveTag(CXFA_CSSTagProvider* pTag);
57 61
58 void Clear() { m_Stack.RemoveAll(); } 62 void Clear() { m_Stack.RemoveAll(); }
59 63
60 FDE_CSSTagCache* GetTopElement() const { return m_Stack.GetTopElement(); } 64 FDE_CSSTagCache* GetTopElement() const { return m_Stack.GetTopElement(); }
61 65
62 protected: 66 protected:
63 CFDE_CSSTagStack m_Stack; 67 CFDE_CSSTagStack m_Stack;
64 }; 68 };
65 69
66 #endif // XFA_FDE_CSS_FDE_CSSCACHE_H_ 70 #endif // XFA_FDE_CSS_FDE_CSSCACHE_H_
OLDNEW
« no previous file with comments | « xfa/fde/css/fde_css.cpp ('k') | xfa/fde/css/fde_csscache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698