Index: third_party/grpc/src/core/iomgr/pollset_windows.h |
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h b/third_party/grpc/src/core/iomgr/pollset_windows.h |
similarity index 55% |
copy from third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h |
copy to third_party/grpc/src/core/iomgr/pollset_windows.h |
index 5fd2e07577a50ee220db120d1359c060213e49f4..dc0b7a4104bd8ada3c4d0301044465d1e3e204fc 100644 |
--- a/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h |
+++ b/third_party/grpc/src/core/iomgr/pollset_windows.h |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (c) 2013, Google Inc. All rights reserved. |
+ * |
+ * Copyright 2015-2016, Google Inc. |
+ * All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -26,36 +28,48 @@ |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+ * |
*/ |
-#ifndef AcceleratedImageBufferSurface_h |
-#define AcceleratedImageBufferSurface_h |
+#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H |
+#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H |
-#include "platform/graphics/ImageBufferSurface.h" |
-#include "public/platform/WebGraphicsContext3DProvider.h" |
-#include "third_party/skia/include/core/SkSurface.h" |
-#include "wtf/OwnPtr.h" |
+#include <grpc/support/sync.h> |
-namespace blink { |
+#include "src/core/iomgr/socket_windows.h" |
-class PLATFORM_EXPORT AcceleratedImageBufferSurface : public ImageBufferSurface { |
- WTF_MAKE_NONCOPYABLE(AcceleratedImageBufferSurface); USING_FAST_MALLOC(AcceleratedImageBufferSurface); |
-public: |
- AcceleratedImageBufferSurface(const IntSize&, OpacityMode = NonOpaque); |
- ~AcceleratedImageBufferSurface() override { } |
+/* There isn't really any such thing as a pollset under Windows, due to the |
+ nature of the IO completion ports. A Windows "pollset" is merely a mutex |
+ used to synchronize with the IOCP, and workers are condition variables |
+ used to block threads until work is ready. */ |
- SkCanvas* canvas() override { return m_surface ? m_surface->getCanvas() : nullptr; } |
- bool isValid() const override { return m_surface; } |
- bool isAccelerated() const override { return true; } |
- PassRefPtr<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason) override; |
- Platform3DObject getBackingTextureHandleForOverwrite() override; |
+typedef enum { |
+ GRPC_POLLSET_WORKER_LINK_POLLSET = 0, |
+ GRPC_POLLSET_WORKER_LINK_GLOBAL, |
+ GRPC_POLLSET_WORKER_LINK_TYPES |
+} grpc_pollset_worker_link_type; |
-private: |
- OwnPtr<WebGraphicsContext3DProvider> m_contextProvider; |
- sk_sp<SkSurface> m_surface; // Uses m_contextProvider. |
-}; |
+typedef struct grpc_pollset_worker_link { |
+ struct grpc_pollset_worker *next; |
+ struct grpc_pollset_worker *prev; |
+} grpc_pollset_worker_link; |
+struct grpc_pollset; |
+typedef struct grpc_pollset grpc_pollset; |
-} // namespace blink |
+typedef struct grpc_pollset_worker { |
+ gpr_cv cv; |
+ int kicked; |
+ struct grpc_pollset *pollset; |
+ grpc_pollset_worker_link links[GRPC_POLLSET_WORKER_LINK_TYPES]; |
+} grpc_pollset_worker; |
+ |
+struct grpc_pollset { |
+ int shutting_down; |
+ int kicked_without_pollers; |
+ int is_iocp_worker; |
+ grpc_pollset_worker root_worker; |
+ grpc_closure *on_shutdown; |
+}; |
-#endif |
+#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H */ |