NativeLayerCommandQueue.h (1017B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #ifndef mozilla_layers_NativeLayerCommandQueue_h 7 #define mozilla_layers_NativeLayerCommandQueue_h 8 9 #include "mozilla/DataMutex.h" 10 #include "mozilla/layers/PNativeLayerRemoteChild.h" 11 12 namespace mozilla { 13 namespace layers { 14 15 class NativeLayerCommandQueue { 16 public: 17 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(NativeLayerCommandQueue) 18 19 NativeLayerCommandQueue(); 20 21 void AppendCommand(mozilla::layers::NativeLayerCommand&& aCommand); 22 void FlushToArray(nsTArray<mozilla::layers::NativeLayerCommand>& aQueue); 23 24 protected: 25 ~NativeLayerCommandQueue() = default; 26 27 DataMutex<nsTArray<mozilla::layers::NativeLayerCommand>> mQueue; 28 }; 29 30 } // namespace layers 31 } // namespace mozilla 32 33 #endif // mozilla_layers_NativeLayerCommandQueue_h