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

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

Issue 2832043002: ui: Prevent DelegatedFrameHost from taking CompositorResizeLock forever (Closed)
Patch Set: resizelocknoframe: submitcomment 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/renderer_host/delegated_frame_host.h" 5 #include "content/browser/renderer_host/delegated_frame_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 void DelegatedFrameHost::MaybeCreateResizeLock() { 83 void DelegatedFrameHost::MaybeCreateResizeLock() {
84 DCHECK(!resize_lock_); 84 DCHECK(!resize_lock_);
85 85
86 if (!compositor_) 86 if (!compositor_)
87 return; 87 return;
88 88
89 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 89 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
90 switches::kDisableResizeLock)) 90 switches::kDisableResizeLock))
91 return; 91 return;
92 92
93 if (!has_frame_)
94 return;
95
93 if (!client_->DelegatedFrameCanCreateResizeLock()) 96 if (!client_->DelegatedFrameCanCreateResizeLock())
94 return; 97 return;
95 98
96 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); 99 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP();
97 if (desired_size.IsEmpty()) 100 if (desired_size.IsEmpty())
98 return; 101 return;
99 if (desired_size == current_frame_size_in_dip_) 102 if (desired_size == current_frame_size_in_dip_)
100 return; 103 return;
101 104
102 resize_lock_ = client_->DelegatedFrameHostCreateResizeLock(); 105 resize_lock_ = client_->DelegatedFrameHostCreateResizeLock();
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 void DelegatedFrameHost::OnBeginFrame(const cc::BeginFrameArgs& args) { 520 void DelegatedFrameHost::OnBeginFrame(const cc::BeginFrameArgs& args) {
518 client_->OnBeginFrame(args); 521 client_->OnBeginFrame(args);
519 } 522 }
520 523
521 void DelegatedFrameHost::EvictDelegatedFrame() { 524 void DelegatedFrameHost::EvictDelegatedFrame() {
522 if (!has_frame_) 525 if (!has_frame_)
523 return; 526 return;
524 client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent(); 527 client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent();
525 support_->EvictFrame(); 528 support_->EvictFrame();
526 has_frame_ = false; 529 has_frame_ = false;
530 resize_lock_.reset();
527 frame_evictor_->DiscardedFrame(); 531 frame_evictor_->DiscardedFrame();
528 UpdateGutters(); 532 UpdateGutters();
529 } 533 }
530 534
531 // static 535 // static
532 void DelegatedFrameHost::ReturnSubscriberTexture( 536 void DelegatedFrameHost::ReturnSubscriberTexture(
533 base::WeakPtr<DelegatedFrameHost> dfh, 537 base::WeakPtr<DelegatedFrameHost> dfh,
534 scoped_refptr<OwnedMailbox> subscriber_texture, 538 scoped_refptr<OwnedMailbox> subscriber_texture,
535 const gpu::SyncToken& sync_token) { 539 const gpu::SyncToken& sync_token) {
536 if (!subscriber_texture.get()) 540 if (!subscriber_texture.get())
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 } 869 }
866 870
867 if (!skipped_frames_) { 871 if (!skipped_frames_) {
868 latest_confirmed_begin_frame_source_id_ = ack.source_id; 872 latest_confirmed_begin_frame_source_id_ = ack.source_id;
869 latest_confirmed_begin_frame_sequence_number_ = 873 latest_confirmed_begin_frame_sequence_number_ =
870 ack.latest_confirmed_sequence_number; 874 ack.latest_confirmed_sequence_number;
871 } 875 }
872 } 876 }
873 877
874 } // namespace content 878 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | 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