| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 assertAlive(); | 143 assertAlive(); |
| 144 | 144 |
| 145 #ifdef ENABLE_RESOURCE_IS_DELETED_CHECK | 145 #ifdef ENABLE_RESOURCE_IS_DELETED_CHECK |
| 146 m_deleted = true; | 146 m_deleted = true; |
| 147 #endif | 147 #endif |
| 148 #ifndef NDEBUG | 148 #ifndef NDEBUG |
| 149 cachedResourceLeakCounter.decrement(); | 149 cachedResourceLeakCounter.decrement(); |
| 150 #endif | 150 #endif |
| 151 } | 151 } |
| 152 | 152 |
| 153 void Resource::dispose() |
| 154 { |
| 155 } |
| 156 |
| 153 void Resource::failBeforeStarting() | 157 void Resource::failBeforeStarting() |
| 154 { | 158 { |
| 155 WTF_LOG(ResourceLoading, "Cannot start loading '%s'", url().string().latin1(
).data()); | 159 WTF_LOG(ResourceLoading, "Cannot start loading '%s'", url().string().latin1(
).data()); |
| 156 error(Resource::LoadError); | 160 error(Resource::LoadError); |
| 157 } | 161 } |
| 158 | 162 |
| 159 void Resource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions& optio
ns) | 163 void Resource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions& optio
ns) |
| 160 { | 164 { |
| 161 if (!fetcher->frame()) { | 165 if (!fetcher->frame()) { |
| 162 failBeforeStarting(); | 166 failBeforeStarting(); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 ResourcePtr<Resource> protect(this); | 548 ResourcePtr<Resource> protect(this); |
| 545 m_loader->cancelIfNotFinishing(); | 549 m_loader->cancelIfNotFinishing(); |
| 546 if (m_status != Cached) | 550 if (m_status != Cached) |
| 547 memoryCache()->remove(this); | 551 memoryCache()->remove(this); |
| 548 } | 552 } |
| 549 | 553 |
| 550 bool Resource::deleteIfPossible() | 554 bool Resource::deleteIfPossible() |
| 551 { | 555 { |
| 552 if (canDelete() && !memoryCache()->contains(this)) { | 556 if (canDelete() && !memoryCache()->contains(this)) { |
| 553 InspectorInstrumentation::willDestroyResource(this); | 557 InspectorInstrumentation::willDestroyResource(this); |
| 558 dispose(); |
| 554 delete this; | 559 delete this; |
| 555 return true; | 560 return true; |
| 556 } | 561 } |
| 557 return false; | 562 return false; |
| 558 } | 563 } |
| 559 | 564 |
| 560 void Resource::setDecodedSize(size_t decodedSize) | 565 void Resource::setDecodedSize(size_t decodedSize) |
| 561 { | 566 { |
| 562 if (decodedSize == m_decodedSize) | 567 if (decodedSize == m_decodedSize) |
| 563 return; | 568 return; |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 return "ImportResource"; | 995 return "ImportResource"; |
| 991 case Resource::Media: | 996 case Resource::Media: |
| 992 return "Media"; | 997 return "Media"; |
| 993 } | 998 } |
| 994 ASSERT_NOT_REACHED(); | 999 ASSERT_NOT_REACHED(); |
| 995 return "Unknown"; | 1000 return "Unknown"; |
| 996 } | 1001 } |
| 997 #endif // !LOG_DISABLED | 1002 #endif // !LOG_DISABLED |
| 998 | 1003 |
| 999 } | 1004 } |
| OLD | NEW |