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

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

Issue 17648006: Rename WorkerContext to WorkerGlobalScope (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 6 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
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 17 matching lines...) Expand all
28 #include "core/dom/Document.h" 28 #include "core/dom/Document.h"
29 #include "core/dom/WebCoreMemoryInstrumentation.h" 29 #include "core/dom/WebCoreMemoryInstrumentation.h"
30 #include "core/loader/FrameLoader.h" 30 #include "core/loader/FrameLoader.h"
31 #include "core/loader/FrameLoaderTypes.h" 31 #include "core/loader/FrameLoaderTypes.h"
32 #include "core/loader/cache/CachedResource.h" 32 #include "core/loader/cache/CachedResource.h"
33 #include "core/loader/cache/CachedResourceHandle.h" 33 #include "core/loader/cache/CachedResourceHandle.h"
34 #include "core/page/FrameView.h" 34 #include "core/page/FrameView.h"
35 #include "core/platform/Logging.h" 35 #include "core/platform/Logging.h"
36 #include "core/platform/graphics/Image.h" 36 #include "core/platform/graphics/Image.h"
37 #include "core/platform/network/ResourceHandle.h" 37 #include "core/platform/network/ResourceHandle.h"
38 #include "core/workers/WorkerContext.h" 38 #include "core/workers/WorkerGlobalScope.h"
39 #include "core/workers/WorkerLoaderProxy.h" 39 #include "core/workers/WorkerLoaderProxy.h"
40 #include "core/workers/WorkerThread.h" 40 #include "core/workers/WorkerThread.h"
41 #include "weborigin/SecurityOrigin.h" 41 #include "weborigin/SecurityOrigin.h"
42 #include "weborigin/SecurityOriginHash.h" 42 #include "weborigin/SecurityOriginHash.h"
43 #include "wtf/Assertions.h" 43 #include "wtf/Assertions.h"
44 #include "wtf/CurrentTime.h" 44 #include "wtf/CurrentTime.h"
45 #include "wtf/MathExtras.h" 45 #include "wtf/MathExtras.h"
46 #include "wtf/MemoryInstrumentationHashMap.h" 46 #include "wtf/MemoryInstrumentationHashMap.h"
47 #include "wtf/MemoryInstrumentationVector.h" 47 #include "wtf/MemoryInstrumentationVector.h"
48 #include "wtf/MemoryObjectInfo.h" 48 #include "wtf/MemoryObjectInfo.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 ASSERT(delta >= 0 || ((int)m_liveSize + delta >= 0)); 507 ASSERT(delta >= 0 || ((int)m_liveSize + delta >= 0));
508 m_liveSize += delta; 508 m_liveSize += delta;
509 } else { 509 } else {
510 ASSERT(delta >= 0 || ((int)m_deadSize + delta >= 0)); 510 ASSERT(delta >= 0 || ((int)m_deadSize + delta >= 0));
511 m_deadSize += delta; 511 m_deadSize += delta;
512 } 512 }
513 } 513 }
514 514
515 void MemoryCache::removeURLFromCache(ScriptExecutionContext* context, const KURL & url) 515 void MemoryCache::removeURLFromCache(ScriptExecutionContext* context, const KURL & url)
516 { 516 {
517 if (context->isWorkerContext()) { 517 if (context->isWorkerGlobalScope()) {
518 WorkerContext* workerContext = static_cast<WorkerContext*>(context); 518 WorkerGlobalScope* workerGlobalScope = static_cast<WorkerGlobalScope*>(c ontext);
519 workerContext->thread()->workerLoaderProxy().postTaskToLoader(createCall backTask(&removeURLFromCacheInternal, url)); 519 workerGlobalScope->thread()->workerLoaderProxy().postTaskToLoader(create CallbackTask(&removeURLFromCacheInternal, url));
520 return; 520 return;
521 } 521 }
522 removeURLFromCacheInternal(context, url); 522 removeURLFromCacheInternal(context, url);
523 } 523 }
524 524
525 void MemoryCache::removeURLFromCacheInternal(ScriptExecutionContext*, const KURL & url) 525 void MemoryCache::removeURLFromCacheInternal(ScriptExecutionContext*, const KURL & url)
526 { 526 {
527 if (CachedResource* resource = memoryCache()->resourceForURL(url)) 527 if (CachedResource* resource = memoryCache()->resourceForURL(url))
528 memoryCache()->remove(resource); 528 memoryCache()->remove(resource);
529 } 529 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", current->decodedSiz e() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, cur rent->accessCount(), current->hasClients(), current->isPurgeable(), current->was Purged()); 648 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", current->decodedSiz e() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, cur rent->accessCount(), current->hasClients(), current->isPurgeable(), current->was Purged());
649 649
650 current = prev; 650 current = prev;
651 } 651 }
652 } 652 }
653 } 653 }
654 654
655 #endif // MEMORY_CACHE_STATS 655 #endif // MEMORY_CACHE_STATS
656 656
657 } // namespace WebCore 657 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/loader/WorkerThreadableLoader.cpp ('k') | Source/core/workers/DedicatedWorkerContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698