FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
NpapiBrowserHostAsyncWin.cpp
1 
2 /**********************************************************\
3 Original Author: Georg Fritzsche
4 
5 Created: March 1, 2010
6 License: Dual license model; choose one of two:
7  New BSD License
8  http://www.opensource.org/licenses/bsd-license.php
9  - or -
10  GNU Lesser General Public License, version 2.1
11  http://www.gnu.org/licenses/lgpl-2.1.html
12 
13 Copyright 2010 Georg Fritzsche, Firebreath development team
14 \**********************************************************/
15 
16 #include "win_targetver.h"
17 #include "win_common.h"
18 #include "precompiled_headers.h" // On windows, everything above this line in PCH
19 #include "AsyncFunctionCall.h"
20 #include "Win/WinMessageWindow.h"
21 
22 #include "NpapiBrowserHostAsyncWin.h"
23 using namespace FB::Npapi;
24 
25 NpapiBrowserHostAsyncWin::NpapiBrowserHostAsyncWin(NpapiPluginModule* module, NPP npp)
26  : NpapiBrowserHost(module, npp)
27  , m_messageWin(new FB::WinMessageWindow())
28 {
29 
30 }
31 
32 NpapiBrowserHostAsyncWin::~NpapiBrowserHostAsyncWin()
33 {
34 
35 }
36 
37 bool NpapiBrowserHostAsyncWin::_scheduleAsyncCall(void (*func)(void*), void* userData) const
38 {
39  return ::PostMessage(m_messageWin->getHWND(), WM_ASYNCTHREADINVOKE, NULL,
40  (LPARAM)new FB::AsyncFunctionCall(func, userData)) ? true : false;
41 }
42 
Provides a FB::BrowserHost implementation for Npapi.