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

Side by Side Diff: Source/core/loader/cache/Resource.cpp

Issue 19393004: Allow eviction of ImageBitmaps that are created from ImageElements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix for assertion failure. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/cache/Resource.h ('k') | Source/core/page/ImageBitmap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 , m_cancelTimer(this, &Resource::cancelTimerFired) 99 , m_cancelTimer(this, &Resource::cancelTimerFired)
100 , m_lastDecodedAccessTime(0) 100 , m_lastDecodedAccessTime(0)
101 , m_loadFinishTime(0) 101 , m_loadFinishTime(0)
102 , m_identifier(0) 102 , m_identifier(0)
103 , m_encodedSize(0) 103 , m_encodedSize(0)
104 , m_decodedSize(0) 104 , m_decodedSize(0)
105 , m_accessCount(0) 105 , m_accessCount(0)
106 , m_handleCount(0) 106 , m_handleCount(0)
107 , m_preloadCount(0) 107 , m_preloadCount(0)
108 , m_preloadResult(PreloadNotReferenced) 108 , m_preloadResult(PreloadNotReferenced)
109 , m_cacheLiveResourcePriority(CacheLiveResourcePriorityLow)
109 , m_inLiveDecodedResourcesList(false) 110 , m_inLiveDecodedResourcesList(false)
110 , m_requestedFromNetworkingLayer(false) 111 , m_requestedFromNetworkingLayer(false)
111 , m_inCache(false) 112 , m_inCache(false)
112 , m_loading(false) 113 , m_loading(false)
113 , m_switchingClientsToRevalidatedResource(false) 114 , m_switchingClientsToRevalidatedResource(false)
114 , m_type(type) 115 , m_type(type)
115 , m_status(Pending) 116 , m_status(Pending)
116 #ifndef NDEBUG 117 #ifndef NDEBUG
117 , m_deleted(false) 118 , m_deleted(false)
118 , m_lruIndex(0) 119 , m_lruIndex(0)
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 WebKit::Platform::current()->cacheMetadata(m_response.url(), m_response.resp onseTime(), serializedData.data(), serializedData.size()); 337 WebKit::Platform::current()->cacheMetadata(m_response.url(), m_response.resp onseTime(), serializedData.data(), serializedData.size());
337 } 338 }
338 339
339 CachedMetadata* Resource::cachedMetadata(unsigned dataTypeID) const 340 CachedMetadata* Resource::cachedMetadata(unsigned dataTypeID) const
340 { 341 {
341 if (!m_cachedMetadata || m_cachedMetadata->dataTypeID() != dataTypeID) 342 if (!m_cachedMetadata || m_cachedMetadata->dataTypeID() != dataTypeID)
342 return 0; 343 return 0;
343 return m_cachedMetadata.get(); 344 return m_cachedMetadata.get();
344 } 345 }
345 346
347 void Resource::setCacheLiveResourcePriority(CacheLiveResourcePriority priority)
348 {
349 if (inCache() && m_inLiveDecodedResourcesList && m_cacheLiveResourcePriority != priority) {
350 memoryCache()->removeFromLiveDecodedResourcesList(this);
351 m_cacheLiveResourcePriority = priority;
352 memoryCache()->insertInLiveDecodedResourcesList(this);
353 memoryCache()->prune();
354 }
355 }
356
346 void Resource::clearLoader() 357 void Resource::clearLoader()
347 { 358 {
348 m_loader = 0; 359 m_loader = 0;
349 } 360 }
350 361
351 void Resource::addClient(ResourceClient* client) 362 void Resource::addClient(ResourceClient* client)
352 { 363 {
353 if (addClientToSet(client)) 364 if (addClientToSet(client))
354 didAddClient(client); 365 didAddClient(client);
355 } 366 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 memoryCache()->insertInLRUList(this); 526 memoryCache()->insertInLRUList(this);
516 527
517 // Update the cache's size totals. 528 // Update the cache's size totals.
518 memoryCache()->adjustSize(hasClients(), delta); 529 memoryCache()->adjustSize(hasClients(), delta);
519 } 530 }
520 } 531 }
521 532
522 void Resource::didAccessDecodedData(double timeStamp) 533 void Resource::didAccessDecodedData(double timeStamp)
523 { 534 {
524 m_lastDecodedAccessTime = timeStamp; 535 m_lastDecodedAccessTime = timeStamp;
525
526 if (inCache()) { 536 if (inCache()) {
527 if (m_inLiveDecodedResourcesList) { 537 if (m_inLiveDecodedResourcesList) {
528 memoryCache()->removeFromLiveDecodedResourcesList(this); 538 memoryCache()->removeFromLiveDecodedResourcesList(this);
529 memoryCache()->insertInLiveDecodedResourcesList(this); 539 memoryCache()->insertInLiveDecodedResourcesList(this);
530 } 540 }
531 memoryCache()->prune(); 541 memoryCache()->prune();
532 } 542 }
533 } 543 }
534 544
535 void Resource::setResourceToRevalidate(Resource* resource) 545 void Resource::setResourceToRevalidate(Resource* resource)
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 if (m_callbackTimer.isActive()) 829 if (m_callbackTimer.isActive())
820 m_callbackTimer.stop(); 830 m_callbackTimer.stop();
821 } 831 }
822 832
823 void Resource::ResourceCallback::timerFired(Timer<ResourceCallback>*) 833 void Resource::ResourceCallback::timerFired(Timer<ResourceCallback>*)
824 { 834 {
825 m_resource->didAddClient(m_client); 835 m_resource->didAddClient(m_client);
826 } 836 }
827 837
828 } 838 }
839
OLDNEW
« no previous file with comments | « Source/core/loader/cache/Resource.h ('k') | Source/core/page/ImageBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698