Commit Graph

317 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
58e1149c71 Add ability to capture audio output to buffer (issue #2381) 2019-03-07 17:09:54 -05:00
5f615a95bc Add multi-touch support for OSR (issue #1059) 2019-02-26 11:51:33 -05:00
379fb8d39e Add CefRenderHandler::OnVirtualKeyboardRequested (issue #2607) 2019-02-26 16:49:41 +00:00
c72d57aa60 Replace AddCustomScheme bool arguments with int using bit flags 2019-02-26 16:45:12 +00:00
ba8b4e8b9d Add support for muting audio in the browser (issue #1806) 2019-02-26 16:44:17 +00:00
6bfb5ab33b Remove old approach for debugging leaked wrapper object references (issue #2593) 2019-02-14 17:08:44 -05:00
3fe062a5b6 Implement new approach for debugging leaked wrapper object references (issue #2593) 2019-02-14 17:08:43 -05:00
a72e00a7b9 Add option to enable fetch support for custom schemes (issue #2579) 2019-02-04 22:31:31 +00:00
bac8fb5e61 Update copyright year on generated files 2019-01-10 15:22:19 +01:00
6df612a597 Update to Chromium version 72.0.3615.0 (#609159)
- The |category| value for all TRACE calls from CEF client applications is now
  "cef.client" due to https://crrev.com/331266377d.
- The |with_menu_marker| parameter to CreateMenuButton has been removed due to
  https://crrev.com/7f7e382118.
2018-12-04 14:45:37 -05: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
09afa3a843 Clarify expectations for CefRenderHandler::GetViewRect (issue #1910) 2018-09-25 16:56:44 +02:00
ea0e213bef Update to Chromium version 70.0.3516.0 (#581409) 2018-08-10 11:31:08 -04:00
4b33c17533 Add user_gesture parameter to OnBeforeBrowse (issue #1526) 2018-04-27 15:11:53 +00:00
4315f3b724 Add support for V8 ArrayBuffers (issue #244) 2018-04-10 16:05:19 -04:00
bb28b85bdd Add CefDisplayHandler::OnLoadingProgressChange callback (issue #2382) 2018-04-10 13:52:31 -04:00
90863b8c5d Add ability to stop CefURLRequest on redirect (issue #1329) 2018-04-10 13:05:18 -04:00
c3f5e6463c Add OSR text selection changed handler and remove hard-coded test bounds (issue #2383) 2018-04-09 13:50:19 -04:00
b44919e3c5 Allow empty username parameter to CefAuthCallback::Continue (issue #2275) 2018-03-28 19:29:28 -04:00
e030236c36 Add CefCookieManager::GetBlockingManager (issue #2374) 2018-03-14 21:40:37 -04:00
ac86b61139 Remove geolocation API support (issue #2380) 2018-02-12 18:51:11 -05:00
de1bd286f8 Enable browser-side navigation by default and remove CefRenderHandler::OnBeforeNavigation (issue #2290) 2018-02-12 18:01:43 -05:00
d34d3d1b3b Add callbacks for network request access to cookies (issue #2374) 2018-02-06 16:06:44 -05:00
50ca6928c3 Add CefURLRequest::ResponseWasCached method (issue #2283) 2018-01-03 16:14:29 -05:00
1c7391b70a Update generated file copyright year 2018-01-03 15:46:26 -05:00
552a3bf353 Add log level to CefDisplayHandler::OnConsoleMessage (issue #2234) 2017-12-18 18:36:56 -05:00
85d041c0e2 Making it possible to bridge C++ wrapper classes to C (issue #2311). 2017-11-28 15:57:10 +00:00
89a1f2b372 Add CefServer API for handling HTTP/WebSocket requests (issue #2278) 2017-11-15 12:00:36 -05:00
607a1d9f49 Add chrome.tabs.create API support (issue #1947) 2017-09-28 15:41:10 +02: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
70a01250e1 Linux: Don't pass NULL CefBrowser to PrintHandler::GetPdfPaperSize (issue #2199) 2017-06-17 12:49:41 +03:00
dce5d5c28f Linux: Pass CefBrowser to CefPrintHandler callbacks (issue #2196) 2017-06-15 08:58:54 -07:00
d4f06e3806 Move matching h file to top of header list (issue #2171) 2017-05-19 11:11:18 +02:00
31d9407ee2 Apply clang-format to all C, C++ and ObjC files (issue #2171) 2017-05-18 12:30:05 +02:00
816f700d3e Implement accessibility enhancements (issue #1217)
- Add new CefBrowserHost::SetAccessibilityState method for toggling
  accessibility state when readers are detected by the client.
- Add new CefAccessibilityHandler interface for the delivery of
  accessibility notifications to windowless (OSR) clients.
- Fix delivery of CefFocusHandler callbacks to windowless clients.
- cefclient: Add example windowless accessibility implementation on Windows and macOS.
- cefclient: Automatically detect screen readers on Windows and macOS.
2017-05-12 18:28:25 +00:00
67e23b472a Expose drag image via CefDragData (issue #1715) 2017-05-11 14:22:21 -04:00
b28a6145a1 Make the CefAuthCallback::Continue password parameter optional (issue #1928) 2017-05-10 12:16:53 -04:00
54647945f1 Update to Chromium revision 939b32ee (#454471) 2017-03-08 13:33:05 -08:00
8fa8af357b views: Support styling of menus (issue #2102) 2017-02-28 12:17:47 -05:00
10f9a9484f views: Support ink drop effect on buttons (issue #2102) 2017-02-28 12:17:47 -05:00
6eaf11f07a views: Support top menu switching with mouse and arrow keys (issue #2102)
- cefclient: Add example ViewsMenuBar implementation and show top menu
  by default (specify `--hide-top-menu` to hide it).
2017-02-22 18:15:36 -05:00
6ed4fe96b8 views: Add groups and focus/blur callbacks (issue #2102)
- cefclient: Only make menus focusable when ALT is pressed.
- cefclient: Display sample top menu when passed the `--show-top-menu`
  command-line flag.
2017-02-17 21:08:55 -05:00