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_
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"
18 class NetworkMonitorResource
: public PluginResource
,
19 public thunk::PPB_NetworkMonitor_API
{
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
;
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_
;
44 // Parameters passed to UpdateNetworkList().
45 PP_Resource
* network_list_
;
46 scoped_refptr
<TrackedCallback
> update_callback_
;
48 DISALLOW_COPY_AND_ASSIGN(NetworkMonitorResource
);
54 #endif // PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_