Skip to content

Commit d380fe8

Browse files
CzarekCzarek
authored andcommitted
Fixed compile errors in CEF Python 1.
Updated docs in the wxpython script (CEF3).
1 parent fb2e67e commit d380fe8

File tree

12 files changed

+74
-56
lines changed

12 files changed

+74
-56
lines changed

cefpython/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ cython_includes/compile_time_constants.pxi
4141

4242
debug_32bit/
4343
debug_64bit/
44+
libcef_debug/
45+
libcef_release/

cefpython/browser.pyx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ IF CEF_VERSION == 1:
1818

1919
cdef dict g_pyBrowsers = {}
2020

21-
cdef PyBrowser GetPyBrowserById(int browserId):
22-
if g_pyBrowsers.has_key(browserId):
23-
return g_pyBrowsers[browserId]
24-
return None
21+
IF CEF_VERSION == 3:
22+
# Unused function warning in CEF 1.
23+
cdef PyBrowser GetPyBrowserById(int browserId):
24+
if g_pyBrowsers.has_key(browserId):
25+
return g_pyBrowsers[browserId]
26+
return None
2527

2628
cdef PyBrowser GetPyBrowser(CefRefPtr[CefBrowser] cefBrowser):
2729
global g_pyBrowsers
@@ -79,16 +81,18 @@ cdef PyBrowser GetPyBrowser(CefRefPtr[CefBrowser] cefBrowser):
7981
pyBrowser.SetJavascriptBindings(javascriptBindings)
8082
return pyBrowser
8183

82-
cdef void RemovePyBrowser(int browserId) except *:
83-
# Called from LifespanHandler_OnBeforeClose().
84-
# TODO: call this function also in CEF 1, currently called only in CEF 3.
85-
global g_pyBrowsers
86-
if g_pyBrowsers.has_key(browserId):
87-
Debug("del g_pyBrowsers[%s]" % browserId)
88-
del g_pyBrowsers[browserId]
89-
else:
90-
Debug("RemovePyBrowser() FAILED: browser not found, id = %s" \
91-
% browserId)
84+
IF CEF_VERSION == 3:
85+
# Unused function warning in CEF 1.
86+
cdef void RemovePyBrowser(int browserId) except *:
87+
# Called from LifespanHandler_OnBeforeClose().
88+
# TODO: call this function also in CEF 1.
89+
global g_pyBrowsers
90+
if g_pyBrowsers.has_key(browserId):
91+
Debug("del g_pyBrowsers[%s]" % browserId)
92+
del g_pyBrowsers[browserId]
93+
else:
94+
Debug("RemovePyBrowser() FAILED: browser not found, id = %s" \
95+
% browserId)
9296

9397
cpdef PyBrowser GetBrowserByWindowHandle(WindowHandle windowHandle):
9498
cdef PyBrowser pyBrowser

cefpython/cef1/client_handler/client_handler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ bool ClientHandler::GetDownloadHandler(
147147
const CefString& fileName,
148148
int64 contentLength,
149149
CefRefPtr<CefDownloadHandler>& handler) {
150+
// Multiple downloads at the same time?
151+
AutoLock lock_scope(this);
150152
REQUIRE_UI_THREAD();
151153
return RequestHandler_GetDownloadHandler(browser, mimeType, fileName,
152154
contentLength, handler);

cefpython/cef1/client_handler/download_handler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ bool DownloadHandler::ReceivedData(
99
void* data,
1010
int data_size
1111
) {
12+
// Multiple downloads at the same time?
13+
AutoLock lock_scope(this);
1214
REQUIRE_UI_THREAD();
1315
if (data_size == 0)
1416
return true;
1517
return DownloadHandler_ReceivedData(downloadHandlerId_, data, data_size);
1618
}
1719

1820
void DownloadHandler::Complete() {
21+
// Multiple downloads at the same time?
22+
AutoLock lock_scope(this);
1923
REQUIRE_UI_THREAD();
2024
DownloadHandler_Complete(downloadHandlerId_);
2125
}

cefpython/cef1/client_handler/download_handler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ class DownloadHandler : public CefDownloadHandler
2525
protected:
2626
// Include the default reference counting implementation.
2727
IMPLEMENT_REFCOUNTING(DownloadHandler);
28+
// Include the default locking implementation.
29+
IMPLEMENT_LOCKING(DownloadHandler);
2830
};

cefpython/cef3/linux/binaries_32bit/wxpython.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ <h3>Cookie tests</h3>
359359
# Create unique cookie manager for each browser.
360360
# --
361361
# Buggy implementation in CEF, reported here:
362-
# http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10901
362+
# https://code.google.com/p/chromiumembedded/issues/detail?id=1043
363363
cookieManager = browser.GetUserData("cookieManager")
364364
if cookieManager:
365365
return cookieManager

cefpython/cef3/linux/binaries_32bit/wxpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def GetCookieManager(self, browser, mainUrl):
334334
# Create unique cookie manager for each browser.
335335
# --
336336
# Buggy implementation in CEF, reported here:
337-
# http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10901
337+
# https://code.google.com/p/chromiumembedded/issues/detail?id=1043
338338
cookieManager = browser.GetUserData("cookieManager")
339339
if cookieManager:
340340
return cookieManager

cefpython/cef3/linux/binaries_64bit/wxpython.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ <h3>Cookie tests</h3>
359359
# Create unique cookie manager for each browser.
360360
# --
361361
# Buggy implementation in CEF, reported here:
362-
# http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10901
362+
# https://code.google.com/p/chromiumembedded/issues/detail?id=1043
363363
cookieManager = browser.GetUserData("cookieManager")
364364
if cookieManager:
365365
return cookieManager

cefpython/cef3/linux/binaries_64bit/wxpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def GetCookieManager(self, browser, mainUrl):
334334
# Create unique cookie manager for each browser.
335335
# --
336336
# Buggy implementation in CEF, reported here:
337-
# http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10901
337+
# https://code.google.com/p/chromiumembedded/issues/detail?id=1043
338338
cookieManager = browser.GetUserData("cookieManager")
339339
if cookieManager:
340340
return cookieManager

cefpython/cefpython.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ IF CEF_VERSION == 1:
144144
include "v8function_handler_cef1.pyx"
145145
include "v8utils_cef1.pyx"
146146
include "javascript_callback_cef1.pyx"
147-
include "python_callback.pyx"
147+
include "python_callback_cef1.pyx"
148148

149149
IF CEF_VERSION == 3:
150150
include "process_message_utils.pyx"

0 commit comments

Comments
 (0)