Skip to content

Commit

Permalink
Merge pull request #492 from amaitland/upgrade/1750
Browse files Browse the repository at this point in the history
Upgrade to Cef 1750
  • Loading branch information
jornh committed Oct 3, 2014
2 parents 65828de + 7dac850 commit 12f9c29
Show file tree
Hide file tree
Showing 31 changed files with 351 additions and 275 deletions.
2 changes: 1 addition & 1 deletion .nuget/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.redist" version="3.1650.1562-pre0" />
<package id="cef.redist" version="3.1750.1738" />
</packages>
161 changes: 0 additions & 161 deletions CefSharp.Core/BrowserCore.h

This file was deleted.

12 changes: 0 additions & 12 deletions CefSharp.Core/BrowserSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,6 @@ namespace CefSharp
void set(Nullable<bool>^ value) { _browserSettings->tab_to_links = CefStateFromDisabledSetting(value); }
}

property String^ UserStyleSheetLocation
{
String^ get() { return StringUtils::ToClr(_browserSettings->user_style_sheet_location); }
void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->user_style_sheet_location, value); }
}

property Nullable<bool>^ AuthorAndUserStylesDisabled
{
Nullable<bool>^ get() { return CefStateToDisabledSetting(_browserSettings->author_and_user_styles); }
void set(Nullable<bool>^ value) { _browserSettings->author_and_user_styles = CefStateFromDisabledSetting(value); }
}

property Nullable<bool>^ LocalStorageDisabled
{
Nullable<bool>^ get() { return CefStateToDisabledSetting(_browserSettings->local_storage); }
Expand Down
6 changes: 3 additions & 3 deletions CefSharp.Core/Cef.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ namespace CefSharp
CefMainArgs main_args;
CefRefPtr<CefSharpApp> app(new CefSharpApp(cefSettings));

int exitCode = CefExecuteProcess(main_args, app.get());
int exitCode = CefExecuteProcess(main_args, app.get(), NULL);

if (exitCode >= 0)
{
Expand All @@ -164,7 +164,7 @@ namespace CefSharp
return false;
}

success = CefInitialize(main_args, *(cefSettings->_cefSettings), app.get());
success = CefInitialize(main_args, *(cefSettings->_cefSettings), app.get(), NULL);
app->CompleteSchemeRegistrations();
_initialized = success;

Expand Down Expand Up @@ -335,7 +335,7 @@ namespace CefSharp
}

/// <summary> Flush the backing store (if any) to disk and execute the specified |handler| on the IO thread when done. Returns </summary>
/// <param name="visitor">A user-provided Cookie Visitor implementation.</param>
/// <param name="handler">A user-provided ICompletionHandler implementation.</param>
/// <return>Returns false if cookies cannot be accessed.</return>
static bool FlushStore(ICompletionHandler^ handler)
{
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core/CefAppWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ namespace CefSharp

CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer());

return CefExecuteProcess(cefMainArgs, (CefApp*)cefApp.get());
return CefExecuteProcess(cefMainArgs, (CefApp*)cefApp.get(), NULL);
}
}
13 changes: 4 additions & 9 deletions CefSharp.Core/CefSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,15 @@ namespace CefSharp
public:
CefSettings() : _cefSettings(new ::CefSettings())
{
MultiThreadedMessageLoop = true;
_cefSettings->multi_threaded_message_loop = true;
}

!CefSettings() { delete _cefSettings; }
~CefSettings() { delete _cefSettings; }

virtual property bool MultiThreadedMessageLoop
{
bool get() override { return _cefSettings->multi_threaded_message_loop; }

// CefSharp doesn't support single threaded message loop (and there's little point in supporting it), so we make this
// property read-only externally.
private:
void set(bool value) sealed { _cefSettings->multi_threaded_message_loop = value; }
bool get() override { return _cefSettings->multi_threaded_message_loop == 1; }
}

virtual property String^ BrowserSubprocessPath
Expand All @@ -91,7 +86,7 @@ namespace CefSharp

virtual property bool IgnoreCertificateErrors
{
bool get() { return _cefSettings->ignore_certificate_errors; }
bool get() { return _cefSettings->ignore_certificate_errors == 1; }
void set(bool value) { _cefSettings->ignore_certificate_errors = value; }
}

Expand Down Expand Up @@ -121,7 +116,7 @@ namespace CefSharp

virtual property bool PackLoadingDisabled
{
bool get() override { return _cefSettings->pack_loading_disabled; }
bool get() override { return _cefSettings->pack_loading_disabled == 1; }
void set(bool value) override { _cefSettings->pack_loading_disabled = value; }
}

Expand Down
4 changes: 2 additions & 2 deletions CefSharp.Core/CefSharp.Core.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props')" />
<Import Project="..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -283,6 +283,6 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props'))" />
<Error Condition="!Exists('..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props'))" />
</Target>
</Project>
6 changes: 2 additions & 4 deletions CefSharp.Core/Internals/ClientAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace CefSharp

// TODO: windows_key_code could possibly be the wrong choice here (the OnKeyEvent signature has changed since CEF1). The
// other option would be native_key_code.
return handler->OnKeyEvent(_browserControl, KeyTypeToManaged(event.type), event.windows_key_code, event.modifiers, event.is_system_key);
return handler->OnKeyEvent(_browserControl, KeyTypeToManaged(event.type), event.windows_key_code, event.modifiers, event.is_system_key == 1);
}

bool ClientAdapter::OnPreKeyEvent(CefRefPtr<CefBrowser> browser, const CefKeyEvent& event, CefEventHandle os_event, bool* is_keyboard_shortcut)
Expand All @@ -149,7 +149,7 @@ namespace CefSharp
return false;
}

return handler->OnPreKeyEvent(_browserControl, (KeyType)event.type, event.windows_key_code, event.native_key_code, event.modifiers, event.is_system_key, *is_keyboard_shortcut);
return handler->OnPreKeyEvent(_browserControl, (KeyType)event.type, event.windows_key_code, event.native_key_code, event.modifiers, event.is_system_key == 1, *is_keyboard_shortcut);
}

void ClientAdapter::OnLoadStart(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame)
Expand Down Expand Up @@ -262,8 +262,6 @@ namespace CefSharp
}
else if (requestResponse->Action == ResponseAction::Respond)
{
CefRefPtr<StreamAdapter> adapter = new StreamAdapter(requestResponse->ResponseStream);

throw gcnew NotImplementedException("Respond is not yet supported.");

//resourceStream = CefStreamReader::CreateForHandler(static_cast<CefRefPtr<CefReadHandler>>(adapter));
Expand Down
4 changes: 2 additions & 2 deletions CefSharp.Core/Internals/CookieVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace CefSharp
cookie->Value = StringUtils::ToClr(cefCookie.value);
cookie->Domain = StringUtils::ToClr(cefCookie.domain);
cookie->Path = StringUtils::ToClr(cefCookie.path);
cookie->Secure = cefCookie.secure;
cookie->HttpOnly = cefCookie.httponly;
cookie->Secure = cefCookie.secure == 1;
cookie->HttpOnly = cefCookie.httponly == 1;

if (cefCookie.has_expires)
{
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core/Internals/RenderClientAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ namespace CefSharp
CopyMemory(*backBufferHandle, (void*)buffer, numberOfBytes);
};

IMPLEMENT_REFCOUNTING(RenderClientAdapterInternal)
IMPLEMENT_REFCOUNTING(RenderClientAdapter)
};
}
}
17 changes: 0 additions & 17 deletions CefSharp.Core/ManagedCefBrowserAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,6 @@ namespace CefSharp
};

public:
property String^ DevToolsUrl
{
String^ get()
{
auto cefHost = _renderClientAdapter->TryGetCefHost();

if (cefHost != nullptr)
{
return StringUtils::ToClr(cefHost->GetDevToolsURL(true));
}
else
{
return nullptr;
}
}
}

ManagedCefBrowserAdapter(IWebBrowserInternal^ webBrowserInternal)
{
_webBrowserInternal = webBrowserInternal;
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.sdk" version="3.1650.1562-pre2" targetFramework="Native" />
<package id="cef.sdk" version="3.1750.1738" targetFramework="Native" />
</packages>
1 change: 1 addition & 0 deletions CefSharp.Example/CefExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static void Init()
{
var settings = new CefSettings();
settings.RemoteDebuggingPort = 8088;
settings.LogSeverity = LogSeverity.Verbose;

if (debuggingSubProcess)
{
Expand Down
8 changes: 4 additions & 4 deletions CefSharp.Example/Resources/Home.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ <h3>State-of-the-art HTML5 and Javascript support</h3>
<p>
Perhaps very obvious, but still worth mentioning. Since CefSharp is based on
<a href="http://code.google.com/p/chromiumembedded/">CEF</a>, which is in turn based on
<a href="http://www.chromium.org/Home">Chromium</a> (version 29 for the time being), CefSharp provides
<a href="http://www.chromium.org/Home">Chromium</a> (version 33 for the time being), CefSharp provides
one of the best HTML5 rendering experiences available -
<a href="http://html5test.com/compare/browser/chrome-25/mybrowser/chrome-29/chrome-33/ie-11.html">
468-470+ points out of 555
<a href="http://html5test.com/compare/browser/chrome-25/mybrowser/chrome-33/chrome-35/ie-11.html">
470+ points out of 555
</a> on <a href="http://www.html5test.com">html5test.com</a>. Note:
<a href="http://en.wiktionary.org/wiki/your_mileage_may_vary" title="Your mileage may vary">YMMV</a>
depending on .DLLs you add and features you enable.
</p>
<h3>Support for both x86 and x64</h3>
<p>
Chromium 29 supports both x86 and x64, and so do we as of CefSharp 3.29.0. For the time being, it does not
Chromium 33 supports both x86 and x64, and so do we as of CefSharp 33.0.0 For the time being, it does not
"auto-detect" the platform being used (since this is quite complex), so you have to choose either one for
your project. This practically means that you will have to compile &amp; package separate
binaries/installers of your app for x86 and x64 respectively if you want/need to support both of them.
Expand Down
Loading

0 comments on commit 12f9c29

Please sign in to comment.