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

Side by Side Diff: third_party/WebKit/Source/platform/MemoryCoordinator.cpp

Issue 2940933003: DO NOT SUBMIT results of new clang-format (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/MemoryCoordinator.h" 5 #include "platform/MemoryCoordinator.h"
6 6
7 #include "base/sys_info.h" 7 #include "base/sys_info.h"
8 #include "platform/fonts/FontCache.h" 8 #include "platform/fonts/FontCache.h"
9 #include "platform/graphics/ImageDecodingStore.h" 9 #include "platform/graphics/ImageDecodingStore.h"
10 #include "platform/instrumentation/tracing/TraceEvent.h" 10 #include "platform/instrumentation/tracing/TraceEvent.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 // static 46 // static
47 MemoryCoordinator& MemoryCoordinator::Instance() { 47 MemoryCoordinator& MemoryCoordinator::Instance() {
48 DEFINE_STATIC_LOCAL(Persistent<MemoryCoordinator>, external, 48 DEFINE_STATIC_LOCAL(Persistent<MemoryCoordinator>, external,
49 (new MemoryCoordinator)); 49 (new MemoryCoordinator));
50 DCHECK(IsMainThread()); 50 DCHECK(IsMainThread());
51 return *external.Get(); 51 return *external.Get();
52 } 52 }
53 53
54
55 MemoryCoordinator::MemoryCoordinator() {} 54 MemoryCoordinator::MemoryCoordinator() {}
56 55
57 void MemoryCoordinator::RegisterClient(MemoryCoordinatorClient* client) { 56 void MemoryCoordinator::RegisterClient(MemoryCoordinatorClient* client) {
58 DCHECK(IsMainThread()); 57 DCHECK(IsMainThread());
59 DCHECK(client); 58 DCHECK(client);
60 DCHECK(!clients_.Contains(client)); 59 DCHECK(!clients_.Contains(client));
61 clients_.insert(client); 60 clients_.insert(client);
62 } 61 }
63 62
64 void MemoryCoordinator::UnregisterClient(MemoryCoordinatorClient* client) { 63 void MemoryCoordinator::UnregisterClient(MemoryCoordinatorClient* client) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // MemoryCoordinatorClients rather than clearing caches here. 96 // MemoryCoordinatorClients rather than clearing caches here.
98 ImageDecodingStore::Instance().Clear(); 97 ImageDecodingStore::Instance().Clear();
99 FontCache::GetFontCache()->Invalidate(); 98 FontCache::GetFontCache()->Invalidate();
100 } 99 }
101 100
102 DEFINE_TRACE(MemoryCoordinator) { 101 DEFINE_TRACE(MemoryCoordinator) {
103 visitor->Trace(clients_); 102 visitor->Trace(clients_);
104 } 103 }
105 104
106 } // namespace blink 105 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698