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

Unified Diff: components/test_runner/mock_webrtc_peer_connection_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_peer_connection_handler.h
diff --git a/components/test_runner/mock_webrtc_peer_connection_handler.h b/components/test_runner/mock_webrtc_peer_connection_handler.h
index 270446972aae90b909c94595542705801de81710..6d7b7e64175041829cfea8e42863080cb611c2b4 100644
--- a/components/test_runner/mock_webrtc_peer_connection_handler.h
+++ b/components/test_runner/mock_webrtc_peer_connection_handler.h
@@ -8,7 +8,7 @@
#include <map>
#include "base/macros.h"
-#include "components/test_runner/web_task.h"
+#include "base/memory/weak_ptr.h"
#include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h"
#include "third_party/WebKit/public/platform/WebRTCSessionDescription.h"
#include "third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h"
@@ -65,9 +65,6 @@ class MockWebRTCPeerConnectionHandler
const blink::WebMediaStreamTrack& track) override;
void stop() override;
- // WebTask related methods
- WebTaskList* mutable_task_list() { return &task_list_; }
-
private:
MockWebRTCPeerConnectionHandler();
@@ -77,9 +74,19 @@ class MockWebRTCPeerConnectionHandler
// is called.
void UpdateRemoteStreams();
+ void ReportInitializeCompleted();
+ void ReportCreationOfDataChannel();
+
+ void PostRequestResult(
+ const blink::WebRTCSessionDescriptionRequest& request,
+ const blink::WebRTCSessionDescription& session_description);
+ void PostRequestFailure(
+ const blink::WebRTCSessionDescriptionRequest& request);
+ void PostRequestResult(const blink::WebRTCVoidRequest& request);
+ void PostRequestFailure(const blink::WebRTCVoidRequest& request);
+
blink::WebRTCPeerConnectionHandlerClient* client_;
bool stopped_;
- WebTaskList task_list_;
blink::WebRTCSessionDescription local_description_;
blink::WebRTCSessionDescription remote_description_;
int stream_count_;
@@ -88,6 +95,8 @@ class MockWebRTCPeerConnectionHandler
StreamMap local_streams_;
StreamMap remote_streams_;
+ base::WeakPtrFactory<MockWebRTCPeerConnectionHandler> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(MockWebRTCPeerConnectionHandler);
};

Powered by Google App Engine
This is Rietveld 408576698