| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 , m_decodedSize(0) | 303 , m_decodedSize(0) |
| 304 , m_overheadSize(calculateOverheadSize()) | 304 , m_overheadSize(calculateOverheadSize()) |
| 305 , m_preloadCount(0) | 305 , m_preloadCount(0) |
| 306 , m_cacheIdentifier(MemoryCache::defaultCacheIdentifier()) | 306 , m_cacheIdentifier(MemoryCache::defaultCacheIdentifier()) |
| 307 , m_preloadResult(PreloadNotReferenced) | 307 , m_preloadResult(PreloadNotReferenced) |
| 308 , m_type(type) | 308 , m_type(type) |
| 309 , m_status(NotStarted) | 309 , m_status(NotStarted) |
| 310 , m_needsSynchronousCacheHit(false) | 310 , m_needsSynchronousCacheHit(false) |
| 311 , m_linkPreload(false) | 311 , m_linkPreload(false) |
| 312 { | 312 { |
| 313 ThreadState::current()->registerPreFinalizer(this); | |
| 314 | |
| 315 ASSERT(m_type == unsigned(type)); // m_type is a bitfield, so this tests car
eless updates of the enum. | 313 ASSERT(m_type == unsigned(type)); // m_type is a bitfield, so this tests car
eless updates of the enum. |
| 316 InstanceCounters::incrementCounter(InstanceCounters::ResourceCounter); | 314 InstanceCounters::incrementCounter(InstanceCounters::ResourceCounter); |
| 317 | 315 |
| 318 // Currently we support the metadata caching only for HTTP family. | 316 // Currently we support the metadata caching only for HTTP family. |
| 319 if (m_resourceRequest.url().protocolIsInHTTPFamily()) | 317 if (m_resourceRequest.url().protocolIsInHTTPFamily()) |
| 320 m_cacheHandler = CachedMetadataHandlerImpl::create(this); | 318 m_cacheHandler = CachedMetadataHandlerImpl::create(this); |
| 321 } | 319 } |
| 322 | 320 |
| 323 Resource::~Resource() | 321 Resource::~Resource() |
| 324 { | 322 { |
| 325 InstanceCounters::decrementCounter(InstanceCounters::ResourceCounter); | 323 InstanceCounters::decrementCounter(InstanceCounters::ResourceCounter); |
| 326 } | 324 } |
| 327 | 325 |
| 328 void Resource::willDestroyResource() | |
| 329 { | |
| 330 willDestroyResourceInternal(); | |
| 331 } | |
| 332 | |
| 333 DEFINE_TRACE(Resource) | 326 DEFINE_TRACE(Resource) |
| 334 { | 327 { |
| 335 visitor->trace(m_loader); | 328 visitor->trace(m_loader); |
| 336 visitor->trace(m_cacheHandler); | 329 visitor->trace(m_cacheHandler); |
| 337 } | 330 } |
| 338 | 331 |
| 339 void Resource::load(ResourceFetcher* fetcher) | 332 void Resource::load(ResourceFetcher* fetcher) |
| 340 { | 333 { |
| 341 // TOOD(japhet): Temporary, out of place hack to stop a top crasher. | 334 // TOOD(japhet): Temporary, out of place hack to stop a top crasher. |
| 342 // Make this more organic. | 335 // Make this more organic. |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 case Resource::Media: | 1122 case Resource::Media: |
| 1130 return "Media"; | 1123 return "Media"; |
| 1131 case Resource::Manifest: | 1124 case Resource::Manifest: |
| 1132 return "Manifest"; | 1125 return "Manifest"; |
| 1133 } | 1126 } |
| 1134 ASSERT_NOT_REACHED(); | 1127 ASSERT_NOT_REACHED(); |
| 1135 return "Unknown"; | 1128 return "Unknown"; |
| 1136 } | 1129 } |
| 1137 | 1130 |
| 1138 } // namespace blink | 1131 } // namespace blink |
| OLD | NEW |