Skip to content

Commit

Permalink
LifespanHandler.OnBeforePopup is now called on UI thread (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomczak committed May 24, 2018
1 parent 148be26 commit 05822d1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
2 changes: 0 additions & 2 deletions api/cefpython.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ Description from upstream CEF:

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

An example usage is in the wxpython.py example on Windows, in implementation of LifespanHandler.OnBeforePopup().

List of threads in the Browser process:
* 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.
* cef.TID_DB: Used to interact with the database.
Expand Down
22 changes: 16 additions & 6 deletions docs/Migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ Table of contents:
* [v55.3+ Handlers' callbacks and other interfaces](#v553-handlers-callbacks-and-other-interfaces)
* [v56+ MacOS 10.9+ required to run](#v56-macos-109-required-to-run)
* [v57.1+ High DPI support on Windows](#v571-high-dpi-support-on-windows)
* [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)
* [v66.0+ DisplayHandler.OnConsoleMessage new param 'level'](#v660-displayhandleronconsolemessage-new-param-level)
* [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)
* [v66+ DisplayHandler.OnConsoleMessage has new param 'level'](#v66-displayhandleronconsolemessage-has-new-param-level)
* [v66+ LifespanHandler.OnBeforePopup is now called on UI thread](#v66-lifespanhandleronbeforepopup-is-now-called-on-ui-thread)



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

## v66.0+ 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

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


## v66.0+ DisplayHandler.OnConsoleMessage new param 'level'
## v66+ DisplayHandler.OnConsoleMessage has new param 'level'

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


## v66+ LifespanHandler.OnBeforePopup is now called on UI thread

The LifespanHandler.[OnBeforePopup](../api/LifespanHandler.md#onbeforepopup)
callback is now called on UI thread. Previously it was called on
IO thread.

8 changes: 4 additions & 4 deletions src/cef_v59..v66_changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ BREAKAGE (needs updating Migration Guide doc)
- + OnConsoleMessage: new param 'level'
- + update migration guide

cef_life_span_handler.h
- OnBeforePopup: created on UI thread instead of IO thread
- update checks for thread
- update migration guide
+ cef_life_span_handler.h
- + OnBeforePopup: created on UI thread instead of IO thread
- + update checks for thread
- + update migration guide

cef_print_handler.h
- Modify subprocess/print_handler_gtk.h and .cpp files
Expand Down
2 changes: 1 addition & 1 deletion src/client_handler/lifespan_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool LifespanHandler::OnBeforePopup(CefRefPtr<CefBrowser> browser,
CefBrowserSettings& settings,
bool* no_javascript_access)
{
REQUIRE_IO_THREAD();
REQUIRE_UI_THREAD();
// Note: passing popupFeatures is not yet supported.
const int popupFeaturesNotImpl = 0;
return LifespanHandler_OnBeforePopup(browser, frame, target_url,
Expand Down

0 comments on commit 05822d1

Please sign in to comment.