Roll src/third_party/WebKit 88cc93e:f6ae725 (svn 200125:200141)
[chromium-blink-merge.git] / ppapi / proxy / network_monitor_resource.h
blob2fb91e753f2b610ae748a38a270a86ef4ce1401e
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_
6 #define PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_
8 #include <list>
10 #include "ppapi/proxy/network_list_resource.h"
11 #include "ppapi/proxy/plugin_resource.h"
12 #include "ppapi/shared_impl/scoped_pp_resource.h"
13 #include "ppapi/thunk/ppb_network_monitor_api.h"
15 namespace ppapi {
16 namespace proxy {
18 class NetworkMonitorResource : public PluginResource,
19 public thunk::PPB_NetworkMonitor_API {
20 public:
21 explicit NetworkMonitorResource(Connection connection,
22 PP_Instance instance);
23 ~NetworkMonitorResource() override;
25 // PluginResource overrides.
26 ppapi::thunk::PPB_NetworkMonitor_API* AsPPB_NetworkMonitor_API() override;
27 void OnReplyReceived(const ResourceMessageReplyParams& params,
28 const IPC::Message& msg) override;
30 // thunk::PPB_NetworkMonitor_API interface
31 int32_t UpdateNetworkList(
32 PP_Resource* network_list,
33 scoped_refptr<TrackedCallback> callback) override;
35 private:
36 // IPC message handlers for the messages received from the browser.
37 void OnPluginMsgNetworkList(const ResourceMessageReplyParams& params,
38 const SerializedNetworkList& list);
39 void OnPluginMsgForbidden(const ResourceMessageReplyParams& params);
41 ScopedPPResource current_list_;
42 bool forbidden_;
44 // Parameters passed to UpdateNetworkList().
45 PP_Resource* network_list_;
46 scoped_refptr<TrackedCallback> update_callback_;
48 DISALLOW_COPY_AND_ASSIGN(NetworkMonitorResource);
51 } // namespace proxy
52 } // namespace ppapi
54 #endif // PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_