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 26 matching lines...) Expand all Loading... | |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 ApplicationCache::ApplicationCache(LocalFrame* frame) | 39 ApplicationCache::ApplicationCache(LocalFrame* frame) |
40 : DOMWindowProperty(frame) | 40 : DOMWindowProperty(frame) |
41 { | 41 { |
42 ApplicationCacheHost* cacheHost = applicationCacheHost(); | 42 ApplicationCacheHost* cacheHost = applicationCacheHost(); |
43 if (cacheHost) | 43 if (cacheHost) |
44 cacheHost->setApplicationCache(this); | 44 cacheHost->setApplicationCache(this); |
45 } | 45 } |
46 | 46 |
47 ApplicationCache::~ApplicationCache() | |
48 { | |
49 ASSERT(!m_frame); | |
50 #if ENABLE(OILPAN) | |
51 if (ApplicationCacheHost* cacheHost = applicationCacheHost()) | |
Mads Ager (chromium)
2014/09/09 12:09:44
What makes sure that m_frame is alive at this poin
sof
2014/09/09 12:53:58
Hmm, this dtor is problematic with Oilpan for two
| |
52 cacheHost->setApplicationCache(0); | |
53 #endif | |
54 } | |
55 | |
56 void ApplicationCache::trace(Visitor* visitor) | |
57 { | |
58 EventTargetWithInlineData::trace(visitor); | |
59 DOMWindowProperty::trace(visitor); | |
60 } | |
61 | |
47 void ApplicationCache::willDestroyGlobalObjectInFrame() | 62 void ApplicationCache::willDestroyGlobalObjectInFrame() |
48 { | 63 { |
49 if (ApplicationCacheHost* cacheHost = applicationCacheHost()) | 64 if (ApplicationCacheHost* cacheHost = applicationCacheHost()) |
50 cacheHost->setApplicationCache(0); | 65 cacheHost->setApplicationCache(0); |
51 DOMWindowProperty::willDestroyGlobalObjectInFrame(); | 66 DOMWindowProperty::willDestroyGlobalObjectInFrame(); |
52 } | 67 } |
53 | 68 |
54 ApplicationCacheHost* ApplicationCache::applicationCacheHost() const | 69 ApplicationCacheHost* ApplicationCache::applicationCacheHost() const |
55 { | 70 { |
56 if (!m_frame || !m_frame->loader().documentLoader()) | 71 if (!m_frame || !m_frame->loader().documentLoader()) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 case ApplicationCacheHost::CACHED_EVENT: | 132 case ApplicationCacheHost::CACHED_EVENT: |
118 return EventTypeNames::cached; | 133 return EventTypeNames::cached; |
119 case ApplicationCacheHost::OBSOLETE_EVENT: | 134 case ApplicationCacheHost::OBSOLETE_EVENT: |
120 return EventTypeNames::obsolete; | 135 return EventTypeNames::obsolete; |
121 } | 136 } |
122 ASSERT_NOT_REACHED(); | 137 ASSERT_NOT_REACHED(); |
123 return EventTypeNames::error; | 138 return EventTypeNames::error; |
124 } | 139 } |
125 | 140 |
126 } // namespace blink | 141 } // namespace blink |
OLD | NEW |