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

Unified Diff: components/test_runner/mock_webrtc_data_channel_handler.h

Issue 1852603002: Replacing most of web_task.h with base::Closure + base::WeakPtrFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-mocks-to-test-runner
Patch Set: Rebasing... Created 4 years, 8 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: components/test_runner/mock_webrtc_data_channel_handler.h
diff --git a/components/test_runner/mock_webrtc_data_channel_handler.h b/components/test_runner/mock_webrtc_data_channel_handler.h
index 403a21915bd60417216433eaca0cbd04c9d2dffa..5b16b12ac25952c7ccda02ff5e91db9fd8c21660 100644
--- a/components/test_runner/mock_webrtc_data_channel_handler.h
+++ b/components/test_runner/mock_webrtc_data_channel_handler.h
@@ -8,7 +8,7 @@
#include <stddef.h>
#include "base/macros.h"
-#include "components/test_runner/web_task.h"
+#include "base/memory/weak_ptr.h"
#include "third_party/WebKit/public/platform/WebRTCDataChannelHandler.h"
#include "third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h"
#include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h"
@@ -23,6 +23,7 @@ class MockWebRTCDataChannelHandler : public blink::WebRTCDataChannelHandler {
MockWebRTCDataChannelHandler(blink::WebString label,
const blink::WebRTCDataChannelInit& init,
WebTestDelegate* delegate);
+ ~MockWebRTCDataChannelHandler() override;
// WebRTCDataChannelHandler related methods
void setClient(blink::WebRTCDataChannelHandlerClient* client) override;
@@ -40,19 +41,19 @@ class MockWebRTCDataChannelHandler : public blink::WebRTCDataChannelHandler {
bool sendRawData(const char* data, size_t size) override;
void close() override;
- // WebTask related methods
- WebTaskList* mutable_task_list() { return &task_list_; }
-
private:
MockWebRTCDataChannelHandler();
+ void ReportOpenedState();
+ void ReportClosedState();
blink::WebRTCDataChannelHandlerClient* client_;
blink::WebString label_;
blink::WebRTCDataChannelInit init_;
bool reliable_;
- WebTaskList task_list_;
WebTestDelegate* delegate_;
+ base::WeakPtrFactory<MockWebRTCDataChannelHandler> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(MockWebRTCDataChannelHandler);
};
« no previous file with comments | « components/test_runner/mock_web_user_media_client.cc ('k') | components/test_runner/mock_webrtc_data_channel_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698