Commit Graph

903 Commits

Author SHA1 Message Date
Nicolas Dusart f6cf7f9ec7 Fix CefURLRequest crash with failing HEAD requests (fixes issue #3226) 2021-11-23 22:14:59 +00:00
Marshall Greenblatt c75ebbccec alloy: Add support for the new non-PPAPI PDF viewer (see issue #3047)
Enable by passing `--enable-features=PdfUnseasoned` on the command line.
2021-11-23 16:38:16 -05:00
Marshall Greenblatt 6eff48e9ff chrome: Add support for PdfViewerTest ceftests (see issue #3047)
We need to override ChromeMimeHandlerViewGuestDelegate to handle
OnGuestAttached/Detached callbacks in order to account for the guest renderer
process hosting the PDF extension.

Additional work will be required to account for the renderer process hosting the
PDF viewer when using `--enable-features=PdfUnseasoned` (see issue #2969).
2021-11-16 19:17:50 -05:00
Marshall Greenblatt f3cea7e7df chrome: Fix DCHECK when a temporary CefFrame is destroyed (see issue #2969)
The temporary CefFrame is created in NavigationOnUIThread during PDF loading.
2021-11-16 17:43:37 -05:00
Marshall Greenblatt 7f0c88b5da chrome: Show non-CefBrowserView browser windows on creation (see issue #2969)
Browser windows created via CefBrowserHost::CreateBrowser should be shown at
creation time. These windows receive default Chromium styling, unlike
CefBrowserView windows which may contain other client-specified Views and
where show state can be configured via CefWindowDelegate::GetInitialShowState
or by calling CefWindow::Show.
2021-11-16 17:25:04 -05:00
Marshall Greenblatt 66648c2343 Update to Chromium version 97.0.4692.0 (#938553)
- Remove CefRequestContextHandler::OnBeforePluginLoad and
  CefRequestContext::PurgePluginListCache (fixes issue #3047). These methods
  stopped being relevant after the removal of Flash support in January 2021.
  The last remaining PPAPI plugin (PDF viewer) will switch to a non-plugin
  implementation in the near future (see https://crbug.com/702993#c58) and
  functionality related to plugin filtering has already been removed in
  https://crrev.com/343ae351c9.
2021-11-15 14:25:16 -05:00
Marshall Greenblatt e83d8d6a13 Trial fix for CORS pre-flight requests missing headers (see issue #3110, see issue #3200) 2021-11-09 14:21:58 -05:00
Marshall Greenblatt 088816d496 Fix writing of files from DevTools (fixes issue #3211) 2021-11-08 15:05:28 -05:00
Marshall Greenblatt 3a2a22f30d osr: Fix GPU process crash with SendExternalBeginFrame (see issue #2800)
Fixes the following error:
Check failed: !pending_frame_callback_. Got overlapping IssueExternalBeginFrame

To test:
Run `cefclient --off-screen-rendering-enabled --external-begin-frame-enabled`
on Windows without crashing.
2021-10-28 15:14:45 -04:00
Marshall Greenblatt 6872dadd74 Update to Chromium version 96.0.4664.0 (#929512) 2021-10-21 15:43:15 -04:00
Marshall Greenblatt 4dd314dec3 alloy: Fix ComponentUpdateService shutdown crash with multi-threaded message loop (see issue #3149) 2021-10-20 17:08:23 -04:00
Marshall Greenblatt f3ed6619da Only disable request handling for HTTP/S schemes (see issue #3110)
The `--disable-request-handling-for-testing` command-line flag would previously
disable handling of all schemes, including custom schemes and internal schemes
such as devtools.
2021-10-05 11:03:28 +03:00
Andy Tzeng 1f85a7752b Fix the timing of SetBackgroundColor (fixes issue #2482)
If the background color is set too early it won't be sent to renderer process.
Also force refresh of the background color for newly created popups.
2021-10-04 09:58:22 +00:00
Marshall Greenblatt a7bbd8a62b Remove ignore_certificate_errors setting (fixes issue #2899)
This removes CefSettings.ignore_certificate_errors and
CefBrowserSettings.ignore_certificate_errors. Due to NetworkService
requirements these values must now be configured globally via the
"ignore-certificate-errors" command-line flag.
2021-09-27 16:36:57 +03:00
Marshall Greenblatt f158c34a21 Remove CefBrowserSettings related to file URL access (fixes issue #2820)
This removes CefBrowserSettings.universal_access_from_file_urls and
CefBrowserSettings.file_access_from_file_urls. Due to NetworkService
requirements these values must now be configured globally via command-line
flags ("allow-universal-access-from-files" and "allow-file-access-from-files"
respectively).

Also remove the kAllowFileAccessFromFileUrls switch in CEF which duplicates
the existing kAllowFileAccessFromFiles switch in Chromium (see issue #1785).
2021-09-27 16:36:57 +03:00
Marshall Greenblatt 659c037c84 Windows: Escape URLs passed to SellExecute (fixes issue #3133) 2021-09-27 16:36:57 +03:00
Marshall Greenblatt 6516b569a9 Remove CefBrowserSettings.application_cache (fixes issue #1785)
AppCache is deprecated in favor of Service Workers and support will be
fully removed soon (~M95). See https://web.dev/appcache-removal/.

Also add missing "allow-file-access-from-files" command-line switch for
CefBrowserSettings.file_access_from_file_urls.
2021-09-27 16:22:27 +03:00
Marshall Greenblatt cbc5710801 Replace CefRequestCallback with CefCallback (fixes issue #1861)
CefRequestCallback::Continue(false) was the same as Cancel(), so we can just
use CefCallback instead.
2021-09-27 16:22:27 +03:00
Marshall Greenblatt 23be17f693 Use CefRect for CefWindowInfo bounds (fixes issue #1515) 2021-09-27 16:22:27 +03:00
Marshall Greenblatt 41b64e428c Rename SendFocusEvent to SetFocus (fixes issue #866)
Also removes CefBrowserHost::SendFocusEvent. Use the existing SetFocus method
instead.
2021-09-27 10:50:12 +03:00
Marshall Greenblatt dc1f934865 views: Support configuration of initial window show state
Known issues:
- Exiting full-screen mode currently crashes with the Chrome runtime
  (see issue #3182).
2021-09-23 14:41:47 +03:00
Mathieu Lafon 6dad2c45ee osr: Implement InvalidateLocalSurfaceIdOnEviction (fixes issue #2483)
This fixes an empty-rendering issue when the view is shown after being
evicted.
2021-09-22 11:09:38 +00:00
Marshall Greenblatt 5782fdca16 Update to Chromium version 95.0.4638.0 (#920003)
Known issues:
- Windows ARM64 builds are currently failing due to
  https://crbug.com/1242884#c31
2021-09-22 12:08:24 +03:00
Marshall Greenblatt 84117f2d1b Don't use NotificationStateLock for GetMainFrame (see issue #2421)
This causes a race related to |notification_state_lock_| assignment when
GetMainFrame is called from multiple threads. GetMainFrame doesn't
trigger any notifications so it shouldn't need that lock. Instead, only
use NotificationStateLock on the UI thread.
2021-09-16 18:25:44 +03:00
Marshall Greenblatt db807e804a alloy: Fix FrameHandlerTest failures with BackForwardCache enabled (see issue #2421)
To test:
Run `ceftests --gtest_filter=FrameHandlerTest.OrderSub*
              --enable-features=BackForwardCache`
2021-09-16 18:25:44 +03:00
Marshall Greenblatt 7a56371b84 Fix draggable region update with BackForwardCache enabled (see issue #2421)
When BackForwardCache is enabled and the user navigates the main frame
back/forward a new RFH may be created for an existing main frame GlobalId value
and CefFrameHostImpl (e.g. an object that was previously Detach()ed after main
frame navigation called SetMainFrame, but for which RenderFrameDeleted was not
subsequently called due to insertion in the BackForwardCache). In this case we
can re-attach the new RFH to the existing main frame CefFrameHostImpl in
RenderFrameHostStateChanged and resume processing of messages.

Swapping back/forward to an existing (already loaded) renderer does not trigger
new notifications for draggable regions (e.g. RenderFrameObserver::
DraggableRegionsChanged is not called by default). We therefore explicitly
request an update of draggable regions by sending the DidStopLoading message to
the renderer.

A new |reattached| parameter is added to CefFrameHandler::OnFrameAttached to
support identification of BackForwardCache usage by the client.

To test with unit tests:
Run `ceftests --gtest_filter=DraggableRegionsTest.DraggableRegionsCrossOrigin
              --enable-features=BackForwardCache`

To test manually:
1. Run `cefclient --enable-features=BackForwardCache --use-views
   --url=http://tests/draggable`, note that draggable regions work.
2. Load https://www.google.com via the address bar, note that draggable regions
   are removed.
3. Go back to http://tests/draggable, note that draggable regions work.
4. Go forward to https://www.google.com, note that draggable regions are
   removed.
2021-09-16 18:25:43 +03:00
Marshall Greenblatt b3f5d7dd59 alloy: Enable BackForwardCache support (see issue #2421)
BackForwardCache is currently being tested via field trials (see
https://crbug.com/1171298) and can be explicitly disabled using the
`--disable-back-forward-cache` or `--disable-features=BackForwardCache`
command-line flags. The default behavior now matches the Chrome runtime.
2021-09-16 18:25:43 +03:00
Marshall Greenblatt 4a44e16a09 views: Add support for absolute positioned overlay views.
To test:
Run `cefclient.exe --use-views --hide-frame --hide-controls`
Add `--enable-chrome-runtime` for the same behavior using the Chrome location
bar instead of a text field.
2021-09-16 18:25:43 +03:00
Shezan Baig 6f6072b857 Fix download via the PDF extension 2021-09-09 07:50:10 +00:00
Marshall Greenblatt cf4457bbb3 Linux: Pass log-file to zygote subprocesses
This fixes a DCHECK(!log_file.empty()) due to commit 2ecf6f1.
2021-08-24 17:43:02 -04:00
Marshall Greenblatt 25c1947f1d Update to Chromium version 94.0.4606.0 (#911515) 2021-08-24 17:43:02 -04:00
Marshall Greenblatt 955097ea77 Remove usage of FrameTreeNode IDs (see issue #2421)
With the introduction of prerendering in Chromium it is now possible for
RenderFrameHosts (RFH) to move between FrameTrees. As a consequence we can no
longer rely on FrameTreeNode IDs to uniquely identify a RFH over its lifespan.
We must now switch to using GlobalRenderFrameHostId (child_id, frame_routing_id)
instead for that purpose. Additionally, we simplify existing code by using the
GlobalRenderFrameHostId struct in all places that previously used a
(render_process_id, render_frame_id) pair, since these concepts are equivalent.

See https://crbug.com/1179502#c8 for additional background.
2021-08-19 19:41:44 -04:00
Marshall Greenblatt 2ecf6f1070 Fix duplicate log-file entry on sub-process command-line 2021-08-11 13:28:52 -04:00
Marshall Greenblatt 17d2d13030 widevine: Fix ARM compile error due to unused variable (see issue #3149)
alloy_browser_main.cc:223:17: error: unused variable 'cus' [-Werror,-Wunused-variable]
    auto* const cus = g_browser_process->component_updater();
2021-08-10 12:05:48 -04:00
Marshall Greenblatt 240b869db5 widevine: Use component updater with the Alloy runtime (fixes issue #3149)
Widevine CDM binaries will be downloaded on supported platforms shortly after
application startup. Widevine support will then become available within a few
seconds after successful installation on Windows or after the next application
restart on other platforms. The CDM files will be downloaded to a "WidevineCdm"
directory inside the `CefSettings.user_data_path` directory.

Pass the `--disable-component-update` command-line flag to disable Widevine
download and installation. Pass the `--component-updater=fast-update` command-
line flag to force Widevine download immediately after application startup.

See the related issue for additional usage details.
2021-08-09 21:10:45 -04:00
Marshall Greenblatt eaf581e544 chrome: Fix AssertBlockingAllowed() with disk-based Profile creation (see issue #2969) 2021-08-04 15:23:49 -04:00
Marshall Greenblatt ad71ec9fdf views: Fix multiple issues with hide-frame (fixes issue #3168) 2021-08-04 14:31:08 -04:00
Marshall Greenblatt 92ec2dcbdd Fix ceftest failures with BackForwardCache enabled (see issue #2421)
When BackForwardCache is enabled the old RFH tree may be cached instead of being
immediately deleted as a result of main frame navigation. If a RFH is cached
then delivery of the CefFrameHandler::OnFrameDetached callback will be delayed
until the the RFH is ejected from the cache (possibly not occurring until the
browser is destroyed). This change in OnFrameDetached timing was causing
FrameHandlerTest.OrderSubCrossOrigin* to fail, and the inclusion of cached
frames in CefBrowserInfo::GetAllFrames was causing
FrameTest.NestedIframesDiffOrigin to fail.

BackForwardCache is currently being tested via field trials (see
https://crbug.com/1171298) and can be explicitly disabled using the
`--disable-back-forward-cache` or `--disable-features=BackForwardCache`
command-line flags.
2021-07-27 19:03:21 -04:00
Marshall Greenblatt 645b62257c chrome: Fix potential UAF of ChromeBrowserContext and Profile (see issue #2969) 2021-07-27 19:03:21 -04:00
Marshall Greenblatt b4ea0496e7 Update to Chromium version 93.0.4577.0 (#902210) 2021-07-27 19:03:09 -04:00
Vladislav 2be59f6edd Translate additional CEF modifiers to EF_* flags (see issue #2597) 2021-07-19 15:52:36 +00:00
Marshall Greenblatt 17fc2b3e3b Various fixes related to the C++11/14 update (see issue #3140)
- Convert scoped_ptr to std::unique_ptr from <memory>
- Convert arraysize to base::size from include/base/cef_cxx17_backports.h
- Convert NULL to nullptr
- Include include/base/cef_callback.h instead of include/base/cef_bind.h
- Implicit conversion of CefRefPtr<T> or scoped_refptr<T> to T* is gone;
  use .get() instead

See the issue for additional details.
2021-06-18 13:42:31 -04:00
Marshall Greenblatt 6d80ec69d7 Replace OVERRIDE with override (see issue #3140) 2021-06-17 16:16:53 -04:00
Marshall Greenblatt de66fb9406 alloy: Fix link click navigation in PDF files (fixes issue #3143)
This change adds a minimal implementation of the |tabs.update| extension API and
modifies StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent to return a valid
|streamInfo.tabId| value as required by the navigateInCurrentTab implementation
in chrome/browser/resources/pdf/browser_api.js.
2021-06-16 16:05:31 -04:00
Alex Maitland 1d02cd2be0 Expose certificate error codes to OnLoadError 2021-06-16 15:59:46 +00:00
Marshall Greenblatt 430895168d Add --disable-request-handling-for-testing option
Add a command-line option to bypass request handling in CEF to faciliate
debugging of network-related issues.
2021-06-11 12:09:18 -04:00
Marshall Greenblatt 3c0a4410ad Fix crash if a frame is detached before the attach message arrives (see issue #2421)
This reproduced on Mac with ResourceRequestHandlerTest.BasicStandardUnhandledModifyBeforeResourceLoad
2021-06-10 16:42:44 -04:00
Marshall Greenblatt 0aad12fe1b Linux: Fix Check failed: generated_timestamp < total_latency_stage.end_time (see issue #3102) 2021-06-10 16:42:44 -04:00
Marshall Greenblatt 00dca9601e Update to Chromium version 92.0.4515.0 (#885287) 2021-06-10 16:42:44 -04:00
Marshall Greenblatt e411b513be Add CefFrameHandler callbacks for tracking CefFrame lifespan (see issue #2421)
See the new cef_frame_handler.h for complete usage documentation.

This change includes the following related enhancements:
- The newly added CefBrowser::IsValid method will return false (in the browser
  process) after CefLifeSpanHandler::OnBeforeClose is called.
- CefBrowser::GetMainFrame will return a valid object (in the browser process)
  until after CefLifeSpanHandler::OnBeforeClose is called.
- The main frame object will change during cross-origin navigation or
  re-navigation after renderer process termination. During that time,
  GetMainFrame will return the new/pending frame (in the browser process) and
  any messages that arrive for the new/pending frame will be correctly
  attributed in OnProcessMessageReceived.
- Commands to be executed in the renderer process that may fail during early
  frame initialization (ExecuteJavaScript, LoadRequest, etc.) will now be
  queued until after the JavaScript context for the frame has been created.
- Logging has been added for any commands that are dropped because they arrived
  after frame detachment.
2021-05-31 18:58:27 -04:00