Commit b89ca1b3 authored by Callum Prentice's avatar Callum Prentice
Browse files

Update to build against CEF 2987.1591.gd3e47f5 (Chrome 57)

parent 3f3fd712
......@@ -17,7 +17,7 @@ It might be useful in a number of situations - for example:
* Integration with JavaScript for automated site testing like [PhantomJS](http://phantomjs.org/) - not there at all yet but that's one of the main plans for the future
* Web page contents analysis - E.G:
* Capture images the top 500 web pages and count the top 5 colors in each.
* Capture a Google Maps traffic map of your commute for 24 hours and see how miserable the commute is :)
* Capture a Google Maps traffic map of your commute for 24 hours and see how miserable you are going to be :)
* Web page capture to an image or a PDF file
* Lots more I haven't thought of yet
......@@ -29,11 +29,11 @@ From the [CEF Wiki](https://en.wikipedia.org/wiki/Chromium_Embedded_Framework) p
An essential site to visit when developing a CEF based application is the [CEF forum](http://magpcss.org/ceforum/) started and run by (I believe) the original CEF author Marshall Greenblatt who is very generous with his time and expertise.
Building CEF locally is quite a task so Adobe kindly host builds for all supported platforms [here](http://cefbuilds.com).
Building CEF locally is quite a task so Adobe kindly host builds for all supported platforms [here](http://opensource.spotify.com/cefbuilds/index.html).
## Which version of CEF does Dullahan use?
Dullahan been developed against the [CEF 3.2704](https://cefbuilds.com) build of CEF but with some small tweaks to take account of CEF interface changes etc. it should work with slightly older or more recent versions too.
Dullahan been developed against the [CEF 3.2987 (like Chrome 57)](http://opensource.spotify.com/cefbuilds/index.html) build of CEF but with some small tweaks to take account of CEF interface changes etc. it should work with slightly older or more recent versions too.
## What are the origins of this project?
......@@ -49,7 +49,7 @@ For historical reasons, both it and the version of CEF in this repository are bu
## Is there a binary version I can download? ##
I packaged up a Win32 version of the examples along with the necessary runtimes. It is built against CEF revision 2704 so it's similar to Chrome 51.0. You can download it [here from my Dropbox](https://dl.dropboxusercontent.com/u/1109/dullahan_bin_examples-1.1.507-win32.zip) for now - permanent location to follow. Download, unzip into a directory and run `webcube.exe` or `console.exe <URL>`.
I packaged up a Win64 version of the examples along with the necessary runtimes. It is built against CEF revision 2987 so it's similar to Chrome 57. You can download it [here from my Dropbox](https://dl.dropboxusercontent.com/u/1109/dullahan_bin_examples-1.1.631-2987.1591.win64.zip) for now - permanent location to follow. Download, unzip into a directory and run `webcube.exe` or `console.exe <URL>`.
## How do I build Dullahan?
......@@ -59,8 +59,8 @@ I packaged up a Win32 version of the examples along with the necessary runtimes.
* Make sure [CMake](https://cmake.org/) version 3.6.3 or later is installed on your system
* Note: a rudimentary batch file that runs these steps automatically can be found in `tools\build_win.bat` - otherwise, follow the manual steps below
* Create a new directory off of the project root `mkdir build` and switch to it `cd build`
* Use CMake to generate project files `cmake -G "Visual Studio 12 2013" -DCEF_DIR="c:\work\cef_builds\cef_2704.1434.win32" ..` where `CEF_DIR` points to the absolute path of a version of CEF that you built or downloaded
* Note: For 64 bit builds, invoke CMake like this `cmake -G "Visual Studio 12 2013 Win64" -DCEF_DIR="c:\work\cef_builds\cef_2704.1434.win64" ..`
* Use CMake to generate project files `cmake -G "Visual Studio 12 2013" -DCEF_DIR="c:\work\cef_builds\cef_2987.1591.win32" ..` where `CEF_DIR` points to the absolute path of a version of CEF that you built or downloaded
* Note: For 64 bit builds, invoke CMake like this `cmake -G "Visual Studio 12 2013 Win64" -DCEF_DIR="c:\work\cef_builds\cef_2987.1591.win64" ..`
* Either open the resulting `dullahan.sln` in Visual Studio as normal or build everything on the command line using `msbuild dullahan.sln /p:Configuration=Release`
* Switch to the output directory `cd Release` and run the example `.\webcube`
* The Dullahan header you need (`dullahan.h`) can be found in `src` directory
......@@ -77,7 +77,7 @@ The short answer is look at the code in the `examples` folder and `dullahan.h`.
## Grabbing CEF
* Make sure [CMake](https://cmake.org/) version 3.6.3 or later is installed on your system
* Grab a Windows 32 or 64 bit build of CEF from [http://cefbuilds.com](http://cefbuilds.com)
* Grab a Windows 32 or 64 bit build of CEF from [http://opensource.spotify.com/cefbuilds/index.html](http://opensource.spotify.com/cefbuilds/index.html)
* Extract the 7Zip archive to a folder in an easy to find place - I use the desktop
* Edit the `tools/make_dullahan_cef_pkg.bat` batch file - specifically, the lines at the top of the file that set the bit width, the CEF folder you just unpacked and the destination folder of the Dullahan compatible package.
* Run the batch file
......@@ -91,7 +91,7 @@ If this step failed then you will have to inspect the batch file. Generally spea
* Build everything
* Copy files to the right place
Another option is to build the whole thing from scratch. This is necessary if you want to make changes to the Chromium code or perhaps turn on the proprietary media codec support which is not available in the [CEF Builds](http://cefbuilds.com) versions. For more information on how to do this, look online or inspect the `tools/build_cef.bat` batch file.
Another option is to build the whole thing from scratch. This is necessary if you want to make changes to the Chromium code or perhaps turn on the proprietary media codec support which is not available in the [Spotify CEF Builds](http://opensource.spotify.com/cefbuilds/index.html) versions. For more information on how to do this, look online or inspect the `tools/build_cef.bat` batch file.
## What is left to do before the first real release?
......@@ -105,4 +105,4 @@ Another option is to build the whole thing from scratch. This is necessary if yo
## Why the name?
[Seemed appropriate](https://www.google.com/search?q=dullahan)
\ No newline at end of file
[Seemed appropriate](https://www.google.com/search?q=dullahan)
......@@ -677,8 +677,6 @@ LRESULT CALLBACK window_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
int wmId = LOWORD(wParam);
int wmEvent = HIWORD(wParam);
std::cout << "event = " << wmEvent << std::endl;
switch (wmId)
{
case ID_FEATURES_REQUEST_EXIT:
......
......@@ -43,8 +43,8 @@ class dullahan_impl;
// version of this package
// TODO: find a way to set build number directly from hg
#define DULLAHAN_VERSION_MAJOR 1
#define DULLAHAN_VERSION_MINOR 0
#define DULLAHAN_VERSION_BUILD 620
#define DULLAHAN_VERSION_MINOR 1
#define DULLAHAN_VERSION_BUILD 631
// version numbers pulled from CEF build via Cmake
@CEF_VERSION_STR@
......
......@@ -152,8 +152,9 @@ void dullahan_browser_client::OnTitleChange(CefRefPtr<CefBrowser> browser,
}
// CefLoadHandler override
void dullahan_browser_client::OnLoadStart(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame)
void dullahan_browser_client::OnLoadStart(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
TransitionType transition_type)
{
CEF_REQUIRE_UI_THREAD();
......
......@@ -73,10 +73,12 @@ class dullahan_browser_client :
void OnTitleChange(CefRefPtr<CefBrowser> browser,
const CefString& title) OVERRIDE;
// LCefLoadHandler overrides
// CefLoadHandler overrides
CefRefPtr<CefLoadHandler> GetLoadHandler() OVERRIDE { return this; }
void OnLoadStart(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame) OVERRIDE;
void OnLoadStart(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
TransitionType transition_type) OVERRIDE;
void OnLoadEnd(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
int httpStatusCode) OVERRIDE;
void OnLoadError(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
......
......@@ -28,8 +28,7 @@
#include "dullahan_context_handler.h"
#include "dullahan_debug.h"
dullahan_context_handler::dullahan_context_handler(const std::string
cookieStorageDirectory)
dullahan_context_handler::dullahan_context_handler(const std::string cookieStorageDirectory)
{
bool persist_session_cookies = false;
CefRefPtr<CefCompletionCallback> callback = nullptr;
......@@ -43,10 +42,11 @@ CefRefPtr<CefCookieManager> dullahan_context_handler::GetCookieManager()
}
bool dullahan_context_handler::OnBeforePluginLoad(const CefString& mime_type,
const CefString& plugin_url,
const CefString& top_origin_url,
CefRefPtr<CefWebPluginInfo> plugin_info,
PluginPolicy* plugin_policy)
const CefString& plugin_url,
bool is_main_frame,
const CefString& top_origin_url,
CefRefPtr<CefWebPluginInfo> plugin_info,
PluginPolicy* plugin_policy)
{
if (*plugin_policy != PLUGIN_POLICY_ALLOW &&
mime_type == "application/pdf")
......
......@@ -39,11 +39,12 @@ class dullahan_context_handler :
CefRefPtr<CefCookieManager> GetCookieManager() OVERRIDE;
bool OnBeforePluginLoad(const CefString& mime_type,
const CefString& plugin_url,
const CefString& top_origin_url,
CefRefPtr<CefWebPluginInfo> plugin_info,
PluginPolicy* plugin_policy) OVERRIDE;
bool OnBeforePluginLoad(const CefString& mime_type,
const CefString& plugin_url,
bool is_main_frame,
const CefString& top_origin_url,
CefRefPtr<CefWebPluginInfo> plugin_info,
PluginPolicy* plugin_policy) OVERRIDE;
private:
CefRefPtr<CefCookieManager> mCookieManager;
......
......@@ -8,10 +8,10 @@ if exist .\build\* rmdir /s /q .\build
mkdir build
cd build
cmake -G "Visual Studio 12 2013" ^
-DCEF_INCLUDE_DIR="c:\work\cef_builds\cef_2704.1434.win32\include" ^
-DCEF_LIB_DIR="c:\work\cef_builds\cef_2704.1434.win32\lib" ^
-DCEF_BIN_DIR="c:\work\cef_builds\cef_2704.1434.win32\bin" ^
-DCEF_RESOURCE_DIR="c:\work\cef_builds\cef_2704.1434.win32\resources" ^
-DCEF_INCLUDE_DIR="c:\work\cef_builds\cef_2987.1591.win32\include" ^
-DCEF_LIB_DIR="c:\work\cef_builds\cef_2987.1591.win32\lib" ^
-DCEF_BIN_DIR="c:\work\cef_builds\cef_2987.1591.win32\bin" ^
-DCEF_RESOURCE_DIR="c:\work\cef_builds\cef_2987.1591.win32\resources" ^
..
goto Build
......@@ -20,10 +20,10 @@ if exist .\build64\* rmdir /s /q .\build64
mkdir build64
cd build64
cmake -G "Visual Studio 12 2013 Win64" ^
-DCEF_INCLUDE_DIR="c:\work\cef_builds\cef_2704.1434.win64\include" ^
-DCEF_LIB_DIR="c:\work\cef_builds\cef_2704.1434.win64\lib" ^
-DCEF_BIN_DIR="c:\work\cef_builds\cef_2704.1434.win64\bin" ^
-DCEF_RESOURCE_DIR="c:\work\cef_builds\cef_2704.1434.win64\resources" ^
-DCEF_INCLUDE_DIR="c:\work\cef_builds\cef_2987.1591.win64\include" ^
-DCEF_LIB_DIR="c:\work\cef_builds\cef_2987.1591.win64\lib" ^
-DCEF_BIN_DIR="c:\work\cef_builds\cef_2987.1591.win64\bin" ^
-DCEF_RESOURCE_DIR="c:\work\cef_builds\cef_2987.1591.win64\resources" ^
..
goto Build
......
......@@ -5,15 +5,15 @@ if "%BIT_WIDTH%" == "64" goto b64_1
goto end
:b32_1
set SRC_DIR="%USERPROFILE%\Desktop\cef_binary_3.2704.1434.gec3e9ed_windows32"
set DST_DIR="%USERPROFILE%\Desktop\cef_2704.1434.win32"
set SRC_DIR="%USERPROFILE%\Desktop\cef_binary_3.2987.1591.gd3e47f5_windows32"
set DST_DIR="%USERPROFILE%\Desktop\cef_2987.1591.win32"
set CMAKE_CMD="Visual Studio 12 2013"
set PLATFORM_CMD="/property:Platform=x86"
goto skip_1
:b64_1
set SRC_DIR="%USERPROFILE%\Desktop\cef_binary_3.2704.1434.gec3e9ed_windows64"
set DST_DIR="%USERPROFILE%\Desktop\cef_2704.1434.win64"
set SRC_DIR="%USERPROFILE%\Desktop\cef_binary_3.2987.1591.gd3e47f5_windows64"
set DST_DIR="%USERPROFILE%\Desktop\cef_2987.1591.win64"
set CMAKE_CMD="Visual Studio 12 2013 Win64"
set PLATFORM_CMD="/property:Platform=x64"
goto skip_1
......@@ -58,23 +58,23 @@ popd
rem ******** bin folder ********
copy %SRC_DIR%"\Release\d3dcompiler_43.dll" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\d3dcompiler_47.dll" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\chrome_elf.dll" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\libcef.dll" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\libEGL.dll" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\libGLESv2.dll" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\natives_blob.bin" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\snapshot_blob.bin" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\widevinecdmadapter.dll" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\wow_helper.exe" %DST_DIR%"\bin\release"
copy %SRC_DIR%"\Release\d3dcompiler_43.dll" %DST_DIR%"\bin\debug"
copy %SRC_DIR%"\Release\d3dcompiler_47.dll" %DST_DIR%"\bin\debug"
copy %SRC_DIR%"\Release\chrome_elf.dll" %DST_DIR%"\bin\debug"
copy %SRC_DIR%"\Release\libcef.dll" %DST_DIR%"\bin\debug"
copy %SRC_DIR%"\Release\libEGL.dll" %DST_DIR%"\bin\debug"
copy %SRC_DIR%"\Release\libGLESv2.dll" %DST_DIR%"\bin\debug"
copy %SRC_DIR%"\Release\natives_blob.bin" %DST_DIR%"\bin\debug"
copy %SRC_DIR%"\Release\snapshot_blob.bin" %DST_DIR%"\bin\debug"
copy %SRC_DIR%"\Release\widevinecdmadapter.dll" %DST_DIR%"\bin\debug"
copy %SRC_DIR%"\Release\wow_helper.exe" %DST_DIR%"\bin\debug"
rem ******** include folder ********
xcopy %SRC_DIR%"\include\*" %DST_DIR%"\include\" /S
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment