Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit bd03d30

Browse files
committed
[[ revBrowserCEF ]] use libcef stubs to dynamically load cef library
[[ revBrowserCEF ]] move revbrowser asset copying step to revbrowser project [[ revBrowserCEF ]] update weak_stub_maker.lc to support 64bit integer params
1 parent ca5fd07 commit bd03d30

File tree

7 files changed

+43
-9
lines changed

7 files changed

+43
-9
lines changed

revbrowser/revbrowser-cefprocess.vcproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
/>
5757
<Tool
5858
Name="VCLinkerTool"
59-
AdditionalDependencies="libcef.lib"
60-
AdditionalLibraryDirectories="&quot;$(SolutionDir)prebuilt\lib\libcef\win32&quot;"
59+
AdditionalLibraryDirectories=""
6160
GenerateDebugInformation="true"
6261
TargetMachine="1"
6362
/>
@@ -123,8 +122,7 @@
123122
/>
124123
<Tool
125124
Name="VCLinkerTool"
126-
AdditionalDependencies="libcef.lib"
127-
AdditionalLibraryDirectories="&quot;$(SolutionDir)prebuilt\lib\libcef\win32&quot;"
125+
AdditionalLibraryDirectories=""
128126
/>
129127
<Tool
130128
Name="VCALinkTool"
@@ -157,6 +155,10 @@
157155
ReferencedProjectIdentifier="{A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}"
158156
RelativePathToProject=".\thirdparty\libcef\libcef_dll_wrapper.vcproj"
159157
/>
158+
<ProjectReference
159+
ReferencedProjectIdentifier="{58314BC9-A2EE-49F0-8B40-7BA12517A60C}"
160+
RelativePathToProject=".\thirdparty\libcef\libcef.vcproj"
161+
/>
160162
</References>
161163
<Files>
162164
<Filter

revbrowser/revbrowser.vcproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
/>
5858
<Tool
5959
Name="VCLinkerTool"
60-
AdditionalDependencies="user32.lib libcef.lib"
60+
AdditionalDependencies="user32.lib"
6161
LinkIncremental="2"
6262
AdditionalLibraryDirectories="&quot;$(SolutionDir)prebuilt\lib\libcef\win32&quot;"
6363
GenerateDebugInformation="true"
@@ -87,6 +87,7 @@
8787
/>
8888
<Tool
8989
Name="VCPostBuildEventTool"
90+
CommandLine="copy /Y &quot;$(SolutionDir)prebuilt\lib\libcef\win32\*.dll&quot; &quot;$(OutDir)&quot;&#x0D;&#x0A;xcopy /E /Y &quot;$(SolutionDir)thirdparty\libcef\res\win32\*&quot; &quot;$(OutDir)&quot;"
9091
/>
9192
</Configuration>
9293
<Configuration
@@ -130,7 +131,7 @@
130131
/>
131132
<Tool
132133
Name="VCLinkerTool"
133-
AdditionalDependencies="user32.lib libcef.lib"
134+
AdditionalDependencies="user32.lib"
134135
LinkIncremental="1"
135136
AdditionalLibraryDirectories="&quot;$(SolutionDir)prebuilt\lib\libcef\win32&quot;"
136137
GenerateDebugInformation="true"
@@ -162,6 +163,7 @@
162163
/>
163164
<Tool
164165
Name="VCPostBuildEventTool"
166+
CommandLine="copy /Y &quot;$(SolutionDir)prebuilt\lib\libcef\win32\*.dll&quot; &quot;$(OutDir)&quot;&#x0D;&#x0A;xcopy /E /Y &quot;$(SolutionDir)thirdparty\libcef\res\win32\*.* &quot;$(OutDir)&quot;"
165167
/>
166168
</Configuration>
167169
</Configurations>
@@ -178,6 +180,10 @@
178180
ReferencedProjectIdentifier="{A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}"
179181
RelativePathToProject=".\thirdparty\libcef\libcef_dll_wrapper.vcproj"
180182
/>
183+
<ProjectReference
184+
ReferencedProjectIdentifier="{58314BC9-A2EE-49F0-8B40-7BA12517A60C}"
185+
RelativePathToProject=".\thirdparty\libcef\libcef.vcproj"
186+
/>
181187
</References>
182188
<Files>
183189
<Filter

revbrowser/src/cefbrowser.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ void MCCefBrowserRunloopAction(void *p_context)
9797
CefDoMessageLoopWork();
9898
}
9999

100+
extern "C" int initialise_weak_link_cef(void);
101+
100102
// IM-2014-03-13: [[ revBrowserCEF ]] Initialisation of the CEF library
101103
bool MCCefInitialise(void)
102104
{
@@ -133,7 +135,12 @@ bool MCCefBrowserInitialise(void)
133135
bool t_success;
134136
t_success = true;
135137

136-
t_success = MCCefInitialise();
138+
// IM-2014-03-18: [[ revBrowserCEF ]] Initialise dynamically loaded cef library
139+
if (t_success)
140+
t_success = initialise_weak_link_cef();
141+
142+
if (t_success)
143+
t_success = MCCefInitialise();
137144

138145
if (t_success)
139146
{
@@ -658,8 +665,12 @@ MCCefBrowserBase::~MCCefBrowserBase(void)
658665

659666
////////////////////////////////////////////////////////////////////////////////
660667

661-
CWebBrowserBase *InstantiateBrowser(int p_window_id)
668+
CWebBrowserBase *MCCefBrowserInstantiate(int p_window_id)
662669
{
670+
// IM-2014-03-18: [[ revBrowserCEF ]] Make sure cef library is loaded before trying to create browser
671+
if (!MCCefBrowserInitialise())
672+
return nil;
673+
663674
MCCefBrowserBase *t_browser;
664675
if (!MCCefPlatformCreateBrowser(p_window_id, t_browser))
665676
return nil;

revbrowser/src/cefprocess_w32.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ extern bool MCCefCreateApp(CefRefPtr<CefApp> &r_app);
2424

2525
////////////////////////////////////////////////////////////////////////////////
2626

27+
extern "C" int initialise_weak_link_cef(void);
28+
2729
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
2830
{
31+
// IM-2014-03-18: [[ revBrowserCEF ]] Initialise dynamically loaded cef library
32+
if (!initialise_weak_link_cef())
33+
return -1;
34+
2935
CefMainArgs t_args(hInstance);
3036

3137
CefRefPtr<CefApp> t_app;

stage.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcef_dll_wrapper", "third
9696
EndProject
9797
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "revbrowser-cefprocess", "revbrowser\revbrowser-cefprocess.vcproj", "{C704BBEE-0A2A-42C3-91D1-A382541593E0}"
9898
EndProject
99+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcef_stubs", "thirdparty\libcef\libcef.vcproj", "{58314BC9-A2EE-49F0-8B40-7BA12517A60C}"
100+
EndProject
99101
Global
100102
GlobalSection(SolutionConfigurationPlatforms) = preSolution
101103
Debug|Win32 = Debug|Win32
@@ -262,6 +264,10 @@ Global
262264
{C704BBEE-0A2A-42C3-91D1-A382541593E0}.Debug|Win32.Build.0 = Debug|Win32
263265
{C704BBEE-0A2A-42C3-91D1-A382541593E0}.Release|Win32.ActiveCfg = Release|Win32
264266
{C704BBEE-0A2A-42C3-91D1-A382541593E0}.Release|Win32.Build.0 = Release|Win32
267+
{58314BC9-A2EE-49F0-8B40-7BA12517A60C}.Debug|Win32.ActiveCfg = Debug|Win32
268+
{58314BC9-A2EE-49F0-8B40-7BA12517A60C}.Debug|Win32.Build.0 = Debug|Win32
269+
{58314BC9-A2EE-49F0-8B40-7BA12517A60C}.Release|Win32.ActiveCfg = Release|Win32
270+
{58314BC9-A2EE-49F0-8B40-7BA12517A60C}.Release|Win32.Build.0 = Release|Win32
265271
EndGlobalSection
266272
GlobalSection(SolutionProperties) = preSolution
267273
HideSolutionNode = FALSE

thirdparty

tools/weak_stub_maker.lc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ function typelistToProto pList, pWithArgs
333333
break
334334
case "integer"
335335
put "int " after tProto
336+
break
337+
case "integer64"
338+
put "long long int " after tProto
336339
break
337340
case "double"
338341
put "double " after tProto

0 commit comments

Comments
 (0)