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

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

Issue 2135743002: Adds command line switch to disable resize lock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable Created 4 years, 5 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/public/common/content_switches.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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 can_lock_compositor_ == NO_PENDING_COMMIT; 113 can_lock_compositor_ == NO_PENDING_COMMIT;
114 114
115 if (can_lock_compositor_ == YES_CAN_LOCK) 115 if (can_lock_compositor_ == YES_CAN_LOCK)
116 can_lock_compositor_ = YES_DID_LOCK; 116 can_lock_compositor_ = YES_DID_LOCK;
117 117
118 resize_lock_ = 118 resize_lock_ =
119 client_->DelegatedFrameHostCreateResizeLock(defer_compositor_lock); 119 client_->DelegatedFrameHostCreateResizeLock(defer_compositor_lock);
120 } 120 }
121 121
122 bool DelegatedFrameHost::ShouldCreateResizeLock() { 122 bool DelegatedFrameHost::ShouldCreateResizeLock() {
123 static const bool is_disabled =
124 base::CommandLine::ForCurrentProcess()->HasSwitch(
125 switches::kDisableResizeLock);
126 if (is_disabled)
127 return false;
128
123 if (!client_->DelegatedFrameCanCreateResizeLock()) 129 if (!client_->DelegatedFrameCanCreateResizeLock())
124 return false; 130 return false;
125 131
126 if (resize_lock_) 132 if (resize_lock_)
127 return false; 133 return false;
128 134
129 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); 135 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP();
130 if (desired_size == current_frame_size_in_dip_ || desired_size.IsEmpty()) 136 if (desired_size == current_frame_size_in_dip_ || desired_size.IsEmpty())
131 return false; 137 return false;
132 138
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 cc::SurfaceManager* manager = factory->GetSurfaceManager(); 899 cc::SurfaceManager* manager = factory->GetSurfaceManager();
894 new_layer->SetShowSurface( 900 new_layer->SetShowSurface(
895 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), 901 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)),
896 base::Bind(&RequireCallback, base::Unretained(manager)), 902 base::Bind(&RequireCallback, base::Unretained(manager)),
897 current_surface_size_, current_scale_factor_, 903 current_surface_size_, current_scale_factor_,
898 current_frame_size_in_dip_); 904 current_frame_size_in_dip_);
899 } 905 }
900 } 906 }
901 907
902 } // namespace content 908 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698