2025 Commits

Author SHA1 Message Date
Riku Palomäki
16a67c4507 Fix gclient_util after depot_tools changes (fixes issue #2736) 2019-08-05 14:07:23 -04:00
Dmitry Azaraev
0ebdb473b1 Fix missing marshaling for CefSettings::root_cache_path member (fixes issue #2740) 2019-08-05 14:07:16 -04:00
Marshall Greenblatt
c81164e2ce Fix crash on DevTools remote debugging of WebWorkers (fixes issue #2605) 2019-07-26 09:49:58 -04:00
Marshall Greenblatt
e0be1d916d Fix missing cookie after redirect response with filter (fixes issue #2689, see issue #2622) 2019-07-25 17:02:24 -04:00
Marshall Greenblatt
d9915d728f Fix option for persisting session cookies (fixes issue #2720, see issue #2622) 2019-07-25 15:29:24 -04:00
Marshall Greenblatt
5656baa197 Fix C compile error due to unintentional C++ include (fixes issue #2728) 2019-07-25 13:42:31 -04:00
Marshall Greenblatt
fed0e1826a macOS: Fix alert dialog display (fixes issue #2726) 2019-07-25 12:36:50 -04:00
Dmitry Azaraev
a9c022bd11 Fix typo in documentation for CefResourceHandler::Skip 2019-07-25 12:36:42 -04:00
Marshall Greenblatt
84fed5dc0e Fix PDF load in <embed> and <object> tags (fixes issue #2727, see issue #2622) 2019-07-24 20:29:15 -04:00
Marshall Greenblatt
b34af23449 Fix crash on shutdown with PDF viewer and multi-threaded message loop (fixes issue #2709, see issue #2622)
Requests from the PDF viewer are not associated with a CefBrowser. Consequently,
the InterceptedRequestHandler for those requests will register as an observer of
CefContext destruction. When the browser is closed the InterceptedRequestHandler
is destroyed and an async task is posted to remove/delete the observer on the UI
thread. If CefShutdown is then called the task may execute after shutdown has
started, in which case CONTEXT_STATE_VALID() will return false. We still need to
remove the observer in this case to avoid a use-after-free in
FinishShutdownOnUIThread.
2019-07-23 15:29:46 -04:00
Dmitry Azaraev
94d09f80e7 Fix typo in documentation for cef_settings_t::cache_path. 2019-07-23 15:29:40 -04:00
Marshall Greenblatt
1c3d34bc32 Fix crash when extensions are disabled (fixes issue #2708, see issue #2622) 2019-07-23 12:22:46 -04:00
Riku Palomäki
4210896724 Fix dangling pointers in CefAudioMirrorDestination (fixes issue #2713). 2019-07-16 17:45:20 -04:00
Isaac Devine
1931b9c969 Fix race with multi-threaded message loop (fixes issue #2668).
Remove the local thread object in favor of setting the ui_thread_ field
directly. This avoids the race between ui_thread_.swap(thread) and
CefUIThread::InitializeBrowserRunner.
2019-07-16 17:45:10 -04:00
Alexander Guettler
fdd887b677 Fix dangling pointers in CefScopedArgArray (fixes issue #2704). 2019-07-16 17:44:59 -04:00
Masako Toda
849a6e64dc Fix redirect of requests with credentials mode 'include' (fixes issue #2699, see issue #2622).
Modifying the URL in OnBeforeResourceLoad causes an internal redirect response.
In cases where the request is cross-origin and credentials mode is 'include'
the redirect response must include the "Access-Control-Allow-Credentials"
header, otherwise the request will be blocked.
2019-07-16 21:42:04 +00:00
Marshall Greenblatt
5e9ca096e0 Add support for GetAuthCredentials (fixes issue #2718, see issue #2622).
When NetworkService is enabled requests created using CefFrame::CreateURLRequest
will call CefRequestHandler::GetAuthCredentials for the associated browser after
calling CefURLRequestClient::GetAuthCredentials if that call returns false.
2019-07-16 13:30:46 -04:00
Marshall Greenblatt
3b211d4bf5 Remove POST data after redirect to GET (see issue #2707, see issue #2622).
For 303 redirects all request methods except HEAD are converted to GET as per
the latest http draft. For historical reasons the draft also allows POST
requests to be converted to GETs when following 301/302 redirects. Most major
browsers do this and so shall we. When a request is converted to GET any POST
data should also be removed.

Use 307 redirects instead if you want the request to be repeated using the same
method and POST data.
2019-07-11 16:43:39 -04:00
Marshall Greenblatt
2c92fcd3cd Fix cross-origin redirect from OnBeforeResourceLoad (fixes issue #2695, see issue #2622).
Modifying the URL in OnBeforeResourceLoad causes an internal redirect response.
In cases where the request is cross-origin (containing a non-null "Origin"
header) the redirect response must include the "Access-Control-Allow-Origin"
header, otherwise the request will be blocked.

This change also fixes a problem where existing request headers would be
discarded if the request was modified in OnBeforeResourceLoad.
2019-06-25 16:56:45 -04:00
Marshall Greenblatt
d792e5fddf Fix loading of http(s) sub-resources from custom scheme initiator (fixes issue #2685, see issue #2622).
Determine external request status based on the current URL instead of the
request initiator.
2019-06-25 11:04:15 -04:00
Marshall Greenblatt
f50b3c2d43 Fix CefFrame::GetIdentifier value in the render process (fixes issue #2687, see issue #2498) 2019-06-19 16:57:17 +02:00
Marshall Greenblatt
6ad1dea9fa Fix crash if a pending request is continued after deletion (see issue #2622).
This is a speculative fix for a crash where the pending ResourceRequest appears
to be invalid after the request is continued from SetInitialized.
2019-06-19 16:01:58 +02:00
Marshall Greenblatt
542c867901 Update to Chromium version 75.0.3770.100 2019-06-19 14:06:11 +02:00
Marshall Greenblatt
5da93a11c8 Fix crashes when a request is aborted during initialization (see issue #2622).
Initialization of request objects requires asynchronous hops between the UI and
IO threads. In some cases the browser may be destroyed, the mojo connection may
be aborted, or the ProxyURLLoaderFactory object may be deleted while
initialization is still in progress. This change fixes crashes and adds unit
tests that try to reproduce these conditions.

To test: Run `ceftests --gtest_repeat=50
              --gtest_filter=ResourceRequestHandlerTest.Basic*Abort*`
2019-06-18 16:31:53 +02:00
Marshall Greenblatt
19229b6d38 Fix crash in ProxyURLLoaderFactory::MaybeDestroySelf (see issue #2622).
This is a speculative fix for a crash where |on_disconnect_| appears to be null
in ProxyURLLoaderFactory::MaybeDestroySelf. The hypothesis here is that
OnURLLoaderClientError is being called while the proxy object is still in-flight
to ResourceContextData::AddProxy (e.g. before SetDisconnectCallback has been
called for the proxy object). Additonally, this change protects against
MaybeDestroySelf attempting to execute |on_disconnect_| multiple times.
2019-06-14 19:01:10 +02:00
Marshall Greenblatt
90ecd35aff Fix inclusion of cookies with restarted requests (fixes issue #2672, see issue #2622) 2019-06-12 17:21:12 +02:00
Marshall Greenblatt
d3b54cbec7 macOS: Don't disable custom libc++ for cef_sandbox build (see issue #2677) 2019-06-12 12:00:50 +02:00
Marshall Greenblatt
3f2a3b1c67 Use FrameTreeNodeId to find delay loaded iframes for OnBeforeBrowse (fixes issue #2675, see issue #2498) 2019-06-12 11:53:14 +02:00
Marshall Greenblatt
699a922bd4 Windows: cmake: Add newer VS versions 2019-06-11 18:08:48 +02:00
Marshall Greenblatt
3b2e46543b Windows: Disable custom libc++ for cef_sandbox build (fixes issue #2677) 2019-06-11 18:08:26 +02:00
Marshall Greenblatt
b5e74dd297 Update to Chromium version 75.0.3770.80 2019-06-08 23:06:25 +02:00
Marshall Greenblatt
6546556a14 Add NetworkService support for DevTools source maps (fixes issue #2671, see issue #2622) 2019-06-06 18:37:45 +02:00
Marshall Greenblatt
6193d8c554 Update to Chromium version 75.0.3770.0 (#652427) 2019-06-06 18:37:45 +02:00
Marshall Greenblatt
ab6fd322d1 Fix crash when loading a file:// URL (fixes issue #2670) 2019-06-05 16:32:24 +02:00
Cristian Amarie
7e742f6e1f Add SSL_CONNECTION_VERSION_TLS1_3 to cef_ssl_version_t (fixes issue #2669) 2019-06-03 08:55:36 +00:00
Marshall Greenblatt
fa5268fa2d Fix issues with request callbacks during browser shutdown (see issue #2622).
The behavior has changed as follows with NetworkService enabled:
- All pending and in-progress requests will now be aborted when the CEF context
  or associated browser is destroyed. The OnResourceLoadComplete callback will
  now also be called in this case for in-progress requests that have a handler.
- The CefResourceHandler::Cancel method will now always be called when resource
  handling is complete, irrespective of whether handling completed successfully.
- Request callbacks that arrive after the OnBeforeClose callback for the
  associated browser (which may happen for in-progress requests that are aborted
  on browser destruction) will now always have a non-nullptr CefBrowser
  parameter.
- Allow empty parameters to CefRequest and CefResponse methods where it makes
  sense (e.g. resetting default response state, or clearing a referrer value).
- Fixed a reference loop that was keeping CefResourceHandler objects from being
  destroyed if they were holding a callback reference (from ProcessRequest,
  ReadResponse, etc.) during CEF context or associated browser destruction.
- Fixed an issue where the main frame was not detached on browser destruction
  which could cause a crash due to RFH use-after-free (see issue #2498).

To test: All unit tests pass as expected.
2019-06-01 15:51:33 +03:00
Marshall Greenblatt
fd80e5c653 Fix assertions when shutting down with pending requests (see issue #2622).
This change avoids the starting of new requests during shutdown.
2019-05-29 20:01:12 +03:00
Marshall Greenblatt
2814054863 Linux: Fix crash when closing a browser with pending requests (see issue #2622).
This change fixes an issue where the cancel_callback for a pending request
might already have been executed when the OnBrowserDestroyed notification is
received.
2019-05-29 09:43:29 -07:00
Marshall Greenblatt
241941a44a Move message routing from CefBrowser to CefFrame (see issue #2498).
This change moves the SendProcessMessage method from CefBrowser to CefFrame and
adds CefBrowser parameters to OnProcessMessageReceived and
OnDraggableRegionsChanged.

The internal implementation has changed as follows:
- Frame IDs are now a 64-bit combination of the 32-bit render_process_id and
  render_routing_id values that uniquely identify a RenderFrameHost (RFH).
- CefFrameHostImpl objects are now managed by CefBrowserInfo with life span tied
  to RFH expectations. Specifically, a CefFrameHostImpl object representing a
  sub-frame will be created when a RenderFrame is created in the renderer
  process and detached when the associated RenderFrame is deleted or the
  renderer process in which it runs has died.
- The CefFrameHostImpl object representing the main frame will always be valid
  but the underlying RFH (and associated frame ID) may change over time as a
  result of cross-origin navigations. Despite these changes calling LoadURL on
  the main frame object in the browser process will always navigate as expected.
- Speculative RFHs, which may be created as a result of a cross-origin
  navigation and discarded if that navigation is not committed, are now handled
  correctly (e.g. ignored in most cases until they're committed).
- It is less likely, but still possible, to receive a CefFrame object with an
  invalid frame ID (ID < 0). This can happen in cases where a RFH has not yet
  been created for a sub-frame. For example, when OnBeforeBrowse is called
  before initiating navigation in a previously nonexisting sub-frame.

To test: All tests pass with NetworkService enabled and disabled.
2019-05-29 17:44:56 +03:00
Marshall Greenblatt
35295d2e27 Fix evaluation of "Cache-Control: no-cache, no-store" header value (see issue #2283)
Choose the stricter "no-cache" behavior which implies the "no-store" behavior.
2019-05-21 17:51:43 +03:00
Marshall Greenblatt
6011d45e38 Enable NetworkService by default (see issue #2622).
The NetworkService can still be disabled for a limited time by specifying the
`--disable-features=NetworkService` command-line flag.
2019-05-20 19:42:44 +03:00
Marshall Greenblatt
9ddb013875 Add NetworkService support for response filtering (see issue #2622).
To test: ResourceRequestHandlerTest.Filter* tests pass with NetworkService
enabled.
2019-05-20 14:39:37 +03:00
Marshall Greenblatt
e5c7fd1c55 Add NetworkService support for CefLoadCRLSetsFile (fixes issue #2497, see issue #2622). 2019-05-18 21:30:06 +03:00
Marshall Greenblatt
99eebd00c4 Add NetworkService support for more CefRequestContext methods (see issue #2622).
This adds support for the CloseAllConnections and ResolveHost methods.

To test: RequestContextTest.Close* and RequestContextTest.Resolve* tests pass
with NetworkService enabled.
2019-05-18 20:48:03 +03:00
Marshall Greenblatt
bddf2a311b Fix NetworkService ServerTest.* failures and test name typo (see issue #2622).
Always return ERR_NONE and the response body if a CefURLRequest completes
successfully, including for non-2xx status codes. This matches the behavior of
the old network stack.

To test: ServerTest.* tests pass with NetworkService enabled.
2019-05-18 17:54:02 +03:00
Marshall Greenblatt
9a30f05f80 macOS: Fix compile errors 2019-05-18 15:23:17 +03:00
Marshall Greenblatt
2ea173a254 Cancel NetworkService requests when the browser is destroyed (see issue #2622).
Pending requests that are associated with a browser will be canceled when that
browser is destroyed. Pending requests that are not associated with a browser
(e.g. created using CefURLRequest::Create), and that use the global context, may
still be pending when CefShutdown is called. For this reason the
no_debugct_check attribute has been added for CefResourceRequestHandler and
CefCookieAccessFilter interfaces.

To test: Load a YouTube video or other long-loading content in cefclient and
close the application. No assertions trigger for leaked CefFrame objects.
2019-05-18 12:40:45 +03:00
Marshall Greenblatt
ba0e1b5719 Add NetworkService support for CefURLRequest (see issue #2622).
Requests created using CefURLRequest::Create are not associated with a
browser/frame. When originating from the render process these requests cannot be
intercepted and consequently only http(s) and blob requests are supported. To
work around this limitation a new CefFrame::CreateURLRequest method has been
added that allows the request to be associated with that browser/frame for
interception purposes.

This change also fixes an issue with the NetworkService implementation where
redirected requests could result in two parallel requests being sent to the
target server.

To test: URLRequestTest.* tests pass with NetworkService enabled.
2019-05-17 21:42:25 +03:00
Chris Dziemborowicz
f9b042c375 Fix version calculation for older commits on a release branch (fixes issue #2659) 2019-05-15 14:35:41 +00:00
Marshall Greenblatt
c7701b8a61 Windows: Add arch-specific versions of d3dcompiler_47.dll (see issue #2656)
This fixes an issue where the 64-bit version of d3dcompiler_47.dll would be
included with 32-bit binary distributions.
2019-05-15 14:36:58 +03:00