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

Side by Side Diff: cc/raster/staging_buffer_pool.cc

Issue 2367953002: Implement OnMemoryStateChange for Various CC Classes (Closed)
Patch Set: feedback Created 4 years, 3 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 | « no previous file | cc/resources/resource_pool.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/raster/staging_buffer_pool.h" 5 #include "cc/raster/staging_buffer_pool.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/memory_coordinator_client_registry.h" 9 #include "base/memory/memory_coordinator_client_registry.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 void StagingBufferPool::OnMemoryStateChange(base::MemoryState state) { 419 void StagingBufferPool::OnMemoryStateChange(base::MemoryState state) {
420 switch (state) { 420 switch (state) {
421 case base::MemoryState::NORMAL: 421 case base::MemoryState::NORMAL:
422 // TODO(tasak): go back to normal state. 422 // TODO(tasak): go back to normal state.
423 break; 423 break;
424 case base::MemoryState::THROTTLED: 424 case base::MemoryState::THROTTLED:
425 // TODO(tasak): make the limits of this component's caches smaller to 425 // TODO(tasak): make the limits of this component's caches smaller to
426 // save memory usage. 426 // save memory usage.
427 break; 427 break;
428 case base::MemoryState::SUSPENDED: 428 case base::MemoryState::SUSPENDED:
429 // TODO(tasak): free this component's caches as much as possible before 429 // Release all buffers, regardless of how recently they were used.
430 // suspending renderer. 430 ReleaseBuffersNotUsedSince(base::TimeTicks() + base::TimeDelta::Max());
431 break; 431 break;
432 case base::MemoryState::UNKNOWN: 432 case base::MemoryState::UNKNOWN:
433 // NOT_REACHED. 433 // NOT_REACHED.
434 break; 434 break;
435 } 435 }
436 } 436 }
437 437
438 } // namespace cc 438 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698