| OLD | NEW |
| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 void DelegatedFrameHost::MaybeCreateResizeLock() { | 86 void DelegatedFrameHost::MaybeCreateResizeLock() { |
| 87 if (!ShouldCreateResizeLock()) | 87 if (!ShouldCreateResizeLock()) |
| 88 return; | 88 return; |
| 89 DCHECK(compositor_); | 89 DCHECK(compositor_); |
| 90 | 90 |
| 91 bool defer_compositor_lock = | 91 bool defer_compositor_lock = |
| 92 can_lock_compositor_ == NO_PENDING_RENDERER_FRAME || | 92 can_lock_compositor_ == NO_PENDING_RENDERER_FRAME || |
| 93 can_lock_compositor_ == NO_PENDING_COMMIT; | 93 can_lock_compositor_ == NO_PENDING_COMMIT; |
| 94 | 94 |
| 95 if (can_lock_compositor_ == YES_CAN_LOCK) | |
| 96 can_lock_compositor_ = YES_DID_LOCK; | |
| 97 | |
| 98 resize_lock_ = client_->DelegatedFrameHostCreateResizeLock(); | 95 resize_lock_ = client_->DelegatedFrameHostCreateResizeLock(); |
| 99 if (!defer_compositor_lock) { | 96 if (!defer_compositor_lock) { |
| 100 bool locked = resize_lock_->Lock(); | 97 bool locked = resize_lock_->Lock(); |
| 101 DCHECK(locked); | 98 DCHECK(locked); |
| 99 can_lock_compositor_ = YES_DID_LOCK; |
| 102 } | 100 } |
| 103 } | 101 } |
| 104 | 102 |
| 105 bool DelegatedFrameHost::ShouldCreateResizeLock() { | 103 bool DelegatedFrameHost::ShouldCreateResizeLock() { |
| 106 static const bool is_disabled = | 104 static const bool is_disabled = |
| 107 base::CommandLine::ForCurrentProcess()->HasSwitch( | 105 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 108 switches::kDisableResizeLock); | 106 switches::kDisableResizeLock); |
| 109 if (is_disabled) | 107 if (is_disabled) |
| 110 return false; | 108 return false; |
| 111 | 109 |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 } | 873 } |
| 876 | 874 |
| 877 if (!skipped_frames_) { | 875 if (!skipped_frames_) { |
| 878 latest_confirmed_begin_frame_source_id_ = ack.source_id; | 876 latest_confirmed_begin_frame_source_id_ = ack.source_id; |
| 879 latest_confirmed_begin_frame_sequence_number_ = | 877 latest_confirmed_begin_frame_sequence_number_ = |
| 880 ack.latest_confirmed_sequence_number; | 878 ack.latest_confirmed_sequence_number; |
| 881 } | 879 } |
| 882 } | 880 } |
| 883 | 881 |
| 884 } // namespace content | 882 } // namespace content |
| OLD | NEW |