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

Unified Diff: content/browser/renderer_host/pepper/pepper_network_monitor_host.h

Issue 23819033: Simplify PPB_NetworkMonitor proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation after r169825 Created 7 years, 3 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: content/browser/renderer_host/pepper/pepper_network_monitor_host.h
diff --git a/content/browser/renderer_host/pepper/pepper_network_monitor_host.h b/content/browser/renderer_host/pepper/pepper_network_monitor_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..e27f8a2ac21a1625c1fc14040c3e4ecc4a3d096a
--- /dev/null
+++ b/content/browser/renderer_host/pepper/pepper_network_monitor_host.h
@@ -0,0 +1,50 @@
+// Copyright 2013 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 CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_NETWORK_MONITOR_HOST_H_
+#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_NETWORK_MONITOR_HOST_H_
+
+#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
+#include "content/common/content_export.h"
+#include "net/base/net_util.h"
+#include "net/base/network_change_notifier.h"
+#include "ppapi/host/host_message_context.h"
+#include "ppapi/host/resource_host.h"
+
+namespace content {
+
+class BrowserPpapiHostImpl;
+
+// The host for PPB_NetworkMonitor. This class lives on the IO thread.
+class CONTENT_EXPORT PepperNetworkMonitorHost
+ : public ppapi::host::ResourceHost,
+ public net::NetworkChangeNotifier::IPAddressObserver {
+ public:
+ PepperNetworkMonitorHost(
+ BrowserPpapiHostImpl* host,
+ PP_Instance instance,
+ PP_Resource resource);
+
+ virtual ~PepperNetworkMonitorHost();
+
+ // net::NetworkChangeNotifier::IPAddressObserver interface.
+ virtual void OnIPAddressChanged() OVERRIDE;
+
+ private:
+ void OnPermissionCheckResult(bool can_use_network_monitor);
+
+ void GetAndSendNetworkList();
+ void SendNetworkList(scoped_ptr<net::NetworkInterfaceList> list);
+
+ ppapi::host::ReplyMessageContext reply_context_;
+
+ base::WeakPtrFactory<PepperNetworkMonitorHost> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperNetworkMonitorHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_NETWORK_MONITOR_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698