| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 if (!cache) { | 109 if (!cache) { |
| 110 cache = new ContextFeaturesCache(); | 110 cache = new ContextFeaturesCache(); |
| 111 WillBeHeapSupplement<Document>::provideTo(document, supplementName(), ad
optPtrWillBeNoop(cache)); | 111 WillBeHeapSupplement<Document>::provideTo(document, supplementName(), ad
optPtrWillBeNoop(cache)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 return *cache; | 114 return *cache; |
| 115 } | 115 } |
| 116 | 116 |
| 117 void ContextFeaturesCache::validateAgainst(Document* document) | 117 void ContextFeaturesCache::validateAgainst(Document* document) |
| 118 { | 118 { |
| 119 String currentDomain = document->securityOrigin()->domain(); | 119 String currentDomain = document->getSecurityOrigin()->domain(); |
| 120 if (currentDomain == m_domain) | 120 if (currentDomain == m_domain) |
| 121 return; | 121 return; |
| 122 m_domain = currentDomain; | 122 m_domain = currentDomain; |
| 123 for (size_t i = 0; i < ContextFeatures::FeatureTypeSize; ++i) | 123 for (size_t i = 0; i < ContextFeatures::FeatureTypeSize; ++i) |
| 124 m_entries[i] = Entry(); | 124 m_entries[i] = Entry(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 bool ContextFeaturesClientImpl::isEnabled(Document* document, ContextFeatures::F
eatureType type, bool defaultValue) | 127 bool ContextFeaturesClientImpl::isEnabled(Document* document, ContextFeatures::F
eatureType type, bool defaultValue) |
| 128 { | 128 { |
| 129 ASSERT(document); | 129 ASSERT(document); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 147 | 147 |
| 148 switch (type) { | 148 switch (type) { |
| 149 case ContextFeatures::MutationEvents: | 149 case ContextFeatures::MutationEvents: |
| 150 return frame->contentSettingsClient()->allowMutationEvents(defaultValue)
; | 150 return frame->contentSettingsClient()->allowMutationEvents(defaultValue)
; |
| 151 default: | 151 default: |
| 152 return defaultValue; | 152 return defaultValue; |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace blink | 156 } // namespace blink |
| OLD | NEW |