Commit Graph

1241 Commits

Author SHA1 Message Date
Marshall Greenblatt 8c6cc302d0 Fix OSR surface sizing on browser resize (fixes issue #2733).
This includes the following changes:
- Update usage of surface IDs to match the Aura implementation from the
  RWHVAura/Window classes.
- Batch CefBrowserHost::WasResized calls to avoid excessive/unnecessary calls
  to SynchronizeVisualProperties.
- Cache the results of CefRenderHandler::GetViewRect after resize and make
  RWHVOSR::GetViewBounds the source of truth for all size calculations.
- Fix bounds calculations in CefVideoConsumerOSR with GPU enabled.

Known issues:
- The size passed to OnPaint may be off by 1 pixel in cases where the device
  scale factor is not 1 and does not divide evenly into the pixel size. This is
  due to the inexact conversion from integer pixel size to integer logical size
  for GetViewRect.
2020-02-21 15:02:52 -05:00
Marshall Greenblatt a141082b91 Fix navigation to debug URLs 2020-02-17 13:19:09 -05:00
Alexander Guettler 71768ea6c3 Update to Chromium version 80.0.3987.0 (#722274) 2020-02-17 13:19:09 -05:00
Marshall Greenblatt 1da3f71357 Fix race between OpenInputStreamWrapper Open and Cancel (fixes issue #2843) 2020-01-29 17:14:29 -05:00
Marshall Greenblatt 9df4a54308 Linux: Fix crashes on main window close (fixes issue #2831)
Call DesktopWindowTreeHostPlatform::Close after destroying CEF's X11 window
so that objects owned by the WindowTreeHost (Compositor, X11Window, etc) are
properly cleaned up.
2020-01-27 17:34:19 -05:00
Marshall Greenblatt a12c2ab3e1 Add support for MimeHandlerViewInCrossProcessFrame (fixes issue #2727)
The PDF loading documentation in extension_system.cc has be updated to
describe the new code paths.

To support delivery of input events to the mime handler renderer process it is
now necessary to route events via the correct RWHV interface. For Aura-based
platforms (Windows/Linux) this means RWHVAura::On*Event and for macOS this
means RWHVMac::RouteOrProcess*Event. Since Aura uses UI event types these have
become the source of truth on Aura-based platforms with conversion to Web event
types when needed (primarily for OSR).

This change also adds a timeout for CefProcessHostMsg_GetNewBrowserInfo to
avoid a hung renderer process if the guest WebContents route is not
registered via CefMimeHandlerViewGuestDelegate::OnGuestDetached as expected
prior to CefBrowserInfoManager::OnGetNewBrowserInfo being called. This
timeout can be disabled for testing purposes by passing the
`--disable-new-browser-info-timeout` command-line flag.

The `--disable-features=MimeHandlerViewInCrossProcessFrame` command-line
flag can be used for a limited time to restore the previous implementation
based on BrowserPlugin. That implementation will be deleted starting with
the 3897 branch update.

Known issues:
- ExecuteJavaScript calls on the frame hosting the PDF extension will not
  be routed to the mime handler renderer process.
- The PDF extension will not load successfully if blocked by
  ChromePluginPlaceholder and then manually continued via the "Run this
  plugin" context menu option (see https://crbug.com/533069#c41).
2020-01-24 20:16:47 -05:00
Marshall Greenblatt 679850a267 Fix crash due to NULL frame during navigation (fixes issue #2772) 2020-01-16 11:18:28 +01:00
Marshall Greenblatt c90b65a72c Fix potential crash in OpenInputStreamWrapper::Open (fixes issue #2808) 2020-01-15 16:46:18 +01:00
Marshall Greenblatt ea63799c3e libcef: Convert NULL to nullptr (see issue #2861) 2020-01-15 14:49:22 +01:00
Yong Li 8d0ae1f894 Remove possibly incorrect CHECK in ProxyURLLoaderFactory::MaybeDestroySelf()
See also commit #81064faa.
2020-01-08 15:09:57 +00:00
Andrei Kurushin 95daea76fc Fix OSR popup view mouse wheel double event (fixes issue #2547) 2020-01-08 17:03:52 +02:00
elad bahar 8ca0b4580e Fix OSR rendering recovery after GPU process crash (fixes issue #2827) 2020-01-08 14:39:24 +02:00
Riku Palomäki 80fc651d7e Ignore OSR paint events on hidden views (fixes issue #2817) 2020-01-08 12:33:06 +00:00
Riku Palomäki 0f944cdc55 Fix routing of OSR input events inside iframes (fixes issue #2789)
Mouse events need to be routed to the correct view and
CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView needs to be
properly implemented for
RenderWidgetHostInputEventRouter::DispatchTouchscreenGestureEvent to
transform event position in the target widget.
2020-01-08 12:32:05 +00:00
Marshall Greenblatt 7c866328e0 Only create Documents\Downloads dir if necessary (fixes issue #2841) 2020-01-06 16:52:39 +02:00
Marshall Greenblatt 0d4879763a Fix crash when loading a file URL if using CefCookieAccessFilter (fixes issue #2818) 2020-01-06 14:47:18 +02:00
Marshall Greenblatt 1c88c74f86 Convert usage and tests to the new CefResourceHandler API (see issue #2622)
Limited test coverage for the old API is still available by passing the
`--test-old-resource-api` command-line flag to ceftests.
2019-12-31 16:11:29 +02:00
Marshall Greenblatt dfcfb51bef Fix shutdown crash in InitNetworkContext with multi-threaded message loop (fixes issue #2703) 2019-11-26 16:26:48 -05:00
Riku Palomäki 49786ccc34 Fix OSR scrolling by passing our compositor to the fling scheduler (fixes issue #2745) 2019-11-26 19:04:19 +00:00
Riku Palomäki c4284b2938 Fix crash when resizing an OSR browser window (fixes issue #2614)
(cherry picked from commit feffedbae9)
2019-11-26 18:42:34 +00:00
Masako Toda a90c9f9c3e Pass the raw size of pixel data instead of valid area (fixes issue #2733) 2019-11-26 18:29:27 +00:00
Marshall Greenblatt bb006b46e6 Fix potential OSR crash due to uninitialized host_display_client_ (see issue #2811) 2019-11-26 13:26:54 -05:00
Marshall Greenblatt 319de22d89 Allow CefImage usage from any thread 2019-11-19 13:29:33 -05:00
Daniel Nitsche 115f760821 Update to Chromium version 79.0.3945.1 (#706915) 2019-11-19 13:22:13 -05:00
Marshall Greenblatt b9fc93955c Fix DiscardableSharedMemoryManager crash on shutdown with multi-threaded message loop (fixes issue #2798) 2019-11-06 16:29:34 -05:00
Marshall Greenblatt 3a8778e2f8 Remove NOTREACHED in CefPostDataElementImpl::Set (fixes issue #2765) 2019-11-06 14:00:38 -05:00
Marshall Greenblatt 58e17b3cdc Fix crash in RemoveFrame on unknown frame_tree_node_id (fixes issue #2799) 2019-11-06 13:17:18 -05:00
Marshall Greenblatt c8d0813669 Restore expected Accept-Language request header order (fixes issue #2796) 2019-11-05 15:29:32 -05:00
Marshall Greenblatt 65f97a60ad Remove the enable-net-security-expiration option (see issue #2622)
The implementation of this option was removed in commit 67b61c4. Certificate
transparency is disabled by default for Chromium embedders. Details at:

https://chromium.googlesource.com/chromium/src/+/master/net/docs/certificate-transparency.md#Supporting-Certificate-Transparency-for-Embedders
2019-10-29 11:36:29 -04:00
Marshall Greenblatt a4b6ef577e Don't set "always on top" style for child CefWindows.
As of https://crrev.com/9e653328e3 the Views framework will apply the "always
on top" (WS_EX_TOPMOST) style by default to widgets created with TYPE_MENU. CEF
uses this type in CefWindowView::CreateWidget to support child windows that are
not clipped to the parent window bounds (currently indicated by returning a
parent window from CefWindowDelegate::GetParentWindow and setting |is_menu| to
true).

Not setting "always on top" shouldn't be a problem except in cases where some
other window is already "always on top" and the child CefWindow is expected to
overlay that window. For this reason any menus created using ShowMenu will
continue to have the "always on top" style.
2019-10-18 15:08:23 +02:00
Marshall Greenblatt 01e75761d3 Remove incorrect DCHECK
There are valid cases where |frame_tree_node_id| may not match the node ID
reported by the selected RenderFrameHost.
2019-10-18 15:08:16 +02:00
Marshall Greenblatt 737ff18498 Remove CefFrame::LoadString method (fixes issue #2586)
This method has not behaved as expected for some time.
2019-10-15 17:34:16 +02:00
Marshall Greenblatt b560f04046 Fix printing from iframes (fixes issue #2753) 2019-10-15 13:52:26 +02:00
Marshall Greenblatt 066762217f Add picture-in-picture support for video (fixes issue #2776) 2019-10-15 11:11:59 +00:00
Mike Wiedenbauer 1d515adc22 Modify CefResponse header methods to match CefRequest API (fixes issue #2770) 2019-10-14 13:49:05 +02:00
Maksim Sisov 152141d7f4 Remove NOTREACHED that triggers on ozone platforms.
Native frames are not guaranteed to be supported on Ozone/Wayland.
2019-10-04 10:57:29 +00:00
Marshall Greenblatt 466f5e23db Add chrome://process-internals support (see issue #2498) 2019-10-04 13:29:35 +03:00
Marshall Greenblatt eea1f6be63 Enable strict site isolation by default (see issue #2498)
This restores the default site isolation mode for Chromium on desktop
platforms. Unit tests have been updated to reflect the new behavior
expectations.

Known behavior changes in CEF are as follows:
- A spare renderer process may be created on initial browser creation or cross-
  origin navigation. This spare process may be used with a future cross-origin
  navigation or discarded on application shutdown. As a result
  CefRenderProcessHandler::OnRenderThreadCreated, which is called shortly after
  renderer process creation, can no longer be used to reliably transfer state
  for the currently in-progress navigation. Unit tests have been updated to use
  the CreateBrowser/OnBeforePopup |extra_info| value for transferring test state
  to CefRenderProcessHandler::OnBrowserCreated which will be called in the
  correct/expected renderer process.
- Cross-origin navigations will again receive a new renderer process, as
  expected. This behavior had briefly regressed in M78 due to the
  ProcessSharingWithDefaultSiteInstances feature becoming enabled by default.
- Cross-origin navigations initiated by calling LoadURL in the renderer process
  will now crash that process with "bad IPC message" reason
  INVALID_INITIATOR_ORIGIN (213). This is a security feature implemented in
  Chromium.
- A DevTools browser created using CefBrowserHost::ShowDevTools will receive
  the same CefRenderProcessHandler::OnBrowserCreated |extra_info| value that was
  set via CreateBrowser/OnBeforePopup for the parent browser.
2019-10-03 17:18:01 +03:00
Maksim Sisov a8263b1b4f Fix ozone build issues (fixes issue #2748) 2019-10-02 09:47:10 +00:00
Marshall Greenblatt bc5cbcf39b Add Google SafeSearch support with NetworkService (see issue #1917) 2019-10-02 12:33:56 +03:00
Marshall Greenblatt 729b3f0a8f Remove cef_sandbox dependency on boringssl MD5/SHA1 functions (fixes issue #2743) 2019-10-01 17:13:02 +03:00
Marshall Greenblatt f8e0797773 Update to Chromium version 78.0.3904.0 (#693954) 2019-10-01 13:55:16 +00:00
Marshall Greenblatt e3723dcda5 Revert "Add ability to capture audio output to buffer (see issue #2381)"
This reverts commit 9f41a27e58.

This needs to be reimplemented to support out of process audio (see issue #2755).
2019-09-20 17:23:33 +03:00
Alexander Guettler 46d3a81ba0 Update to Chromium version 77.0.3865.0 (#681094)
- Windows: SDK version 10.0.18362.0 is now required.
2019-09-04 15:13:32 +00:00
Marshall Greenblatt 8f0a202e0c Fix folder upload with `input type=file webkitdirectory` (fixes issue #2751) 2019-08-26 15:43:55 -04:00
Marshall Greenblatt 67b61c4af9 Remove the old network implementation (see issue #2622)
The `--disable-features=NetworkService` flag is no longer supported.
2019-07-29 17:41:45 -04:00
Marshall Greenblatt ccb06ce3cb Fix crash on DevTools remote debugging of WebWorkers (fixes issue #2605) 2019-07-26 09:47:11 -04:00
Marshall Greenblatt 2d8d064ce8 Fix missing cookie after redirect response with filter (fixes issue #2689, see issue #2622) 2019-07-25 16:50:30 -04:00
Marshall Greenblatt 4c70c67042 Fix option for persisting session cookies (fixes issue #2720, see issue #2622) 2019-07-25 15:27:15 -04:00
Marshall Greenblatt 1d3b911b16 macOS: Fix alert dialog display (fixes issue #2726) 2019-07-25 12:28:41 -04:00
Rob Sussman c038bf8198 macOS: Support configuration of the main bundle path (fixes issue #2729) 2019-07-25 15:47:46 +00:00
Marshall Greenblatt 15fc7e58a8 Fix PDF load in <embed> and <object> tags (fixes issue #2727, see issue #2622) 2019-07-24 17:12:00 -04:00
Marshall Greenblatt e57acace0b 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:27:38 -04:00
Marshall Greenblatt 1fd1b320c2 Fix crash when showing views context menu 2019-07-19 21:55:30 -04:00
Ananyo Maiti 1669c0afbd Add print preview support (see issue #123)
Pass the `--enable-print-preview` command-line flag to enable. Currently only
supported on Windows and Linux.
2019-07-19 21:55:30 -04:00
Marshall Greenblatt cf87c88b05 Remove unused GetCompositor method and fix macOS compile error (see issue #2575) 2019-07-18 19:41:47 -04:00
Masako Toda 99c27f57b1 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 17:43:44 -04:00
Riku Palomäki 367c6eb704 Fix dangling pointers in CefAudioMirrorDestination (fixes issue #2713). 2019-07-16 21:42:39 +00:00
Isaac Devine 1086495096 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 21:42:35 +00:00
Marshall Greenblatt 3f1ebebde5 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 16:33:08 -04:00
Alexander Guettler ac2cc54e13 Add initial Viz implementation for OSR (see issue #2575).
The old shared surface implementation has been removed and will need to be
re-implemented using the Viz code path.
2019-07-16 16:33:08 -04:00
Petra Öhlin cc0db5f166 Update to Chromium version 76.0.3809.0 (#665002)
OSR tests will be fixed by a follow-up merge of Viz support (see issue #2575).
2019-07-16 15:34:16 -04:00
Marshall Greenblatt 5892ffc382 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:56:51 -04:00
Marshall Greenblatt 45329d05a5 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:54:42 -04:00
Marshall Greenblatt 02a6b3bb38 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 10:50:33 -04:00
Marshall Greenblatt 732a307c75 Fix CefFrame::GetIdentifier value in the render process (fixes issue #2687, see issue #2498) 2019-06-19 16:55:31 +02:00
Marshall Greenblatt b03a419c6b 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 15:49:08 +02:00
Marshall Greenblatt ba08c21517 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:21:04 +02:00
Marshall Greenblatt 81064faac3 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 18:52:31 +02:00
Marshall Greenblatt c3c3af34fd Fix inclusion of cookies with restarted requests (fixes issue #2672, see issue #2622) 2019-06-12 17:19:09 +02:00
Marshall Greenblatt 0b7c0be29a Use FrameTreeNodeId to find delay loaded iframes for OnBeforeBrowse (fixes issue #2675, see issue #2498) 2019-06-12 11:48:57 +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
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 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
Andrei Kurushin 03c1c21fd3 Fix crash when setting an invalid cookie (fixes issue #2657) 2019-05-08 18:12:21 +00:00
cef-ms 473c29a70d Add |extra_info| parameter for browser creation (fixes issue #1088)
The optional |extra_info| parameter provides an opportunity to specify extra
information specific to the created browser that will be passed to
CefRenderProcessHandler::OnBrowserCreated() in the render process.
2019-05-08 12:31:46 -04:00
Chris Dziemborowicz ad4ce5f441 Fix |options| argument usage in GetJSONWriterOptions (fixes issue #2647) 2019-05-08 15:10:19 +00:00
Ananyo Maiti 3827f817c7 Support override of client id for file scanning (fixes issue #2368). 2019-05-07 16:22:16 +00:00
Marshall Greenblatt 8b400331c7 Support disabling of cookie load/save via SetSupportedSchemes (see issue #2622).
With this change the CefCookieManager::SetSupportedSchemes method can be used
to disable all loading and saving of cookies for the associated request context.
This matches functionality that was previously available via GetBlockingManager.

This change also fixes a bug where Set-Cookie headers returned for a request
handled via CefSchemeHandlerFactory would be ignored if there was not also a
CefResourceRequestHandler returned for the request.

To test: All CookieTest.* tests pass.
2019-05-02 18:33:10 -04:00
Marshall Greenblatt 4592cba19f Fix command-line override of the User-Agent product component (see issue #2622).
When the NetworkService is enabled the U-A string is configured via
SystemNetworkContextManager::CreateDefaultNetworkContextParams, which calls
chrome_content_browser_client.cc GetUserAgent(). This change modifies the Chrome
implementation to match CEF, so that the U-A product component can still be
overridden via the `--product-version` command-line flag.

To test: Verify that chrome://version, navigator.userAgent (JS executed from
DevTools console) and network requests (headers shown in DevTools Network tab)
show the expected User-Agent value in the following cases:
- Running `cefclient --enable-network-service --user-agent="<value>"`
- Running `cefclient --enable-network-service --product-version="<value>"`
2019-05-02 14:06:54 -04:00
Marshall Greenblatt b1018ad64b Fix SystemNetworkContextManager initialization timing (see issue #2622). 2019-05-02 13:33:44 -04:00
Marshall Greenblatt 5ce52bd775 Add NetworkService support for extensions and downloads (see issue #2622).
To test:
- All tests pass with NetworkService disabled. DownloadTest.*, ExtensionTest.*
  and PluginTest.* tests pass with NetworkService enabled.
- The PDF extension displays a file, and the download and print buttons work.
2019-05-01 17:10:52 -04:00
Marshall Greenblatt 370cc028cb Add NetworkService support for chrome and chrome-devtools schemes (see issue #2622).
Known behavior changes:
- Unsupported chrome hosts no longer redirect to chrome://version.

To test: All tests pass with NetworkService disabled. WebUITest.* and V8Test.*
tests pass with NetworkService enabled.
2019-04-30 17:16:42 -04:00
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