OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Native Client 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 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 6 // |
| 7 // This is an early draft of background thread support. |
| 8 // Until it is complete, we assume that all functions proxy functions |
| 9 // (but CallOnMainThread) are called on the main thread. |
| 10 // |
| 11 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 12 // |
| 13 // Support for "upcalls" -- RPCs to the browser that are done from other than |
| 14 // the PPAPI main thread. These calls are synchronized by the ppapi_proxy |
| 15 // library at the plugin end. |
| 16 |
| 17 #include "native_client/src/include/portability.h" |
| 18 |
| 19 struct NaClSrpcChannel; |
| 20 struct NaClThread; |
| 21 |
| 22 namespace nacl { |
| 23 class DescWrapper; |
| 24 } // namespace nacl |
| 25 |
| 26 namespace ppapi_proxy { |
| 27 |
| 28 class BrowserUpcall { |
| 29 public: |
| 30 // If successful, creates the listener thread in the browser that will handle |
| 31 // upcalls and returns the plugin end of the upcall channel. The caller |
| 32 // takes ownership of this descriptor. If either thread or socket creation |
| 33 // fails, this method returns NULL. |
| 34 // The thread's state is maintained by nacl_thread. Upcall processing may |
| 35 // cause rpcs to be performed on main_channel (e.g., CallOnMainThread), |
| 36 // so the interface takes main_channel, but the upcall thread does not have |
| 37 // ownership. |
| 38 static nacl::DescWrapper* Start(NaClThread* nacl_thread, |
| 39 NaClSrpcChannel* main_channel); |
| 40 }; |
| 41 |
| 42 } // namespace ppapi_proxy |
OLD | NEW |