OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include "platform/RefCountedSupplement.h" | 30 #include "platform/RefCountedSupplement.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 class ContextFeaturesClient; | 34 class ContextFeaturesClient; |
35 class Document; | 35 class Document; |
36 class Page; | 36 class Page; |
37 | 37 |
38 #if ENABLE(OILPAN) | 38 #if ENABLE(OILPAN) |
39 class ContextFeatures FINAL : public GarbageCollectedFinalized<ContextFeatures>,
public HeapSupplement<Page> { | 39 class ContextFeatures final : public GarbageCollectedFinalized<ContextFeatures>,
public HeapSupplement<Page> { |
40 USING_GARBAGE_COLLECTED_MIXIN(ContextFeatures); | 40 USING_GARBAGE_COLLECTED_MIXIN(ContextFeatures); |
41 public: | 41 public: |
42 typedef HeapSupplement<Page> SupplementType; | 42 typedef HeapSupplement<Page> SupplementType; |
43 #else | 43 #else |
44 class ContextFeatures : public RefCountedSupplement<Page, ContextFeatures> { | 44 class ContextFeatures : public RefCountedSupplement<Page, ContextFeatures> { |
45 public: | 45 public: |
46 typedef RefCountedSupplement<Page, ContextFeatures> SupplementType; | 46 typedef RefCountedSupplement<Page, ContextFeatures> SupplementType; |
47 #endif | 47 #endif |
48 enum FeatureType { | 48 enum FeatureType { |
49 PagePopup = 0, | 49 PagePopup = 0, |
50 MutationEvents, | 50 MutationEvents, |
51 PushState, | 51 PushState, |
52 FeatureTypeSize // Should be the last entry. | 52 FeatureTypeSize // Should be the last entry. |
53 }; | 53 }; |
54 | 54 |
55 static const char* supplementName(); | 55 static const char* supplementName(); |
56 static ContextFeatures* defaultSwitch(); | 56 static ContextFeatures* defaultSwitch(); |
57 static PassRefPtrWillBeRawPtr<ContextFeatures> create(PassOwnPtr<ContextFeat
uresClient>); | 57 static PassRefPtrWillBeRawPtr<ContextFeatures> create(PassOwnPtr<ContextFeat
uresClient>); |
58 | 58 |
59 static bool pagePopupEnabled(Document*); | 59 static bool pagePopupEnabled(Document*); |
60 static bool mutationEventsEnabled(Document*); | 60 static bool mutationEventsEnabled(Document*); |
61 static bool pushStateEnabled(Document*); | 61 static bool pushStateEnabled(Document*); |
62 | 62 |
63 bool isEnabled(Document*, FeatureType, bool) const; | 63 bool isEnabled(Document*, FeatureType, bool) const; |
64 void urlDidChange(Document*); | 64 void urlDidChange(Document*); |
65 | 65 |
66 #if ENABLE(OILPAN) | 66 #if ENABLE(OILPAN) |
67 virtual void trace(Visitor* visitor) OVERRIDE { HeapSupplement<Page>::trace(
visitor); } | 67 virtual void trace(Visitor* visitor) override { HeapSupplement<Page>::trace(
visitor); } |
68 #endif | 68 #endif |
69 | 69 |
70 private: | 70 private: |
71 explicit ContextFeatures(PassOwnPtr<ContextFeaturesClient> client) | 71 explicit ContextFeatures(PassOwnPtr<ContextFeaturesClient> client) |
72 : m_client(client) | 72 : m_client(client) |
73 { } | 73 { } |
74 | 74 |
75 OwnPtr<ContextFeaturesClient> m_client; | 75 OwnPtr<ContextFeaturesClient> m_client; |
76 }; | 76 }; |
77 | 77 |
(...skipping 30 matching lines...) Expand all Loading... |
108 // See issue 294180 | 108 // See issue 294180 |
109 // | 109 // |
110 // if (m_client) | 110 // if (m_client) |
111 // return; | 111 // return; |
112 // m_client->urlDidChange(document); | 112 // m_client->urlDidChange(document); |
113 } | 113 } |
114 | 114 |
115 } // namespace blink | 115 } // namespace blink |
116 | 116 |
117 #endif // ContextFeatures_h | 117 #endif // ContextFeatures_h |
OLD | NEW |