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

Unified Diff: content/browser/renderer_host/frame_memory_manager.cc

Issue 25942002: Make software compositing work on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows resolve Created 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/frame_memory_manager.cc
diff --git a/content/browser/renderer_host/frame_memory_manager.cc b/content/browser/renderer_host/frame_memory_manager.cc
deleted file mode 100644
index 708bddfa61b9cefd1a5a8d9c95a661717e4eea2d..0000000000000000000000000000000000000000
--- a/content/browser/renderer_host/frame_memory_manager.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/renderer_host/frame_memory_manager.h"
-
-#include "base/logging.h"
-#include "base/memory/singleton.h"
-#include "base/sys_info.h"
-
-namespace content {
-
-namespace {
-
-size_t MaxNumberOfSavedFrames() {
- return std::min(5, 2 + (base::SysInfo::AmountOfPhysicalMemoryMB() / 256));
-}
-
-} // namespace
-
-FrameMemoryManager* FrameMemoryManager::GetInstance() {
- return Singleton<FrameMemoryManager>::get();
-}
-
-void FrameMemoryManager::AddFrame(FrameContainer* frame, bool visible) {
- RemoveFrame(frame);
- if (visible)
- visible_frames_.insert(frame);
- else
- hidden_frames_.push_front(frame);
- CullHiddenFrames();
-}
-
-void FrameMemoryManager::RemoveFrame(FrameContainer* frame) {
- visible_frames_.erase(frame);
- hidden_frames_.remove(frame);
-}
-
-void FrameMemoryManager::SetFrameVisibility(FrameContainer* frame,
- bool visible) {
- if (visible) {
- hidden_frames_.remove(frame);
- visible_frames_.insert(frame);
- } else {
- visible_frames_.erase(frame);
- hidden_frames_.push_front(frame);
- CullHiddenFrames();
- }
-}
-
-FrameMemoryManager::FrameMemoryManager() {}
-
-FrameMemoryManager::~FrameMemoryManager() {}
-
-void FrameMemoryManager::CullHiddenFrames() {
- while (!hidden_frames_.empty() &&
- hidden_frames_.size() + visible_frames_.size() >
- MaxNumberOfSavedFrames()) {
- size_t old_size = hidden_frames_.size();
- // Should remove self from list.
- hidden_frames_.back()->ReleaseCurrentFrame();
- DCHECK_EQ(hidden_frames_.size() + 1, old_size);
- }
-}
-
-} // namespace content
« no previous file with comments | « content/browser/renderer_host/frame_memory_manager.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698