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

Unified Diff: public/platform/WebWaitableEvent.h

Issue 138303002: Add blink::WebWaitableEvent interface (blink side) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WebVector Created 6 years, 11 months 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
« no previous file with comments | « public/platform/Platform.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebWaitableEvent.h
diff --git a/public/platform/WebSocketStreamHandle.h b/public/platform/WebWaitableEvent.h
similarity index 70%
copy from public/platform/WebSocketStreamHandle.h
copy to public/platform/WebWaitableEvent.h
index 60a469ac2a09d561bdd05015bf603a8dc62c0f0f..2b44d7b1b747fcce048d2a0c6f2d218363136b76 100644
--- a/public/platform/WebSocketStreamHandle.h
+++ b/public/platform/WebWaitableEvent.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2014 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
@@ -28,31 +28,28 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebSocketStreamHandle_h
-#define WebSocketStreamHandle_h
+#ifndef WebWaitableEvent_h
+#define WebWaitableEvent_h
#include "WebCommon.h"
namespace blink {
-class WebData;
-class WebSocketStreamHandleClient;
-class WebURL;
-
-class WebSocketStreamHandle {
+// Provides a thread synchronization that can be used to allow one thread to
+// wait until another thread to finish some work.
+class BLINK_PLATFORM_EXPORT WebWaitableEvent {
public:
- virtual ~WebSocketStreamHandle() { }
-
- // Connect new socket stream asynchronously.
- virtual void connect(const WebURL&, WebSocketStreamHandleClient*) { }
+ virtual ~WebWaitableEvent() { }
- // Send web socket frame data on the socket stream.
- virtual bool send(const WebData&) { return false; }
+ // Waits indefinitely for the event to be signaled.
+ virtual void wait() = 0;
- // Close the socket stream.
- virtual void close() { }
+ // Puts the event in the signaled state. Causing any thread blocked on Wait
+ // to be woken up. The event state is reset to non-signaled after
+ // a waiting thread has been released.
+ virtual void signal() = 0;
};
} // namespace blink
-#endif
+#endif // WebWaitableEvent_h
« no previous file with comments | « public/platform/Platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698