Index: extensions/renderer/api/display_source/wifi_display/wifi_display_session.h |
diff --git a/extensions/renderer/api/display_source/wifi_display/wifi_display_session.h b/extensions/renderer/api/display_source/wifi_display/wifi_display_session.h |
index 5d1030889d51f5bb93a0308c19b982f9f9bb1ed7..ffc7519cbe67590dd5bb439ea0d10cd2069a32b7 100644 |
--- a/extensions/renderer/api/display_source/wifi_display/wifi_display_session.h |
+++ b/extensions/renderer/api/display_source/wifi_display/wifi_display_session.h |
@@ -5,16 +5,26 @@ |
#ifndef EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSION_H_ |
#define EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSION_H_ |
+#include <map> |
#include <string> |
#include "extensions/common/mojo/wifi_display_session_service.mojom.h" |
#include "extensions/renderer/api/display_source/display_source_session.h" |
#include "mojo/public/cpp/bindings/binding.h" |
+#include "third_party/wds/src/libwds/public/source.h" |
+ |
+namespace base { |
+class Timer; |
+} // namespace base |
namespace extensions { |
+class WiFiDisplayMediaManager; |
+ |
class WiFiDisplaySession: public DisplaySourceSession, |
asargent_no_longer_on_chrome
2016/02/25 22:09:39
nit: this class could use a brief overview comment
Mikhail
2016/02/26 14:42:46
Done.
|
- public WiFiDisplaySessionServiceClient { |
+ public WiFiDisplaySessionServiceClient, |
+ public wds::Peer::Delegate, |
+ public wds::Peer::Observer { |
public: |
explicit WiFiDisplaySession( |
const DisplaySourceSessionParams& params); |
@@ -31,14 +41,31 @@ class WiFiDisplaySession: public DisplaySourceSession, |
void OnError(int32_t type, const mojo::String& description) override; |
void OnMessage(const mojo::String& data) override; |
+ // wds::Peer::Delegate overrides. |
+ unsigned CreateTimer(int seconds) override; |
+ void ReleaseTimer(unsigned timer_id) override; |
+ void SendRTSPData(const std::string& message) override; |
+ std::string GetLocalIPAddress() const override; |
+ int GetNextCSeq(int* initial_peer_cseq = nullptr) const override; |
+ |
+ // wds::Peer::Observer overrides. |
+ void ErrorOccurred(wds::ErrorType error) override; |
+ void SessionCompleted() override; |
+ |
// A connection error handler for the mojo objects used in this class. |
- void OnConnectionError(); |
+ void OnIPCConnectionError(); |
private: |
+ scoped_ptr<wds::Source> wfd_source_; |
+ scoped_ptr<WiFiDisplayMediaManager> media_manager_; |
WiFiDisplaySessionServicePtr service_; |
mojo::Binding<WiFiDisplaySessionServiceClient> binding_; |
std::string ip_address_; |
+ std::map<unsigned, scoped_ptr<base::Timer>> timers_; |
+ |
DisplaySourceSessionParams params_; |
+ mutable int cseq_; |
asargent_no_longer_on_chrome
2016/02/25 22:09:39
nits:
-"cseq" isn't a very descriptive name - at
Mikhail
2016/02/26 14:42:46
Added a description comment. This member is mutabl
asargent_no_longer_on_chrome
2016/02/26 17:01:34
To be clear, the point I was trying to make is as
|
+ unsigned timer_id_; |
asargent_no_longer_on_chrome
2016/02/25 22:09:39
nit: we usually prefer to use either int, size_t,
Mikhail
2016/02/26 14:42:46
'unsigned' was used due to the inherited WDS inter
|
base::WeakPtrFactory<WiFiDisplaySession> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(WiFiDisplaySession); |