OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "vpn_provider_helper.h" | 5 #include "vpn_provider_helper.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "ppapi/cpp/var_dictionary.h" | 9 #include "ppapi/cpp/var_dictionary.h" |
10 | 10 |
| 11 #ifdef WIN32 |
| 12 # undef PostMessage |
| 13 #endif |
| 14 |
11 VpnProviderHelper::VpnProviderHelper(pp::Instance* instance) | 15 VpnProviderHelper::VpnProviderHelper(pp::Instance* instance) |
12 : instance_(instance), | 16 : instance_(instance), |
13 thread_(pp::InstanceHandle(instance)), | 17 thread_(pp::InstanceHandle(instance)), |
14 vpn_(pp::InstanceHandle(instance)), | 18 vpn_(pp::InstanceHandle(instance)), |
15 factory_(this), | 19 factory_(this), |
16 send_packet_pending_(false) { | 20 send_packet_pending_(false) { |
17 thread_.Start(); | 21 thread_.Start(); |
18 } | 22 } |
19 | 23 |
20 void VpnProviderHelper::Init() { | 24 void VpnProviderHelper::Init() { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 instance_->PostMessage(ss.str()); | 123 instance_->PostMessage(ss.str()); |
120 | 124 |
121 vpn_.SendPacket( | 125 vpn_.SendPacket( |
122 send_packet_queue_.front(), | 126 send_packet_queue_.front(), |
123 factory_.NewCallback(&VpnProviderHelper::SendPacketCompletionCallback)); | 127 factory_.NewCallback(&VpnProviderHelper::SendPacketCompletionCallback)); |
124 send_packet_queue_.pop(); | 128 send_packet_queue_.pop(); |
125 } else { | 129 } else { |
126 send_packet_pending_ = false; | 130 send_packet_pending_ = false; |
127 } | 131 } |
128 } | 132 } |
OLD | NEW |