Commit Graph

114 Commits

Author SHA1 Message Date
8f240861e3 Implement NetworkService request interception/handling (see issue #2622).
Implementation notes:
- Chromium change: CookieMonster::SetCookieableSchemes needs to be called
  immediately after the CookieMonster is created in NetworkContext::
  ApplyContextParamsToBuilder. Add a Profile::GetCookieableSchemes method and
  NetworkContextParams.cookieable_schemes member (set from
  ProfileNetworkContextService::CreateNetworkContextParams) to support that.
- Chromium change: Add a ContentBrowserClient::HandleExternalProtocol variant
  that exposes additional NetworkService request information.
- GetResourceResponseFilter is not yet implemented.

API changes:
- Resource-related callbacks have been moved from CefRequestHandler to a new
  CefResourceRequestHandler interface which is returned via the
  GetResourceRequestHandler method. If the CefRequestHandler declines to handle
  a resource it can optionally be handled by the CefRequestContextHandler, if
  any, associated with the loading context.
- The OnProtocolExecution callback has been moved from CefRequestHandler to
  CefResourceRequestHandler and will be called if a custom scheme request is
  unhandled.
- Cookie send/save permission callbacks have been moved from CefRequestHandler
  and CefResourceHandler to CefResourceRequestHandler.
- New methods added to CefResourceHandler that better match NetworkService
  execution sequence expectations. The old methods are now deprecated.
- New methods added to CefRequest and CefResponse.

Known behavior changes with the NetworkService implementation:
- Modifying the |new_url| parameter in OnResourceRedirect will no longer result
  in the method being called an additional time (likely a bug in the old
  implementation).
- Modifying the request URL in OnResourceResponse would previously cause a
  redirect. This behavior is now deprecated because the NetworkService does not
  support this functionality when using default network loaders. Temporary
  support has been added in combination with CefResourceHandler usage only.
- Other changes to the request object in OnResourceResponse will now cause the
  request to be restarted. This means that OnBeforeResourceLoad, etc, will be
  called an additional time with the new request information.
- CefResponse::GetMimeType will now be empty for non-200 responses.
- Requests using custom schemes can now be handled via CefResourceRequestHandler
  with the same callback behavior as builtin schemes.
- Redirects of custom scheme requests will now be followed as expected.
- Default handling of builtin schemes can now be disabled by setting
  |disable_default_handling| to true in GetResourceRequestHandler.
- Unhandled requests (custom scheme or builtin scheme with default handling
  disabled) will fail with an CefResponse::GetError value of
  ERR_UNKNOWN_URL_SCHEME.
- The CefSchemeHandlerFactory::Create callback will now include cookie headers.

To test:
- Run `cefclient --enable-network-service`. All resources should load
  successfully (this tests the transparent proxy capability).
- All tests pass with NetworkService disabled.
- The following tests pass with NetworkService enabled:
  - CookieTest.*
  - FrameTest.* (excluding .*Nav)
  - NavigationTest.* (excluding .Redirect*)
  - RequestHandlerTest.*
  - RequestContextTest.Basic*
  - RequestContextTest.Popup*
  - RequestTest.*
  - ResourceManagerTest.*
  - ResourceRequestHandlerTest.* (excluding .Filter*)
  - SchemeHandlerTest.*
  - StreamResourceHandlerTest.*
2019-04-23 22:53:28 -04:00
019611c764 macOS: Add support for building clients with ARC enabled (fixes issue #2623).
Under ARC (Automatic Reference Counting), assigning to an Objective-C
pointer has different semantics than assigning to a void* pointer.
This makes it dangerous to treat the same memory address as an
Objective-C pointer in some cases and as a "regular C pointer" in
other cases.

This change removes the conditional type defines and instead uses
void* everywhere. Explicit type casting in combination with ARC
annotations makes it safe to get typed Objective-C pointers from the
void* pointers.

This change enables ARC by default in the CEF binary distribution CMake
configuration for the cefclient and cefsimple sample applications. It can be
disabled by adding `-DOPTION_USE_ARC=Off` to the CMake command line.

ARC is not supported when building Chromium due to the substantial
number of changes that would be required in the Chromium code base.
2019-04-23 17:17:56 +00:00
491253fa03 Linux: Add support for ozone builds (fixes issue #2296).
Ozone builds can run with different platform backends (Wayland, X11, etc). Usage of the Views framework is required, and the cefclient sample application is not supported.

Example usage:

$ export GN_DEFINES="use_ozone=true"
$ cd /path/to/chromium/src/cef
$ ./cef_create_projects.sh
$ cd /path/to/chromium/src
$ ninja -C out/Release_GN_x64 cefsimple
$ ./out/Release_GN_x64/cefsimple --use-views --ozone-platform=wayland

Binary distributions can be created by passing the `--ozone` flag to make_distrib.py.
2019-04-23 17:00:14 +00:00
879911b721 Update to Chromium version 75.0.3749.0 (#645082) 2019-04-16 14:38:48 +00:00
a48e072076 Linux: Add OSR use_external_begin_frame support (see issue #1006) 2019-03-18 21:07:02 +00:00
34db87563e Linux: Add support for setting the initial window title (issue #2204). 2019-02-27 19:18:16 +00:00
5f615a95bc Add multi-touch support for OSR (issue #1059) 2019-02-26 11:51:33 -05:00
5a1c642431 Update to Chromium version 74.0.3706.0 (#632463) 2019-02-25 12:09:54 -05:00
f85816f0c7 Windows: Fix focus assignment after dismissing JS dialogs (issue #2584) 2019-02-11 17:26:12 -05:00
b8eaec0db2 Windows: Use WS_EX_NOACTIVATE to control initial window activation (issue #1856) 2019-02-07 16:38:26 -05:00
bf51cd21b6 Update to Chromium version 73.0.3683.0 (#625896) 2019-02-04 11:16:53 -05:00
2e7f935b0d Update to Chromium version 73.0.3679.0 (#624510) 2019-02-01 16:42:40 +00:00
a7e997e524 Update to Chromium version 72.0.3599.0 (#604791) 2018-11-05 13:31:55 -05:00
c64898f9fc Windows: Fix hidden dropdowns when the window is topmost (issue #1468)
Also add a --always-on-top flag to cefclient to allow easier testing of this
behavior on Windows and Linux.
2018-10-09 12:28:13 +03:00
da53451f97 Update to Chromium version 71.0.3567.0 (#595360)
- Configuration of OSR VSync interval is currently missing (issue #2517)
- Rename VERSION to VERSION.in to fix libc++ compile error (issue #2518)
2018-10-04 12:17:26 +03:00
713eebcafc Add support for shared texture and external BeginFrame in OSR mode (issue #1006)
- Add CefWindowInfo::shared_texture_enabled and
  CefRenderHandler::OnAcceleratedPaint for shared texture support. Currently
  only supported on Windows (D3D11).
- Add CefWindowInfo::external_begin_frame_enabled and
  CefBrowserHost::SendExternalBeginFrame for external begin frame support.
2018-09-26 13:10:49 +02:00
8aa4b7aaae Linux: Add multi-threaded message loop support (issue #2512) 2018-09-20 15:17:35 +02:00
0abd08b6cc macOS: Fix crash when closing full-screen window (issue #2491) 2018-09-06 13:46:32 +02:00
a64237bcb0 Update to Chromium version 70.0.3538.0 (#587811)
Known issues:
- The CefLoadCRLSetsFile function needs to be re-implemented (see issue #2497).
- Linux: GTK2 support has been removed. The cefclient sample needs to be updated
  to use GTK3 (see issue #2014).
2018-09-05 15:42:42 +02:00
a9f0fa9dfe Update to Chromium version 68.0.3416.0 (#554961) 2018-05-19 12:35:20 +03:00
240ba800ed Update to Chromium version 68.0.3409.0 (#553714)
Known issues:
- Download fails with empty cache path due to https://crrev.com/950748a25f.
  Fixed in https://crrev.com/087ef223ac.
2018-05-18 13:07:14 +03:00
8426da0de6 Update to Chromium version 68.0.3399.0 (#551554) 2018-05-16 11:23:34 +03:00
a3c55f1d26 Update to Chromium revision 9ef2aa86 (#550428) 2018-05-04 10:50:26 +02:00
7a59914f97 Update to Chromium revision 66afc5e5 (#540276) 2018-03-22 16:56:23 -04:00
36668efc2f Fix input range handle does not follow mouse cursor with OSR (issue #2189) 2018-02-22 17:09:28 +00:00
a5a5e7ff08 Windows: Fix per-monitor DPI scaling of top-level browser windows and placement of context menus (issue #2313) 2018-02-21 16:58:54 -05:00
9e644b7538 Update to Chromium revision bc084a8b (#530369) 2018-02-19 17:38:04 -05:00
8d51acb9be Update to Chromium revision 5fdc0fab (#520840)
- Windows now builds with clang by default.
2017-12-14 15:31:07 -05:00
8b4980b4ca Update to Chromium revision adb61db1 (#508578) 2017-10-26 15:58:05 -04:00
f372e90025 Linux: Fix client termination (issue #2268) 2017-09-21 07:05:36 -07:00
c95b92f1e8 macOS: Fix horizontal scrolling with trackpad (issue #2261) 2017-09-13 16:47:43 +00:00
ed5208366c Windows: Wait for WM_NCDESTROY before calling OnBeforeClose (issue #2248) 2017-08-31 18:10:51 -04:00
9cff99dc4e Add support for loading extensions (issue #1947)
- Add CefRequestContext::LoadExtension, CefExtension, CefExtensionHandler and
  related methods/interfaces.
- Add chrome://extensions-support that lists supported Chrome APIs.
- Add CefBrowserHost::SetAutoResizeEnabled and CefDisplayHandler::OnAutoResize
  to support browser resize based on preferred web contents size.
- views: Add support for custom CefMenuButton popups.
- cefclient: Run with `--load-extension=set_page_color` command-line flag for
  an extension loading example. Add `--use-views` on Windows and Linux for an
  even better example.
2017-08-25 18:40:32 -04:00
f229796a39 Update to Chromium revision ff259bab (#488528) 2017-07-28 18:30:34 -04:00
6da2bbf229 Windows: Fix dialog loading for component build (issue #1617) 2017-07-24 12:14:27 -04:00
5c79944b31 Update to Chromium revision d483fb77 (#474934)
- CefLifeSpanHandler::OnBeforePopup is now called on the UI thread.
- Remove CefBrowserSettings.javascript_open_windows which is no
  longer supported.
2017-06-02 05:55:23 -07:00
31d9407ee2 Apply clang-format to all C, C++ and ObjC files (issue #2171) 2017-05-18 12:30:05 +02:00
3f71138d64 Update to Chromium revision a106f0ab (#464641)
- Remove CefWindowInfo.transparent_painting_enabled. Set
  CefBrowserSettings.background_color to an opaque or transparent
  value instead.
2017-04-24 15:14:47 -04:00
54647945f1 Update to Chromium revision 939b32ee (#454471) 2017-03-08 13:33:05 -08:00
94f604975d Fix localization of default context menu labels (issue #2081) 2017-02-01 15:24:20 -05:00
b7b145fa4f Update to Chromium revision ad51088c (#444943) 2017-01-24 16:53:09 -05:00
12aeeb13f7 Update to Chromium revision 3a87aecc (#433059) 2016-11-29 16:56:29 -05:00
c9e81c082f Update to Chromium revision 614d31da (#423768)
- Fix PDF extension loading after showing the plugin placeholder (issue #2020)
2016-10-25 15:34:33 -04:00
07d12b78e1 Update to Chromium revision 9cedf753 (#418732)
- Simplify usage of OnBeforePluginLoad (issue #2015)
- Switch crash reporting from crashpad to breakpad on Windows and OS X.
  Adds a new chrome_elf.dll dependency on Windows (issue #1995)
- Remove CefTextfield::GetPlaceholderTextColor() method which is no
  longer supported by Chromium.
2016-10-20 16:54:25 -04:00
95973a7c1d Mac: Remove registration of selector methods that were deleted in e7ddc933 2016-09-19 11:59:29 -04:00
9064e30296 Update to Chromium revision 1ae106db (#414607) 2016-09-01 11:52:50 +03:00
98f59f47fd Update to Chromium revision fc6aaca4 (#406441) 2016-07-26 13:28:54 -04:00
3cc539b506 Depend directly on chrome targets and unfork code (issue #1947) 2016-07-15 21:17:44 -04:00
c8681ea3e8 Mac: Remove duplicate focus change notification 2016-07-11 17:11:42 -04:00
a60bb077a3 Update to Chromium revision 68623971 (#403382) 2016-07-07 16:24:12 -04:00