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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 m_value = value ? IsEnabled : IsDisabled; | 59 m_value = value ? IsEnabled : IsDisabled; |
60 m_defaultValue = defaultValue; | 60 m_defaultValue = defaultValue; |
61 } | 61 } |
62 | 62 |
63 bool needsRefresh(bool defaultValue) const { | 63 bool needsRefresh(bool defaultValue) const { |
64 return m_value == NeedsRefresh || m_defaultValue != defaultValue; | 64 return m_value == NeedsRefresh || m_defaultValue != defaultValue; |
65 } | 65 } |
66 | 66 |
67 private: | 67 private: |
68 Value m_value; | 68 Value m_value; |
69 bool | 69 bool m_defaultValue; // Needs to be traked as a part of the signature since |
70 m_defaultValue; // Needs to be traked as a part of the signature since
it can be changed dynamically. | 70 // it can be changed dynamically. |
71 }; | 71 }; |
72 | 72 |
73 static const char* supplementName(); | 73 static const char* supplementName(); |
74 static ContextFeaturesCache& from(Document&); | 74 static ContextFeaturesCache& from(Document&); |
75 | 75 |
76 Entry& entryFor(ContextFeatures::FeatureType type) { | 76 Entry& entryFor(ContextFeatures::FeatureType type) { |
77 size_t index = static_cast<size_t>(type); | 77 size_t index = static_cast<size_t>(type); |
78 ASSERT_WITH_SECURITY_IMPLICATION(index < ContextFeatures::FeatureTypeSize); | 78 ASSERT_WITH_SECURITY_IMPLICATION(index < ContextFeatures::FeatureTypeSize); |
79 return m_entries[index]; | 79 return m_entries[index]; |
80 } | 80 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 switch (type) { | 139 switch (type) { |
140 case ContextFeatures::MutationEvents: | 140 case ContextFeatures::MutationEvents: |
141 return frame->contentSettingsClient()->allowMutationEvents(defaultValue); | 141 return frame->contentSettingsClient()->allowMutationEvents(defaultValue); |
142 default: | 142 default: |
143 return defaultValue; | 143 return defaultValue; |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 } // namespace blink | 147 } // namespace blink |
OLD | NEW |