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

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

Issue 452923005: Add PepperAddressResolver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | remoting/client/plugin/pepper_address_resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/pepper_address_resolver.h
diff --git a/remoting/client/plugin/pepper_address_resolver.h b/remoting/client/plugin/pepper_address_resolver.h
new file mode 100644
index 0000000000000000000000000000000000000000..37012ea51e05cdacb89575da339a2d170a813f6b
--- /dev/null
+++ b/remoting/client/plugin/pepper_address_resolver.h
@@ -0,0 +1,45 @@
+// Copyright 2014 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_ADDRESS_RESOLVER_H_
+#define REMOTING_CLIENT_PLUGIN_PEPPER_ADDRESS_RESOLVER_H_
+
+#include "ppapi/cpp/host_resolver.h"
+#include "ppapi/utility/completion_callback_factory.h"
+#include "third_party/webrtc/base/asyncresolverinterface.h"
+
+namespace remoting {
+
+// rtc::AsyncResolverInterface implementation that uses Pepper to resolve
+// addresses.
+class PepperAddressResolver : public rtc::AsyncResolverInterface {
+ public:
+ explicit PepperAddressResolver(const pp::InstanceHandle& instance);
+ virtual ~PepperAddressResolver();
+
+ // rtc::AsyncResolverInterface.
+ virtual void Start(const rtc::SocketAddress& addr) OVERRIDE;
+ virtual bool GetResolvedAddress(int family,
+ rtc::SocketAddress* addr) const OVERRIDE;
+ virtual int GetError() const OVERRIDE;
+ virtual void Destroy(bool wait) OVERRIDE;
+
+ private:
+ void OnResolved(int32_t result);
+
+ pp::HostResolver resolver_;
+
+ rtc::SocketAddress ipv4_address_;
+ rtc::SocketAddress ipv6_address_;
+
+ int error_;
+
+ pp::CompletionCallbackFactory<PepperAddressResolver> callback_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperAddressResolver);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_CLIENT_PLUGIN_PEPPER_ADDRESS_RESOLVER_H_
« no previous file with comments | « no previous file | remoting/client/plugin/pepper_address_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698