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

Unified Diff: remoting/client/plugin/pepper_port_allocator_session.h

Issue 6623048: Replace libjingle's HttpPortAllocatorSession with Pepper's http client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thread switching Created 9 years, 10 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: remoting/client/plugin/pepper_port_allocator_session.h
diff --git a/remoting/client/plugin/pepper_port_allocator_session.h b/remoting/client/plugin/pepper_port_allocator_session.h
new file mode 100644
index 0000000000000000000000000000000000000000..c53dcf19d0e69ceae73658647077b27e5f6e0255
--- /dev/null
+++ b/remoting/client/plugin/pepper_port_allocator_session.h
@@ -0,0 +1,65 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_SESSION_H_
+#define REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_SESSION_H_
+
+#include "base/message_loop.h"
+#include "ppapi/cpp/completion_callback.h"
+#include "third_party/libjingle/source/talk/p2p/client/basicportallocator.h"
+
+namespace remoting {
+
+class ChromotingInstance;
+class PepperCreateSessionTask;
+class PepperURLFetcher;
+class PortAllocatorSessionFactory;
+
+class PepperPortAllocatorSession : public cricket::BasicPortAllocatorSession {
+ public:
+ PepperPortAllocatorSession(
+ ChromotingInstance* instance,
+ MessageLoop* message_loop,
+ cricket::BasicPortAllocator* allocator,
+ const std::string& name,
+ const std::string& session_type,
+ const std::vector<talk_base::SocketAddress>& stun_hosts,
+ const std::vector<std::string>& relay_hosts,
+ const std::string& relay,
+ const std::string& agent);
+ virtual ~PepperPortAllocatorSession();
+
+ const std::string& relay_token() const {
+ return relay_token_;
+ }
+ virtual void SendSessionRequest(const std::string& host, int port);
Sergey Ulanov 2011/03/07 12:58:45 Add comments that these are overrides. Maybe add O
Alpha Left Google 2011/03/07 18:02:29 Done.
+ virtual void ReceiveSessionResponse(const std::string& response);
+
+ void OnRequestDone(bool success, int status_code,
+ const std::string& response);
+
+ static PortAllocatorSessionFactory* CreateFactory(
Sergey Ulanov 2011/03/07 12:58:45 It doesn't look right, that the object creates fac
Alpha Left Google 2011/03/07 18:02:29 I'll make this a method in the namespace but I don
+ ChromotingInstance* instance);
+
+ private:
+ virtual void GetPortConfigurations();
+ void TryCreateRelaySession();
+
+ ChromotingInstance* const instance_;
+ MessageLoop* const jingle_message_loop_;
+
+ std::vector<std::string> relay_hosts_;
+ std::vector<talk_base::SocketAddress> stun_hosts_;
+ std::string relay_token_;
+ std::string agent_;
+ int attempts_;
+
+ scoped_refptr<PepperCreateSessionTask> create_session_task_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperPortAllocatorSession);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_SESSION_H_

Powered by Google App Engine
This is Rietveld 408576698