Skip to content

Commit 05822d1

Browse files
committed
LifespanHandler.OnBeforePopup is now called on UI thread (cztomczak#403)
1 parent 148be26 commit 05822d1

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

api/cefpython.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ Description from upstream CEF:
237237

238238
Post a task for execution on the thread associated with this task runner. Execution will occur asynchronously. Only Browser process threads are allowed.
239239

240-
An example usage is in the wxpython.py example on Windows, in implementation of LifespanHandler.OnBeforePopup().
241-
242240
List of threads in the Browser process:
243241
* cef.TID_UI: The main thread in the browser. This will be the same as the main application thread if cefpython.Initialize() is called with a ApplicationSettings.multi_threaded_message_loop value of false. Do not perform blocking tasks on this thread. All tasks posted after CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() are guaranteed to run. This thread will outlive all other CEF threads.
244242
* cef.TID_DB: Used to interact with the database.

docs/Migration-guide.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ Table of contents:
3636
* [v55.3+ Handlers' callbacks and other interfaces](#v553-handlers-callbacks-and-other-interfaces)
3737
* [v56+ MacOS 10.9+ required to run](#v56-macos-109-required-to-run)
3838
* [v57.1+ High DPI support on Windows](#v571-high-dpi-support-on-windows)
39-
* [v66.0+ Linux patch that fixed HTTPS cache problems on pages with certificate errors was disabled](#v660-linux-patch-that-fixed-https-cache-problems-on-pages-with-certificate-errors-was-disabled)
40-
* [v66.0+ DisplayHandler.OnConsoleMessage new param 'level'](#v660-displayhandleronconsolemessage-new-param-level)
39+
* [v66+ Linux patch that fixed HTTPS cache problems on pages with certificate errors was disabled](#v66-linux-patch-that-fixed-https-cache-problems-on-pages-with-certificate-errors-was-disabled)
40+
* [v66+ DisplayHandler.OnConsoleMessage has new param 'level'](#v66-displayhandleronconsolemessage-has-new-param-level)
41+
* [v66+ LifespanHandler.OnBeforePopup is now called on UI thread](#v66-lifespanhandleronbeforepopup-is-now-called-on-ui-thread)
4142

4243

4344

@@ -298,15 +299,24 @@ for High DPI support. In previous versions the default value was
298299
"system_dpi" and if you have set it explicitilly in your application,
299300
then you should change it to an empty string now.
300301

301-
## v66.0+ Linux patch that fixed HTTPS cache problems on pages with certificate errors was disabled
302+
303+
## v66+ Linux patch that fixed HTTPS cache problems on pages with certificate errors was disabled
302304

303305
That patch allowed for HTTPS caching to work when using self-signed
304-
certificates (or any invalid certificate). This doesn't work anymore. See
305-
Issue [#125](../../../issues/125) for more details.
306+
certificates (or any invalid certificate). This doesn't work anymore.
307+
If you need this feature then you can build from sources and apply
308+
the patch yourself. See Issue [#125](../../../issues/125) for more details.
306309

307310

308-
## v66.0+ DisplayHandler.OnConsoleMessage new param 'level'
311+
## v66+ DisplayHandler.OnConsoleMessage has new param 'level'
309312

310313
The DisplayHandler.[OnConsoleMessage](../api/DisplayHandler.md#onconsolemessage)
311314
callback has a new param `level`.
312315

316+
317+
## v66+ LifespanHandler.OnBeforePopup is now called on UI thread
318+
319+
The LifespanHandler.[OnBeforePopup](../api/LifespanHandler.md#onbeforepopup)
320+
callback is now called on UI thread. Previously it was called on
321+
IO thread.
322+

src/cef_v59..v66_changes.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ BREAKAGE (needs updating Migration Guide doc)
77
- + OnConsoleMessage: new param 'level'
88
- + update migration guide
99

10-
cef_life_span_handler.h
11-
- OnBeforePopup: created on UI thread instead of IO thread
12-
- update checks for thread
13-
- update migration guide
10+
+ cef_life_span_handler.h
11+
- + OnBeforePopup: created on UI thread instead of IO thread
12+
- + update checks for thread
13+
- + update migration guide
1414

1515
cef_print_handler.h
1616
- Modify subprocess/print_handler_gtk.h and .cpp files

src/client_handler/lifespan_handler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ bool LifespanHandler::OnBeforePopup(CefRefPtr<CefBrowser> browser,
2121
CefBrowserSettings& settings,
2222
bool* no_javascript_access)
2323
{
24-
REQUIRE_IO_THREAD();
24+
REQUIRE_UI_THREAD();
2525
// Note: passing popupFeatures is not yet supported.
2626
const int popupFeaturesNotImpl = 0;
2727
return LifespanHandler_OnBeforePopup(browser, frame, target_url,

0 commit comments

Comments
 (0)