| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 if (frame->document()->url().protocolIs("https") | 135 if (frame->document()->url().protocolIs("https") |
| 136 && (frame->loader()->documentLoader()->response().cacheControlContainsNo
Cache() | 136 && (frame->loader()->documentLoader()->response().cacheControlContainsNo
Cache() |
| 137 || frame->loader()->documentLoader()->response().cacheControlContain
sNoStore())) { | 137 || frame->loader()->documentLoader()->response().cacheControlContain
sNoStore())) { |
| 138 PCLOG(" -Frame is HTTPS, and cache control prohibits caching or storin
g"); | 138 PCLOG(" -Frame is HTTPS, and cache control prohibits caching or storin
g"); |
| 139 rejectReasons |= 1 << IsHttpsAndCacheControlled; | 139 rejectReasons |= 1 << IsHttpsAndCacheControlled; |
| 140 } | 140 } |
| 141 if (frame->document()->domWindow() && frame->document()->domWindow()->hasEve
ntListeners(eventNames().unloadEvent)) { | 141 if (frame->document()->domWindow() && frame->document()->domWindow()->hasEve
ntListeners(eventNames().unloadEvent)) { |
| 142 PCLOG(" -Frame has an unload event listener"); | 142 PCLOG(" -Frame has an unload event listener"); |
| 143 rejectReasons |= 1 << HasUnloadListener; | 143 rejectReasons |= 1 << HasUnloadListener; |
| 144 } | 144 } |
| 145 #if ENABLE(SQL_DATABASE) | |
| 146 if (DatabaseManager::manager().hasOpenDatabases(frame->document())) { | 145 if (DatabaseManager::manager().hasOpenDatabases(frame->document())) { |
| 147 PCLOG(" -Frame has open database handles"); | 146 PCLOG(" -Frame has open database handles"); |
| 148 rejectReasons |= 1 << HasDatabaseHandles; | 147 rejectReasons |= 1 << HasDatabaseHandles; |
| 149 } | 148 } |
| 150 #endif | |
| 151 #if ENABLE(SHARED_WORKERS) | 149 #if ENABLE(SHARED_WORKERS) |
| 152 if (SharedWorkerRepository::hasSharedWorkers(frame->document())) { | 150 if (SharedWorkerRepository::hasSharedWorkers(frame->document())) { |
| 153 PCLOG(" -Frame has associated SharedWorkers"); | 151 PCLOG(" -Frame has associated SharedWorkers"); |
| 154 rejectReasons |= 1 << HasSharedWorkers; | 152 rejectReasons |= 1 << HasSharedWorkers; |
| 155 } | 153 } |
| 156 #endif | 154 #endif |
| 157 if (!frame->loader()->history()->currentItem()) { | 155 if (!frame->loader()->history()->currentItem()) { |
| 158 PCLOG(" -No current history item"); | 156 PCLOG(" -No current history item"); |
| 159 rejectReasons |= 1 << NoHistoryItem; | 157 rejectReasons |= 1 << NoHistoryItem; |
| 160 } | 158 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 DocumentLoader* documentLoader = frameLoader->documentLoader(); | 341 DocumentLoader* documentLoader = frameLoader->documentLoader(); |
| 344 Document* document = frame->document(); | 342 Document* document = frame->document(); |
| 345 | 343 |
| 346 return documentLoader | 344 return documentLoader |
| 347 && documentLoader->mainDocumentError().isNull() | 345 && documentLoader->mainDocumentError().isNull() |
| 348 // Do not cache error pages (these can be recognized as pages with subst
itute data or unreachable URLs). | 346 // Do not cache error pages (these can be recognized as pages with subst
itute data or unreachable URLs). |
| 349 && !(documentLoader->substituteData().isValid() && !documentLoader->subs
tituteData().failingURL().isEmpty()) | 347 && !(documentLoader->substituteData().isValid() && !documentLoader->subs
tituteData().failingURL().isEmpty()) |
| 350 && (!frameLoader->subframeLoader()->containsPlugins() || frame->page()->
settings()->pageCacheSupportsPlugins()) | 348 && (!frameLoader->subframeLoader()->containsPlugins() || frame->page()->
settings()->pageCacheSupportsPlugins()) |
| 351 && (!document->url().protocolIs("https") || (!documentLoader->response()
.cacheControlContainsNoCache() && !documentLoader->response().cacheControlContai
nsNoStore())) | 349 && (!document->url().protocolIs("https") || (!documentLoader->response()
.cacheControlContainsNoCache() && !documentLoader->response().cacheControlContai
nsNoStore())) |
| 352 && (!document->domWindow() || !document->domWindow()->hasEventListeners(
eventNames().unloadEvent)) | 350 && (!document->domWindow() || !document->domWindow()->hasEventListeners(
eventNames().unloadEvent)) |
| 353 #if ENABLE(SQL_DATABASE) | |
| 354 && !DatabaseManager::manager().hasOpenDatabases(document) | 351 && !DatabaseManager::manager().hasOpenDatabases(document) |
| 355 #endif | |
| 356 #if ENABLE(SHARED_WORKERS) | 352 #if ENABLE(SHARED_WORKERS) |
| 357 && !SharedWorkerRepository::hasSharedWorkers(document) | 353 && !SharedWorkerRepository::hasSharedWorkers(document) |
| 358 #endif | 354 #endif |
| 359 && frameLoader->history()->currentItem() | 355 && frameLoader->history()->currentItem() |
| 360 && !frameLoader->quickRedirectComing() | 356 && !frameLoader->quickRedirectComing() |
| 361 && !documentLoader->isLoadingInAPISense() | 357 && !documentLoader->isLoadingInAPISense() |
| 362 && !documentLoader->isStopping() | 358 && !documentLoader->isStopping() |
| 363 && document->canSuspendActiveDOMObjects() | 359 && document->canSuspendActiveDOMObjects() |
| 364 // FIXME: We should investigating caching frames that have an associated | 360 // FIXME: We should investigating caching frames that have an associated |
| 365 // application cache. <rdar://problem/5917899> tracks that work. | 361 // application cache. <rdar://problem/5917899> tracks that work. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 if (!item->m_prev) { | 524 if (!item->m_prev) { |
| 529 ASSERT(item == m_head); | 525 ASSERT(item == m_head); |
| 530 m_head = item->m_next; | 526 m_head = item->m_next; |
| 531 } else { | 527 } else { |
| 532 ASSERT(item != m_head); | 528 ASSERT(item != m_head); |
| 533 item->m_prev->m_next = item->m_next; | 529 item->m_prev->m_next = item->m_next; |
| 534 } | 530 } |
| 535 } | 531 } |
| 536 | 532 |
| 537 } // namespace WebCore | 533 } // namespace WebCore |
| OLD | NEW |