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

Unified Diff: ppapi/proxy/network_list_resource.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
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/network_list_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/network_list_resource.h
diff --git a/ppapi/shared_impl/ppb_network_list_private_shared.h b/ppapi/proxy/network_list_resource.h
similarity index 35%
rename from ppapi/shared_impl/ppb_network_list_private_shared.h
rename to ppapi/proxy/network_list_resource.h
index 8396003a93ba893ec6d567dc12caeb3f5e949291..9c078669b3d01cc2a13d572f464ea28f11671ef0 100644
--- a/ppapi/shared_impl/ppb_network_list_private_shared.h
+++ b/ppapi/proxy/network_list_resource.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef PPAPI_SHARED_IMPL_PPB_NETWORK_LIST_PRIVATE_SHARED_H_
-#define PPAPI_SHARED_IMPL_PPB_NETWORK_LIST_PRIVATE_SHARED_H_
+#ifndef PPAPI_PROXY_NETWORK_LIST_RESOURCE_H_
+#define PPAPI_PROXY_NETWORK_LIST_RESOURCE_H_
#include <string>
#include <vector>
@@ -11,59 +11,26 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "ppapi/c/private/ppb_net_address_private.h"
+#include "ppapi/proxy/ppapi_proxy_export.h"
+#include "ppapi/proxy/serialized_structs.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/thunk/ppb_network_list_api.h"
namespace ppapi {
+namespace proxy {
-struct PPAPI_SHARED_EXPORT NetworkInfo {
- NetworkInfo();
- ~NetworkInfo();
-
- std::string name;
- PP_NetworkListType_Private type;
- PP_NetworkListState_Private state;
- std::vector<PP_NetAddress_Private> addresses;
- std::string display_name;
- int mtu;
-};
-typedef std::vector<NetworkInfo> NetworkList;
-
-// NetworkListStorage is refcounted container for NetworkList. It
-// allows sharing of one NetworkList object between multiple
-// NetworkList resources.
-class PPAPI_SHARED_EXPORT NetworkListStorage
- : public base::RefCountedThreadSafe<NetworkListStorage> {
+class NetworkListResource
+ : public Resource,
+ public thunk::PPB_NetworkList_API {
public:
- explicit NetworkListStorage(const NetworkList& list);
-
- const NetworkList& list() { return list_; }
-
- private:
- friend class base::RefCountedThreadSafe<NetworkListStorage>;
- ~NetworkListStorage();
-
- NetworkList list_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkListStorage);
-};
-
-class PPAPI_SHARED_EXPORT PPB_NetworkList_Private_Shared
- : public ::ppapi::Resource,
- public ::ppapi::thunk::PPB_NetworkList_API {
- public:
- static PP_Resource Create(ResourceObjectType type,
- PP_Instance instance,
- const scoped_refptr<NetworkListStorage>& list);
-
- virtual ~PPB_NetworkList_Private_Shared();
+ NetworkListResource(PP_Instance instance,
+ const SerializedNetworkList& list);
+ virtual ~NetworkListResource();
// Resource override.
- virtual ::ppapi::thunk::PPB_NetworkList_API*
- AsPPB_NetworkList_API() OVERRIDE;
+ virtual thunk::PPB_NetworkList_API* AsPPB_NetworkList_API() OVERRIDE;
// PPB_NetworkList_API implementation.
- virtual const NetworkList& GetNetworkListData() const OVERRIDE;
virtual uint32_t GetCount() OVERRIDE;
virtual PP_Var GetName(uint32_t index) OVERRIDE;
virtual PP_NetworkListType_Private GetType(uint32_t index) OVERRIDE;
@@ -74,15 +41,12 @@ class PPAPI_SHARED_EXPORT PPB_NetworkList_Private_Shared
virtual uint32_t GetMTU(uint32_t index) OVERRIDE;
private:
- PPB_NetworkList_Private_Shared(ResourceObjectType type,
- PP_Instance instance,
- const scoped_refptr<NetworkListStorage>& list);
-
- scoped_refptr<NetworkListStorage> list_;
+ SerializedNetworkList list_;
- DISALLOW_COPY_AND_ASSIGN(PPB_NetworkList_Private_Shared);
+ DISALLOW_COPY_AND_ASSIGN(NetworkListResource);
};
+} // namespace proxy
} // namespace ppapi
-#endif // PPAPI_SHARED_IMPL_PPB_NETWORK_LIST_PRIVATE_SHARED_H_
+#endif // PPAPI_PROXY_NETWORK_LIST_RESOURCE_H_
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/network_list_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698