Skip to content

Commit 59a9aa1

Browse files
committed
Update to Chrome 55.0.2883.21 and CEF 3.2883.1506.ga6c42a7 (#263), and
others. This is CEF Python 55.1 beta release with Chrome 55 from beta channel. Add support for Python 3.6 (#121). Update to Cython 0.25.1 (#110). Build cefpython .so modules using clean Python installations as in pyenv to avoid invalid symbols being embedded in the .so module (#266). Update CEF include/. Update patches/. Update compile.py. Run unit tests first and don't run gtk3 example temporarily until #261 is fixed. Check if Cython version installed is the same as specified in tools/requirements.txt. Update examples - print filename when logging messages.
1 parent 15a2063 commit 59a9aa1

24 files changed

+301
-78
lines changed

api/RequestHandler.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ For an example of how to implement handler see [cefpython](cefpython.md).CreateB
99

1010
The `RequestHandler` tests can be found in the wxpython.py script.
1111

12-
Not yet ported to CEF Python:
12+
The following callbacks are available in upstream CEF, but were not yet
13+
exposed:
1314
* OnOpenURLFromTab
14-
15+
* OnSelectClientCertificate
1516

1617

1718
Table of contents:

docs/Build-instructions.md

+5-11
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Table of contents:
3232

3333
## Build CEF Python on Linux
3434

35-
Complete steps for building CEF Python 54 using prebuilt
35+
Complete steps for building CEF Python 55 using prebuilt
3636
binaries from GitHub releases:
3737

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

4949
5) Download 64-bit Linux binaries and libraries from
5050
[GH releases](https://github.com/cztomczak/cefpython/releases)
51-
tagged 'v54-upstream'.
51+
tagged 'v55-upstream'.
5252

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

5656
8) Build cefpython and run examples:
5757
```
5858
cd cefpython/src/linux/
59-
python compile.py 54.0
59+
python compile.py 55.0
6060
```
6161

6262
## Requirements
@@ -167,7 +167,7 @@ mkdir build/ && cd build
167167
python ../tools/automate.py --build-cef --ninja-jobs 6
168168
mv cef*_*_linux64/ cef_linux64/
169169
cd ../../../src/linux/
170-
python compile.py 54.0
170+
python compile.py 55.0
171171
```
172172

173173
__MISSING PACKAGES (Linux)__: After the chromium sources are downloaded,
@@ -248,13 +248,7 @@ git diff --no-prefix --relative > issue251.patch
248248
Apply a patch in current directory:
249249
```
250250
cd chromium/src/cef/
251-
git apply issue251.patch
252-
```
253-
254-
In case of a "No such file or directory" error and when paths seem
255-
to be correct, try the -p0 or -p1 flag:
256-
```
257-
git apply -p0 issue251.patch
251+
git apply -v -p0 issue251.patch
258252
```
259253

260254
To create a patch from last two commits (no --relative flag available

examples/gtk2.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ def main():
3535

3636

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

4444

4545
def configure_message_loop():
4646
global g_message_loop
4747
if "--message-loop-timer" in sys.argv:
48-
print("Message loop mode: TIMER")
48+
print("[gkt2.py] Message loop mode: TIMER")
4949
g_message_loop = MESSAGE_LOOP_TIMER
5050
sys.argv.remove("--message-loop-timer")
5151
else:
52-
print("Message loop mode: BEST")
52+
print("[gkt2.py] Message loop mode: BEST")
5353
g_message_loop = MESSAGE_LOOP_BEST
5454
if len(sys.argv) > 1:
55-
print("ERROR: unknown argument passed")
55+
print("[gkt2.py] ERROR: unknown argument passed")
5656
sys.exit(1)
5757

5858

examples/gtk3.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010

1111
def main():
12-
print("CEF Python {ver}".format(ver=cef.__version__))
13-
print("Python {ver}".format(ver=sys.version[:6]))
14-
print("GTK {major}.{minor}".format(
12+
print("[gkt3.py] CEF Python {ver}".format(ver=cef.__version__))
13+
print("[gkt3.py] Python {ver}".format(ver=sys.version[:6]))
14+
print("[gkt3.py] GTK {major}.{minor}".format(
1515
major=Gtk.get_major_version(),
1616
minor=Gtk.get_minor_version()))
1717
assert cef.__version__ >= "53.1", "CEF Python v53.1+ required to run this"

examples/hello_world.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77

88
def main():
9-
print("CEF Python {ver}".format(ver=cef.__version__))
10-
print("Python {ver}".format(ver=sys.version[:6]))
9+
print("[hello_world.py] CEF Python {ver}".format(ver=cef.__version__))
10+
print("[hello_world.py] Python {ver}".format(ver=sys.version[:6]))
1111
assert cef.__version__ >= "53.1", "CEF Python v53.1+ required to run this"
1212
sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error
1313
cef.Initialize()

examples/tkinter_.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@
1212
import Tkinter as tk
1313
import sys
1414
import os
15-
import logging
15+
import logging as _logging
1616

1717
# Globals
18-
logger = logging.getLogger()
18+
logger = _logging.getLogger("tkinter_.py")
1919

2020

2121
def main():
22-
logger.setLevel(logging.INFO)
23-
logger.addHandler(logging.StreamHandler())
22+
logger.setLevel(_logging.INFO)
23+
stream_handler = _logging.StreamHandler()
24+
formatter = _logging.Formatter("[%(filename)s] %(message)s")
25+
stream_handler.setFormatter(formatter)
26+
logger.addHandler(stream_handler)
2427
logger.info("CEF Python {ver}".format(ver=cef.__version__))
2528
logger.info("Python {ver}".format(ver=sys.version[:6]))
2629
logger.info("Tk {ver}".format(ver=tk.TkVersion))

patches/issue125.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git http_cache_transaction.cc http_cache_transaction.cc
2-
index 489e4960..2c4d719 100644
2+
index 370862d..e63aecf 100644
33
--- http_cache_transaction.cc
44
+++ http_cache_transaction.cc
5-
@@ -2535,7 +2535,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
5+
@@ -2548,7 +2548,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
66
// blocking page is shown. An alternative would be to reverse-map the cert
77
// status to a net error and replay the net error.
88
if ((response_.headers->HasHeaderValue("cache-control", "no-store")) ||
@@ -11,4 +11,4 @@ index 489e4960..2c4d719 100644
1111
+ IsCertStatusError(response_.ssl_info.cert_status))) {
1212
DoneWritingToEntry(false);
1313
if (net_log_.IsCapturing())
14-
net_log_.EndEvent(NetLog::TYPE_HTTP_CACHE_WRITE_INFO);
14+
net_log_.EndEvent(NetLogEventType::HTTP_CACHE_WRITE_INFO);

patches/issue231.patch

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ index 6a75930..ad620d7 100644
8383
+ return PathService::Override(pref_key, file_path);
8484
+}
8585
diff --git libcef_dll/libcef_dll.cc libcef_dll/libcef_dll.cc
86-
index 208333c..fcadb7e 100644
86+
index 496c9b0..f2dc4d8 100644
8787
--- libcef_dll/libcef_dll.cc
8888
+++ libcef_dll/libcef_dll.cc
89-
@@ -747,6 +747,23 @@ CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) {
89+
@@ -752,6 +752,23 @@ CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) {
9090
return _retval;
9191
}
9292

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

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

patches/issue251.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ index 8f8094b..8b4602b 100644
7171

7272
#endif // CEF_INCLUDE_CEF_DRAG_DATA_H_
7373
diff --git libcef/browser/osr/web_contents_view_osr.cc libcef/browser/osr/web_contents_view_osr.cc
74-
index 52f1a87..e967865 100644
74+
index c39a29c..8b3c30a 100644
7575
--- libcef/browser/osr/web_contents_view_osr.cc
7676
+++ libcef/browser/osr/web_contents_view_osr.cc
7777
@@ -6,6 +6,7 @@
@@ -82,7 +82,7 @@ index 52f1a87..e967865 100644
8282
#include "libcef/browser/osr/render_widget_host_view_osr.h"
8383
#include "libcef/common/drag_data_impl.h"
8484

85-
@@ -227,7 +228,9 @@ void CefWebContentsViewOSR::StartDragging(
85+
@@ -230,7 +231,9 @@ void CefWebContentsViewOSR::StartDragging(
8686
if (browser.get())
8787
handler = browser->GetClient()->GetRenderHandler();
8888
if (handler.get()) {

src/include/cef_navigation_entry.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
#pragma once
4040

4141
#include "include/cef_base.h"
42-
43-
class CefSSLStatus;
42+
#include "include/cef_ssl_status.h"
4443

4544
///
4645
// Class used to represent an entry in navigation history.

src/include/cef_render_handler.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@
3838
#define CEF_INCLUDE_CEF_RENDER_HANDLER_H_
3939
#pragma once
4040

41+
#include <vector>
42+
4143
#include "include/cef_base.h"
4244
#include "include/cef_browser.h"
4345
#include "include/cef_drag_data.h"
44-
#include <vector>
4546

4647
///
4748
// Implement this interface to handle events when window rendering is disabled.

src/include/cef_request_handler.h

+42-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
#define CEF_INCLUDE_CEF_REQUEST_HANDLER_H_
3939
#pragma once
4040

41+
#include <vector>
42+
4143
#include "include/cef_auth_callback.h"
4244
#include "include/cef_base.h"
4345
#include "include/cef_browser.h"
@@ -47,7 +49,7 @@
4749
#include "include/cef_response_filter.h"
4850
#include "include/cef_request.h"
4951
#include "include/cef_ssl_info.h"
50-
52+
#include "include/cef_x509_certificate.h"
5153

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

7274

75+
///
76+
// Callback interface used to select a client certificate for authentication.
77+
///
78+
/*--cef(source=library)--*/
79+
class CefSelectClientCertificateCallback : public virtual CefBase {
80+
public:
81+
///
82+
// Chooses the specified certificate for client certificate authentication.
83+
// NULL value means that no client certificate should be used.
84+
///
85+
/*--cef(optional_param=cert)--*/
86+
virtual void Select(CefRefPtr<CefX509Certificate> cert) =0;
87+
};
88+
89+
7390
///
7491
// Implement this interface to handle events related to browser requests. The
7592
// methods of this class will be called on the thread indicated.
@@ -81,6 +98,7 @@ class CefRequestHandler : public virtual CefBase {
8198
typedef cef_termination_status_t TerminationStatus;
8299
typedef cef_urlrequest_status_t URLRequestStatus;
83100
typedef cef_window_open_disposition_t WindowOpenDisposition;
101+
typedef std::vector<CefRefPtr<CefX509Certificate> > X509CertificateList;
84102

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

303+
///
304+
// Called on the UI thread when a client certificate is being requested for
305+
// authentication. Return false to use the default behavior and automatically
306+
// select the first certificate available. Return true and call
307+
// CefSelectClientCertificateCallback::Select either in this method or at a
308+
// later time to select a certificate. Do not call Select or call it with NULL
309+
// to continue without using any certificate. |isProxy| indicates whether the
310+
// host is an HTTPS proxy or the origin server. |host| and |port| contains the
311+
// hostname and port of the SSL server. |certificates| is the list of
312+
// certificates to choose from; this list has already been pruned by Chromium
313+
// so that it only contains certificates from issuers that the server trusts.
314+
///
315+
/*--cef()--*/
316+
virtual bool OnSelectClientCertificate(
317+
CefRefPtr<CefBrowser> browser,
318+
bool isProxy,
319+
const CefString& host,
320+
int port,
321+
const X509CertificateList& certificates,
322+
CefRefPtr<CefSelectClientCertificateCallback> callback) {
323+
return false;
324+
}
325+
285326
///
286327
// Called on the browser process UI thread when a plugin has crashed.
287328
// |plugin_path| is the path of the plugin that crashed.

src/include/cef_ssl_status.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040

4141
#include "include/cef_base.h"
4242
#include "include/cef_values.h"
43-
44-
class CefX509Certificate;
43+
#include "include/cef_x509_certificate.h"
4544

4645
///
4746
// Class representing the SSL information for a navigation entry.

0 commit comments

Comments
 (0)