OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ppapi/proxy/plugin_globals.h" | 5 #include "ppapi/proxy/plugin_globals.h" |
6 | 6 |
7 #include "base/task_runner.h" | 7 #include "base/task_runner.h" |
8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "ipc/ipc_message.h" | 9 #include "ipc/ipc_message.h" |
10 #include "ipc/ipc_sender.h" | 10 #include "ipc/ipc_sender.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // It performs necessary locking/unlocking of the proxy lock, and forwards all | 25 // It performs necessary locking/unlocking of the proxy lock, and forwards all |
26 // messages to the underlying sender. | 26 // messages to the underlying sender. |
27 class PluginGlobals::BrowserSender : public IPC::Sender { | 27 class PluginGlobals::BrowserSender : public IPC::Sender { |
28 public: | 28 public: |
29 // |underlying_sender| must outlive this object. | 29 // |underlying_sender| must outlive this object. |
30 explicit BrowserSender(IPC::Sender* underlying_sender) | 30 explicit BrowserSender(IPC::Sender* underlying_sender) |
31 : underlying_sender_(underlying_sender) { | 31 : underlying_sender_(underlying_sender) { |
32 } | 32 } |
33 | 33 |
34 virtual ~BrowserSender() {} | 34 ~BrowserSender() override {} |
35 | 35 |
36 // IPC::Sender implementation. | 36 // IPC::Sender implementation. |
37 virtual bool Send(IPC::Message* msg) override { | 37 bool Send(IPC::Message* msg) override { |
38 if (msg->is_sync()) { | 38 if (msg->is_sync()) { |
39 // Synchronous messages might be re-entrant, so we need to drop the lock. | 39 // Synchronous messages might be re-entrant, so we need to drop the lock. |
40 ProxyAutoUnlock unlock; | 40 ProxyAutoUnlock unlock; |
41 return underlying_sender_->Send(msg); | 41 return underlying_sender_->Send(msg); |
42 } | 42 } |
43 | 43 |
44 return underlying_sender_->Send(msg); | 44 return underlying_sender_->Send(msg); |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 return true; | 257 return true; |
258 } | 258 } |
259 | 259 |
260 void PluginGlobals::OnReleaseKeepaliveThrottle() { | 260 void PluginGlobals::OnReleaseKeepaliveThrottle() { |
261 ppapi::ProxyLock::AssertAcquiredDebugOnly(); | 261 ppapi::ProxyLock::AssertAcquiredDebugOnly(); |
262 plugin_recently_active_ = false; | 262 plugin_recently_active_ = false; |
263 } | 263 } |
264 | 264 |
265 } // namespace proxy | 265 } // namespace proxy |
266 } // namespace ppapi | 266 } // namespace ppapi |
OLD | NEW |