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

Side by Side Diff: Source/web/ApplicationCacheHost.cpp

Issue 22802012: Rename DOMApplicationCache to ApplicationCache and expose it to JS (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove change to devtools and fix nits Created 7 years, 4 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
« no previous file with comments | « Source/core/page/Window.idl ('k') | Source/web/ApplicationCacheHostInternal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 25 matching lines...) Expand all
36 #include "public/platform/WebURLResponse.h" 36 #include "public/platform/WebURLResponse.h"
37 #include "public/platform/WebVector.h" 37 #include "public/platform/WebVector.h"
38 #include "ApplicationCacheHostInternal.h" 38 #include "ApplicationCacheHostInternal.h"
39 #include "WebFrameImpl.h" 39 #include "WebFrameImpl.h"
40 #include "bindings/v8/ExceptionStatePlaceholder.h" 40 #include "bindings/v8/ExceptionStatePlaceholder.h"
41 #include "core/dom/ProgressEvent.h" 41 #include "core/dom/ProgressEvent.h"
42 #include "core/inspector/InspectorApplicationCacheAgent.h" 42 #include "core/inspector/InspectorApplicationCacheAgent.h"
43 #include "core/inspector/InspectorInstrumentation.h" 43 #include "core/inspector/InspectorInstrumentation.h"
44 #include "core/loader/DocumentLoader.h" 44 #include "core/loader/DocumentLoader.h"
45 #include "core/loader/FrameLoader.h" 45 #include "core/loader/FrameLoader.h"
46 #include "core/loader/appcache/DOMApplicationCache.h" 46 #include "core/loader/appcache/ApplicationCache.h"
47 #include "core/page/Frame.h" 47 #include "core/page/Frame.h"
48 #include "core/page/Page.h" 48 #include "core/page/Page.h"
49 #include "core/page/Settings.h" 49 #include "core/page/Settings.h"
50 #include "core/platform/chromium/support/WrappedResourceRequest.h" 50 #include "core/platform/chromium/support/WrappedResourceRequest.h"
51 #include "core/platform/chromium/support/WrappedResourceResponse.h" 51 #include "core/platform/chromium/support/WrappedResourceResponse.h"
52 #include "weborigin/SecurityOrigin.h" 52 #include "weborigin/SecurityOrigin.h"
53 53
54 using namespace WebKit; 54 using namespace WebKit;
55 55
56 namespace WebCore { 56 namespace WebCore {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 void ApplicationCacheHost::willStartLoadingSynchronously(ResourceRequest& reques t) 153 void ApplicationCacheHost::willStartLoadingSynchronously(ResourceRequest& reques t)
154 { 154 {
155 if (m_internal) { 155 if (m_internal) {
156 WrappedResourceRequest wrapped(request); 156 WrappedResourceRequest wrapped(request);
157 m_internal->m_outerHost->willStartSubResourceRequest(wrapped); 157 m_internal->m_outerHost->willStartSubResourceRequest(wrapped);
158 } 158 }
159 } 159 }
160 160
161 void ApplicationCacheHost::setDOMApplicationCache(DOMApplicationCache* domApplic ationCache) 161 void ApplicationCacheHost::setApplicationCache(ApplicationCache* domApplicationC ache)
162 { 162 {
163 ASSERT(!m_domApplicationCache || !domApplicationCache); 163 ASSERT(!m_domApplicationCache || !domApplicationCache);
164 m_domApplicationCache = domApplicationCache; 164 m_domApplicationCache = domApplicationCache;
165 } 165 }
166 166
167 void ApplicationCacheHost::notifyDOMApplicationCache(EventID id, int total, int done) 167 void ApplicationCacheHost::notifyApplicationCache(EventID id, int total, int don e)
168 { 168 {
169 if (id != PROGRESS_EVENT) 169 if (id != PROGRESS_EVENT)
170 InspectorInstrumentation::updateApplicationCacheStatus(m_documentLoader- >frame()); 170 InspectorInstrumentation::updateApplicationCacheStatus(m_documentLoader- >frame());
171 171
172 if (m_defersEvents) { 172 if (m_defersEvents) {
173 // Event dispatching is deferred until document.onload has fired. 173 // Event dispatching is deferred until document.onload has fired.
174 m_deferredEvents.append(DeferredEvent(id, total, done)); 174 m_deferredEvents.append(DeferredEvent(id, total, done));
175 return; 175 return;
176 } 176 }
177 dispatchDOMEvent(id, total, done); 177 dispatchDOMEvent(id, total, done);
(...skipping 30 matching lines...) Expand all
208 const DeferredEvent& deferred = m_deferredEvents[i]; 208 const DeferredEvent& deferred = m_deferredEvents[i];
209 dispatchDOMEvent(deferred.eventID, deferred.progressTotal, deferred.prog ressDone); 209 dispatchDOMEvent(deferred.eventID, deferred.progressTotal, deferred.prog ressDone);
210 } 210 }
211 m_deferredEvents.clear(); 211 m_deferredEvents.clear();
212 m_defersEvents = false; 212 m_defersEvents = false;
213 } 213 }
214 214
215 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int total, int done) 215 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int total, int done)
216 { 216 {
217 if (m_domApplicationCache) { 217 if (m_domApplicationCache) {
218 const AtomicString& eventType = DOMApplicationCache::toEventType(id); 218 const AtomicString& eventType = ApplicationCache::toEventType(id);
219 RefPtr<Event> event; 219 RefPtr<Event> event;
220 if (id == PROGRESS_EVENT) 220 if (id == PROGRESS_EVENT)
221 event = ProgressEvent::create(eventType, true, done, total); 221 event = ProgressEvent::create(eventType, true, done, total);
222 else 222 else
223 event = Event::create(eventType, false, false); 223 event = Event::create(eventType, false, false);
224 m_domApplicationCache->dispatchEvent(event, ASSERT_NO_EXCEPTION); 224 m_domApplicationCache->dispatchEvent(event, ASSERT_NO_EXCEPTION);
225 } 225 }
226 } 226 }
227 227
228 ApplicationCacheHost::Status ApplicationCacheHost::status() const 228 ApplicationCacheHost::Status ApplicationCacheHost::status() const
(...skipping 21 matching lines...) Expand all
250 } 250 }
251 251
252 bool ApplicationCacheHost::isApplicationCacheEnabled() 252 bool ApplicationCacheHost::isApplicationCacheEnabled()
253 { 253 {
254 ASSERT(m_documentLoader->frame()); 254 ASSERT(m_documentLoader->frame());
255 return m_documentLoader->frame()->settings() 255 return m_documentLoader->frame()->settings()
256 && m_documentLoader->frame()->settings()->offlineWebApplicationCacheE nabled(); 256 && m_documentLoader->frame()->settings()->offlineWebApplicationCacheE nabled();
257 } 257 }
258 258
259 } // namespace WebCore 259 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/Window.idl ('k') | Source/web/ApplicationCacheHostInternal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698