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

Unified Diff: ppapi/tests/test_websocket.h

Issue 10661026: WebSocket Pepper API: allow to release in completion callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use WeakPtr to protect |this| Created 8 years, 6 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
Index: ppapi/tests/test_websocket.h
diff --git a/ppapi/tests/test_websocket.h b/ppapi/tests/test_websocket.h
index 321d556c95008b9c53e6afda34c240051557b410..690d1efe886a58d636de7cd15cf4d0039d9fca13 100644
--- a/ppapi/tests/test_websocket.h
+++ b/ppapi/tests/test_websocket.h
@@ -12,11 +12,17 @@
#include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/c/ppb_websocket.h"
#include "ppapi/tests/test_case.h"
+#include "ppapi/tests/test_utils.h"
-class TestWebSocket : public TestCase {
+class TestWebSocket
+ : public TestCase,
+ public TestCompletionCallback::Delegate {
dmichael (off chromium) 2012/06/25 15:50:51 I think it would be cleaner to define a separate c
Takashi Toyoshima 2012/06/26 09:19:10 OK, I will introduce class ReleaseResourceDelegate
public:
explicit TestWebSocket(TestingInstance* instance) : TestCase(instance) {}
+ // TestCompletionCallback::Delegate interfaces.
dmichael (off chromium) 2012/06/25 15:50:51 interfaces->implementation
Takashi Toyoshima 2012/06/26 09:19:10 Done.
+ virtual void OnCallback(void* user_data, int32_t result);
+
private:
// TestCase implementation.
virtual bool Init();
@@ -68,6 +74,9 @@ class TestWebSocket : public TestCase {
const PPB_Var* var_interface_;
const PPB_VarArrayBuffer* arraybuffer_interface_;
const PPB_Core* core_interface_;
+
+ // This resource will be released in |OnCallback|.
+ PP_Resource resource_;
};
#endif // PAPPI_TESTS_TEST_WEBSOCKET_H_

Powered by Google App Engine
This is Rietveld 408576698