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

Side by Side Diff: content/browser/renderer_host/delegated_frame_evictor.cc

Issue 2819493002: [Test] Move DelegatedFrameEvictor into components -public_deps (Closed)
Patch Set: use if null instead of feature Created 3 years, 8 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/renderer_host/delegated_frame_evictor.h"
6
7 #include "base/logging.h"
8
9 namespace content {
10
11 DelegatedFrameEvictor::DelegatedFrameEvictor(
12 DelegatedFrameEvictorClient* client)
13 : client_(client), has_frame_(false), visible_(false) {
14 }
15
16 DelegatedFrameEvictor::~DelegatedFrameEvictor() { DiscardedFrame(); }
17
18 void DelegatedFrameEvictor::SwappedFrame(bool visible) {
19 visible_ = visible;
20 has_frame_ = true;
21 RendererFrameManager::GetInstance()->AddFrame(this, visible);
22 }
23
24 void DelegatedFrameEvictor::DiscardedFrame() {
25 RendererFrameManager::GetInstance()->RemoveFrame(this);
26 has_frame_ = false;
27 }
28
29 void DelegatedFrameEvictor::SetVisible(bool visible) {
30 if (visible_ == visible)
31 return;
32 visible_ = visible;
33 if (has_frame_) {
34 if (visible) {
35 LockFrame();
36 } else {
37 UnlockFrame();
38 }
39 }
40 }
41
42 void DelegatedFrameEvictor::LockFrame() {
43 DCHECK(has_frame_);
44 RendererFrameManager::GetInstance()->LockFrame(this);
45 }
46
47 void DelegatedFrameEvictor::UnlockFrame() {
48 DCHECK(has_frame_);
49 RendererFrameManager::GetInstance()->UnlockFrame(this);
50 }
51
52 void DelegatedFrameEvictor::EvictCurrentFrame() {
53 client_->EvictDelegatedFrame();
54 }
55
56 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/delegated_frame_evictor.h ('k') | content/browser/renderer_host/delegated_frame_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698