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

Side by Side Diff: cc/resources/prioritized_resource_manager.h

Issue 612323010: Align base::hash_map with C++11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try a different tack for C++ insanity Created 6 years, 2 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #ifndef CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_ 5 #ifndef CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_
6 #define CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_ 6 #define CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/containers/hash_tables.h" 12 #include "base/containers/hash_tables.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
15 #include "cc/base/cc_export.h" 15 #include "cc/base/cc_export.h"
16 #include "cc/resources/prioritized_resource.h" 16 #include "cc/resources/prioritized_resource.h"
17 #include "cc/resources/priority_calculator.h" 17 #include "cc/resources/priority_calculator.h"
18 #include "cc/resources/resource.h" 18 #include "cc/resources/resource.h"
19 #include "cc/trees/proxy.h" 19 #include "cc/trees/proxy.h"
20 #include "ui/gfx/size.h" 20 #include "ui/gfx/size.h"
21 21
22 #if defined(COMPILER_GCC)
23 namespace BASE_HASH_NAMESPACE {
24 template <> struct hash<cc::PrioritizedResource*> {
25 size_t operator()(cc::PrioritizedResource* ptr) const {
26 return hash<size_t>()(reinterpret_cast<size_t>(ptr));
27 }
28 };
29 } // namespace BASE_HASH_NAMESPACE
30 #endif // COMPILER
31
32 namespace cc { 22 namespace cc {
33 23
34 class PriorityCalculator; 24 class PriorityCalculator;
35 class Proxy; 25 class Proxy;
36 26
37 class CC_EXPORT PrioritizedResourceManager { 27 class CC_EXPORT PrioritizedResourceManager {
38 public: 28 public:
39 static scoped_ptr<PrioritizedResourceManager> Create(const Proxy* proxy) { 29 static scoped_ptr<PrioritizedResourceManager> Create(const Proxy* proxy) {
40 return make_scoped_ptr(new PrioritizedResourceManager(proxy)); 30 return make_scoped_ptr(new PrioritizedResourceManager(proxy));
41 } 31 }
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // Statistics copied at the time of PushTexturePrioritiesToBackings. 228 // Statistics copied at the time of PushTexturePrioritiesToBackings.
239 size_t memory_visible_last_pushed_bytes_; 229 size_t memory_visible_last_pushed_bytes_;
240 size_t memory_visible_and_nearby_last_pushed_bytes_; 230 size_t memory_visible_and_nearby_last_pushed_bytes_;
241 231
242 DISALLOW_COPY_AND_ASSIGN(PrioritizedResourceManager); 232 DISALLOW_COPY_AND_ASSIGN(PrioritizedResourceManager);
243 }; 233 };
244 234
245 } // namespace cc 235 } // namespace cc
246 236
247 #endif // CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_ 237 #endif // CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698