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

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

Issue 43193002: Aura/ÜC: Drop frames on background tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CONTENT_EXPORT 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/delegated_frame_evictor.cc
diff --git a/content/browser/renderer_host/delegated_frame_evictor.cc b/content/browser/renderer_host/delegated_frame_evictor.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8fb51c40d7a110a35b8ed068e7cea021cbbebdb9
--- /dev/null
+++ b/content/browser/renderer_host/delegated_frame_evictor.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 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/delegated_frame_evictor.h"
+
+namespace content {
+
+DelegatedFrameEvictor::DelegatedFrameEvictor(
+ DelegatedFrameEvictorClient* client)
+ : client_(client), has_frame_(false) {}
+
+DelegatedFrameEvictor::~DelegatedFrameEvictor() { DiscardedFrame(); }
+
+void DelegatedFrameEvictor::SwappedFrame(bool visible) {
+ has_frame_ = true;
+ RendererFrameManager::GetInstance()->AddFrame(this, visible);
+}
+
+void DelegatedFrameEvictor::DiscardedFrame() {
+ RendererFrameManager::GetInstance()->RemoveFrame(this);
+ has_frame_ = false;
+}
+
+void DelegatedFrameEvictor::SetVisible(bool visible) {
+ if (has_frame_)
+ RendererFrameManager::GetInstance()->SetFrameVisibility(this, visible);
+}
+
+void DelegatedFrameEvictor::EvictCurrentFrame() {
+ client_->EvictDelegatedFrame();
+}
+
+} // namespace content
« no previous file with comments | « content/browser/renderer_host/delegated_frame_evictor.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