OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 2 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 24 matching lines...) Expand all Loading... | |
35 #include "platform/Length.h" | 35 #include "platform/Length.h" |
36 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
37 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 | 40 |
41 class Document; | 41 class Document; |
42 class MutableStylePropertySet; | 42 class MutableStylePropertySet; |
43 class StyleRuleViewport; | 43 class StyleRuleViewport; |
44 | 44 |
45 class ViewportStyleResolver : public RefCounted<ViewportStyleResolver> { | 45 class ViewportStyleResolver : public RefCountedWillBeGarbageCollected<ViewportSt yleResolver> { |
46 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ViewportStyleResolver); | |
46 public: | 47 public: |
47 static PassRefPtr<ViewportStyleResolver> create(Document* document) | 48 static PassRefPtrWillBeRawPtr<ViewportStyleResolver> create(Document* docume nt) |
48 { | 49 { |
49 return adoptRef(new ViewportStyleResolver(document)); | 50 return adoptRefWillBeNoop(new ViewportStyleResolver(document)); |
50 } | 51 } |
51 | 52 |
52 ~ViewportStyleResolver(); | |
53 | |
54 enum Origin { UserAgentOrigin, AuthorOrigin }; | 53 enum Origin { UserAgentOrigin, AuthorOrigin }; |
55 | 54 |
56 void collectViewportRules(RuleSet*, Origin); | 55 void collectViewportRules(RuleSet*, Origin); |
57 | 56 |
58 void clearDocument(); | 57 void clearDocument(); |
59 void resolve(); | 58 void resolve(); |
60 | 59 |
60 void trace(Visitor*); | |
61 | |
61 private: | 62 private: |
62 explicit ViewportStyleResolver(Document*); | 63 explicit ViewportStyleResolver(Document*); |
63 | 64 |
64 void addViewportRule(StyleRuleViewport*, Origin); | 65 void addViewportRule(StyleRuleViewport*, Origin); |
65 | 66 |
66 float viewportArgumentValue(CSSPropertyID) const; | 67 float viewportArgumentValue(CSSPropertyID) const; |
67 Length viewportLengthValue(CSSPropertyID) const; | 68 Length viewportLengthValue(CSSPropertyID) const; |
68 | 69 |
69 Document* m_document; | 70 Document* m_document; |
haraken
2014/03/19 10:26:23
This raw pointer is safe since it's cleared in cle
wibling-chromium
2014/03/19 10:33:19
Yes, that was my assessment as well.
| |
70 RefPtr<MutableStylePropertySet> m_propertySet; | 71 RefPtrWillBeMember<MutableStylePropertySet> m_propertySet; |
71 bool m_hasAuthorStyle; | 72 bool m_hasAuthorStyle; |
72 }; | 73 }; |
73 | 74 |
74 } // namespace WebCore | 75 } // namespace WebCore |
75 | 76 |
76 #endif // ViewportStyleResolver_h | 77 #endif // ViewportStyleResolver_h |
OLD | NEW |