Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: Source/core/loader/appcache/ApplicationCache.cpp

Issue 879423003: Move Location to DOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 void ApplicationCache::willDestroyGlobalObjectInFrame() 53 void ApplicationCache::willDestroyGlobalObjectInFrame()
54 { 54 {
55 if (ApplicationCacheHost* cacheHost = applicationCacheHost()) 55 if (ApplicationCacheHost* cacheHost = applicationCacheHost())
56 cacheHost->setApplicationCache(0); 56 cacheHost->setApplicationCache(0);
57 DOMWindowProperty::willDestroyGlobalObjectInFrame(); 57 DOMWindowProperty::willDestroyGlobalObjectInFrame();
58 } 58 }
59 59
60 ApplicationCacheHost* ApplicationCache::applicationCacheHost() const 60 ApplicationCacheHost* ApplicationCache::applicationCacheHost() const
61 { 61 {
62 if (!m_frame || !m_frame->loader().documentLoader()) 62 if (!localFrame() || !localFrame()->loader().documentLoader())
63 return 0; 63 return 0;
64 return m_frame->loader().documentLoader()->applicationCacheHost(); 64 return localFrame()->loader().documentLoader()->applicationCacheHost();
65 } 65 }
66 66
67 unsigned short ApplicationCache::status() const 67 unsigned short ApplicationCache::status() const
68 { 68 {
69 ApplicationCacheHost* cacheHost = applicationCacheHost(); 69 ApplicationCacheHost* cacheHost = applicationCacheHost();
70 if (!cacheHost) 70 if (!cacheHost)
71 return ApplicationCacheHost::UNCACHED; 71 return ApplicationCacheHost::UNCACHED;
72 return cacheHost->status(); 72 return cacheHost->status();
73 } 73 }
74 74
(...skipping 18 matching lines...) Expand all
93 cacheHost->abort(); 93 cacheHost->abort();
94 } 94 }
95 95
96 const AtomicString& ApplicationCache::interfaceName() const 96 const AtomicString& ApplicationCache::interfaceName() const
97 { 97 {
98 return EventTargetNames::ApplicationCache; 98 return EventTargetNames::ApplicationCache;
99 } 99 }
100 100
101 ExecutionContext* ApplicationCache::executionContext() const 101 ExecutionContext* ApplicationCache::executionContext() const
102 { 102 {
103 if (m_frame) 103 if (localFrame())
104 return m_frame->document(); 104 return localFrame()->document();
105 return 0; 105 return 0;
106 } 106 }
107 107
108 const AtomicString& ApplicationCache::toEventType(ApplicationCacheHost::EventID id) 108 const AtomicString& ApplicationCache::toEventType(ApplicationCacheHost::EventID id)
109 { 109 {
110 switch (id) { 110 switch (id) {
111 case ApplicationCacheHost::CHECKING_EVENT: 111 case ApplicationCacheHost::CHECKING_EVENT:
112 return EventTypeNames::checking; 112 return EventTypeNames::checking;
113 case ApplicationCacheHost::ERROR_EVENT: 113 case ApplicationCacheHost::ERROR_EVENT:
114 return EventTypeNames::error; 114 return EventTypeNames::error;
115 case ApplicationCacheHost::NOUPDATE_EVENT: 115 case ApplicationCacheHost::NOUPDATE_EVENT:
116 return EventTypeNames::noupdate; 116 return EventTypeNames::noupdate;
117 case ApplicationCacheHost::DOWNLOADING_EVENT: 117 case ApplicationCacheHost::DOWNLOADING_EVENT:
118 return EventTypeNames::downloading; 118 return EventTypeNames::downloading;
119 case ApplicationCacheHost::PROGRESS_EVENT: 119 case ApplicationCacheHost::PROGRESS_EVENT:
120 return EventTypeNames::progress; 120 return EventTypeNames::progress;
121 case ApplicationCacheHost::UPDATEREADY_EVENT: 121 case ApplicationCacheHost::UPDATEREADY_EVENT:
122 return EventTypeNames::updateready; 122 return EventTypeNames::updateready;
123 case ApplicationCacheHost::CACHED_EVENT: 123 case ApplicationCacheHost::CACHED_EVENT:
124 return EventTypeNames::cached; 124 return EventTypeNames::cached;
125 case ApplicationCacheHost::OBSOLETE_EVENT: 125 case ApplicationCacheHost::OBSOLETE_EVENT:
126 return EventTypeNames::obsolete; 126 return EventTypeNames::obsolete;
127 } 127 }
128 ASSERT_NOT_REACHED(); 128 ASSERT_NOT_REACHED();
129 return EventTypeNames::error; 129 return EventTypeNames::error;
130 } 130 }
131 131
132 } // namespace blink 132 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698