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

Unified Diff: third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.h

Issue 1484853003: Ganesh: images upload to GPU performance fix (skip copying encoded data) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Thread safe reference counting and disposal of shared data (m_data that is) Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.h
diff --git a/third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.h b/third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.h
index 9fdea6c0ee2bc0e6fc7d4a7844dd81c2610669a3..e51277e721c17ab1d90eb30a0a334bafeda92f2d 100644
--- a/third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.h
+++ b/third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.h
@@ -30,6 +30,7 @@
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/RefPtr.h"
+#include "wtf/ThreadSafeRefCounted.h"
#include "wtf/ThreadingPrimitives.h"
#include "wtf/Vector.h"
@@ -43,7 +44,7 @@ class SharedBuffer;
//
// This class is designed such that there is only one producer and
// one consumer.
-class PLATFORM_EXPORT ThreadSafeDataTransport {
+class PLATFORM_EXPORT ThreadSafeDataTransport : public ThreadSafeRefCounted<ThreadSafeDataTransport> {
public:
ThreadSafeDataTransport();
~ThreadSafeDataTransport();
@@ -63,6 +64,7 @@ private:
Mutex m_mutex;
Vector<RefPtr<SharedBuffer>> m_newBufferQueue;
+ bool m_newAllDataReceived;
RefPtr<SharedBuffer> m_readBuffer;
bool m_allDataReceived;
size_t m_readPosition;

Powered by Google App Engine
This is Rietveld 408576698