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

Side by Side Diff: ppapi/proxy/network_monitor_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_
6 #define PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_
7
8 #include <list>
9
10 #include "ppapi/proxy/plugin_resource.h"
11 #include "ppapi/shared_impl/ppb_network_list_private_shared.h"
12 #include "ppapi/thunk/ppb_network_monitor_api.h"
13
14 namespace base {
15 class MessageLoopProxy;
16 } // namespace base
17
18 namespace ppapi {
19 namespace proxy {
20
21 class NetworkMonitorResource : public PluginResource,
22 public thunk::PPB_NetworkMonitor_API {
23 public:
24 explicit NetworkMonitorResource(Connection connection,
25 PP_Instance instance);
26 virtual ~NetworkMonitorResource();
27
28 // PluginResource overrides.
29 ppapi::thunk::PPB_NetworkMonitor_API* AsPPB_NetworkMonitor_API() OVERRIDE;
30 virtual void OnReplyReceived(const ResourceMessageReplyParams& params,
31 const IPC::Message& msg) OVERRIDE;
32
33 // thunk::PPB_NetworkMonitor_API interface
34 virtual int32_t UpdateNetworkList(
35 PP_Resource* network_list,
yzshen1 2013/09/11 22:51:26 wrong indent.
Sergey Ulanov 2013/09/12 07:01:51 Done.
36 scoped_refptr<TrackedCallback> callback) OVERRIDE;
37
38 private:
39 // IPC message handlers for the messages received from the browser.
40 void OnPluginMsgNetworkList(const ResourceMessageReplyParams& params,
41 const ppapi::NetworkList& list);
42 void OnPluginMsgForbidden(const ResourceMessageReplyParams& params);
43
44 scoped_refptr<NetworkListStorage> current_list_;
45 bool initial_list_sent_;
46 bool forbidden_;
47
48 // Parameters passed to UpdateNetworkList().
49 PP_Resource* network_list_;
50 scoped_refptr<TrackedCallback> update_callback_;
51
52 DISALLOW_COPY_AND_ASSIGN(NetworkMonitorResource);
53 };
54
55 } // namespace proxy
56 } // namespace ppapi
57
58 #endif // PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698