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

Side by Side Diff: ppapi/proxy/vpn_provider_resource.h

Issue 2129653002: Revert of ppapi: PPB_VpnProvider: Implement Resource Host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vpn-nacl-sdk
Patch Set: Created 4 years, 5 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
« no previous file with comments | « ppapi/proxy/ppapi_messages.h ('k') | ppapi/proxy/vpn_provider_resource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PPAPI_PROXY_VPN_PROVIDER_RESOURCE_H_ 5 #ifndef PPAPI_PROXY_VPN_PROVIDER_RESOURCE_H_
6 #define PPAPI_PROXY_VPN_PROVIDER_RESOURCE_H_ 6 #define PPAPI_PROXY_VPN_PROVIDER_RESOURCE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <queue> 9 #include <queue>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // PluginResource overrides. 42 // PluginResource overrides.
43 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, 43 virtual void OnReplyReceived(const ResourceMessageReplyParams& params,
44 const IPC::Message& msg) override; 44 const IPC::Message& msg) override;
45 45
46 // PPB_VpnProvider IPC Replies 46 // PPB_VpnProvider IPC Replies
47 void OnPluginMsgBindReply(const ResourceMessageReplyParams& params, 47 void OnPluginMsgBindReply(const ResourceMessageReplyParams& params,
48 uint32_t queue_size, 48 uint32_t queue_size,
49 uint32_t max_packet_size, 49 uint32_t max_packet_size,
50 int32_t result); 50 int32_t result);
51 void OnPluginMsgSendPacketReply(const ResourceMessageReplyParams& params, 51 void OnPluginMsgSendPacketReply(const ResourceMessageReplyParams& params,
52 uint32_t id); 52 int32_t result);
53 53
54 // Browser callbacks 54 // Browser callbacks
55 void OnPluginMsgOnUnbindReceived(const ResourceMessageReplyParams& params); 55 void OnPluginMsgOnUnbindReceived(const ResourceMessageReplyParams& params);
56 void OnPluginMsgOnPacketReceived(const ResourceMessageReplyParams& params, 56 void OnPluginMsgOnPacketReceived(const ResourceMessageReplyParams& params,
57 uint32_t packet_size, 57 uint32_t packet_size,
58 uint32_t id); 58 uint32_t id);
59 59
60 // Picks up a received packet and moves it to user buffer. This method is used 60 // Picks up a received packet and moves it to user buffer. This method is used
61 // in both ReceivePacket() for fast returning path, and in 61 // in both ReceivePacket() for fast returning path, and in
62 // OnPluginMsgOnPacketReceived() for delayed callback invocations. 62 // OnPluginMsgOnPacketReceived() for delayed callback invocations.
63 void WritePacket(); 63 void WritePacket();
64 64
65 // Sends a packet to the browser. This method is used in both SendPacket() for 65 // Sends a packet to the browser. This method is used in both SendPacket() for
66 // fast path, and in OnPluginMsgSendPacketReply for processing previously 66 // fast path, and in OnPluginMsgSendPacketReply for processing previously
67 // queued packets. 67 // queued packets.
68 int32_t DoSendPacket(const PP_Var& packet, uint32_t id); 68 int32_t DoSendPacket(const PP_Var& packet, uint32_t id);
69 69
70 scoped_refptr<TrackedCallback> bind_callback_; 70 scoped_refptr<TrackedCallback> bind_callback_;
71 scoped_refptr<TrackedCallback> send_packet_callback_; 71 scoped_refptr<TrackedCallback> send_packet_callback_;
72 scoped_refptr<TrackedCallback> receive_packet_callback_; 72 scoped_refptr<TrackedCallback> receive_packet_callback_;
73 73
74 // Keeps a pointer to the provided callback variable. Received packet will be 74 // Keeps a pointer to the provided callback variable. Received packet will be
75 // copied to this variable on ready. 75 // copied to this variable on ready.
76 PP_Var* receive_packet_callback_var_; 76 PP_Var* receive_packet_callback_var_;
77 77
78 std::unique_ptr<ppapi::VpnProviderSharedBuffer> send_packet_buffer_; 78 std::unique_ptr<ppapi::VpnProviderSharedBuffer> send_packet_buffer_;
79 std::unique_ptr<ppapi::VpnProviderSharedBuffer> recv_packet_buffer_; 79 std::unique_ptr<ppapi::VpnProviderSharedBuffer> receive_packet_buffer_;
80 80
81 std::queue<PP_Var> send_packets_; 81 std::queue<PP_Var> send_packets_;
82 std::queue<scoped_refptr<Var>> received_packets_; 82 std::queue<scoped_refptr<Var>> received_packets_;
83 83
84 // Connection bound state 84 // Connection bound state
85 bool bound_; 85 bool bound_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(VpnProviderResource); 87 DISALLOW_COPY_AND_ASSIGN(VpnProviderResource);
88 }; 88 };
89 89
90 } // namespace proxy 90 } // namespace proxy
91 } // namespace ppapi 91 } // namespace ppapi
92 92
93 #endif // PPAPI_PROXY_VPN_PROVIDER_RESOURCE_H_ 93 #endif // PPAPI_PROXY_VPN_PROVIDER_RESOURCE_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_messages.h ('k') | ppapi/proxy/vpn_provider_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698