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

Side by Side Diff: Source/core/fetch/MemoryCache.cpp

Issue 887463003: Turn WorkerLoaderProxy into a threadsafe, ref-counted object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clarify WorkerLoaderProxyProvider's obligations on shutdown Created 5 years, 10 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/loader/WorkerLoaderClientBridge.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) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 MemoryCacheEntry* entry = getEntryForResource(resource); 628 MemoryCacheEntry* entry = getEntryForResource(resource);
629 if (!entry) 629 if (!entry)
630 return MemoryCacheLiveResourcePriorityUnknown; 630 return MemoryCacheLiveResourcePriorityUnknown;
631 return entry->m_liveResourcePriority; 631 return entry->m_liveResourcePriority;
632 } 632 }
633 633
634 void MemoryCache::removeURLFromCache(ExecutionContext* context, const KURL& url) 634 void MemoryCache::removeURLFromCache(ExecutionContext* context, const KURL& url)
635 { 635 {
636 if (context->isWorkerGlobalScope()) { 636 if (context->isWorkerGlobalScope()) {
637 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); 637 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
638 workerGlobalScope->thread()->workerLoaderProxy().postTaskToLoader(create CrossThreadTask(&removeURLFromCacheInternal, url)); 638 workerGlobalScope->thread()->workerLoaderProxy()->postTaskToLoader(creat eCrossThreadTask(&removeURLFromCacheInternal, url));
639 return; 639 return;
640 } 640 }
641 removeURLFromCacheInternal(context, url); 641 removeURLFromCacheInternal(context, url);
642 } 642 }
643 643
644 void MemoryCache::removeURLFromCacheInternal(ExecutionContext*, const KURL& url) 644 void MemoryCache::removeURLFromCacheInternal(ExecutionContext*, const KURL& url)
645 { 645 {
646 WillBeHeapVector<Member<Resource>> resources = memoryCache()->resourcesForUR L(url); 646 WillBeHeapVector<Member<Resource>> resources = memoryCache()->resourcesForUR L(url);
647 for (Resource* resource : resources) 647 for (Resource* resource : resources)
648 memoryCache()->remove(resource); 648 memoryCache()->remove(resource);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", currentResource->de codedSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overhe adSize()) / 1024.0f, current->m_accessCount, currentResource->hasClients(), curr entResource->isPurgeable(), currentResource->wasPurged()); 855 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", currentResource->de codedSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overhe adSize()) / 1024.0f, current->m_accessCount, currentResource->hasClients(), curr entResource->isPurgeable(), currentResource->wasPurged());
856 856
857 current = current->m_previousInAllResourcesList; 857 current = current->m_previousInAllResourcesList;
858 } 858 }
859 } 859 }
860 } 860 }
861 861
862 #endif // MEMORY_CACHE_STATS 862 #endif // MEMORY_CACHE_STATS
863 863
864 } // namespace blink 864 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/loader/WorkerLoaderClientBridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698