| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/renderer_host/resize_lock.h" | |
| 6 | |
| 7 namespace content { | |
| 8 | |
| 9 ResizeLock::ResizeLock(const gfx::Size new_size, bool defer_compositor_lock) | |
| 10 : new_size_(new_size), defer_compositor_lock_(defer_compositor_lock) { | |
| 11 if (!defer_compositor_lock_) | |
| 12 LockCompositor(); | |
| 13 } | |
| 14 | |
| 15 ResizeLock::~ResizeLock() { | |
| 16 UnlockCompositor(); | |
| 17 } | |
| 18 | |
| 19 bool ResizeLock::GrabDeferredLock() { | |
| 20 if (!defer_compositor_lock_) | |
| 21 return false; | |
| 22 LockCompositor(); | |
| 23 return true; | |
| 24 } | |
| 25 | |
| 26 void ResizeLock::UnlockCompositor() { | |
| 27 defer_compositor_lock_ = false; | |
| 28 } | |
| 29 | |
| 30 void ResizeLock::LockCompositor() { | |
| 31 defer_compositor_lock_ = false; | |
| 32 } | |
| 33 | |
| 34 } // namespace content | |
| OLD | NEW |