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

Side by Side Diff: cc/resources/resource_pool.cc

Issue 2367953002: Implement OnMemoryStateChange for Various CC Classes (Closed)
Patch Set: feedback Created 4 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
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/resource_pool_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "cc/resources/resource_pool.h" 5 #include "cc/resources/resource_pool.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 void ResourcePool::OnMemoryStateChange(base::MemoryState state) { 462 void ResourcePool::OnMemoryStateChange(base::MemoryState state) {
463 switch (state) { 463 switch (state) {
464 case base::MemoryState::NORMAL: 464 case base::MemoryState::NORMAL:
465 // TODO(tasak): go back to normal state. 465 // TODO(tasak): go back to normal state.
466 break; 466 break;
467 case base::MemoryState::THROTTLED: 467 case base::MemoryState::THROTTLED:
468 // TODO(tasak): make the limits of this component's caches smaller to 468 // TODO(tasak): make the limits of this component's caches smaller to
469 // save memory usage. 469 // save memory usage.
470 break; 470 break;
471 case base::MemoryState::SUSPENDED: 471 case base::MemoryState::SUSPENDED:
472 // TODO(tasak): free this component's caches as much as possible before 472 // Release all resources, regardless of how recently they were used.
473 // suspending renderer. 473 EvictResourcesNotUsedSince(base::TimeTicks() + base::TimeDelta::Max());
474 break; 474 break;
475 case base::MemoryState::UNKNOWN: 475 case base::MemoryState::UNKNOWN:
476 // NOT_REACHED. 476 // NOT_REACHED.
477 break; 477 break;
478 } 478 }
479 } 479 }
480 480
481 } // namespace cc 481 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/resource_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698