| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 { | 266 { |
| 267 RefPtr<DocumentLoader> protect(documentLoader()); | 267 RefPtr<DocumentLoader> protect(documentLoader()); |
| 268 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) { | 268 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) { |
| 269 const DeferredEvent& deferred = m_deferredEvents[i]; | 269 const DeferredEvent& deferred = m_deferredEvents[i]; |
| 270 dispatchDOMEvent(deferred.eventID, deferred.progressTotal, deferred.prog
ressDone); | 270 dispatchDOMEvent(deferred.eventID, deferred.progressTotal, deferred.prog
ressDone); |
| 271 } | 271 } |
| 272 m_deferredEvents.clear(); | 272 m_deferredEvents.clear(); |
| 273 m_defersEvents = false; | 273 m_defersEvents = false; |
| 274 } | 274 } |
| 275 | 275 |
| 276 #if ENABLE(INSPECTOR) | |
| 277 void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources) | 276 void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources) |
| 278 { | 277 { |
| 279 ApplicationCache* cache = applicationCache(); | 278 ApplicationCache* cache = applicationCache(); |
| 280 if (!cache || !cache->isComplete()) | 279 if (!cache || !cache->isComplete()) |
| 281 return; | 280 return; |
| 282 | 281 |
| 283 ApplicationCache::ResourceMap::const_iterator end = cache->end(); | 282 ApplicationCache::ResourceMap::const_iterator end = cache->end(); |
| 284 for (ApplicationCache::ResourceMap::const_iterator it = cache->begin(); it !
= end; ++it) { | 283 for (ApplicationCache::ResourceMap::const_iterator it = cache->begin(); it !
= end; ++it) { |
| 285 RefPtr<ApplicationCacheResource> resource = it->value; | 284 RefPtr<ApplicationCacheResource> resource = it->value; |
| 286 unsigned type = resource->type(); | 285 unsigned type = resource->type(); |
| 287 bool isMaster = type & ApplicationCacheResource::Master; | 286 bool isMaster = type & ApplicationCacheResource::Master; |
| 288 bool isManifest = type & ApplicationCacheResource::Manifest; | 287 bool isManifest = type & ApplicationCacheResource::Manifest; |
| 289 bool isExplicit = type & ApplicationCacheResource::Explicit; | 288 bool isExplicit = type & ApplicationCacheResource::Explicit; |
| 290 bool isForeign = type & ApplicationCacheResource::Foreign; | 289 bool isForeign = type & ApplicationCacheResource::Foreign; |
| 291 bool isFallback = type & ApplicationCacheResource::Fallback; | 290 bool isFallback = type & ApplicationCacheResource::Fallback; |
| 292 resources->append(ResourceInfo(resource->url(), isMaster, isManifest, is
Fallback, isForeign, isExplicit, resource->estimatedSizeInStorage())); | 291 resources->append(ResourceInfo(resource->url(), isMaster, isManifest, is
Fallback, isForeign, isExplicit, resource->estimatedSizeInStorage())); |
| 293 } | 292 } |
| 294 } | 293 } |
| 295 | 294 |
| 296 ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo() | 295 ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo() |
| 297 { | 296 { |
| 298 ApplicationCache* cache = applicationCache(); | 297 ApplicationCache* cache = applicationCache(); |
| 299 if (!cache || !cache->isComplete()) | 298 if (!cache || !cache->isComplete()) |
| 300 return CacheInfo(KURL(), 0, 0, 0); | 299 return CacheInfo(KURL(), 0, 0, 0); |
| 301 | 300 |
| 302 // FIXME: Add "Creation Time" and "Update Time" to Application Caches. | 301 // FIXME: Add "Creation Time" and "Update Time" to Application Caches. |
| 303 return CacheInfo(cache->manifestResource()->url(), 0, 0, cache->estimatedSiz
eInStorage()); | 302 return CacheInfo(cache->manifestResource()->url(), 0, 0, cache->estimatedSiz
eInStorage()); |
| 304 } | 303 } |
| 305 #endif | |
| 306 | 304 |
| 307 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int total, int done) | 305 void ApplicationCacheHost::dispatchDOMEvent(EventID id, int total, int done) |
| 308 { | 306 { |
| 309 if (m_domApplicationCache) { | 307 if (m_domApplicationCache) { |
| 310 const AtomicString& eventType = DOMApplicationCache::toEventType(id); | 308 const AtomicString& eventType = DOMApplicationCache::toEventType(id); |
| 311 RefPtr<Event> event; | 309 RefPtr<Event> event; |
| 312 if (id == PROGRESS_EVENT) | 310 if (id == PROGRESS_EVENT) |
| 313 event = ProgressEvent::create(eventType, true, done, total); | 311 event = ProgressEvent::create(eventType, true, done, total); |
| 314 else | 312 else |
| 315 event = Event::create(eventType, false, false); | 313 event = Event::create(eventType, false, false); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 } | 467 } |
| 470 } | 468 } |
| 471 | 469 |
| 472 bool ApplicationCacheHost::isApplicationCacheEnabled() | 470 bool ApplicationCacheHost::isApplicationCacheEnabled() |
| 473 { | 471 { |
| 474 return m_documentLoader->frame()->settings() | 472 return m_documentLoader->frame()->settings() |
| 475 && m_documentLoader->frame()->settings()->offlineWebApplicationCacheE
nabled(); | 473 && m_documentLoader->frame()->settings()->offlineWebApplicationCacheE
nabled(); |
| 476 } | 474 } |
| 477 | 475 |
| 478 } // namespace WebCore | 476 } // namespace WebCore |
| OLD | NEW |