summaryrefslogtreecommitdiffstats
path: root/net/base/test_completion_callback.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/test_completion_callback.cc')
-rw-r--r--net/base/test_completion_callback.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/net/base/test_completion_callback.cc b/net/base/test_completion_callback.cc
index c226478..2ee4c8d 100644
--- a/net/base/test_completion_callback.cc
+++ b/net/base/test_completion_callback.cc
@@ -8,6 +8,7 @@
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base/message_loop.h"
+#include "net/base/io_buffer.h"
namespace net {
@@ -42,7 +43,8 @@ TestCompletionCallback::TestCompletionCallback()
base::Unretained(this)))) {
}
-TestCompletionCallback::~TestCompletionCallback() {}
+TestCompletionCallback::~TestCompletionCallback() {
+}
TestInt64CompletionCallback::TestInt64CompletionCallback()
: ALLOW_THIS_IN_INITIALIZER_LIST(callback_(
@@ -50,6 +52,20 @@ TestInt64CompletionCallback::TestInt64CompletionCallback()
base::Unretained(this)))) {
}
-TestInt64CompletionCallback::~TestInt64CompletionCallback() {}
+TestInt64CompletionCallback::~TestInt64CompletionCallback() {
+}
+
+ReleaseBufferCompletionCallback::ReleaseBufferCompletionCallback(
+ IOBuffer* buffer) : buffer_(buffer) {
+}
+
+ReleaseBufferCompletionCallback::~ReleaseBufferCompletionCallback() {
+}
+
+void ReleaseBufferCompletionCallback::SetResult(int result) {
+ if (!buffer_->HasOneRef())
+ result = net::ERR_FAILED;
+ TestCompletionCallback::SetResult(result);
+}
} // namespace net