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

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: 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: 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 43%
rename from ppapi/shared_impl/ppb_network_list_private_shared.h
rename to ppapi/proxy/network_list_resource.h
index 8396003a93ba893ec6d567dc12caeb3f5e949291..c9726d8656482412ef5252d45c6837804d12065c 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,12 +11,13 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "ppapi/c/private/ppb_net_address_private.h"
-#include "ppapi/shared_impl/resource.h"
+#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/thunk/ppb_network_list_api.h"
namespace ppapi {
+namespace proxy {
-struct PPAPI_SHARED_EXPORT NetworkInfo {
+struct PPAPI_PROXY_EXPORT NetworkInfo {
NetworkInfo();
~NetworkInfo();
@@ -29,41 +30,19 @@ struct PPAPI_SHARED_EXPORT NetworkInfo {
};
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,
yzshen1 2013/09/13 17:47:10 You probably want to still include resource.h on l
Sergey Ulanov 2013/09/13 18:35:00 Done.
+ 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(ResourceObjectType type,
yzshen1 2013/09/13 17:47:10 |type| is not needed, we only use it as PROXY.
Sergey Ulanov 2013/09/13 18:35:00 Done.
+ PP_Instance instance,
+ const NetworkList& 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 +53,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_;
+ NetworkList 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_

Powered by Google App Engine
This is Rietveld 408576698