1d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)// found in the LICENSE file.
4d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
5d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#ifndef PPAPI_PROXY_NETWORK_LIST_RESOURCE_H_
6d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#define PPAPI_PROXY_NETWORK_LIST_RESOURCE_H_
7d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
8d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include <string>
9d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include <vector>
10d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
11d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "base/basictypes.h"
12d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "base/memory/ref_counted.h"
13d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "ppapi/c/private/ppb_net_address_private.h"
14d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "ppapi/proxy/ppapi_proxy_export.h"
15d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "ppapi/proxy/serialized_structs.h"
16d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "ppapi/shared_impl/resource.h"
17d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "ppapi/thunk/ppb_network_list_api.h"
18d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
19d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)namespace ppapi {
20d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)namespace proxy {
21d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
22d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)class NetworkListResource
23d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)    : public Resource,
24d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)      public thunk::PPB_NetworkList_API {
25d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles) public:
26d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  NetworkListResource(PP_Instance instance,
27d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)                      const SerializedNetworkList& list);
28d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual ~NetworkListResource();
29d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
30d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  // Resource override.
31d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual thunk::PPB_NetworkList_API* AsPPB_NetworkList_API() OVERRIDE;
32d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
33d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  // PPB_NetworkList_API implementation.
34d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual uint32_t GetCount() OVERRIDE;
35d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual PP_Var GetName(uint32_t index) OVERRIDE;
3668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)  virtual PP_NetworkList_Type GetType(uint32_t index) OVERRIDE;
3768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)  virtual PP_NetworkList_State GetState(uint32_t index) OVERRIDE;
38d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual int32_t GetIpAddresses(uint32_t index,
39d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)                                 const PP_ArrayOutput& output) OVERRIDE;
40d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual PP_Var GetDisplayName(uint32_t index) OVERRIDE;
41d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual uint32_t GetMTU(uint32_t index) OVERRIDE;
42d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
43d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles) private:
44d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  SerializedNetworkList list_;
45d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
46d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(NetworkListResource);
47d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)};
48d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
49d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)}  // namespace proxy
50d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)}  // namespace ppapi
51d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
52d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#endif  // PPAPI_PROXY_NETWORK_LIST_RESOURCE_H_
53