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

Side by Side Diff: third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp

Issue 2068053002: Rename Blink constants generated from IDL files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 void ApplicationCacheHost::detachFromDocumentLoader() 183 void ApplicationCacheHost::detachFromDocumentLoader()
184 { 184 {
185 // Detach from the owning DocumentLoader and let go of WebApplicationCacheHo st. 185 // Detach from the owning DocumentLoader and let go of WebApplicationCacheHo st.
186 setApplicationCache(nullptr); 186 setApplicationCache(nullptr);
187 m_host.reset(); 187 m_host.reset();
188 m_documentLoader = nullptr; 188 m_documentLoader = nullptr;
189 } 189 }
190 190
191 void ApplicationCacheHost::notifyApplicationCache(EventID id, int progressTotal, int progressDone, WebApplicationCacheHost::ErrorReason errorReason, const Strin g& errorURL, int errorStatus, const String& errorMessage) 191 void ApplicationCacheHost::notifyApplicationCache(EventID id, int progressTotal, int progressDone, WebApplicationCacheHost::ErrorReason errorReason, const Strin g& errorURL, int errorStatus, const String& errorMessage)
192 { 192 {
193 if (id != PROGRESS_EVENT) 193 if (id != kProgressEvent)
194 InspectorInstrumentation::updateApplicationCacheStatus(m_documentLoader- >frame()); 194 InspectorInstrumentation::updateApplicationCacheStatus(m_documentLoader- >frame());
195 195
196 if (m_defersEvents) { 196 if (m_defersEvents) {
197 // Event dispatching is deferred until document.onload has fired. 197 // Event dispatching is deferred until document.onload has fired.
198 m_deferredEvents.append(DeferredEvent(id, progressTotal, progressDone, e rrorReason, errorURL, errorStatus, errorMessage)); 198 m_deferredEvents.append(DeferredEvent(id, progressTotal, progressDone, e rrorReason, errorURL, errorStatus, errorMessage));
199 return; 199 return;
200 } 200 }
201 dispatchDOMEvent(id, progressTotal, progressDone, errorReason, errorURL, err orStatus, errorMessage); 201 dispatchDOMEvent(id, progressTotal, progressDone, errorReason, errorURL, err orStatus, errorMessage);
202 } 202 }
203 203
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int progressTotal, int p rogressDone, WebApplicationCacheHost::ErrorReason errorReason, const String& err orURL, int errorStatus, const String& errorMessage) 238 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int progressTotal, int p rogressDone, WebApplicationCacheHost::ErrorReason errorReason, const String& err orURL, int errorStatus, const String& errorMessage)
239 { 239 {
240 if (!m_domApplicationCache) 240 if (!m_domApplicationCache)
241 return; 241 return;
242 242
243 const AtomicString& eventType = ApplicationCache::toEventType(id); 243 const AtomicString& eventType = ApplicationCache::toEventType(id);
244 if (eventType.isEmpty() || !m_domApplicationCache->getExecutionContext()) 244 if (eventType.isEmpty() || !m_domApplicationCache->getExecutionContext())
245 return; 245 return;
246 Event* event = nullptr; 246 Event* event = nullptr;
247 if (id == PROGRESS_EVENT) 247 if (id == kProgressEvent)
248 event = ProgressEvent::create(eventType, true, progressDone, progressTot al); 248 event = ProgressEvent::create(eventType, true, progressDone, progressTot al);
249 else if (id == ERROR_EVENT) 249 else if (id == kErrorEvent)
250 event = ApplicationCacheErrorEvent::create(errorReason, errorURL, errorS tatus, errorMessage); 250 event = ApplicationCacheErrorEvent::create(errorReason, errorURL, errorS tatus, errorMessage);
251 else 251 else
252 event = Event::create(eventType); 252 event = Event::create(eventType);
253 m_domApplicationCache->dispatchEvent(event); 253 m_domApplicationCache->dispatchEvent(event);
254 } 254 }
255 255
256 ApplicationCacheHost::Status ApplicationCacheHost::getStatus() const 256 ApplicationCacheHost::Status ApplicationCacheHost::getStatus() const
257 { 257 {
258 return m_host ? static_cast<Status>(m_host->getStatus()) : UNCACHED; 258 return m_host ? static_cast<Status>(m_host->getStatus()) : kUncached;
259 } 259 }
260 260
261 bool ApplicationCacheHost::update() 261 bool ApplicationCacheHost::update()
262 { 262 {
263 return m_host ? m_host->startUpdate() : false; 263 return m_host ? m_host->startUpdate() : false;
264 } 264 }
265 265
266 bool ApplicationCacheHost::swapCache() 266 bool ApplicationCacheHost::swapCache()
267 { 267 {
268 bool success = m_host ? m_host->swapCache() : false; 268 bool success = m_host ? m_host->swapCache() : false;
(...skipping 19 matching lines...) Expand all
288 // FIXME: Prod the inspector to update its notion of what cache the page is using. 288 // FIXME: Prod the inspector to update its notion of what cache the page is using.
289 } 289 }
290 290
291 void ApplicationCacheHost::notifyEventListener(WebApplicationCacheHost::EventID eventID) 291 void ApplicationCacheHost::notifyEventListener(WebApplicationCacheHost::EventID eventID)
292 { 292 {
293 notifyApplicationCache(static_cast<ApplicationCacheHost::EventID>(eventID), 0, 0, WebApplicationCacheHost::UnknownError, String(), 0, String()); 293 notifyApplicationCache(static_cast<ApplicationCacheHost::EventID>(eventID), 0, 0, WebApplicationCacheHost::UnknownError, String(), 0, String());
294 } 294 }
295 295
296 void ApplicationCacheHost::notifyProgressEventListener(const WebURL&, int progre ssTotal, int progressDone) 296 void ApplicationCacheHost::notifyProgressEventListener(const WebURL&, int progre ssTotal, int progressDone)
297 { 297 {
298 notifyApplicationCache(PROGRESS_EVENT, progressTotal, progressDone, WebAppli cationCacheHost::UnknownError, String(), 0, String()); 298 notifyApplicationCache(kProgressEvent, progressTotal, progressDone, WebAppli cationCacheHost::UnknownError, String(), 0, String());
299 } 299 }
300 300
301 void ApplicationCacheHost::notifyErrorEventListener(WebApplicationCacheHost::Err orReason reason, const WebURL& url, int status, const WebString& message) 301 void ApplicationCacheHost::notifyErrorEventListener(WebApplicationCacheHost::Err orReason reason, const WebURL& url, int status, const WebString& message)
302 { 302 {
303 notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, mess age); 303 notifyApplicationCache(kErrorEvent, 0, 0, reason, url.string(), status, mess age);
304 } 304 }
305 305
306 DEFINE_TRACE(ApplicationCacheHost) 306 DEFINE_TRACE(ApplicationCacheHost)
307 { 307 {
308 visitor->trace(m_domApplicationCache); 308 visitor->trace(m_domApplicationCache);
309 visitor->trace(m_documentLoader); 309 visitor->trace(m_documentLoader);
310 } 310 }
311 311
312 } // namespace blink 312 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698