| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "core/frame/Deprecation.h" | 32 #include "core/frame/Deprecation.h" |
| 33 #include "core/frame/HostsUsingFeatures.h" | 33 #include "core/frame/HostsUsingFeatures.h" |
| 34 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
| 35 #include "core/frame/UseCounter.h" | 35 #include "core/frame/UseCounter.h" |
| 36 #include "core/loader/DocumentLoader.h" | 36 #include "core/loader/DocumentLoader.h" |
| 37 #include "core/loader/FrameLoader.h" | 37 #include "core/loader/FrameLoader.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 ApplicationCache::ApplicationCache(LocalFrame* frame) | 41 ApplicationCache::ApplicationCache(LocalFrame* frame) |
| 42 : DOMWindowProperty(frame) { | 42 : ContextLifecycleObserver(frame->document()) { |
| 43 ApplicationCacheHost* cacheHost = applicationCacheHost(); | 43 ApplicationCacheHost* cacheHost = applicationCacheHost(); |
| 44 if (cacheHost) | 44 if (cacheHost) |
| 45 cacheHost->setApplicationCache(this); | 45 cacheHost->setApplicationCache(this); |
| 46 } | 46 } |
| 47 | 47 |
| 48 DEFINE_TRACE(ApplicationCache) { | 48 DEFINE_TRACE(ApplicationCache) { |
| 49 EventTargetWithInlineData::trace(visitor); | 49 EventTargetWithInlineData::trace(visitor); |
| 50 DOMWindowProperty::trace(visitor); | 50 ContextLifecycleObserver::trace(visitor); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void ApplicationCache::frameDestroyed() { | 53 void ApplicationCache::contextDestroyed() { |
| 54 if (ApplicationCacheHost* cacheHost = applicationCacheHost()) | 54 if (ApplicationCacheHost* cacheHost = applicationCacheHost()) |
| 55 cacheHost->setApplicationCache(0); | 55 cacheHost->setApplicationCache(0); |
| 56 DOMWindowProperty::frameDestroyed(); | |
| 57 } | 56 } |
| 58 | 57 |
| 59 ApplicationCacheHost* ApplicationCache::applicationCacheHost() const { | 58 ApplicationCacheHost* ApplicationCache::applicationCacheHost() const { |
| 60 if (!frame() || !frame()->loader().documentLoader()) | 59 if (!frame() || !frame()->loader().documentLoader()) |
| 61 return 0; | 60 return 0; |
| 62 return frame()->loader().documentLoader()->applicationCacheHost(); | 61 return frame()->loader().documentLoader()->applicationCacheHost(); |
| 63 } | 62 } |
| 64 | 63 |
| 65 unsigned short ApplicationCache::status() const { | 64 unsigned short ApplicationCache::status() const { |
| 66 recordAPIUseType(); | 65 recordAPIUseType(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } else { | 141 } else { |
| 143 Deprecation::countDeprecation( | 142 Deprecation::countDeprecation( |
| 144 document, UseCounter::ApplicationCacheAPIInsecureOrigin); | 143 document, UseCounter::ApplicationCacheAPIInsecureOrigin); |
| 145 HostsUsingFeatures::countAnyWorld( | 144 HostsUsingFeatures::countAnyWorld( |
| 146 *document, | 145 *document, |
| 147 HostsUsingFeatures::Feature::ApplicationCacheAPIInsecureHost); | 146 HostsUsingFeatures::Feature::ApplicationCacheAPIInsecureHost); |
| 148 } | 147 } |
| 149 } | 148 } |
| 150 | 149 |
| 151 } // namespace blink | 150 } // namespace blink |
| OLD | NEW |