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

Unified Diff: net/base/test_completion_callback.h

Issue 693943003: Update from https://crrev.com/302630 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « net/BUILD.gn ('k') | net/base/test_completion_callback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/test_completion_callback.h
diff --git a/net/base/test_completion_callback.h b/net/base/test_completion_callback.h
index f5a9f8da7453d81ddc0cd1f2f31f3bac3b9d86f1..c1f715c9dfae404602804cbfecf2c4bd3aa0e9c8 100644
--- a/net/base/test_completion_callback.h
+++ b/net/base/test_completion_callback.h
@@ -5,6 +5,7 @@
#ifndef NET_BASE_TEST_COMPLETION_CALLBACK_H_
#define NET_BASE_TEST_COMPLETION_CALLBACK_H_
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/tuple.h"
#include "net/base/completion_callback.h"
@@ -34,6 +35,8 @@ class TestCompletionCallbackBaseInternal {
protected:
TestCompletionCallbackBaseInternal();
+ virtual ~TestCompletionCallbackBaseInternal();
+
void DidSetResult();
void WaitForResult();
@@ -48,7 +51,7 @@ template <typename R>
class TestCompletionCallbackTemplate
: public TestCompletionCallbackBaseInternal {
public:
- virtual ~TestCompletionCallbackTemplate() {}
+ virtual ~TestCompletionCallbackTemplate() override {}
R WaitForResult() {
TestCompletionCallbackBaseInternal::WaitForResult();
@@ -77,6 +80,22 @@ class TestCompletionCallbackTemplate
} // namespace internal
+class TestClosure
+ : public internal::TestCompletionCallbackBaseInternal {
+ public:
+ using internal::TestCompletionCallbackBaseInternal::WaitForResult;
+
+ TestClosure();
+ virtual ~TestClosure() override;
+
+ const base::Closure& closure() const { return closure_; }
+
+ private:
+ const base::Closure closure_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestClosure);
+};
+
// Base class overridden by custom implementations of TestCompletionCallback.
typedef internal::TestCompletionCallbackTemplate<int>
TestCompletionCallbackBase;
@@ -87,7 +106,7 @@ typedef internal::TestCompletionCallbackTemplate<int64>
class TestCompletionCallback : public TestCompletionCallbackBase {
public:
TestCompletionCallback();
- ~TestCompletionCallback() override;
+ virtual ~TestCompletionCallback() override;
const CompletionCallback& callback() const { return callback_; }
@@ -100,7 +119,7 @@ class TestCompletionCallback : public TestCompletionCallbackBase {
class TestInt64CompletionCallback : public TestInt64CompletionCallbackBase {
public:
TestInt64CompletionCallback();
- ~TestInt64CompletionCallback() override;
+ virtual ~TestInt64CompletionCallback() override;
const Int64CompletionCallback& callback() const { return callback_; }
@@ -114,7 +133,7 @@ class TestInt64CompletionCallback : public TestInt64CompletionCallbackBase {
class ReleaseBufferCompletionCallback: public TestCompletionCallback {
public:
explicit ReleaseBufferCompletionCallback(IOBuffer* buffer);
- ~ReleaseBufferCompletionCallback() override;
+ virtual ~ReleaseBufferCompletionCallback() override;
private:
void SetResult(int result) override;
« no previous file with comments | « net/BUILD.gn ('k') | net/base/test_completion_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698