Skip to content

Commit

Permalink
Update to Chrome 54.0.2840.99 and CEF 3.2840.1518.gffd843c (#272).
Browse files Browse the repository at this point in the history
Update to Cython 0.25.2 (#110).

Changes in API:
- Add ApplicationSettings.net_security_expiration_enabled

Key changes in upstream CEF between commits 7fe3d03...ffd843c (CEF Python 54.0 ... 54.1):
- Update to Chromium version 54.0.2840.99
- Fix PDF rendering with OSR
- Add CefRequestHandler::OnSelectClientCertificate (allows for client certificate selection programmatically)
- Fix load error when using Request->SetUrl when url contains double byte characters
- Fix crash related to channel ID support, disable channel ID support
- Net security (CT, HSTS) expiration based on build age is now disabled by default. Configurable with CefSettings.enable_net_security_expiration.
- New web plugin API: CefRegisterCdmCallback, CefRegisterWidevineCdm
  • Loading branch information
cztomczak committed Dec 9, 2016
1 parent 6ffb865 commit 1da0110
Show file tree
Hide file tree
Showing 25 changed files with 361 additions and 73 deletions.
14 changes: 14 additions & 0 deletions api/ApplicationSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,20 @@ only supported on Windows.
This option is not and cannot be supported on OS-X for architectural reasons.


### net_security_expiration_enabled

(bool)
Set to true (1) to enable date-based expiration of built in network
security information (i.e. certificate transparency logs, HSTS preloading
and pinning information). Enabling this option improves network security
but may cause HTTPS load failures when using CEF binaries built more than
10 weeks in the past. See https://www.certificate-transparency.org/ and
https://www.chromium.org/hsts for details. Also configurable using the
"enable-net-security-expiration" command-line switch. Can be overridden for
individual CefRequestContext instances via the
CefRequestContextSettings.enable_net_security_expiration value.


### pack_loading_disabled

(bool)
Expand Down
9 changes: 6 additions & 3 deletions api/RequestHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@

Implement this interface to handle events related to browser requests.

For an example of how to implement handler see [cefpython](cefpython.md).CreateBrowser(). For a list of all handler interfaces see [API > Client handlers](API#Client_handlers).
For an example of how to implement handler see
[cefpython](cefpython.md).CreateBrowserSync(). For a list of all handler
interfaces see [API > Client handlers](API#Client_handlers).

The `RequestHandler` tests can be found in the wxpython.py script.
The `RequestHandler` tests can be found in the old wxpython.py script (v31).

Not yet ported to CEF Python:
Not yet exposed in CEF Python:
* OnOpenURLFromTab
* OnSelectClientCertificate



Expand Down
11 changes: 11 additions & 0 deletions api/WebPluginInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@

See [RequestHandler](RequestHandler.md).OnBeforePluginLoad().

Web Plugin API available in upstream CEF, but not yet exposed in CEF Python
(see src/include/cef_web_plugin.h):

* CefRegisterCdmCallback
* CefRegisterWidevineCdm
* CefIsWebPluginUnstable
* CefRegisterWebPluginCrash
* CefUnregisterInternalWebPlugin
* CefRefreshWebPlugins
* CefVisitWebPluginInfo


Table of contents:
* [Methods](#methods)
Expand Down
10 changes: 5 additions & 5 deletions docs/Build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Table of contents:

## Build CEF Python on Linux

Complete steps for building CEF Python 54 using prebuilt
Complete steps for building CEF Python v50+ using prebuilt
binaries from GitHub releases:

1) Tested and works fine on Ubuntu 14.04 64-bit (cmake 2.8.12 and g++ 4.8.4)
Expand All @@ -48,15 +48,15 @@ binaries from GitHub releases:

5) Download 64-bit Linux binaries and libraries from
[GH releases](https://github.com/cztomczak/cefpython/releases)
tagged 'v54-upstream'.
tagged e.g. 'v50-upstream' when building v50.

6) Extract it in the cefpython/build/ directory and rename the extracted
directory to "cef_linux64".

8) Build cefpython and run examples:
8) Build cefpython and run examples (xx.x is version e.g. 50.0):
```
cd cefpython/src/linux/
python compile.py 54.0
python compile.py xx.x
```

## Requirements
Expand Down Expand Up @@ -167,7 +167,7 @@ mkdir build/ && cd build
python ../tools/automate.py --build-cef --ninja-jobs 6
mv cef*_*_linux64/ cef_linux64/
cd ../../../src/linux/
python compile.py 54.0
python compile.py xx.x
```

__MISSING PACKAGES (Linux)__: After the chromium sources are downloaded,
Expand Down
12 changes: 6 additions & 6 deletions examples/gtk2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ def main():


def check_versions():
print("CEF Python {ver}".format(ver=cef.__version__))
print("Python {ver}".format(ver=sys.version[:6]))
print("GTK {ver}".format(ver='.'.join(map(str, list(gtk.gtk_version)))))
print("[gkt2.py] CEF Python {ver}".format(ver=cef.__version__))
print("[gkt2.py] Python {ver}".format(ver=sys.version[:6]))
print("[gkt2.py] GTK {ver}".format(ver='.'.join(map(str, list(gtk.gtk_version)))))
assert cef.__version__ >= "54.0", "CEF Python v54+ required to run this"
pygtk.require('2.0')


def configure_message_loop():
global g_message_loop
if "--message-loop-timer" in sys.argv:
print("Message loop mode: TIMER")
print("[gkt2.py] Message loop mode: TIMER")
g_message_loop = MESSAGE_LOOP_TIMER
sys.argv.remove("--message-loop-timer")
else:
print("Message loop mode: BEST")
print("[gkt2.py] Message loop mode: BEST")
g_message_loop = MESSAGE_LOOP_BEST
if len(sys.argv) > 1:
print("ERROR: unknown argument passed")
print("[gkt2.py] ERROR: unknown argument passed")
sys.exit(1)


Expand Down
6 changes: 3 additions & 3 deletions examples/gtk3.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@


def main():
print("CEF Python {ver}".format(ver=cef.__version__))
print("Python {ver}".format(ver=sys.version[:6]))
print("GTK {major}.{minor}".format(
print("[gkt3.py] CEF Python {ver}".format(ver=cef.__version__))
print("[gkt3.py] Python {ver}".format(ver=sys.version[:6]))
print("[gkt3.py] GTK {major}.{minor}".format(
major=Gtk.get_major_version(),
minor=Gtk.get_minor_version()))
assert cef.__version__ >= "53.1", "CEF Python v53.1+ required to run this"
Expand Down
4 changes: 2 additions & 2 deletions examples/hello_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@


def main():
print("CEF Python {ver}".format(ver=cef.__version__))
print("Python {ver}".format(ver=sys.version[:6]))
print("[hello_world.py] CEF Python {ver}".format(ver=cef.__version__))
print("[hello_world.py] Python {ver}".format(ver=sys.version[:6]))
assert cef.__version__ >= "53.1", "CEF Python v53.1+ required to run this"
sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error
cef.Initialize()
Expand Down
11 changes: 7 additions & 4 deletions examples/tkinter_.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
import Tkinter as tk
import sys
import os
import logging
import logging as _logging

# Globals
logger = logging.getLogger()
logger = _logging.getLogger("tkinter_.py")


def main():
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())
logger.setLevel(_logging.INFO)
stream_handler = _logging.StreamHandler()
formatter = _logging.Formatter("[%(filename)s] %(message)s")
stream_handler.setFormatter(formatter)
logger.addHandler(stream_handler)
logger.info("CEF Python {ver}".format(ver=cef.__version__))
logger.info("Python {ver}".format(ver=sys.version[:6]))
logger.info("Tk {ver}".format(ver=tk.TkVersion))
Expand Down
8 changes: 4 additions & 4 deletions patches/issue231.patch
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ index 6a75930..ad620d7 100644
+ return PathService::Override(pref_key, file_path);
+}
diff --git libcef_dll/libcef_dll.cc libcef_dll/libcef_dll.cc
index 208333c..fcadb7e 100644
index 496c9b0..f2dc4d8 100644
--- libcef_dll/libcef_dll.cc
+++ libcef_dll/libcef_dll.cc
@@ -747,6 +747,23 @@ CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) {
@@ -752,6 +752,23 @@ CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) {
return _retval;
}

Expand All @@ -111,10 +111,10 @@ index 208333c..fcadb7e 100644
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

diff --git libcef_dll/wrapper/libcef_dll_wrapper.cc libcef_dll/wrapper/libcef_dll_wrapper.cc
index 248a285..3f0c226 100644
index 3a5d30f..7431698 100644
--- libcef_dll/wrapper/libcef_dll_wrapper.cc
+++ libcef_dll/wrapper/libcef_dll_wrapper.cc
@@ -691,6 +691,23 @@ CEF_GLOBAL bool CefGetPath(PathKey key, CefString& path) {
@@ -696,6 +696,23 @@ CEF_GLOBAL bool CefGetPath(PathKey key, CefString& path) {
return _retval?true:false;
}

Expand Down
4 changes: 2 additions & 2 deletions patches/issue251.patch
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ index 8f8094b..8b4602b 100644

#endif // CEF_INCLUDE_CEF_DRAG_DATA_H_
diff --git libcef/browser/osr/web_contents_view_osr.cc libcef/browser/osr/web_contents_view_osr.cc
index 52f1a87..e967865 100644
index f6715a2..0f7c20a 100644
--- libcef/browser/osr/web_contents_view_osr.cc
+++ libcef/browser/osr/web_contents_view_osr.cc
@@ -6,6 +6,7 @@
Expand All @@ -82,7 +82,7 @@ index 52f1a87..e967865 100644
#include "libcef/browser/osr/render_widget_host_view_osr.h"
#include "libcef/common/drag_data_impl.h"

@@ -227,7 +228,9 @@ void CefWebContentsViewOSR::StartDragging(
@@ -230,7 +231,9 @@ void CefWebContentsViewOSR::StartDragging(
if (browser.get())
handler = browser->GetClient()->GetRenderHandler();
if (handler.get()) {
Expand Down
3 changes: 2 additions & 1 deletion src/extern/cef/cef_types.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ cdef extern from "include/internal/cef_types.h":
cef_string_t accept_language_list
int single_process
cef_string_t browser_subprocess_path
int multi_threaded_message_loop
int command_line_args_disabled
cef_string_t cache_path
int enable_net_security_expiration
int persist_session_cookies
cef_string_t user_agent
cef_string_t product_version
cef_string_t locale
cef_string_t log_file
int log_severity
int multi_threaded_message_loop
cef_string_t javascript_flags
cef_string_t resources_dir_path
cef_string_t locales_dir_path
Expand Down
6 changes: 3 additions & 3 deletions src/include/cef_menu_model_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ class CefMenuModelDelegate : public virtual CefBase {
// The menu is about to show.
///
/*--cef()--*/
virtual void MenuWillShow(CefRefPtr<CefMenuModel> menu_model) {};
virtual void MenuWillShow(CefRefPtr<CefMenuModel> menu_model) {}

///
// The menu has closed.
///
/*--cef()--*/
virtual void MenuClosed(CefRefPtr<CefMenuModel> menu_model) {};
virtual void MenuClosed(CefRefPtr<CefMenuModel> menu_model) {}

///
// Optionally modify a menu item label. Return true if |label| was modified.
///
/*--cef()--*/
virtual bool FormatLabel(CefRefPtr<CefMenuModel> menu_model,
CefString& label) { return false; };
CefString& label) { return false; }
};

#endif // CEF_INCLUDE_VIEWS_CEF_MENU_MODEL_DELEGATE_H_
3 changes: 2 additions & 1 deletion src/include/cef_render_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
#define CEF_INCLUDE_CEF_RENDER_HANDLER_H_
#pragma once

#include <vector>

#include "include/cef_base.h"
#include "include/cef_browser.h"
#include "include/cef_drag_data.h"
#include <vector>

///
// Implement this interface to handle events when window rendering is disabled.
Expand Down
43 changes: 42 additions & 1 deletion src/include/cef_request_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#define CEF_INCLUDE_CEF_REQUEST_HANDLER_H_
#pragma once

#include <vector>

#include "include/cef_auth_callback.h"
#include "include/cef_base.h"
#include "include/cef_browser.h"
Expand All @@ -47,7 +49,7 @@
#include "include/cef_response_filter.h"
#include "include/cef_request.h"
#include "include/cef_ssl_info.h"

#include "include/cef_x509_certificate.h"

///
// Callback interface used for asynchronous continuation of url requests.
Expand All @@ -70,6 +72,21 @@ class CefRequestCallback : public virtual CefBase {
};


///
// Callback interface used to select a client certificate for authentication.
///
/*--cef(source=library)--*/
class CefSelectClientCertificateCallback : public virtual CefBase {
public:
///
// Chooses the specified certificate for client certificate authentication.
// NULL value means that no client certificate should be used.
///
/*--cef(optional_param=cert)--*/
virtual void Select(CefRefPtr<CefX509Certificate> cert) =0;
};


///
// Implement this interface to handle events related to browser requests. The
// methods of this class will be called on the thread indicated.
Expand All @@ -81,6 +98,7 @@ class CefRequestHandler : public virtual CefBase {
typedef cef_termination_status_t TerminationStatus;
typedef cef_urlrequest_status_t URLRequestStatus;
typedef cef_window_open_disposition_t WindowOpenDisposition;
typedef std::vector<CefRefPtr<CefX509Certificate> > X509CertificateList;

///
// Called on the UI thread before browser navigation. Return true to cancel
Expand Down Expand Up @@ -282,6 +300,29 @@ class CefRequestHandler : public virtual CefBase {
return false;
}

///
// Called on the UI thread when a client certificate is being requested for
// authentication. Return false to use the default behavior and automatically
// select the first certificate available. Return true and call
// CefSelectClientCertificateCallback::Select either in this method or at a
// later time to select a certificate. Do not call Select or call it with NULL
// to continue without using any certificate. |isProxy| indicates whether the
// host is an HTTPS proxy or the origin server. |host| and |port| contains the
// hostname and port of the SSL server. |certificates| is the list of
// certificates to choose from; this list has already been pruned by Chromium
// so that it only contains certificates from issuers that the server trusts.
///
/*--cef()--*/
virtual bool OnSelectClientCertificate(
CefRefPtr<CefBrowser> browser,
bool isProxy,
const CefString& host,
int port,
const X509CertificateList& certificates,
CefRefPtr<CefSelectClientCertificateCallback> callback) {
return false;
}

///
// Called on the browser process UI thread when a plugin has crashed.
// |plugin_path| is the path of the plugin that crashed.
Expand Down
Loading

0 comments on commit 1da0110

Please sign in to comment.