Commit Graph

1096 Commits

Author SHA1 Message Date
Marshall Greenblatt 9fd6c8a1ee Mac: Fix build error and NetworkService startup assertion (see issue #2622).
Fixes FATAL:os_crypt_mac.mm(103)] Check failed: g_key_creation_util
2019-04-29 11:33:04 -04:00
Marshall Greenblatt 4e089766a5 Fix NetworkService startup assertion with multi-threaded message loop (see issue #2622).
When using multi-threaded message loop mode the PrefService needs to be created
on the UI thread.

To test: Run `cefclient --enable-network-service --multi-threaded-message-loop`.
The application should start successfully.
2019-04-26 17:17:26 -04:00
Marshall Greenblatt cc80175e89 Linux: Fix NetworkService startup assertion in FeatureList::InitializeInstance (see issue #2622). 2019-04-26 13:22:07 -07:00
Marshall Greenblatt 8a4f4bff9b Fix NetworkService load hang with default request handling (see issue #2622).
This change fixes a load hang when no custom handlers (CefResourceRequestHandler
or registered scheme handler) are found for a request.

To test: Run `cefsimple --enable-network-service` and all requests load. Test
expectations are unchanged.
2019-04-26 14:22:44 -04:00
Marshall Greenblatt 2ace33f8b7 Move cookie load/save callbacks to CefCookieAccessFilter (see issue #2622).
This change allows the NetworkService to handle cookie load/save in cases where
cookies will not be filtered (CefResourceRequestHandler::GetCookieAccessFilter
returns null) and the request will be handled by the default network loader.
This represents a minor performance improvement by reducing the volume of cross-
process messaging in the default (no filtering or custom handing) case. Cookie
load/save still needs to be routed through the browser process if a filter is
returned, or if a CefResourceHandler is used for the request.

To test: Test expectations are unchanged.
2019-04-26 13:02:58 -04:00
Marshall Greenblatt 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
Jesper Papmehl-Dufay 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
santosh mahto 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
Daniel Nitsche 879911b721 Update to Chromium version 75.0.3749.0 (#645082) 2019-04-16 14:38:48 +00:00
Riku Palomäki 1beec23065 Fix assert failure when hiding the OSR widget (fixes issue #2631) 2019-04-15 17:25:30 +00:00
Orfeas Zafeiris 5623338662 Fix OSR use_external_begin_frame support and update VSync setters (fixes issue #2618) 2019-04-15 16:57:33 +00:00
Marshall Greenblatt 9ce29e8ec5 Fix crash on shutdown with extensions enabled (see issue #2622).
We don't support the WebRequestAPI yet, so we shouldn't be creating any objects
for it.

To test: Run `cefclient --enable-network-service` and then close the app.
2019-03-27 14:43:54 -04:00
Marshall Greenblatt b949d86c40 Move CookieManager callbacks to the UI thread (see issue #2622).
The Chromium content layer (which also exposes the NetworkService interface)
generally runs on the UI thread. Previous use of the IO thread for CookieManager
callbacks is an implementation detail of the old network stack that shouldn't be
exposed to clients.

To test: Run ceftests. They should pass as expected.
2019-03-25 15:36:08 -04:00
Marshall Greenblatt 85c34c4dcf Add CookieManagerImpl for NetworkService (see issue #2622).
To test: Run `ceftests --gtest_filter=CookieTest.*:-CookieTest.GetCookieManager*
                       --enable-network-service`

There should be no functional change when running without the NetworkService
enabled.

Known issues:
- CefCookieManager::SetSupportedSchemes is not yet implemented.
2019-03-25 15:35:59 -04:00
Marshall Greenblatt b65f336f81 Enforce cache_path requirements for NetworkService (see issue #2622).
This change adds a new CefSettings.root_cache_path value that must be either
equal to or a parent directory of all CefSettings.cache_path and
CefRequestContextSettings.cache_path values. The sandbox may block read/write
access from the NetworkService to directories that do not meet this requirement.

To test: Run cefclient with a combination of the following flags:

--cache-path=c:\temp\cache
  Cache data should be persisted to the specified directory.

--request-context-per-browser
  A separate numbered cache directory should be created underneath the
  cache-path directory for each new browser instance.

--enable-network-service --disable-extensions
  Same tests, but with NetworkService enabled.

Known issues:
- When NetworkService is enabled a C:\temp\cache\cache\Cache directory is
  created (should be C:\temp\cache\Cache).
2019-03-24 16:47:00 -04:00
Marshall Greenblatt 9b43d265c3 Remove Chromium patches that are no longer required (see issue #2622). 2019-03-24 16:45:07 -04:00
Marshall Greenblatt ea27dff338 Move the frame/handler association to CefResourceContext (see issue #2622).
A CefBrowserHostImpl is created using a CefRequestContextImpl that may have a
CefRequestContextHandler. Multiple CefRequestContextImpl may share the same
underlying CefBrowserContext which owns a CefResourceContext. IO-thread
callbacks from Chromium are often associated with a CefResourceContext and the
target frame is identified using render_process_id/render_frame_id routing IDs.

This change forwards frame create/delete notifications from CefBrowserHostImpl
(or CefMimeHandlerViewGuestDelegate) to CefResourceContext so that it can
properly resolve the association from routing ID to Handler when queried from
CefPluginServiceFilter::IsPluginAvailable.

To test: Verify that all ceftests pass with NetworkService disabled.
2019-03-24 16:45:07 -04:00
Marshall Greenblatt a23e845244 Remove methods that modify cookie storage at runtime (see issue #2622).
This change removes cookie and request handler functionality that will not
supported by the NetworkService. Specifically, it is no longer possible to
change cookie storage locations at runime by returning a different
CefCookieManager for an already initialized CefRequestContext. After this change
you will need to use a separate CefRequestContext when creating a CefBrowser if
you require separate cookie storage.

The following methods have been removed:
- CefCookieManager::CreateManager
- CefCookieManager::GetBlockingManager
- CefCookieManager::SetStoragePath
- CefRequestContextHandler::GetCookieManager

The following methods have been renamed:
- CefRequestContext::GetDefaultCookieManager to GetCookieManager.

This change substantially simplifies the network implementation in CEF because
it is no longer necessary to proxy objects that are normally owned by Chromium.
Chromium patches that are no longer necessary will be removed as a follow-up
commit.

To test: Verify that `ceftests --gtest_filter=-PluginTest.*` pass with
NetworkService disabled. Plugin tests will be fixed in a follow-up commit.
2019-03-24 16:45:06 -04:00
Marshall Greenblatt 6b2c1fe969 Add initial NetworkService support (see issue #2622).
This change adds an --enable-network-service command-line flag to run with
NetworkService enabled.

To test: Run `cefclient --enable-network-service --disable-extensions`. The
application should start, load a website and exit without crashing.
Network-related handlers (for cookies, schemes, requests, etc) and extensions
are not expected to work yet.

There should be no functional change when running without the NetworkService
enabled.
2019-03-24 16:43:56 -04:00
Marshall Greenblatt b3468451f5 Linux: Load additional binaries from DIR_ASSETS (fixes issue #1936)
This adds *.pak, locales/*.pak , chrome-sandbox, libGLESv2.so, libEGL.so and
swiftshader/*.so to the list of binaries that will be loaded from the libcef.so
directory instead of the executable directory by default.
2019-03-20 14:14:49 -04:00
Riku Palomäki a48e072076 Linux: Add OSR use_external_begin_frame support (see issue #1006) 2019-03-18 21:07:02 +00:00
Riku Palomäki 531df6eaba Fix frozen OSR rendering after resize (fixes issue #2627) 2019-03-18 21:04:21 +00:00
Riku Palomäki 64ad8c32f2 Make sure to call OnLoadingStateChange when navigation state changes (fixes issue #2624) 2019-03-18 21:03:36 +00:00
Riku Palomäki d8845b88f4 Fix OSR PDF viewer rendering on initial page load (fixes issue #2598) 2019-03-18 21:02:37 +00:00
Alexander Guettler 725ed88529 Update to Chromium version 74.0.3729.0 (#638880)
- Windows: 10.0.17763.0 SDK is now required.
- Mac: 10.13 SDK is now required.
- Removed CefRequestContext::ResolveHostCached which is no longer supported by Chromium.
2019-03-13 21:27:37 +00:00
Mike Wiedenbauer 58e1149c71 Add ability to capture audio output to buffer (issue #2381) 2019-03-07 17:09:54 -05:00
Riku Palomäki 7b5d30e9a9 Add pen support for OSR (issue #1059) 2019-03-07 22:06:54 +00:00
Felix Bruns 4cbcb4615a Add 'UR_FLAG_DISABLE_CACHE' and support for equivalent 'Cache-Control: no-store' (issue #2283) 2019-03-07 22:05:36 +00:00
Riku Palomäki 602c163127 Linux: Override DIR_ASSETS with libcef directory (issue #1936) 2019-03-07 22:04:32 +00:00
Riku Palomäki feffedbae9 Fix a crash when resizing an OSR browser window (issue #2614) 2019-03-07 22:03:35 +00:00
Riku Palomäki 18ef4f72c7 Fix OSR crash when display DPI changes (issue #2600). 2019-02-27 19:44:31 +00:00
Branko Čibej 34db87563e Linux: Add support for setting the initial window title (issue #2204). 2019-02-27 19:18:16 +00:00
Branko Čibej 658bf2834a Linux: Add support for the Chrome command-line option --touch-devices (issue #2205). 2019-02-27 19:17:21 +00:00
Riku Palomäki 5f615a95bc Add multi-touch support for OSR (issue #1059) 2019-02-26 11:51:33 -05:00
Riku Palomäki 379fb8d39e Add CefRenderHandler::OnVirtualKeyboardRequested (issue #2607) 2019-02-26 16:49:41 +00:00
Alexander Guettler c72d57aa60 Replace AddCustomScheme bool arguments with int using bit flags 2019-02-26 16:45:12 +00:00
Mike Wiedenbauer ba8b4e8b9d Add support for muting audio in the browser (issue #1806) 2019-02-26 16:44:17 +00:00
Riku Palomäki 8d1453fd24 Fix crash if CefAuthCallback outlives the matching URLRequest (issue #2612) 2019-02-26 16:42:22 +00:00
Marshall Greenblatt 5a1c642431 Update to Chromium version 74.0.3706.0 (#632463) 2019-02-25 12:09:54 -05:00
Marshall Greenblatt 176e14d451 Add missing header include (issue #1614) 2019-02-14 17:08:42 -05:00
Marshall Greenblatt 4c730e8935 Add DevTools save dialog support (issue #1614) 2019-02-12 15:31:52 -05:00
Marshall Greenblatt 0e461b7f5c Move DevTools sources to browser/devtools 2019-02-12 13:43:44 -05:00
Marshall Greenblatt d73fc464c9 Remove unnecessary DCHECK(!dialog_running_) on browser destruction (issue #2589) 2019-02-11 17:50:03 -05:00
Marshall Greenblatt f85816f0c7 Windows: Fix focus assignment after dismissing JS dialogs (issue #2584) 2019-02-11 17:26:12 -05:00
Marshall Greenblatt b8eaec0db2 Windows: Use WS_EX_NOACTIVATE to control initial window activation (issue #1856) 2019-02-07 16:38:26 -05:00
Alexander Guettler a72e00a7b9 Add option to enable fetch support for custom schemes (issue #2579) 2019-02-04 22:31:31 +00:00
Marshall Greenblatt bf51cd21b6 Update to Chromium version 73.0.3683.0 (#625896) 2019-02-04 11:16:53 -05:00
Mathieu Lafon ec2ee91bf0 Fix 'auth.gssapi_library_name' pref handling (issue #2568) 2019-02-01 21:08:40 +00:00
Marshall Greenblatt 2e7f935b0d Update to Chromium version 73.0.3679.0 (#624510) 2019-02-01 16:42:40 +00:00
Marshall Greenblatt 4b0ac90ab3 Windows: Another fix for OSR rendering with shared texture enabled (issue #2559) 2019-01-30 14:48:19 -05:00