| 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/browser_compositor_view_mac.h" | 5 #include "content/browser/renderer_host/browser_compositor_view_mac.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // Set when no browser compositors should remain alive. | 27 // Set when no browser compositors should remain alive. |
| 28 bool g_has_shut_down = false; | 28 bool g_has_shut_down = false; |
| 29 | 29 |
| 30 // The number of placeholder objects allocated. If this reaches zero, then | 30 // The number of placeholder objects allocated. If this reaches zero, then |
| 31 // the RecyclableCompositorMac being held on to for recycling, | 31 // the RecyclableCompositorMac being held on to for recycling, |
| 32 // |g_spare_recyclable_compositors|, will be freed. | 32 // |g_spare_recyclable_compositors|, will be freed. |
| 33 uint32_t g_browser_compositor_count = 0; | 33 uint32_t g_browser_compositor_count = 0; |
| 34 | 34 |
| 35 // A spare RecyclableCompositorMac kept around for recycling. | 35 // A spare RecyclableCompositorMac kept around for recycling. |
| 36 base::LazyInstance<std::deque<std::unique_ptr<RecyclableCompositorMac>>> | 36 base::LazyInstance<std::deque<std::unique_ptr<RecyclableCompositorMac>>>:: |
| 37 g_spare_recyclable_compositors; | 37 DestructorAtExit g_spare_recyclable_compositors; |
| 38 | 38 |
| 39 void ReleaseSpareCompositors() { | 39 void ReleaseSpareCompositors() { |
| 40 // Allow at most one spare recyclable compositor. | 40 // Allow at most one spare recyclable compositor. |
| 41 while (g_spare_recyclable_compositors.Get().size() > 1) | 41 while (g_spare_recyclable_compositors.Get().size() > 1) |
| 42 g_spare_recyclable_compositors.Get().pop_front(); | 42 g_spare_recyclable_compositors.Get().pop_front(); |
| 43 | 43 |
| 44 if (!g_browser_compositor_count) | 44 if (!g_browser_compositor_count) |
| 45 g_spare_recyclable_compositors.Get().clear(); | 45 g_spare_recyclable_compositors.Get().clear(); |
| 46 } | 46 } |
| 47 | 47 |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 468 |
| 469 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { | 469 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { |
| 470 return last_begin_frame_args_; | 470 return last_begin_frame_args_; |
| 471 } | 471 } |
| 472 | 472 |
| 473 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { | 473 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { |
| 474 // Only used on Android WebView. | 474 // Only used on Android WebView. |
| 475 } | 475 } |
| 476 | 476 |
| 477 } // namespace content | 477 } // namespace content |
| OLD | NEW |