Compare commits

..

2610 Commits

Author SHA1 Message Date
Marshall Greenblatt
da971da381 Fix DCHECK adding menu separator with hidden items (fixes #3577) 2024-07-16 16:02:04 -04:00
Marshall Greenblatt
444983d9ec distrib: Add new tools distribution for mksnapshot (see #3734) 2024-07-16 16:00:03 -04:00
Marshall Greenblatt
d96e29b528 mac: cefclient: Fix zombie NSWindow object on exit (fixes #3602)
- Don't create a TempWindow when using Views.
- Don't call `close` on an NSWindow that is never opened.
2024-07-15 17:08:41 -04:00
Marshall Greenblatt
c4ddda42fb Call SetIsShutdown after CefInitialize (fixes #3738)
Delay shutdown checking until after CefInitialize has drained existing
task pools.
2024-07-15 17:08:34 -04:00
Marshall Greenblatt
34572843ea Fix duplicate open from DevTools when handling OnOpenURLFromTab (fixes #3735) 2024-07-11 14:20:51 -04:00
Marshall Greenblatt
499df12b97 Update to Chromium version 127.0.6533.43 2024-07-11 13:32:51 +00:00
Marshall Greenblatt
96ac3d04b4 Update to Chromium version 127.0.6533.41 2024-07-10 12:50:51 -04:00
Marshall Greenblatt
7f27173f2f tools: win: Remove dynamic_annotations.lib from cef_sandbox
This library was removed in https://crbug.com/40209570.
2024-07-10 12:34:21 -04:00
Marshall Greenblatt
d77d001f56 Include debug symbols for all distributed binaries (fixes #2235) 2024-07-08 12:20:14 -04:00
Nik Pavlov
bea9614a45 tools: Fix "invalid escape sequence '\s'" warning 2024-07-01 13:20:59 -04:00
Marshall Greenblatt
9772389a14 Allow dangling Listener in CefFileDialogManager (fixes #3720) 2024-06-25 13:59:03 -04:00
Marshall Greenblatt
bbc35eb30a Fix dangling ResourceRequest* (fixes #3719)
Add raw_ptr<network::ResourceRequest> to RequestState instead of
passing ResourceRequest* as a bound parameter.
2024-06-21 16:57:10 -04:00
Marshall Greenblatt
b59a20ac7f Allow dangling UnretainedWrapper for ResourceRequest* (fixes #3717)
Change UnretainedWrapper traits from MayNotDangle (default) to
MayDangleUntriaged as a short-term fix.
2024-06-21 13:00:52 -04:00
Yuta Sekiguchi
0c339dfc41 Rewrite raw pointers reported by clang plugin (see #3239)
Found using a CEF build with clang_use_chrome_plugins=true
and treat_warnings_as_errors=false.

This change rewrites remaining raw pointers reported by
chromium-rawptr checker and fixes a build error reported
by StackAllocatedChecker.
2024-06-21 13:00:52 -04:00
Marshall Greenblatt
c741db0d1f Update to Chromium version 127.0.6533.17 2024-06-21 15:11:46 +00:00
Marshall Greenblatt
5ab32347b8 Fix assertions with Save As dialog
Fixes some issues introduced by 8e79307a62 (see #3314) and
6354d8daf1 (see #3239).

To test:
- Run `cefclient --url=chrome://net-export`
- Click the "Start Logging to Disk" button
- Exit cefclient; get no debug assertions
2024-06-20 14:09:52 -04:00
Marshall Greenblatt
7d739b3d33 Update to Chromium version 127.0.6533.5 2024-06-20 12:13:53 -04:00
Marshall Greenblatt
5afde67593 chrome: Fix CHECK when switching from kPrerendering to kActive
In this case |render_frame_| is not bound, |render_frame_host_| is
non-nullptr and |render_frame_host| equals |render_frame_host_| in
CefFrameHostImpl::MaybeReAttach when called from
CefBrowserInfo::FrameHostStateChanged.
2024-06-20 12:09:46 -04:00
Marshall Greenblatt
3b98dbda79 posix: Always resolve symlinks to absolute paths
This avoids issues with mismatched paths when mixing Chromium and
OS filesystem functions. See https://crbug.com/40229712.
2024-06-20 12:09:46 -04:00
Marshall Greenblatt
c44aa35bfc Update to Chromium version 127.0.6533.0 (#1313161) 2024-06-20 12:09:46 -04:00
Marshall Greenblatt
4ed13d8c47 views: Add missing patched files (see #3711) 2024-06-13 18:07:59 -04:00
Marshall Greenblatt
fe24ce3c71 chrome: Add cleanup when context menu isn't running (fixes #3711)
The menu may not be running in the following cases:

- If the menu is empty (e.g. cleared in OnBeforeContextMenu).
- If the menu is disabled (see e.g. RenderViewContextMenuViews::Show).
- When the run call blocks until the menu is dismissed (macOS behavior).

We explicitly clean up in these cases instead of waiting for OnMenuClosed
which will otherwise never be called for the first 2 cases.

Menu run status is exposed via new ContextMenuDelegate and
RenderViewContextMenuBase methods.
2024-06-13 13:38:41 -04:00
Marshall Greenblatt
cc40cbdd45 alloy: Move warning after logging init (fixes #3713) 2024-06-10 11:03:35 -04:00
Julian Waller
7c19cb90e1 cmake: Skip docs generation if the Doxyfile is missing
The Doxyfile is not included with minimal distributions.
2024-06-06 13:54:11 +00:00
Marshall Greenblatt
47798d3dbf Fix potential dangling PendingRequest::request_ (see #3239)
See https://magpcss.org/ceforum/viewtopic.php?f=6&t=19802 for error.
2024-06-04 14:11:59 -04:00
Yuta Sekiguchi
e4bb51f6f6 chrome: Add CefJSDialogHandler support (fixes #3702) 2024-06-04 12:19:14 -04:00
Marshall Greenblatt
fd7444c7a4 win: Enable WinSboxNoFakeGdiInit for Debug component builds (see #3708)
The WinSboxNoFakeGdiInit feature requires delayload of all DLLs that
might load user32.dll in the renderer process. It's enabled as a field
trial for all non-Official builds, but caused problems with Debug
component builds using VS 17.5.0 due to MSVCP140D.dll depending on
OLE32.DLL (which depends on user32.dll). The dependency on OLE32.DLL
is removed with VS 17.9.2 so the feature can now be enabled.

See https://crbug.com/326277735#comment39 for background.
2024-06-04 11:56:12 -04:00
Marshall Greenblatt
c56ae7213e cefclient: linux: Fix gcc -Werror=parentheses (see #3314) 2024-06-04 11:19:50 -04:00
Marshall Greenblatt
cb1830e16c win: Fix undefined symbol with cef_sandbox and VS 17.9.2 (see #3708)
This avoids a bug in clang + MSVC STL when using the default three-way
comparison operator with base::TimeDelta. The compiler does not throw
away the function call to the `std::_Literal_zero_is_expected` symbol,
which is deliberately undefined.

See also https://github.com/microsoft/STL/issues/4359#issuecomment-2042911928
2024-06-03 14:01:14 -04:00
Marshall Greenblatt
39cafe3e6c tests: Fix URLRequestTest failure with ReduceAcceptLanguage trial 2024-05-31 22:53:09 -04:00
Marshall Greenblatt
15c7e80e3c cefclient: win: Fix MSVC compile error 2024-05-31 13:28:33 -04:00
Marshall Greenblatt
8e79307a62 Pass mime type values as file dialog accept filters (see #3314)
File dialogs that specify mime type (e.g. "image/*") accept filters will pass
those values unchanged to the OnFileDialog |accept_filters| parameter. The
default dialog implementation will show those filters in addition to a combined
"Custom Files" filter. This is a change from preexisting Google Chrome
behavior where only the combined "Custom Files" filter is displayed, and
restores CEF behavior that existed prior to 2ea7459a89.

Document the fact that OnFileDialog may be called twice, once before MIME type
expansion and once afterwards.

Add new OnFileDialog |accept_extensions| and |accept_descriptions| parameters
for MIME type extensions and descriptions.

Details: This change adds a SelectFileDialog::FileTypeInfo::extension_mimetypes
member and improves the logic in FileSelectHelper::GetFileTypesFromAcceptType
and file_dialog_manager.cc SelectFileToFileChooserParams to support recall of
the source mime type when populating the FileChooserParams structure.

To test:
- Run `ceftests --gtest_filter=DialogTest.*`
- Run `cefclient --url=https://tests/dialogs`
2024-05-30 15:38:36 -04:00
Marshall Greenblatt
b0bceecba9 Add cef_sandbox dependency on make_config_header (see #3685) 2024-05-26 13:45:30 -04:00
Marshall Greenblatt
b6842f8b80 Remove unused cef_ptr_util.h 2024-05-26 13:45:30 -04:00
Marshall Greenblatt
5fe6382906 cefclient: win: Fix delayload of user32.dll
The WinSboxNoFakeGdiInit feature requires delayload of all DLLs that
might load user32.dll in the renderer process. It's enabled as a field
trial for all non-Official builds, but appears to only work with
non-component Release builds. See https://crbug.com/326277735
2024-05-26 13:45:30 -04:00
Marshall Greenblatt
bd1e188c77 tests: Fix SchemeHandlerTest failure with ReduceAcceptLanguage trial 2024-05-26 13:45:29 -04:00
Marshall Greenblatt
701fc03f00 Update to Chromium version 126.0.6478.0 (#1300313) 2024-05-26 13:45:29 -04:00
pkv
bc1b856b96 alloy: Fix audio capturer crash on exit (fixes #3689) 2024-05-21 17:58:13 +00:00
Marshall Greenblatt
c7b30ee80f cefclient: win: Fix crash on close with --use-native (see #3239)
OnBeforeClose notification is delivered via TabModel destruction in
TabStripModel::SendDetachWebContentsNotifications. We need to let
that call stack unwind before triggering TabStripModel destruction
via closure of the native host window.
2024-05-21 12:58:28 -04:00
Marshall Greenblatt
48137b9538 cefclient: Use default window for DevTools non-Views popup (see #3681)
Chrome runtime only supports creation of a Views-hosted DevTools
popup in ChromeBrowserDelegate::CreateDevToolsBrowser if the parent
is also Views-hosted.

To test:
- Run `cefclient --use-native`
- Right click, select "Show DevTools"
- Close both windows and the app should exit
2024-05-21 12:56:48 -04:00
Marshall Greenblatt
5a2cfb6907 osr: Support DevTools windows with Chrome runtime Alloy style (see #3681) 2024-05-21 12:56:48 -04:00
Marshall Greenblatt
6354d8daf1 Fix dangling raw_ptr errors and related issues (see #3239)
- Use raw_ptr in class container fields.
- Use defined lifespan for StreamReaderURLLoader.
- Fix lifespan assumptions for WebContents/RFH usage.
2024-05-21 12:56:47 -04:00
Marshall Greenblatt
aad216bf56 Revert "Revert unretained dangling ptr detector crash by default (fixes #3693)"
This reverts commit 8283317cb1.
2024-05-20 13:05:37 -04:00
Marshall Greenblatt
3f036edf2d Fix deadlock with enable_backup_ref_ptr_instance_tracer=true (see #3239) 2024-05-20 13:05:37 -04:00
Marshall Greenblatt
32fc106ab0 Enable BackupRefPtr for compatible non-Official builds (see #3239)
Compatible configurations include:
- Non-component builds.
- Debug builds on Mac/Linux.
- Release builds on Windows (b/c Debug builds require component builds).
- ASAN builds (which are also Release builds).

See related logic in //build_overrides/partition_alloc.gni
2024-05-20 13:05:37 -04:00
Marshall Greenblatt
0170f431a0 Apply raw_ptr rewrite to libcef (see #3239) 2024-05-11 12:47:10 -04:00
Marshall Greenblatt
2156c9fd5d Apply raw_ptr usage in patch files (see #3239) 2024-05-11 11:23:56 -04:00
Marshall Greenblatt
00118ddcdb cefsimple: Enable Chrome runtime by default (see #3685)
Run with `--disable-chrome-runtime` to use the Alloy runtime.
2024-05-09 12:53:43 -04:00
Marshall Greenblatt
e7626b2df6 cefclient: Enable Chrome runtime by default (see #3685)
Run with `--disable-chrome-runtime` to use the Alloy runtime.
2024-05-09 12:49:06 -04:00
Marshall Greenblatt
8283317cb1 Revert unretained dangling ptr detector crash by default (fixes #3693) 2024-05-06 16:50:44 -04:00
Marshall Greenblatt
271c6f6446 Fix credentials mode for fetch request redirect (fixes #3675)
Also verified that https://browseraudit.com/ gives the same results
both with and without `--disable-request-handling-for-testing`.
2024-05-06 15:10:12 -04:00
Marshall Greenblatt
311eaf827e alloy: Add missing geolocation pref registration (fixes #3694) 2024-05-06 11:58:55 -04:00
Marshall Greenblatt
002f4b5b4a tools: Don't write args.gn if unchanged (see #3681, see #3685)
Now that args.gn is an input to the make_config_header target we
don't want to invalidate the build unnecessarily by modifying the
file if the contents are unchanged.
2024-05-03 15:38:10 -04:00
Marshall Greenblatt
17a1fd62ec tests: Remove extension tests (see #3685)
The Alloy extension API is deprecated and these tests have not been
supported for some time.
2024-05-03 15:23:35 -04:00
Marshall Greenblatt
ca636bb96e chrome: Support CefResourceBundleHandler (see #3685) 2024-05-03 12:51:09 -04:00
Marshall Greenblatt
4e3668f93a chrome: Support CefSettings logging config (see #3685)
Also enables logging by default for Release builds (previously
required the `--enable-logging` flag). Logging can still be
disabled by passing the `--disable-logging` flag.
2024-05-02 19:43:39 -04:00
Marshall Greenblatt
6b13b1c627 cefclient: Don't call GetExtension when NOTIMPLEMENTED (see #3681) 2024-05-02 19:43:39 -04:00
Marshall Greenblatt
29381355ef chrome: Support CefSettings path config (see #3685) 2024-05-02 19:43:39 -04:00
Marshall Greenblatt
7328b9e40d views: Support themes for Alloy BrowserView in Chrome Window (see #3681)
To test:
- Run `cefclient --enable-chrome-runtime --use-alloy-style
                 --use-chrome-style-window [--background-color=green]`
- OS and Chrome theme changes behave as expected.
2024-05-02 11:21:49 -04:00
Marshall Greenblatt
b92749a58a Add DISABLE_ALLOY_BOOTSTRAP to cef_config.h (see #3681, see #3685)
Include cef_config.h from base/cef_build.h and fix detection of
args.gn changes so that defines are available everywhere by default.

Fix include configuration for chrome_elf_set and sandbox targets.
2024-05-01 14:34:32 -04:00
Marshall Greenblatt
49a34d9160 Apply new Chromium style for #include sorting
Add "cef/" prefix for CEF #includes in libcef/ directory.

Sort #includes by following
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
2024-05-01 14:34:32 -04:00
Marshall Greenblatt
b5d84c254d Add GN arg to disable Alloy bootstrap (see #3681, see #3685)
Set enable_alloy_bootstrap=false to build with Alloy bootstrap code
removed. Extension API is documented as deprecated in comments but
not compiled out with this arg.
2024-05-01 14:34:21 -04:00
reito
d666ec5770 win: osr: Fix GPU mutex logic (see #2575) 2024-04-29 14:58:26 +00:00
Marshall Greenblatt
fe5b0dd668 chrome: osr: Fix performance manager init (see #3681) 2024-04-27 15:36:59 -04:00
Marshall Greenblatt
c0e7854782 cefclient: osr: Fix compile errors with binary distribution (see #2575) 2024-04-27 15:36:58 -04:00
Marshall Greenblatt
be6642df3f chrome: Add CefDownloadHandler support (see #3681)
Behaves the same as Alloy runtime except that CanDownload is not
called for invalid protocol schemes.
2024-04-27 15:36:58 -04:00
Marshall Greenblatt
ed079792b6 chrome: Add extension support for Alloy style browsers (see #3681)
This change adds minimal tabs API support for Alloy style browsers.
Clicking links in PDF documents now navigate as expected.
2024-04-27 15:36:58 -04:00
Marshall Greenblatt
0783b4c57d win: Fix generated binaries crashing with exit code 3221225477
See https://issues.chromium.org/issues/336007395
2024-04-26 13:46:45 -04:00
Marshall Greenblatt
b537fc929b mac: Disable dangling pointer detector (see #3239)
This is enabled by default on Mac in M125 but we can't use it until
raw_ptr<> is supported by libcef. For background see
https://chromium.googlesource.com/chromium/src/+/main/docs/dangling_ptr.md
2024-04-26 10:31:40 -04:00
Marshall Greenblatt
708d90a6ff chrome: osr: Create CefWebContentsViewOSR for guest views (see #3681)
Match the logic in Alloy's CefMimeHandlerViewGuestDelegate.
2024-04-26 10:31:40 -04:00
Marshall Greenblatt
5065aba1b4 Remove explicit tracking of guest view frames
This is no longer required now that we have implicit exclusion
of certain frame types including guest view frames.

Rename GuestView to ExcludedView in the renderer process.
2024-04-26 10:31:40 -04:00
Marshall Greenblatt
65234a6830 Ignore load of excluded PDF renderer frames
Starting with M125 we get WebContentsObserver callbacks for speculative
PDF renderer frames. These callbacks should be ignored.
2024-04-26 10:31:40 -04:00
Marshall Greenblatt
b67cbc47e3 Update to Chromium version 125.0.6422.0 (#1287751) 2024-04-25 18:43:05 -04:00
Marshall Greenblatt
4fe529e2dc mac: Enable allocator shim to fix builds (see #3061)
This is a workaround for https://crbug.com/326898585
2024-04-25 18:43:04 -04:00
reito
260dd0ca24 osr: Implement shared texture support (fixes #1006, fixes #2575)
Adds support for the OnAcceleratedPaint callback. Verified to work
on macOS and Windows. Linux support is present but not implemented
for cefclient, so it is not verified to work.

To test:
Run `cefclient --off-screen-rendering-enabled --shared-texture-enabled`
2024-04-23 13:03:56 -04:00
Marshall Greenblatt
dca0435d2f chrome: Add support for Alloy style browsers and windows (see #3681)
Split the Alloy runtime into bootstrap and style components. Support
creation of Alloy style browsers and windows with the Chrome runtime.
Chrome runtime (`--enable-chrome-runtime`) + Alloy style
(`--use-alloy-style`) supports Views (`--use-views`), native parent
(`--use-native`) and windowless rendering
(`--off-screen-rendering-enabled`).

Print preview is supported in all cases except with windowless rendering
on all platforms and native parent on MacOS. It is disabled by default
with Alloy style for legacy compatibility. Where supported it can be
enabled or disabled globally using `--[enable|disable]-print-preview` or
configured on a per-RequestContext basis using the
`printing.print_preview_disabled` preference. It also behaves as
expected when triggered via the PDF viewer print button.

Chrome runtime + Alloy style behavior differs from Alloy runtime in the
following significant ways:

- Supports Chrome error pages by default.
- DevTools popups are Chrome style only (cannot be windowless).
- The Alloy extension API will not supported.

Chrome runtime + Alloy style passes all expected Alloy ceftests except
the following:

- `DisplayTest.AutoResize` (Alloy extension API not supported)
- `DownloadTest.*` (Download API not yet supported)
- `ExtensionTest.*` (Alloy extension API not supported)

This change also adds Chrome runtime support for
CefContextMenuHandler::RunContextMenu (see #3293).

This change also explicitly blocks (and doesn't retry) FrameAttached
requests from PDF viewer and print preview excluded frames (see #3664).

Known issues specific to Chrome runtime + Alloy style:
- DevTools popup with windowless rendering doesn't load successfully.
  Use windowed rendering or remote debugging as a workaround.
- Chrome style Window with Alloy style BrowserView (`--use-alloy-style
  --use-chrome-style-window`) does not show Chrome theme changes.

To test:
- Run `ceftests --enable-chrome-runtime --use-alloy-style
       [--use-chrome-style-window] [--use-views|--use-native]
       --gtest_filter=...`
- Run `cefclient --enable-chrome-runtime --use-alloy-style
       [--use-chrome-style-window]
       [--use-views|--use-native|--off-screen-rendering-enabled]`
- Run `cefsimple --enable-chrome-runtime --use-alloy-style [--use-views]`
2024-04-22 14:57:37 -04:00
Marshall Greenblatt
62c93f01f4 Avoid possible reentrancy of ThemeChanged (see #3671)
The call to SelectNativeTheme from ChromeBrowserFrame::Initialized was
causing Widget::ThemeChanged reentrancy via OnColorProviderCacheResetMissed
when running with `--enable-chrome-runtime --use-native`. Make all calls to
ThemeChanged async to avoid this and possible future issues.
2024-04-14 21:43:44 -04:00
Jacobo Aragunde Pérez
81a0648ee1 tools: Use raw strings for regexps in python scripts (fixes #3677)
Starting with Python 3.12, use of invalid escape sequences in strings
is reported as a SyntaxWarning and will become a SyntaxError at a
later point.

Regular expressions use the backslash character a lot, which result in
warnings of this kind. Python docs recommend to generally use raw
strings for this purpose.
2024-04-12 15:53:51 +00:00
Nik Pavlov
744a194a6e mac: views: Add customization point for acceptsFirstMouse (fixes #3680) 2024-04-12 15:49:31 +00:00
Nik Pavlov
96dc172980 Fix how CefV8ValueImpl differentiates INT and UINT types (fixes #3657) 2024-04-12 15:37:33 +00:00
Marshall Greenblatt
f1effba336 views: Fix destruction issues with CefOverlayViewHost 2024-04-11 15:51:42 -04:00
Marshall Greenblatt
d10cc16236 distrib: Add missing cef_color_id_macros.inc (see #3671) 2024-04-11 11:35:55 -04:00
Marshall Greenblatt
da1c3179a9 win: Fix MSVC compile error with cef_color_ids.h (see #3671)
Copy and modify ui/color/color_id_macros.inc to include an MSVC
workaround for `__VA_ARGS__` expansion.
2024-04-11 11:29:51 -04:00
Marshall Greenblatt
2e33954032 cefclient: Add missing draggable.html resource reference 2024-04-11 11:24:26 -04:00
Marshall Greenblatt
f60476b848 views: Add support for OS and Chrome themes (fixes #3610, fixes #3671)
Controls now respect OS and Chrome themes by default for both Alloy
and Chrome runtimes. Chrome themes (mode and colors) can be configured
using the new CefRequestContext::SetChromeColorScheme method. Individual
theme colors can be overridden using the new CefWindowDelegate::
OnThemeColorsChanged and CefWindow::SetThemeColor methods.

The `--force-light-mode` and `--force-dark-mode` command-line flags are
now respected on all platforms as an override for the OS theme.

The current Chrome theme, if any, will take precedence over the OS theme
when determining light/dark status. On Windows and MacOS the titlebar
color will also be updated to match the light/dark theme.

Testable as follows:
- Run: `cefclient --enable-chrome-runtime` OR
       `cefclient --use-views --persist-user-preferences --cache-path=...`
  - App launches with default OS light/dark theme colors.
  - Change OS dark/light theme under system settings. Notice that theme
    colors change as expected.
  - Right click, select items from the new Theme sub-menu. Notice that
    theme colors behave as expected.
  - Exit and relaunch the app. Notice that the last-used theme colors are
    applied on app restart.
- Add `--background-color=green` to above command-line.
  - Perform the same actions as above. Notice that all controls start
    and remain green throughout (except some icons with Chrome runtime).
- Add `--force-light-mode` or `--force-dark-mode` to above command-line.
  - Perform the same actions as above. Notice that OS dark/light theme
    changes are ignored, but Chrome theme changes work as expected.
2024-04-09 16:19:35 -04:00
Marshall Greenblatt
29c21f58e8 views: Generate cef_color_ids.h header (see #3671) 2024-04-03 12:09:22 -04:00
Marshall Greenblatt
54a9c26b92 Disable thin archives with cef_sandbox builds (fixes #3674) 2024-03-28 11:35:37 -04:00
Marshall Greenblatt
6253e69b70 views: cefclient: Fix initial toolbar button state 2024-03-28 11:35:37 -04:00
Marshall Greenblatt
8ba22e9e11 views: Update textfield colors when enabled state changes 2024-03-28 11:35:37 -04:00
Marshall Greenblatt
19ba8b2b8d views: Use default theme background color for all controls (see #3671)
Add new CefViewDelegate::OnThemeChanged callback for optionally overriding
default theme colors when the current theme changes.
2024-03-28 11:35:37 -04:00
Marshall Greenblatt
a13b6dc7f6 chrome: Use square corners for Chrome toolbar when Views-hosted
Chrome design changed to rounded top corners by default with
Chrome Refresh 2023. Square corners look better when the toolbar
is part of a custom Views-hosted layout, like in cefclient.
2024-03-22 14:50:14 -04:00
Marshall Greenblatt
52dac91167 Update to Chromium version 124.0.6367.0 (#1274542) 2024-03-22 13:46:28 -04:00
Marshall Greenblatt
526e934a12 ceftests: Check CefInitialize return value (see #3609) 2024-03-18 18:33:38 -04:00
Marshall Greenblatt
b8f91c5431 Add callbacks for unresponsive render process (fixes #3661)
The client can optionally wait or terminate the render process.

Expose process exit codes via OnRenderProcessTerminated and
CefGetExitCode (fixes #2126).

cefclient: Add a new https://tests/hang page for testing hang behavior.

cefclient: Move message and resource handling to a new BaseClientHandler
class to support loading of test pages in default Chrome UI windows.
2024-03-18 17:45:31 -04:00
Marshall Greenblatt
5e616b2df0 Improve crash reporting of frame connection retry failures (see #3664)
Introduce different call stacks for different types of disconnects,
and log additional state information in the FATAL message.
2024-03-08 14:24:32 -05:00
qqqqqqqqq
9b06b028dc Replace non-standard memory.h with cstring (fixes #3665)
cef_string_wrappers.h uses a non-standard header memory.h, which breaks
the build on UCRT environments. Replace <memory.h> include with <cstring>,
which is guaranteed to contain strlen.
2024-03-08 17:18:15 +00:00
Marshall Greenblatt
d4cf19db29 Update to Chromium version 123.0.6312.0 (#1262506)
- MacOS ARM64 Official builds are currently failing due to
  https://issues.chromium.org/issues/326898585
2024-02-26 12:08:55 -05:00
Marshall Greenblatt
2c5dd120c7 mac: Add fallback for unsupported --lang values (fixes #3653) 2024-02-20 13:15:25 -05:00
Nik Pavlov
ffea0d9c4a chrome: Add SetAccessibilityState support (fixes #3649) 2024-02-20 16:27:48 +00:00
Marshall Greenblatt
8db08e657d win: distrib: Add DirectX compiler binaries for WebGPU (fixes #3646) 2024-02-15 17:00:30 -05:00
Marshall Greenblatt
706193f3d9 Reland "alloy: Allow --remote-debugging-port=0 (fixes #3619)"
This relands commit 70471059cf
with necessary changes.
2024-02-15 16:12:47 -05:00
Marshall Greenblatt
bfed26c5fc alloy: Fix crash on JS dialog from PDF viewer (fixes #3644) 2024-02-15 15:35:11 -05:00
Marshall Greenblatt
71c8b4b2bb chrome: win: Disable taskbar decoration for PiP and DevTools windows (fixes #3645) 2024-02-15 14:17:59 -05:00
Marshall Greenblatt
ec122a9148 chrome: win: Fix crash on ShowProfileErrorDialog (fixes #3648) 2024-02-15 12:22:52 -05:00
Marshall Greenblatt
90775f149f Revert "alloy: Allow --remote-debugging-port=0 (fixes #3619)"
Reason for the revert: Incorrectly enables DevTools remote debugging
by default.

This reverts commit 70471059cf.
2024-02-14 20:02:20 -05:00
Marshall Greenblatt
f071a4a988 alloy: Fix crash when accessing FirstPartySets (fixes #3643)
Initialize FirstPartySets without PrivacySandbox or IdentityManager
dependencies.
2024-02-14 18:51:32 -05:00
Marshall Greenblatt
cc3d77eec5 chrome: Enforce matching context for new user and incognito profiles
Selecting a new user or incognito profile via Chrome UI may result in
the creation of a new Profile object. If that occurs, we should find
or create a matching CefBrowserContext and CefRequestContext instead
of reusing an existing mismatched context (e.g. using the original
context for an incognito window would be a mismatch). If a new
CefRequestContext will be created the client can now implement
CefBrowserProcessHandler::GetDefaultRequestContextHandler() to
provide the handler for that context.

To test with a new user profile:
1. Click "Profile" icon, select "Add". Now you have 2+ profiles.
2. Click "Profile" icon, select the other user name to create a new
   window using the other user profile.
3. The new window should launch successfully.

To test with a new incognito profile:
1. Select "New Incognito window" from the 3-dot menu.
2. The new window should launch successfully.

To test DevTools window creation for the new profile:
1. Right-click in the new window, select Inspect.
2. The DevTools window should launch successfully.
2024-02-14 18:51:32 -05:00
Marshall Greenblatt
a79981bf7f chrome: cefclient: Add support for --request-context-per-browser
Wait for the OnRequestContextInitialized callback before using a
non-global CefRequestContext.

Use default handling of --load-extension for Chrome runtime (fixes #3529).
2024-02-14 18:51:32 -05:00
Vladimir Kharitonov
70471059cf alloy: Allow --remote-debugging-port=0 (fixes #3619) 2024-02-07 18:42:06 +00:00
Marshall Greenblatt
5dc3cc13e7 chrome: win: Fix taskbar grouping of PiP and DevTools windows (fixes #3641) 2024-02-06 13:55:01 -05:00
Marshall Greenblatt
da3899d142 views: win: Fix occlusion tracking of initially-minimized windows (fixes #3638)
Chromium considers initially-minimized windows to be visible at
creation time in the Aura layer. This confuses the native occlusion
detector which knows that the OS window is initially hidden due to
IsIconic returning true. Start occlusion tracking with consistent
state by delaying enablement until the initially-minimized window is
restored for the first time.
2024-02-05 16:24:51 -05:00
Shezan Baig
69fd43f789 Always assign |is_guest_view| in CefBrowserInfo::GetFrameForGlobalToken 2024-02-05 16:31:04 +00:00
Marshall Greenblatt
d3a483ef59 Fix singleton relaunch issues with multi-threaded-message-loop (fixes #3635)
- Fix UI thread shutdown issues on early app exit.
- views: cefclient: Fix threading requirements in RootWindowViews::Init when
  called on the UI thread via OnAlreadyRunningAppRelaunch.
2024-01-30 17:13:51 -05:00
Marshall Greenblatt
bdb070c85c mac: Update target SDK to 10.15 for cmake and tests 2024-01-30 12:33:53 -05:00
Marshall Greenblatt
57bad703ee views: mac: Add CEF_SHOW_STATE_HIDDEN (fixes #3630)
- Adds `--initial-show-state=hidden` support for cefclient and cefsimple
  where the window launches as initially hidden (no dock thumbnail).
- Adds `--hide-window-on-close` support for cefclient where clicking the
  red traffic light button hides the window instead of closing it.
2024-01-30 12:16:03 -05:00
Marshall Greenblatt
47fe9f834a cefclient: linux: Add missing math.h include (see #3187) 2024-01-30 12:07:08 -05:00
Marshall Greenblatt
2f1e782f62 Update to Chromium version 122.0.6261.0 (#1250580)
Frame identifiers have changed from int64_t to string type. This is due
to https://crbug.com/1502660 which removes access to frame routing IDs
in the renderer process. New cross-process frame identifiers are 160-bit
values (32-bit child process ID + 128-bit local frame token) and most
easily represented as strings. All other frame-related expectations and
behaviors remain the same.
2024-01-30 12:07:08 -05:00
Marshall Greenblatt
2a86a02bdd ceftests: Avoid shutdown hang due to leaked TestHandlers 2024-01-26 14:12:11 -05:00
Marshall Greenblatt
132ac7a180 tools: win: Switch to python3.bat
The python.bat file is removed in never versions of depot_tools.
2024-01-24 17:06:57 -05:00
Marshall Greenblatt
a0446a3c8a Fix clang-tidy warnings (see #3632) 2024-01-21 14:18:09 -05:00
Marshall Greenblatt
a02d2ab3e6 libcef: Format with clang-tidy (see #3632) 2024-01-20 19:33:17 -05:00
Marshall Greenblatt
4ea1b6f293 wrapper: Format with clang-tidy (see #3632) 2024-01-20 12:34:13 -05:00
Marshall Greenblatt
befa827da1 ceftests: Format with clang-tidy (see #3632) 2024-01-20 12:06:28 -05:00
Marshall Greenblatt
0a64bb6f9b tests: Format with clang-tidy (see #3632) 2024-01-19 21:42:21 -05:00
Marshall Greenblatt
9fd312ce04 alloy: Don't create GPUCache directory when cache_path is empty (fixes #3617) 2024-01-17 21:33:27 -05:00
Marshall Greenblatt
468e55e553 cefsimple: Minor code and docs cleanup 2024-01-17 17:44:33 -05:00
Marshall Greenblatt
f1fe098e09 Fix parent window move on show modal dialog (fixes #3629) 2024-01-17 14:33:52 -05:00
Marshall Greenblatt
5af6227a6f chrome: Improve positioning of dialogs (fixes #3628)
Dialogs will be excluded from regions near the top of the window
that contain overlays, draggable regions or titlebar.
2024-01-12 18:13:36 -05:00
Marshall Greenblatt
0d50d5a8c6 tools: Add env var to filter output configs (fixes #2423)
Adds a new GN_OUT_CONFIGS environment variable that, if specified,
will limit the generated configurations to a list of comma-delimited
values (e.g. "Debug_GN_x64,Release_GN_x64").
2024-01-11 13:08:50 -05:00
Marshall Greenblatt
a097b62b6e alloy: Update extensions-related interface registration to match chrome 2024-01-08 14:20:45 -05:00
Marshall Greenblatt
ffc703276a alloy: Fix print preview WebUI registration (fixes #3625) 2024-01-08 13:50:50 -05:00
Julien Bouix
3592d36808 osr: Fix potential null ptr dereference during DnD 2024-01-05 20:20:37 +00:00
Sergey Markelov
deb4664038 capi: Update list comments in generated files 2024-01-05 15:04:12 -05:00
Sergey Markelov
9f6995f839 tools: Fix formatting of lists in capi comments 2024-01-05 15:04:12 -05:00
Sergey Markelov
784302280b tools: Write generated files with UNIX line endings on all platforms (see #3627) 2024-01-05 15:03:45 -05:00
Sergey Markelov
7c2bd75f7a docs: Fix typos "recieve" -> "receive" 2024-01-05 15:03:20 -05:00
Mike Wiedenbauer
3507249202 cefclient: osr: Implement shader-based rendering for Linux (fixes #3187)
Windows still uses OpenGL 1.1 to avoid the added complexity of linking
newer OpenGL APIs on that platform. MacOS has deprecated OpenGL and we
should eventually provide a Metal-based implementation on that platform.
2024-01-05 14:09:30 -05:00
Philipp Thiel
5a9b8e2bc4 views: Add can_activate parameter to AddOverlayView 2024-01-05 13:46:49 -05:00
Marshall Greenblatt
9a45102db0 Update copyright year for generated files 2024-01-05 13:03:36 -05:00
Marshall Greenblatt
1f55d2e12f osr: Fix potential shared memory OOB access 2024-01-05 12:14:58 -05:00
Marshall Greenblatt
9dc7653ddc chrome: mac: Support locale configuration (fixes #3623) 2024-01-03 14:00:39 -05:00
Nik Pavlov
e4acacee18 chrome: Fix unintended show of minimized window on navigation (fixes #3618) 2023-12-18 18:26:31 +00:00
Marshall Greenblatt
206b7b1c95 Fix mojom_ts_generator.py error with Python 3.11 2023-12-13 18:46:06 -05:00
Marshall Greenblatt
262a93b2f7 Split UI thread shutdown into before and after stages (see #3609)
Existing UI thread shutdown tasks need to be executed before the UI
thread RunLoop is terminated. Those tasks have now been moved to
CefMainRunner::StartShutdownOnUIThread and FinishShutdownOnUIThread is
now called after the RunLoop is terminated.

This fixes a shutdown crash in ChromeProcessSingleton::DeleteInstance.
DeleteInstance needs to be called on the UI thread near the end of the
shutdown process (after ChromeProcessSingleton::Cleanup is called via
PostMainMessageLoopRun).
2023-12-13 12:58:55 -05:00
Marshall Greenblatt
80c65f25a3 Update to Chromium version 121.0.6167.0 (#1233107) 2023-12-13 12:58:55 -05:00
Marshall Greenblatt
2f0b00f8f5 cmake: Fix docs for CMake and Xcode version 2023-12-06 13:18:23 -05:00
Marshall Greenblatt
be734efe68 linux: Disable compiler TLS in libxml2 (fixes #3616) 2023-12-06 12:27:08 -05:00
Marshall Greenblatt
0dd7dca229 alloy: Add callback for already running app relaunch (fixes #3615)
Executes CefBrowserProcessHandler::OnAlreadyRunningAppRelaunch
callback for when an already running app is relaunched with the
same CefSettings.root_cache_path.

Adds "Root Cache Path" value and related explainer text to
chrome://version.

Adds a LOG(WARNING) that will be output on startup if
CefSettings.root_cache_path is unset in the client app.
2023-12-06 11:50:08 -05:00
Marshall Greenblatt
5613af8f53 alloy: Fix crash loading chrome://system 2023-12-04 19:11:23 -05:00
Marshall Greenblatt
a25f89f9e4 chrome: Add callback for already running app relaunch (fixes #3609)
Adds a new CefBrowserProcessHandler::OnAlreadyRunningAppRelaunch
callback for when an already running app is relaunched with the
same CefSettings.root_cache_path.

Client apps should check the CefInitialize() return value for early
exit of the relaunch source process.
2023-12-04 15:43:45 -05:00
Marshall Greenblatt
d6af79e7a6 tests: Remove accidental C++20 dependency (see #3611) 2023-11-28 12:48:50 -05:00
Marshall Greenblatt
f781ea373f Update to Chromium version 120.0.6099.0 (#1217362)
- chrome: Disable upgrade/downgrade behavior (see #3608)
- chrome: Disable process singleton behavior (see #3609)
- chrome: Disable config as default system browser (see #3613)
2023-11-28 12:47:00 -05:00
Marshall Greenblatt
738192addf chrome: win: Add CefSettings.chrome_app_icon_id (see #3606) 2023-11-21 11:24:20 -05:00
Marshall Greenblatt
2b1922746f Fix minor include and docs errors 2023-11-21 11:22:37 -05:00
Marshall Greenblatt
3b652a9966 chrome: win: Fix app icon for default Chrome windows (fixes #3606)
This fixes the app icon for default Chrome windows such as DevTools
and Task Manager.

An ICON with value IDR_MAINFRAME (101) will be loaded from the main
executable is available. Otherwise, the default Chromium ICON will be
loaded from libcef.dll.
2023-11-20 19:35:09 -05:00
Marshall Greenblatt
cf934a20a7 Fix cookie exclusion for fetch CORS pre-flight requests (fixes #3596)
Cookies (and other credentials) will be excluded when appropriate by
downgrading |credentials_mode| from kSameOrigin to kOmit.

Improve logic for Origin header inclusion, including a fix for
Referrer/Origin calculation in URLRequestJob::ComputeReferrerForPolicy
when used with custom standard schemes.

Specify correct CookiePartitionKeyCollection when loading cookies.

To test:
- Run tests from https://browseraudit.com/ with and without
  `--disable-request-handling-for-testing`. Results are the same.
- Run `ceftests --gtest_filter=CorsTest.*`.
2023-11-20 14:44:43 -05:00
Marshall Greenblatt
a9f1ce090a tools: Fix typo in make_distrib.py 2023-11-14 12:27:28 -05:00
Nik Pavlov
1886f68490 Remove virtual attribute from CefStringBase destructor (fixes #3587) 2023-11-14 17:20:26 +00:00
Marshall Greenblatt
53ef570f57 chrome: Support Chrome and DevTools command execution (fixes #3282, fixes #3600)
Add new CefBrowserHost::[Can]ExecuteChromeCommand methods for executing
arbitrary Chrome commands.

Add support for existing CefBrowserHost::ShowDevTools, CloseDevTools and
HasDevTools methods.

DevTools windows now support the same Views callbacks as normal popup
windows with the new CefLifeSpanHandler::OnBeforeDevToolsPopup callback
as the DevTools-specific equivalent of OnBeforePopup.

Always create DevTools as an undocked window to support use of
ShowDevTools with default Chrome browser windows.

To test:

Run `ceftests --enable-chrome-runtime [--use-views]
     --gtest_filter=V8Test.OnUncaughtExceptionDevTools`

OR:

1. Run `cefclient --enable-chrome-runtime [--use-native]`
2. Select "Show DevTools", "Close DevTools" or "Inspect" from the
   right-click menu.
3. Notice that the DevTools window is Views-hosted (or native-hosted)
   and works as expected.

Add --use-default-popup to get a default styled popup in step 3.
2023-11-14 17:16:43 +00:00
Marshall Greenblatt
d3d465b32e views: Support per-accelerator priority config (fixes #3598) 2023-11-08 14:27:50 -05:00
Marshall Greenblatt
2b38e2f793 Add workaround for https://crbug.com/1500371 (see #3597) 2023-11-07 17:14:02 -05:00
Marshall Greenblatt
3837f209e1 mac: Update CSS on fullscreen window exit (fixes #3597) 2023-11-07 16:40:29 -05:00
Marshall Greenblatt
21e01d4889 chrome: Hit-test PiP draggable regions before resize border (see #3566) 2023-11-06 15:47:07 -05:00
Nik Pavlov
44323082b1 Add binary format support to CefMessageRouter (fixes #3502) 2023-10-25 18:20:55 +00:00
Marshall Greenblatt
1b74ac5124 mac: chrome: Updated fix for crash in BrowserView::ShouldHideUIForFullscreen (see #3527) 2023-10-24 11:02:35 -04:00
Marshall Greenblatt
b2274f534d Update to Chromium version 119.0.6045.0 (#1204232)
Mac: 13.5+ build system w/ 14.0 base SDK (Xcode 15.0) is now required.
2023-10-24 10:56:39 -04:00
Marshall Greenblatt
3476199bc5 ceftests: More cleanup of TestHandler::OnTestTimeout 2023-10-23 12:31:44 -04:00
Marshall Greenblatt
6651523d86 ceftests: Simplify completion for tests that don't just create browsers
Some test cases don't create browsers at all, or require additional signals
such as request context destruction.

To test: Run `ceftests --gtest_filter=URLRequestTest.*`
2023-10-18 15:42:14 -04:00
Marshall Greenblatt
f594ca3785 ceftests: Fix flaky URLRequestTest due to server response timing
In some cases the browser may be closed before the server response is sent.
2023-10-18 15:42:14 -04:00
Nik Pavlov
15caa9858d Update ipc_performance_test to compare similar transfers (see #3502) 2023-10-18 19:41:33 +00:00
Marshall Greenblatt
e6a96e2bec chrome: views: Fix close of popup windows when parent is destroyed
When running ceftests with Views enabled always close the CefWindow
when the browser is destroyed and wait for both CefBrowser and
CefWindow destruction before signaling test completion.

To test:
Run `ceftests --enable-chrome-runtime --use-views
     --gtest_filter=FrameHandlerTest.OrderMainPopup*:RequestContextTest.PopupNavDestroyParent*`
2023-10-17 11:48:11 -04:00
Marshall Greenblatt
90aea56de6 ceftests: Change CreateTestRequestContext to async usage
With Chrome runtime, custom request contexts may be initialized asynchronously.
Wait for that initialization before using the request context.

This also removes TEST_RC_MODE_CUSTOM (uses TEST_RC_MODE_CUSTOM_WITH_HANDLER
instead) since we always need a handler to get the initialization callback.
2023-10-16 18:44:20 -04:00
Marshall Greenblatt
a2a1b66ea5 chrome: Support configuration of Chrome policy management (fixes #3581)
Disable Chrome policy management by default. Add CefSettings.chrome_policy_id
which, when configured, enables Chrome policy management. See
https://support.google.com/chrome/a/answer/9037717 for background.

To test:
- Start with a machine where Google Chrome is managed.
- Run `cefclient --enable-chrome-runtime --url=chrome://policy/`
  There should be no configured policies.
- Run `cefclient --enable-chrome-runtime --url=chrome://policy/
       --enable-chrome-policy`
  Configured Platform properties should match Google Chrome.
- Run `cefclient --enable-chrome-runtime --url=chrome://policy/
       --enable-chrome-policy --enable-chrome-browser-cloud-management`
  Configured Platform and Cloud properties should match Google Chrome.
2023-10-16 18:44:15 -04:00
Nik Pavlov
8d7001adc3 Replace ReadOnlySharedMemoryRegion with WritableSharedMemoryRegion (see #3502)
Write access to the shared memory region is required because JavaScript lacks
the capability to create read-only ArrayBuffers. When a user attempts to modify
an ArrayBuffer that utilizes a ReadOnlySharedMemoryRegion as its BackingStore
it triggers an access violation.

Note that this pull request may be reverted in the future if JavaScript adds
read-only ArrayBuffer support.
2023-10-16 22:43:29 +00:00
Marshall Greenblatt
f3e92b45fc Fix incorrect includes (see #3284) 2023-10-09 13:13:00 -04:00
Marshall Greenblatt
64c2dc13ca Remove CefBrowserSettings.accept_language_list (fixes #3555)
Chromium does not support configuration of this value on a per-Browser basis.
2023-10-05 18:28:49 -04:00
Marshall Greenblatt
a8a96235a8 chrome: Set prefs for accept_language_list on Profile init (fixes #3579) 2023-10-05 16:43:45 -04:00
Marshall Greenblatt
29938f9cb0 Add new CanZoom/Zoom API (fixes #3284)
Add a simpler CanZoom/Zoom API as an alternative to the more error-prone
SetZoomLevel/GetZoomLevel API. Both APIs are now implemented for both runtimes.
With the Chrome runtime a zoom notification bubble will be displayed unless
CefBrowserSettings.chrome_zoom_bubble is set to STATE_DISABLED.

To test:
- Run cefclient and select zoom entries from the Tests menu.
- chrome: Run cefclient with `--hide-chrome-bubbles` command-line flag to hide
  the zoom notification bubble.
2023-10-05 13:22:44 -04:00
Nik Pavlov
d8ea7363f5 Remove unnecessary copy during CefBinaryValue creation (see #3502) 2023-10-05 16:57:01 +00:00
Nik Pavlov
f8dd0dbfb4 Avoid signed integer overflow UB in IdGenerator 2023-10-05 15:34:40 +00:00
Cristian Amarie
bdec92caf8 Add CefDragData::GetFilePaths to return file paths (fixes #3568)
GetFileNames now returns just the display names with a fallback to
path.BaseName() if the display name is empty.
2023-10-04 12:25:52 -04:00
Diego Pino
4ae030fec1 automate-git: Print out invalid options on error 2023-10-04 16:22:12 +00:00
Marshall Greenblatt
c7d4d9690c Add missing media router prefs registration (fixes #3570) 2023-09-29 13:52:22 -04:00
Marshall Greenblatt
39e64d8cc9 chrome: Standardize fullscreen transition behavor/callbacks (fixes #3571)
Use the same code path for all fullscreen transitions so that Chrome UI updates
correctly. All user-initiated fullscreen transitions now result in
CefWindowDelegate::OnWindowFullscreenTransition callbacks.
2023-09-28 17:44:35 -04:00
Marshall Greenblatt
262ed72348 cefclient: Use HTTPS for test URLs
Some features that we wish to test require HTTPS. Also, Chrome runtime is
redirecting HTTP URLs to HTTPS due to HSTS.
2023-09-28 12:01:04 -04:00
Marshall Greenblatt
27c6a4eabc Update to Chromium version 118.0.5993.0 (#1192594) 2023-09-20 12:07:47 -04:00
Marshall Greenblatt
4df2933516 alloy: Disable DocumentPictureInPictureAPI feature (see #3448)
This feature is default-enabled in M116+ but is not supported by the
Alloy runtime.
2023-09-20 12:07:46 -04:00
Marshall Greenblatt
57d7d89b53 Remove cef_template_util.h (see #3362)
This file is no longer required after cherry-picking C++17 migration
changes from https://crbug.com/1320019.

This also fixes compile errors with Xcode 15:
__has_trivial_destructor is deprecated; use __is_trivially_destructible instead
2023-09-20 12:07:46 -04:00
Marshall Greenblatt
cab404578d Add new Go project to README.md 2023-09-18 19:48:27 +00:00
Marshall Greenblatt
ef6ae3071d chrome: Support frameless document PiP window with draggable regions (fixes #3566) 2023-09-14 12:41:24 -04:00
Nik Pavlov
b064ba08f3 Use python3.bat in cef_create_projects.bat 2023-09-11 15:15:26 +00:00
Marshall Greenblatt
f808926fbd chrome: Add support for CefBrowserViewDelegate::OnGestureCommand 2023-08-31 13:28:27 -04:00
Marshall Greenblatt
f4ecc23213 Disable Chromium field trials in official builds (fixes #3560) 2023-08-30 13:21:06 -04:00
Marshall Greenblatt
0a633e361b win: Fix stickyness of force-[light|dark]-mode on theme change (see #3534) 2023-08-29 15:24:49 -04:00
Marshall Greenblatt
2133d8f5b3 mac: Add support for force-[light|dark]-mode flags (see #3534) 2023-08-29 14:38:18 -04:00
Marshall Greenblatt
445da33efe win: Enable Rust dependencies for x86 builds (see #3553) 2023-08-16 19:09:46 -04:00
Marshall Greenblatt
a4b27a7248 Update to Chromium version 117.0.5938.0 (#1181205) 2023-08-15 12:07:58 -04:00
Marshall Greenblatt
52cb08b973 win: Reduce length of command line for combine_libs.py
This fixes "command line is too long" error when running make_distrib.py.
2023-08-15 12:07:57 -04:00
Marshall Greenblatt
52a9794659 win: Add delayloads to libcef.dll and exe targets
Delay-load as many DLLs as possible for sandbox and startup perf
improvements.
2023-08-15 12:07:57 -04:00
Marshall Greenblatt
605c2bac86 win: Add support for --force-light-mode command-line flag (fixes #3534)
Like the existing --force-dark-mode flag.
2023-08-09 15:16:11 -04:00
Julien Bouix
01e1a0f44d alloy: Add setting to customize log items 2023-08-07 13:40:40 -04:00
Marshall Greenblatt
52b4d7ba5a Fix content_shell build with CEF enabled 2023-07-28 11:54:50 -04:00
Marshall Greenblatt
94d51ffe20 win: Fix implicit conversion changes signedness error 2023-07-25 15:08:42 -04:00
Marshall Greenblatt
4fc5fb8690 mac: tests: Fix NOTREACHED with ViewsTextfieldTest.TextfieldKeyEvent 2023-07-24 16:03:39 -04:00
Marshall Greenblatt
b07a9e1843 mac: cefclient: Fix deprecation warnings 2023-07-24 12:57:37 -04:00
Marshall Greenblatt
8b46735b79 Update to Chromium version 117.0.5895.0 (#1171312) 2023-07-20 18:11:34 -04:00
Marshall Greenblatt
1353677a98 Don't run UI thread tasks after calling CefQuitMessageLoop
This avoids a situation where misbehaving clients may cause the
application to continue running indefinitely by posting new UI
thread tasks after calling CefQuitMessageLoop.
2023-07-11 15:59:52 +03:00
Marshall Greenblatt
a576150ab5 cefclient: mac: Fix type conversion error with Xcode 2023-07-06 13:19:51 +03:00
Marshall Greenblatt
7a033d7585 chrome: linux: Fix NativeWidgetType for bubble popups 2023-07-04 16:38:44 +03:00
Marshall Greenblatt
1f11ce8700 chrome: mac: Keep bubble popups on-screen 2023-07-04 16:38:44 +03:00
Marshall Greenblatt
59bfb32221 cefclient: views: Add option for bottom controls placement
Run with the `--use-bottom-controls` command-line flag to place all controls
at the bottom of the window instead of the top.
2023-07-04 16:38:44 +03:00
Marshall Greenblatt
04c042d9d1 linux: Fix invalid argument type in CHECK 2023-06-28 11:46:38 +03:00
Marshall Greenblatt
8603545aef tests: Fix timing issue with DownloadTest.ClickedInvalid 2023-06-28 11:43:11 +03:00
Marshall Greenblatt
650755a092 Update to Chromium version 116.0.5845.0 (#1160321) 2023-06-28 11:43:11 +03:00
Marshall Greenblatt
71c588c16a alloy: mac/linux: Support OS execution via OnProtocolExecution (fixes #1340) 2023-06-26 13:08:04 +03:00
Marshall Greenblatt
0b99f92e97 views: Add support for modal browser dialogs
A modal dialog is a child CefWindow that implements some special behaviors
relative to a parent CefWindow. Like any CefWindow it can be framed with
titlebar or frameless, and optionally contain draggable regions (subject to
platform limitations described below). Modal dialogs are shown centered on
the parent window (inside a single display) and always stay on top of the
parent window in z-order. Sizing behavior and available window buttons are
controlled via the usual CefWindowDelegate callbacks. For example, the dialog
can have a preferred size with resize, minimize and maximize disabled (via
GetPreferredSize, CanResize, CanMinimize and CanMaximize respectively).

This change adds support for two modality modes. With window modality all
controls in the parent window are disabled. With browser modality only the
browser view in the parent window is disabled.

Both modality modes require that a valid parent window be returned via
GetParentWindow. For window modality return true from IsWindowModalDialog
and call CefWindow::Show. For browser modality return false from
IsWindowModalDialog (the default value) and call
CefWindow::ShowAsBrowserModalDialog with a reference to the parent window's
browser view.

Window modal dialog behavior depends on the platform. On Windows and
Linux these dialogs have a titlebar and can be moved independent of the
parent window. On macOS these dialogs do not have a titlebar, move with
the parent window, and do not support draggable regions (because they are
implemented using sheets). On Linux disabling the parent window controls
requires a window manager the supports _NET_WM_STATE_MODAL.

Browser modal dialog behavior is similar on all platforms. The dialog will
be automatically sized and positioned relative to the parent window's
browser view. Closing the parent window or navigating the parent browser
view will dismiss the dialog. The dialog can also be moved independent of
the parent window though it will be recentered when the parent window
itself is resized or redisplayed. On MacOS the dialog will move along with
the parent window while on Windows and Linux the parent window can be moved
independently.

To test: Use the Tests > Dialog Window menu option in cefclient with Views
enabled (`--use-views` or `--enable-chrome-runtime` command-line flag).
Browser modal dialog is the default behavior. For window modal dialog add
the `--use-window-modal-dialog` command-line flag.
2023-06-21 11:18:24 +03:00
Marshall Greenblatt
05930b7bc9 views: win: Use black title bar with dark mode 2023-06-21 11:18:16 +03:00
Marshall Greenblatt
12d0bccbd4 mac: Fix char16_t declaration error with Xcode 14.2 (fixes #3526) 2023-06-07 13:25:23 +03:00
Marshall Greenblatt
b5386249bd alloy: Remove CefSettings.user_data_path (fixes #3511)
This change replaces existing CefSettings.user_data_path usage with
CefSettings.root_cache_path for better alignment with the Chrome runtime.
All files should now be written inside the root_cache_path directory.
2023-06-06 17:41:57 +03:00
Chris Frank
36a645ffd8 linux: alloy: Fix window resize after context menu dismissal (fixes #3466) 2023-06-06 12:33:52 +00:00
Marshall Greenblatt
3bd2cd78c7 mac: Fix <uchar.h> not available with Xcode < 14.3 (fixes #3526) 2023-06-06 14:43:20 +03:00
Marshall Greenblatt
cbdda6b03b mac: chrome: Fix crash in BrowserView::ShouldHideUIForFullscreen (fixes #3527) 2023-06-06 12:05:02 +03:00
Marshall Greenblatt
6355aaf33b mac: cefclient: Fix compile error with Xcode 14.3.1 2023-06-02 17:28:41 +03:00
Marshall Greenblatt
e53bff712a Delete cef_basictypes.h which is no longer required (fixes #3507) 2023-06-01 19:32:36 +03:00
Marshall Greenblatt
b854992ae6 Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
Marshall Greenblatt
5042d71408 Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
Marshall Greenblatt
695ee2a041 Update to Chromium version 115.0.5790.0 (#1148114)
- Mac: 13.3 SDK (Xcode 14.3) is now required
2023-06-01 13:44:39 +03:00
Marshall Greenblatt
cf8b7db4b4 win: Ship d3dcompiler_47.dll on ARM64 (fixes #3515)
Use the same file from the Windows SDK as Chromium on all architectures
("$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll").
2023-06-01 13:38:38 +03:00
Marshall Greenblatt
5d8c6799fc win: cmake: VS2022 is now required (fixes #3516) 2023-06-01 13:10:56 +03:00
Marshall Greenblatt
bd368f5d3a win: Fix ambiguous max() usage (fixes #3524, see #3422) 2023-06-01 12:55:30 +03:00
Marshall Greenblatt
87a04aba03 win: Update msvs_env.bat to prefer VS2022 (fixes #3509) 2023-06-01 12:55:30 +03:00
Marshall Greenblatt
df4dddee0b win: Fix MSVC compile errors in registry.cc (fixes #3519) 2023-05-30 11:57:41 +03:00
Nik Pavlov
eb63f9e7ae alloy: views: mac: Add three-finger-swipe navigation gesture support
This adds support for the three-finger-swipe navigation gesture with
Alloy/Views. The default implementation matches the Chrome runtime
and navigates the browser back/forward. We also add an Alloy/Views-
specific client callback in CefBrowserViewDelegate for optional
custom handling of the gesture event.
2023-05-26 09:05:33 +00:00
Marshall Greenblatt
29b5999fd7 Add missing include for std::numeric_limits (see #3422) 2023-05-26 08:35:09 +00:00
Marshall Greenblatt
5707889555 Add methods for configuring website/content settings (fixes #3490)
This approach is now used to allow popups on a case-by-case basis in
tests instead of globally disabling the popup blocker with the Chrome
runtime.
2023-05-25 11:15:06 +00:00
Vladimir Kharitonov
ecdfd467f8 Update CefRange type to match gfx::Range (fixes #3422) 2023-05-16 14:44:19 +03:00
Marshall Greenblatt
e5334a5a18 mac: Enable ARC in libcef (fixes #3496)
Also enables debugging of zombie Objective-C objects.
2023-05-09 18:26:47 +03:00
Marshall Greenblatt
e5c4b27366 tools: Fix incorrect SharedMemoryRegion translation (fixes #3498) 2023-05-09 12:37:42 +03:00
Marshall Greenblatt
c18545a7f5 Replace NOTREACHED() with DCHECK(false) in generated files (see #3500)
Restores the old behavior of assertion in Debug build only.
2023-05-08 18:36:00 +03:00
Marshall Greenblatt
dc9e64308a Replace NOTREACHED() with DCHECK(false) (fixes #3500)
Restores the old behavior of assertion in Debug build only.
2023-05-08 18:36:00 +03:00
Marshall Greenblatt
b8e1c6a59d Remove TRACE_EVENT_COPY_XXX overloads (fixes #3497)
This functionality is not compatible with Chromium's new tracing implementation
based on Perfetto.
2023-05-08 18:32:54 +03:00
Takashi Hashida
cf14b2a972 Add CefDownloadItem IsInterrupted and GetInterruptReason methods (fixes #3486) 2023-05-06 16:11:16 +03:00
Marshall Greenblatt
5a22a5c8a3 cmake: win: Fix incorrect /STACK value (fixes #3491) 2023-05-06 15:37:19 +03:00
Marshall Greenblatt
5e80ea3371 mac: Remove libtest_trace_processor.dylib as a runtime dependency 2023-05-05 22:53:16 +03:00
Marshall Greenblatt
d0b3042940 tests: Fix SchemeHandlerTest.HttpXSSDifferentOriginWithDomain failure
Cross-origin usage of document.domain is now restricted by default with the
Chrome runtime. Relax this policy for XSS tests by setting the
"Origin-Agent-Cluster: ?0" header.

Also remove usage of global variable in tests.
2023-05-05 22:53:16 +03:00
Marshall Greenblatt
de4f9e8908 tests: Change HTTP test URLs to HTTPS
This avoids unexpected HTTP to HTTPS redirects which cause test failures with
the Chrome runtime.
2023-05-05 22:53:16 +03:00
Marshall Greenblatt
ab94a13522 Update to Chromium version 114.0.5735.0 (#1135570)
- Mac: 13.3 SDK (Xcode 14.3) is now supported (see https://crbug.com/1431897).
- Mac: Removed UnderlayOpenGLHostingWindow which is no longer used.
2023-05-05 22:53:16 +03:00
Marshall Greenblatt
09c4142dad chrome: mac: Add Alerts helper app (fixes #3181)
Some Chromium code cleanup will follow in
https://chromium-review.googlesource.com/c/chromium/src/+/4456752
2023-04-21 14:39:19 -04:00
Marshall Greenblatt
e0063880ac chrome: mac: cefclient: Support Find window commands (fixes #3462) 2023-04-20 12:26:07 -04:00
Marshall Greenblatt
7ade772e0b chrome: mac: Support dispatch of window commands (see #3462) 2023-04-20 12:26:07 -04:00
Marshall Greenblatt
a39c2a0068 chrome: Improve positioning of the "Find" widget (fixes #3461)
The "Find" widget will be excluded from regions near the edges of the window
that contain overlays, draggable regions or titlebar.
2023-04-20 12:26:07 -04:00
Marshall Greenblatt
17cab6d955 views: mac: Fix overlay association with host CefWindow (fixes #3456) 2023-04-20 12:23:57 -04:00
Nik Pavlov
cad2498d87 mac: views: Add CefWindowDelegate::OnWindowFullscreenTransition 2023-04-20 14:59:15 +00:00
Marshall Greenblatt
6569ef09c5 Update API hash 2023-04-13 12:10:00 -04:00
Sergey Markelov
78ea5d8c61 Make string map append API match the manuals
Reduce cef_string_[multi]map_key() and cef_string_[multi]map_value() complexities
from O(N) to O(1).
2023-04-13 16:08:48 +00:00
Sergey Markelov
c3648f42b2 Use less error prone string list, map or multimap pointer types
Use pointers to incomplete struct types. If an argument of a not suitable
type is passed to a function of any string collection,
C compiler will warn:
  warning: passing argument 1 of <func> from incompatible pointer type
C++ compiler will raise an error, for example:
  error: cannot convert 'cef_string_list_t' ... to 'cef_string_multimap_t'

With the previously used `void*` pointer types, such errors in a code were not
diagnosed.
2023-04-13 16:06:02 +00:00
Sergey Markelov
f90d5bc49e Remove unused macro FALLTHROUGH
Chromium and CEF now use the attribute `[[fallthrough]]`.
2023-04-13 16:03:41 +00:00
Eric Astor
55e158fe81 Avoid generating an accidental UDL suffix
In the error case, we previously output a pragma with a string immediately
followed by __FILE__ - but with no space between the string terminator and
__FILE__, a compliant C++ compiler can interpret this as a user-defined literal
suffix and end up failing to embed the intended information. We should add
spaces here to ensure our generated code is standards-compliant.
2023-04-12 19:54:31 +00:00
Sergey Markelov
5d48f277f2 Fix typos in cef_origin_whitelist.h and capi/cef_origin_whitelist_capi.h 2023-04-12 18:21:39 +00:00
Marshall Greenblatt
2094a8e221 alloy: Fix incorrect rendering of PiP overlay on mouseover (fixes #3482)
Initialize the Chrome color mixer so that ColorProvider returns the expected
semi-transparent color for overlay background in video_overlay_window_views.cc
instead of the default opaque red color (kPlaceholderColor).
2023-04-11 14:08:36 -04:00
Marshall Greenblatt
4b3c3132cb Update to Chromium version 113.0.5672.0 (#1121455) 2023-04-05 17:48:51 -04:00
Nik Pavlov
c83b3cda24 views: mac: Support dynamic resize of title bar height (see #3189)
This is intended for usage with frameless windows that show the standard window
buttons, where resizing the title bar height changes the button offset. Returning a
different value from CefWindowDelegate::GetTitlebarHeight and forcing a resize of
the NSWindow's theme frame (see ViewsWindow::NudgeWindow) will update the
title bar height.

To test:
1. Run `cefclient --use-views --hide-frame --show-window-buttons --url=http://tests/window`
2. Enter a new value for title bar height and click the "Set Titlebar Height" button
2023-03-16 17:19:50 +00:00
Marshall Greenblatt
0a2c7a1070 chrome: Move ThreadProfiler initialization to the UI thread (fixes #3465)
ThreadProfiler::CreateAndStartOnMainThread and SetMainThreadTaskRunnerImpl
should be called on the same thread.
2023-03-14 15:22:58 -04:00
Marshall Greenblatt
178a44bd18 Rewrite issue links to GitHub (see #3464) 2023-03-13 13:50:48 -04:00
Nik Pavlov
45d771dfb0 views: mac: Enable WindowTestRunnerViews 2023-03-13 17:24:25 +00:00
Marshall Greenblatt
1726176b9b Update GitHub issue templates (see #3464) 2023-03-11 20:59:16 -05:00
Marshall Greenblatt
c6872cec5f Add GitHub issue templates (see #3464) 2023-03-11 20:45:14 -05:00
Marshall Greenblatt
14dd0c0d06 chrome: Add ability to hide toolbar and app menu contents (see issue #3280)
This change adds new CefCommandHandler callbacks for optionally hiding
specific Chrome toolbar icons, buttons and app menu items.

To test: Run `cefclient --enable-chrome-runtime --filter-chrome-commands`.
Most icons, buttons and app/context menu items will be hidden.
2023-03-08 12:02:49 -05:00
Nik Pavlov
06af9c85da views: mac: Show standard window buttons with frame by default (see issue #3189)
This restores the previous default behavior for framed windows.
2023-03-08 16:58:21 +00:00
Marshall Greenblatt
d509d5833d chrome: Don't show gray background during browser load (fixes issue #3459) 2023-03-06 15:55:55 -05:00
Marshall Greenblatt
2c67350605 Update API hash for commit 9ae4da3b38 2023-03-06 15:55:38 -05:00
Sergey Markelov
9ae4da3b38 Fix compile error: this function declaration is not a prototype
`cef_basetime_now()` failed to compile if `-Wstrict-prototypes` is set in clang
or gcc.
2023-03-06 16:48:36 +00:00
梅迎朝
8b79f9cbe7 cefclient: Fix incorrect logic in PassThruResponseFilter 2023-03-06 16:48:03 +00:00
Marshall Greenblatt
3e4f8d1b9c win: Copy dbghelp.dll/dbgcore.dll from the Windows SDK (fixes issue #3356) 2023-03-03 18:26:06 -05:00
Marshall Greenblatt
f3b570cf8e win: Remove CefEnableHighDPISupport function (fixes issue #3452)
High-DPI support is now enabled by default in Chromium.
2023-03-03 16:07:29 -05:00
Marshall Greenblatt
d33b67cb33 tools: mac: Add missing README.sandbox.txt (fixes issue #3453) 2023-03-03 15:48:03 -05:00
Marshall Greenblatt
ae9ede9aa6 win: Add windows_sdk_version GN arg (see https://crbug.com/1420723) 2023-03-03 09:59:30 -05:00
Marshall Greenblatt
584b19967a Update to Chromium version 112.0.5615.0
- Windows: VS2022 and Win11 SDK 10.0.22621.0 are now required.
2023-03-03 09:59:30 -05:00
Marshall Greenblatt
3c85154faf Remove renderer process CefURLRequest support
The CefFrame::CreateURLRequest method is no longer supported in the renderer
process. Usage of this method was already limited to same-origin requests due
to renderer process CORS restrictions, and the underlying Blink API has now
been removed in https://crbug.com/1413912 (M112+).

Existing alternatives include CefURLRequest usage in the browser process, or
JavaScript XMLHttpRequest/fetch API usage in the renderer process.
2023-02-28 13:36:15 -05:00
Nik Pavlov
276423dcfb views: mac: Fix frameless window behavior (fixes issue #3189)
Frameless windows now display as expected. Default traffic light buttons can
optionally be shown at configurable vertical position. Layout respects text
direction.
2023-02-28 18:34:12 +00:00
Marshall Greenblatt
42f351a40d alloy: Fix theme configuration on startup (fixes issue #3449) 2023-02-22 17:11:47 -05:00
Marshall Greenblatt
13f2282754 chrome: cefclient: Add default handler for request tests (see issue #3444)
Support loading of request tests (e.g. http://tests/other_tests) inside default
browsers created via "New window" and "New incognito window" commands.
2023-02-17 16:01:22 -05:00
Marshall Greenblatt
80cfb3c97c chrome: Fix request interception with active extension (fixes issue #3444)
Support chaining of proxies in WillCreateURLLoaderFactory.
2023-02-17 15:18:10 -05:00
Marshall Greenblatt
73082fd2ce chrome: Make primary user profile the default global context (see issue #3444)
Chrome is always loading the primary user profile by default, so with this
change the CEF behavior more accurately reflects reality. Incognito contexts
can still be created explicitly via CefRequestContext::CreateContext.

Prior to this change, the default for the global context was an Incognito
profile based on the primary user profile. That caused request interception
to be bypassed in WillCreateURLLoaderFactory for profiles associated with
the "New window" and "New incognito window" commands. Those profiles, while
also being (or based on) the primary user profile, did not match the specific
Incognito profile assigned to the default global context.

After this change, the "New window" and "New incognito window" commands will
match the default global context when executed on a browser that was created
using the primary user profile.
2023-02-17 14:36:13 -05:00
Marshall Greenblatt
bc29774553 chrome: Fix crash on display of browser via "New window" command 2023-02-17 14:35:42 -05:00
Marshall Greenblatt
ff68c01543 chrome: Use default Browser creation for picture-in-picture popups (see issue #3448)
Note: In current master (based on M111), document PiP partially works when
run with the `--enable-features=DocumentPictureInPictureAPI` command-line
flag. However, the document PiP implementation at this Chromium version is
missing fixes that have already been cherry-picked to the 5563 release
branch. Those fixes will only be available in master after the next Chromium
update (to M112).
2023-02-10 15:42:37 -05:00
Marshall Greenblatt
400fbf7839 automate-git: Remove --chromium-channel parameter (fixes issue #3447)
This functionality is currently unused, and depends on deprecated omahaproxy
data sources from Chromium.
2023-02-08 12:56:20 -05:00
Marshall Greenblatt
f34406c57d Fix potential UAF of CefBPDNativeAura::window_widget_ 2023-02-07 10:45:57 -05:00
Marshall Greenblatt
adfa59f690 ceftests: Fix OSRTest flakyness 2023-02-06 17:45:35 -05:00
Marshall Greenblatt
baf98ee6e9 ceftests: Fix MediaAccessTest.Desktop failures
Fixes InvalidStateError: Failed to execute 'getDisplayMedia' on 'MediaDevices':
getDisplayMedia() requires transient activation (user gesture).
2023-02-03 13:00:26 -05:00
Marshall Greenblatt
dc2231cdfb Update to Chromium version 111.0.5563.0 (#1097615) 2023-02-03 13:00:26 -05:00
Marshall Greenblatt
4c41f14360 Remove deprecated base::[Dictionary|List]Value API usage 2023-01-30 21:32:19 -05:00
Marshall Greenblatt
36ee304ed4 Use default cookie scheme settings for non-global request contexts
The CefSettings cookie scheme configuration will now only impact the global
request context. Custom behavior for other request contexts must now be
configured via CefRequestContextSettings.
2023-01-26 14:37:05 -05:00
Marshall Greenblatt
c3c5d6ff37 chrome: Allow WebUI handling of DevTools scheme (fixes issue #3421) 2023-01-23 14:20:11 -05:00
Marshall Greenblatt
47d2651ea4 Fix patched chrome build with enable_cef=false 2023-01-23 14:20:11 -05:00
Marshall Greenblatt
5c4ac32bb9 tools: Return non-zero exit code from automate-git.py on error 2023-01-19 16:42:55 -05:00
Marshall Greenblatt
8b447e3a6f chrome: Don't show the profile picker on startup (fixes issue #3440) 2023-01-19 16:21:21 -05:00
Marshall Greenblatt
b065ca8cf4 ceftests: Add support for scaling default test timeout values 2023-01-13 14:01:29 -05:00
Marshall Greenblatt
2b906c31b5 cmake: Set PROJECT_ARCH to the host architecture by default 2023-01-12 16:46:46 -05:00
e.jorge
b65d59f27e Fix edit command execution on pdf frames (fixes issue #3429) 2023-01-12 21:45:43 +00:00
Marshall Greenblatt
606e5dddf3 Fix crash calling GetUserData on a non-user V8 object (fixes issue #3438) 2023-01-12 15:56:12 -05:00
Sergey Markelov
4f336c110b Fix the comments to CefCommandLine::AppendSwitch methods 2023-01-12 11:51:25 -05:00
e.jorge
aae420aa8b linux: Fix component build errors (fixes issue #3424) 2023-01-12 16:49:21 +00:00
Vladimir Kharitonov
b1a530c76a mac: Fix OSR scaling behavior when switching displays (fixes issue #3423) 2023-01-12 16:47:19 +00:00
Enrique Turegano Pedruelo
f6d626d979 Linux: Fix build without X11 (fixes issue #3431) 2023-01-10 21:30:47 +00:00
Marshall Greenblatt
2b2c6aa143 win: osr: Fix context menu popup placement (fixes issue 3433) 2023-01-06 15:51:22 -05:00
Marshall Greenblatt
b66c2d1bea Revert "Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue #3294)"
This reverts commit 5f4bccd672.

Reason for revert: This change causes a native parented browser to lose focus
on move (fixes issue #3426).
2023-01-06 13:48:29 -05:00
Marshall Greenblatt
e65da8fab8 alloy: Avoid initialization of privacy sandbox and identity manager (fixes issue #3434, fixes issue #3401) 2023-01-06 12:12:19 -05:00
Marshall Greenblatt
aef474b909 alloy: Fix crashes when extensions are disabled (fixes issue #3430) 2023-01-05 14:00:22 -05:00
Marshall Greenblatt
8a07a836e1 cmake: Set build target to Windows 10 2023-01-05 12:47:15 -05:00
Marshall Greenblatt
9f8be5ea6c Update include files for bracket style 2023-01-04 21:36:29 -05:00
Marshall Greenblatt
83cb82d50f Rename namespace to "cef_internal" for base types
This fixes duplicate symbol errors when building CEF sample applications as
part of the Chromium build. These applications pick up a link-time dependency
on base.lib via the //sandbox and/or //testing/gtest targets which then
conflict with the symbols provided by the libcef_dll_wrapper target.
2023-01-04 21:36:29 -05:00
Marshall Greenblatt
a986b1c226 ceftests: Fix CorsTest.IframeNone failures
The same console message is sometimes output multiple times.
2023-01-04 21:36:29 -05:00
Marshall Greenblatt
d04b5d4f87 Update to Chromium version 110.0.5481.0 (#1084008) 2023-01-04 21:36:29 -05:00
Marshall Greenblatt
e646827d92 cefclient: Remove console message alert and update google URLs 2023-01-04 17:58:42 -05:00
Marshall Greenblatt
7ba45a0451 Mac: Fix implicit type cast errors with Xcode 14.1 2023-01-04 17:58:42 -05:00
Marshall Greenblatt
3af3eab3e4 Update source files for bracket style 2023-01-04 17:47:17 -05:00
Marshall Greenblatt
d84b07a5cb Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
Marshall Greenblatt
c7ffa3a122 Update translator tooling for bracket style 2023-01-04 17:32:03 -05:00
David Cernoch
ecc89d7d93 alloy: Generate tagged PDFs when using PrintToPDF
This matches the current behavior in Chrome.
2022-12-14 19:51:03 +00:00
Marshall Greenblatt
30a321b1ce win: Add ENABLE_BASE_TRACING check to fix cef_sandbox build 2022-11-17 12:50:15 -05:00
Marshall Greenblatt
d7d0c2fc6d mac: Fix bug in GetNSBoundsInDisplay (see issue #3359) 2022-11-17 12:50:15 -05:00
Marshall Greenblatt
216e5b31dd tests: Fix CorsTest.Iframe failures (see issue #3348)
Run test initialization after the server has started.
2022-11-17 12:50:15 -05:00
Marshall Greenblatt
47d69a842a Update to Chromium version 109.0.5414.0 (#1070088)
- mac: Xcode 14.0 with macOS SDK 13.0 is now required.
- Remove CefRequestHandler::OnQuotaRequest because persistent quota is no
  longer supported (see https://crbug.com/1208141)
2022-11-17 12:50:15 -05:00
Marshall Greenblatt
74fc5d5573 win: Fix 1px gap with maximized frameless windows on Win11 (fixes issue #3414) 2022-11-09 13:08:16 -05:00
Rye Mutt
7611c4dba6 win: tools: Add VS2022 to msvs_env.bat 2022-11-08 22:19:02 +00:00
Marshall Greenblatt
25954e872e cefclient: mac: Support window state restore (see issue #3359)
The cefclient sample app on macOS will persist window state across application
restart if run with cache_path and persist_user_references enabled.

To test:
1. Run `cefclient --cache-path=/path/to/cache --persist-user-preferences`
2. Move or resize the window, maximize, minimize, etc.
3. Exit cefclient.
4. Run cefclient again with the same arguments. The previous window state will
   be restored.
2022-11-08 16:37:39 -05:00
Marshall Greenblatt
e2a9236106 cefclient: win: Support window state restore (see issue #3359)
The cefclient sample app on Windows will persist window state across application
restart if run with cache_path and persist_user_references enabled.

To test:
1. Run `cefclient --cache-path=/path/to/cache --persist-user-preferences`
2. Move or resize the window, maximize, minimize, etc.
3. Exit cefclient.
4. Run cefclient again with the same arguments. The previous window state will
   be restored.
2022-11-07 15:21:46 -05:00
Marshall Greenblatt
882bc19fdd cefclient: views: Support window state restore (see issue #3359)
The cefclient sample app will persist window state across application restart
if run with views, cache_path and persist_user_references enabled.

To test:
1. Run `cefclient --use-views --cache-path=/path/to/cache --persist-user-preferences`
2. Move or resize the window, maximize, minimize, etc.
3. Exit cefclient.
4. Run cefclient again with the same arguments. The previous window state will
   be restored.
2022-10-28 14:28:53 -04:00
Marshall Greenblatt
09bb643ef6 Support registration of custom preferences.
Custom global and request context preferences can now be registered via
CefBrowserProcessHandler::OnRegisterCustomPreferences. CefRequestContext
now extends CefPreferenceManager and global preferences can be accessed
via CefPreferenceManager::GetGlobalPreferenceManager.
2022-10-26 16:54:33 -04:00
Marshall Greenblatt
767c4422ac windows: Fix size/placement with multi-DPI screen setup (fixes issue #3359)
Use ScreenWin functions to correctly compute DIP/pixel conversions for
CEF-created top-level windows.

Fix incorrect DIPToScreenRect usage in DesktopWindowTreeHostWin when
|has_external_parent_| is true.
2022-10-24 19:53:05 -04:00
Marshall Greenblatt
07bf5dbacc windows: Configure stack size for executables (fixes issue #3250)
Change the default stack size to 8 MiB for 64-bit and 0.5 MiB for 32-bit.

CEF's main thread needs at least a 1.5 MiB stack size in order to avoid
stack overflow crashes. However, if this is set in the PE file then other
threads get this size as well, leading to address-space exhaustion in 32-bit
CEF. A new CefRunWinMainWithPreferredStackSize function uses fibers to switch
the main thread to a 4 MiB stack (roughly the same effective size as the
64-bit build's 8 MiB stack) before running any other code.

This change additionally moves the existing Windows-only functions
CefSetOSModalLoop and CefEnableHighDPISupport from cef_app.h to cef_win.h.
2022-10-21 14:52:50 -04:00
Marshall Greenblatt
dfd1917d9b Remove obsolete call to _set_FMA3_enable(0)
This call was longer required after the switch to VS2015 (see
https://crbug.com/586618).
2022-10-20 13:47:27 -04:00
Marshall Greenblatt
a046794e68 alloy: Fix renderer crashes related to BadgeService (fixes issue #3005) 2022-10-20 12:49:43 -04:00
Marshall Greenblatt
1e4e18240d Linux: Fix deprecated-volatile error with older glib version
Fix "error: use of result of assignment to object of volatile-
qualified type 'volatile gsize' (aka 'volatile unsigned long') is
deprecated [-Werror,-Wdeprecated-volatile]" when building with
use_sysroot=false on Ubuntu 18.04.
2022-10-18 17:58:41 -04:00
Marshall Greenblatt
8b45f32b33 Update to Chromium version 108.0.5359.0 (#1058933) 2022-10-18 17:58:41 -04:00
Marshall Greenblatt
25c75c5fc4 Use new PrintViewManagerBase::PrintToPdf method (fixes issue #3377) 2022-10-14 14:10:30 -04:00
npavlov
485f0b9caf Add screen pixel to screen DIP conversion methods.
On Windows these new CefDisplay methods convert between screen pixel coordinates
and screen DIP coordinates. On macOS and Linux these methods just return a copy
of the input coordinates.
2022-10-14 13:55:07 -04:00
VodBox
fa643b269e Add support for native creation and resolution of Promises (fixes issue #3305) 2022-10-11 14:55:12 -04:00
Marshall Greenblatt
60ee4a34aa Add support for PGO builds (fixes issue #2956)
This configuration applies to Official Release builds only.

Chromium currently provides PGO profiles for Windows x86/x64, MacOS x64/ARM64
and Linux x64. Official builds for these platforms must run automate-git.py with
the `--with-pgo-profiles` command-line flag. Official builds for other platforms
must disable PGO builds by adding `chrome_pgo_phase=0` to GN_DEFINES.
2022-10-10 14:11:22 -04:00
Marshall Greenblatt
f33c062d78 Don't include ceftests/resources in minimal distrib (fixes issue #3408) 2022-10-10 14:11:22 -04:00
Marshall Greenblatt
fce5af14a8 widevine: Support CDM host verification and storage ID (fixes issue #3404)
This functionality will be enabled if .sig files exist in the required
locations. See the issue for details.
2022-10-04 18:21:31 -04:00
Marshall Greenblatt
497e0d2d98 Support GN configuration of enable_rlz (see issue #3404) 2022-10-04 12:52:48 -04:00
Jelle Bleyaert
e0c878df5f Add CefResolveURL function (fixes issue #3402) 2022-10-03 17:46:50 +00:00
Marshall Greenblatt
5433d9fe5c alloy: Fix crash after file dialog selection (fixes issue #3401) 2022-09-30 14:09:37 -04:00
Marshall Greenblatt
dc35b3a93e Linux: Remove the fatal_linker_warnings=false default GN arg
This value is no longer required with Ubuntu 16+ host systems.
2022-09-29 13:12:45 -04:00
Marshall Greenblatt
4e43f90244 chrome: Fix shutdown crashes with multi-threaded-message-loop (fixes issue #3403) 2022-09-29 13:09:35 -04:00
Marshall Greenblatt
4d1fd05740 Update to Chromium version 107.0.5304.0 (#1047731) 2022-09-29 13:09:35 -04:00
Marshall Greenblatt
0089378a0a alloy: Fix crash when requesting periodic-background-sync permission (fixes issue #3393) 2022-09-09 11:58:22 -04:00
Marshall Greenblatt
7e3b084819 cefclient: Fix infinite loop in FilterMenuModel (fixes issue #3392) 2022-09-08 12:41:25 -04:00
Marshall Greenblatt
53c365b752 Fix more space in comments (see issue #3384) 2022-09-06 16:11:02 -04:00
Marshall Greenblatt
9c359b682b docs: Fix API doc link in README.md (see issue #3385) 2022-09-06 16:10:29 -04:00
Marshall Greenblatt
7174c4c328 docs: Add new API docs links to README.md (see issue #3385) 2022-09-06 14:44:38 -04:00
Czarek Tomczak
9ecd25a93b linux: cefclient: Fix MESA_GL_VERSION_OVERRIDE env variable name 2022-09-05 20:56:49 +00:00
Marshall Greenblatt
5ea0c141b5 Convert base::size to std::size from C++17 (see issue #3362) 2022-09-05 16:31:47 -04:00
Marshall Greenblatt
12fc72147c Format include/base comments for Doxygen (see issue #3384) 2022-09-05 16:17:57 -04:00
Marshall Greenblatt
cf7e10aacc Fix space in comments (see issue #3384) 2022-09-05 14:10:30 -04:00
Marshall Greenblatt
09b4cbd32c docs: Use README.md as the Doxygen main page (see issue #3384)
Also set FULL_SIDEBAR=NO for consistency with older Doxygen versions where
this option is not supported.
2022-09-05 14:06:23 -04:00
Marshall Greenblatt
8645e88e0e tools: Add make_cppdocs.sh for Linux/MacOS (see issue #3385)
The make_distrib script will now generate Doxygen docs by default
if the doxygen command-line tool is installed. Run with `--no-docs`
(`--no-distrib-docs` with automate-git.py) to disable docs generation.
2022-09-02 11:27:22 -07:00
Marshall Greenblatt
fa2464e843 cmake: Add a Doxygen target to the binary distribution (fixes issue #3386)
This change also writes a docs/index.html file to provide an easier entry point
for loading the documentation from the docs/html directory.
2022-09-02 13:17:30 -04:00
Marshall Greenblatt
51699e671a Fix line wrapping in comments (see issue #3384) 2022-09-02 13:10:09 -04:00
Marshall Greenblatt
14c0f74707 tools: Update make_cppdocs.bat for Doxygen support (see issue #3384) 2022-09-01 17:21:19 -04:00
Marshall Greenblatt
77582a01b5 tools: Add initial Doxyfile configuration (see issue #3384)
This configuration can be summarized as:

```
$ doxygen.exe -x_noenv
// Difference with default Doxyfile 1.9.5
PROJECT_NAME           = "Chromium Embedded Framework (CEF)"
PROJECT_NUMBER         = $(PROJECT_NUMBER)
OUTPUT_DIRECTORY       = docs
STRIP_FROM_INC_PATH    = .
JAVADOC_AUTOBRIEF      = YES
PYTHON_DOCSTRING       = NO
TAB_SIZE               = 2
TYPEDEF_HIDES_STRUCT   = YES
EXTRACT_ALL            = YES
EXTRACT_STATIC         = YES
FORCE_LOCAL_INCLUDES   = YES
QUIET                  = YES
INPUT                  = include
RECURSIVE              = YES
EXCLUDE                = include/capi \
                         include/test \
                         include/base/internal
EXCLUDE_PATTERNS       = *_internal.h
EXCLUDE_SYMBOLS        = base::cef_internal \
                         base::cef_subtle \
                         base::internal \
                         cef_trace_event \
                         cef::logging
STRIP_CODE_COMMENTS    = NO
REFERENCES_LINK_SOURCE = NO
VERBATIM_HEADERS       = NO
IGNORE_PREFIX          = Cef \
                         cef_
DISABLE_INDEX          = YES
GENERATE_TREEVIEW      = YES
FULL_SIDEBAR           = YES
SEARCHENGINE           = NO
GENERATE_LATEX         = NO
PREDEFINED             = USING_CEF_SHARED \
                         __cplusplus \
                         OS_WIN \
                         OS_LINUX \
                         CEF_X11 \
                         OS_MAC
```
2022-09-01 17:20:54 -04:00
Marshall Greenblatt
d7a153bdd4 Update include/ comments to Doxygen formatting (see issue #3384)
See related guidelines in the issue.
2022-09-01 17:14:30 -04:00
Marshall Greenblatt
7b352159df tools: Update translator tool for Doxygen comment format (see issue #3384)
Comments for translated classes/methods/functions must now take the form:

///
/// ... text ...
///
2022-09-01 17:13:28 -04:00
Marshall Greenblatt
00f34d5e68 cmake: Update supported Xcode to 13.4 2022-08-31 22:06:51 -04:00
Marshall Greenblatt
f8d90a8972 Fix OnReceiveResponse expectations (fixes issue #3380)
OnHeadersReceived may not have been called for cached responses.
2022-08-30 14:20:19 -04:00
Marshall Greenblatt
27d4f1fc97 alloy: Fix crashes related to permissions checks (fixes issue #3379, fixes issue #3381) 2022-08-26 12:23:48 -04:00
Marshall Greenblatt
f2206b8dbc Windows: Enable big PDBs for libcef.dll.pdb in full-symbol builds
This fixes official build linker errors like:

lld-link: error: Output data is larger than 4 GiB. File size 4,341,682,176 too large for current PDB page size 4096
lld-link: error: failed to write PDB file ./libcef.dll.pdb

See https://crbug.com/1245726 for background.
2022-08-25 18:53:38 -04:00
Marshall Greenblatt
713297ee04 Windows: Fix unresolved dependencies error on ARM64 2022-08-25 18:33:24 -04:00
Marshall Greenblatt
37aee4d3a0 Improve the timing of OnLoadEnd (fixes issue #3341)
Use WebContentsDelegate::DidFinishLoad instead of a custom Mojo message.
This fixes flaky OnLoadEnd behavior with NavigationTest.Order.
2022-08-25 18:23:33 -04:00
Marshall Greenblatt
5ec6e62656 tests: Fix DOMTest failure with fractional devicePixelRatio 2022-08-25 14:09:20 -04:00
Marshall Greenblatt
bf467e136a tests: Disable HTTPS server reuse between tests (see issue #3348)
We can't currently reuse the HTTPS server between tests due to
https://crrev.com/dd2a57d753 causing certificate registration issues.
2022-08-25 14:09:20 -04:00
Marshall Greenblatt
e95d1653ac tests: Fix failures on multiple execution of HSTSRedirectTest.Redirect (see issue #3336) 2022-08-25 14:09:20 -04:00
Marshall Greenblatt
5dc69c6cdb alloy: Remove optimization/prediction service usage (see issue #3352)
This service is required by the "PermissionOnDeviceNotificationPredictions"
feature which is enabled by default in https://crbug.com/1350956. It uses a
Google backend service as described at https://go.dev/solutions/google/chrome.

This change removes the usage of PredictionBasedPermissionUiSelector, which
triggered this dependency, along with related startup complexity that was added
to support the optimization/prediction service in the M106 update.
2022-08-25 14:09:20 -04:00
Marshall Greenblatt
7659dd60ba Update to Chromium version 106.0.5249.0 (#1036826) 2022-08-25 14:09:20 -04:00
Marshall Greenblatt
6d71f5ffd7 Don't reconnect after intentional browser frame detach (see issue #3260)
Send a FrameDetached message from CefFrameHostImpl::Detach before closing
the RenderFrame connection to avoid an immediate reconnect attempt by the
renderer.

When BFCache is disabled the intentionally detached frame will never be
reconnected. When BFCache is enabled the intentionally detached frame will
be reconnected via CefFrameImpl::OnWasShown if/when it exits the cache.
2022-08-19 12:38:32 -04:00
Marshall Greenblatt
2bf3d536ea Improve logging of frame connection state (see issue #3260)
Run with "--vmodule=frame_*=1 --enable-logging=stderr --no-sandbox" on the
command-line to see these log messages from both the browser and renderer
processes.
2022-08-19 12:38:32 -04:00
Marshall Greenblatt
a7e50dfe7f Fix same-site calculation for saving cookies from intercepted responses
This fixes an issue where authentication cookies from SAML responses were not
being saved.
2022-08-19 12:38:32 -04:00
Marshall Greenblatt
6d98d2c6ed Fix crashes with PrintToPDF (fixes issue #3373)
- Configure the DPI setting (see https://crrev.com/40e28bcba3)
- Call StopWorker on the UI thread (see https://crrev.com/564fa1d8a4)
2022-08-18 12:29:35 -04:00
Marshall Greenblatt
a4b8935427 Add missing newline at end of file 2022-08-16 16:23:27 -04:00
Marshall Greenblatt
7fdbb427bc alloy: Fix flaky OnDraggableRegionsChanged behavior (fixes issue #3374)
Disable BackForwardCache globally for the Alloy runtime so that
blink::RuntimeEnabledFeatures::BackForwardCacheEnables reports the
correct value in the renderer process.
2022-08-11 17:25:36 -04:00
Marshall Greenblatt
e44f76bbe4 Fix DisplayTest.AutoResize failure 2022-08-11 14:49:54 -04:00
Marshall Greenblatt
f8d10289b5 Fix DOMTest failure related to device scaling 2022-08-11 14:20:23 -04:00
Marshall Greenblatt
8908465546 Fix browser focus assignment on mouse click (fixes issue #3306)
DesktopWindowTreeHostWin ("Chrome_WidgetWin_0") focus needs to be set before
the associated call to WebContents::Focus. In the case of mouse click events,
this means ::SetFocus needs to be called explicitly. See updated comments in
CefBrowserPlatformDelegateNativeWin::SetFocus.
2022-08-10 13:52:42 -04:00
Marshall Greenblatt
0ddb572c03 chrome: Add support for CefRequestHandler::OnCertificateError (see issue #3148) 2022-08-09 15:43:00 -04:00
Marshall Greenblatt
7ce139bd2c chrome: cefclient: Fix crash on launch with --enable-chrome-runtime 2022-08-09 15:42:18 -04:00
Marshall Greenblatt
ecb29b7fa5 alloy: Fix OnCertificateError callback for requests redirected to HTTPS (fixes issue #3364)
This change also adds initial unit test coverage for OnCertificateError (see issue #3148).
2022-08-09 13:31:18 -04:00
Jelle Bleyaert
3b90a084b4 Linux: Fix Debug build v8_context_snapshot_generator failure (fixes issue #3371) 2022-08-08 17:13:18 +00:00
Marshall Greenblatt
21d714ab6e Fix issues with browser focus assignment (fixes issue #3306, fixes issue #3116, see issue #3040)
DesktopWindowTreeHostWin ("Chrome_WidgetWin_0") focus needs to be set
synchronously in response to the parent window WM_SETFOCUS message and
before the associated call to WebContents::Focus. See updated comments in
CefBrowserPlatformDelegateNativeWin::SetFocus.
2022-08-05 15:02:27 -04:00
Marshall Greenblatt
9f7a59536c windows: cefclient: Fix crash when triggering IME popup (see issue #3313) 2022-08-04 13:18:17 -04:00
Marshall Greenblatt
18dac30874 Support configuration of the CefTestServer certificate type (see issue #3348) 2022-08-04 12:37:12 -04:00
Marshall Greenblatt
dcd4a0077c Include net test data in the binary distribution (see issue #3348) 2022-08-03 16:28:52 -04:00
Marshall Greenblatt
46e1c4f177 ceftests: Add HSTS redirect test (see issue #3336, see issue #3348) 2022-08-03 12:14:51 -04:00
Marshall Greenblatt
952f2b0829 ceftests: Rename test_server::Observer::OnHttpRequest to OnTestServerRequest (see issue #3348) 2022-08-01 21:14:12 -04:00
Marshall Greenblatt
0b1c3938c6 ceftests: Fix CookieTest failure with --use-test-http-server (see issue #3348) 2022-08-01 21:09:02 -04:00
Marshall Greenblatt
a895274add ceftests: Add test_server support for CefTestServer (see issue #3348) 2022-08-01 16:20:04 -04:00
Marshall Greenblatt
f24dd61329 Add CefTestServer that supports both HTTP and HTTPS (see issue #3348) 2022-08-01 16:20:03 -04:00
Marshall Greenblatt
ce18bb98ab ceftests: Deprecate the use of test_server constants (see issue #3348) 2022-08-01 16:20:03 -04:00
Marshall Greenblatt
a4d63010c9 ceftests: Refactor test_server to support both HTTP and HTTPS servers (see issue #3348) 2022-08-01 16:20:03 -04:00
Marshall Greenblatt
68be2b8938 ceftests: Generalize the test_server::Observer interface (see issue #3348)
Don't expose CefServer implementation details to consumers.
2022-08-01 15:14:13 -04:00
Marshall Greenblatt
8353564d92 Move testonly support for UI input events to libcef_test_support 2022-07-29 20:15:10 -04:00
Marshall Greenblatt
27525523be Change the 'libcef_static' target type from static_library to source_set
Using a source_set here keeps the linker on Windows from discarding exported
compilation units that are not directly called from inside libcef_static.

This may also fix linker errors on Linux due to CEF's use of an intermediate
static library (see https://crbug.com/1319006#c2).
2022-07-29 12:21:21 -04:00
Marshall Greenblatt
bbc08e4f5e Fix minor style issues with request_impl.[cc|h] 2022-07-29 12:14:20 -04:00
Marshall Greenblatt
f148af1bd6 linux: Fix implicit conversion error on ARM [updated] (see https://crbug.com/1292951#c100) 2022-07-27 14:26:35 -04:00
Marshall Greenblatt
654f570b6e windows: Fix Views test failures (fixes issue #3365) 2022-07-27 13:57:53 -04:00
Marshall Greenblatt
a9043f2e80 Replace macros with C++17 features (see issue #3362)
- Convert ALLOW_UNUSED_LOCAL to [[maybe_unused]]
- Convert WARN_UNUSED_RESULT to [[nodiscard]]
2022-07-27 12:52:45 -04:00
Marshall Greenblatt
02d7a758fe linux: Fix implicit conversion error on ARM (see https://crbug.com/1292951#c100) 2022-07-26 13:37:48 -04:00
Marshall Greenblatt
5034749463 patcher: Skip missing platform-specific third-party directories 2022-07-26 13:37:47 -04:00
Marshall Greenblatt
9af494d36c Update to Chromium version 105.0.5195.0 (#1027018) 2022-07-25 23:47:56 -04:00
Marshall Greenblatt
e9f29ab3d6 Update to Chromium version 105.0.5176.0 (#1023155) 2022-07-22 13:31:29 -04:00
Marshall Greenblatt
5e753d211f Run TimeTest.InvalidBaseTimeToTime on Windows only (see issue #2935)
This test is failing on Linux and MacOS.
2022-07-22 13:31:29 -04:00
Marshall Greenblatt
3838536126 windows: Fix warning C4267 conversion from 'size_t' to 'int' (see issue #3126) 2022-07-19 10:09:36 -04:00
Marshall Greenblatt
4aef0ada9d Add missing newline at end of file (see issue #3126) 2022-07-19 10:09:35 -04:00
Marshall Greenblatt
03176b505c cmake: Switch to C++17 language standard (see issue #3362) 2022-07-19 10:09:35 -04:00
Dmitry Azaraev
27d3089804 Add CefBaseTime and use it instead of CefTime (see issue #2935) 2022-07-19 10:09:35 -04:00
Nik Pavlov
987b932a19 Fix compilation errors from shared message unit tests (see issue #3126) 2022-07-19 14:09:10 +00:00
Marshall Greenblatt
ba947d842a alloy: win: Focus the browser after dismissal of a modal dialog (fixes issue #3361) 2022-07-15 14:05:58 +03:00
Marshall Greenblatt
dad9bf87ef Stop using CefStructBase for POD types (fixes issue #3357) 2022-07-14 08:13:29 +00:00
Marshall Greenblatt
71ef10bb60 Don't copy dbghelp.dll/dbgcore.dll from the Windows SDK (fixes issue #3356) 2022-07-13 13:46:15 +03:00
Marshall Greenblatt
06acc9546f Increase frame reconnect timeout to 10 seconds (see issue #3260) 2022-07-13 12:17:19 +03:00
Marshall Greenblatt
cb02c23c32 alloy: Mac: Fix crash related to geolocation permissions (see issue #3352) 2022-07-08 14:37:58 +03:00
Marshall Greenblatt
c49ffa9723 Update libcef_dll_dylib.cc for compiler deduce types 2022-07-08 14:37:58 +03:00
Sergey Markelov
55cb9d9c1f libcef_dll/wrapper: Let the compiler deduce types of func ptr 2022-07-08 11:37:12 +00:00
Marshall Greenblatt
f1003df810 chrome: Add support for OnRequestMediaAccessPermission callback (see issue #2582) 2022-07-08 07:40:35 +00:00
Marshall Greenblatt
e4b9169221 Add CefPermissionHandler callbacks for permission prompts (see issue #3352) 2022-07-07 10:01:24 +00:00
Nik Pavlov
81e892d19e Add a shared memory variant of CefProcessMessage (fixes issue #3126)
CefSharedProcessMessageBuilder supports creation of a CefProcessMessage
backed by a CefSharedMemoryRegion.

Performance tests comparing the existing ArgumentList approach and the new
SharedMemoryRegion approach have been added to cefclient at
http://tests/ipc_performance.

CefMessageRouter has been updated to use SharedMemoryRegion as transport
for larger message payloads. The threshold is configurable via
|CefMessageRouterConfig.message_size_threshold|.

To test:
run `ceftests --gtest_filter=SendSharedProcessMessageTest.*:SharedProcessMessageTest.*:MessageRouterTest.Threshold*`
2022-07-04 09:49:15 +00:00
Jelle Bleyaert
a931d49f3e Fix duplicate symbol error on MakeVisibleOnScreenRect (fixes issue #3353) 2022-07-01 14:15:22 +00:00
Marshall Greenblatt
daa89115d5 Add OnMediaAccessChange notification (fixes issue #3310) 2022-06-30 12:22:28 +00:00
Nik Pavlov
0c6c44ba0b Use nothrow new when allocating memory for zip file data 2022-06-30 07:32:03 +00:00
Marshall Greenblatt
26e30b3859 Add CefPermissionHandler callback for media access (fixes issue #2582) 2022-06-30 07:31:18 +00:00
Nik Pavlov
d3a2237a5a alloy: mac: Fix default popup window positioning (see issue #3244)
Popup windows will be created on the display that best matches the requested
coordinates. The requested size will apply to the content area (as required by
JS documentation) and window size will be reduced if necessary to fit within the
target display. The requested origin will apply to the window (including frame)
and will be modified if necessary so that the window is fully visible on the
target display.

This change does not implement popup positioning for cefclient which uses an
application-created parent window.

This change grants access to the getScreenDetails JS API without user prompt.
2022-06-27 10:29:16 +00:00
Marshall Greenblatt
1ca4961b27 Windows: Fix AssertBlockingAllowed failure in GetAzureADJoinStateStorage (fixes issue #3342) 2022-06-23 13:59:09 +03:00
Marshall Greenblatt
95373bb042 Windows: Fix unresolved symbol for cef_sandbox build 2022-06-23 11:20:39 +03:00
Marshall Greenblatt
ec8076536e Fix timing issue with OnDraggableRegionsChanged
When bfcache is disabled use the RenderFrameObserver::DidFinishLoad notification
instead of the DidStopLoading notification that originates from the browser
process. During fast navigation the DidStopLoading notification may arrive in
the renderer after a new navigation has commenced and cause the wrong regions to
be reported.
2022-06-22 18:57:52 +03:00
Marshall Greenblatt
100b457743 Windows: Fix time_win.cc compile error with cef_sandbox 2022-06-22 11:17:06 +03:00
Marshall Greenblatt
c7ea0c5958 Update to Chromium version 104.0.5112.0 (#1012729)
- Mac: 10.13 is now the minimum required macOS version
2022-06-22 10:56:35 +03:00
Marshall Greenblatt
35654cd709 alloy: Use Chrome JS dialogs on Windows/Linux (fixes issue #3316) 2022-06-03 22:45:23 +03:00
Marshall Greenblatt
b5eba89598 cefclient: Linux: Fix OSR context menu placement (see issue #2640)
This only fixes the top-level menu placement. Sub-menus are still
placed incorrectly.
2022-06-03 22:45:10 +03:00
JohnKarel
d9b764860a alloy: Add touch handle and quick menu support for OSR (fixes issue #3268)
The client is responsible for rendering both as no default implementation
is currently available for OSR.
2022-05-30 10:51:39 +03:00
Marshall Greenblatt
771e5c7c0c ceftests: Replace unicode characters with encoded equivalent 2022-05-30 10:26:12 +03:00
Marshall Greenblatt
464efb1162 Call OnResourceRedirect for internal network service redirects (fixes issue #3336) 2022-05-25 16:43:30 +03:00
Marshall Greenblatt
ee15eca351 ceftests: Minor code cleanup 2022-05-25 16:42:41 +03:00
Marshall Greenblatt
cb83a7c3fd Windows: Fix time_win.cc compile error with cef_sandbox 2022-05-23 11:10:44 +03:00
Marshall Greenblatt
332d7f4ee1 patcher: Output actual executable name in error message 2022-05-20 19:39:32 +03:00
Marshall Greenblatt
bf168174d0 Set v8_enable_sandbox=false to avoid CefV8Value::CreateArrayBuffer crash (see issue #3332) 2022-05-20 19:39:32 +03:00
Marshall Greenblatt
185a908811 Update to Chromium version 103.0.5060.0 (#1002911) 2022-05-20 19:39:32 +03:00
Marshall Greenblatt
7a372a642b alloy: Use Views context menus on Windows/Linux (fixes issue #3330) 2022-05-20 14:15:17 +03:00
Marshall Greenblatt
2dcee2ccfc alloy: Disable ProxyErrorClient callbacks when extensions are disabled (fixes issue #2830) 2022-05-13 12:05:06 +03:00
Marshall Greenblatt
7702d96b33 Fix type conversion warning with GCC 10 (fixes issue #3324) 2022-04-28 16:40:49 -04:00
Marshall Greenblatt
b62dd2b6ee Update to Chromium version 102.0.5005.0 (#992738)
Linux: 32-bit x86 builds are no longer supported (see issue #2676).
2022-04-28 16:38:50 -04:00
Marshall Greenblatt
916360e2e5 Update to Chromium version 102.0.4997.0 (#990845)
- Windows: SDK version 10.0.20348.0 is now required.
- MacOS: SDK version 12.3 (Xcode 13.3) is now required.
- Legacy swiftshader binaries (`swiftshader/*` on Win/Linux and
  `libswiftshader_*.dylib` on MacOS) have been removed (see issue #3176).
2022-04-26 16:32:20 -04:00
Marshall Greenblatt
b318adddac Don't override Accept-Language header if set by the client (fixes issue #3139) 2022-04-20 14:49:21 -04:00
Marshall Greenblatt
c1b06ccee8 alloy: Delay creation of CefComponentExtensionResourceManager (see issue #3314)
This was causing early access to ResourceBundle on the main thread (via
webui::GetFontFamily) which resulted in crashes on Linux when running
with multi-threaded-message-loop.
2022-04-19 18:52:27 -04:00
Marshall Greenblatt
c04895b222 chrome: Implement GetWindowHandle() for --multi-threaded-message-loop (see issue #3294) 2022-04-19 18:52:26 -04:00
Marshall Greenblatt
2ea7459a89 Use Chrome file dialogs on all platforms and runtimes (fixes issue #3314)
All file dialogs irrespective of source, platform and runtime will now be
routed through CefFileDialogManager and trigger CefDialogHandler callbacks
(see issue #3293).

Adds Chrome runtime support for CefBrowserHost::RunFileDialog and
CefDialogHandler callbacks.

Adds Alloy runtime support for internal GTK file and print dialogs on Linux
subject to the following limitations:

1. Internal GTK implementation:
   - Cannot be used with multi-threaded-message-loop because Chromium's
     internal GTK implementation is not thread-safe (does not use GDK threads).
   - Dialogs will not be modal to application windows when used with off-screen
     rendering due to lack of access to the client's top-level GtkWindow.
2. Cefclient CefDialogHandler implementation:
   - Cannot be used with Views because it requires a top-level GtkWindow.

Due to the above limitations no dialog implementation is currently provided for
Views + multi-threaded-message-loop on Linux. In cases where both
implementations are supported the cefclient version is now behind an optional
`--use-client-dialogs` command-line flag.

Expressly forbids multiple simultaneous file dialogs with the internal platform
implementation which uses modal dialogs. CefDialogHandler will still be notified
and can optionally handle each request without a modal dialog (see issue #3154).

Removes some RunFileDialog parameters that are not supported by the Chrome file
dialog implementation (selected_accept_filter parameter, cef_file_dialog_mode_t
overwrite/read-only flags).
2022-04-19 18:52:26 -04:00
Nik Pavlov
edef01f579 Fix devtools_util_unittest.cc failures 2022-04-19 16:17:16 +00:00
Marshall Greenblatt
b1cd9d1598 win/linux: Use CursorLoader for loading cursor resources (see issue #3270)
Switch to using aura::CursorLoader which knows how to load system, non-system
and pak cursor resources.

On Windows, cursors will be loaded via LoadCursor first if available with a
fallback to pak file if necessary (like with component builds).

On Linux, all non-system cursor resources will be loaded from pak file. Cursors
may be loaded asynchronously resulting in the default (pointer) cursor being
returned on the first request.
2022-04-14 20:21:21 -04:00
Joshua Marler
d6b2b4b144 views: Fix ConvertPointFromPixel for fractional scaling (fixes issue #3312) 2022-04-14 22:30:32 +00:00
Marshall Greenblatt
cbf66a8077 views: Fix crash when clicking a draggable region (fixes issue #3311) 2022-04-14 15:12:23 -04:00
Marshall Greenblatt
fc82de7aa7 alloy: win: Fix range check for system cursors (fixes issue #3270) 2022-04-14 14:06:58 -04:00
Marshall Greenblatt
111b6de46c Fix cursor change notification for OOP iframes (fixes issue #3308) 2022-04-13 20:31:27 -04:00
maikesiwu
512e588e40 Use Uint32::NewFromUnsigned for unsigned values 2022-04-13 19:07:31 +00:00
Marshall Greenblatt
4921dc2213 Fix unintentional state transfer in DetachToUserFree (fixes issue #3309)
Calling DetachToUserFree() on a CefString holding a reference should copy the
value instead of transferring ownership.

A new `StringTest.Ownership` test has been added for this behavior.
2022-04-13 14:33:25 -04:00
Marshall Greenblatt
d8db6fa9da mac: cefclient: Use RootWindowManager to track key window status (fixes issue #3307)
This change provides a generic solution for active (key) window tracking that
works with both Views-hosted and native windows on MacOS. With this new approach
we can now successfully route top menu actions to the currently active window.

Prior to this change CEF's Views API was using focus notifications as a proxy
for window activation notifications. That doesn't work on MacOS where NSWindow
activation (key status) is independent of NSView focus (first responder) status,
and changes in activation don't necessarily generate focus notifications (see
NativeWidgetMac::OnWindowKeyStatusChanged). To make this work reliably on all
platforms we now expose a CefWindowDelegate::OnWindowActivationChanged callback.

This change also fixes an uninitialized variable
(RootWindowMacImpl::with_extension_) that was causing flaky behavior in
RootWindowManager::OnRootWindowActivated.

To test:
1. Run `cefclient [--use-views]`
2. Select Popup Window from the Tests menu. Do not explicitly activate the popup
   window (e.g. don't click on it).
3. Verify that further Tests menu actions go to the popup window.
4. Change activation to a first window by clicking on it. Verify that Test
   menu actions go to that window.
5. Close the currently active window. Do not explicitly activate the remaining
   window (e.g. don't click on it).
6. Verify that Test menu actions go to the only remaining window.
2022-04-12 16:37:01 -04:00
Nik Pavlov
493232ce5a alloy: mac: Fix default popup window positioning (see issue #3244)
Popup windows will be created on the display that best matches the requested
coordinates. The requested size will apply to the content area (as required by
JS documentation) and window size will be reduced if necessary to fit within the
target display. The requested origin will apply to the window (including frame)
and will be modified if necessary so that the window is fully visible on the
target display.
2022-04-12 17:12:16 +00:00
Marshall Greenblatt
17cb26b8b9 Remove compile-time checks for toolkit_views
The toolkit_views=true setting is supported (and now required) on all platforms.
2022-04-12 12:06:53 -04:00
Marshall Greenblatt
a0a7a35fe2 chrome: Change popup default behavior with native parent (see issue #3294)
When using a Views-hosted browser window the client receives Views-related
callbacks for popups and can thereby customize the Views-hosted popup behavior.
When using an external parent window no Views-related callbacks are delivered
and customization options are restricted to providing a new parent handle via
OnBeforePopup. Consequently, we should default to a normal browser window in
the external parent case instead of the very minimial Views-hosted default.

To test (A):
1. Run `cefclient --use-default-popup --enable-chrome-runtime --use-native`
2. Select Tests > Popup Window
3. Get a normal Chrome browser window

To test (B):
1. Run `cefclient --use-default-popup [--enable-chrome-runtime] [--use-views]`
2. Select Tests > Popup Window
3. Get a native or Views-hosted browser window with title bar only
2022-04-12 12:06:52 -04:00
Marshall Greenblatt
75ca552a4e cefclient: Add option to create default popups (see issue #3165, see issue #3294)
This change adds a `--use-default-popup` command-line option to cefclient. When
specified, popup windows will be created with default styling (e.g. without an
application-provided native parent window).

This change also adds some reasonable default window bounds in cases where they
are not specified by the client.
2022-04-12 11:49:27 -04:00
Marshall Greenblatt
3000bc8748 chrome: win/linux: Add support for browser with native parent (see issue #3294)
This change adds Chrome runtime support on Windows and Linux for creating a
browser parented to a native window supplied by the client application.
Expected API usage and window behavior is similar to what already exists with
the Alloy runtime. The parent window handle should be specified by using
CefWindowInfo::SetAsChild in combination with the CefBrowserHost::CreateBrowser
and CefLifeSpanHandler::OnBeforePopup callbacks.

The previously existing behavior of creating a fully-featured Chrome browser
window when empty CefWindowInfo is used with CreateBrowser remains unchanged
and Views is still the preferred API for creating top-level Chrome windows
with custom styling (e.g. title bar only, frameless, etc).

The cefclient Popup Window test with a native parent window continues to crash
on Linux with both the Alloy and Chrome runtimes (see issue #3165).

Also adds Chrome runtime support for CefDisplayHandler::OnCursorChange.

To test:
- Run `cefclient --enable-chrome-runtime [--use-views]` for the default (and
  previously existing) Views-based behavior.
- Run `cefclient --enable-chrome-runtime --use-native` for the new native
  parent window behavior.
- Run `cefclient --enable-chrome-runtime --use-native --no-activate` and the
  window will not be activated (take input focus) on launch (Windows only).
- Run `cefclient --enable-chrome-runtime [--use-views|--use-native]
  --mouse-cursor-change-disabled` and the mouse cursor will not change on
  mouseover of DOM elements.
2022-04-12 11:49:26 -04:00
Marshall Greenblatt
5f4bccd672 Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue #3294)
This impacts both Alloy and Chrome runtimes when using a native parent window.
2022-04-11 13:11:08 -04:00
Marshall Greenblatt
0428438e72 mac/linux: Use python3 for .sh scripts
Newer OS versions no longer ship with Python 2 by default.
2022-04-08 11:38:12 -04:00
Marshall Greenblatt
21cf732e7f chrome: Update expectations with same-site BFCache enabled (fixes issue #3301)
With same-site BFCache enabled every navigation can now potentially be served
via the BFCache. To support this internally a new top-level RenderFrame object
may be created for each new navigation. As a result, OnBrowserCreated may now
be called multiple times with the same browser ID in a given renderer process
(a behavior previously only seen with cross-site navigations and different
renderer processes).

BFCache navigations do not trigger the same Chromium notifications as a normal
load. To avoid breaking CEF API usage expectations we now synthetically
generate the load-related callbacks that would otherwise be missing
(OnLoadingStateChange with isLoading=true, OnLoadStart, OnLoadEnd). The
|httpStatusCode| argument to OnLoadEnd will be 0 in this case.

To test:
- Run `FrameHandlerTest.*:MessageRouterTest.*:NavigationTest.*`
- Run `NavigationTest.LoadSameOriginLoadURL` for OnBrowserCreated behavior.
- Run `NavigationTest.History` for load-related callback behavior.
2022-04-05 15:30:30 -04:00
Marshall Greenblatt
a3b1dc01ea Set dcheck_always_on=false for cef_sandbox Release builds (fixes issue #3302) 2022-03-31 16:16:48 -04:00
Marshall Greenblatt
b524edc209 Update to Chromium version 101.0.4951.0 (#982481)
Known issues:
- chrome: Some ceftests are failing due to bfcache same-site enabled by default
  (see issue #3301)
2022-03-30 19:54:09 -04:00
Marshall Greenblatt
77466e7b6d alloy: Use chrome's value for ApplicationClientIdForFileScanning (fixes issue #3030)
This change removes CefSettings.application_client_id_for_file_scanning in
favor of always using the same hard-coded value as chrome.
2022-03-24 12:16:11 -04:00
Marshall Greenblatt
e43d2054d1 Increase priority of the EndTracing task (fixes issue #3288)
Use a priority that is guaranteed to execute in a reasonable amount of time.
2022-03-23 17:31:09 -04:00
Marshall Greenblatt
9d52d72ae5 chrome: Add support for persist_session_cookies (fixes issue #3291)
This change configures session restore behavior for the NEXT application
restart by setting the "session.restore_on_startup" preference based on the
[CefSettings|CefRequestContextSettings].persist_session_cookies value.
2022-03-22 20:49:20 -04:00
Marshall Greenblatt
5ec45e5f7f patcher: Improve error message for failed patches 2022-03-22 19:10:36 -04:00
Marshall Greenblatt
6d7a680187 Add permission callback for user-initated downloads (fixes issue #3183)
This change adds a CefDownloadHandler::CanDownload callback for optionally
blocking user-initiated downloads (e.g. alt + link click or link click that
returns a `Content-Disposition: attachment` response from the server).

To test:
- Run `ceftests --gtest_filter=DownloadTest.*`.
- Run `cefclient --hide-controls`. User-initiated downloads will be blocked.
2022-03-22 17:46:44 -04:00
Marshall Greenblatt
2f5838eaaa chrome: Add ability to handle chrome menu/keyboard commands (fixes issue #3280)
This change adds a CefCommandHandler::OnChromeCommand callback for optionally
handling Chrome commands triggered via menus or keyboard shortcuts. Supported
command IDs are listed in a new cef_command_ids.h header file.

To test: Run `cefclient --enable-chrome-runtime --hide-controls`. Most commands
will blocked and removed from context menus.
2022-03-22 15:11:47 -04:00
Marshall Greenblatt
13ca38e4e0 chrome: Fix assertions when showing the incognito data dialog
This dialog is displayed by (for example) pressing ctrl+h to open the history
page while in incognito mode.
2022-03-22 12:39:17 -04:00
Marshall Greenblatt
4615fffafb chrome: Add setting for controlling the status bubble (fixes isse #3279)
This change adds `CefBrowserSettings.chrome_status_bubble` for controlling
whether the Chrome status bubble will be used.

Testable in cefclient by passing the `--hide-chrome-status-bubble`
command-line flag.
2022-03-21 17:25:40 -04:00
Marshall Greenblatt
1eab4322f8 crash_server: Fix assertion when downloading files with larger chunk sizes 2022-03-18 15:10:57 -04:00
Marshall Greenblatt
c38d62b233 Linux: Migrate from breakpad to crashpad (see issue #3249)
Renderer process crashes are currently only reported with `--no-sandbox`.
2022-03-17 15:34:49 -04:00
Marshall Greenblatt
8fc6aced6c Fix DevTools crash due to unknown .md mime type (fixes issue #3278) 2022-03-15 13:06:58 -04:00
Marshall Greenblatt
3474e7abc1 chrome: Fix shutdown crashes with multi-threaded-message-loop (fixes issue #3277) 2022-03-09 15:12:24 -05:00
Marshall Greenblatt
a513e01b01 Fix shutdown crash in RenderProcessHostImpl::Cleanup (fixes issue #3276)
Execute all pending UI thread tasks at the beginning of the shutdown sequence.
2022-03-09 13:59:07 -05:00
Marshall Greenblatt
113a96be0d alloy: Fix PDF download 'With your changes' (fixes issue #3169) 2022-03-04 13:56:30 -05:00
Marshall Greenblatt
705b6ec15c alloy: Fix print preview Save as PDF (fixes issue #2867) 2022-03-04 13:15:20 -05:00
Cristian Amarie
7945baf640 alloy: Fix crash when downloading a modified PDF form (see issue #3169)
Create a CefFileSystemDelegate based on the ShellFileSystemDelegate placeholder
implementation. An actual implementation will still be required to properly
support this download functionality.
2022-03-02 15:16:09 -05:00
Jelle Bleyaert
3c2e97d82e Adding ClearFilenames method to CefDragData (fixes issue #3266) 2022-03-02 19:44:16 +00:00
Jupiter
0cb874c9e1 Update link to Chromium C++ style guide in README 2022-03-01 18:13:57 -05:00
Marshall Greenblatt
fcf5dd036d Fix typo in cef_audio_handler.h 2022-03-01 18:13:56 -05:00
Hunter Laux
477ab61e3b Fix std::result_of deprecation error in C++17 (fixes issue #3194) 2022-02-24 17:34:10 +00:00
Marshall Greenblatt
d24ea7572f Disable histogram bad minimum warning (see https://crbug.com/1288842#c29) 2022-02-22 19:22:39 -05:00
Marshall Greenblatt
f97f0bbda6 Update to Chromium version 100.0.4896.0 (#972766) 2022-02-22 19:22:39 -05:00
Sergey Markelov
a2c621bf8b Fix documentation typo in cef_sandbox_win.h 2022-02-18 21:58:50 +00:00
Marshall Greenblatt
4014be78dc Include PDF resource IDs in cef_pack_resources.h (fixes issue #3172) 2022-02-18 16:56:15 -05:00
Marshall Greenblatt
bee82b6ac3 Update context menu type enums to match Chromium (fixes issue #3257) 2022-02-18 16:44:37 -05:00
Marshall Greenblatt
28c7f04001 Delete cef_web_plugin.h and plugin-related APIs (see issue #3047)
This functionality 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 (PdfUnseasoned) in M100.
2022-02-18 16:23:11 -05:00
Marshall Greenblatt
dc0a45d429 alloy: Fix printing of PDF viewer (see issue #3047)
Match the logic for printing::StartPrint() used by Chrome.
2022-02-18 11:37:27 -05:00
Marshall Greenblatt
171d525aa4 alloy: Implement Find() using find_in_page::FindTabHelper (fixes issue #3098, see issue #3047)
The find behavior should now match Chrome.
2022-02-17 13:59:25 -05:00
Sergey Markelov
758022006a Update include/ files for strict C function prototypes 2022-02-17 12:54:16 -05:00
Sergey Markelov
8bfcbeaf48 Update generated files for strict C function prototypes 2022-02-17 12:46:38 -05:00
Sergey Markelov
8410b1383f Use strict C function prototypes
This fixes warnings when compiling with `-Wstrict-prototypes`.

Functions with empty parameter lists behave differently in C and C++:
- void func() in C is same as void func(...) in C++.
- void func() in C++ is same as void func(void) in C.
2022-02-17 12:46:38 -05:00
Sergey Markelov
ce891b57e1 Update generated files for check C API structure sizes (fixes issue #3238) 2022-02-17 12:46:38 -05:00
Sergey Markelov
5c0895e27f Check C API structure sizes before copying values to C++ classes (fixes issue #3238) 2022-02-17 12:46:38 -05:00
Marshall Greenblatt
db9298fd3e chrome: Disable Chrome WebUI factory registration (see issue #3047)
Disable the initial Chrome factory registration in ChromeBrowserMainParts
so that all WebUI loading goes through CefWebUIControllerFactory.
2022-02-16 18:28:15 -05:00
Marshall Greenblatt
d43c3091b2 Revert "chrome: Simplify WebUIControllerFactory registration (see issue #3047)"
Still need to unregister the Content-level factory to stop Alloy loading
unsupported pages.

This reverts commit a21d0c41a4.
2022-02-16 18:28:08 -05:00
Marshall Greenblatt
32ebbd60f9 chrome: Simplify WebUIControllerFactory registration (see issue #3047)
Disable the initial Chrome factory registration in ChromeBrowserMainParts
instead of trying to unregister those factories at a later point.
2022-02-16 18:11:45 -05:00
Marshall Greenblatt
883b4af51d Fix incorrect patch of constrained_web_dialog_ui.cc 2022-02-16 17:48:35 -05:00
Marshall Greenblatt
efc0a67e00 alloy: Add support for chrome-untrusted scheme (see issue #3047)
Lack of this functionality was causing print preview to fail with
PdfUnseasoned enabled.
2022-02-16 17:48:28 -05:00
Marshall Greenblatt
71727464b8 Add support for the chrome-untrusted scheme (see issue #3047)
Lack of this functionality was causing print preview to fail with
PdfUnseasoned enabled.
2022-02-16 17:48:20 -05:00
Marshall Greenblatt
5c1d5c1f06 Update remote-debugging-port documentation
Use chrome://inspect for remote debugging. The localhost server landing
page is currently deprecated and will be removed in M100 (see
https://crbug.com/1232509#c25).
2022-02-16 15:17:20 -05:00
Marshall Greenblatt
3d1bbaf54f Support reconnect of the mojo frame channel (fixes issue #3260)
The mojo channel used for frame communication may disconnect for a variety of
reasons including frame navigation, frame destruction, or insertion into the
BackForwardCache (when the browser-side frame representation is destroyed and
closes the connection). When disconnect occurs we now evaluate the situation
and reconnect if appropriate.

Connections are now initiated solely from the renderer process and the
RenderFrame is passed as an argument to FrameAttached() instead of being
retrieved independently. Messages are queued while the frame is disconnected
and sent only after FrameAttachedAck() is received from the browser process.
The renderer process will be crashed intentionally with a "connection retry
failure" message if the reconnect fails 3 times in a row.
2022-02-14 20:31:04 -05:00
Marshall Greenblatt
80caf947f3 Fix includes path for Linux ARM cross-compile (see issue #2926) 2022-02-09 16:54:54 -05:00
Jun Tseng
086848a7ad Fix incorrect then/than usage in docs 2022-02-09 16:54:49 +00:00
Marshall Greenblatt
a74b66352e Make cef_config.h discoverable from patched Chromium targets (see issue #2926)
Add the generated includes/ directory to CEF's "config" so that source files
included in patched Chromium targets (for example, blink_glue.cc) can find
cef_config.h which will be included via `include/internal/cef_types_linux.h`
on Linux.
2022-02-08 14:03:49 -05:00
Marshall Greenblatt
4f2b7f1829 Remove cef_config.h from cef_paths2.gypi (see issue #2926) 2022-02-05 00:47:45 +00:00
Marshall Greenblatt
eabf93f6cf Make cef_config.h generation a dependency of libcef_dll_wrapper (see issue #2926)
The libcef_dll_wrapper target may be built very early due to minimal
dependencies. Make sure that cef_config.h is generated first as it will be
included via `include/internal/cef_types_linux.h` on Linux.
2022-02-02 15:24:21 -05:00
Marshall Greenblatt
4adc23a52a alloy: Fix extension function registration for print preview dialog (fixes issue #3167) 2022-02-02 15:24:14 -05:00
Marshall Greenblatt
9667789621 Generate cef_config.h as a build-time step (fixes issue #2926) 2022-02-02 12:40:41 -05:00
Marshall Greenblatt
9eb0954cde alloy: Move ExtensionsBrowserClient ownership to BrowserProcess (fixes issue #3247)
Fixes a shutdown crash due to `ExtensionsBrowserClient::Set(nullptr)` being
called too early. Some code that may occasionally be triggered via
`content::ContentMainShutdown()` is expecting the extensions objects to still
be valid.

This new ownership pattern matches the code in chrome/.
2022-02-02 12:40:31 -05:00
Marshall Greenblatt
81e7748fb5 Remove DCHECK that triggers while loading DevTools resources
See https://crbug.com/1289230 for background.
2022-01-28 12:13:29 -05:00
Marshall Greenblatt
303280dd71 alloy: Fix shutdown assert if OneShotTimer is deleted on the wrong thread 2022-01-26 21:10:29 -05:00
Marshall Greenblatt
1e1133ec66 Update to Chromium version 99.0.4844.0 (#961656) 2022-01-26 21:10:29 -05:00
Marshall Greenblatt
c32f366dfa Migrate ignore_result to std::ignore (see issue #3234)
See https://crbug.com/1285085 for background.
2022-01-25 14:40:53 -05:00
Marshall Greenblatt
ebde595370 Convert defined(OS_XXX) to BUILDFLAG(IS_XXX) in libcef
See https://crbug.com/1234043 for background.
2022-01-24 12:58:04 -05:00
Shezan Baig
7b0bb931b1 Fix notification for focused frame (fixes issue #3248) 2022-01-24 16:13:32 +00:00
Marshall Greenblatt
51e8bd9bd8 chrome: Fix crash when clicking Reading List sidebar link (fixes issue #3128) 2022-01-14 13:52:56 -05:00
Marshall Greenblatt
9276dba712 cefclient: Disable alert on space bar press (see issue #3184)
This will be reverted after issue #3184 is resolved.
2022-01-14 12:15:26 -05:00
Nick Mueller
029cc67915 Fix OSR resize issue when multiple monitors have different scale factors (fixes issue #3240) 2022-01-14 12:04:38 -05:00
Marshall Greenblatt
17d51ceed0 Revert "Fix OSR resize issue when multiple monitors have different scale factors (fixes issue #3240)"
This reverts commit 9e416a7921.

Reverted due to compile error.
2022-01-14 12:04:06 -05:00
Nick Mueller
9e416a7921 Fix OSR resize issue when multiple monitors have different scale factors (fixes issue #3240) 2022-01-14 16:50:23 +00:00
Marshall Greenblatt
031c8a7f52 chrome: Fix crashes when toggling full-screen mode (fixes issue #3182) 2022-01-12 18:11:27 -05:00
Marshall Greenblatt
2428b35f6c alloy: Disable bfcache (see issue #3237)
This will be reverted if the bfcache issue is fixed.
2022-01-10 17:32:22 -05:00
Marshall Greenblatt
ff0e5c0348 Fix possible use after shutdown of BrowserContext (fixes issue #3193) 2022-01-10 17:21:07 -05:00
Marshall Greenblatt
839fdb211c Fix certificate errors with restarted/redirected requests (fixes issue #3200)
URLLoaderNetworkServiceObserver is used for routing certificate and
authentication callbacks from the NetworkService to the associated
StoragePartition instance. With request interception enabled this object was
previously only assigned for the initial request. This change adds assignment
for restarted/redirected requests as well.
2022-01-06 20:53:00 -05:00
Marshall Greenblatt
2b9a06933b Update copyright year in generated files 2022-01-06 13:34:35 -05:00
Marshall Greenblatt
2f5e1b621e Mac: Use system allocator instead of PartitionAlloc (fixes issue #3061)
This change disables PartitionAlloc and the related allocator shim. Using the
system allocator makes it easier to integrate with client applications which
may perform allocations before initializing CEF.
2021-12-18 15:57:49 -05:00
Marshall Greenblatt
dfc0131516 Update to Chromium version 98.0.4758.0 (#950365) 2021-12-18 15:57:34 -05:00
Marshall Greenblatt
b76badd958 Remove DISALLOW_ macro from include/ (see issue #3234)
Also perform related C++ cleanup:
- Use =default instead of {} for default implementations of
  constructors/destructors.
- Replace typedef with using.
2021-12-07 15:02:28 -05:00
Marshall Greenblatt
1eb55cbba8 Remove DISALLOW_ macro from libcef_dll/ (see issue #3234)
Also perform related C++ cleanup:
- Use =default instead of {} for default implementations of
  constructors/destructors.
- Replace typedef with using.
2021-12-07 15:02:28 -05:00
Marshall Greenblatt
9484d6528c Remove DISALLOW_ macro from libcef/ (see issue #3234)
Also perform related C++ cleanup:
- Use =default instead of {} for default implementations of
  constructors/destructors.
- Replace typedef with using.
2021-12-07 15:02:28 -05:00
Marshall Greenblatt
83ffc1f00d Add kPdfRenderer define for non-Windows platforms (see issue #3047)
This switch is currently only defined for Windows in
content/public/common/content_switches.h.
2021-12-02 12:37:02 -05:00
Marshall Greenblatt
f4d5395c4b Skip GetNewBrowserInfo call for PDF renderer processes (see issue #3047)
With PdfUnseasoned the PDF file will be loaded in a dedicated renderer process.
We identify this process by adding the kPdfRenderer command-line flag (similar
to how kExtensionProcess is used to identify an extension renderer process). We
then avoid calling GetNewBrowserInfo for the PDF renderer process because we
know the request will otherwise time out.
2021-11-29 15:46:39 -05:00
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
d6d316e304 Fix discontinued/outdated External Projects links (fixes issue #3225) 2021-11-23 11:50:32 -05:00
Sarah
833612ba9a Prevent possible null dereference in ctocpp_ref_counted.h (fixes issue #3218) 2021-11-22 15:28:06 +00: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
8e39ae2703 Windows: Add abseil-cpp deps to cef_sandbox.lib
Now required due to https://crrev.com/504881812c adding a //base/metrics
dependency on absl::Mutex.
2021-11-16 14:22:58 -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
4c7ac2dddd cmake: Require version 3.19 or newer for VS2019 and Xcode 12+ support 2021-11-08 15:28:43 -05:00
Marshall Greenblatt
088816d496 Fix writing of files from DevTools (fixes issue #3211) 2021-11-08 15:05:28 -05:00
Marshall Greenblatt
463ca625e1 Linux: Load Ozone EGL binaries from DIR_ASSETS (fixes issue #3213) 2021-11-08 14:29:31 -05:00
Marshall Greenblatt
2c9055a8bd Windows: Fix crash when |sandbox_info| parameter is nullptr (fixes issue #3210) 2021-11-08 14:18:25 -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
fae1402a6e Mac: cefclient: Fix crash when quitting from the top menu (fixes issue #3201) 2021-10-22 18:36:25 -04:00
Marshall Greenblatt
aa1399f790 Mac: Document Xcode 13.0 support 2021-10-22 18:27:03 -04:00
Marshall Greenblatt
17e6d41366 Windows: Fix cef_sandbox compile error due to missing include. 2021-10-22 17:04:24 -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
07bc800f00 Remove deprecated base::Bind APIs (see issue #3140)
This CL removes the following deprecated APIs:

- base::Bind()
- base::Callback
- base::Closure
- base::CancelableCallback
- base::CancelableClosure

The behavior that these APIs provided is still available using the *Repeating*
variants. However, consider strongly whether using these variants is actually
necessary in your case or whether the *Once* variants will suffice: unless your
callback *objects* (note: not variables!) need to be called multiple times,
they most likely can and should be the Once variants.

This applies the same changes as https://crrev.com/6cc94b5339.
2021-10-05 15:10:14 +03: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
Marshall Greenblatt
62a9f00bd3 Return display_name from CefDragData::GetFileNames if available
When dropping from Microsoft 365 Outlook the path will be "temp.tmp"
while display_name contains the original file name.
2021-10-04 14:57:20 +03:00
Alex Maitland
eabdf3a2ca alloy-win: Disable the WinUseBrowserSpellChecker feature (see issue #3055)
Workaround until support for the Windows 10+ spellcheck service is added for
the Alloy runtime.
2021-10-04 10:02:05 +00: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
4767130954 Windows: Fix VS2019 warning C4458: declaration of 'bounds' hides class member (see issue #1515) 2021-10-01 12:05:55 +03:00
Marshall Greenblatt
582e0a0ab7 Distribute binaries for SwANGLE support (fixes issue #3176)
Adds SwANGLE libraries that are required for software rendering on Windows
and Linux. Updates README.txt documentation accordingly.
2021-09-30 21:22:59 +03:00
Marshall Greenblatt
e63e6b110b Windows: Update d3dcompiler_47.dll to version 10.0.20348.1
Updated to match the DLL version that currently ships with Chrome.
Binaries from https://chromium.woolyss.com/download/en/.

Chromium will load the bundled version of the DLL by default (see
https://crbug.com/920704#c136).
2021-09-30 21:13:49 +03: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
4d1c5ebdd2 Fix CefCommandLine character case requirements (fixes issue #1872)
Switch names will now be converted to lowercase ASCII on all platforms.
Switch values will retain the original case and UTF8 encoding.
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
a74fa88812 Linux: Fix PrintToPDF crash (fixes issue #3178) 2021-09-23 06:01:24 -07: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
Marshall Greenblatt
2b40cab3fe Update cef_api_hash.h 2021-09-22 14:23:48 +03:00
Martin Falk
d4a2f72d10 Use absolute namespace in cef_logging.h (fixes issue #3185) 2021-09-22 14:09:54 +03:00
Aviv Duek
0cbc0a757e Add two missing resource types to cef_resource_type_t enum 2021-09-22 14:09:53 +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
Alex Maitland
28599ae1a5 alloy: win: Fix loading of some mouse cursors (fixes issue #3174) 2021-09-22 09:17:27 +00:00
Marshall Greenblatt
0cee138670 views: cefclient: Add missing <algorithm> include for std::max 2021-09-22 12:08:59 +03:00
Marshall Greenblatt
1eba937874 views: cefclient: Fix VS2019 compile error 2021-09-22 12:08:59 +03: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
Josip Sokcevic
0a10fd4506 Update automate-git script to use main branch (fixes issue #3141)
chromium/src now has main as the default branch, and has
Cr-Commit-Position with main ref too.
2021-09-17 12:48:21 +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
0fa40110e3 Linux: Fix ld.lld: error: relocation R_X86_64_TPOFF32 cannot be used with -shared 2021-08-24 17:43:02 -04:00
Marshall Greenblatt
92f67ee847 Check in fused GTest files
The fuse_gtest_files.py script was removed from GTest in
https://github.com/google/googletest/commit/47f819c3ca.
Consequently we can no longer generate these files at runtime.
2021-08-24 17:43:02 -04: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
cfdec92624 Fix ExecuteJavaScript failure with null CefRenderProcessHandler (see issue #2421)
When CefApp::GetRenderProcessHandler returned null
CefRenderFrameObserver::DidCreateScriptContext was returning early (not
calling CefFrameImpl::OnContextCreated) and consequently queued actions
such as JavaScript were never executed.
2021-08-18 18:08:00 -04:00
Marshall Greenblatt
b4ab321a79 Remove unicode character from cef_bind_internal.h
This can cause compile errors on non-English Windows versions.
2021-08-16 13:22:39 -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
f435c3af9e Linux: Update user data path docs (see issue #3149) 2021-08-11 13:15:03 -04:00
Marshall Greenblatt
ee090039c7 Mac: Update CFBundleIdentifier for the CEF framework 2021-08-11 12:38:43 -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
39dbdf8ddb Mac: ceftests: Fix component build error due to unresolved symbols 2021-07-30 13:27:24 -04:00
Marshall Greenblatt
a94e113410 Win/Mac: Generate build configs for the native host architecture by default (see issue #2773, see issue #2981)
When building on an ARM64 host the ARM64 configs (arm64) will be generated by
default and the AMD64 configs (x86,x64) will only be generated if the
CEF_ENABLE_AMD64=1 env variable is set.

When building on an AMD64 host the AMD64 configs (x86,x64) will be generated by
default and the ARM64 configs (arm64) will only be generated if the
CEF_ENABLE_ARM64=1 env variable is set.
2021-07-29 13:41:07 -04:00
Marshall Greenblatt
0cfa65b48c Fix gclient vpython3 install error on automated builders (see https://crbug.com/1231439) 2021-07-28 12:13:16 -04:00
Marshall Greenblatt
6f819707b0 chrome: Linux: Fix ceftest DraggableRegionsTest.DraggableRegions failure (see issue #2969) 2021-07-27 19:03:21 -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
campersau
1ffa5528b3 Windows: cefclient: Map Shift+Ctrl+Alt to Shift+AltGr for OSR (see issue #3026) 2021-07-19 15:55:43 +00:00
Vladislav
2be59f6edd Translate additional CEF modifiers to EF_* flags (see issue #2597) 2021-07-19 15:52:36 +00:00
Marshall Greenblatt
103fe12b72 Linux: Fix SchemeHandlerTest.Custom*StandardNoResponse test failures 2021-06-24 20:55:29 -04:00
Marshall Greenblatt
7efac13ac1 gtest: Add plugin for TeamCity integration
Automatically report unit tests to the TeamCity server if run within TeamCity.
See tests/gtest/teamcity/README.cef for details.

To test: Set the TEAMCITY_PROJECT_NAME environment variable and run ceftests.
2021-06-24 17:00:21 -04:00
Marshall Greenblatt
50f627b07e cmake: Windows: Fix ceftests ARM64 unresolved external symbol GetDeviceCaps (see issue #2773, see issue #3140) 2021-06-23 13:27:42 -04:00
Marshall Greenblatt
28c9e9db35 Update distribution build requirements (see issue #3140) 2021-06-23 13:00:34 -04:00
Marshall Greenblatt
9efd3dc8ee Fix compile errors with VS2019 v16.9.3 and GCC v7.5.0 (see issue #3140) 2021-06-23 13:00:34 -04:00
Marshall Greenblatt
529b91bc6e tests: Convert usage of base::Bind to Once or Repeating (see issue #3140) 2021-06-19 17:19:32 -04:00
Marshall Greenblatt
ed1840ddb5 wrapper: Convert usage of base::Bind to Once or Repeating (see issue #3140) 2021-06-19 15:35:12 -04:00
Marshall Greenblatt
cc2759d07e Add base::OnceClosure support in cef_closure_task.h (see issue #3140) 2021-06-18 14:19:11 -04:00
Marshall Greenblatt
3545e20b01 ceftests: Don't use base::Bind in object constructor (see issue #3140)
Fixes the following error:
[FATAL:cef_bind_internal.h(868)] Check failed: receiver->HasAtLeastOneRef().
base::Bind{Once,Repeating}() refuses to create the first reference to ref-counted
objects. That typically happens around PostTask() in their constructor, and such
objects can be destroyed before `new` returns if the task resolves fast enough.
2021-06-18 13:42:32 -04:00
Marshall Greenblatt
6a1c641f75 Rename 'subtle' namespace to fix duplicate symbol errors (see issue #3140) 2021-06-18 13:42:32 -04: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
5d438ced79 cmake: Update to -std=c++14 (see issue #3140) 2021-06-17 20:47:13 -04:00
Marshall Greenblatt
43f9baa23a Update include/base headers for C++11/14 (see issue #3140)
See the issue for update guidelines.
2021-06-17 20:47:12 -04:00
Marshall Greenblatt
6d80ec69d7 Replace OVERRIDE with override (see issue #3140) 2021-06-17 16:16:53 -04:00
Matthew Isaacs
9c7367bd4e widevine: Add arm64 arch manifest value (see issue #2981) 2021-06-17 14:07:27 +00: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
b7ef08ca84 widevine: Fix VP9 version string for v4.10.2209.0 (fixes issue #3138) 2021-06-14 14:47:17 -04:00
Marshall Greenblatt
2432333f98 Windows: Allow non-component Debug official sandbox builds (see issue #2679) 2021-06-11 20:54:30 -04:00
Marshall Greenblatt
571911730a Use Chromium code for cookie date validity check (fixes issue #2927) 2021-06-11 12:37:08 -04: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
de46befc18 Windows: Forbid non-component Debug builds (see issue #2679) 2021-06-11 11:52:44 -04:00
Marshall Greenblatt
ba46b8c53e Fix CefBrowser::GetMainFrame assumptions in the renderer process (see issue #2421)
ClientAppRenderer::Delegate callbacks are executed for all tests. In this case
CorsTest.IframeAllowScriptsCustomNonStandardSchemeToServer was crashing on Linux
because CefBrowser::GetMainFrame() returns nullptr in the renderer process when
called from a cross-origin sub-frame.
2021-06-10 16:42:45 -04:00
Marshall Greenblatt
9353f9b28b Mac: Fix Xcode 12.5 build errors related to implicit copy assignment operators 2021-06-10 16:42:45 -04:00
Marshall Greenblatt
992479d5a8 Mac: Don't enable dSYMs by default for non-offical builds
Building with dSYMs enabled results in substantially longer link times and
provides minimal benefit for builds that are not intended for distribution.

They can still optionally be enabled by setting enable_dsyms=true via
GN_DEFINES. They remain enabled by default for official builds generated
with is_official_build=true and are required if packaging symbols via the
make_distrib.py script.
2021-06-10 16:42:45 -04:00
Marshall Greenblatt
5a622c22b5 Mac: Fix flaky ResourceRequestHandlerTest failures
The AbortAfterCreated and AbortBeforeBrowse tests were flaking due to a race
between request handling and browser close. The tests would fail if the request
handling completed first.
2021-06-10 16:42:45 -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
ecbeca36e7 Mac: Fix compile error due to multiply defined type (see issue #2421) 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
f2f52c1e2c Fix compile error due to missing include (see issue #2421) 2021-05-31 19:18:33 -04:00
Marshall Greenblatt
f3ddec372f chrome: Fix ResourceRequestHandlerTest failures (see issue #2969) 2021-05-31 18:58:27 -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
Marshall Greenblatt
5ddd26e483 Restore support for CreateBrowserSync with NULL |request_context| (see issue #2969)
This was unintentionally lost during the Chrome runtime refactoring effort.
2021-05-20 15:11:39 -04:00
Marshall Greenblatt
21ac0be8d7 Update process message unit test expectations (see issue #3126)
See related comments in commit f3c513ba.
2021-05-20 14:56:23 -04:00
Marshall Greenblatt
f3c513bafd Allow a CefProcessMessage to remain valid after receipt (see issue #3126)
A reference to a received CefProcessMessage object and/or associated argument
list can now be kept outside of the OnProcessMessageReceived callback. The
argument list is no longer explicitly owned by the CefProcessMessage object
and can be individually assigned to other CefValue types as needed (e.g. by
passing to SetList, etc). Depending on client usage this could reduce the
potential for unnecessary copies of the list contents.

Received messages can also be sent back using SendProcessMessage (after which
the CefProcessMessage would become invalid as discussed in issue #3123). This
is not new behavior but we have now added explicit unit test coverage for it.
This also no longer requires a copy of the argument list contents.

Note that a received argument list is initially read-only for logical
consistency. Assignment to another CefValue object could potentially remove
the read-only status because it is not an intrinsic property of the underlying
Chromium data type. This is fine because, at that point, ownership has been
transfered to the new CefValue object and the original logical context (as
part of the CefProcessMessage) no longer applies.
2021-05-20 14:46:19 -04:00
Marshall Greenblatt
ff8f4a7217 Remove the TID_FILE default value
Clients should instead make an informed decision about which blocking thread
to use. See cef_thread_id_t documentation for guidance.
2021-05-19 17:42:51 -04:00
Marshall Greenblatt
d9efaee9b9 Fix routing of frame messages after cross-origin navigation (fixes issue #2849)
When navigating cross-origin a speculative RenderFrameHost (RFH) and
CefFrameHostImpl is created in the browser process for the new frame object
created in a new renderer process. The FrameAttached message then arrives for
the speculative RFH, and as a consequence interfaces are bound between the new
CefFrameHostImpl and the speculative RFH. If the pending navigation commits
then the existing RFH will be replaced with the previously speculative RFH.
Since interfaces are already bound we must keep the new CefFrameHostImpl. This
means that frame objects (including for the main frame) will now always change
after cross-origin navigation, and the old frame object will be invalidated.
2021-05-18 21:59:48 -04:00
Marshall Greenblatt
ebee84755e Convert legacy IPC messages to Mojo (fixes issue #3123)
This change introduces a few minor CEF API behavior changes:

- A CefProcessMessage object cannot be reused after being passed to
  SendProcessMessage.
- The |extra_info| argument to CefRenderProcessHandler::OnBrowserCreated may
  now be NULL.

Where appropriate, we now utilize the default UTF string encoding format and
shared memory to reduce copies and conversions for the cross-process
transfer of arbitrary-length strings. For example, CefFrame::GetSource/GetText
now involves zero UTF conversions and zero copies in the browser process for
the CefString delivered to CefStringVisitor::Visit().
2021-05-18 21:59:48 -04:00
Marshall Greenblatt
4f0b7b4511 chrome: ceftests: Avoid timeouts of ResourceManagerTest.ManyRequests (see issue #2969) 2021-05-18 15:35:42 -04:00
Marshall Greenblatt
fde96be168 Fix crash closing DevTools window (fixes issue #3111) 2021-05-05 12:48:07 -04:00
Marshall Greenblatt
820ef6c323 Fix crash in OnGuestDetached when unloading PDF (fixes issue #3121) 2021-05-04 13:25:25 -04:00
Marshall Greenblatt
2de07250dc Restore async CreateBrowser behavior (fixes issue #3116, fixes issue #3118)
Restore the async CreateBrowser behavior that existed prior to commit 691c9c2
because executing synchronously (for example, from inside OnContextInitialized)
causes issues on MacOS and possibly other platforms.
2021-04-29 17:33:32 -04:00
Marshall Greenblatt
3ab91a45c9 chrome: Support configuration of accept language (see issue #2969)
This change adds support for CEF settings configuration of accept_language_list.
If specified, this value will take precedence over the "intl.accept_languages"
preference which is controlled by chrome://settings/languages.
2021-04-28 13:12:09 -04:00
Marshall Greenblatt
c03a6f4386 chrome: Support configuration of user agent and locale (see issue #2969)
This change adds support for CefSettings and command-line configuration of
user_agent, user_agent_product (formerly product_version) and locale.
2021-04-27 12:39:12 -04:00
Marshall Greenblatt
328de502ac Windows: Disable iterator debugging for cef_sandbox builds (fixes issue #3109)
Iterator debugging has been disabled by default (_HAS_ITERATOR_DEBUGGING=0)
for CEF/Chromium builds using clang/LLVM since 2018. Inversely, it is enabled
by default (_ITERATOR_DEBUG_LEVEL=2) for the MSVC Debug build configuration.
In order to minimize configuration-related headaches for MSVC-based clients
we have been building the Debug cef_sandbox.lib with iterator debugging
enabled. Recently, we have identified a number of crashes that may be due to
bugs in current clang/LLVM or MSVC versions but in any case can be resolved by
disabling iterator debugging:

- Crash when loading chrome://sandbox.
- Crash if an application lists libraries that utilize iterators after
  cef_sandbox.lib in the linker order.

To resolve these crashes we will now disable iterator debugging by default
for the cef_sandbox.lib builds. Client applications that link cef_sandbox.lib
will now also need to build with iterator debugging disabled by setting
_HAS_ITERATOR_DEBUGGING=0 or _ITERATOR_DEBUG_LEVEL=0 in their project
configuration (this will be done for you if you use cef_variables.cmake from
the binary distribution).

In addition to the crash fixes mentioned above, this change also:

- Reduces the size of the Debug cef_sandbox.lib by ~10MB.
- May result in faster Debug executables (see https://crbug.com/539996).
2021-04-26 18:19:59 -04:00
Marshall Greenblatt
511e10d594 ceftests: Add missing newline at end of file 2021-04-23 21:00:43 -04:00
Marshall Greenblatt
3c8507c4a3 Linux: cefclient: Don't use std::make_unique which requires C++14 2021-04-23 20:42:14 -04:00
Marshall Greenblatt
ae4f68f695 Update to Chromium version 91.0.4472.0 (#870763) 2021-04-23 11:38:51 -04:00
Marshall Greenblatt
b189c7b472 Fix extension loading test failure 2021-04-22 17:15:14 -04:00
Marshall Greenblatt
f84762d84a Fix crash closing DevTools window (fixes issue #3111) 2021-04-22 12:41:35 -04:00
Marshall Greenblatt
cf1074cf49 chrome: Support configuration of renderer prefs (see issue #2969) 2021-04-17 21:23:55 -04:00
Marshall Greenblatt
9756e15a23 chrome: Don't rely on CREATE_STATUS_CREATED for disk-based profiles (see issue #2969) 2021-04-15 13:36:10 -04:00
Marshall Greenblatt
a4d71d8fe2 cefclient: Fix slow loading of the Views image cache (see issue #2969) 2021-04-14 22:29:30 -04:00
Marshall Greenblatt
34c63a665d Wait for CefBrowserContext initialization (see issue #2969)
With the Chrome runtime, Profile initialization may be asynchronous. Code that
waited on CefBrowserContext creation now needs to wait on CefBrowserContext
initialization instead.
2021-04-14 21:03:44 -04:00
Marshall Greenblatt
fc7f9ff505 Fix crash when navigating to an unregistered scheme (fixes issue #3105)
The policy->CanAccessDataForOrigin CHECK in NavigationRequest::
GetOriginForURLLoaderFactory was failing because unregistered schemes
(which are already considered non-standard schemes) didn't trigger the
registered non-standard scheme allowance that we previously added in
ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin. This change
modifies GetOriginForURLLoaderFactory to always return an opaque/unique
origin for non-standard schemes resulting in unregistered and non-standard
schemes receiving the same treatment.

New test coverage has been added for this condition, and can be run with:
ceftests --gtest_filter=CorsTest.*CustomUnregistered*
2021-04-12 16:18:37 -04:00
Marshall Greenblatt
e1b6f5ad31 chrome: mac: Fix exception_port_.is_valid() failure (see issue #2969)
Fixes the following startup error:
FATAL:crashpad_client_mac.cc(499) Check failed: exception_port_.is_valid()
2021-04-11 20:44:28 -04:00
Marshall Greenblatt
6d25033822 mac: ceftests: Fix helper app linker errors (see issue #2969) 2021-04-11 20:44:28 -04:00
Marshall Greenblatt
a4603c6f1a chrome: Support usage of the Chrome toolbar from Views (see issue #2969) 2021-04-11 20:44:28 -04:00
Marshall Greenblatt
9c82785077 chrome: Fix assertion when clicking the incognito profile button (see issue #2969)
Profile::IsIncognitoProfile() currently returns false for CEF incognito profiles
because they are not the primary OTR profile. At the same time, we don't
necessarily want IsIncognitoProfile() to return true for CEF profiles because,
among other things, that causes the BrowserView to apply the dark toolbar theme.
Instead, this change updates ProfileMenu expectations to support the CEF
incognito profiles without otherwise modifying the incognito behavior.

Note that the IsIncognitoProfile() implementation has recently changed in
https://crrev.com/7bf6eb2497 and the conclusions in this commit will likely need
to be revisited in an upcoming Chromium update.
2021-04-11 16:05:10 -04:00
Marshall Greenblatt
1c04d96468 chrome: Fix FrameTest and RequestHandlerTest failures (see issue #2969) 2021-04-09 22:24:44 -04:00
Marshall Greenblatt
5318dfe252 chrome: Fix PreferenceTest failures (see issue #2969) 2021-04-09 22:00:33 -04:00
Marshall Greenblatt
76642ccafa Move cookieable scheme configuration to settings (see issue #2969)
The Chrome runtime requires that cookieable scheme information be available
at Profile initialization time because it also triggers NetworkContext creation
at the same time. To make this possible, and to avoid various race conditions
when setting state, the cookieable scheme configuration has been added as
|cookieable_schemes_list| and |cookieable_schemes_exclude_defaults| in
CefSettings and CefBrowserContextSettings. The CefCookieManager::
SetSupportedSchemes and CefBrowserProcessHandler::GetCookieableSchemes methods
are no longer required and have been removed.

This change also modifies chrome to delay OffTheRecordProfileImpl initialization
so that |ChromeBrowserContext::profile_| can be set before
ChromeContentBrowserClientCef::ConfigureNetworkContextParams calls
CefBrowserContext::FromBrowserContext to retrieve the ChromeBrowserContext
and associated cookieable scheme information. Otherwise, the
ChromeBrowserContext will not be matched and the NetworkContext will not be
configured correctly.

The CookieTest suite now passes with the Chrome runtime enabled.
2021-04-09 15:04:24 -04:00
Marshall Greenblatt
c565d9b1e6 Fix server thread assertion on CEF shutdown (see issue #2969)
The server thread was not guaranteed to be released in the correct scope on
CEF shutdown. This resulted in occasional thread_restrictions assertions on
ceftests shutdown after running the URLRequestTest suite with the Chrome
runtime enabled.
2021-04-09 14:22:51 -04:00
Marshall Greenblatt
09a9d9b54c chrome: Support customization of context menus (see issue #2969) 2021-04-08 19:38:29 -04:00
Marshall Greenblatt
701f51b1cc Fix URL rewrite on browser creation (see issue #2969)
The WebUITest suite now passes with the Chrome runtime enabled.
2021-04-07 18:56:07 -04:00
Marshall Greenblatt
4188cc2f75 Avoid potential use-after-free of CefIOThreadState (see issue #2969)
The problem occured while executing multiple URLRequestTest with the Chrome
runtime.
2021-04-07 18:19:46 -04:00
Marshall Greenblatt
09fa22898d chrome: Support client-created request contexts (see issue #2969)
RequestContextTest and URLRequestTest suites now pass with the Chrome runtime
enabled.
2021-04-07 18:19:17 -04:00
Marshall Greenblatt
1cddbeb12f chrome: Fix CorsTest.RedirectPost307HttpSchemeToCustomNonStandardScheme failure (see issue #2969) 2021-04-05 14:49:30 -04:00
Marshall Greenblatt
09c6586480 chrome: Fix NavigationTest and ResourceRequestHandlerTest failures (see issue #2969) 2021-04-05 13:50:21 -04:00
Marshall Greenblatt
25701cfa6f chrome: Add support for reparenting of popups with Views (see issue #2969) 2021-04-02 16:53:34 -04:00
Marshall Greenblatt
4960970dbd Customize the 'platform' crash key value for ARM builds (see issue #2981, see issue #2773) 2021-03-31 11:00:37 -04:00
Marshall Greenblatt
19ac738b77 cefclient: Simplify ClientPrintHandlerGtk for single browser usage (see issue #2196) 2021-03-30 09:49:17 -07:00
Marshall Greenblatt
7876a2f321 Move GetPrintHandler to CefClient (see issue #2196)
This new location is preferred because we now know the associated CefBrowser
for all CefPrintHandler callbacks.
2021-03-30 12:26:57 -04:00
Marshall Greenblatt
f7a4c777e8 Remove CefBrowserSettings.web_security (fixes issue #3058) 2021-03-25 13:07:17 -04:00
Marshall Greenblatt
b375397efb Fix crash in MediaRouterEnabled due to missing pref registration (see issue #2900) 2021-03-24 15:15:53 -04:00
Corentin Dumont
6574e1d914 Windows: Fix out-of-sync timestamps in OSR mode (fixes issue #3102) 2021-03-23 20:13:03 +00:00
Marshall Greenblatt
91ecc85e93 Fix potential use-after-free of V8TrackArrayBuffer (fixes issue #3074) 2021-03-23 16:02:51 -04:00
Marshall Greenblatt
96404f1fd9 Revert "Fix potential use-after-free of V8TrackArrayBuffer (fixes issue #3074)"
This reverts commit 64a1612b70.
2021-03-22 19:44:42 -04:00
Marshall Greenblatt
288366c96d Mac: Fix "fatal error: 'include/cef_pack_resources.h' file not found"
This occurs on a clean build of the ceftests target.
2021-03-22 19:40:37 -04:00
Marshall Greenblatt
64a1612b70 Fix potential use-after-free of V8TrackArrayBuffer (fixes issue #3074) 2021-03-22 13:53:18 -04:00
Marshall Greenblatt
69a8839ce9 Fix underflow in EventRouterForwarder::HandleEvent (fixes issue #3066) 2021-03-18 14:11:59 -04:00
Yannick
47f15dd307 Remove maximum frame rate limit with OSR (fixes issue #3077) 2021-03-18 17:46:03 +00:00
Dmitry Azaraev
505bf24abb chrome: Add DevTools protocol support (see issue #2969)
Testable with the following:
$ ceftests --enable-chrome-runtime --gtest_filter=DevToolsMessageTest.*
2021-03-18 13:32:56 -04:00
Marshall Greenblatt
a17c59ce1d Fix renderer crash when printing a PDF file (fixes issue #3100) 2021-03-18 13:00:35 -04:00
Marshall Greenblatt
74db00fc89 Update to Chromium version 90.0.4430.0 (#857950)
- Linux ARM builds require use_vaapi=false (see https://crbug.com/1185348)
- Windows official builds require use_thin_lto=false (see https://crbug.com/1177001)
2021-03-18 11:23:00 -04:00
Marshall Greenblatt
1587d6da03 Update ArrayBuffer to use new BackingStore API (fixes issue #3074) 2021-03-12 12:36:47 -05:00
Marshall Greenblatt
c4baba880e Linux: Enable GTK3 by default (see issue #2969)
GTK3 is required by the Chrome runtime. Client applications using GTK2 will
now require a custom build of CEF with use_gtk=false set via GN_DEFINES.
2021-03-01 15:35:31 -05:00
Marshall Greenblatt
020ac1b509 Linux: cefclient: Port to GTK3 (see issue #2969)
GTK3 is required by the Chrome runtime. The cefclient off-screen rendering
example no longer works with Ubuntu 16.04. With end-of-life in April 2021
we are dropping support for 16.04 in the near future in any case.
2021-03-01 15:25:09 -05:00
Marshall Greenblatt
8424f166cc Use the same pak files for the Alloy and Chrome runtimes (see issue #2969)
Chrome currently uses chrome_100_percent.pak, chrome_200_percent.pak,
resources.pak and locales/<locale>.pak files. This change adds CEF
resources to those existing pak files and updates the Alloy runtime to
use them instead of the previous CEF-specific pak files (cef.pak,
cef_100_percent.pak, cef_200_percent.pak, cef_extensions.pak,
devtools_resources.pak) which are no longer generated.

The addition of Chrome resources results in an ~16% (~4.1MB) increase in total
combined pak file size vs. the previous CEF-specific pak files. While a size
increase is not ideal for the Alloy runtime, it seems preferable to the
alternative of distributing separate (and partially duplicated) pak files for
each runtime, which would have added ~9.8MB to the total binary distribution
size.
2021-02-28 16:51:37 -05:00
Marshall Greenblatt
a6a8c0e845 chrome: Fix URL rewrite on new tab navigation (see issue #2969)
This fixes an `Unhandled chrome.send("getApps");` error when creating a new tab.

Creating a new tab initially loads chrome://newtab which should then be
rewritten to chrome://new-tab-page for normal profiles in
HandleNewTabURLRewrite. Failure to rewrite the URL results in the loading of
NewTabUI instead of the expected NewTabPageUI. NewTabUI loads different
resources for normal vs incognito/guest profiles (new_tab.js vs
incognito_tab.js), and new_tab.js calls chrome.send("getApps") via
page_list_view.js. This then fails in WebUIImpl::ProcessWebUIMessage because
the message is unhandled.
2021-02-27 14:34:49 -05:00
Marshall Greenblatt
1d39ff720e Mac: Add Views API support (see issue #1749)
The Chrome browser can now be hosted in a Views-based application on Mac
(see issue #2969).

To launch a fully-featured Chrome window using cefsimple:
$ open cefsimple.app --args --enable-chrome-runtime

To launch a minimally-styled Views-hosted window using cefsimple:
$ open cefsimple.app --args --use-views [--enable-chrome-runtime]

To launch a fully-styled Views-hosted window using cefclient:
$ open cefclient.app --args --use-views [--enable-chrome-runtime]

Known issues:
- Some Views unit tests are currently failing on Mac.
2021-02-27 12:31:45 -05:00
Marshall Greenblatt
f93c9c0c5c Mac: Remove browser_compositor_mac.patch
This patch file causes the blank screen issue with Views and is not
actually required.
2021-02-26 20:12:16 -05:00
Marshall Greenblatt
b5dfcd05cb Support building the chome target with enable_cef=false 2021-02-26 20:12:16 -05:00
Marshall Greenblatt
8733cb89c7 chrome: Add Views API integration (see issue #2969)
The Chrome browser can now be hosted in a Views-based application on Windows
and Linux.

To launch a fully-featured Chrome window using cefsimple:
$ cefsimple --enable-chrome-runtime

To launch a minimally-styled Views-hosted window using cefsimple:
$ cefsimple --enable-chrome-runtime --use-views

To launch a fully-styled Views-hosted window using cefclient:
$ cefclient --enable-chrome-runtime --use-views

Views unit tests also now pass with the Chrome runtime enabled:
$ ceftests --gtest_filter=Views* --enable-chrome-runtime

Known issues:
- Popup browsers cannot be intercepted and reparented.
2021-02-21 15:25:10 -05:00
Marshall Greenblatt
8f5fdc1f9a chrome: Add CEF-specific WebUI handling (see issue #2969)
To avoid conflicting IDs between Alloy (which uses cef.pak) and Chrome
(which uses chrome_100_percent.pak) the cef/LICENSE.txt file is now included
in both cef/libcef/resources/cef_resources.grd and
chrome/app/theme/chrome_unscaled_resources.grd with different ID values.

The cef.pak file currently contains both CEF-specific resources and Chrome
resources that are already included in the default *.pak files distributed
with Chrome. In the future we should remove this duplication and just
distribute the same *.pak files as Chrome for the majority of resources.
2021-02-15 18:24:52 -05:00
Marshall Greenblatt
ec7067c55e chrome: Fix callbacks for different Profile types (see issue #2969)
- Only install network intercepts for Profiles that have an associated
  CefBrowserContext. For incognito windows the CefBrowserContext is
  associated with the OffTheRecordProfileImpl's original Profile.
- cefsimple: Return the default CefClient instance for browser windows
  created via the Chrome UI, and allow Chrome to show error pages.
2021-02-15 16:50:04 -05:00
Marshall Greenblatt
bf3b7b2c62 Linux: cefclient: Fix GTK expectations with OSR multi-threaded-message-loop (fixes issue #3087) 2021-02-15 09:54:06 -08:00
Marshall Greenblatt
b3ad79e2c5 Linux: cefclient: Fix GTK behavior with multi-threaded-message-loop (fixes issue #3087)
Switch to using g_main_context_default() in MainMessageLoopMultithreadedGtk. As of M86
(https://crrev.com/b960daf4e6) Chromium now creates its own context in MessagePumpGlib so
we can use the default context in cefclient. This is also more "correct" from a GTK usage
perspective. As part of this change all GTK dialogs and callbacks are now executed on the
main thread instead of the UI thread (note that these are the same thread when not using
multi-threaded-message-loop).
2021-02-12 11:54:31 -08:00
Marshall Greenblatt
7fe6a18f03 Mac: Fix incorrect creation of NSAutoreleasePool (fixes issue #2160) 2021-02-11 17:12:15 -05:00
Masayuki Nagamachi
d6dc4b667b Support git working directory created by git worktree add (fixes issue #2673) 2021-02-10 18:43:30 +00:00
Cristian Amarie
59c11404e6 Fix loading of URL without scheme (fixes issue #3079) 2021-02-10 13:33:51 -05:00
Marshall Greenblatt
5ef0fb8ac8 Update to Chromium version 89.0.4389.0 (#843830)
- SSE3 is now required on x86 processors (see https://crbug.com/1123353).
2021-02-08 14:15:38 -05:00
Marshall Greenblatt
119415b8e9 Update copyright year on generated files 2021-01-27 13:36:54 -05:00
Marshall Greenblatt
d06fdcff85 Add workaround for crash on Views popup window creation (see issue #3040) 2021-01-21 13:43:50 -05:00
Marshall Greenblatt
9d4f862210 Windows: cmake: Fix unknown arguments error with VS2017 generator 2021-01-21 13:43:44 -05:00
Marshall Greenblatt
5055d1f1d5 Windows: Ignore INCLUDE/LIB env if vcvarsall.bat is available (see issue #2773)
Windows ARM64 cross-compile requires building Clang x64 binaries. Building both
arm64 and x64 binaries in the same build is not possible when using INCLUDE/LIB
values set via the environment. Instead, allow Chromium to extract the correct
configuration from vcvarsall.bat for populating the environment.[arch] files.
2021-01-11 14:11:57 -05:00
Marshall Greenblatt
b798147c33 Windows: Add ARM64 distribution support (see issue #2773)
To generate Windows ARM64 builds set the CEF_ENABLE_ARM64=1 environment
variable and pass the "--arm64-build --build-target=cefsimple" command-line
arguments to automate-git.py. We can't build cefclient.exe for ARM64 due to
missing OpenGL library support so build cefsimple.exe instead.
2021-01-11 13:49:39 -05:00
Marshall Greenblatt
2a64387259 Add workaround for crash on popup window creation (see issue #3040) 2020-12-07 13:53:28 -05:00
Marshall Greenblatt
71179da2f6 Mac: Add ARM64 configuration support (see issue #2981)
Requires Xcode 12.2 and the MacOS 11.0 SDK. To generate ARM64 builds set
the CEF_ENABLE_ARM64=1 environment variable and replace all usage of
--x64-build with --arm64-build in script command-line arguments.
2020-12-04 15:43:50 -05:00
Marshall Greenblatt
a584bd187b Update to Chromium version 88.0.4324.0 (#827102)
- Mac: Xcode 12.2 and the MacOS 11.0 SDK are now required for building.
- MacOS 10.10 (Yosemite) is no longer supported (see https://crbug.com/1126056).
- Flash is no longer supported (see https://www.chromium.org/flash-roadmap).
2020-12-04 15:43:33 -05:00
Marshall Greenblatt
7d1d3c0206 Linux: Fix ATK assertion error when generating ARM build config. 2020-11-18 15:52:37 -05:00
Marshall Greenblatt
d2c884da86 Prevent UB if a WeakPtr to an already-destroyed object is dereferenced.
If a WeakPtr references an already-destroyed object, operator-> and
operator* end up simply dereferencing nullptr. However, dereferencing
nullptr is undefined behavior and can be optimized in surprising ways
by compilers. To prevent this from happening, add a defence of last
resort and CHECK that the WeakPtr is still valid.

Based on https://crrev.com/bbb64b5c69
2020-11-10 11:51:50 -05:00
Marshall Greenblatt
0b7840ab2f Update URL for CEF downloads 2020-11-05 14:02:36 -05:00
Cristian Amarie
977cc71fd9 Win/Linux: Add support for chrome://sandbox (fixes issue #3029) 2020-10-29 17:55:45 +00:00
Marshall Greenblatt
023d218104 Move OnCursorChange from CefRenderHandler to CefDisplayHandler
The cursor change can now be handled by the client with both windowed and
off-screen rendering.

Returning true from OnCursorChange will disable the default cursor change
behavior. This is functionally equivalent to the
CefBrowserHost::SetMouseCursorChangeDisabled method, so that method has been
removed.
2020-10-28 12:56:27 -04:00
Marshall Greenblatt
4e6c558bf2 Windows: Fix focus assignment when clicking WebView with external parent (fixes issue #3031) 2020-10-27 14:43:10 -04:00
Marshall Greenblatt
6a525748c4 cefbuilds: Remove html generation and add beta channel support 2020-10-24 13:13:43 -04:00
Sergey Markelov
c3aa36323b Mac: cefclient: Remove duplicated cleanup code 2020-10-15 20:18:20 +00:00
Marshall Greenblatt
a1ba0c9166 Windows/Linux: Fix scrolling in popup lists with high-dpi. 2020-10-15 16:03:32 -04:00
Marshall Greenblatt
e618f44667 Windows: Fix warning C4458: declaration of 'method' hides class member 2020-10-15 14:21:06 -04:00
Cristian Amarie
9e296bde3c Windows: Fix duplicate symbol ThrowBadVariantAccess with cef_sandbox build (fixes issue #3021) 2020-10-15 14:21:06 -04:00
Marshall Greenblatt
015e3621a3 Update to Chromium version 87.0.4280.0 (#812852)
- Windows: VS2015 Update 2 is now the minimum version requirement for linking
  cef_sandbox from official build binary distributions.
2020-10-15 14:21:06 -04:00
Marshall Greenblatt
cae194f493 Improve documentation related to views screen coordinates (see issue #2980) 2020-10-01 16:12:01 -04:00
Marshall Greenblatt
4fbd247231 Add chrome runtime support for more callbacks and ceftests (see issue #2969)
This change adds support for:
- Protocol and request handling.
- Loading and navigation events.
- Display and focus events.
- Mouse/keyboard events.
- Popup browsers.
- Callbacks in the renderer process.
- Misc. functionality required for ceftests.

This change also adds a new CefBrowserProcessHandler::GetCookieableSchemes
callback for configuring global state that will be applied to all
CefCookieManagers by default. This global callback is currently required by the
chrome runtime because the primary ProfileImpl is created via
ChromeBrowserMainParts::PreMainMessageLoopRun (CreatePrimaryProfile) before
OnContextCreated can be called.

ProfileImpl will use the "C:\Users\[user]\AppData\Local\CEF\User Data\Default"
directory by default (on Windows). Cookies may persist in this directory when
running ceftests and may need to be manually deleted if those tests fail.

Remaining work includes:
- Support for client-created request contexts.
- Embedding the browser in a Views hierarchy (cefclient support).
- TryCloseBrowser and DoClose support.
- Most of the CefSettings configuration.
- DevTools protocol and window control (ShowDevTools, ExecuteDevToolsMethod).
- CEF-specific WebUI pages (about, license, webui-hosts).
- Context menu customization (CefContextMenuHandler).
- Auto resize (SetAutoResizeEnabled).
- Zoom settings (SetZoomLevel).
- File dialog runner (RunFileDialog).
- File and JS dialog handlers (CefDialogHandler, CefJSDialogHandler).
- Extension loading (LoadExtension, etc).
- Plugin loading (OnBeforePluginLoad).
- Widevine loading (CefRegisterWidevineCdm).
- PDF and print preview does not display.
- Crash reporting is untested.
- Mac: Web content loads but does not display.

The following ceftests are now passing when run with the
"--enable-chrome-runtime" command-line flag:

CorsTest.*
DisplayTest.*:-DisplayTest.AutoResize
DOMTest.*
DraggableRegionsTest.*
ImageTest.*
MessageRouterTest.*
NavigationTest.*
ParserTest.*
RequestContextTest.*Global*
RequestTest.*
ResourceManagerTest.*
ResourceRequestHandlerTest.*
ResponseTest.*
SchemeHandlerTest.*
ServerTest.*
StreamResourceHandlerTest.*
StreamTest.*
StringTest.*
TaskTest.*
TestServerTest.*
ThreadTest.*
URLRequestTest.*Global*
V8Test.*:-V8Test.OnUncaughtExceptionDevTools
ValuesTest.*
WaitableEventTest.*
XmlReaderTest.*
ZipReaderTest.*
2020-09-29 18:31:43 -04:00
Marshall Greenblatt
e94a261bf5 Rename CefBrowserHostImpl to AlloyBrowserHostImpl (see issue #2969)
After commit 38d8acfa18 this object is only used with the alloy runtime.
2020-09-22 17:36:06 -04:00
Marshall Greenblatt
9022d40e6a Add missing print preview resources and prefs (fixes issue #2989) 2020-09-22 17:36:06 -04:00
Marshall Greenblatt
38d8acfa18 Create a ChromeBrowserHostImpl for every Chrome tab (see issue #2969)
The Browser object represents the top-level Chrome browser window. One or more
tabs (WebContents) are then owned by the Browser object via TabStripModel. A
new Browser object can be created programmatically using "new Browser" or
Browser::Create, or as a result of user action such as dragging a tab out of an
existing window. New or existing tabs can also be added to an already existing
Browser object.

The Browser object acts as the WebContentsDelegate for all attached tabs. CEF
integration requires WebContentsDelegate callbacks and notification of tab
attach/detach. To support this integration we add a cef::BrowserDelegate
(ChromeBrowserDelegate) member that is created in the Browser constructor and
receives delegation for the Browser callbacks. ChromeBrowserDelegate creates a
new ChromeBrowserHostImpl when a tab is added to a Browser for the first time,
and that ChromeBrowserHostImpl continues to exist until the tab's WebContents
is destroyed. The associated WebContents object does not change, but the
Browser object will change when the tab is dragged between windows.

CEF callback logic is shared between the chrome and alloy runtimes where
possible. This shared logic has been extracted from CefBrowserHostImpl to
create new CefBrowserHostBase and CefBrowserContentsDelegate classes. The
CefBrowserHostImpl class is now only used with the alloy runtime and will be
renamed to AlloyBrowserHostImpl in a future commit.
2020-09-21 17:06:56 -04:00
Marshall Greenblatt
7ca9e9c54b Update chrome_browser_net_export patch for chrome runtime (see issue #2969) 2020-09-17 13:43:04 -04:00
Marshall Greenblatt
64c561f0bd Linux: cmake: Disable GTK deprecated functions (fixes issue #2791) 2020-09-15 12:44:48 -04:00
Marshall Greenblatt
f2c0c3f8fb Add support for prefers-color-scheme media queries (fixes issue #2824) 2020-09-15 12:34:22 -04:00
Marshall Greenblatt
5f9bd3ecbd Fix crash when sending programmatic event to a Views-hosted browser window.
The |web_contents_| member was nullptr in CefBrowserPlatformDelegateNativeAura
when calling methods like SendKeyEvent from CefBrowserPlatformDelegateViews.
2020-09-15 11:19:04 -04:00
Marshall Greenblatt
8796d3cd95 Persist media device IDs across navigation and restart (fixes issue #2064)
Media device IDs will now be persisted across navigation and reload by default.
The device IDs will also be persisted across restart if --cache-path=<path> and
--persist-user-preferences settings are specified.
2020-09-14 16:28:23 -04:00
Marshall Greenblatt
cc56720bd2 Support CORS preflight requests with OutOfBlinkCors (fixes issue #3006)
A CORS preflight request is an "OPTIONS" request sent to a server prior to a
cross-origin XMLHttpRequest or Fetch request. The server's response determines
which HTTP request methods are allowed and supported, and whether credentials
such as Cookies and HTTP Authentication should be sent with requests.

A CORS preflight request will only be sent if certain conditions are met. For
example, it will be sent for requests that have potentially unsafe HTTP
methods [1] or request headers [2]. See the NeedsPreflight function in
services/network/cors/cors_url_loader.cc for full details.

CORS preflight functionality is implemented in the network service and will not
be triggered if the client handles the request instead of allowing it to proceed
over the network. Since the preflight request itself also runs in the network
service it cannot be intercepted by the client.

[1] https://fetch.spec.whatwg.org/#cors-safelisted-method
[2] https://fetch.spec.whatwg.org/#cors-safelisted-request-header
2020-09-11 19:21:53 -04:00
Marshall Greenblatt
88faf1023a Fix incorrect Origin and Cookie headers for POST redirects (fixes issue #2806)
This change also adds unit test coverage for cross-origin POST redirects.
2020-09-09 18:30:12 -04:00
Marshall Greenblatt
42f517ec69 Fix DCHECK failure in the URLLoader constructor.
The request.trusted_params.isolation_info.site_for_cookies value must
match request.site_for_cookies.

This change also adds unit test coverage for cross-origin GET redirects.
2020-09-09 18:29:21 -04:00
Marshall Greenblatt
4791109a28 Don't save or load cookies for non-cookieable scheme requests.
This fixes an IsCanonical() DCHECK failure triggered by calling
CanonicalCookie::Create for a non-cookieable URL.

This change also adds unit test coverage for cross-origin cookie
behavior with sub-resource requests (iframe, XHR, Fetch).
2020-09-09 18:29:15 -04:00
Marshall Greenblatt
19391d8ab0 Fix documentation typo 2020-09-08 12:18:35 -04:00
Marshall Greenblatt
59a779c38a Disable Badging API which is not supported (fixes issue #3005) 2020-09-03 17:52:09 -04:00
Marshall Greenblatt
b579b37db4 views: Support specification of screen bounds for CefWindow creation (fixes issue #2980) 2020-09-03 17:51:57 -04:00
Marshall Greenblatt
4aad5f23a0 Include capi sub-directories in API hash calculation 2020-09-03 17:51:22 -04:00
Marshall Greenblatt
e6047bd54b Restore the CefRenderHandler::OnScrollOffsetChanged callback (fixes issue #2810) 2020-09-03 17:51:09 -04:00
Marshall Greenblatt
24c2f2fa38 Update to Chromium version 86.0.4240.0 (#800218)
- CefURLRequest::Create is no longer supported in the renderer process
  (see https://crbug.com/891872). Use CefFrame::CreateURLRequest instead.
- Mac platform definitions have been changed from `MACOSX` to `MAC`
  (see https://crbug.com/1105907) and related CMake macro names have
  been updated. The old `OS_MACOSX` define is still set in code and CMake
  for backwards compatibility.
- Linux ARM build is currently broken (see https://crbug.com/1123214).
2020-09-03 17:44:25 -04:00
Marshall Greenblatt
6b1e5335bc Add support and enable out-of-Blink CORS (fixes issue #2716)
It can still be disabled for a short time by passing
`--disable-features=OutOfBlinkCors` on the command-line.
2020-08-26 16:25:25 -04:00
Marshall Greenblatt
2e94bfafea wrapper: Allow null stream parameter to CefStreamResourceHandler 2020-08-26 16:25:25 -04:00
Marshall Greenblatt
b09cd1a197 ceftests: Add shared test_request and test_server implementations
To reduce text execution time and flakyness this change also
introduces a global test server that is initialized when needed
and torn down after all tests have completed.
2020-08-26 16:23:19 -04:00
Marshall Greenblatt
d63e5bbd8a wrapper: Add thread-specific IMPLEMENT_REFCOUNTING variant 2020-08-26 16:21:51 -04:00
Marshall Greenblatt
6337aa6fad ceftests: Move TrackCallback to a separate header file 2020-08-26 16:21:51 -04:00
Marshall Greenblatt
08ebbb395a ceftests: Fix incorrect include guard #ifdef names 2020-08-26 16:21:30 -04:00
Masako Toda
87c8a72831 Fix initial transparency delay for OSR + gpu-disabled (see issue #2938) 2020-08-13 14:50:40 -04:00
Cristian Amarie
11f37bc6eb Add limit on request redirects (fixes issue #3001) 2020-08-13 18:45:26 +00:00
Marshall Greenblatt
a5d88d697a Update API hash to include enums (see issue #300) 2020-08-07 13:14:41 -04:00
Dmitry Azaraev
f89c0d74dd Include enum declarations into API hash calculation (fixes issue #3000) 2020-08-07 13:03:51 -04:00
Marshall Greenblatt
9e60357fc8 cefbuilds: Improve display time for index.html 2020-08-06 16:10:16 -04:00
Marshall Greenblatt
75e0f9f60e Fix automate-git.py argument error 2020-08-03 15:00:38 -04:00
Marshall Greenblatt
9717d3e1da Add --distrib-subdir-suffix option to make_distrib 2020-08-03 14:37:24 -04:00
Marshall Greenblatt
b822ea43b9 Fix DCHECK when showing print preview dialog (see issue #2952) 2020-07-23 15:46:57 -04:00
Marshall Greenblatt
ac99621829 Fix link navigation from PDF files (fixes issue #2952)
Navigations initiated from a guest view will now be routed to the
OpenURLFromTab callback.
2020-07-23 14:48:25 -04:00
Marshall Greenblatt
99d66db930 Windows: cmake: Simplify the MSVC version check 2020-07-23 12:28:45 -04:00
Czarek Tomczak
c27fceb7de MacOS: Update target SDK to 10.10 for cmake and tests 2020-07-23 12:12:16 -04:00
Marshall Greenblatt
845322b5fb cmake: Update documentation of build requirements and examples 2020-07-21 16:12:43 -04:00
Marshall Greenblatt
ef7e98c616 Fix crash in ThemeService with --disable-extensions (fixes issue #2852) 2020-07-21 13:09:26 -04:00
Masako Toda
a3919cb0ec Fix excessive CPU usage with external and multi-threaded message loops (fixes issue #2809, fixes issue #2970). 2020-07-21 16:26:41 +00:00
Mike Wiedenbauer
034bd641de Return decompressed values from CefResourceBundle (fixes issue #2976) 2020-07-21 15:55:54 +00:00
Masako Toda
ca1c00f95d Fix timing of InstallTransparency for OSR + gpu-disabled (see issue #2938) 2020-07-20 20:01:13 +00:00
Marshall Greenblatt
0add3eaacb cefclient: Fix rendering of example background for OSR transparency (see issue #2938) 2020-07-20 15:43:26 -04:00
Andrei Kurushin
574d4dcedc Fix crash when closing an OSR browser (fixes issue #2919)
Release the Compositor before the WebContents is destroyed to match
the behavior in non-OSR code.
2020-07-20 14:33:00 -04:00
Cristian Amarie
82d6bcbbea Properly disable the notification and push APIs (fixes issue #2951) 2020-07-20 18:16:48 +00:00
Marshall Greenblatt
e87fedd27c Fix shutdown crash in InitNetworkContext with multi-threaded message loop (fixes issue #2985) 2020-07-20 13:49:16 -04:00
Marshall Greenblatt
fab2af8876 Windows: Avoid cef_sandbox compile errors with perfetto (fixes issue #2984) 2020-07-16 19:11:19 -04:00
Marshall Greenblatt
e8573173dd Expose MediaSink device ip/port and model name (see issue #2900) 2020-07-16 19:11:19 -04:00
Marshall Greenblatt
13e3c8b42a Fix official build errors caused by chrome runtime changes (see issue #2969) 2020-07-16 19:11:18 -04:00
Marshall Greenblatt
280c9127c1 Remove render thread created callbacks (see issue #2498)
With site-per-process enabled a spare renderer process will be created
for use with a future browser or navigation. Consequently the
|extra_info| parameter populated in OnRenderProcessThreadCreated will no
longer be delivered to OnRenderThreadCreated in the expected renderer
process. To avoid confusion these callbacks have been removed completely.

After this change CefRenderProcessHandler::OnWebKitInitialized should
be used for startup tasks in the render process, and OnBrowserCreated
should be used in the render process to recieve |extra_info| passed from
CefBrowserHost::CreateBrowser or CefLifeSpanHandler::OnBeforePopup.
2020-07-16 19:11:18 -04:00
Marshall Greenblatt
6573df6cc3 Update to Chromium version 85.0.4183.0 (#782793)
- Windows: 10.0.19041 SDK is now required.
- macOS: 10.15.1 SDK (at least Xcode 11.2) is now required.
- Remove CefMediaSource::IsValid and CefMediaSink::IsValid which would
  always return true.
2020-07-16 19:11:12 -04:00
Marshall Greenblatt
03c9156c80 Fix build and initial Chrome runtime issues on macOS (see issue #2969)
This change moves shared resource initialization to a common location and
disables crash reporting initialization in chrome/ code via patch files.

When using the Chrome runtime on macOS the Chrome application window will
display, but web content is currently blank and the application does not
exit cleanly. This will need to be debugged further in the future.
2020-07-06 15:20:53 -04:00
Marshall Greenblatt
02cdf05848 Move Alloy-specific logic to CefBrowserPlatformDelegateAlloy (see issue #2969)
Also remove OSR-related methods where the attributes can instead be passed
to the OSR platform delegate constructor directly.
2020-07-04 16:13:30 -04:00
Marshall Greenblatt
e9bf3cdb98 Add initial Chrome runtime support for browser APIs (see issue #2969)
This change adds basic Chrome runtime implementations for CefBrowserContext
and CefBrowserPlatformDelegate. A Chrome browser window with default frame
and styling can now be created using CefBrowserHost::CreateBrowser and some
CefClient callbacks will be triggered via the WebContentsObserver
implementation in CefBrowserHostImpl.

Any additional browser windows created via the Chrome UI will be unmanaged
by CEF. The application message loop will block until all browser windows
have been closed by the user.
2020-07-04 16:13:30 -04:00
Marshall Greenblatt
6cb9f0c695 Move browser runtime-specific logic to CefBrowserPlatformDelegate (see issue #2969)
This change moves the runtime-specific implementations of CefBrowserHostImpl
methods to CefBrowserPlatformDelegate. Some WebContentsDelegate methods
implemented by CefBrowserHostImpl set state or trigger client callbacks.
Those implementations will likely stay with CefBrowserHostImpl and will
need to be called from the Browser equivalents when using the Chrome runtime.
2020-07-03 18:09:52 -04:00
Marshall Greenblatt
6152d68b6a Make chrome://chrome-urls an alias for chrome://webui-hosts (fixes issue #2977) 2020-07-02 15:44:48 -04:00
Marshall Greenblatt
88b88251e7 Fix decoding of resources (fixes issue #2966)
Use LoadDataResourceString instead of GetDataResource. It will perform
decoding if necessary.
2020-07-02 14:45:23 -04:00
Marshall Greenblatt
48fc0bd220 Make CefBrowserContext an abstract base class (see issue #2969)
Existing CefBrowserContext functionality is now split between
CefBrowserContext and AlloyBrowserContext. Runtime implementations of
CefBrowserContext will provide access to the content::BrowserContext and
Profile types via different inheritance paths. For example, the Alloy
runtime uses ChromeProfileAlloy and the Chrome runtime uses ProfileImpl.

This change also renames CefResourceContext to CefIOThreadState to more
accurately represent its purpose as it no longer needs to extend
content::ResourceContext.
2020-07-01 15:35:07 -04:00
lwttai.lu
619f18fea0 Windows: File dialog add filter with all supported extensions as default (see issue #860) 2020-06-30 18:45:50 +00:00
Cristian Amarie
7b518511df Fix crash when reading malformed Flash manifest file (fixes issue #2948) 2020-06-30 18:44:14 +00:00
Marshall Greenblatt
5c1118230d Windows: Fix CefCookieVisitor crash on invalid date (fixes issue #2927) 2020-06-30 14:32:48 -04:00
Mike Wiedenbauer
0dfefe391c Fix decoding of the DevTools remote debugging discovery page (fixes issue #2974) 2020-06-30 14:43:48 +00:00
Marshall Greenblatt
b3a8da9b25 Add CefAppManager and remove global ContentClient accessors (see issue #2969)
This is the first pass in removing direct dependencies on the Alloy
runtime from code that can potentially be shared between runtimes.

CefBrowserHost and CefRequestContext APIs (including CefCookieManager,
CefURLRequest, etc.) are not yet implemented for the Chrome runtime.
Assert early if these API methods are called while the Chrome runtime
is enabled.
2020-06-29 16:17:58 -04:00
Marshall Greenblatt
84f3ff2afd Rename the current CEF runtime to Alloy (see issue #2969)
As part of introducing the Chrome runtime we now need to distinguish
between the classes that implement the current CEF runtime and the
classes the implement the shared CEF library/runtime structure and
public API. We choose the name Alloy for the current CEF runtime
because it describes a combination of Chrome and other elements.

Shared CEF library/runtime classes will continue to use the Cef
prefix. Classes that implement the Alloy or Chrome runtime will use
the Alloy or Chrome prefixes respectively. Classes that extend an
existing Chrome-prefixed class will add the Cef or Alloy suffix,
thereby following the existing naming pattern of Chrome-derived
classes.

This change applies the new naming pattern to an initial set of
runtime-related classes. Additional classes/files will be renamed
and moved as the Chrome runtime implementation progresses.
2020-06-29 16:17:41 -04:00
Marshall Greenblatt
f5587b74f0 Set enable_background_mode=false by default (see issue #2969)
This mode doesn't make sense with CEF, and it was causing strange
shutdown crashes when running with Chrome mode enabled.
2020-06-29 16:17:32 -04:00
Marshall Greenblatt
1174994211 Add initial chrome runtime support (see issue #2969)
Running `cefsimple --enable-chrome-runtime` will create and run a
Chrome browser window using the CEF app methods, and call
CefApp::OnContextInitialized as expected. CEF task methods also
work as expected in the main process. No browser-related methods or
callbacks are currently supported for the Chrome window, and the
application will exit when the last Chrome window closes.

The Chrome runtime requires resources.pak, chrome_100_percent.pak
and chrome_200_percent.pak files which were not previously built
with CEF. It shares the existing locales pak files which have been
updated to include additional Chrome-specific strings.

On Linux, the Chrome runtime requires GTK so use_gtk=true must be
specified via GN_DEFINES when building.

This change also refactors the CEF runtime, which can be tested in
the various supported modes by running:
$ cefclient
$ cefclient --multi-threaded-message-loop
$ cefclient --external-message-pump
2020-06-29 16:17:23 -04:00
Marshall Greenblatt
049caf9131 Refactor process execution logic (see issue #2969)
CefContext implements the public CEF API functions and delegates
the stages of content & service_manager process execution to
CefMainRunner. CEF-specific runtime logic (which may be replaced
with chrome-specific runtime logic) is then delegated to
CefMainDelegate which implements content::ContentMainDelegate.
2020-06-29 16:17:13 -04:00
Marshall Greenblatt
39aed35644 Add support for direct DevTools protocol messaging (fixes issue #2961).
This change allows the client to directly send and receive DevTools
protocol messages (send method calls, and receive method results and
events) without requiring a DevTools front-end or remote-debugging
session.

This change includes additional supporting changes:
- Add a new CefRequestHandler::OnDocumentAvailableInMainFrame
  callback (see issue #1454).
- Add a CefParseJSON variant that accepts a UTF8-encoded buffer.
- Add a `--devtools-protocol-log-file=<path>` command-line flag for
  logging protocol messages sent to/from the DevTools front-end
  while it is displayed. This is useful for understanding existing
  DevTools protocol usage.
- Add a new "libcef_static_unittests" executable target to support
  light-weight unit tests of libcef_static internals (e.g. without
  requiring exposure via the CEF API). Files to be unittested are
  placed in the new "libcef_static_unittested" source_set which is
  then included by both the existing libcef_static library and the
  new unittests executable target.
- Linux: Remove use_bundled_fontconfig=false, which is no longer
  required and causes unittest build errors (see issue #2424).

This change also adds a cefclient demo for configuring offline mode
using the DevTools protocol (fixes issue #245). This is controlled
by the "Offline mode" context menu option and the `--offline`
command-line switch which will launch cefclient in offline mode. When
cefclient is offline all network requests will fail with
ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when
called from JavaScript in any frame. This mode is per-browser so
newly created browser windows will have the default mode. Note that
configuring offline mode in this way will not update the Network tab
UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-19 22:15:22 -04:00
Marshall Greenblatt
a9aef28966 Improve AudioOutputTest.AudioTogglePlaybackTest to avoid flakyness. 2020-06-10 15:26:40 -04:00
Alexander Guettler
790d248111 Update to Chromium version 84.0.4147.0 (#768962) 2020-06-10 15:26:29 -04:00
Marshall Greenblatt
640cd0f411 Remove duplicate local_discovery file entries (see issue #2900)
This fixes duplicate symbol errors when linking libcef on Linux. These files
are now included by default with enable_service_discovery=true.
2020-05-26 12:32:40 -04:00
Marshall Greenblatt
cfe8e320be Enable DNS-SD discovery for cast devices (see issue #2900) 2020-05-25 16:54:45 -04:00
Marshall Greenblatt
5780bf40d4 Linux: Fix undefined symbol: ui::GtkUiDelegate::SetInstance
See https://crbug.com/1085806 for details.
2020-05-22 14:56:09 -04:00
Marshall Greenblatt
31d3e88d32 Add |client_| nullptr check in CefBrowserHostImpl::CanDragEnter (fixes issue #2934) 2020-05-13 14:30:44 -04:00
Marshall Greenblatt
7ecaa8afdd Windows: Add VS2019 path discovery to msvs_env.bat (fixes issue #2925) 2020-05-13 13:23:05 -04:00
Marshall Greenblatt
8c996d2efd Remember the user-selected printer by default (fixes issue #2875) 2020-05-13 13:10:08 -04:00
Marshall Greenblatt
d8b4281c06 Fix window.print() of PDF file (fixes issue #2987) 2020-05-12 16:25:13 -04:00
Marshall Greenblatt
c82eb3e80f Windows: cefclient: Fix return value check for AcquireSync (fixes issue #2933) 2020-05-12 15:41:20 -04:00
Marshall Greenblatt
14571658a2 Fix load of non-standard custom scheme URI as iframe src (see issue #2929) 2020-05-11 18:12:34 -04:00
Marshall Greenblatt
aa4473e2c6 Fix registration of WebSafe schemes (fixes issue #2929) 2020-05-11 18:11:53 -04:00
Marshall Greenblatt
9deef4189c Update AUTHORS.txt documentation 2020-05-08 12:35:04 -04:00
Marshall Greenblatt
25d81e0f1d Update AUTHORS.txt documentation 2020-05-08 12:25:35 -04:00
Marshall Greenblatt
70590a759d Update API hash for audio handler changes (see issue #2755) 2020-05-01 14:24:53 -04:00
Mike Wiedenbauer
8d01442d75 Re-implement audio capturing based on the AudioService API (fixes issue #2755) 2020-05-01 18:18:18 +00:00
Marshall Greenblatt
d65483ae16 Update cef_api_hash.h at build time if necessary (fixes issue #2922)
The cef_api_hash.h file was previously only updated when the translator tool
was run manually. Forgetting to run the translator tool after changing
include/internal/cef_types*.h files would result in cef_parser.py
incorrectly computing the CEF minor version number for future builds. By
updating this file automatically at build time the number of errors should be
reduced.
2020-04-30 17:52:10 -04:00
Marshall Greenblatt
7c6e53ddfb Save LocalPrefs.json in CefSettings.root_cache_path (see issue #2890) 2020-04-29 15:36:29 -04:00
Marshall Greenblatt
ff0c36b465 Add CefMediaSink::GetIconType (see issue #2900)
This attribute is useful for identifying different classes of cast devices
without first requiring a connection (CAST, CAST_AUDIO, CAST_AUDIO_GROUP, etc).
2020-04-29 15:01:12 -04:00
Vladislav
dafce45e49 Fix OSR resize issue with DPI scaling (fixes issue #2733) 2020-04-27 16:48:06 +00:00
Dmitry Azaraev
be6af15754 Add SameSite (same_site) and Priority attributes to CefCookie (fixes issue #2524)
This change also restores the Chromium default values for the
SameSiteByDefaultCookies and CookiesWithoutSameSiteMustBeSecure features. See
https://www.chromium.org/updates/same-site for feature details and rollout
timeline.
2020-04-24 17:48:26 -04:00
Marshall Greenblatt
cbc0625272 Revert "Fix background color assignment for popups (fixes issue #2482)"
This change is causing the OSRTest.OsrPopupJSOtherClient test to fail.

This reverts commit 3adb801ca8.
2020-04-24 15:41:07 -04:00
Marshall Greenblatt
fd1f465fa7 Normalize path values and add additional error logging (fixes issue #2405)
This change also improves the settings documentation and enforces the
requirement that path values be absolute (see issue #2916).
2020-04-23 17:51:19 -04:00
Marshall Greenblatt
8ed39e4ae5 Fix transposed variables in GetRequestInfo (fixes issue #2530) 2020-04-23 14:40:19 -04:00
Marshall Greenblatt
3adb801ca8 Fix background color assignment for popups (fixes issue #2482) 2020-04-23 13:47:10 -04:00
Marshall Greenblatt
ccf7b28723 Fix PDF extension loading of large files (fixes issue #2905)
The PDF extension will send Range requests when loading large PDF files. For
these cross-origin requests to be allowed (from extension origin to PDF origin)
the CORB checks in URLLoader must be disabled.
2020-04-22 16:26:22 -04:00
Alex Maitland
e876217e24 Change cef_pdf_print_settings_t custom margins from double to int (fixes issue #2694) 2020-04-21 18:44:52 +00:00
Mike Wiedenbauer
ec0c57d0e1 Fix OSR keyboard input for editable PDF (fixes issue #2907) 2020-04-21 18:30:52 +00:00
Jengerer
87a7c4f94b Fix handling of partial range request (fixes issue #2873) 2020-04-20 13:19:42 -04:00
Marshall Greenblatt
27257d0288 Remove DCHECK in InterceptedRequest::OnReceiveRedirect (fixes issue #2917) 2020-04-20 12:38:31 -04:00
Marshall Greenblatt
245bc9bfab Windows: Early init parental controls to avoid blocking assertions 2020-04-15 21:46:31 -04:00
Marshall Greenblatt
fa519f5108 Update to Chromium version 83.0.4103.0 (#756066) 2020-04-15 16:47:50 -04:00
Mike Wiedenbauer
30d83cb94a Fix AltGr handling for OSR keyboard events (fixes issue #2892) 2020-04-08 15:43:39 +00:00
Mike Wiedenbauer
f5c79bf50c Linux: Fix CefPrintHandler callbacks from PDF viewer (fixes issue #2906) 2020-04-02 21:26:14 +00:00
Andrei Kurushin
ea1324a9f1 Windows: cefclient: Fix accessibility where TreeId type has changed from int to string 2020-04-02 21:19:25 +00:00
Andy Tzeng
261a8899fc Fix UU_REPLACE_PLUS_WITH_SPACE value to match Chromium (fixes issue #2904) 2020-04-02 21:16:52 +00:00
Vladislav
a5de549456 Fix OSR popup position when the view origin is offset in screen coords (fixes issue #2902) 2020-04-02 21:14:28 +00:00
rcdrone
bdaa857c49 Windows: Disable the sandbox if windows_sandbox_info is null
This restores the behavior prior to revision 438382c. Calling
InitializeSandboxInfo from inside libcef won’t work unless libcef is
statically linked with the executable, so there's no point in doing so.
See the Chromium sandbox docs for background.
2020-04-02 21:11:16 +00:00
Cristian Amarie
1c14900093 Remove unexpected content headers when converting from POST to GET request on 302 redirect response (fixes issue #2883) 2020-04-02 21:05:07 +00:00
Andrei Kurushin
01f385a6f7 Fix CefFrame::GetSource crash on detached frame (fixes issue #2898) 2020-04-02 21:01:33 +00:00
Mike Wiedenbauer
cf6b57d659 Enable smooth scrolling with OSR (fixes issue #2895) 2020-04-02 20:59:26 +00:00
Marshall Greenblatt
f742ab4994 Mac: Remove unicode character in README.redistrib.txt (fixes issue #2910) 2020-04-02 13:44:27 -04:00
Marshall Greenblatt
cfac1c347c Fix no newline at end of file error with Xcode 11.3.1 2020-04-02 13:36:45 -04:00
Marshall Greenblatt
047e8f9349 Update to Chromium version 82.0.4085.0 (#749737)
- Building on macOS now requires the 10.15 SDK. Xcode 11.3 is recommended as
  Xcode 11.4 is not currently supported (see https://crbug.com/1065146).
- Jumbo build configuration is no longer supported.

Chromium is skipping the M82 release and consequently no CEF 4085 branch will
be created. For details on the Chromium decision see
https://groups.google.com/a/chromium.org/d/msg/chromium-dev/Vn7uzglqLz0/JItlSrZxBAAJ
2020-04-02 13:20:25 -04:00
Marshall Greenblatt
3d87a68561 Always persist local_state by default (fixes issue #2890)
If a cache_path is specified local_state will now be persisted to a
LocalPrefs.json file. This is necessary because local_state is used to store
the cookie encryption key on Windows.
2020-04-01 17:06:19 -04:00
Marshall Greenblatt
66433c1869 Windows: Fix warning C4457: declaration of 'result' hides function parameter in VS2019 2020-04-01 17:06:19 -04:00
Marshall Greenblatt
869ae21c9f Convert CefCookieManagerImpl to use CefBrowserContext::Getter.
With this change CefCookieManagerImpl no longer keeps a reference to the
originating CefRequestContextImpl. This means that the CefRequestContextImpl
can be destroyed if all other references are released while the
CefCookieManagerImpl exists. If CefRequestContextImpl destruction results in
the underlying CefBrowserContext being destroyed then the CefCookieManagerImpl's
reference to that CefBrowserContext will be invalidated.

This is the same ownership model introduced with CefMediaRouterImpl in the
previous commit.
2020-03-27 16:22:34 -04:00
Marshall Greenblatt
03fd5b15da Add support for media device discovery and messaging (fixes issue #2900)
Chromium supports communication with media devices on the local network via
the Cast and DIAL protocols. This takes two primary forms:

1. Messaging, where strings representing state information are passed between
   the client and a dedicated receiver app on the media device. The receiver
   app communicates directly with an app-specific backend service to retrieve
   and possibly control media playback.
2. Tab/desktop mirroring, where the media contents are streamed directly from
   the browser to a generic streaming app on the media device and playback is
   controlled by the browser.

This change adds support for device discovery and messaging (but not
mirroring) with functionality exposed via the new CefMediaRouter interface.

To test: Navigate to http://tests/media_router in cefclient and follow the
on-screen instructions.
2020-03-27 15:54:39 -04:00
Vladislav
fecd582035 Fix OSR crash on window.open with new client (fixes issue #2894) 2020-03-06 19:51:58 +00:00
Andy Tzeng
180e9bd362 Support fragment (hash) component in CefParseURL (fixes issue #2896) 2020-03-06 17:40:28 +00:00
Marshall Greenblatt
2fbb6ba1e9 automate-git: Add support for depot_tools version pinning (fixes issue #2893) 2020-03-06 11:42:08 -05:00
Marshall Greenblatt
51e12b3866 automate-git: Remove support for branches older than 3071.
3071 and newer branches use Git and GN exclusively.
2020-03-05 13:56:17 -05:00
rcdrone
a6f9d78c1c Windows: Skip InitializeSandboxInfo if no_sandbox is true
The InitializeSandboxInfo method applies mitigations to the main process
that are inappropriate when the sandbox is disabled.
2020-03-05 17:53:13 +00:00
rcdrone
8cf82c24dc Windows: Skip InitializeSandboxInfo if no_sandbox is true
The InitializeSandboxInfo method applies mitigations to the main process
that are inappropriate when the sandbox is disabled.
2020-03-05 17:52:51 +00:00
rcdrone
438382c5df Windows: Skip InitializeSandboxInfo if no_sandbox is true
The InitializeSandboxInfo method applies mitigations to the main process
that are inappropriate when the sandbox is disabled.
2020-03-05 17:52:41 +00:00
Marshall Greenblatt
1ab44722e8 Windows: Fix ScreenlockMonitorDeviceSource window creation error.
See https://crbug.com/1058556 for details.
2020-03-04 19:31:55 -05:00
Marshall Greenblatt
4291776473 Windows: Update cef_sandbox mitigations to match Chromium 2020-03-04 19:31:55 -05:00
Marshall Greenblatt
06a5ef3cd8 automate-git: Windows: Patch VS toolchain scripts before runhooks
Split `gclient sync` into separate `gclient sync --nohooks` and
`gclient runhooks` steps so that we can optionally apply patches
from `runhooks.patch` in-between. This is necessary because the
src/tools/clang/scripts/update.py script is run via a hook and has
dependencies on the VS toolchain scripts which must be patched to
properly consider the GYP_MSVS_VERSION environment variable.
2020-03-04 19:31:54 -05:00
Marshall Greenblatt
9d9ee8b45f Update to Chromium version 81.0.4044.0 (#737173) 2020-03-04 19:31:54 -05:00
Marshall Greenblatt
a22b670a00 automate-git: Remove unsupported --disable-syntax-validation flag 2020-03-03 23:00:58 -05:00
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
Iain Apreotesei
afcee77abe Windows: Add ARM64 binary distribution support (see issue #2773) 2020-02-19 16:33:27 +00:00
Marshall Greenblatt
294eb75355 Windows: Build the pe_image target as C++17 (see issue #2819)
This works around a bug in the Visual C++ standard library where the
std::is_integral templates are exported instead of inlined when building
with C++14. See also https://bugs.llvm.org/show_bug.cgi?id=42027.
2020-02-18 20:18:37 -05:00
Marshall Greenblatt
e472228f29 Windows: Fix cef_sandbox build error: call to 'as_const' is ambiguous.
See https://crbug.com/752720#c132 for details.
2020-02-18 15:15:34 -05:00
Marshall Greenblatt
fb925e7aa5 Fix inline documentation in crash_server.py 2020-02-17 13:19:09 -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
ed39922f85 cefclient: Windows: Pass correct mouse click count value (see issue #2727) 2020-01-31 16:27:55 -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
c3d4f24720 cefsimple: Fix sizing of popup windows with --use-views (see issue #2854) 2020-01-27 20:36:35 -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
492c6c6843 macOS: Disable toolchain prompt for tests (see issue #2692) 2020-01-24 20:16:47 -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
f2f6ae4f29 Linux: Add CEF_INSTALL_SYSROOT env variable for calling install-sysroot.py (see issue #1990) 2020-01-16 15:13:29 +01: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
d02d252690 cefclient: Convert NULL to nullptr (see issue #2861) 2020-01-15 16:11:53 +01:00
Marshall Greenblatt
b785d34d29 cefsimple: Convert NULL to nullptr (see issue #2861) 2020-01-15 15:26:01 +01:00
Marshall Greenblatt
f5eef5390a ceftests: Convert NULL to nullptr (see issue #2861) 2020-01-15 14:59:12 +01:00
Marshall Greenblatt
97d559982e Update generated files for NULL to nullptr conversion (see issue #2861) 2020-01-15 14:53:19 +01:00
Marshall Greenblatt
7a701546e1 tools: Convert NULL to nullptr (see issue #2861) 2020-01-15 14:49:44 +01:00
Marshall Greenblatt
ea63799c3e libcef: Convert NULL to nullptr (see issue #2861) 2020-01-15 14:49:22 +01:00
Marshall Greenblatt
c05c3e4065 Windows: cmake: Add VS2019 version 16.4 2020-01-14 16:21:52 +01:00
Marshall Greenblatt
c629c5bb59 Fix tarfile issues by using GNU_FORMAT with Python 3.8 (see issue #2856) 2020-01-14 11:16:33 +01:00
Marshall Greenblatt
53b98a5022 fix_style: Add Python 3 support (see issue #2856) 2020-01-13 21:43:18 +01:00
Marshall Greenblatt
f0347f0589 crash_server: Add Python 3 support (see issue #2856) 2020-01-13 21:30:54 +01:00
Marshall Greenblatt
06a5a5bb36 gn_args: Fix representation of int-type GN_DEFINES values (see issue #2856) 2020-01-13 16:50:00 +01:00
Marshall Greenblatt
08f6cbb675 gn_args: Fix Python 3 AttributeError: 'module' object has no attribute 'exc_clear' (see issue #2856) 2020-01-13 16:21:09 +01:00
Marshall Greenblatt
1a406d079b Use explicit check for python version (see issue #2856) 2020-01-13 11:53:36 +01:00
Marshall Greenblatt
3afa29d499 build: Add Python 3 support (see issue #2856) 2020-01-13 11:47:33 +01:00
Marshall Greenblatt
b98f142e0e gclient_hook: Add Python 3 support (see issue #2856) 2020-01-12 17:48:13 +02:00
Marshall Greenblatt
894ac21532 Fix Python 2 TypeError: write() argument 1 must be unicode, not str (see issue #2856) 2020-01-12 16:17:19 +02:00
Marshall Greenblatt
e1132672ee make_distrib: Add Python 3 support (see issue #2856) 2020-01-12 13:45:46 +01:00
Marshall Greenblatt
15226b9332 Fix incorrectly translated types in capi header comments (see issue #2856) 2020-01-09 22:26:53 +02:00
Marshall Greenblatt
1b85022c58 translator: Add Python 3 support (see issue #2856)
This also fixes incorrect translation of types in capi header comments.
2020-01-09 22:22:15 +02:00
Marshall Greenblatt
dbc479e490 cef_version: Add Python 3 support (see issue #2856) 2020-01-09 17:16:39 +02:00
Marshall Greenblatt
5792cea985 patch_updater: Add Python 3 support (see issue #2856) 2020-01-09 17:08:24 +02:00
Marshall Greenblatt
16e8710a81 patcher: Add Python 3 support (see issue #2856) 2020-01-09 16:42:00 +02:00
Marshall Greenblatt
503ec7c2e6 gn_args: Add Python 3 support (see issue #2856) 2020-01-09 15:49:11 +02:00
Marshall Greenblatt
11ee7e984c cefbuilds: Add Python 3 support (see issue #2856) 2020-01-09 15:40:40 +02: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
7653e9e04c Windows: Build the double_conversion target as C++17 (fixes issue #2819)
This works around a bug in the Visual C++ standard library where the
std::is_integral templates are exported instead of inlined when building
with C++14. See also https://bugs.llvm.org/show_bug.cgi?id=42027.
2020-01-07 15:12:59 +02: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
440dbfb6df Fix crash when running with --disable-extensions (fixes issue #2852) 2020-01-06 14:20:26 +02:00
Marshall Greenblatt
875b202cbb Windows: Fix ImportError: No module named win32file (see https://crbug.com/1033106) 2020-01-06 12:29:40 +02:00
Marshall Greenblatt
beb005138a Update copyright year 2020-01-06 11:59:05 +02:00
Andy Tzeng
a94dc6a058 Check for non-empty string before writing to logger (fixes issue #2825) 2019-12-31 15:48:21 +00: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
f9706f260a Windows: cefclient: Fix assertions with --use-views --multi-threaded-message-loop 2019-11-19 13:29:41 -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
f2756b5318 Update API hashes for changes in commit 65f97a6 2019-11-06 15:44:19 -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
cc6f285abd Fix GN undefined identifier error on non-Linux platforms 2019-11-05 16:17:10 -05:00
Thomas Preston
04c9bcd802 Linux: Add cef_use_gtk GN variable to optionally disable GTK configuration.
GTK is required to build the cefclient sample application but is not otherwise
required by CEF. This option allows builders to avoid configuring GTK when
building outside of the sysroot environment (with use_sysroot=false). It defaults to false when building inside the sysroot environment.
2019-11-05 21:12:20 +00:00
Marshall Greenblatt
c8d0813669 Restore expected Accept-Language request header order (fixes issue #2796) 2019-11-05 15:29:32 -05:00
Riku Palomäki
9b9a9f359e Linux: Load *.bin files from DIR_ASSETS (see issue #1936) 2019-11-01 14:19:48 +00:00
Marshall Greenblatt
b51a4de540 Windows: Fix cef_sandbox.lib link errors (fixes issue #2792) 2019-10-29 17:31:17 -04: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
4f07cba011 Windows: Fix type conversion warning with 64-bit MSVC.
request_handler_unittest.cc(448,55): warning C4267: 'argument':
conversion from 'size_t' to 'int', possible loss of data
2019-10-21 15:34:50 +02:00
Marshall Greenblatt
aad4bf2464 cefclient: Move StringResourceMap to ClientHandler (see issue #2586)
Fixes a DCHECK when creating multiple windows in cefclient due to the creation
of multiple StringResourceProvider objects.
2019-10-18 15:30:56 +02:00
Marshall Greenblatt
329facfbdf cefclient: Fix crash when removing extension resource path prefix.
To test: Run `cefclient.exe --use-views --load-extension=set_page_color`
2019-10-18 15:08:32 +02: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
d28efe8797 Add warning to LoadRequest about INVALID_INITIATOR_ORIGIN (213) failure condition (see issue #2586) 2019-10-15 15:11:46 +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
Marshall Greenblatt
1a661a2d15 macOS: cefsimple: Add missing AppKit.framework dependency to GN config 2019-10-14 17:46:54 +02:00
Marshall Greenblatt
aefe9a4195 macOS: Fix Jumbo/component build dependency issue.
Fixes the following error:

In file included from gen/chrome/browser/safe_browsing/safe_browsing_jumbo_1.cc:34:
In file included from ./../../chrome/browser/safe_browsing/download_protection/binary_fcm_service.cc:15:
../../components/gcm_driver/gcm_profile_service.h:18:10: fatal error: 'components/gcm_driver/gcm_buildflags.h' file not found
2019-10-14 17:46:54 +02:00
Mike Wiedenbauer
1d515adc22 Modify CefResponse header methods to match CefRequest API (fixes issue #2770) 2019-10-14 13:49:05 +02:00
Marshall Greenblatt
9cdda243a1 cefsimple: Use data URI instead of LoadString for error messages (see issue #2586) 2019-10-10 11:10:28 +03:00
Marshall Greenblatt
22746985f2 Fix crashes with --disable-extensions (fixes issue #2777) 2019-10-07 11:22:46 +03:00
Marshall Greenblatt
76368bda60 Remove WebUITest.credits because it always times out 2019-10-04 17:59:18 +03:00
Marshall Greenblatt
88ecf49549 Windows: Fix ViewsWindowTest failures due to incorrect client area size (fixes issue #2775)
These tests expect the window's client area size to be (kWSize, kWSize). Use
::AdjustWindowRect to offset TestWindowDelegate's preferred size so that the
client area size is correct after the OS internally applies frame insets during
::CreateWindow.

To test: Run `ceftests.exe --gtest_filter=ViewsWindowTest.Window*`.
All tests should pass.
2019-10-04 17:24:01 +03:00
Marshall Greenblatt
e7b66aa43a Increase URLRequestTest CloseBrowser timeout to reduce flakes (fixes issue #2756)
Tests for incomplete request behavior use a timeout to trigger CloseBrowser
and terminate the test case. Recent architectural changes in Chromium have
likely increased the minimum delay required to spin up a working browser
instance and initiate the request. Consequently we need to wait longer before
closing the browser.

To test:
Run `ceftests --gtest_filter=URLRequestTest.*Incomplete* --gtest_repeat=5`.
All test runs should succeed.
2019-10-04 15:46:27 +03: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
Marshall Greenblatt
5da1649653 macOS: cmake: Prevent Xcode 11 from doing automatic codesigning. 2019-10-03 11:26:55 +03:00
Marshall Greenblatt
c0af145165 Windows: Disable the ARM64 config by default
Set the CEF_ENABLE_ARM64=1 environment variable to enable the ARM64 build if
you have installed the Visual Studio compiler toolchain for ARM64.
2019-10-02 14:54:04 +03:00
Iain Apreotesei@Arm
a8283d1cc3 Add Windows ARM64 build support 2019-10-02 11:43:38 +00:00
Marshall Greenblatt
cc0530cbf6 Add missing services strings to pak (fixes issue #2764) 2019-10-02 13:56:17 +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
52c24ed061 Windows: Restore missing resources to binary distribution (fixes issue #2771) 2019-10-01 17:10:36 +03:00
Marshall Greenblatt
ba1b4a41a9 Windows: cmake: Add newer VS versions 2019-10-01 17:10:30 +03:00
Marshall Greenblatt
f8e0797773 Update to Chromium version 78.0.3904.0 (#693954) 2019-10-01 13:55:16 +00:00
Marshall Greenblatt
c8b457da38 Remove audio_output_unittest.cc which no longer exists (see issue #2755, see issue #2381) 2019-09-23 18:52:09 +03: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
b6b033a52b Windows: cmake: Add additional cef_sandbox link dependencies (fixes issue #2754) 2019-08-30 11:43:58 -04:00
Marshall Greenblatt
98527317a8 Revert "Windows: Add boringssl to cef_sandbox to fix VS2017 link error (fixes issue #2743)"
This reverts commit 2cf916e6d5.

This change causes linker errors with third-party projects using VS2019 that also link openssl.

cef_sandbox.lib(err.obj) : error LNK2005: _ERR_get_error already defined in websockets.lib(mbedtls-client.obj)
cef_sandbox.lib(err.obj) : error LNK2005: _ERR_error_string already defined in websockets.lib(ssl_lib.obj)
cef_sandbox.lib(err.obj) : error LNK2005: _ERR_error_string_n already defined in websockets.lib(ssl_lib.obj)
cef_sandbox.lib(err.obj) : error LNK2005: _ERR_free_strings already defined in websockets.lib(ssl_lib.obj)
2019-08-29 14:53:10 -04: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
5574d1c32f Windows: Add boringssl to cef_sandbox to fix VS2017 link error (fixes issue #2743) 2019-08-06 17:20:57 -04:00
Riku Palomäki
cfb4309479 Fix gclient_util after depot_tools changes (fixes issue #2736) 2019-08-05 18:01:14 +00:00
Dmitry Azaraev
91f48c5588 Fix missing marshaling for CefSettings::root_cache_path member (fixes issue #2740) 2019-08-05 17:00:09 +00: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
d82624411e Fix C compile error due to unintentional C++ include (fixes issue #2728) 2019-07-25 12:57:11 -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
Dmitry Azaraev
30cc80efe3 Fix typo in documentation for CefResourceHandler::Skip 2019-07-25 15:44:23 +00:00
Marshall Greenblatt
ea9bd50fca Fix compile error due to 1669c0af (see issue #123) 2019-07-25 09:17:27 -04: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
Dmitry Azaraev
a697464a33 Fix typo in documentation for cef_settings_t::cache_path. 2019-07-23 19:09:00 +00:00
Marshall Greenblatt
42b259d124 Fix crash when extensions are disabled (fixes issue #2708, see issue #2622) 2019-07-23 12:20:08 -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
Alwin Esch
fafe7a7cfc Update .gitignore to ignore VS and kdevelop project files 2019-07-17 01:10:33 +00: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
Alexander Guettler
17ec55a3b3 Fix dangling pointers in CefScopedArgArray (fixes issue #2704). 2019-07-16 21:42:20 +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
David Sowa
f0c82200ba Add ARM64 build and binary distribution support (see issue #1990)
Adds a new `--arm64-build` option to automate-git.py and make_distrib.py.
2019-06-13 11:52:32 +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
dd04583dcb macOS: Don't disable custom libc++ for cef_sandbox build (see issue #2677) 2019-06-12 12:02:50 +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
d277dcd5d7 Windows: cmake: Add newer VS versions 2019-06-11 18:12:29 +02:00
Marshall Greenblatt
939e9f40b5 Windows: Disable custom libc++ for cef_sandbox build (fixes issue #2677) 2019-06-11 18:12:23 +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
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
Marshall Greenblatt
ef06407da6 Windows: Remove d3dcompiler_43.dll
The d3dcompiler_43.dll file was only required on Windows XP, which is no longer
supported.
2019-05-07 15:25:25 -04:00
Marshall Greenblatt
bbabccf9aa Windows: Add d3dcompiler_47.dll version 10.0.17134.12
This change adds the d3dcompiler_47.dll version that was included with Windows
SDK 10.0.17134. The newer version of this file included with Windows SDK
10.0.17763 adds a dependency on the Universal C Runtime (api-ms-win-crt-*.dll)
which might not be installed on Windows 7 (requires KB2999226).
2019-05-07 15:25:25 -04: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
cef882616b Fix NetworkService cache directory structure (see issue #2622).
To test: When running `cefclient --cache-path=c:\temp\cache` with NetworkService
enabled the the cache directory structure should be "C:\temp\cache\Cache"
instead of "C:\temp\cache\cache\Cache".
2019-05-02 14:51:02 -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
0193a3fe54 Fix NetworkService expectations for NavigationTest.Redirect* tests (see issue #2622). 2019-04-30 17:54:17 -04:00
Marshall Greenblatt
fb0133cd4b Fix NetworkService expectations for FrameTest.*Nav tests (see issue #2622). 2019-04-30 17:33:40 -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
Marshall Greenblatt
edd9efd1b3 Fix compile error due to missing override (fixes issue #2652) 2019-04-25 14:23:24 -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
Marshall Greenblatt
07863c0d46 Use net/base/net_error_list.h to populate the cef_errorcode_t enum (fixes issue #2650) 2019-04-16 12:07:33 -04: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
941d53ebfd Fix CHECK on startup when running with --trace-startup=mojom (see issue #2622). 2019-03-27 14:44:11 -04: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
aa42db6e25 automate-git: Fix .gclient file format for updated depot_tools (fixes issue #2639) 2019-03-27 13:03:52 -04:00
Petra Öhlin
04e2728dc2 Mac: cefclient:: Add C++ implementation of BrowserWindowOsrMac::UpdateAccessibilityLocation
This fixes an build break that was introduced by commit af349ad (see issue #2604).
2019-03-26 14:13:55 +00: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
Andrei Kurushin
af349ade33 cefclient: OSR accessibility enhancements (see issue #2604)
- Implement multi-tree support (e.g. page with iframes contains several trees)
- Implement OnAccessibilityLocationChange support
- Add scroll offset calculation
- Fix new Chromium tree layout parsing
- Fix uninitialized OsrAXNode::offset_container_id_
- Fix Windows non ascii AxName, AxValue, AxDescription representation
2019-03-21 16:56:06 +00: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
Marshall Greenblatt
48f7c67587 cefbuilds: Encode plus signs in filenames (see issue #2596) 2019-03-20 09:59:28 -04:00
Riku Palomäki
e5568118ac Don't create cache directories in incognito mode (fixes issue #2289) 2019-03-18 17:22:52 -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
Marshall Greenblatt
e7d8dd5ef7 Enable new version number format by default (see issue #2596)
To continue using the old format set the CEF_OLD_VERSION_FORMAT=1 environment
variable before building.
2019-03-18 16:55:23 -04:00
Chris Dziemborowicz
1b9bc33bcf Mac: Fix undefined C++ symbols in cef_sandbox.a (see issue #2629)
This change updates make_distrib.py to link in all of libc++ and libc++abi from the Chromium build when generating cef_sandbox.a. This increases the size of the release build of cef_sandbox.a from about 0.5 MB to about 2.0 MB, but it ensures that no C++ symbols are imported by the archive.

Linking cef_sandbox.a with an incompatible C++ library prior to this change could cause undefined behavior in the resulting binary.

To make sure that we do not regress this fix, this change also updates make_distrib.py to verify that no C++ symbols are imported by cef_sandbox.a after it is generated (in a way similar to the way we verify that cef_sandbox.a exports the correct symbols).
2019-03-16 17:12:19 +00:00
Marshall Greenblatt
a4f0b4c5fb Linux: cmake: Add xi dependency for cefclient (see issue #1059) 2019-03-15 13:41:48 -04:00
Marshall Greenblatt
872f25dcc6 cefbuilds: Add support for new version number format (see issue #2596) 2019-03-15 13:16:50 -04:00
Marshall Greenblatt
2a40650926 Compute all version numbers using cef_version.py (see issue #2596)
The version format can now be controlled by setting the CEF_OLD_VERSION_FORMAT
environment variable. The old format is currently the default.
2019-03-15 13:16:43 -04:00
Marshall Greenblatt
a76f40eb83 Add cef_api_hash.h generated by the translator tool (see issue #2596)
This splits out the API hashes from the cef_version.h file which is generated at
build time. Changes to the cef_api_hash.h file are committed to the repo and
represent potentially breaking API changes. This commit history will be used to
calculate the version number.
2019-03-14 12:44:24 -04: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
7f1453b294 Linux: Fix cefclient when using component build and tcmalloc.
Link to libbase.so to fix FATAL:content_main_runner_impl.cc(731)]
Check failed: base::allocator::IsAllocatorInitialized().
2019-02-27 19:16:35 +00:00
Riku Palomäki
5f615a95bc Add multi-touch support for OSR (issue #1059) 2019-02-26 11:51:33 -05:00
Marshall Greenblatt
9ba28dd730 Remove V8Test.ContextInvalid which always fails (issue #2435) 2019-02-26 11:50:55 -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
3cf50ed942 Trigger CEF Save As dialog from chrome://net-export (issue #2613) 2019-02-25 13:26:38 -05:00
Marshall Greenblatt
5a1c642431 Update to Chromium version 74.0.3706.0 (#632463) 2019-02-25 12:09:54 -05:00
Marshall Greenblatt
6bfb5ab33b Remove old approach for debugging leaked wrapper object references (issue #2593) 2019-02-14 17:08:44 -05:00
Marshall Greenblatt
3fe062a5b6 Implement new approach for debugging leaked wrapper object references (issue #2593) 2019-02-14 17:08:43 -05:00
Marshall Greenblatt
176e14d451 Add missing header include (issue #1614) 2019-02-14 17:08:42 -05:00
Marshall Greenblatt
feb99571d2 Windows: Use scoped_ptr for VS2015 compatibility (issue #2594) 2019-02-14 17:08:42 -05:00
Marshall Greenblatt
d5be6e3afb Fix extra newline in CEF logging output (issue #1649) 2019-02-13 17:46:58 -05:00
Marshall Greenblatt
359a5b7cb5 Fix undefined reference to `operator<<(std::ostream&, wchar_t const*)' (issue #2553) 2019-02-13 17:46:58 -05:00
Marshall Greenblatt
406e347d6f Linux: Use existing keycodes_x_export.h file (issue #2587) 2019-02-13 17:46:57 -05:00
Riku Palomäki
b5d76b499c Linux: Fixed component build failure due to undefined KeySym functions (issue #2587) 2019-02-13 14:23:10 -05:00
Marshall Greenblatt
7aae02e411 Enable iterator debugging (_ITERATOR_DEBUG_LEVEL=2) for official cef_sandbox Debug builds (issue #2592) 2019-02-13 14:11:54 -05:00
Marshall Greenblatt
8bc348d615 Windows: cefclient: Fix compile error with ATL disabled 2019-02-13 12:43:55 -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
Tyler Johnson
84a5749f9f Squelch attribute warnings from the GNU compiler (issue #2552) 2019-02-06 20:48:09 +00: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
667d190547 Fix TracingTest failures (issue #2583) 2019-02-04 16:36:13 -05:00
Marshall Greenblatt
bf51cd21b6 Update to Chromium version 73.0.3683.0 (#625896) 2019-02-04 11:16:53 -05:00
Marshall Greenblatt
9c50f1bfdb Linux: cefclient: Fix incorrect header path 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
Zacharias Knudsen
c0a7fa392d Linux: cmake: Don't warn about potentially uninstantiated static members. 2019-02-01 21:05:52 +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
Marshall Greenblatt
710021be15 Windows: Fix OSR rendering with shared texture enabled (issue #2559) 2019-01-29 15:52:46 -05:00
Marshall Greenblatt
995dd0ba19 Suppress ERROR messages with log-severity=disable (issue #2581)
Also expose FATAL severity level.
2019-01-29 14:53:46 -05:00
Arnaud Renevier
f962b5863e Fix uninitialized member CefNavigateParams::load_flags (issue #2580) 2019-01-29 17:53:11 +00:00
Marshall Greenblatt
778ee5c60c Fix incorrect OSR IME suggestion background color (issue #2562) 2019-01-28 12:15:17 -05:00
Marshall Greenblatt
a189c5b937 Fix CefResourceHandler leak in DownloadTest.Pending* 2019-01-23 14:47:52 +01:00
Chris Dziemborowicz
e94b3e2478 macOS: Create a CFRunLoop for video-capture and audio services (issue #2573) 2019-01-18 16:47:03 +00:00
Chris Dziemborowicz
7ecc5d31ea Add support for --unsafely-treat-insecure-origin-as-secure flag (issue #2574) 2019-01-18 16:45:31 +00:00
Alexander Guettler
1a86240c93 Update to Chromium version 73.0.3665.0 (#620590) 2019-01-18 11:25:51 +01:00
Marshall Greenblatt
10916749d6 Fix Check failed: frame->IsMain() when loading Worker scripts (issue #2561) 2019-01-17 21:52:45 +01:00
Mike Wiedenbauer
4b5c38eeb4 Improve CefURLRequestJob redirect handling (issue #2542) 2019-01-11 15:12:06 +00:00
Alexander Guettler
5671165308 Fix crash when using external message pump (issue #2571) 2019-01-11 14:40:47 +00:00
Marshall Greenblatt
ae317a5bfd macOS: Export only CEF symbols from cef_sandbox.a (issue #2459) 2019-01-11 11:59:46 +01:00
Alexander Guettler
27fb4694ed Fix crashes when running with multi-threaded message loop (issue #2565) 2019-01-11 11:58:36 +01:00
Alexander Guettler
7f08159461 Fix ReleasePump patch, the unique_ptr was moved to the backend 2019-01-11 10:47:34 +01:00
Marshall Greenblatt
bac8fb5e61 Update copyright year on generated files 2019-01-10 15:22:19 +01:00
Marshall Greenblatt
927869e59e README.md: Add new links. 2018-12-27 12:35:06 +02:00
Marshall Greenblatt
28d24e22d6 Update to Chromium version 72.0.3626.0 (#612437)
- Windows: Can now build with either 10.0.17134 or 10.0.17763 SDK.
2018-12-26 19:15:28 +02:00
Marshall Greenblatt
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
Marshall Greenblatt
91a1286d52 Windows: cefclient: Create a new D3D11 device for each browser (issue #2538)
This fixes a texture resizing issue when creating multiple windows with OSR
and shared textures enabled.
2018-11-15 15:42:53 -05:00
Marshall Greenblatt
3e06fa8271 Revert "Improve CefURLRequestJob redirect handling (issue #2542)"
This reverts commit 7ea19d740d which was added
prematurely.
2018-11-15 15:26:48 -05:00
Marshall Greenblatt
f5a3fd6430 Windows: Add MS BuildTools support to msvs_env.bat (issue #2545) 2018-11-15 15:24:37 -05:00
Mike Wiedenbauer
7ea19d740d Improve CefURLRequestJob redirect handling (issue #2542) 2018-11-14 16:27:06 -05:00
Marshall Greenblatt
919ae45b0f Windows: Fix sandbox link error with binary distribution (issue #2546) 2018-11-13 13:44:59 -05:00
Marshall Greenblatt
285dbb1ce6 macOS: Fix crash when scrolling in OSR mode (issue #2540) 2018-11-06 17:27:26 -05:00
Marshall Greenblatt
bb5fe57984 macOS: Make the NativeEventProcessor protocol dependency optional (issue #2539) 2018-11-06 13:52:09 -05:00
Marshall Greenblatt
1e0c248044 cefclient: Fix new window always on top (issue #1468) 2018-11-05 13:38:41 -05:00
Marshall Greenblatt
a7e997e524 Update to Chromium version 72.0.3599.0 (#604791) 2018-11-05 13:31:55 -05:00
Marshall Greenblatt
07f57223a8 Fix incorrect quota size (issue #2452) 2018-10-26 15:42:39 -04:00
Marshall Greenblatt
315b57e9f7 Update to Chromium version 71.0.3578.0 (#599034) 2018-10-25 12:57:05 -04:00
Marshall Greenblatt
f9ebe693e4 Fix substitution of localized strings for directory listings (issue #2412) 2018-10-19 14:39:54 -04:00
Marshall Greenblatt
15fad89839 Fix ArrayBuffer crashes and add performance test (issue #2521) 2018-10-10 16:12:22 +03:00
Marshall Greenblatt
e4ae534754 Windows: Fix crashes when dragging an image with OSR enabled (issue #2525) 2018-10-10 14:44:23 +03:00
Marshall Greenblatt
49c149c20b Linux: cefclient: Fix crash when creating popup window (issue #1006) 2018-10-10 13:41:34 +03:00
Isaac Devine
c64898f9fc Windows: Fix hidden dropdowns when the window is topmost (issue #1468)
Also add a --always-on-top flag to cefclient to allow easier testing of this
behavior on Windows and Linux.
2018-10-09 12:28:13 +03:00
Marshall Greenblatt
1928572b52 Fix crash using CefCookieManager::SetStoragePath (issue #2522) 2018-10-08 18:57:14 +03:00
Marshall Greenblatt
da53451f97 Update to Chromium version 71.0.3567.0 (#595360)
- Configuration of OSR VSync interval is currently missing (issue #2517)
- Rename VERSION to VERSION.in to fix libc++ compile error (issue #2518)
2018-10-04 12:17:26 +03:00
Marshall Greenblatt
a2bf177a32 macOS: Fix crash when showing a select popup with CefDoMessageLoopWork (issue #2495) 2018-09-28 16:27:32 +02:00
Marshall Greenblatt
dead08bf52 Add missing include for DISALLOW_COPY_AND_ASSIGN 2018-09-28 15:44:47 +02:00
Marshall Greenblatt
8a055593d6 Fix redraw of OSR PDF viewer (issue #2507) 2018-09-27 16:00:45 +02:00
Marshall Greenblatt
48dabc9143 Fix DCHECK when mouse wheel deltas are 0 (issue #2515) 2018-09-27 14:19:54 +02:00
Marshall Greenblatt
e6a3a5b72d Fix crash due to CefRenderHandler::GetViewRect returning 0 size for popup windows (issue #1910) 2018-09-27 10:32:14 +02:00
Marshall Greenblatt
1e6b870af0 cefclient: Add support for shared texture and external BeginFrame in OSR mode (issue #1006) 2018-09-27 10:32:05 +02:00
Greg Wessels
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
Marshall Greenblatt
09afa3a843 Clarify expectations for CefRenderHandler::GetViewRect (issue #1910) 2018-09-25 16:56:44 +02:00
Marshall Greenblatt
64cd460c73 Add disable-javascript command-line flag to match documentation (issue #1848) 2018-09-25 14:01:59 +02:00
Marshall Greenblatt
b9c10cb46e Linux: Add missing return statement (issue #2014) 2018-09-25 13:23:40 +02:00
Marshall Greenblatt
c7d2891058 Fix potential iterator validity issue in RootWindowManager::CloseAllWindows (issue #2514) 2018-09-24 17:14:04 +02:00
Marshall Greenblatt
275af5e972 Linux: Add missing use_gtk check (issue #2014) 2018-09-24 15:45:39 +02:00
Marshall Greenblatt
3a91ccd940 Add TS_PROCESS_OOM termination status (issue #2510) 2018-09-24 10:50:01 +02:00
Marshall Greenblatt
bb61775b61 Fix crash when high contrast themes are enabled (issue #2508) 2018-09-21 16:34:02 +02:00
Marshall Greenblatt
3cdc29aa53 Windows: cmake: Add VS2017 15.8 build support 2018-09-21 11:11:33 +02:00
Marshall Greenblatt
8aa4b7aaae Linux: Add multi-threaded message loop support (issue #2512) 2018-09-20 15:17:35 +02:00
Marshall Greenblatt
c7d187a512 Fix crash when hovering buttons in OSR PDF viewer (issue #2488) 2018-09-14 11:18:10 +02:00
Marshall Greenblatt
f97a241126 Remove Singleton patches which are no longer required (issue #2362) 2018-09-06 21:45:49 +02:00
Marshall Greenblatt
0401e6b912 Windows: Fix DCHECKs during shutdown with multi-threaded message loop mode (issue #2362) 2018-09-06 17:32:01 +02:00
Marshall Greenblatt
869efa155f Fix external message pump (issue #2493) 2018-09-06 14:40:36 +02:00
Marshall Greenblatt
116859456e Linux: Zero initialize MwmHints (issue #2492) 2018-09-06 13:47:57 +02:00
Marshall Greenblatt
0abd08b6cc macOS: Fix crash when closing full-screen window (issue #2491) 2018-09-06 13:46:32 +02:00
Marshall Greenblatt
e8e0f1f6c6 Linux: Remove GTK build dependency (issue #2014) 2018-09-06 02:29:45 -07:00
Marshall Greenblatt
a64237bcb0 Update to Chromium version 70.0.3538.0 (#587811)
Known issues:
- The CefLoadCRLSetsFile function needs to be re-implemented (see issue #2497).
- Linux: GTK2 support has been removed. The cefclient sample needs to be updated
  to use GTK3 (see issue #2014).
2018-09-05 15:42:42 +02:00
Marshall Greenblatt
ea0e213bef Update to Chromium version 70.0.3516.0 (#581409) 2018-08-10 11:31:08 -04:00
Marshall Greenblatt
a659b48fd1 Update to Chromium version 70.0.3507.0 (#578961) 2018-08-02 15:15:23 -04:00
Marshall Greenblatt
4cc3a221c3 macOS: Update README.txt for distribution content changes 2018-07-30 16:15:19 -04:00
Marshall Greenblatt
dec98a5534 macOS: Add support for and enable the V2 sandbox (issue #2459)
The CEF_USE_SANDBOX define is now used on all platforms.
2018-07-27 22:33:31 -04:00
Marshall Greenblatt
fcad76b405 macOS: Load the CEF framework using dlopen instead of direct linking (issue #2459)
This is a prerequisite for using the Chromium V2 sandbox.
2018-07-27 17:36:49 -04:00
Marshall Greenblatt
0fb03e7aa1 macOS: Fix OSR configuration of device scale factor 2018-07-25 16:55:11 -04:00
Marshall Greenblatt
7f3c21b64a macOS: Add angle and swiftshader libraries to the app bundle (issue #2446)" 2018-07-25 15:18:24 -04:00
Marshall Greenblatt
339ce47575 macOS: Add the LSEnvironment variable MallocNanoZone=0 (see https://crbug.com/861939) 2018-07-25 14:23:54 -04:00
Marshall Greenblatt
7d09642925 Update to Chromium version 69.0.3497.0 (#576753) 2018-07-24 12:15:30 -04:00
Alexander Guettler
fad6aec5d0 Add MouseWheelPhaseHandler for OSR (issue #2214) 2018-07-13 15:50:16 -04:00
Marshall Greenblatt
96bd993d99 Update to Chromium version 69.0.3489.0 (#574445) 2018-07-13 15:29:39 -04:00
Marshall Greenblatt
8e9d736cda Windows: Fix failure in tools/clang/scripts/update.py with custom VS toolchain (issue #2474) 2018-07-12 14:53:36 -04:00
Marshall Greenblatt
6a76bdb040 Revert "Disable cfi-icall which is not supported by the CEF bindings layer (issue #2472)"
This reverts commit 66b5dc3d55.
2018-07-12 10:58:49 -07:00
Marshall Greenblatt
cf5b322efc Linux: Fix cfi-icall failure in atk_util_auralinux_gtk2.cc (issue #2472) 2018-07-12 10:58:29 -07:00
Marshall Greenblatt
7139f01103 Fix cfi-cast failure in CefBrowserMessageLoop::current (issue #2472) 2018-07-12 10:58:29 -07:00
Marshall Greenblatt
0d12959a50 Disable cfi-icall checks for CEF bindings (issue #2472) 2018-07-12 10:58:29 -07:00
Marshall Greenblatt
10c01ff43e Remove include/base/cef_thread_collision_warner.h which is unused and causes linker errors with CFI builds (issue #2472) 2018-07-12 10:58:29 -07:00
Marshall Greenblatt
66b5dc3d55 Disable cfi-icall which is not supported by the CEF bindings layer (issue #2472) 2018-07-11 12:32:48 -04:00
Marshall Greenblatt
f12ad6b634 Add missing include 2018-07-09 16:12:39 -04:00
Marshall Greenblatt
5bf4d4febd Fix passing of lang command-line flag to the renderer (issue #2468) 2018-07-09 16:10:03 -04:00
Marshall Greenblatt
448a112352 CefFrame::GetURL in the renderer process should return the provisional URL for popups during loading (issue #2448) 2018-07-09 14:36:37 -04:00
Marshall Greenblatt
9229cdd0eb Remove CefSettings.single_process. This mode is not supported and CefSettings makes it too easy to enable. The command-line flag still exists. 2018-07-09 13:31:32 -04:00
Alexander Guettler
9e22c975fa Windows: Remove /llvmlibthin from link command (issue #2470) 2018-07-09 11:37:13 -04:00
Marshall Greenblatt
6301e06c8a Update to Chromium version 69.0.3483.0 (#572879) 2018-07-09 11:23:23 -04:00
Kudo Chien
123324f5f9 Fix PDF print and save buttons (issue #2463). 2018-07-05 18:32:01 +00:00
Marshall Greenblatt
eb3325a9ae Fix application of DEPS.patch for 3029 branch 2018-07-05 14:24:49 -04:00
Marshall Greenblatt
2d48a07bec Update to Chromium version 69.0.3476.0 (#571360) 2018-07-03 13:48:07 -04:00
Marshall Greenblatt
669e8673ce Linux: cmake: Don't warn about code in comments (issue #2346) 2018-06-27 12:47:39 -04:00
Marshall Greenblatt
b03c54bfbe Linux: Use poll instead of select to fix crash during startup (issue #2466) 2018-06-27 12:40:59 -04:00
Marshall Greenblatt
35830c88e5 Update to Chromium version 69.0.3464.0 (#567918) 2018-06-19 15:49:32 -04:00
Cristian Amarie
3c3045a5cb Add http:// prefix to browser creation URLs if necessary (issue #2427) 2018-06-15 20:14:47 +00:00
Marshall Greenblatt
b25374c8e7 Pass BrowserProcessSubThread to ContentMainDelegate::RunProcess (issue #2456) 2018-06-15 15:55:54 -04:00
Marshall Greenblatt
4f28c5ffff Windows: cmake: Add VS2017 15.6 & 15.7 build support 2018-06-12 14:40:30 -04:00
Marshall Greenblatt
12043b16e7 Update to Chromium version 69.0.3453.0 (#565531) 2018-06-12 14:16:03 -04:00
Marshall Greenblatt
d9ebd4c50f Switch DevTools to the default view that doesn't show screencast 2018-06-07 12:57:46 -04:00
Marshall Greenblatt
f6f2c9a0ca Update to Chromium version 68.0.3440.0 (#561733) 2018-06-04 12:43:08 -04:00
Marshall Greenblatt
21310e4374 macOS: Fix rendering with surface synchronization (issue #2447) 2018-05-31 16:34:44 -04:00
Marshall Greenblatt
08ff72fa20 Update to Chromium version 68.0.3433.0 (#559327)
Known issues:
- Windows now requires VS 2017 15.7.1 with 10.0.17134.0 SDK.
2018-05-22 17:03:01 +03:00
Marshall Greenblatt
12cc069b69 Improve reliability of automate-git.py --fast-update, add --resave (issue #2435) 2018-05-21 14:06:35 +03:00
Marshall Greenblatt
cd27cbc802 Update to Chromium version 68.0.3425.0 (#557062)
Known issues:
- Surface synchronization is now enabled for OSR, see issue #2447.
- Jumbo build is broken, fixed in https://crrev.com/868717ce.
2018-05-21 13:54:23 +03:00
Marshall Greenblatt
a9f0fa9dfe Update to Chromium version 68.0.3416.0 (#554961) 2018-05-19 12:35:20 +03:00
Marshall Greenblatt
240ba800ed Update to Chromium version 68.0.3409.0 (#553714)
Known issues:
- Download fails with empty cache path due to https://crrev.com/950748a25f.
  Fixed in https://crrev.com/087ef223ac.
2018-05-18 13:07:14 +03:00
Marshall Greenblatt
84e2286995 Update to Chromium version 68.0.3403.0 (#552595) 2018-05-16 21:03:56 +02:00
Marshall Greenblatt
58413e16b1 Fix usage of automate-git.py --fast-update with new checkouts (issue #2435) 2018-05-16 20:27:39 +02:00
Marshall Greenblatt
58e2e4b23d Support less error-prone update of just CEF changes with automate-git.py --force-cef-update (issue #2435) 2018-05-16 18:37:37 +02:00
Marshall Greenblatt
77dc8157d0 Use absolute path to avoid execution failure with automate-git.py --test-prefix=xvfb-run (issue #2435). 2018-05-16 11:27:33 +03:00
Marshall Greenblatt
8426da0de6 Update to Chromium version 68.0.3399.0 (#551554) 2018-05-16 11:23:34 +03:00
Marshall Greenblatt
66484d799e Support analysis of Chromium update status with automate-git.py --log-chromium-changes (issue #2435) 2018-05-15 17:06:49 +03:00
Marshall Greenblatt
dcf533cc3c Fix patching of files with Windows line endings on Posix systems 2018-05-15 03:42:16 -07:00
Marshall Greenblatt
67708d07f2 Support running tests with automate-git.py --run-tests (issue #2435) 2018-05-14 13:43:36 +03:00
Marshall Greenblatt
d1d4f7a3ef Improve handling of patches during Chromium update (issue #2435) 2018-05-11 14:09:26 +03:00
Marshall Greenblatt
46e8152b6d Support automatic Chromium updates with automate-git.py --chromium-channel=canary (issue #2433) 2018-05-08 16:33:59 +02:00
Marshall Greenblatt
1f4f8f4af7 Support faster incremental Chromium/CEF updates with automate-git.py --fast-update (issue #2435). 2018-05-08 10:29:07 +02:00
Marshall Greenblatt
f24f885eeb Fix DCHECK due to unreliable is_main_frame state on XHR requests (issue #2433) 2018-05-04 16:42:02 +02:00
Marshall Greenblatt
a3c55f1d26 Update to Chromium revision 9ef2aa86 (#550428) 2018-05-04 10:50:26 +02:00
Cristian Amarie
f6c9a96a12 Add missing space at the end of verbose build command (issue #2431). 2018-05-01 15:55:47 +00:00
Felix Bruns
4b33c17533 Add user_gesture parameter to OnBeforeBrowse (issue #1526) 2018-04-27 15:11:53 +00:00
Marshall Greenblatt
0677d0d9de Linux: Fix startup hang on Ubuntu 16.04.4 (issue #2424) 2018-04-13 21:21:17 -04:00
Marshall Greenblatt
64d86a7397 Linux: Fix ASAN link error: odr-violation: global 'typeinfo name for std::exception' (see https://crbug.com/832808) 2018-04-13 17:30:17 -04:00
Marshall Greenblatt
87e33b1692 Linux: Fix crash when closing popup after printing (issue #2422) 2018-04-12 14:35:57 -04:00
Christopher Cifra
4315f3b724 Add support for V8 ArrayBuffers (issue #244) 2018-04-10 16:05:19 -04:00
Mike Wiedenbauer
bb28b85bdd Add CefDisplayHandler::OnLoadingProgressChange callback (issue #2382) 2018-04-10 13:52:31 -04:00
Mike Wiedenbauer
90863b8c5d Add ability to stop CefURLRequest on redirect (issue #1329) 2018-04-10 13:05:18 -04:00
Mike Wiedenbauer
c3f5e6463c Add OSR text selection changed handler and remove hard-coded test bounds (issue #2383) 2018-04-09 13:50:19 -04:00
Marshall Greenblatt
b220672c42 Fix compile error due to commit acb0922 (issue #2415) 2018-04-02 17:17:40 -04:00
Marshall Greenblatt
acb0922500 Fix crashes loading chrome://system with extensions disabled (issue #2415) 2018-03-29 13:58:52 -04:00
Marshall Greenblatt
b44919e3c5 Allow empty username parameter to CefAuthCallback::Continue (issue #2275) 2018-03-28 19:29:28 -04:00
Marshall Greenblatt
a1f47abaf6 Don't include locales/*.info files in distribution (issue #2375) 2018-03-28 18:20:10 -04:00
Marshall Greenblatt
ff8aa46e5e Support override of crash_reporter.cfg settings with environment variables (issue #2413) 2018-03-28 17:15:05 -04:00
Marshall Greenblatt
d4ec164297 Windows: Fix crash report upload failure on Windows 7 (see https://crbug.com/826564). 2018-03-28 16:02:11 -04:00
John Mayhew
e312a35ef3 Change CefFrame::GetName() to return assigned name if it is non-empty before returning unique name (issue #2403) 2018-03-28 17:30:15 +00:00
Marshall Greenblatt
3018e1866b Linux: Update to Debian sid sysroot (issue #2409) 2018-03-28 12:42:55 -04:00
Marshall Greenblatt
7a59914f97 Update to Chromium revision 66afc5e5 (#540276) 2018-03-22 16:56:23 -04:00
Marshall Greenblatt
4fb6e1ba29 macOS: Fix undesirable switch to discrete GPU during startup (issue #2398) 2018-03-16 14:04:16 -04:00
Marshall Greenblatt
e030236c36 Add CefCookieManager::GetBlockingManager (issue #2374) 2018-03-14 21:40:37 -04:00
Marshall Greenblatt
a98c6b1f52 Linux: Fix creation of client distribution 2018-03-08 10:55:05 -05:00
Marshall Greenblatt
5b136976e9 Revert "Linux: Add missing build dependency"
This commit causes the following build error when use_sysroot=true:

../../third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc:17:10: fatal error: 'curl/curl.h' file not found
         ^~~~~~~~~~~~~
1 error generated.

This reverts commit cd6ff760dd.
2018-03-08 10:54:57 -05:00
Marshall Greenblatt
56bbee8efb cmake: Linux: Add missing binaries (issue #2394) 2018-02-27 15:37:19 -05:00
Marshall Greenblatt
cd6ff760dd Linux: Add missing build dependency 2018-02-27 12:31:13 -05:00
Alfred Reynolds
5caccda56c Fix crash due to by delayed execution of JS functions on destroyed windows (issue #2038) 2018-02-22 15:38:12 -05:00
Dmitry Azaraev
3b499d3d11 Add unit test for crash due to by delayed execution of JS functions on destroyed windows (issue #2038) 2018-02-22 15:37:55 -05:00
Tobias Taschner
cca0bcc8e0 Windows: cmake: Add CEF_RUNTIME_LIBRARY_FLAG for overriding VS runtime type. 2018-02-22 20:00:09 +00:00
Mike Wiedenbauer
39ccd85d77 Fixes encoding issues when using a custom resource handler (issue #1906). 2018-02-22 19:05:54 +00:00
Marshall Greenblatt
0ac37cefa1 Fix OSR transparency problems (issue #2212, issue #2345) 2018-02-22 13:05:53 -05:00
Alexander Guettler
36668efc2f Fix input range handle does not follow mouse cursor with OSR (issue #2189) 2018-02-22 17:09:28 +00:00
Marshall Greenblatt
a5a5e7ff08 Windows: Fix per-monitor DPI scaling of top-level browser windows and placement of context menus (issue #2313) 2018-02-21 16:58:54 -05:00
Marshall Greenblatt
57b9cf9ddd Windows: Add per-monitor DPI support (issue #2313) 2018-02-20 17:33:25 -05:00
Marshall Greenblatt
57fb011377 Fix test flakyness in renderer process OnLoadingStateChange history state 2018-02-20 13:51:59 -05:00
Marshall Greenblatt
9e644b7538 Update to Chromium revision bc084a8b (#530369) 2018-02-19 17:38:04 -05:00
Marshall Greenblatt
ac86b61139 Remove geolocation API support (issue #2380) 2018-02-12 18:51:11 -05:00
Marshall Greenblatt
c3f2c2e91c Fix style issues from commit de1bd28 2018-02-12 18:13:51 -05:00
Marshall Greenblatt
de1bd286f8 Enable browser-side navigation by default and remove CefRenderHandler::OnBeforeNavigation (issue #2290) 2018-02-12 18:01:43 -05:00
Marshall Greenblatt
98de8e79db Fix crash when plugin is not found (issue #2379) 2018-02-12 16:24:02 -05:00
Marshall Greenblatt
d34d3d1b3b Add callbacks for network request access to cookies (issue #2374) 2018-02-06 16:06:44 -05:00
Marshall Greenblatt
d7e1312e9d Fix crashes when loading Flash plugins with extensions disabled (issue #2359) 2018-02-02 19:02:07 -05:00
Marshall Greenblatt
a2f430c6f3 Initialize required KeyedServiceFactories when extensions are disabled (issue #2359) 2018-02-02 17:44:08 -05:00
Marshall Greenblatt
128fbfb2d6 Fix crash when clicking PDF link (issue #2371) 2018-02-02 16:28:03 -05:00
Marshall Greenblatt
6006f77bd9 msvs_env.bat: Fix VS2017 path discovery and avoid CWD change (issue #2350, issue #2351) 2018-01-05 13:30:05 -05:00
Marshall Greenblatt
232f6bc427 Return Chrome 'Browser' value for DevTools remote debugging (issue #2300) 2018-01-04 18:52:30 -05:00
Marshall Greenblatt
50ca6928c3 Add CefURLRequest::ResponseWasCached method (issue #2283) 2018-01-03 16:14:29 -05:00
Marshall Greenblatt
1c7391b70a Update generated file copyright year 2018-01-03 15:46:26 -05:00
Marshall Greenblatt
0cd8169125 macOS: cmake: Don't create target name with spaces (issue #2342) 2018-01-03 15:03:15 -05:00
Dan Kegel
6e457d6bb1 - Linux: Disable gcc warning about code in comments (issue #2346).
- macOS: Fix clang warning about display_unittest.cc missing a newline (issue #2347).
2018-01-03 13:53:38 -05:00
Marshall Greenblatt
8b4b6ac2ed Linux: Fix crash when canceling the print dialog (issue #2341) 2018-01-02 13:51:02 -08:00
Dan Kegel
3750c59aaa Linux: Switch to Debian Stretch sysroot (issue #2343) 2018-01-02 14:32:32 -05:00
Marshall Greenblatt
7b3d7b8575 Return correct 'Browser' value for DevTools remote debugging (issue #2300) 2017-12-27 17:35:15 -05:00
Marshall Greenblatt
e5d0cfe639 Fix proxy service initialization (issue #2066) 2017-12-27 16:38:34 -05:00
Marshall Greenblatt
f02e7b54b3 cmake: Fix detection of tests folder 2017-12-27 15:50:38 -05:00
Marshall Greenblatt
accf1f1613 Windows: cmake: Add VS2017 15.5 build support 2017-12-27 15:50:21 -05:00
Marshall Greenblatt
a724e90d52 Windows: Fix 64-bit build warning C4267 (issue #2335) 2017-12-27 15:49:52 -05:00
Marshall Greenblatt
4ddff77339 Merge webkit_set target into //WebKit/source/controller to fix deps race (issue #2339) 2017-12-27 13:20:12 -05:00
Marshall Greenblatt
54a015f785 Fix crash when ALT+Clicking invalid protocol link (issue #2306) 2017-12-22 16:05:32 -05:00
Marshall Greenblatt
f052e282dd Fix crash when using CefJSDialogHandler with the default dialog implementation (issue #2329) 2017-12-21 16:47:20 -05:00
Marshall Greenblatt
2fe9f7bd31 Windows: Fix x64 compile error (issue #2332) 2017-12-21 15:43:29 -05:00
Marshall Greenblatt
cafa5954dc Fix crash when creating JS popup with no URL (issue #2330) 2017-12-21 14:57:42 -05:00
Marshall Greenblatt
d8bc3d8372 Fix assertion when calling SendProcessMessage from non-UI thread (issue #2325) 2017-12-19 15:14:00 -05:00
SergeyAvd
4c5ccce85f Fix typos in the comments that generate the documentation 2017-12-18 18:46:41 -05:00
Mario Pistrich
552a3bf353 Add log level to CefDisplayHandler::OnConsoleMessage (issue #2234) 2017-12-18 18:36:56 -05:00
Marshall Greenblatt
c04652d193 Windows: Fix ui/base/ui_features.h file not found component build error 2017-12-18 18:32:53 -05:00
Andrei Kurushin
56557833d9 Windows: Fix non x2 HiDPI OSR paint crop (issue #2299) 2017-12-18 19:37:36 +00:00
Marshall Greenblatt
6a9a51222e Fix README typo 2017-12-18 14:18:03 -05:00
Marshall Greenblatt
14c030174e Linux: Add missing swiftshader binaries to distribution (issue #2321) 2017-12-18 11:07:45 -08:00
Marshall Greenblatt
8d51acb9be Update to Chromium revision 5fdc0fab (#520840)
- Windows now builds with clang by default.
2017-12-14 15:31:07 -05:00
Marshall Greenblatt
d5e141648b Fix OSR accessibility tests (issue #2312) 2017-12-12 15:57:46 -05:00
Tammo Hinrichs
4c795f5188 OSR: Fix GPU->CPU readback performance issues (issue #2046) 2017-12-05 13:05:12 -05:00
Marshall Greenblatt
7fe13d87c6 Fix accessibility information (issue #2312) 2017-12-04 14:20:06 -05:00
Marshall Greenblatt
7dcabf547b macOS: Fix build of widevinecdmadapter.plugin (issue #2314) 2017-12-04 12:41:57 -05:00
Marshall Greenblatt
69178d519e Fix bugs and test failures with browser-side navigation (issue #2290) 2017-11-30 18:20:24 -05:00
Per Lundberg
493bec52c9 README.md: Update CefSharp link 2017-11-30 15:37:05 -05:00
amaitland
b14167ad04 cmake: Don't require test projects with minimal distribution (issue #2169) 2017-11-30 15:36:58 -05:00
Tamas Lustyik
85d041c0e2 Making it possible to bridge C++ wrapper classes to C (issue #2311). 2017-11-28 15:57:10 +00:00
Tamas Lustyik
be2160e6c3 macOS: Added guard to previously overlooked C++ include (issue #2297) 2017-11-28 15:52:00 +00:00
Marshall Greenblatt
232a68480e cmake: Add v8_context_snapshot.bin binary file 2017-11-27 12:18:05 -05:00
Marshall Greenblatt
facee1f750 - Add cache awareness to CefURLRequest (issue #2283)
- Properly set referer values on server requests (issue #2278)
2017-11-17 17:14:05 -05:00
Marshall Greenblatt
7e783d6a37 Linux: Fix missing ui::Service symbols (issue #2294) 2017-11-16 12:23:51 -05:00
Marshall Greenblatt
059ed41926 Linux: Don't generate Chromium installer packages (issue #2301) 2017-11-15 19:28:16 -05:00
Marshall Greenblatt
7840b4f406 Enable Brotli encoding (issue #2303) 2017-11-15 17:21:34 -05:00
Lk Xf
4a6e9b636e Allow inclusion of cef_application_mac.h from pure C/ObjC (issue #2297) 2017-11-15 19:55:16 +00:00
Marshall Greenblatt
89a1f2b372 Add CefServer API for handling HTTP/WebSocket requests (issue #2278) 2017-11-15 12:00:36 -05:00
Marshall Greenblatt
bfdc2655ad Windows: Add VS2017.4 build support 2017-11-01 16:27:40 -04:00
Marshall Greenblatt
51136f6541 cmake: Fix accidental version dependency break (issue #2293) 2017-11-01 16:27:34 -04:00
Marshall Greenblatt
9f7bdcf7d5 Don't create 'GPUCache' and 'databases' directories when cache-path is unspecified (issue #2289) 2017-10-30 16:52:39 -04:00
Marshall Greenblatt
486e69e23b Windows: Add missing swiftshader binaries to distribution (issue #2291) 2017-10-30 14:49:25 -04:00
Marshall Greenblatt
c506c8c5c0 Windows: Don't recommend is_win_fastlink=true with VS2017 (issue #1691) 2017-10-27 19:02:59 -04:00
Marshall Greenblatt
4787b45db2 Resolve request mapping issues with swapped out frames and browser-side navigation (issue #2290) 2017-10-26 15:58:57 -04:00
Marshall Greenblatt
2733a561e4 Disable browser-side navigation by default (issue #2290) 2017-10-26 15:58:49 -04:00
Marshall Greenblatt
9334a09176 Set the correct response status on internal redirects 2017-10-26 15:58:43 -04:00
Marshall Greenblatt
8b4980b4ca Update to Chromium revision adb61db1 (#508578) 2017-10-26 15:58:05 -04:00
Marshall Greenblatt
c80264ab11 Add "win-rt-app" command-line flag to disable MITIGATION_STRICT_HANDLE_CHECKS
and avoid sandboxed renderer process crash in WinRT apps (issue #2274)
2017-09-29 11:17:36 +02:00
Marshall Greenblatt
607a1d9f49 Add chrome.tabs.create API support (issue #1947) 2017-09-28 15:41:10 +02:00
Marshall Greenblatt
3006329678 Simplify PrefService initialization (issue #1947) 2017-09-25 15:12:12 +02:00
Marshall Greenblatt
f372e90025 Linux: Fix client termination (issue #2268) 2017-09-21 07:05:36 -07:00
Marshall Greenblatt
6bcbefa5fc Fix task runner checking 2017-09-21 14:23:02 +02:00
Marshall Greenblatt
b0edce9c9d Windows: Add missing pe_image.lib to cef_sandbox.lib (issue #2266) 2017-09-20 11:34:30 +02:00
Kaustubh Vats
c95b92f1e8 macOS: Fix horizontal scrolling with trackpad (issue #2261) 2017-09-13 16:47:43 +00:00
Marshall Greenblatt
c1269e105d automate-git.py: Fix application of DEPS.patch 2017-09-12 15:57:56 -04:00
Marshall Greenblatt
3f48f8ec54 Linux: Fix 32-bit build fails with ld.gold: internal error in get_section_contents, at icf.cc:467 (issue #2256) 2017-09-12 13:22:39 -04:00
Ryan Shetley
d8a602ed2f Add support for Chrome Storage Extension API (issue #1947)
- Supports chrome.storage.local and chrome.storage.sync
- chrome.storage.sync behaves identically to chrome.storage.local
2017-09-11 18:42:30 +00:00
Marshall Greenblatt
a028976ac4 Update to Chromium revision fa6a5d87 (#499098) 2017-09-07 17:29:47 -04:00
Marshall Greenblatt
22d2fc50d1 Add QUIC protocol configuration support (issue #2184) 2017-09-05 14:21:56 -04:00
Marshall Greenblatt
05cddc2490 Windows: Fix crash during window creation (see https://crbug.com/761389) 2017-09-05 11:41:34 -04:00
Marshall Greenblatt
ed5208366c Windows: Wait for WM_NCDESTROY before calling OnBeforeClose (issue #2248) 2017-08-31 18:10:51 -04:00
Ryan Shetley
dddfce456c Add support for Chrome Alarms Extension API (issue #1947) 2017-08-30 11:46:21 +00:00
Marshall Greenblatt
64e6971099 views: Linux: Support CefWindowDelegate::CanResize restriction 2017-08-25 18:42:10 -04:00
Marshall Greenblatt
7f6c18af09 Fix shutdown assertion in SchemaRegistryServiceFactory after loading chrome://system 2017-08-25 18:42:10 -04:00
Marshall Greenblatt
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
Sergey Linev
5b12134a45 Linux: Fix error: suggest explicit braces to avoid ambiguous ‘else’ [-Werror=dangling-else] with gcc 7.1 2017-08-11 16:56:52 +00:00
Marshall Greenblatt
76eb49196e Fix crash loading chrome://net-internals 2017-08-10 16:58:05 -04:00
Marshall Greenblatt
b153ba46db Fix Widevine DRM loading 2017-08-09 14:56:17 -04:00
Marshall Greenblatt
7b94ec0c8b views: Fix LabelButton size calculation 2017-08-08 19:44:52 -04:00
Marshall Greenblatt
f229796a39 Update to Chromium revision ff259bab (#488528) 2017-07-28 18:30:34 -04:00
Marshall Greenblatt
6da2bbf229 Windows: Fix dialog loading for component build (issue #1617) 2017-07-24 12:14:27 -04:00
Marshall Greenblatt
85c945bc00 Add missing deps for component build (issue #1617) 2017-07-19 12:41:18 -04:00
Marshall Greenblatt
0c24e90b44 Fix errors on gclient sync of older release branches (issue #2211) 2017-07-18 17:07:23 -04:00
Marshall Greenblatt
1aea3a06a5 Linux/Mac: Fix handling of command-line arguments (issue #2208) 2017-07-18 13:57:04 -07:00
Marshall Greenblatt
796c7b6c59 Windows: Build cef_sandbox.lib with different GN args for official binary distributions (issue #2220) 2017-07-18 15:52:18 -04:00
Marshall Greenblatt
700123d3eb Add support for loading certificate revocation lists (issue #2213) 2017-07-11 15:44:35 -04:00
Marshall Greenblatt
b216f427f6 Add component build support (issue #1617) 2017-07-06 18:22:13 -04:00
Marshall Greenblatt
c080187908 Fix incorrect OSR browser display during navigation (issue #2209) 2017-07-05 15:18:52 -04:00
Marshall Greenblatt
75acd20e9a Fix OSR PDF mouse events after keyboard input (issue #2078) 2017-06-30 16:30:30 -04:00
Marshall Greenblatt
8e69e3dcea Windows/macOS: Fix incorrect clear of buffer during software rendering (issue #2197) 2017-06-23 18:37:49 -04:00
Marshall Greenblatt
cb0dfccddc Fix OSR PDF mouse wheel scrolling (issue #2078) 2017-06-23 15:28:56 -04:00
Marshall Greenblatt
2773518869 Windows: cefclient: Fix ATL-related build errors (issue #2200) 2017-06-19 15:00:18 +03:00
Marshall Greenblatt
70a01250e1 Linux: Don't pass NULL CefBrowser to PrintHandler::GetPdfPaperSize (issue #2199) 2017-06-17 12:49:41 +03:00
Marshall Greenblatt
dce5d5c28f Linux: Pass CefBrowser to CefPrintHandler callbacks (issue #2196) 2017-06-15 08:58:54 -07:00
Marshall Greenblatt
5918d426b3 Fix gtest path (issue #2188) 2017-06-13 17:09:59 +03:00
Marshall Greenblatt
943ffb217b macOS: Fix error: unknown type name 'size_t' 2017-06-05 15:38:49 +03:00
Marshall Greenblatt
09f021be88 Linux: Update to debian jessie sysroots 2017-06-05 15:38:42 +03:00
Marshall Greenblatt
5c79944b31 Update to Chromium revision d483fb77 (#474934)
- CefLifeSpanHandler::OnBeforePopup is now called on the UI thread.
- Remove CefBrowserSettings.javascript_open_windows which is no
  longer supported.
2017-06-02 05:55:23 -07:00
Marshall Greenblatt
12150b43d2 Apply yapf formatting to all Python files (issue #2171) 2017-05-28 15:04:18 +02:00
Marshall Greenblatt
59606b88d2 Update tooling to use yapf for Python file formatting (issue #2171) 2017-05-28 15:03:42 +02:00
Marshall Greenblatt
d4f06e3806 Move matching h file to top of header list (issue #2171) 2017-05-19 11:11:18 +02:00
Marshall Greenblatt
f6eb19f8d6 Fix discovery of the .clang-format file (issue #2171) 2017-05-19 11:00:44 +02:00
Marshall Greenblatt
24e20aec0f Fix duplicate definition of MSVC_PUSH_DISABLE_WARNING (issue #2171) 2017-05-18 12:30:06 +02:00
Marshall Greenblatt
31d9407ee2 Apply clang-format to all C, C++ and ObjC files (issue #2171) 2017-05-18 12:30:05 +02:00
Marshall Greenblatt
a566549e04 Update tooling to use clang-format (issue #2171) 2017-05-18 12:30:04 +02:00
Nishant Kaushik
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
Marshall Greenblatt
64fcfa6068 Linux: cefclient: Add OSR drag&drop implementation (issue #2008) 2017-05-11 12:06:32 -07:00
Marshall Greenblatt
67e23b472a Expose drag image via CefDragData (issue #1715) 2017-05-11 14:22:21 -04:00
Marshall Greenblatt
eaa0942690 Make CMake target settings private (issue #2007) 2017-05-11 13:43:38 -04:00
Marshall Greenblatt
49d1fe3b30 CMake configuration improvements (issue #2120)
- Windows: Fix excessive Ninja build warnings.
- Windows: Fix ATL detection for different VC toolchain paths.
- Windows: Fix Ninja Debug build when official build sandbox is enabled.
- Update build tool version recommendations.
2017-05-11 13:19:35 -04:00
Marshall Greenblatt
eea39b8413 Windows: Fix wrong calling convention with gcc compiler (issue 1209) 2017-05-10 16:26:11 -04:00
Marshall Greenblatt
b28a6145a1 Make the CefAuthCallback::Continue password parameter optional (issue #1928) 2017-05-10 12:16:53 -04:00
Marshall Greenblatt
7a02419cac Fix crash when parent is destroyed during popup creation (issue #2041) 2017-05-09 18:54:34 -04:00
Marshall Greenblatt
1347fec298 Remove unused function (issue #1853) 2017-05-09 17:14:02 -04:00
Marshall Greenblatt
51e8c53f30 Remove CefForceShutdown and make failure to call CefShutdown a DCHECK instead (issue #1932) 2017-05-09 15:52:52 -04:00
Marshall Greenblatt
77097ffab7 Remove the CefSettings.context_safety_implementation option (issue #1853).
The default hash implementation will now always be used.
2017-05-09 15:29:27 -04:00
Andrew Warnick
96f9108343 Fix crash when a resource is cancelled due to browser closing (issue #2165) 2017-05-09 15:30:48 +00:00
Marshall Greenblatt
e5ad5a8fcd Fix DCHECK during Find (issue #2050) 2017-05-05 15:34:20 -04:00
Marshall Greenblatt
86c329e790 Linux: Fix DCHECK during GPU feature info detection. 2017-05-04 16:58:47 -07:00
Marshall Greenblatt
3f970689a0 Popups must share the parent context to avoid crashes on parent browser destruction (issue #2162) 2017-05-04 18:17:24 -04:00
Marshall Greenblatt
5a5b538af7 macOS: Fix incorrect creation of NSAutoreleasePool (issue #2160) 2017-04-28 17:49:23 -04:00
Marshall Greenblatt
6d97cfb761 cefclient: macOS: Fix Xcode 5 compile error (issue #2116) 2017-04-28 17:19:29 -04:00
Marshall Greenblatt
b85e69a94c Add support for WebRTC screen sharing (issue #1065) 2017-04-28 16:39:37 -04:00
Marshall Greenblatt
03e25c778a Exit early when patches fail to apply (issue #2012) 2017-04-27 15:20:50 -04:00
Marshall Greenblatt
6a603af993 Fix IndexedDB quota (issue #2070) 2017-04-27 14:59:31 -04:00
Marshall Greenblatt
4fe6ac0d4b Use git apply for applying patch files (issue #1825) 2017-04-27 13:53:32 -04:00
Marshall Greenblatt
a2b8c250a8 Windows: Revert early chrome_elf crashpad initialization (issue #2122) 2017-04-27 13:20:33 -04:00
Marshall Greenblatt
0a2b82757a cefclient: macOS: Fix crash during shutdown from full-screen (issue #2158) 2017-04-26 15:17:49 -04:00
Marshall Greenblatt
f440f850ef cefclient: macOS: Fix CefBrowser leak during OSR shutdown (issue #2151) 2017-04-26 15:05:12 -04:00
Marshall Greenblatt
f2b988a0ce Windows: Fix crash on touch press text selection (issue #2149) 2017-04-26 12:49:30 -04:00
Marshall Greenblatt
10fccbd6cf Windows: Fix VS2008 compile error (issue #2155) 2017-04-26 12:15:59 -04:00
Marshall Greenblatt
3f71138d64 Update to Chromium revision a106f0ab (#464641)
- Remove CefWindowInfo.transparent_painting_enabled. Set
  CefBrowserSettings.background_color to an opaque or transparent
  value instead.
2017-04-24 15:14:47 -04:00
Marshall Greenblatt
2f6475c0d8 Fix print to PDF (issue #2129) 2017-04-06 11:20:07 -04:00
Marshall Greenblatt
33b52839c6 cmake: macOS: Add Xcode 8.3 build support (issue #2140) 2017-04-05 13:30:18 -04:00
Marshall Greenblatt
b66cddb919 cefclient: Linux: Fix order and timing of OSR key events (issue #2139) 2017-04-04 12:39:01 -04:00
Marshall Greenblatt
aacc3aae9a crash_server.py: Add support for chunked requests 2017-03-28 16:17:18 -04:00
Marshall Greenblatt
e7ac0d0ff5 Add PDF print scale factor setting (issue #2106) 2017-03-16 17:47:40 -04:00
Marshall Greenblatt
c6838d8ca8 Fix DevTools inspect element at (issue #2115) 2017-03-16 17:13:06 -04:00
Marshall Greenblatt
bab532b35b Fix opening of popups from sandboxed iframes (issue #2121) 2017-03-15 18:04:16 -04:00
Marshall Greenblatt
608f2d4170 Fix CHECK failure in CefBrowserHostImpl::DidFinishNavigation (issue #2125) 2017-03-15 17:07:01 -04:00
Marshall Greenblatt
54647945f1 Update to Chromium revision 939b32ee (#454471) 2017-03-08 13:33:05 -08:00
Marshall Greenblatt
fe68aee82c Persist DevTools preferences with CefSettings.persist_user_preferences (issue #2077) 2017-02-28 17:41:11 -05:00
Marshall Greenblatt
d2f48f6e08 Windows: Fix VS2010 compile error 2017-02-28 15:41:31 -05:00
Marshall Greenblatt
7de882ece3 cmake: Update target platform versions (issue #2109)
- macOS: Allow selection of 10.11 SDK and set target version to 10.9 SDK.
- Windows: Set target version to Windows 7.
2017-02-28 15:26:28 -05:00
Marshall Greenblatt
70f51c972a Fix configuration of CefSettings.framework_dir_path (issue #2110) 2017-02-28 14:40:03 -05:00
Marshall Greenblatt
c01f40017b Windows: Fix AtExitManager assertion in SupervisedUserSettingsServiceFactory on shutdown when running with multi-threaded message loop (issue #1680) 2017-02-28 13:16:26 -05:00
Marshall Greenblatt
8fa8af357b views: Support styling of menus (issue #2102) 2017-02-28 12:17:47 -05:00
Marshall Greenblatt
b08f0ed713 views: Fix layout calculation for LabelButton with mnemonics (issue #2102) 2017-02-28 12:17:47 -05:00
Marshall Greenblatt
10f9a9484f views: Support ink drop effect on buttons (issue #2102) 2017-02-28 12:17:47 -05:00
Marshall Greenblatt
f8909fe9e0 README.md edited online with Bitbucket 2017-02-24 16:33:17 +00:00
Marshall Greenblatt
16125bdbbd views: Support accelerators in MenuButton label (issue #2102) 2017-02-23 12:47:20 -08:00
Marshall Greenblatt
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
Marshall Greenblatt
fbc8b983d5 Windows: Support crash upload URLs with query component (issue #1995) 2017-02-21 13:38:50 -05:00
Marshall Greenblatt
c8c3ef4792 views: cefclient: Fix top menu placement (issue #2102) 2017-02-17 21:42:15 -05:00
Marshall Greenblatt
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
Marshall Greenblatt
bd1b80198f views: Add support for accelerators (issue #2102) 2017-02-17 14:11:19 -08:00
Marshall Greenblatt
e4867b5afb Fix type comparison error 2017-02-16 18:31:07 -05:00
Marshall Greenblatt
b7556bdddf Fix CefZipReader::GetFileLastModified (issue #1899) 2017-02-15 18:44:42 -05:00
Marshall Greenblatt
c82ef82c21 Fix OSR popup transparency (issue #2099) 2017-02-15 16:03:00 -05:00
Marshall Greenblatt
897c0f01ed Simplify ownership of CefBrowserContext objects (issue #2083) 2017-02-15 08:53:34 -08:00
Marshall Greenblatt
43001c0a94 Fix unreferenced variable warning (issue #2090) 2017-02-14 10:15:12 -08:00
Marshall Greenblatt
54424d0edc Fix crash during process shutdown (issue #2096) 2017-02-14 10:09:42 -08:00
Marshall Greenblatt
feaca0ddf2 Simplify StoragePartition changes 2017-02-14 11:47:27 -05:00
Marshall Greenblatt
4054d66de0 Fix SupervisedUserSettingsService initialization (issue #2093) 2017-02-13 17:12:57 -05:00
Marshall Greenblatt
903da5e452 Simplify OSR guest view implementation 2017-02-13 13:28:10 -05:00
Marshall Greenblatt
0a62a4dca8 Enable leak detection for translator test classes (issue #2090) 2017-02-09 18:11:28 -05:00
Marshall Greenblatt
0afcb82ee6 Rename CefBase to CefBaseRefCounted (issue #2090) 2017-02-09 17:50:59 -05:00
Marshall Greenblatt
07ba48b082 Add support for non-ref-counted interface classes (issue #2090) 2017-02-09 17:50:46 -05:00
Marshall Greenblatt
9dd0ca2661 Allow empty value param to CefSetCrashKeyValue (issue #1995) 2017-02-08 12:35:21 -05:00
Marshall Greenblatt
aa398d8798 macOS: Generate correct framework and Info.plist version numbers (issue #1969) 2017-02-06 18:15:42 -05:00
Marshall Greenblatt
fda2f34c75 macOS: Fix incorrect OSR compositor resize in OnSwapCompositorFrame (issue #2065) 2017-02-06 16:24:25 -05:00
Marshall Greenblatt
661fa722a7 macOS: Add option for forwarding browser process crashes to the system crash reporter (issue #1995) 2017-02-06 15:06:25 -05:00
Marshall Greenblatt
caef479ae0 macOS: Update xib files to 10.9 deployment target 2017-02-02 18:16:43 -05:00
Marshall Greenblatt
d6531b9fe6 macOS: cefclient: Create Tests menu with Interface Builder 2017-02-02 15:43:41 -05:00
Marshall Greenblatt
94f604975d Fix localization of default context menu labels (issue #2081) 2017-02-01 15:24:20 -05:00
Marshall Greenblatt
a90b50f1ff Fix KeyedServiceFactory assertion during shutdown (issue #2083) 2017-01-31 17:23:27 -05:00
Marshall Greenblatt
30451b7ca5 Fix crash using WebRTC with TLS certs (issue #2080) 2017-01-31 15:25:12 -05:00
Marshall Greenblatt
5c160e018b Windows: Fix command line parsing for crash handler (issue #1995) 2017-01-30 16:21:12 -05:00
Marshall Greenblatt
a56ac9782e macOS: Support crash reporting from unbundled apps (issue #1532) 2017-01-27 14:16:04 -05:00
Marshall Greenblatt
dda50912ed macOS: Allow configuration of framework path (issue #1532) 2017-01-26 19:14:56 -05:00
Marshall Greenblatt
18ce862ad8 Standardize product/version/platform crash keys (issue #1995) 2017-01-25 13:37:12 -05:00
Marshall Greenblatt
819dcdf461 Fix potential OSR crash on renderer process recreation (issue #2082) 2017-01-25 12:34:42 -05:00
Marshall Greenblatt
41a02dbe08 Add is_main_frame argument to CefRequestContextHandler::OnBeforePluginLoad (issue #2015) 2017-01-24 18:53:08 -05:00
Marshall Greenblatt
b7b145fa4f Update to Chromium revision ad51088c (#444943) 2017-01-24 16:53:09 -05:00
Marshall Greenblatt
9d48a4f80e Fix CefRequestHandler::OnCertificateError callback trigger (issue #2019) 2017-01-17 12:49:23 -05:00
Marshall Greenblatt
da6f2864c2 cefclient: Fix typo in TempWindow comments 2017-01-17 12:46:49 -05:00
Marshall Greenblatt
5f4190ff75 Add CefContextMenuParams::GetTitleText method (issue #2030) 2017-01-17 12:43:49 -05:00
Marshall Greenblatt
3f0c94f7e6 Windows: Fix white flash during browser creation (issue #1984) 2017-01-13 16:57:54 -05:00
Marshall Greenblatt
914fc6f7af Windows: Fix AppName and ExternalHandler usage in crash_reporter.cfg (issue #1995) 2017-01-13 15:44:43 -05:00
Marshall Greenblatt
7bdfe79e35 Add product name and version to crash_reporter.cfg (issue #1995) 2017-01-12 13:23:28 -05:00
Marshall Greenblatt
a834487177 Improve crashpad integration (issue #1995)
- Crash reporting is enabled and configured using a "crash_reporter.cfg"
  file. See comments in include/cef_crash_util.h and tools/crash_server.py
  for usage.
2017-01-10 18:40:31 -05:00
Marshall Greenblatt
c990b5d877 Update copyright year on generated files 2017-01-10 18:00:30 -05:00
Marshall Greenblatt
9928036f63 Windows: Fix behavior of frameless windows with Views.
- Don't set InitParams::TRANSLUCENT_WINDOW. Setting this resulted in
  the WS_EX_COMPOSITED style being added and the WS_THICKFRAME style
  being removed, which disabled Aero Snap.
- Remove the non-client border to get a completely frameless window.
  Having a border is problematic because the top is drawn by Windows
  while the rest is drawn black. Having Windows draw part of the
  border is required to enable the window drop shadow (see
  HWNDMessageHandler::SetDwmFrameExtension).
- Delete the remove_caption patches which are no longer required.
2016-12-14 06:59:13 -08:00
Marshall Greenblatt
48908c9195 Windows: Add missing crashpad initialization (issue #1995) 2016-12-05 14:29:54 +01:00
Marshall Greenblatt
03ed733800 Windows: Fix missing InsertAllocatorDispatch symbol in cef_sandbox.lib (issue #2044) 2016-11-30 19:54:08 -05:00
Marshall Greenblatt
c1a1dbdb7d Windows: Fix x64 build conversion from 'size_t' to 'int' error (issue #2054) 2016-11-30 15:23:04 -05:00
Marshall Greenblatt
12aeeb13f7 Update to Chromium revision 3a87aecc (#433059) 2016-11-29 16:56:29 -05:00
Marshall Greenblatt
c6881fe145 Add option to enable/disable net security expiration (issue #1994)
- Net security (CT, HSTS) expiration based on build age is now
  disabled by default.
- Add new enable_net_security_expiration option to CefSettings and
  CefRequestContextSettings.
2016-11-18 16:11:40 -05:00
Marshall Greenblatt
4ecff1670e Windows: Fix x64 build conversion from 'size_t' to 'int' error (issue #2043) 2016-11-18 14:31:29 -05:00
Marshall Greenblatt
258c588b44 Mac: Fix resource copy when building the binary distrib with Ninja (issue #1632) 2016-11-18 13:34:32 -05:00
Marshall Greenblatt
bd9a2c8069 Rename unittests to ceftests (issue #1632) 2016-11-18 12:44:46 -05:00
Marshall Greenblatt
8fee8ed05d Add unittests target to the binary distribution (issue #1632)
- Move all tests from the top-level directory to tests/.
- Move files shared by cefclient and unittests to tests/shared/.
- Add a fused (single header/source file) version of gtest in
  tests/gtest/ with associated CMake configuration.
- Test-only headers are now exposed in include/test/. Unit test
  targets must define UNIT_TEST in order to access them.
- Replace usage of USING_CEF_SHARED with WRAPPING_CEF_SHARED for
  clarity (only the libcef_dll_wrapper target should define it).
- Remove the RENAME_DIRECTORY CMake macro which is no longer used.
- Remove C++11 usage from unittests sources for compatibility with
  the binary distribution configuration.
- Windows: Fix build errors due to chrome_elf.dll and imm32.lib
  missing from the CMake configuration.
2016-11-18 03:19:17 -05:00
Marshall Greenblatt
f557d325c1 Remove Chromium target dependencies for unit tests (issue #1632) 2016-11-16 12:51:44 -08:00
Marshall Greenblatt
ef6df50bf9 Remove Chromium includes in unit tests (issue #1632) 2016-11-15 18:22:34 -05:00
Marshall Greenblatt
0e65f027d2 Remove usage of ui::KeyboardCode in unit tests (issue #1632) 2016-11-15 17:50:33 -05:00
Marshall Greenblatt
832654689f Add CefWaitableEvent interface for unit tests (issue #1632) 2016-11-15 16:18:41 -05:00
Marshall Greenblatt
04642e0480 Add CefScopedTempDir and file utility functions for unit tests (issue #1632) 2016-11-15 13:47:44 -05:00
Marshall Greenblatt
a7195c0103 Remove usage of gfx in unit tests (issue #1632) 2016-11-14 13:47:31 -05:00
Marshall Greenblatt
9ed17519a9 Remove usage of base::StringPrintf in unit tests (issue #1632) 2016-11-14 13:28:05 -05:00
Marshall Greenblatt
03f3900d75 Remove usage of base::WrapUnique in unit tests (issue #1632) 2016-11-14 13:03:12 -05:00
Marshall Greenblatt
18d56feac0 Add CefThread interface (issue #1632) 2016-11-14 11:30:15 -05:00
Marshall Greenblatt
607d420baf Fix memory leak with IME on macOS (see http://crbug.com/654695) 2016-11-10 19:16:38 -05:00
Marshall Greenblatt
18763fde50 Add initial WebUI support (issue #2037)
- Visit chrome://webui-hosts for the list of supported hosts.
2016-11-08 16:56:11 -08:00
Marshall Greenblatt
659e5af870 Fix cef_time_t.year documentation (issue #1913) 2016-11-04 17:07:54 -04:00
Marshall Greenblatt
cdd2a40469 Change index parameter type from int to size_t (issue #1491) 2016-11-04 15:26:35 -04:00
Marshall Greenblatt
f3a0ff98bb Add test for history navigation of pages containing dynamically created iframes (issue #2022) 2016-11-04 13:56:19 -04:00
Marshall Greenblatt
d6b17a8fb5 Standardize IME callbacks for off-screen rendering (issue #1675) 2016-11-03 21:02:36 -04:00
Marshall Greenblatt
e69de63b15 Fix DCHECK while running PDF unit tests (issue #2032) 2016-11-03 13:11:09 -04:00
Marshall Greenblatt
7543d16cce Disable channel ID support (issue #1912) 2016-11-02 16:14:18 -04:00
Marshall Greenblatt
a87f0975e2 Remove mention of automatic type conversion in cef_v8.h (issue #1089) 2016-10-28 20:52:40 -04:00
Marshall Greenblatt
efd96f342f Mac: Always set enable_dsyms=true (issue #2027) 2016-10-28 20:27:55 -04:00
Marshall Greenblatt
cea55225f0 Remove unhelpful context debug checks (issue #1954) 2016-10-28 14:56:31 -04:00
Marshall Greenblatt
2149a34d0a Fix URL comparison errors in CefRequest (issue #1967) 2016-10-28 14:15:26 -04:00
Marshall Greenblatt
e39accd266 Fix CefMenuModelDelegate methods missing from the CAPI (issue #2006) 2016-10-28 13:20:04 -04:00
Marshall Greenblatt
4adaa2b552 Fix crash when persisting user preferences (issue #2017) 2016-10-28 12:38:38 -04:00
Marshall Greenblatt
ffab334e94 Fix translator error with X509CertificateList (issue #1824) 2016-10-27 15:46:58 -04:00
Marshall Greenblatt
17c2ecd79d Fix missing browser.enable_spellchecking pref registration (issue #1996) 2016-10-27 14:31:53 -04:00
Marshall Greenblatt
29f7953677 Minor fixes for output consistency 2016-10-27 14:24:03 -04:00
Marshall Greenblatt
676cb1f07d Add callback for custom certificate selection (issue #1824) 2016-10-27 14:04:48 -04:00
Marshall Greenblatt
e006ec0ab5 Add V8 interceptor support (issue #1159) 2016-10-27 14:03:53 -04:00
Marshall Greenblatt
917b4a0de5 Fix shutdown assertion with authentication whitelist preferences (issue #1150) 2016-10-27 14:03:53 -04:00
Marshall Greenblatt
d8f943cd94 Add authentication whitelist preferences (issue #1150) 2016-10-27 14:03:53 -04:00
Marshall Greenblatt
0e97c527ae Allow CefV8Context::Eval to bypass CSP (issue #2024) 2016-10-27 14:03:53 -04:00
Marshall Greenblatt
f7a4102978 Windows: Fix crash when AVX instructions are not supported (issue #1999) 2016-10-27 14:03:53 -04:00
Marshall Greenblatt
be15daa844 Add patch tool enhancements (issue #2016) 2016-10-27 14:03:52 -04:00
Marshall Greenblatt
5ec98243a9 Fix PDF rendering with OSR (issue #1689) 2016-10-27 14:03:45 -04:00
Marshall Greenblatt
c9e81c082f Update to Chromium revision 614d31da (#423768)
- Fix PDF extension loading after showing the plugin placeholder (issue #2020)
2016-10-25 15:34:33 -04:00
Marshall Greenblatt
07d12b78e1 Update to Chromium revision 9cedf753 (#418732)
- Simplify usage of OnBeforePluginLoad (issue #2015)
- Switch crash reporting from crashpad to breakpad on Windows and OS X.
  Adds a new chrome_elf.dll dependency on Windows (issue #1995)
- Remove CefTextfield::GetPlaceholderTextColor() method which is no
  longer supported by Chromium.
2016-10-20 16:54:25 -04:00
Marshall Greenblatt
a1fc6f1ad0 Add CefRegisterWidevineCdm function and remove component updater support (issue #2009)
Mac: Check in widevinecdmadapter.plugin binary until Widevine GN build errors are resolved (https://crbug.com/626436).
2016-10-17 14:16:31 -04:00
Marshall Greenblatt
b338bf9392 Linux: Don't generate GN configs for missing sysroots 2016-10-17 14:08:55 -04:00
Marshall Greenblatt
95973a7c1d Mac: Remove registration of selector methods that were deleted in e7ddc933 2016-09-19 11:59:29 -04:00
Marshall Greenblatt
9ae2cf6ad1 Add SSL certificate transparency support (issue #1994) 2016-09-16 12:57:03 -04:00
Marshall Greenblatt
6158110063 Linux: Add ARM build support (issue #1990) 2016-09-09 18:04:39 -07:00
Marshall Greenblatt
a312974ad9 Add CefDOMNode::GetElementBounds() method 2016-09-09 14:02:57 -04:00
Marshall Greenblatt
1679632000 Fix display of select popups with OSR (issue #1988) 2016-09-09 13:21:16 -04:00
Marshall Greenblatt
f94c5a1cb6 Windows: Add /LARGEADDRESSAWARE to CMake configuration (issue #1855) 2016-09-08 16:52:37 -04:00
Marshall Greenblatt
ae74d735cf Create a PrefServiceSyncable as required by Chrome (issue #1947) 2016-09-08 13:35:15 -07:00
Marshall Greenblatt
51bdb46ac2 List files in directories recursively (issue #1987) 2016-09-08 11:38:54 -04:00
Marshall Greenblatt
40558a0922 Mac: Set rpath instead of using install_name_tool from CMake (issue #1403) 2016-09-02 16:59:39 +03:00
Marshall Greenblatt
96b368ed14 Mac: Fix typo in make_distrib.py 2016-09-02 16:58:13 +03:00
Marshall Greenblatt
594fde704e Fix debug assertion on right-click context menu. 2016-09-02 13:14:53 +03:00
Marshall Greenblatt
10c1fd6b8d Add API for SSL status and certificate retrieval (issue #1924) 2016-09-02 13:01:33 +03:00
Marshall Greenblatt
4d1a32e028 README.md edited online with Bitbucket 2016-09-02 08:13:57 +00:00
Marshall Greenblatt
b52741d236 Windows: Add compiler settings to CMake for official build sandbox compatibility (issue #1961) 2016-09-01 16:34:05 +03:00
Marshall Greenblatt
5068b50b48 Use DCHECK_IS_ON() instead of !NDEBUG for debug logic (issue #1961) 2016-09-01 14:24:30 +03:00
Marshall Greenblatt
ad1619dbd7 Fix decoding of about:credits HTML (issue #1980) 2016-09-01 13:32:56 +03:00
Marshall Greenblatt
1e84e0cfff Mac: Fix dSYM processing and add debug dSYM in make_distrib.py (issue #1403) 2016-09-01 12:21:14 +03:00
Marshall Greenblatt
9064e30296 Update to Chromium revision 1ae106db (#414607) 2016-09-01 11:52:50 +03:00
Marshall Greenblatt
c48cac8dc4 Mac: Fix dSYM path in make_distrib.py (issue #1403) 2016-08-30 18:45:11 +03:00
Marshall Greenblatt
9ee4db6dbb Fix documentation errors 2016-08-26 13:22:22 +03:00
Marshall Greenblatt
ae452e5348 Windows: Clarify custom toolchain env variable requirements (issue #1403) 2016-08-26 13:08:37 +03:00
Marshall Greenblatt
d4663b2b4c Windows: Don't copy DLLs when using custom toolchain (issue #1403) 2016-08-25 18:38:22 +03:00
Marshall Greenblatt
c006dc7f0f Linux: Fix copying of libcef.so in make_distrib.py (issue #1403) 2016-08-25 06:12:45 -07:00
Marshall Greenblatt
5288dc5414 Fix DEPOT_TOOLS_WIN_TOOLCHAIN value check (issue #1403) 2016-08-25 16:01:01 +03:00
Marshall Greenblatt
041ec09525 Add missing visual_studio_runtime_dirs value (issue #1403) 2016-08-25 15:27:14 +03:00
Marshall Greenblatt
0cba9481fb Change official debug builds to release + dcheck_always_on (issue #1961) 2016-08-25 14:36:39 +03:00
Marshall Greenblatt
da314f12fb Linux: Remove deleted key from make_distrib.py (issue #1403) 2016-08-25 13:21:07 +03:00
Marshall Greenblatt
b89329b0fa Use the same PDF plugin name as official Chrome 2016-08-24 16:38:51 +03:00
Marshall Greenblatt
3b5fb0d526 Add CefResponse parameter to CefRequestHandler::OnResourceRedirect 2016-08-24 16:19:57 +03:00
Marshall Greenblatt
69334e22c2 Add StoragePartition and extension object proxy support (issue #1973) 2016-08-24 15:41:53 +03:00
Marshall Greenblatt
1c06d8e3f5 cefclient: Allow dragging of fragments and show message when blocking URLs/files (issue #1976) 2016-08-19 13:59:50 +02:00
Marshall Greenblatt
73c669d67e Windows: Resize offscreen compositor window to match view size (issue #1933) 2016-08-17 17:29:38 +02:00
Marshall Greenblatt
2e1d960f3f Linux: Flush display after showing window (issue #1946) 2016-08-17 07:56:43 -07:00
Marshall Greenblatt
4f0ba755c6 Check that platform_delegate_ is non-NULL 2016-08-15 12:30:17 +03:00
Marshall Greenblatt
aa950f8bdb views: Restore hover state on menu buttons 2016-08-08 19:15:34 +03:00
Marshall Greenblatt
ea33255c09 Fix incorrect scaling of drag regions on HiDPI display. 2016-08-08 16:15:28 +03:00
Marshall Greenblatt
8a68967937 Fix debug assertion in CefImageImpl::AddBitmap. 2016-08-08 16:13:25 +03:00
Marshall Greenblatt
968fbacac3 Remove GYP build support (issue #1403) 2016-08-08 14:31:57 +03:00
Marshall Greenblatt
2070a1bc41 Windows: Add VS2015 Update 3 build support 2016-08-05 13:24:27 +03:00
Marshall Greenblatt
5444c389fd Unfork chome code related to extensions and pepper plugins (issue #1947) 2016-08-04 16:12:16 +03:00
Marshall Greenblatt
98f59f47fd Update to Chromium revision fc6aaca4 (#406441) 2016-07-26 13:28:54 -04:00
Marshall Greenblatt
d92bc1d200 Build with GN by default (issue #1403) 2016-07-20 18:27:37 -04:00
Marshall Greenblatt
f2f76a0a20 Remove variable references from cef_path2.gypi to fix VS project generation with GN (issue #1403) 2016-07-20 17:19:44 -04:00
Marshall Greenblatt
88a8dad9c9 Generate pack header files using GN (issue #1403) 2016-07-20 16:40:23 -04:00
Marshall Greenblatt
0e940c4128 Windows: Fix widevine copy step for binary distribution (issue #1948) 2016-07-20 14:26:37 -04:00
Marshall Greenblatt
5732a8da52 Unfork streamsPrivate API and add resourcesPrivate and tabs zoom APIs required by the PDF extension (issue #1947) 2016-07-20 14:07:20 -04:00
Marshall Greenblatt
f4425a9a0c Move chrome members to BrowserProcess and add ProfileManager support (issue #1947) 2016-07-18 18:07:55 -04:00
Marshall Greenblatt
3cc539b506 Depend directly on chrome targets and unfork code (issue #1947) 2016-07-15 21:17:44 -04:00
Marshall Greenblatt
62d177455b Fix Widevine CDM download (issue #1950) 2016-07-15 13:42:29 -04:00
Marshall Greenblatt
cf4a50b116 Update component updater configurator to match chrome (issue #1950) 2016-07-15 13:42:22 -04:00
Marshall Greenblatt
1ee311fa45 Move HTTP cache to a subfolder of CefSettings.cache_path (issue #1940) 2016-07-12 15:00:12 -04:00
Marshall Greenblatt
188326bbc4 Pass transition type to CefLoadHandler::OnLoadStart (issue #1943) 2016-07-12 12:00:51 -04:00
Marshall Greenblatt
c8681ea3e8 Mac: Remove duplicate focus change notification 2016-07-11 17:11:42 -04:00
Marshall Greenblatt
a22b11d764 Fix crash in CefResourceDispatcherHostDelegate::HandleExternalProtocol when destroying a browser during redirect (issue #1941) 2016-07-08 15:28:53 -04:00
Marshall Greenblatt
8a5e7a1270 CefBrowserHost::Invalidate should call OnPaint unconditionally (issue #1871) 2016-07-08 11:45:47 -04:00
Marshall Greenblatt
a60bb077a3 Update to Chromium revision 68623971 (#403382) 2016-07-07 16:24:12 -04:00
Marshall Greenblatt
d0a2e217a0 Add GN configuration (issue #1403) 2016-07-05 17:32:01 -04:00
Marshall Greenblatt
05ee60b7b4 Update to Chromium revision 318e6f54 (#400326) 2016-06-21 12:41:21 -04:00
Marshall Greenblatt
66425def4a Fix crash in CefTaskRunnerImpl::GetTaskRunner when CEF is not initialized (issue #1925) 2016-06-15 14:11:30 -04:00
Marshall Greenblatt
262e327c74 Mac: Fix file dialog behavior (issue #1919) 2016-06-15 13:43:58 -04:00
Marshall Greenblatt
f5b910326d Improve binary distribution CMake macros (issue #1923) 2016-06-14 18:29:34 -04:00
Marshall Greenblatt
eb199b2547 README.md edited online with Bitbucket 2016-06-14 18:53:35 +00:00
Marshall Greenblatt
80f5a35668 Linux: Don't add version script in Debug build (issue #1765) 2016-06-14 13:46:49 -04:00
Marshall Greenblatt
18d882b5d2 cefclient: Don't create multiple DevTools windows (issue #1920) 2016-06-10 14:33:07 -04:00
Marshall Greenblatt
b23c0f1097 ShowDevTools should inspect element in existing window (issue #1487) 2016-06-10 12:59:32 -04:00
Marshall Greenblatt
acdb4bb564 Mac: Fix window sharing type (issue #1884) 2016-06-09 14:48:59 -04:00
Marshall Greenblatt
e41a763307 Linux: Don't add version script when using ASAN build (issue #1765) 2016-06-07 12:03:13 -07:00
Marshall Greenblatt
a356ee9ca1 Add Google SafeSearch support (issue #1917) 2016-06-07 14:44:59 -04:00
Marshall Greenblatt
fe9c24e307 Linux: Include cefsimple instead of cefclient in client distribution (issue #1916) 2016-06-07 11:27:40 -04:00
Marshall Greenblatt
76a40cafe3 Linux: Include cefsimple instead of cefclient in client distribution (issue #1916) 2016-06-06 18:23:15 -04:00
Marshall Greenblatt
754638846e cefbuilds: Linux: Include cefsimple instead of cefclient in client distribution (issue #1916).
cefbuilds: Fix CEF source URL.
2016-06-06 18:03:17 -04:00
Marshall Greenblatt
733ff6ffff Windows: Remove wow_helper.exe which is no longer required (issue #1915) 2016-06-06 12:47:59 -04:00
Marshall Greenblatt
f1fec0933e Linux: Add version script to restrict exported symbols (issue #1765) 2016-06-06 12:31:24 -04:00
Marshall Greenblatt
e0fd09ed20 Linux: Fix warn_unused_result error (issue #1911) 2016-06-03 11:33:06 -04:00
Marshall Greenblatt
99bf1b8458 Windows: Set CEF_VCVARS=none when using a custom VS install location 2016-05-28 22:00:28 -04:00
Marshall Greenblatt
769150e178 Add cefbuilds tools. See AutomatedBuildSetup Wiki page for usage. 2016-05-27 17:55:00 -04:00
Marshall Greenblatt
ab2636b012 Update to Chromium revision 2b3ae3b8 (#394939) 2016-05-25 08:10:01 -07:00
Marshall Greenblatt
582ce074aa Add new CEF_ARCHIVE_FORMAT env var to support different built-in compression formats (issue #1067) 2016-05-18 18:14:26 -04:00
Marshall Greenblatt
0b3d93cc8f Add new CEF_COMMAND_7ZIP_FORMAT env var to support different compression formats (issue #1067) 2016-05-17 13:52:31 -04:00
Marshall Greenblatt
ca928bd3f7 Update msvs_env.bat to respect platform architecture 2016-05-17 12:50:04 -04:00
Marshall Greenblatt
80c7c1bd77 Add cmake, include and libcef_dll directories to minimal binary distribution (issue #1897) 2016-05-16 14:46:13 -04:00
Marshall Greenblatt
575c968a55 Modernize binary distribution CMake configuration (issue #1897)
- Load CEF configuration using `find_package(CEF)`.
- Use per-target configuration via a new SET_EXECUTABLE_TARGET_PROPERTIES
  macro instead of setting global CMAKE_* variables.
- Support building projects more easily with an external binary
  distribution directory.
- Improve related documentation.
2016-05-12 18:10:31 -04:00
Marshall Greenblatt
958618359c Add error code to CefResponse (issue #1845) 2016-05-11 15:36:15 -04:00
Marshall Greenblatt
543178ce67 Call RenderProcessHost::Send from correct thread (issue #1881) 2016-05-11 12:18:43 -04:00
Marshall Greenblatt
839e78a519 Fix incorrect initialization of WebCursor object (issue #1894) 2016-05-11 11:03:40 -04:00
Marshall Greenblatt
bff6dd684c Fix assertion when only video or audio capture is selected (issue #1802) 2016-05-09 16:17:54 -04:00
Marshall Greenblatt
157f526d07 Fix Win 64-bit conversion from 'size_t' to 'int' error (issue #1887) 2016-05-09 12:04:06 -07:00
Marshall Greenblatt
da3c6a3b61 Enable unified text checker to match Chrome spellcheck behavior (issue #1891) 2016-05-09 14:10:52 -04:00
Marshall Greenblatt
1ff26aa02a Improve support for a host owned message pump (issue #1805)
- Add new CefSettings.external_message_pump option and
  CefBrowserProcessHandler::OnScheduleMessagePumpWork() callback.
- Improve documentation related to CefDoMessageLoopWork().
- Pass `--external-message-pump` command-line flag to cefclient or
  cef_unittests to test the new mode.
2016-05-04 18:35:49 -04:00
Marshall Greenblatt
52f9aacdf5 Fix heap-use-after-free during CefCookieManagerImpl destruction (issue #1882) 2016-04-29 17:16:28 -04:00
Marshall Greenblatt
e690fa444c Update platform and build requirements.
- Mac: Require 10.7+ deployment target and 10.9+ system version
  (see https://codereview.chromium.org/1615823003/).
- Windows: Changes references from VS2013 to VS2015.
2016-04-29 13:16:28 -04:00
Marshall Greenblatt
79c8f30d46 Fix failure to extract depot_tools archive due to lack of top-level directory (issue #1877) 2016-04-28 13:30:08 -04:00
Marshall Greenblatt
e7ddc933c9 Update to Chromium revision 6e53600d (#386251)
- Remove |accept_lang| parameter from CefJSDialogHandler::OnJSDialog
  and CefFormatUrlForSecurityDisplay (see https://crbug.com/336973#c36).
- Remove remaining NPAPI-related code including functions from
  cef_web_plugin.h (see https://crbug.com/493212#c55).
- Mac: 10.7+ deployment target is now required for client applications.
- Mac: Remove CefBrowserHost::SetWindowVisibility (issue #1375). No
  replacement is required for windowed rendering. Use WasHidden for
  off-screen rendering.
- Windows: Visual Studio 2015 Update 2 is now required when building
  CEF/Chromium.
2016-04-28 12:57:08 -04:00
Marshall Greenblatt
3c957f9257 Fix depot_tools download URL (issue #1877) 2016-04-26 12:10:20 -04:00
Marshall Greenblatt
06e73fff15 Implement Views framework on Windows and Linux (issue #1749).
- Add Views header files in a new include/views directory.
- Add initial top-level window (CefWindow), control (CefBrowserView,
  CefLabelButton, CefMenuButton, CefPanel, CefScrollView,
  CefTextfield) and layout (CefBoxLayout, CefFlowLayout) support.
  See libcef/browser/views/view_impl.h comments for implementation
  details.
- Add Views example usage in cefclient and cefsimple and Views unit
  tests in cef_unittests. Pass the `--use-views` command-line flag to
  cefclient, cefsimple and cef_unittests to run using the Views
  framework instead of platform APIs. For cefclient and cefsimple
  this will create the browser window and all related functionality
  using the Views framework. For cef_unittests this will run all
  tests (except OSR tests) in a Views-based browser window. Views-
  specific unit tests (`--gtest_filter=Views*`) will be run even if
  the the `--use-views` flag is not specified.
- Pass the `--hide-frame` command-line flag to cefclient to demo a
  frameless Views-based browser window.
- Pass the `--hide-controls` command-line flag to cefclient to demo a
  browser window without top controls. This also works in non-Views
  mode.
- Pass the `--enable-high-dpi-support` command-line flag to
  cef_unittests on Windows to test high-DPI support on a display
  that supports it.
- Add CefImage for reading/writing image file formats.
- Add CefBrowser::DownloadImage() for downloading image URLs as a
  CefImage representation. This is primarily for loading favicons.
- Add CefMenuModel::CreateMenuModel() and CefMenuModelDelegate for
  creating custom menus. This is primarily for use with
  CefMenuButton.
- Add CefBrowser::TryCloseBrowser() helper for closing a browser.
  Also improve related documentation in cef_life_span_handler.h.
- Rename cef_page_range_t to cef_range_t. It is now also used by
  CefTextfield.
- Remove CefLifeSpanHandler::RunModal() which is never called.
- Add draggable regions example to cefclient.
2016-04-26 11:58:13 -04:00
Marshall Greenblatt
84fe790035 make_distrib.py: Look for libcef instead of cefclient when running with --allow-partial (issue #1804) 2016-03-31 15:46:52 +02:00
Marshall Greenblatt
243a9c26d7 Update to Chromium revision 0bfd25d4 (#381305)
- Delete include/cef_runnable.h (issue #1336).
- Build the cef_unittests target using all Chromium headers. Add a
  USING_CHROMIUM_INCLUDES define and libcef_dll_wrapper_unittests
  target to support this. This change avoids compile errors due to
  the divergence of CEF and Chromium base/ header implementations.
  The libcef_dll_wrapper sources must now compile successfully with
  both CEF and Chromium base/ headers (issue #1632).
- The onbeforeunload message specified via JavaScript is no longer
  passed to the client (see http://crbug.com/587940).
2016-03-17 13:01:21 -04:00
Marshall Greenblatt
77746cfd1b Linux: Don't try to resolve missing package dependencies when use_sysroot==1 (issue #1804) 2016-03-10 12:35:57 -05:00
Marshall Greenblatt
e1aa8cc109 Fix duplicate entries in CefRequest header map (issue #1840) 2016-03-01 19:11:08 -05:00
Marshall Greenblatt
1b7c5303ce Fix documentation errors (issue #1834) 2016-03-01 17:17:08 -05:00
Marshall Greenblatt
1b8f76dd69 Fix thread safety issue with CefBrowserHostImpl::IsWindowless 2016-02-29 15:23:44 -05:00
Marshall Greenblatt
b4cf5bdb9c Windows: cmake: Add ws2_32.lib to CEF_STANDARD_LIBS (issue #1842) 2016-02-24 12:53:58 -05:00
Marshall Greenblatt
efe88b2790 Windows: cmake: Disable VS2010 override warning (issue #1642) 2016-02-24 12:52:31 -05:00
Marshall Greenblatt
e2576eb938 Add missing values to cef_resource_type_t 2016-02-24 12:42:18 -05:00
Marshall Greenblatt
a1d9c22b58 Add DNS resolution methods to CefRequestContext (issue #1841) 2016-02-23 18:37:35 -05:00
Marshall Greenblatt
fabd3db33e Allow clients to clear certificate exceptions and close connections (issue #1793) 2016-02-23 14:32:07 -05:00
Marshall Greenblatt
e601e76445 Continue OnDownloadUpdated notifications after navigation (issue #1833) 2016-02-16 13:48:52 -05:00
Marshall Greenblatt
8972bbfcb6 Windows/Linux: Enable V8 deprecation warnings 2016-02-08 12:24:06 -08:00
Marshall Greenblatt
f7aa98fe69 Update to Chromium revision 088f14a0 (#373530)
- Building on Windows now requires the Windows 10.0.10586 SDK.
- Remove CefParseCSSColor which was implemented using Blink code in the
  browser process. This is longer advisable now that the Oilpan GC is enabled.
- Avoid potential renderer process crashes by disabling script actions
  on the CefV8Context passed to CefRenderProcessHandler::OnContextReleased.
2016-02-08 13:16:11 -05:00
Marshall Greenblatt
70ab57ab23 Update to Chromium revision 92d77538 (#369907) 2016-02-02 22:16:48 -05:00
Marshall Greenblatt
d6fa9ed3e3 Windows: Disable use of FMA3 versions of CRT functions on x64 (issue #1410) 2016-01-28 11:16:14 -05:00
Marshall Greenblatt
c3d80a5658 Always pass callback object to CefRequestHandler::OnCertificateError (issue #1795) 2016-01-27 12:57:48 -05:00
Marshall Greenblatt
63d313de76 Persist visited link status (issue #287) 2016-01-13 15:38:50 -05:00
Marshall Greenblatt
6d7ee1e084 Add --built-target option to automate-git.py (issue #1804) 2016-01-11 13:55:46 -05:00
Marshall Greenblatt
d829e80f5e Fix compile error in cef_thread_checker.h due to DCHECK_IS_ON not being defined in some cases. 2016-01-08 17:47:24 -05:00
Marshall Greenblatt
c1efd5b5be Linux: Fix pkg-config execution with custom sysroot (issue #1804) 2016-01-08 11:50:34 -08:00
Marshall Greenblatt
ff8c5a6caa Update generated file copyright year 2016-01-08 14:00:27 -05:00
Marshall Greenblatt
d2372c3d11 Update to Chromium revision d7d5682a (#367535) 2016-01-07 11:53:39 -08:00
Marshall Greenblatt
12f19e3a33 Expose additional SSL certificate information.
- Provide access to the full certificate issuer chain (issue #1530)
- Add several missing certificate error codes to cef_errorcode_t (issue #1784)
- Provide the full certificate status bitmask (issue #1790)
2015-12-18 14:05:42 -05:00
Marshall Greenblatt
07e845ed31 CefRequestHandler::GetAuthCredentials |scheme| argument is optional for FTP sources (issue #1794) 2015-12-17 13:24:22 -05:00
Marshall Greenblatt
ae25a352d0 Linux: Fix compile error due to Chromium update (issue #1788) 2015-12-14 14:57:29 -05:00
Marshall Greenblatt
5dec0c5f57 Update to Chromium revision c78c0ad7 (#363565) 2015-12-10 12:45:26 -05:00
Marshall Greenblatt
535c4fbc30 tools: Add --patch argument to patch_updater.py 2015-12-08 14:14:09 -05:00
Marshall Greenblatt
f207a555a3 Add support for response filtering (issue #515).
- Add a new CefRequestHandler::GetResourceResponseFilter method and
  CefResponseFilter class.
2015-12-08 13:47:52 -05:00
Marshall Greenblatt
864db71f6b Mac: Fix Xcode 7 (10.11 SDK) build errors (issue #1732) 2015-12-08 12:59:42 -05:00
Marshall Greenblatt
626fc561ca Add new CefRequestHandler::OnResourceLoadComplete callback (issue #1781) 2015-12-04 13:59:14 -05:00
Marshall Greenblatt
bd6e656747 cefsimple: Only instantiate SimpleApp in the browser process (issue #1776) 2015-12-03 17:27:32 -05:00
Marshall Greenblatt
b4a159a1da Add CommandLineTest.IgnorePrefixes unit test to verify prefix removal behavior (issue #1778) 2015-12-03 17:13:23 -05:00
Marshall Greenblatt
aaa5563582 Windows: Add CMake configuration option in the binary distribution to support /Z7 (issue #385) 2015-12-03 16:32:39 -05:00
Marshall Greenblatt
06e1a34850 Consider scale factor changes to OSR browsers when switching monitors (issue #1774) 2015-12-03 15:24:41 -05:00
Marshall Greenblatt
667f0edcf4 Do not remove OSR transparency when switching monitors (issue #1775) 2015-12-03 15:15:32 -05:00
Marshall Greenblatt
903e296621 Set visibility state correctly after OSR renderer process crashes and avoid DCHECKs (issue #1779) 2015-12-03 14:48:26 -05:00
Marshall Greenblatt
6824387c8d Allow blank URL when creating popup windows (issue #1289) 2015-12-03 13:41:40 -05:00
Marshall Greenblatt
26e68c3d26 Fix crash when receiving a title change notification without a navigation entry (issue #1764) 2015-12-03 13:40:16 -05:00
Marshall Greenblatt
9bc8da1e02 - Add CefPostData::HasExcludedElements which returns true if the underlying
POST data includes elements that are not represented (issue #1761).
- Add CefRequest::SetReferrer and CefRequest::GetReferrer[URL|Policy]. The
  Referer value will no longer be stored in the header map.
- Move request-related conversion logic to CefRequestImpl and standardize the
  implementation.
2015-12-02 17:23:16 -05:00
Marshall Greenblatt
2a658c414b Windows: Fix AtExitManager assertions on shutdown when running with multi-threaded message loop (issue #1680) 2015-11-25 22:46:08 -05:00
Marshall Greenblatt
269aaa2c3c Move network-related code to net/ folder 2015-11-25 21:53:12 -05:00
Marshall Greenblatt
6cccc3b8a7 - Factor platform-specific code out of CefBrowserHostImpl (issue #1749).
- Introduce native/ and osr/ folders for native (non-platform-agnostic) and
    osr (windowless) code respectively.
  - Introduce CefBrowserPlatformDelegate for abstracting platform-specific
    implementations of browser host functionality.
  - Move dialog and menu code to separate manager and platform-specific runner
    implementations exposed via CefBrowserPlatformDelegate.
  - Standardize focus-handling behavior between windowed and windowless
    implementations. CefFocusHandler::OnSetFocus() will now also be called for
    osr focus changes.
- Support multiple simultaneous popups (issue #1289).
2015-11-25 20:19:36 -05:00
Marshall Greenblatt
4b5f052e13 README.md edited online with Bitbucket 2015-11-21 05:38:17 +00:00
Marshall Greenblatt
c199539747 Fix multi-part file uploads (issue #1761) 2015-11-16 17:20:34 -05:00
Marshall Greenblatt
694b45717c Windows: Fix VS2008SP1 compiler errors (issue #1758)
- override was being defined but this compiler doesn't support it.
- Warning C4355 wasn't being properly suppressed in cef_resource_manager.cc
2015-11-13 11:19:27 -05:00
Marshall Greenblatt
07d75e540f Improvements to automate-git.py for local mirror support (issue #1728)
- Add new command-line flags:
  --chromium-url: Allows overriding the synced Chromium URL.
  --no-cef-update: Allows bypassing the step to sync CEF.
  --no-chromium-update: Allows bypassing the step to sync Chromium.
  --no-depot-tools-update: Allows bypassing the step to update depot_tools.
  --distrib-subdir: Allows specifying the subdirectory name of
    chromium/src/cef/binary_distrib.
- Add support in make_distrib.py for the --distrib-subdir flag.
- Change CMake requirement from 2.8.12.2 to 2.8.12.1.
2015-11-13 11:02:17 -05:00
Marshall Greenblatt
c6111d5947 Update to Chromium revision 304f01a1 (#358063)
- Improve ordering of CefLoadHandler callbacks. OnLoadingStateChange will
  be called before and after all calls to OnLoadStart and OnLoadEnd.
  OnLoadStart/OnLoadEnd calls will occur as matching pairs
  (see http://crbug.com/539952#c2).
- Remove the |requesting_url| argument to CefGeolocationHandler::
  OnCancelGeolocationPermission. Clients can use the |request_id| argument
  to track this information themselves.
- Fix a crash when loading the PDF extension in multiple browsers with a
  custom CefRequestContext (issue #1757).
2015-11-11 18:24:00 -05:00
Marshall Greenblatt
e0974ea64d Add |has_external_parent| flag in Chromium patches to avoid behavior changes
when the widget is not parented to an external window (issue #1749).
2015-10-26 18:17:32 -04:00
Marshall Greenblatt
1f86d24d48 Use a reasonable default log file location if none is specified (issue #1757) 2015-10-23 18:32:40 -04:00
Marshall Greenblatt
b731133713 Windows: cefclient: Size browser window correctly when RootWindow is initially shown as maximized (issue #1745) 2015-10-23 15:06:02 -04:00
Marshall Greenblatt
018f9b0f9a Mac: Fix positioning of default open/save dialog (issue #1740) 2015-10-22 10:02:25 -04:00
Marshall Greenblatt
211c81cb14 CTRL + left click on a link in a PDF document should call OnOpenURLFromTab (issue #1737) 2015-10-21 17:06:53 -04:00
Marshall Greenblatt
936e595fe5 - Support runtime configuration of renderer-related preferences (issue #1501).
- Persist modified user preferences including per-host zoom settings when a
  cache_path value is specified and persist_user_preferences is set to true
  via CefSettings or CefRequestContextSettings.
- Avoid the need to duplicate files from chrome/ by having CefBrowserContext
  extend Chrome's Profile class.
2015-10-20 11:12:21 -04:00
Marshall Greenblatt
487ea8a99d Restore previous CefFrame::GetText behavior (issue #1743) 2015-10-15 13:16:45 -04:00
Marshall Greenblatt
19b61ec391 Add missing touch menu resources (issue #1739) 2015-10-15 10:37:05 -04:00
Marshall Greenblatt
5033a27e58 Fix navigation from inside PDF files (issue #1737) 2015-10-14 15:27:05 -04:00
Marshall Greenblatt
efbc200b51 Linux: Fix focus/activation handling and keyboard input (issue #1679). 2015-10-14 09:46:42 -07:00
Marshall Greenblatt
fdf3088470 Linux: Fix BadWindow error when creating popup windows (issue #1717). 2015-10-14 09:46:02 -07:00
Marshall Greenblatt
16f8a66040 - Fix use-after-return in ReleaseAndWaitForDestructor if it times out
while running unit tests.
- Increase PluginTest PDF load timeout.
2015-10-14 09:42:44 -07:00
Marshall Greenblatt
70ed95bcca base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON() to match Chromium
changes (see http://crrev.com/e649f573) and fix unit test runtime
errors when building with GYP_DEFINES=dcheck_always_on=1.
2015-10-14 09:40:59 -07:00
Marshall Greenblatt
3f4687a4cd Fix parsing of CefResourceManager::Request::url() when both query
and fragment components are present (issue #1733)
2015-10-13 16:51:52 -04:00
Marshall Greenblatt
1f21fe5412 Add CefPrintHandler::OnPrintStart callback (issue #1736) 2015-10-13 14:04:02 -04:00
Marshall Greenblatt
f7d9457c20 Fix extension resource access permissions (issue #1719) 2015-10-12 14:13:13 -04:00
Marshall Greenblatt
dd0bb98c22 Remove final keyword to fix builds with non-C++11 compilers (issue #1725) 2015-10-12 12:43:04 -04:00
Marshall Greenblatt
8aac23386e Update to Chromium revision cb947c01 (#352221)
- Implement CefRequestHandler::OnBeforeBrowse using NavigationThrottle
  instead of ResourceThrottle (see http://crbug.com/537634). The CefRequest
  object passed to OnBeforeBrowse will no longer have an associated request
  identifier.
- Mac: Remove additional helper apps which are no longer required (see
  http://crbug.com/520680)
- Remove the UR_FLAG_REPORT_RAW_HEADERS flag which is no longer supported (see
  http://crbug.com/517114)
- Remove the CefBrowserSettings.java parameter. Java is an NPAPI plugin and
  NPAPI plugins are no longer supported (see http://crbug.com/470301#c11)
- Add CefFormatUrlForSecurityDisplay function in cef_parser.h
- Fix crash when passing `--disable-extensions` command-line flag (issue #1721)
- Linux: Fix NSS handler loading (issue #1727)
2015-10-09 17:31:27 -04:00
Marshall Greenblatt
5780ea8baa Support configuration of preferences during runtime (issue #1709)
- Preferences are now associated with a CefRequestContext instead of
  being stored globally.
- Add methods to CefRequestContext for getting/setting preferences.
2015-10-06 18:14:11 -04:00
Marshall Greenblatt
2328b9be39 cefclient: Remove accidental change disabling plugin load (issue #1708) 2015-10-01 11:29:33 -04:00
Marshall Greenblatt
4149192d81 Call OnBeforePluginLoad when building the plugin list (issue #1708) 2015-09-30 18:09:28 -04:00
Marshall Greenblatt
a33720558e Don't create Widevine-related folders when Widevine support is disabled (issue #1713) 2015-09-24 11:35:42 +03:00
Marshall Greenblatt
74dfd9ad81 Mac: Fix background color (issue #1161) 2015-09-22 13:23:33 +02:00
Marshall Greenblatt
dc3aae19e8 Add plugin placeholder and policy support (issue #1708)
- Default plugin loading policy can be specified using the new
  `--plugin-policy=[allow|block|detect]` command-line flag.
- Move CefRequestHandler::OnBeforePluginLoad to
  CefRequestContextHandler and add a new policy argument that
  supports different actions (allow, block, detect, disable) on a
  per-plugin-instance basis.
- Add CefContextMenuHandler::RunContextMenu for providing a custom
  context menu implementation.
- Add CefResourceBundleHandler::GetDataResourceForScale for
  returning scaled resources (issue #1272).
- Add CefResourceBundle for retrieving resources from the resource
  bundle (*.pak) files loaded by CEF during startup or via the
  CefResourceBundleHandler.
- Linux: Fix Debug build IO access warning with CefGetMimeType.
- cef_unittests: Move the refcounting implementation from TestHandler
  to subclasses in order to support interface inheritance from
  subclasses.
2015-09-22 12:28:46 +03:00
Marshall Greenblatt
846107b291 Windows: Fix warning treated as error with Widevine CDM 64-bit build (issue #1631) 2015-09-16 13:37:58 +03:00
Marshall Greenblatt
2c3d761ad0 Fix PDF extension loading with custom request context handler (issue #1710) 2015-09-11 14:23:19 +02:00
Marshall Greenblatt
e343da7e40 Fix crash with OSR when the render process terminates (issue #1702) 2015-09-07 15:20:39 +02:00
Marshall Greenblatt
3640f81f01 Add Widevine CDM support (issue #1631)
- Windows/Mac: Use `--enable-widevine-cdm` command-line flag to
  enable download of CDM binaries via the component updater.
- Linux: Use `--widevide-cdm-path` and `--widevine-cdm-version`
  command-line flags to load CDM binaries that already exist on
  the system.
- A cache-path value is usually required when CDM is enabled.
2015-09-01 14:04:21 +02:00
Marshall Greenblatt
4a8546efd7 Windows: Fix focus/activation handling and keyboard input (issue #1700) 2015-08-27 20:09:19 -04:00
Marshall Greenblatt
c2086cf7c7 Mac: Fix 10.10 SDK compile and test errors (issue #1414) 2015-08-26 16:39:09 -04:00
Marshall Greenblatt
9af98fab45 Update to Chromium revision 788460a4 (#345352)
- Mac: 10.10 SDK is now required for building (see http://crbug.com/463170#c63).
  Older SDKs can be used for a short time by setting mac_sdk_min via GYP_DEFINES.
2015-08-26 12:42:54 -04:00
Marshall Greenblatt
aa72f402ba Always save cookies for http, https, ws and wss schemes (issue #1684) 2015-08-21 16:38:19 -04:00
Marshall Greenblatt
e6e123d503 Windows: Fix warning C4267: 'argument' : conversion from 'size_t' to 'int' (issue #1695) 2015-08-21 13:55:13 -04:00
Marshall Greenblatt
9ec03906a8 Don't execute URLRequest callback for already canceled requests (issue #1685) 2015-08-20 17:05:14 -04:00
Marshall Greenblatt
1999a3f237 Don't render the OSR parent view when a full-screen view is visible (issue #1694) 2015-08-20 12:28:48 -07:00
Marshall Greenblatt
b543d3217d Windows: Fix incorrect usage of MAKEINTRESOURCE (issue #1692) 2015-08-20 13:14:14 -04:00
Marshall Greenblatt
f4e579f1e8 Remove C++11 "= default" to maintain compatibility with older VS versions (issue #1693) 2015-08-20 10:50:11 -04:00
Marshall Greenblatt
fda35eae80 Windows: Fix VS2015 build errors in the binary distribution (issue #1692) 2015-08-20 10:22:12 -04:00
Marshall Greenblatt
cd7e0eef20 Fix rendering of the PDF extension with OSR when the device scale factor is not 1 (issue #1687) 2015-08-19 12:40:38 -07:00
Marshall Greenblatt
39020fb2ea Fix duplicate/incorrect type defines (issue #1683) 2015-08-17 20:59:36 -04:00
Marshall Greenblatt
614e2a5b7e Add missing OVERRIDE specifier to avoid compile errors with clang 3.6 (issue #1688) 2015-08-17 19:06:43 -04:00
Marshall Greenblatt
aef9fd486a cefclient: Set recommended command-line switches for off-screen rendering 2015-08-17 18:14:59 -04:00
Marshall Greenblatt
4b491c3a77 Fix assertion when loading the PDF extension with begin-frame-scheduling and OSR (issue #1686) 2015-08-17 15:50:04 -04:00
Marshall Greenblatt
a63d646e3b Update to Chromium revision fc6ad471 (#342568) 2015-08-14 14:42:03 -04:00
Marshall Greenblatt
a08686e6a6 cefclient: Support dynamic configuration of the device scale factor with off-screen rendering (issue #1674) 2015-08-11 14:19:16 -04:00
Marshall Greenblatt
41669141eb Windows: cefclient: Improve high-dpi display (issue #1674).
- Add high-dpi support to the OSR example.
- Apply DPI scaling to the buttons and URL bar.
2015-08-10 14:08:15 -04:00
Marshall Greenblatt
9e0d84d94a Windows: Add CefEnableHighDPISupport function and fix high-dpi scaling issues (issue #1674) 2015-08-07 16:04:03 -04:00
Marshall Greenblatt
2792d1bb12 Linux: Fix undefined reference to 'AtomicOps_Internalx86CPUFeatures' (issue #1681) 2015-08-07 15:13:49 -04:00
Marshall Greenblatt
828fe45bc1 Linux: Fix Debug build IO access warning (issue #1565) 2015-08-07 15:08:52 -04:00
Marshall Greenblatt
560b881a2f Add missing kSpellCheckDictionaries preference (issue #1682) 2015-08-07 15:04:50 -04:00
Marshall Greenblatt
6cb3be7395 Windows: Fix crash on startup with multi-threaded-message-loop (issue #1678) 2015-08-05 13:24:01 -04:00
Marshall Greenblatt
3010ee1ce6 Windows: Fix focus/blur handling (issue #1677) 2015-08-04 13:53:59 -04:00
Marshall Greenblatt
5f0720e096 Fix loading of the DevTools window.
- The devtools.html file has been renamed to inspector.html.
2015-07-31 16:54:57 -04:00
Marshall Greenblatt
96e116de9e Windows: Fix multiple handling of WM_MOUSEWHEEL messages (issue #1481) 2015-07-31 14:45:31 -04:00
Marshall Greenblatt
84c7b0ad8a Add CHECK() to verify that the resources directory is an absolute path (issue #1673) 2015-07-29 12:13:14 -04:00
Marshall Greenblatt
322d697169 Linux: Remove DCHECK hit when initializing CEF from a non-main thread (issue #1639) 2015-07-29 12:04:19 -04:00
Marshall Greenblatt
c992ef9d57 Update automate-git.py for removal of .DEPS.git in newer branches (issue #1671) 2015-07-27 13:43:43 -04:00
Marshall Greenblatt
8da8a4fbf1 Update to Chromium revision 12bfc336 (#338390).
- The ffmpeg library is now statically linked (see https://codereview.chromium.org/1141703002).
- Off-screen rendering of the PDF viewer does not work in combination with surfaces. Pass the
  `--disable-surfaces` command-line flag if GPU is enabled (see https://codereview.chromium.org/1169983006).
2015-07-24 16:11:13 -04:00
Marshall Greenblatt
50a9343cec Fix warning C4267: 'argument' : conversion from 'size_t' to 'int' (issue #1647) 2015-07-23 14:29:54 -04:00
Marshall Greenblatt
b7a56d9343 Add PDF extension support (issue #1565) 2015-07-23 14:02:03 -04:00
Marshall Greenblatt
aefb5ccce8 Fix unknown type when logging IPC messages (issue #963) 2015-06-12 13:54:42 -04:00
Marshall Greenblatt
272ecc3047 Windows: Fix sandbox permissions for Flash video playback (issue #1650) 2015-06-11 19:00:09 -04:00
Marshall Greenblatt
ee90dc0915 Windows: Add DirectWrite font cache support (issue #1652) 2015-06-11 18:08:33 -04:00
Marshall Greenblatt
de05577c86 Support full-screen Flash with off-screen rendering (issue #1648) 2015-06-11 11:00:05 -04:00
Marshall Greenblatt
378a64b39a Update to Chromium revision 14bd12d6 (#333041)
- Remove CefNavigationEntry::GetFrameName() (see http://crbug.com/477150#c5).
- Devirtualize base::BindState (see http://crbug.com/486594).
- Move Tuple to the base namespace.
2015-06-08 17:31:50 -04:00
Marshall Greenblatt
d820080479 Add fullscreen API support (issue #562) 2015-06-04 18:33:24 -04:00
Alexei Bykov
85f83680d7 Add PDF printing support (issue #1478). 2015-06-04 13:15:26 -04:00
Marshall Greenblatt
b6e5310bce Add CefResourceManager class for mapping requests to data providers (issue #1640). 2015-06-03 15:21:40 -04:00
Yu-Teh Shen
d02f03a71a Add JSON parsing support (issue #1188). 2015-06-03 15:03:41 -04:00
Marshall Greenblatt
373180fef2 Windows: Add default extension to file name in save dialog (issue #1646) 2015-06-03 14:51:09 -04:00
Felix Bruns
c5b8b8b9c8 Add support for draggable regions (issue #1645).
Regions are defined using the '-webkit-app-region: drag/no-drag'
CSS property and passed to the CefDragHandler::
OnDraggableRegionsChanged callback.
2015-06-03 14:48:28 -04:00
Marshall Greenblatt
ead921a3f6 Mac: Use NSColor function available in older SDKs (issue #1605) 2015-05-19 14:54:39 -04:00
Marshall Greenblatt
0d905e3744 - Add support for client SSL certificates (issue #1608).
- Remember OnCertificateError approvals (issue #1590).
2015-05-19 14:39:45 -04:00
Marshall Greenblatt
2a308f2a05 Linux: Disable ODR detection for cef_unittests target (issue #1604) 2015-05-14 08:10:22 -07:00
Marshall Greenblatt
483a841348 Add a new CefBrowserHost::SetWindowlessFrameRate method to support
dynamic configuration of the windowless frame rate (issue #1629).
2015-05-13 20:42:40 +03:00
Marshall Greenblatt
42341b40fa Fix crash when calling LoadURL from OnRenderProcessTerminated (issue #1161) 2015-05-13 09:18:46 -04:00
Marshall Greenblatt
a388a69356 Fix incorrct DCHECK in CefAllowCertificateErrorCallbackImpl::RunNow (issue #1626) 2015-05-07 10:37:50 -04:00
Marshall Greenblatt
b849e7fb70 Return CefTime instead of time_t from CefZipReader::GetFileLastModified (issue #1625) 2015-05-05 19:12:10 -04:00
Marshall Greenblatt
616fdbf3ff Improve inheritance support in the CEF API (issue #1623).
- Support single parent inheritance in CEF API classes.
- Support non-virtual inheritance in CEF API classes.
- Support translation of CEF API sub-directories.
- Add test sub-directories for testing-only functionality that will be
  available to unit tests but not exposed via the binary distribution.
- Add unit tests for the translator tool.
- Fix parsing of template parameter types that include commas.
2015-05-05 17:16:44 -04:00
Marshall Greenblatt
4715a1644e Windows: Fix IME window placement and dismissal in password fields (issue #1377) 2015-04-24 18:33:27 +03:00
Marshall Greenblatt
b6f09f3865 Improve documentation for CefSettings.multi_threaded_message_loop 2015-04-24 14:53:57 +03:00
Marshall Greenblatt
ab50008595 Windows: Fix placement of IME window (issue #1610) 2015-04-24 14:25:50 +03:00
Marshall Greenblatt
faafdd2cd7 Update to Chromium revision c03558c9 (#326273) 2015-04-24 11:04:30 +03:00
Marshall Greenblatt
aeb35d2f36 Fix typo in automate-git.py (issue #1612) 2015-04-22 16:01:55 +03:00
Marshall Greenblatt
939a6598c1 Add ability to patch Chromium DEPS file (issue #1612) 2015-04-22 15:33:52 +03:00
Marshall Greenblatt
1c6da5fe86 Update to Chromium revision 59d44948 (#323860) 2015-04-20 19:48:43 +03:00
Marshall Greenblatt
0369063810 - Add CefValue for wrapping various value types in a single object (issue #1607).
- Add IsSame() and IsEqual() methods for comparing CefValue* types.
- Improve CefValue* documentation.
2015-04-16 15:04:56 +02:00
Marshall Greenblatt
740ad72f90 Update automate_git.py to set GYP_CHROMIUM_NO_ACTION (issue #1470). 2015-04-13 17:11:54 +02:00
YuTeh Shen
505f11159a Add support for the webkit-directory attribute (issue #958). 2015-04-10 12:17:14 +02:00
Marshall Greenblatt
ae91d8f4e5 - cefclient: Add background-color command-line argument (issue #1161).
- Rename cef_url.h to cef_parser.h.
- Add new CefParseCSSColor function.
2015-04-10 11:35:31 +02:00
Marshall Greenblatt
2c03492160 Mac: Fix customization of background color (issue #1161). 2015-04-08 17:43:00 +02:00
Marshall Greenblatt
6cceb1bd41 Mac: Add disable-scroll-bounce command-line flag (issue #1597). 2015-04-08 15:42:50 +02:00
Marshall Greenblatt
4a905f1e2b - Allow asynchronous continuation of OnBeforeResourceLoad (issue #1593).
- Use CefRequestCallback for most asynchronous CefRequestHandler methods.
2015-04-08 10:33:49 +02:00
Marshall Greenblatt
a82110b31e Fix documentation reference to CefV8ContextHandler. 2015-03-30 11:40:33 +02:00
Marshall Greenblatt
2fe1d33239 Add Pepper Flash plugin support (issue #1586).
A system-wide installation of the Pepper Flash plugin is available from Adobe
for Windows and Mac OS X platforms as a separate download. To enable automatic
detection and loading of the system-wide installation pass the
`--enable-system-flash` command-line flag.

The Pepper Flash plugin can also be loaded by specifying the file path and
version via the `--ppapi-flash-path=<path> --ppapi-flash-version=<version>`
command-line flags. The version can be identified by viewing the
manifest.json file in the same directory as the Pepper Flash plugin library.
2015-03-26 17:00:30 -04:00
Marshall Greenblatt
1772ac0278 Fix line endings 2015-03-26 10:24:39 -07:00
Marshall Greenblatt
5e5bbac692 README.md edited online with Bitbucket 2015-03-23 22:36:10 +00:00
Marshall Greenblatt
d7f7c61ddd Update to Chromium revision fea84635 (#321386)
- Use a separate utility process for V8 proxy resolution (see http://crbug.com/11746).
2015-03-20 16:52:33 -04:00
Marshall Greenblatt
aaab7bdb35 Make the cef_locales target depend on components_strings to fix ninja race condition (issue #1423) 2015-03-19 18:38:40 -04:00
Marshall Greenblatt
5914c50a88 README.md edited online with Bitbucket 2015-03-19 18:11:30 +00:00
Marshall Greenblatt
ac5797269e Use absolute paths for CEF generated files in .gitignore 2015-03-18 21:21:11 -04:00
Marshall Greenblatt
fa48d98877 Add .gitignore file 2015-03-18 21:03:01 -04:00
Marshall Greenblatt
7968594ec6 Remove unnecessary username component from Bitbucket url 2015-03-18 17:58:14 -04:00
Chromium Embedded Framework
b06d429416 README.md edited online with Bitbucket 2015-03-18 19:17:46 +00:00
Marshall Greenblatt
c80f4ba6a6 README.md edited online with Bitbucket 2015-03-17 22:28:58 +00:00
Marshall Greenblatt
bac83749c4 Update the project URL in txt files 2015-03-17 16:58:14 -04:00
Marshall Greenblatt
7b70c8317e Update the project URL in the binary distribution README.txt 2015-03-17 16:46:41 -04:00
Marshall Greenblatt
159f315483 Change CEF version number format to remove SVN dependency (issue #1580). 2015-03-17 13:43:57 -04:00
Marshall Greenblatt
7acecd6b6b Change CEF version number format to remove SVN dependency (issue #1580). 2015-03-16 19:34:35 -04:00
Chromium Embedded Framework
d17dc3e5de README.md edited online with Bitbucket 2015-03-16 19:40:26 +00:00
Chromium Embedded Framework
75bb909731 README.md edited online with Bitbucket 2015-03-15 04:42:48 +00:00
Marshall Greenblatt
236d419d9d Improvements to automate-git.py
- Remove support for SVN checkouts (issue #1577).
- Use new Bitbucket cef.git repo for Git checkouts (issue #1577).
- Windows: Set DEPOT_TOOLS_WIN_TOOLCHAIN=0 to avoid errors while
  running Chromium hooks (issue #1533).
- Fix create/restore of out_<branch> directories.
2015-03-14 23:27:12 -04:00
Chromium Embedded Framework
36a97330bd README.md edited online with Bitbucket 2015-03-14 15:44:49 +00:00
Chromium Embedded Framework
567fe67274 README.md edited online with Bitbucket 2015-03-14 15:07:07 +00:00
Marshall Greenblatt
4ede1cc416 Linux: Remove unused build.sh file from the binary distribution.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2076 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-12 17:07:18 +00:00
Marshall Greenblatt
c67b825fdc Linux: Remove unused build.sh file from the binary distribution.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2075 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-12 17:05:18 +00:00
Marshall Greenblatt
558a8a3658 Implement improvements for request handling (issue #1327).
- Add a new CefRequestHandler::OnResourceResponse() method for inspecting the request/response headers and potentially restarting or redirecting the request.
- Add a new CefRequest::GetIdentifier() method for tracking a request across multiple CefRequestHandler callbacks.
- Pass a CefRequest object instead of just the old URL to CefRequestHandler::OnResourceRedirect().

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2073 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-11 18:44:11 +00:00
Marshall Greenblatt
0b36550786 Linux: cefclient: Fix suggested file name display in the save file dialog (issue #1572).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2072 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-10 18:54:05 +00:00
Marshall Greenblatt
5d4942fdf3 Move natives_blob.bin and snapshot_blob.bin files to the build configuration directory in the binary distribution (issue #1554).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2071 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-10 17:46:53 +00:00
Marshall Greenblatt
c252bf29dd Windows: Fix display of default JavaScript dialogs (issue #760).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2067 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-09 22:08:17 +00:00
Marshall Greenblatt
b43d26a4e5 Support selection of WebRTC audio/video source (issue #1335).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2065 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-09 21:57:00 +00:00
Marshall Greenblatt
9dc7d2a398 Add a new CefRequestHandler::OnRenderViewReady method which is called when a browser is ready to receive/handle IPC messages in the render process (issue #1564).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2055 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-09 21:05:22 +00:00
Marshall Greenblatt
c49473729d Add a new CefRequestHandler::OnOpenURLFromTab method for handling certain limited cases where navigating a new or different browser might be desirable (issue #1526).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2054 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-09 20:22:31 +00:00
Marshall Greenblatt
5de989e306 Add target disposition and user gesture parameters to CefLifeSpanHandler::OnBeforePopup (issue #1525).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2053 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-06 21:38:38 +00:00
Marshall Greenblatt
36fd5e3ed0 Pass the scroll offset to CefRenderHandler::OnScrollOffsetChanged (issue #1561).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2052 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-06 17:50:14 +00:00
Marshall Greenblatt
a4c4246897 Fix heap-use-after-free in CefBrowserMessageFilter::OnFrameFocused (issue #1567).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2049 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-04 19:24:16 +00:00
Marshall Greenblatt
5f3df0b702 Add missing initializer to CefStreamResourceHandler constructor (issue #1187).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2046 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-04 19:01:53 +00:00
Marshall Greenblatt
4edc996180 Remove an unused patch to ContentBrowserClient (issue #1161).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2044 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-04 01:15:50 +00:00
Marshall Greenblatt
ac4f451c94 Update to Chromium revision 47fb4821 (#318735).
- Remove the in-process PDF plugin implementation. A new implementation is now required (issue #1565).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2043 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-04 01:00:13 +00:00
Marshall Greenblatt
a9191b26d2 Fix heap-use-after-free when shutting down CEF with DevTools remote debugging enabled (issue #1557).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2041 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-03 18:40:52 +00:00
Marshall Greenblatt
ca0e381681 Add support for complete isolation of storage and permissions (cache, cookies, localStorage, access grants, etc) on a per-request-context basis (issue #1044).
- CefRequestContext instances can be configured using a new CefRequestContextSettings structure passed to CefRequestContext::CreateContext.
- Scheme registration is now per-request-context using new CefRequestContext::RegisterSchemeHandlerFactory and ClearSchemeHandlerFactories methods.
- Cookie managers are now per-request-context by default and can be retrieved using a new CefRequestContext::GetDefaultCookieManager method.
- CefURLRequest::Create now accepts an optional CefRequestContext argument for associating a URL request with a context (browser process only).
- The CefRequestContextHandler associated with a CefRequestContext will not be released until all objects related to that context have been destroyed.
- When the cache path is empty an in-memory cache ("incognito mode") will be used for storage and no data will be persisted to disk.
- Add CefSettings.user_data_path which specifies the location where user data such as spell checking dictionary files will be stored on disk.
- Add asynchronous callbacks for all CefCookieManager methods.
- Add PK_LOCAL_APP_DATA and PK_USER_DATA path keys for retrieving user directories via CefGetPath.
- cefclient: Add "New Window" test that creates a new window unrelated to existing windows. When used in combination with `--request-context-per-browser` the new window will be given a new and isolated request context.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2040 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-02 20:25:14 +00:00
Marshall Greenblatt
031f192e5a Linux: Fix heap-buffer-overflow when passing command-line arguments to cef_unittests (issue #1458).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2037 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-02 17:26:11 +00:00
Marshall Greenblatt
bfac5a1c46 Windows: Add natives_blob.bin and snapshot_blob.bin to binary distribution (issue #1554).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2036 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-03-02 17:06:34 +00:00
Marshall Greenblatt
80128453c3 Support configuration of the "Accept-Language" HTTP header globally or on a per-browser basis using new CefSettings.accept_language_list and CefBrowserSettings.accept_language_list members (issue #318).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2034 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-18 18:10:44 +00:00
Marshall Greenblatt
f67b6fecaf Support configuration of the "Accept-Language" HTTP header globally or on a per-browser basis using new CefSettings.accept_language_list and CefBrowserSettings.accept_language_list members (issue #318).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2033 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-18 17:28:56 +00:00
Marshall Greenblatt
7a2ce64096 Fix issues related to request and context object lifespan (issue #1037, issue #1044).
- Simplify and document the relationship between the various context object types. See browser_context.h for a description of the new relationships.
- cefclient: Add `request-context-per-browser` command-line flag for testing multiple CefRequestContext instances.
- cefclient: Add a CefURLRequest example.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2032 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-13 23:17:08 +00:00
Marshall Greenblatt
559ca19bbe Fix documentation for CefBrowserSettings::javascript_close_windows (issue #1407).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2030 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-11 19:20:30 +00:00
Marshall Greenblatt
7c5cb76692 - Pass SSL certificate information to CefRequestHandler::OnCertificateError via a new CefSSLInfo interface (issue #1530).
- cefclient: Improve error message text and use a data: URI instead of LoadString for loading error messages (issue #579).
- Add functions in cef_url.h for base64 and URI encoding/decoding (issue #579).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2028 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-11 18:15:04 +00:00
Marshall Greenblatt
cda8819b62 Improvements to automate-git.py:
- Mac: 32-bit builds are no longer support with 2272 branch and newer (issue #1517).
- Add `--dry-run-platform` flag to simulate execution on a different platform.
- Print the value of all build-related environment variables.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2025 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-10 17:08:30 +00:00
Marshall Greenblatt
282eb76750 Linux: Apply simpler solution for multiple definition of 'AtomicOps_Internalx86CPUFeatures' error
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2021 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-05 21:47:25 +00:00
Marshall Greenblatt
3dc9072f58 Update to Chromium revision beafd8cb (#314338).
- Remove unused CefContextMenuHandler::GetMisspellingHash() method.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2020 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-04 18:10:14 +00:00
Marshall Greenblatt
4f301a098b cefclient: Fix/improve source code documentation (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2019 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-02 23:18:16 +00:00
Marshall Greenblatt
82655ea01a cefclient: Move files containing the main() program entry point to the top-level cefclient directory (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2018 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-02 22:33:35 +00:00
Marshall Greenblatt
3ae110bd92 cefclient: Restructure file lists in CMakeLists.txt.in to generate nicer output (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2017 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-02 22:29:50 +00:00
Marshall Greenblatt
6f8def12a5 cefclient: Add missing include (issue #1518).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2016 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-02-02 21:03:19 +00:00
Marshall Greenblatt
1ce99c0ed4 cefclient: Split ClientApp into process-specific types (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2015 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-31 04:41:36 +00:00
Marshall Greenblatt
5c28259c31 cefclient: Organize source files into directories by target process (browser, renderer, common) (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2014 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-31 00:55:56 +00:00
Marshall Greenblatt
52b02eb838 cefclient: Mac: Move the mac/ folder to resources/mac/ (issue #1500)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2013 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-30 20:55:28 +00:00
Marshall Greenblatt
8fe95d54d9 cefclient: Windows: Move icon files to a new resources/win folder (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2012 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-30 20:26:16 +00:00
Marshall Greenblatt
0255e4c741 cefclient: Rename the res/ folder to resources/ (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2011 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-30 20:22:46 +00:00
Marshall Greenblatt
16b3817b82 cefclient: Mac: Reduce helper process file dependencies (issue #1500)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2010 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-30 19:34:58 +00:00
Marshall Greenblatt
c6f8c63a45 cefclient: Simplify TempWindow usage (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2009 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-30 19:08:53 +00:00
Marshall Greenblatt
50380c7be4 cefclient: Remove ClientHandler abstraction that is no longer necessary now that all platforms use RootWindow (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2008 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-30 18:55:55 +00:00
Marshall Greenblatt
bd9b578f05 cefclient: Mac: Clean up ClientAppDelegate initialization (issue #1500)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2007 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-30 18:13:39 +00:00
Marshall Greenblatt
c44f6f7efb cefclient: Mac: Introduce RootWindow concept and associated window/client object hierarchy (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2006 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-30 18:07:13 +00:00
Marshall Greenblatt
0031e7c603 cefclient: Add missing include (issue #1500)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2005 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-29 21:44:17 +00:00
Marshall Greenblatt
89de4a5bb6 - cefclient: Linux: Introduce RootWindow concept and associated window/client object hierarchy (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2004 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-29 20:53:53 +00:00
Marshall Greenblatt
37464c2a4c cefclient: Windows: Fix type conversion error (issue #1511).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2003 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-28 17:14:52 +00:00
Marshall Greenblatt
fd5ededb27 - cefclient: Windows: Introduce RootWindow concept and associated window/client object hierarchy (issue #1500).
- cefclient: Remove locking from ClientHandlerShared that was only required for the Windows implementation (issue #1500).
- Add CefDeleteOnThread helper for deleting ref-counted types on a named CEF thread.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2001 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-27 00:03:25 +00:00
Marshall Greenblatt
bcab7e0ebd cefclient: Mac: Fix compile error (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2000 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-26 22:49:36 +00:00
Marshall Greenblatt
a66c401687 - cefclient: Split ClientHandler into an abstract base class and a concrete implementation for shared usage (issue #1500).
- cefclient: Show an alert box when selecting Tests > Popup Window while running in off-screen rendering mode.
- cefclient: Mac: Enable/disable UX buttons to match loading state.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1999 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-26 19:34:26 +00:00
Marshall Greenblatt
3f4c5acbe7 Add missing include statement (issue #1502).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1997 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-26 00:59:40 +00:00
Marshall Greenblatt
d640978350 Check that the return value of CefClient::GetRenderHandler is non-NULL (issue #1504).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1995 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-26 00:57:01 +00:00
Marshall Greenblatt
f38c620e28 cefclient: Linux: Move GTK dialog handlers from ClientHandler into a separate class (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1991 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-23 20:03:47 +00:00
Marshall Greenblatt
dfc2dfb0f5 cefclient: Move all remaining files to the client namespace (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1990 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-23 19:23:54 +00:00
Marshall Greenblatt
68cb4b6213 cefclient: Move all remaining files to the client namespace (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1989 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-23 19:09:34 +00:00
Marshall Greenblatt
87c41bf99f cefclient: Standardize osr-related file names and move to the client namespace (issue #1500).
cefclient: Windows: Move OSRWindow static methods to util_win (issue #1500).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1988 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-23 17:37:23 +00:00
Marshall Greenblatt
986e6fb939 cefclient: Don't specify virtual in combination with OVERRIDE since it's redundant (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1987 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-23 16:20:52 +00:00
Marshall Greenblatt
7a0b40e8c9 cefclient: Don't specify virtual in combination with OVERRIDE since it's redundant (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1986 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-22 23:34:29 +00:00
Marshall Greenblatt
b9dd027411 cefclient: Replace global App* functions with singleton MainContext instance (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1985 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-22 23:11:30 +00:00
Marshall Greenblatt
af0635bb34 cefclient: Use test_runner::Alert instead of platform-specific notifications (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1984 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-22 21:39:36 +00:00
Marshall Greenblatt
1428f022af - cefclient: Add test_runner as the single entry point for running test-related code and move test implementations to the client namespace (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1983 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-22 20:21:21 +00:00
Marshall Greenblatt
249ad7f6e4 cefclient: Use an abstraction for message loop functionality (Run/Quit/PostTask) instead of implementing the same logic multiple times in platform-specific files (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1982 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-22 17:55:55 +00:00
Marshall Greenblatt
4bf08b70d6 Rename .cpp file extensions to .cc for consistency (issue #1500).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1981 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-22 01:55:39 +00:00
Marshall Greenblatt
f0bba98523 Add NavigationTest.PopupNavigateAfterCreation to verify that navigation of popup windows does not assert (issue #1392).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1980 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-21 17:26:42 +00:00
Marshall Greenblatt
0d084af123 Linux: Fix "No URLRequestContext for NSS HTTP handler" error (issue #1490).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1978 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-20 23:57:30 +00:00
Marshall Greenblatt
c71cae325f Add CefDownloadItem::GetOriginalUrl method (issue #1201).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1976 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-20 22:48:32 +00:00
Marshall Greenblatt
8a35083b8f Fix crash when spell checking with custom CefRequestContext (issue #1497).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1974 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-20 21:59:59 +00:00
Marshall Greenblatt
e50ea8c29f - Add open folder dialog support (FILE_DIALOG_OPEN_FOLDER mode) for CefBrowserHost::RunFileDialog (issue #1030).
- Standardize file dialog behavior across all platforms (issue #1492).
-- Show a file type filter list on OS X.
-- Show the file extensions as part of the filter list description on all platforms (e.g. "Image Types (*.png;*.gif;*.jpg)").
-- Rename the CefBrowserHost::RunFileDialog |accept_types| argument to |accept_filters| and expand support for filters that will be displayed as-is in addition to the currently supported mime-type and extension-based filters. For example, a filter value of "Supported Image Types|.png;.gif;.jpg" will display "Supported Image Types (*.png;*.gif;*.jpg)" in the filter drop-down list and accept *.png, *.gif and *.jpg files.
-- Persist the selected filter item index by passing a new |selected_accept_filter| argument to CefBrowserHost::RunFileDialog and returning the newly selected index via the CefRunFileDialogCallback and CefFileDialogCallback callbacks.
-- Rename the CefBrowserHost::RunFileDialog |default_file_name| argument to |default_file_path| and use the directory component, if any, to set the default directory location. If |default_file_path| ends in a trailing path separator it will be treated as a directory without a file name component.
-- Add FILE_DIALOG_OVERWRITEPROMPT_FLAG and FILE_DIALOG_HIDEREADONLY_FLAG values to cef_file_dialog_mode_t for controlling those behaviors where possible.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1973 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-20 18:24:54 +00:00
Marshall Greenblatt
3eabbb2e7d Fix crash when calling LoadURL/Reload from OnRenderProcessTerminated (issue #1429).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1971 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-13 17:38:49 +00:00
Marshall Greenblatt
a76510c0bd Set the CefResponse mime type before calling CefResourceHandler::GetResponseHeaders if it can be determined based on the requested path's file extension (issue #1098).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1970 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-12 21:40:40 +00:00
Marshall Greenblatt
758d5c23c5 Add CefFindHandler for reporting find results (issue #1482).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1969 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-12 21:04:08 +00:00
Marshall Greenblatt
a2d690a9bd Use int64 instead of uint64 for CefURLRequestClient progress notifications (issue #1202).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1968 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-12 20:46:31 +00:00
Marshall Greenblatt
04e072ca40 Windows: Fix execution of keyboard menu shortcuts (issue #1387).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1967 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-12 19:54:58 +00:00
Marshall Greenblatt
833f762273 Add the ability to Pause/Resume downloads via new CefDownloadItemCallback methods (issue #1425).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1966 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-12 19:47:40 +00:00
Marshall Greenblatt
ad536f769f Add CefDisplayHandler::OnFaviconURLChange callback (issue #964).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1965 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-12 19:37:52 +00:00
Marshall Greenblatt
054300874d Improvements to unit test behavior.
- Standardize the test timeout implementation using a new TestHandler::SetTestTimeout method and enable timeouts for almost all tests. The test timeout can be disabled globally using a new `--disable-test-timeout` command-line flag.
- Wait for TestHandler object destruction at the end of each test using a new ReleaseAndWaitForDestructor function. This avoids test state leakage and verifies that no object references are leaked.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1964 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-09 23:40:26 +00:00
Marshall Greenblatt
ba198e9ef1 Update to Chromium revision d3cf92ca (#310534).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1963 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-09 17:22:10 +00:00
Marshall Greenblatt
b5e8914bde - Change ALLOW_UNUSED to ALLOW_UNUSED_TYPE and ALLOW_UNUSED_LOCAL to match Chromium.
- Windows: d3dcompiler_46.dll changed to d3dcompiler_47.dll due to 8.1 SDK update (issue #1484).
- Windows: Fix `local variable is initialized but not referenced` warning with Release build (issue #1484).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1962 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-08 02:42:59 +00:00
Marshall Greenblatt
7fe86e0b26 Update copyright year in generated files.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1961 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-05 13:03:50 +00:00
Marshall Greenblatt
d0a45cfbbb Add support for begin frame scheduling and direct rendering when GPU compositing is disabled (issue #1368).
- Always set the browser process VSync rate (frame rate) to CefSettings.windowless_frame_rate.
- When the `enable-begin-frame-scheduling` command-line flag is specified the VSync rate for all processes will be synchronized to CefSettings.windowless_frame_rate. This flag cannot be used in combination with windowed rendering.
- When the `disable-gpu` and `disable-gpu-compositing` command-line flags are specified the CefRenderHandler::OnPaint method will be called directly from the compositor instead of requiring an additional copy for each frame.
- CefRenderHandler::OnPopupSize now passes view coordinates instead of (potentially scaled) pixel coordinates.
- Add OSR unit tests for 2x (HiDPI) pixel scaling.
- Improve CefRenderHandler documentation.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1960 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2015-01-01 16:51:56 +00:00
Marshall Greenblatt
3aec2e1a72 Windows: Ignore C4702 unreachable code warning for binary distribution build (issue #1472).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1958 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-12-15 12:31:22 +00:00
Marshall Greenblatt
5a5d2caff2 Update to Chromium revision 8cb76f56 (#307671)
- Linux/Mac: Load V8 initial snapshot from external bin files (see http://crbug.com/421063).
- Windows: 8.1 SDK is now required (issue #1470).
- Remove CefDOMDocument::GetSelectionStartNode and GetSelectionEndNode methods(see https://codereview.chromium.org/763043004).
- Rename internal namespace used in base headers to avoid linker conflicts with cef_sandbox.lib.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1956 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-12-13 20:18:31 +00:00
Marshall Greenblatt
ac81cbcdf1 Windows: Use the amd64_x86 cross-compiler with custom builds (issue #1470).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1954 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-12-09 12:48:17 +00:00
Marshall Greenblatt
0fbc37a2fd Fix check for WIN_CUSTOM_TOOLCHAIN (issue #1470).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1952 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-12-09 10:30:39 +00:00
Marshall Greenblatt
7eea6d3c18 Windows: Support building with a custom VS toolchain (issue #1470).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1950 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-12-08 20:06:16 +00:00
Marshall Greenblatt
405dd1824b Fix crash when passing NULL |callback| to CefEndTracing.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1948 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-12-02 16:42:34 +00:00
Marshall Greenblatt
b12e172af0 Improve off-screen rendering behavior (issue #1257).
- The |dirtyRects| argument to CefRenderHandler::OnPaint is now a single rectangle representing the union of all dirty rectangles since the last frame was generated. In most cases this rectangle will be smaller than the view (frame) size.
- cefclient: Use a ScopedGLContext class on all platforms to manage the current GL context and avoid GL state leaks.
- cefclient: Add debug checks in ClientOSRenderer for GL errors and fix some errors that were discovered.
- cefclient: Add a new `--show-update-rect` command-line flag that provides visualization of the update rectangle by drawing a red border around it for each frame.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1945 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-12-02 11:23:57 +00:00
Marshall Greenblatt
cbae1994ae Mac: Fix frame rate with OSR (issue #1456).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1943 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-12-01 09:25:15 +00:00
Marshall Greenblatt
7efd15daa0 Linux: Fix build with use_allocator=none.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1940 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-27 02:41:29 +00:00
Marshall Greenblatt
af31ea83ac Remove build_projects scripts which are no longer used now that non-Ninja builds are no longer supported.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1939 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-25 23:57:27 +00:00
Marshall Greenblatt
b5fd572670 Remove the check_revision.py script since it only works with SVN checkouts and SVN checkouts are no longer supported.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1938 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-25 23:45:13 +00:00
Marshall Greenblatt
1c2bb1be16 Remove automate.py since SVN download is no longer supported.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1937 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-25 23:34:48 +00:00
Marshall Greenblatt
3556777a5f Update make_distrib.py to require ninja build on all platforms.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1936 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-25 23:32:34 +00:00
Marshall Greenblatt
2dfaf00ce4 Remove old project file generation now that CMake generation is stable (issue #1404).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1935 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-25 23:18:21 +00:00
Marshall Greenblatt
1a5542af58 Linux: Fix command line for GNU linker (issue #1430).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1933 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-25 22:35:47 +00:00
Marshall Greenblatt
93c1a7fcd7 Pass cursor type and custom cursor information to CefRenderHandler::OnCursorChange (issue #1443).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1928 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-24 21:56:12 +00:00
Marshall Greenblatt
8eb14dd71f Add CefBrowserHost::GetNavigationEntries for retrieving a snapshot of navigation history (issue #1442).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1924 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-24 19:23:26 +00:00
Marshall Greenblatt
70ed757e5a Fix spelling error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1923 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-24 18:47:26 +00:00
Marshall Greenblatt
8038ff9579 Update xmlhttprequest.html to use an async request since sync requests are now deprecated.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1922 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-21 21:49:52 +00:00
Marshall Greenblatt
baa54fdadf Call OnTitleChange after navigation/reload even if the title has not changed (issue #1441).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1918 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-20 18:00:43 +00:00
Marshall Greenblatt
1dbb979792 Linux: Fix compile error due to revision 1916 (issue #1440).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1917 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-20 16:43:12 +00:00
Marshall Greenblatt
af97f34ab0 Make CefBrowserHost::CloseDevTools behave like CefBrowserHost::Close was called on the DevTools browser (issue #1439).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1916 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-19 17:56:37 +00:00
Marshall Greenblatt
f963f10acb Hide the DelegatedFrameHost when RenderProcessGone() is called. This avoids a crash due to DelegatedFrameHost calling GetHost() after RenderProcessGone() has been called.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1915 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-19 00:25:08 +00:00
Marshall Greenblatt
5389b98085 Fix rendering of off-screen popup windows (issue #1437).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1910 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-18 19:29:26 +00:00
Marshall Greenblatt
03e5cd14d3 Fix missing include in cef_scoped_ptr.h.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1908 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-18 19:11:11 +00:00
Marshall Greenblatt
5ed909194c Windows: Define CEF_USE_ATL and CEF_USE_SANDBOX for integrated builds of sample applications.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1906 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-18 19:10:23 +00:00
Marshall Greenblatt
a67f971781 Windows: Don't draw a resize frame around the browser (issue #1401).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1905 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-15 01:19:52 +00:00
Marshall Greenblatt
eef89ccdd3 Update to Chromium revision 40af916d (#303546).
- Standardize usage of virtual/override specifiers in CEF internals (see http://crbug.com/417463).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1903 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-11-12 19:25:15 +00:00
Marshall Greenblatt
470518a52e Windows/Linux: Fix positioning of select popups and dismissal on window move/resize by calling new CefBrowserHost::NotifyMoveOrResizeStarted() method from client applications (issue #1208).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1901 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-29 18:14:47 +00:00
Marshall Greenblatt
0cbadc6e07 Improvements to CMake configuration for the binary distribution (issue #1404).
- Remove libcef_dll/CMakeLists.txt dependency on the parent CMakeLists.txt file.


git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1899 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-28 13:39:13 +00:00
Marshall Greenblatt
b1026cc191 Fix configuration of the User-Agent string during startup (issue #1275).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1896 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-27 23:12:21 +00:00
Marshall Greenblatt
b7ad182732 Linux: Fix drag&drop in windows with zero or more parents (issue #1258).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1893 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-27 22:20:11 +00:00
Marshall Greenblatt
2109d76763 Windows: Fix reporting of WM_MOUSELEAVE coordinates by the cefclient OSR example (issue #1133).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1890 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-27 21:58:37 +00:00
Marshall Greenblatt
a0f5f9c6c8 Use CMake configuration to detect ATL support (issue #1328).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1888 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-27 21:34:48 +00:00
Marshall Greenblatt
43dac54b44 Improvements to CMake configuration for the binary distribution (issue #1404).
- Add LIBCEF_APPEND_PLATFORM_SOURCES macro definition in libcef_dll/CMakeLists.txt to remove dependency on macros.cmake.
- Don't add the default "lib" prefix to the libcef_dll_wrapper output library name.
- Fix a documentation error in CMakeLists.txt.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1886 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-27 18:13:01 +00:00
Marshall Greenblatt
728cc7f423 Improvements to CMake configuration for the binary distribution (issue #1404).
- Linux: Fix unrecognized command line option "-Wno-literal-suffix" error.
- Linux: Fix "_FORTIFY_SOURCE" redefined error.
- Mac: Warn about undefined PROJECT_ARCH value.
- Provide default CMAKE_BUILD_TYPE value when unspecified in combination with Ninja or Unix Makefiles generator.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1883 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-23 15:40:45 +00:00
Marshall Greenblatt
a91de6d6db Generate CMake configuration for the binary distribution (issue #1404).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1881 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-22 21:48:11 +00:00
Marshall Greenblatt
ff77107e73 Further improvements to spell checking support (issue #137).
- Add "Add to dictionary" context menu option.
- Use available translations for "Add to dictionary" and "No spelling suggestions".
- Fix placement of context menu separators.
- Display the "No spelling suggestions" option as grayed out.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1879 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-19 01:47:27 +00:00
Marshall Greenblatt
a20b5cc88d Fix CefPoint.IsEmpty implementation (issue #1405).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1877 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-16 16:26:10 +00:00
Marshall Greenblatt
7ddcaaf14e Fix type conversion compile error (issue #1397).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1874 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-14 17:57:24 +00:00
Marshall Greenblatt
aef4fafe56 Mac: Fix nsview_additions.mm compile error
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1872 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-14 15:47:59 +00:00
Marshall Greenblatt
d15f6abc3a Add support for DevTools inspect element via a new |inspect_element_at| parameter added to CefBrowserHost::ShowDevTools (issue #586).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1870 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-11 00:12:01 +00:00
Marshall Greenblatt
5c1f3e4ffa Update LICENSE.txt copyright date.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1869 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-10 18:57:47 +00:00
Marshall Greenblatt
e26442087f Update to Chromium revision 267aeeb8 (#297060).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1864 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-10 17:56:16 +00:00
Marshall Greenblatt
57d47f64b5 Update to Chromium revision 267aeeb8 (#297060).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1863 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-10 17:54:35 +00:00
Marshall Greenblatt
aa45672d53 Fix missing cef_strings_ms.pak error (issue #1399).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1862 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-09 18:26:25 +00:00
Marshall Greenblatt
02c3655ddb Fix type conversion compile error (issue #1397).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1860 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-09 16:09:07 +00:00
Marshall Greenblatt
77aa0be191 Add spell checking support (issue #137).
This includes:
- Red underline of misspelled words in html text areas.
- Right-click context menu options to correct the misspelled word.
- New CefBrowser::ReplaceMisspelling method for accepting a word replacement.
- Methods added to CefContextMenuParams for retrieving spelling-related information.
- Uses the unified text checker when auto-correct is not enabled to match Google Chrome behavior.
- On Windows and Linux a hunspell dictionary file will be downloaded to the "<cache_path>/Dictionaries" directory as needed, or used from the <cache_path> directory if the file already exists there. The dictionary file will be downloaded from http://cache.pack.google.com/edgedl/chrome/dict/<LANG>-3-0.bdic where <LANG> is the language abbreviation.
- On OS X the spell checking implementation will use the system NSSpellChecker implementation.

The following command-line flags have been added:
--disable-spell-checking => Disable spell-checking support (no red underline, no dictionary file download, etc).
--enable-spelling-auto-correct => Automatically correct common misspellings while typing (like 'omre' to 'more' on Windows/Linux or 'ehlo' to 'helo' on OS X).
--enable-spelling-service => Enable use of the remote Google spelling service (this requires Google API keys).
--override-spell-check-lang=<LANG> => Use the specified dictionary language <LANG> instead of the language specified in the locales.pak file. To see the default/supported dictionary languages: https://code.google.com/p/chromium/codesearch#search/&q=IDS_SPELLCHECK_DICTIONARY%20xtb&sq=package:chromium


git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1859 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-07 20:44:33 +00:00
Marshall Greenblatt
de3d28f9a1 Add missing cef_render_handler_capi.h definition.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1858 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-07 20:43:21 +00:00
Marshall Greenblatt
b26468be3f Mac: Add NSSupportsAutomaticGraphicsSwitching to Info.plist (issue #1396).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1855 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-10-03 17:00:56 +00:00
Marshall Greenblatt
58de0da301 Windows: Fix cancellation of drag&drop when using off-screen rendering and multi-threaded message loop and returning false from CefRenderHandler::StartDragging (issue #1364).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1853 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-30 18:52:26 +00:00
Marshall Greenblatt
25ed4dfefc Linux: Fix browser window position in cefclient when using integrated window menu bar (issue #1388).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1851 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-30 17:20:43 +00:00
Marshall Greenblatt
4fe21a31d8 Linux: Don't use clang for binary release (issue #1390)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1850 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-30 17:04:50 +00:00
Marshall Greenblatt
949bbc64bf Add missing cef_logging.h include (issue #1389).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1848 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-30 16:49:22 +00:00
Marshall Greenblatt
2ba756d3e1 Update to Chromium revision b0aa1fb5 (#296183).
- Restore CefRenderHandler::OnScrollOffsetChanged.
- Add new RT_PING and RT_SERVICE_WORKER resource type values.
- The resource type for image sub-resource loads has changed from RT_IMAGE to RT_PREFETCH (this is a regression, see http://crbug.com/415253#c23).
- Add a patch to fix a crash in Scheduler::swapQueuesRunPendingTasks* (http://crbug.com/415478).
- Add documentation for cef_key_event_type_t values.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1846 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-26 23:48:19 +00:00
Marshall Greenblatt
418303a1ff Linux: Install xlib error handlers to avoid crash on X11 error (issue #1337).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1844 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-24 17:22:27 +00:00
Marshall Greenblatt
39ca06a66d Add new FrameTest.* unit tests and fix discovered CefFrame-related bugs.
- Allow empty |name| argument to CefBrowser::GetFrame. This will return the main frame.
- Modify CefBrowser::GetFrame to search both assigned and unique frame names.
- Calling CefFrame::IsFocused on the main frame should return true when there are no other frames.
- Fix CefBrowser::GetFrameIdentifiers and GetFrameNames to return correct values in the renderer process (issue #1236).
- Delete NavigationTest.FrameNameIdent which is now obsoleted by the new FrameTests.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1842 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-24 15:38:11 +00:00
Marshall Greenblatt
c17cd60630 Fix identification of focused frame (issue #1381).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1840 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-19 19:12:44 +00:00
Marshall Greenblatt
3850498939 Windows: Fix assertion on shutdown when using multi-threaded-message-loop (issue #755).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1837 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-18 19:11:03 +00:00
Marshall Greenblatt
d94aec3839 Change automate-git.py to use a Git checkout of depot_tools (issue #1376).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1834 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-11 21:30:57 +00:00
Marshall Greenblatt
61ffc55ec3 Linux: Reduce resource usage when the window is minimized (issue #1369).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1832 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-11 18:23:10 +00:00
Marshall Greenblatt
fa5aa5fe4e Mac: Reduce resource usage on SetWindowVisibility(false) and fix delivery of application hide/unhide notifications (issue #1369)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1830 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-10 21:32:30 +00:00
Marshall Greenblatt
082845619c Windows: Add wow_helper.exe to the 32-bit binary distribution for Vista 64-bit sandbox support (issue #1366).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1827 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-10 17:22:40 +00:00
Marshall Greenblatt
7b5632d504 Linux: Fix compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1825 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-09 21:53:06 +00:00
Marshall Greenblatt
335ba8031a Add patch_udpater.py support for added files.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1823 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-09 14:51:22 +00:00
Marshall Greenblatt
70165e0ab8 Fix uninitialized variable warning on Windows.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1822 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-08 15:28:09 +00:00
Marshall Greenblatt
6308a7e03b Windows: Set browser window size to 0x0 when minimized to reduce resource usage (issue #1369).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1820 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-04 23:12:28 +00:00
Marshall Greenblatt
df2242aff2 - Fix initial state of the |is_showing_| flag in CefRenderWidgetHostViewOSR (issue #1363).
- Windows: Modify the cefclient OSR example to call WasHidden(true) when the app is minimized.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1818 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-04 22:15:16 +00:00
Marshall Greenblatt
0b78461f5b Update to Chromium revision ad468e8b (#292352).
- Building Chromium using SVN is no longer supported.
- Remove CefDOMEvent and CefDOMEventListener (issue #933).
- Remove CefRenderHandler::OnScrollOffsetChanged (http://crbug.com/404656).
- Remove UR_FLAG_REPORT_LOAD_TIMING (https://codereview.chromium.org/451623002/).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1816 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-04 17:53:40 +00:00
Marshall Greenblatt
3f3ffdedee Fix ostream link error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1814 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-09-03 18:45:12 +00:00
Marshall Greenblatt
cba2e8ac3a Add --revert option to patch_updater.py.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1811 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-08-25 14:01:13 +00:00
Marshall Greenblatt
c06d0cd2d8 Add #ifndef guards to types in cef_build.h (issue #1336).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1808 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-08-14 13:23:47 +00:00
Marshall Greenblatt
2d12b430d3 Linux: Fix type mismatch compile error (issue #1354).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1807 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-08-14 09:42:23 +00:00
Marshall Greenblatt
828d2f68b2 Fix identification of SVN revision after picking up incremental changes in the remote CEF Git repository.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1802 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-08-08 12:40:16 +00:00
Marshall Greenblatt
5587ccbd2d Fix automate-git.py to pick up incremental changes in the remote CEF Git repository.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1799 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-08-08 12:25:11 +00:00
Marshall Greenblatt
a1fcfe8dc5 Add support for large zip files in make_distrib.py (issue #1350).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1795 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-08-07 14:41:41 +00:00
Marshall Greenblatt
9dfcf5c443 Update automate-git.py to explicitly fetch tags required for release branch builds.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1791 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-08-07 12:32:51 +00:00
Marshall Greenblatt
34ad23fa0b Add a new --force-clean-deps flag to automate-git.py that deletes/re-downloads all third-party git repos (issue #1348). Should be used in combination with the --force-clean flag.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1787 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-08-07 09:23:24 +00:00
Marshall Greenblatt
427cca8665 Linux: Fix compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1785 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-08-06 13:38:46 +00:00
Marshall Greenblatt
b34963b743 Revert revision 1765 changes due to broken sub-frame loading.
- Move LoadRequest execution to the browser process and use data: URLs for LoadString (issue #579).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1780 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-16 21:27:25 +00:00
Marshall Greenblatt
18f634c11f Add base::string16 support (issue #1336).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1779 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-15 22:07:25 +00:00
Marshall Greenblatt
b25766ed0c Fix documentation typo.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1778 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-15 18:53:53 +00:00
Marshall Greenblatt
1a819fe284 Replace NewCefRunnable* usage with base::Bind and fix CefCreateClosureTask typo (issue #1336).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1776 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-15 18:10:40 +00:00
Marshall Greenblatt
646ae3310f Update wrapper implementations to use base types (issue #1336).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1775 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-15 17:19:43 +00:00
Marshall Greenblatt
f9bf8dfa10 Fix insertion of Chromium URL/revision info into the binary distribution README.txt file (issue #1330).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1772 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-15 01:10:09 +00:00
Marshall Greenblatt
3dd37c421f Fix Release build compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1771 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-14 23:52:48 +00:00
Marshall Greenblatt
515d4e6829 Remove unused include of cef_runnable.h (issue #1336).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1770 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-14 22:26:56 +00:00
Marshall Greenblatt
122397acfc Introduce the use of Chromium types (issue #1336).
Changes to the CEF public API:
- Add base::Bind, base::Callback, base::Lock, base::WeakPtr, scoped_refptr, scoped_ptr and supporting types.
- Add include/wrapper/cef_closure_task.h helpers for converting a base::Closure to a CefTask.
- Change CefRefPtr to extend scoped_refptr.
-- Change CefBase method signatures to match RefCountedThreadSafeBase.
- Change IMPLEMENT_REFCOUNTING to use base::AtomicRefCount*.
-- Remove the CefAtomic* functions.
-- IMPLEMENT_REFCOUNTING now enforces via a compile-time error that the correct class name was passed to the macro.
- Change IMPLEMENT_LOCKING to use base::Lock.
-- Remove the CefCriticalSection class.
-- Deprecate the IMPLEMENT_LOCKING macro.
-- base::Lock will DCHECK() in Debug builds if lock usage is reentrant.
- Move include/internal/cef_tuple.h to include/base/cef_tuple.h.
- Allow an empty |callback| parameter passed to CefBeginTracing.

Changes to the CEF implementation:
- Fix incorrect names passed to the IMPLEMENT_REFCOUNTING macro.
- Fix instances of reentrant locking in the CefXmlObject and CefRequest implementations.
- Remove use of the IMPLEMENT_LOCKING macro.

Changes to cef_unittests:
- Add tests/unittests/chromium_includes.h and always include it first from unit test .cc files to avoid name conflicts with Chromium types.
- Fix wrong header include ordering.
- Remove use of the IMPLEMENT_LOCKING macro.

Changes to cefclient and cefsimple:
- Use base::Bind and cef_closure_task.h instead of NewCefRunnable*.
- Remove use of the IMPEMENT_LOCKING macro.
- Fix incorrect/unnecessary locking.
- Add additional runtime thread checks.
- Windows: Perform actions on the UI thread instead of the main thread when running in multi-threaded-message-loop mode to avoid excessive locking.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1769 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-14 22:18:51 +00:00
Marshall Greenblatt
c260a2d166 cefclient: Fix member variable naming to match Chromium style.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1768 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-11 20:28:37 +00:00
Marshall Greenblatt
6702fc573a Introduce the use of Chromium types (issue #1336).
- Move include/cef_build.h to include/base/cef_build.h.
- Move libcef_dll/cef_macros.h to include/base/cef_macros.h.
- Move include/cef_trace_event.h to include/base/cef_trace_event.h and include/internal/cef_trace_event_internal.h.
- Remove the "CEF_" prefix from TRACE macros.
- Add new include/base/cef_logging.h and include/internal/cef_logging_internal.h for logging support.
- Add new include/wrapper/cef_helpers.h for CEF_REQUIRE_*_THREAD macros and CefScopedArgArray.
- Delete the util.h headers used by tests that duplicated the above functionality.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1767 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-11 20:10:05 +00:00
Marshall Greenblatt
b9781aa000 Move LoadRequest execution to the browser process and use data: URLs for LoadString (issue #579).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1765 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-10 18:22:09 +00:00
Marshall Greenblatt
49fa439594 Return timing information for custom requests to avoid crash in WebKit (issue #1259).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1763 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-10 17:37:40 +00:00
Marshall Greenblatt
8313963a27 Linux: Add new CefPrintHandler and CefPrintSettings classes to support printing and a GTK implementation in cefclient (issue #1258).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1762 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-10 15:41:30 +00:00
Marshall Greenblatt
6f63f5d4f8 - Linux: cefclient: Add a GTK implementation of CefDialogHandler (issue #1258).
- Add new CefGetExtensionsForMimeType function.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1761 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-09 18:03:43 +00:00
Marshall Greenblatt
da1ac7dde5 Linux: cefclient: Add a GTK implementation of CefJSDialogHandler (issue #1258).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1760 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-09 17:13:06 +00:00
Marshall Greenblatt
824f8f4009 Linux: Add drag&drop support (issue #1258).
- Requires proper handling of the "XdndProxy" property on the top-level window. This currently works in cefsimple but not cefclient (perhaps due to https://bugzilla.gnome.org/show_bug.cgi?id=653264).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1759 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-08 22:37:06 +00:00
Marshall Greenblatt
81f8883b4a Bundle pepper PDF plugin on all platforms (issue #1331).
- Add new libpdf.so library on Linux and PDF.plugin app bundle on OS X.
- Move scaled resources from cef.pak into separate cef_100_percent.pak and cef_200_percent.pak files.
- Password-protected PDF files are not currently supported.
- No fallback is provided for PDF files that contain unsupported features.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1758 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-07 22:17:33 +00:00
Marshall Greenblatt
479e69fd4e Windows: Add bundled pdf.dll and use it for printing support (issue #1313).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1757 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-03 18:34:58 +00:00
Marshall Greenblatt
b3309086d9 Linux: Fix release build compile errors (issue #1316)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1754 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-02 22:51:31 +00:00
Marshall Greenblatt
cb907f3649 Update to Chromium revision 280796.
- Mac: Remove Carbon interpose library (see http://crbug.com/157130).
- Remove unused LOGSEVERITY_ERROR_REPORT value (see http://crbug.com/352378).
- CefURLRequest in the render process will now always have the UR_FLAG_REPORT_LOAD_TIMING flag set (see http://crbug.com/376025#c15).
- Change CefGeolocationHandler::OnRequestGeolocationPermission return value from void to boolean.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1753 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-02 18:25:22 +00:00
Marshall Greenblatt
4114dbd609 Add missing newline at end of file
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1752 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-30 22:54:35 +00:00
Marshall Greenblatt
dea4daffd7 Implement off-screen rendering support using delegated rendering (issue #1257).
This implementation supports both GPU compositing and software compositing (used when GPU is not supported or when passing `--disable-gpu --disable-gpu-compositing` command-line flags). GPU-accelerated features (WebGL and 3D CSS) that did not work with the previous off-screen rendering implementation do work with this implementation when GPU support is available.

Rendering now operates on a per-frame basis. The frame rate is configurable via CefBrowserSettings.windowless_frame_rate up to a maximum of 60fps (potentially limited by how fast the system can generate new frames). CEF generates a bitmap from the compositor backing and passes it to CefRenderHandler::OnPaint.

The previous CefRenderHandler/CefBrowserHost API for off-screen rendering has been restored mostly as-is with some minor changes:

- CefBrowserHost::Invalidate no longer accepts a CefRect region argument. Instead of invalidating a specific region it now triggers generation of a new frame.
- The |dirtyRects| argument to CefRenderHandler::OnPaint will now always be a single CefRect representing the whole view (frame) size. Previously, invalidated regions were listed separately.
- Linux: CefBrowserHost::SendKeyEvent now expects X11 event information instead of GTK event information. See cefclient for an example of converting GTK events to the necessary format.
- Sizes passed to the CefRenderHandler OnPaint and OnPopupSize methods are now already DPI scaled. Previously, the client had to perform DPI scaling.
- Includes drag&drop implementation from issue #1032.
- Includes unit test fixes from issue #1245.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1751 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-30 22:30:29 +00:00
Marshall Greenblatt
133317eeec Linux: Fix crash due to Chromium modifying the |argv| passed to main() (issue #620).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1750 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-25 19:47:06 +00:00
Marshall Greenblatt
3a70815036 Mac: Fix flash on resize (issue #1307)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1748 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-16 17:58:46 +00:00
Marshall Greenblatt
60e3c9c090 Fix generation of the binary distribution using gyp_chromium (issue #1304).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1746 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-13 16:28:05 +00:00
Marshall Greenblatt
2e54831860 Fix execution of OnBeforePluginLoad (issue #1284).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1744 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-12 20:42:53 +00:00
Marshall Greenblatt
de5b859c0a Update to Chromium revision 275973.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1743 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-12 20:28:58 +00:00
Marshall Greenblatt
4e0dddcfa8 Remove gyp_cef and use gyp_chromium instead (issue #1304).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1740 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-12 14:29:41 +00:00
Marshall Greenblatt
f6819004e0 Remove duplicate content in file.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1734 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-10 18:05:50 +00:00
Marshall Greenblatt
4da3c9ecaa Set DEPOT_TOOLS_WIN_TOOLCHAIN=0 by default (issue #1304).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1731 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-10 17:01:49 +00:00
Marshall Greenblatt
6a401f5955 Windows: Fix execution of keyboard shortcuts (issue #1299).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1728 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-09 20:13:24 +00:00
Marshall Greenblatt
16c005e446 Update msvs_env.bat to include VS2013 paths (issue #1304).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1725 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-09 18:26:27 +00:00
Marshall Greenblatt
38d9a4c828 Remove gyp_cef and use gyp_chromium instead (issue #1304).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1723 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-06 21:36:18 +00:00
Marshall Greenblatt
3da202a5b9 Force revert local changes when using the --force-clean switch (issue #1300).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1720 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-06 19:14:56 +00:00
Marshall Greenblatt
62d9365b51 Fix delivery of focus/blur events (issue #1301).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1717 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-06-06 19:04:21 +00:00
Marshall Greenblatt
99faa3fda4 Linux: Fix release build compile error (issue #1245).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1716 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-30 19:29:45 +00:00
Marshall Greenblatt
beb198fca9 Change CefV8ValueImpl::Handle lifespan so that persistent V8 handles can be reset after execution of the weak persistent destructor. The previous implementation reset persistent V8 handles immediately after calling SetWeak which caused a memory leak due to the weak persistent destructor never being executed (issue #1278).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1712 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-29 21:25:19 +00:00
Marshall Greenblatt
74b35c30eb Update to Chromium revision 272007.
- Remove CefSettings.accelerated_compositing option (see https://crbug.com/363772).
- Remove experimental x-webkit-speech support (see https://crbug.com/223198).
- Execute CefGeolocationHandler callbacks on the UI thread (see https://crbug.com/304341#c212).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1711 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-29 17:15:34 +00:00
Marshall Greenblatt
79bd4dd93c Linux: Use Aura to display context menus (issue #1258)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1710 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-23 17:47:07 +00:00
Marshall Greenblatt
aeb1aa7b52 Fix revision #1708 compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1709 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-22 21:21:51 +00:00
Marshall Greenblatt
3859457eef Linux: Remove GTK+ dependency and add initial Aura/X11 implementation (issue #1258)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1708 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-22 21:01:22 +00:00
Marshall Greenblatt
921c25f0af Use correct id type in CefContentBrowserClient::AllowCertificateError (issue #1282).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1705 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-12 15:56:24 +00:00
Marshall Greenblatt
791c0ff12c Mac: Fix locale error with GL shader (issue #1270).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1702 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-07 20:40:09 +00:00
Marshall Greenblatt
63c980ecc0 Add OnDragEnter support for Aura (issue #1262).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1699 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-06 21:01:41 +00:00
Marshall Greenblatt
bee216cfb2 Fix ClientHandler::EndTracing to call correct method (issue #1254).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1696 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-06 17:33:00 +00:00
Marshall Greenblatt
01cba8ccb4 Windows: Fix loading of cursor resources from DLL (issue #1265).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1693 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-06 17:20:43 +00:00
Marshall Greenblatt
84382ecbbb Fix patch_updater.py to work on non-Windows platforms.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1690 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-02 20:57:30 +00:00
Marshall Greenblatt
5b4ed93abf Fix crash when displaying html select popup (issue #1264).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1689 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-05-02 20:28:43 +00:00
Marshall Greenblatt
7f16f5fbd2 Update to Chromium revision 263053.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1683 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-30 17:14:40 +00:00
Marshall Greenblatt
95b76b30b5 Update automate-git.py to support release branches.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1681 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-25 23:56:07 +00:00
Marshall Greenblatt
f6bc617bc5 Remove the legacy off-screen rendering implementation. A new implementation is required (issue #1257).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1678 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-25 01:36:58 +00:00
Marshall Greenblatt
1e239187a2 Add patch_updater.py tool for automatically updating patch files.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1677 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-23 18:51:22 +00:00
Marshall Greenblatt
58f04c7c4c Update automate-git.py to support the new Chromium git workflow and functionality similar to automate.py.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1675 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-22 15:35:29 +00:00
Marshall Greenblatt
7511f1e921 Fix error in exec_util.py.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1667 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-18 19:03:15 +00:00
Marshall Greenblatt
da87cf449d Update scripts to support git checkouts of CEF and/or Chromium.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1664 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-18 18:31:22 +00:00
Marshall Greenblatt
5e5b753c4c Fix check_revision.py to not throw exceptions when using a Chromium git checkout.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1661 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-16 16:53:33 +00:00
Marshall Greenblatt
29ba85c53e Fix application of patch files created with git diff --no-prefix --relative .
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1659 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-16 16:32:39 +00:00
Marshall Greenblatt
33e7bb04b3 Add CefBrowserSettings.background_color for custom background color assignment on a per-browser basis and fix assignment of the default value (issue #1161).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1656 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-15 19:02:30 +00:00
Marshall Greenblatt
966b64c01f Update build instructions.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1652 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-11 20:17:19 +00:00
Marshall Greenblatt
078aae8bd8 Mac: Fix cefsimple shutdown problem when launching from Finder (issue #1203)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1650 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-09 18:47:57 +00:00
Marshall Greenblatt
8b67278279 Mac: Change shutdown-related code to match Chromium (issue #1203)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1648 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-09 18:29:51 +00:00
Marshall Greenblatt
6344555de7 Restore access to local files (issue #1249)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1647 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-09 17:58:31 +00:00
Marshall Greenblatt
66604e4741 Windows: Fix white flashes during browser initialization (issue #1161).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1645 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-08 19:33:48 +00:00
Marshall Greenblatt
d8aed5b52d Windows: Fix assignment of keyboard focus (issue #1248).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1643 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-04 22:26:39 +00:00
Marshall Greenblatt
199a3faafe Update to Chromium revision 261035.
- The CefSettings.release_dcheck_enabled option has been removed. This functionality can be enabled by setting the dcheck_always_on=1 gyp variable before building CEF/Chromium. See http://crbug.com/350462 for details.
- The UR_FLAG_ALLOW_COOKIES option has been removed and the functionality has been merged into UR_FLAG_ALLOW_CACHED_CREDENTIALS.
- Mac: [NSApplication sharedApplication] should no longer be called in the renderer process. See http://crbug.com/306348 for details.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1641 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-04-04 16:50:38 +00:00
Marshall Greenblatt
11df06b1ad Crash early on incorrect usage of CefJSDialogHandler::OnJSDialog (issue #1206).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1637 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-03-12 15:43:05 +00:00
Marshall Greenblatt
1d798844b6 Make |string| parameter to CefStringVisitor::Visit optional (issue #1216).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1635 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-03-12 14:49:11 +00:00
Marshall Greenblatt
cf348f7b83 Remove unused optional_param from OnQuotaRequest (issue #1222).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1634 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-03-12 14:46:32 +00:00
Marshall Greenblatt
b7ecb963f0 Windows: Don't apply inset to borderless windows (issue #1195).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1632 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-03-12 14:36:18 +00:00
Marshall Greenblatt
d9310e2c58 Mac: Fix execution of performClose: signal (issue #1203)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1630 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-03-06 13:42:14 +00:00
Marshall Greenblatt
5b6086ffb3 Update to Chromium revision 251746.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1628 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-19 16:27:54 +00:00
Marshall Greenblatt
4b75a68f9b Fix type conversion error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1624 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-12 18:47:01 +00:00
Marshall Greenblatt
c2090fe967 Fix wrapping of comments in generated files.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1623 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-11 22:46:57 +00:00
Marshall Greenblatt
0e8a017416 Allow usage of file streams on IO-prohibited threads (issue #1187).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1622 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-11 22:44:35 +00:00
Marshall Greenblatt
b5700a6f4c Make |origin_url| parameter to CefJSDialogHandler::OnJsDialog optional since it may be empty for non-standard schemes (issue #1106).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1621 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-11 20:23:00 +00:00
Marshall Greenblatt
fb0a28d702 Fix documentation for CefDisplayHandler::OnStatusMessage (issue #1036).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1620 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-11 18:57:14 +00:00
Marshall Greenblatt
14f5464fa5 Add new URLRequestTest.BrowserInvalidURL test (issue #888).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1615 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-10 23:28:58 +00:00
Marshall Greenblatt
769616da5f Remove the CefBrowserHost::ParentWindowWillClose method that was added for modal dialog support but never implemented (issue #519).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1613 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-10 19:53:09 +00:00
Marshall Greenblatt
b76b207ec4 Windows: Support non-ASCII paths for CefStream file access (issue #481).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1611 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-10 19:26:35 +00:00
Marshall Greenblatt
9de5343501 cefclient: Move router initialization to the UI thread to be compatible with multi-threaded-message-loop.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1609 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-10 18:53:56 +00:00
Marshall Greenblatt
7b873addd0 Fix include of C API headers from C++ code (issue #1194).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1607 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-10 17:20:38 +00:00
Marshall Greenblatt
0ff8f923f6 Linux: Make translator tool output consistent with other platforms (issue #1177).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1606 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-10 16:56:37 +00:00
Marshall Greenblatt
a0be247527 Use int instead of bool for C API compatibility (issue #1196).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1605 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-10 16:38:35 +00:00
Marshall Greenblatt
8a73d26fc2 Avoid crash when building Chrome with CEF patches applied.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1602 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-06 23:36:29 +00:00
Marshall Greenblatt
ed535dcb2a Avoid crash when building Chrome with CEF patches applied.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1600 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-06 22:33:18 +00:00
Marshall Greenblatt
fc3d05f01d Fix completion status for asynchronous custom resource handler requests (issue #1066, issue #1187).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1594 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-06 00:18:33 +00:00
Marshall Greenblatt
931e81549f Add missing patch file for revision 1592 changes.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1593 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-05 22:49:14 +00:00
Marshall Greenblatt
8078afe7bf Update to Chromium revision 248478.
- Add new CefSettings.windowless_rendering_enabled value that must be enabled when using windowless (off-screen) rendering.
- Improve naming and documentation for CefWindowInfo members.
- CefBeginTracing now completes asynchronously.
- Rename CefEndTracingAsync to CefEndTracing.
- Rename CefCompletionHandler to CefCompletionCallback.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1592 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-02-05 20:35:45 +00:00
Marshall Greenblatt
76f6ca0763 Mac: Fix compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1591 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-31 23:35:23 +00:00
Marshall Greenblatt
d47b633121 Revert unintended changes from revision 1582.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1584 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-30 23:21:58 +00:00
Marshall Greenblatt
c310dc08f5 Revert unintended changes from revision 1582.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1583 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-30 23:20:10 +00:00
Marshall Greenblatt
2534b67365 - Add MayBlock() method to stream classes which is used as a hint when determining the thread to access the stream from (issue #1187).
- In cases where MayBlock() returns true have CefStreamResourceReader perform the reads on the FILE thread (issue #1187).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1582 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-30 23:15:55 +00:00
Marshall Greenblatt
89a8832550 Fix crash when using asynchronous continuation with a custom resource handler (issue #1066).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1579 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-30 00:51:52 +00:00
Marshall Greenblatt
b608dae758 Add a new CefURLParts.origin member for retrieving the origin when parsing a URL.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1578 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-28 19:19:41 +00:00
Marshall Greenblatt
2f8b024797 Add a CefGetMimeType function for retrieving the mime type of a file extension (issue #1098).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1577 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-28 17:26:59 +00:00
Marshall Greenblatt
0c8b381a46 Windows: Fix 64-bit compile errors (issue #1184).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1576 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-28 16:58:44 +00:00
Marshall Greenblatt
0df95ca529 Provide a generic JavaScript message router implementation (issue #1183).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1574 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-27 23:31:03 +00:00
Marshall Greenblatt
78bfefee5e Add <algorithm> include required by VS2013 (issue #1094).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1571 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-14 19:57:17 +00:00
Marshall Greenblatt
a1b83784ec Mac: Fix loading of media libraries (issue #1176)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1570 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-14 17:37:02 +00:00
Marshall Greenblatt
796ddf27b4 Add <algorithm> include required by VS2013 (issue #1094).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1566 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-14 02:45:56 +00:00
Marshall Greenblatt
21c8131742 Send the kProductVersion flag to all processes (issue #1149).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1561 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-10 19:49:43 +00:00
Marshall Greenblatt
8a6530db1f Mac: Allow customization of background color (issue #1161)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1560 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-07 18:54:06 +00:00
Marshall Greenblatt
b479cb3aa3 Windows: Allow customization of background color (issue #1161).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1559 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-07 18:04:31 +00:00
Marshall Greenblatt
72660c6fed Fix C compiler errors when using the C API (issue #1165).
- Replace 'bool' with 'int' in cef_types[_*].h.
- Typedef enums in cef_types.h
- Add includes and struct forward declarations in C API header files.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1558 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-06 19:59:48 +00:00
Marshall Greenblatt
7074154725 Update copyright year in generated files.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1557 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-06 19:48:18 +00:00
Marshall Greenblatt
30c36156ea Update to Chromium revision 242756.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1553 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-01-02 22:41:11 +00:00
Marshall Greenblatt
9daee785bd Windows: Improve "view source" implementation.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1550 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-12-17 23:33:01 +00:00
Marshall Greenblatt
099664fba0 Update to Chromium revision 241258.
- Update tracing implementation to use the new file-based approach (issue #1157).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1549 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-12-17 22:04:35 +00:00
Marshall Greenblatt
992cc56583 Update the CEF logo image in cefclient.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1548 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-12-09 19:03:49 +00:00
Marshall Greenblatt
b28ce63adb Add a CEF_ENABLE_SANDBOX define in cefclient and cefsimple to make disabling the sandbox easier for non-VS2010 builds of the binary distribution (issue #524).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1546 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-12-09 16:39:00 +00:00
Marshall Greenblatt
68916c9571 Fix crash when browser window creation is canceled (issue #1147).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1543 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-12-07 01:58:36 +00:00
Marshall Greenblatt
e09948c37e Windows: Switch to aura/views architecture for content window creation (issue #180).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1542 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-12-07 01:55:22 +00:00
Marshall Greenblatt
dda0753fa8 Mac: Fix creation of dSYM files for the Release target by enabling the |mac_strip_release| GYP variable which was disabled in Chromium revision 235601.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1541 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-12-05 19:09:17 +00:00
Marshall Greenblatt
64294f659d Linux: Apply system font settings (issue #1148).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1538 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-12-02 20:07:03 +00:00
Marshall Greenblatt
916d8d08c4 Add the cefsimple sample application which demonstrates the minimal functionality required to create a browser window.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1535 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-26 22:02:14 +00:00
Marshall Greenblatt
19379d98c2 Mac: Add NSAutoreleasePool in PlatformCreateWindow to make sure CefBrowserHostView is dealloc'ed on window destruction
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1534 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-26 19:45:45 +00:00
Marshall Greenblatt
4e58096051 Remove the old (non-functional) about:tracing implementation. A new implementation is required due to Chromium changes (issue #1146).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1533 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-25 23:21:32 +00:00
Marshall Greenblatt
3d218e4442 Update to Chromium revision 237081.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1532 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-25 23:04:25 +00:00
Marshall Greenblatt
777e3c440e Mac: Fix equality test compile error (issue #1013).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1529 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-25 18:56:22 +00:00
Marshall Greenblatt
527f1aa5da Use file_util::WriteFile instead of ofstream (issue #1013).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1527 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-25 18:53:13 +00:00
Marshall Greenblatt
43d2ca32fa Support file uploads in CefURLRequests originating from the browser process (issue #1013).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1525 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-25 17:31:59 +00:00
Marshall Greenblatt
ec8b64e88a Add breakpad support (issue #1131).
- General usage instructions are available at https://sites.google.com/a/chromium.org/dev/developers/testing/webkit-layout-tests/using-breakpad-with-content-shell.
- Mac: Generate "Chromium Embedded Framework.framework" using a new cef_framework target (the libcef target is now only used on Windows and Linux). Rename "Libraries/libcef.dylib" to "Chromium Embedded Framework". Distribute Release and Debug builds of the "Chromium Embedded Framework.framework" folder as part of the binary distribution.
- Mac: Fix the Xcode target compiler setting for the binary distribution so that it no longer needs to be set manually.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1524 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-21 22:43:36 +00:00
Marshall Greenblatt
ba3615324d Enable print option in context menu (issue #1127).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1521 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-21 21:47:40 +00:00
Marshall Greenblatt
7428e45dd2 Restore CefRenderProcessHandler::OnBeforeNavigation (issue #1076). This method is still needed for some use cases due to issue #1129.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1519 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-21 20:59:28 +00:00
Marshall Greenblatt
f5bc72b234 Add sandbox support (issue #524).
- The sandbox is now enabled by default on all platforms. Use the CefSettings.no_sandbox option or the "no-sandbox" command-line flag to disable sandbox support.
- Windows: See cef_sandbox_win.h for requirements to enable sandbox support.
- Windows: If Visual Studio isn't installed in the standard location set the CEF_VCVARS environment variable before running make_distrib.py or automate.py (see msvs_env.bat).
- Linux: For binary distributions a new chrome-sandbox executable with SUID permissions must be placed next to the CEF executable. See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for details on setting up the development environment when building CEF from source code.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1518 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-15 18:47:02 +00:00
Marshall Greenblatt
395f443215 Wait for the debugger as early in process initialization as possible.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1517 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-12 17:43:39 +00:00
Marshall Greenblatt
7e1fbaca6a Update to Chromium revision 234212
- The CefBrowserSettings.user_style_sheet_location option is no longer supported in Blink.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1516 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-11 17:29:52 +00:00
Marshall Greenblatt
81f336f4bb Fix error in TaskTest.PostDelayedTask1 test.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1513 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-11 16:57:20 +00:00
Marshall Greenblatt
133e06c50a Update to Chromium revision 233896.
- The CefBrowserSettings.author_and_user_styles option is now always enabled.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1512 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-08 21:28:56 +00:00
Marshall Greenblatt
d789d84c30 Remove CefBrowserHost::GetDevToolsURL(). It is now possible to use DevTools without remote debugging, and the ability to load a remote debugging URL without first loading the discovery page is no longer supported (issue #659).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1511 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-08 16:27:22 +00:00
Marshall Greenblatt
d2dfded03a - Support DevTools without remote debugging via CefBrowserHost::ShowDevTools and CloseDevTools methods (issue #659).
- Fix loading of DevTools frontend from chrome-devtools scheme (issue #1095).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1510 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-08 16:06:06 +00:00
Marshall Greenblatt
dbbaf51383 automate.py: Run update_depot_tools even if a depot-tools directory is specified on the command-line.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1505 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-05 20:26:02 +00:00
Marshall Greenblatt
601c2b0ee9 Set "User-Agent" and "Accept-Language" headers for requests sent using CefURLRequest (issue #1125).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1502 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-30 17:42:05 +00:00
Marshall Greenblatt
78cfa155c6 Fix a crash when closing an off-screen browser with no references (issue #1121).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1500 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-29 22:19:51 +00:00
Marshall Greenblatt
81f3a75f6a Fix automate.py --dry-run output.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1497 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-29 21:30:43 +00:00
Marshall Greenblatt
b64c1b3dd2 Use scoped_refptr<> instead of raw pointer
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1495 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-29 19:14:52 +00:00
Marshall Greenblatt
0c45f66d37 Update to Chromium revision 231322.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1494 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-29 17:53:18 +00:00
Marshall Greenblatt
74fea9e2b9 Fix memory corruption in browser-initiated CefURLRequests (issue #1118).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1487 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-24 21:43:47 +00:00
Marshall Greenblatt
4fa7a4d806 Linux: Fix clang compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1485 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-24 21:40:32 +00:00
Marshall Greenblatt
c7d7b9fbbf Add search/find support (issue #513).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1482 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-23 22:44:12 +00:00
Marshall Greenblatt
bc1ea4974a Add support for printing via CefBrowserHost::Print() and JavaScript window.print() (issue #505).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1479 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-23 19:30:47 +00:00
Marshall Greenblatt
f248b937f9 Windows: Fix VS2012 compile error (issue #1109).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1474 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-18 17:27:17 +00:00
Marshall Greenblatt
6a52564668 Fix svn:eol-style property.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1470 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-18 16:33:56 +00:00
Marshall Greenblatt
bc90a7f854 Fix WebKit scripts path.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1469 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-17 22:35:50 +00:00
Marshall Greenblatt
56c1a740aa Mac: Fix compile/build errors due to Chromium update
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1468 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-17 15:13:25 +00:00
Marshall Greenblatt
d816fde859 Update to Chromium revision 228917.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1467 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-16 23:09:07 +00:00
Marshall Greenblatt
b00630d039 Windows: Pass shell=True so Popen can run a batch file (issue #1091).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1462 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-16 15:09:41 +00:00
Marshall Greenblatt
b80d75f07d Update to Chromium revision 224845.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1461 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-16 01:07:40 +00:00
Marshall Greenblatt
4c3bd0b724 Update to Chromium revision 224895.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1460 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-16 00:25:38 +00:00
Marshall Greenblatt
901528b4a5 Mac: Fix "format string is not a string literal" error when building with clang and 10.7 SDK.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1458 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-14 19:29:39 +00:00
Marshall Greenblatt
52d374bc9a Remove the CEF1 trunk folder. Any future development will be in the 1453 branch.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1454 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-10-11 14:49:52 +00:00
Marshall Greenblatt
40892d9067 Fixes to automate.py (issue #1067):
- 'update_depot_tools' command fails on Linux without depot_tools in the PATH.
- Always generates build log files without looking at --build-log-file.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1449 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-19 15:32:11 +00:00
Marshall Greenblatt
43a5dccec1 Fix windows 64-bit compile errors (issue #1079).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1448 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-17 09:17:12 +00:00
Marshall Greenblatt
f9bed78d56 Fix AssertNoURLRequests due to pending proxy connections during shutdown (issue #1037).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1445 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-17 08:13:02 +00:00
Marshall Greenblatt
e8c2c80f70 Remove unused variable (issue #1079).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1444 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-16 15:29:21 +00:00
Marshall Greenblatt
8adb86e7e6 Remove CefRenderProcessHandler::OnBeforeNavigation (issue #1076).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1443 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-16 15:26:08 +00:00
Marshall Greenblatt
71125f76d8 Expose CefLoadHandler in the render process (issue #1077).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1442 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-12 23:36:54 +00:00
Marshall Greenblatt
c577293d96 Initial changes to allow use of CefLoadHandler in the render process (issue #1077).
- Move OnLoadingStateChange from CefDisplayHandler to CefLoadHandler.
- Move OnRenderProcessTerminated and OnPluginCrashed from CefLoadHandler to CefRequestHandler.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1441 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-12 20:34:18 +00:00
Marshall Greenblatt
4eafb2ea24 Add CefRequestHandler::OnBeforeBrowse callback (issue #1076).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1440 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-12 17:44:54 +00:00
Marshall Greenblatt
2b6285b701 - Only update back/forward state for committed navigations.
- Don't change the frame URL for failed loads.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1437 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-12 17:27:59 +00:00
Marshall Greenblatt
83ae91a9e2 Linux: Fix compile error
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1436 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-11 19:12:58 +00:00
Marshall Greenblatt
be69bf9eb1 Enhancements to automate.py and make_distrib.py (issue #1072):
- Update the depot tools checkout if the checkout is managed by automate.py (on windows it's mandatory to run depot tools update to install svn, git and python).
- Add "--no-update" switch to allow users to run only build and distrib steps without updating CEF and Chromium. This is useful when some custom actions have to be done between the checkout and build steps. 
- Add "--build-tests" switch to build the cef_unittests target in addition to the cefclient target.
- Add "--verbose" switch to have ninja output more details while building.
- Add "--build-log-file" switch to write build logs to a file on disk.
- Add 7z compression support based on the presence of a CEF_COMMAND_7ZIP environment variable.
- Create distrib folders using the architecture (32/64) string.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1434 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-10 20:02:09 +00:00
Marshall Greenblatt
31dd95c3f8 Expose resource type and transition type via CefRequest (issue #1071).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1433 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-10 19:42:53 +00:00
Marshall Greenblatt
a5d8b746e8 Fix compile error (issue #1064).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1431 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-04 19:05:48 +00:00
Marshall Greenblatt
290809cec8 Mac: Fix compile error due to Chromium update
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1430 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-03 22:32:29 +00:00
Marshall Greenblatt
e7ae14435b Specify a background color for tests so that they're easier to read when transparent rendering is enabled.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1428 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-03 21:58:02 +00:00
Marshall Greenblatt
97dd8beb4f Update to Chromium revision 220934.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1427 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-03 21:48:12 +00:00
Marshall Greenblatt
9e50918a30 Linux: Fix compile error
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1426 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-03 19:12:22 +00:00
Marshall Greenblatt
1a2a0afee5 Make CefContext non-reference-counted to clarify ownership semantics.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1425 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-03 18:06:25 +00:00
Marshall Greenblatt
385be456c3 Structural improvements for request handling (issue #1044)
- Add new CefRequestContext and CefRequestContextHandler classes.
- Add CefRequestContext argument to CefBrowserHost static factory methods.
- Move GetCookieManager from CefRequestHandler to CefRequestContextHandler.
- Use BrowserContext as the root proxy object for network requests.
- Move accessors for CefBrowserMainParts members from CefContext to CefContentBrowserClient.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1424 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-09-03 16:43:31 +00:00
Marshall Greenblatt
935a35f21c Move the |use_osr_next_contents_view| attribute from CefBrowserContext to CefContentBrowserClient.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1422 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-28 15:56:18 +00:00
Marshall Greenblatt
a865b25a2d Fix assignment of log file path (issue #903).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1420 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-28 15:26:01 +00:00
Marshall Greenblatt
8ac34699f6 Make CefURLRequest::GetResponse() data available before download completion (issue #956).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1418 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-27 19:16:24 +00:00
Marshall Greenblatt
ac22cfaad2 Add CefURLRequestClient::GetAuthCredentials callback (issue #975).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1416 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-27 18:58:08 +00:00
Marshall Greenblatt
a71b780b0a Fix loading of popup windows with a newly created render process (issue #1057).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1413 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-27 18:19:21 +00:00
Marshall Greenblatt
d5b6264dce Add x64 build support to automate.py.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1411 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-23 19:29:00 +00:00
Marshall Greenblatt
34797e3876 Add x64 build support to automate.py.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1409 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-23 16:22:11 +00:00
Marshall Greenblatt
9e9ef3311d Windows: Fix compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1407 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-23 14:34:43 +00:00
Marshall Greenblatt
e8334e040a Use subprocess instead of os.popen3 to avoid deprecation warnings.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1404 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-22 20:14:11 +00:00
Marshall Greenblatt
aa8cd9bf86 Windows: Always use the depot_tools SVN version instead of the system SVN version.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1401 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-22 19:52:25 +00:00
Marshall Greenblatt
28974d096c Windows: Always use the depot_tools SVN version instead of the system SVN version.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1398 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-22 19:31:53 +00:00
Marshall Greenblatt
4ca8905881 Download depot_tools as the first step in automate.py.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1395 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-22 19:20:10 +00:00
Marshall Greenblatt
4892da5d72 Windows: Always use the depot_tools SVN version instead of the system SVN version.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1392 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-22 19:13:26 +00:00
Marshall Greenblatt
bbe793d9b1 Parse svn info output using XML format.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1389 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-22 17:57:26 +00:00
Marshall Greenblatt
8902b25b61 Add make_distrib.py support for 64-bit builds.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1387 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-22 17:18:17 +00:00
Marshall Greenblatt
518888dc55 Add CefSetOSModalLoop function (issue #194).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1384 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-22 17:11:19 +00:00
Marshall Greenblatt
073a20b973 Add support for excluding files from the translator tool.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1381 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-22 16:59:52 +00:00
Marshall Greenblatt
e216e42a6d Revert revision 1372 changes to the about_credits target (issue #1055).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1375 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-21 17:26:25 +00:00
Marshall Greenblatt
405ea14138 Fix ninja build generation of locale files (issue #1052).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1372 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-19 18:31:42 +00:00
Marshall Greenblatt
940d2c474d Fix render process crash when detaching a frame that never navigated.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1369 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-16 17:05:26 +00:00
Marshall Greenblatt
40c237c31c Mac: Fix compile error
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1368 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-15 21:21:55 +00:00
Marshall Greenblatt
cdd7333b76 Update to Chromium revision 217791.
- Pass popup window attributes to CefLifeSpanHandler::OnBeforePopup (issue #520).
- Windows: Add manifest files for all binary targets and include compatibility manifest in *.exe targets.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1367 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-15 19:38:55 +00:00
Marshall Greenblatt
0a452addf0 Mac: Fix 64-bit compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1364 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-14 22:15:28 +00:00
Marshall Greenblatt
2f1c313fd0 Windows: Fix 64-bit compile errors (issue #394).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1361 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-14 21:45:22 +00:00
Marshall Greenblatt
94b5c536ba Mac: Don't call OverrideChildProcessPath in child processes (issue #806).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1358 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-14 16:36:50 +00:00
Marshall Greenblatt
14a6bf03d4 Mac: Support retina display when building with the 10.6 SDK (issue #1038).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1355 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-08-08 15:58:50 +00:00
Marshall Greenblatt
e874af0891 Update CefSettings.cache_path documentation.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1346 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-27 00:25:31 +00:00
Marshall Greenblatt
d357bb0b80 Update to Chromium revision 213078.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1339 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-24 22:40:07 +00:00
Marshall Greenblatt
a2a3513620 Update to Chromium revision 213078.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1338 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-24 20:15:18 +00:00
Marshall Greenblatt
6a7353be3e Mac: Fix compile error in cefclient_osr_widget_mac.mm when using the 10.6 SDK.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1335 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-23 17:21:09 +00:00
Marshall Greenblatt
4abdd35309 Fix script detection of git checkouts
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1330 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-22 22:37:42 +00:00
Marshall Greenblatt
e24a6b02af Fix revision.py detection of git checkouts
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1329 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-22 22:23:54 +00:00
Marshall Greenblatt
a32861ad7b Fix incorrect patch path due to Chromuum update.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1328 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-22 22:14:55 +00:00
Marshall Greenblatt
38be92e283 Add script for creating git svn mirrors of CEF branches (issue #1023).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1324 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-20 02:36:18 +00:00
Marshall Greenblatt
88afe8b152 Add an automate.py option to download depot_tools as a zip archive (issue #1020).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1321 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-19 20:44:46 +00:00
Marshall Greenblatt
5c7fe6b9a7 Add an automate.py option to clean the artifacts output directory (issue #1022).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1318 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-19 18:36:09 +00:00
Marshall Greenblatt
0117a04bdb Update to Chromium revision 208345
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1314 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-18 23:25:28 +00:00
Marshall Greenblatt
fdbb62a272 Update to Chromium revision 208345.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1313 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-18 22:37:02 +00:00
Marshall Greenblatt
5ccc4f8bfb Linux: Include the libffmpegsumo.so library in binary distributions (issue #1003).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1311 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-18 20:03:44 +00:00
Marshall Greenblatt
0b46579e99 Add CefRenderHandler::OnScrollOffsetChanged callback (issue #889).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1309 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-18 19:26:11 +00:00
Marshall Greenblatt
575cdbbd31 Fix crash when using empty V8 strings with bindings (issue #1015).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1308 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-18 18:09:09 +00:00
Marshall Greenblatt
27fac646d9 Fix mapping of routing IDs to browser objects (issue #1012).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1305 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-15 20:25:59 +00:00
Marshall Greenblatt
8118ed28b3 Add multi_threaded_dll option to cefclient.gyp (issue #970).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1303 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-11 18:53:53 +00:00
Marshall Greenblatt
5d5a1eb641 Add trace events for SendProcessMessage and off-screen rendering (issue #991).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1301 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-11 17:44:48 +00:00
Marshall Greenblatt
c19d8c11ab Remove the debug count check for CefCookieManager.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1299 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-11 16:55:09 +00:00
Marshall Greenblatt
9a3d78fc54 Linux: Fix g_signal_handlers_disconnect_by_data compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1296 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-28 16:00:40 +00:00
Marshall Greenblatt
13af477401 Linux: Add off-screen rendering support (issue #518).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1294 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-27 17:40:04 +00:00
Marshall Greenblatt
947a99d592 Improvements to v8::Persistent usage (issue #1001):
- Remove V8_USE_UNSAFE_HANDLES dependency.
- Don't create persistent handles for primitive types.
- Don't create persistent handles for stack traces.
- CefV8Value::IsObject() no longer returns true for Date types.
- Fix V8Test.ContextEntered test flakiness.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1293 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-26 22:33:44 +00:00
Marshall Greenblatt
db530ec5e3 Add additional V8 performance tests (issue #960).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1292 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-26 22:18:30 +00:00
Marshall Greenblatt
00375f912c Add support for CefDragHandler::OnDragEnter (issue #601).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1291 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-25 15:22:02 +00:00
Marshall Greenblatt
15c1e43a99 Linux: Force use of the sub-process executable path for the zygote process (issue #980).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1289 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-24 19:40:07 +00:00
Marshall Greenblatt
8c5a5c8ff1 - Restore FTP protocol support that was removed by a recent Chromium update.
- Register the net resource provider for render processes (issue #999).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1287 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-24 18:57:05 +00:00
Marshall Greenblatt
7e259aa9f2 Force flash and silverlight plugins to windowless mode when using off-screen rendering (issue #518).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1285 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-24 16:40:40 +00:00
Marshall Greenblatt
d6d93bd490 Use chrome translations for most context menu strings (issue #992).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1283 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-24 15:55:58 +00:00
Marshall Greenblatt
828e6ffe46 Add support for CefDragHandler::OnDragEnter (issue #601).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1282 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-24 15:45:58 +00:00
Marshall Greenblatt
2fc9788311 Update to Chromium revision 207871.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1281 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-22 02:06:32 +00:00
Marshall Greenblatt
45691556e4 Linux: Force use of the sub-process executable path for the zygote process (issue #980).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1278 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-10 18:48:09 +00:00
Marshall Greenblatt
ca3a2da5ee Add password argument to CefZipArchive::Load (issue #986).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1277 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-10 18:23:48 +00:00
Marshall Greenblatt
a135b46e2c Fix keyboard handling for popups when window rendering is disabled (issue #962).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1276 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-10 18:00:46 +00:00
Marshall Greenblatt
de41be81b8 Move custom scheme registration to CefContentClient. This works around a problem on Linux where the zygote process has no CefContentRendererClient instance at the time that CefContentClient::AddAdditionalSchemes is executed (the zygote process is later forked to create new render processes).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1271 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-04 23:37:26 +00:00
Marshall Greenblatt
ca28f7b67d Linux: Fix build error
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1270 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-04 22:36:26 +00:00
Marshall Greenblatt
7a71dc06de Update to Chromium revision 203701.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1269 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-06-04 17:41:37 +00:00
Marshall Greenblatt
300847a38a Mac: Improve scroll event handling for the cefclient OSR example (issue #982).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1267 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-05-31 16:22:02 +00:00
Marshall Greenblatt
468eee6560 Reduce locking in browser and frame implementations to avoid potential deadlocks (issue #824).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1265 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-05-31 15:34:53 +00:00
Marshall Greenblatt
b3cd2ae6a8 Add CefJSDialogHandler::OnDialogClosed callback (issue #943).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1263 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-05-31 13:45:21 +00:00
Marshall Greenblatt
3d16a39e9e Use scoped class to implement CEF_TRACE_EVENTx (issue #971).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1261 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-05-31 13:25:38 +00:00
Marshall Greenblatt
ac4c19159c Mac: Add IME support with off-screen rendering (issue #973).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1259 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-05-31 12:46:56 +00:00
Marshall Greenblatt
3f17635d3e cefclient: Fix frame rate calculation (issue #987).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1257 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-05-31 11:33:19 +00:00
Marshall Greenblatt
943bfb9103 Fix race condition during V8 proxy initialization (issue #912).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1252 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-05-08 18:21:18 +00:00
Marshall Greenblatt
2801cfd5b1 Update to Chromium revision 198276.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1249 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-05-07 21:48:34 +00:00
Marshall Greenblatt
1cd4c79994 Linux: Update binary distrib to execute pkg-config as part of the make configuration.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1246 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-23 22:38:23 +00:00
Marshall Greenblatt
b5ad1c6caf Linux: Update binary distrib to execute pkg-config as part of the make configuration.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1243 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-23 22:36:38 +00:00
Marshall Greenblatt
1caa980faf Linux: Fix paths in binary distrib make files that caused build errors on Debian.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1240 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-23 18:42:38 +00:00
Marshall Greenblatt
c1e96f6193 Linux: Fix paths in binary distrib make files that caused build errors on Debian.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1237 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-23 18:41:31 +00:00
Marshall Greenblatt
6a50db3e49 Support cross-origin XMLHttpRequest loads and redirects for custom standard schemes when enabled via the cross-origin whitelist (issue #950).
- Call WebSecurityPolicy::registerURLSchemeAsCORSEnabled() for custom standard schemes.
- Explicitly check the cross-origin whitelist in CefResourceDispatcherHostDelegate::OnRequestRedirected() and add the appropriate CORS headers.
- Improve the CefAddCrossOriginWhitelistEntry() documentation to mention the top-level domain requirement for sub-domain matching.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1235 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-18 17:58:23 +00:00
Marshall Greenblatt
d6a9cea226 Improve scheme handler documentation.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1233 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-17 21:13:26 +00:00
Marshall Greenblatt
3a801af61d Update to Chromium revision 194165.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1232 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-17 20:52:53 +00:00
Marshall Greenblatt
62290279d5 Continue resource loading asynchronously to avoid issues during ResourceScheduler stack unwinding.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1230 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-17 20:42:39 +00:00
Marshall Greenblatt
19d9ebd063 Fix crash during window close when no CefClient is provided.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1228 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-17 18:33:26 +00:00
Marshall Greenblatt
c41127f236 Mac: Add off-screen rendering support (issue #518).
- Build with the 10.7 SDK (set GYP_DEFINES='mac_sdk=10.7') to include Retina support in the cefclient OSR example.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1226 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-16 19:23:00 +00:00
Marshall Greenblatt
0f8af86b79 Destroy CefMenuCreator on the UI thread thread (issue #887).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1224 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-16 17:34:13 +00:00
Marshall Greenblatt
bb6eeee686 Update to Chromium revision 194165.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1221 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-15 22:16:01 +00:00
Marshall Greenblatt
414befcd92 make_distrib improvements:
- Windows: Change the directory and build structure to match other platforms.
- Windows: Create archives of both Debug and Release symbols.
- Windows: Create a separate archive for documentation.
- Add a new "client" mode flag that creates a distribution of cefclient.
- Add "no-docs" and "no-archive" flags.
- Break README.txt files into separate components that can be shared between platforms and distribution modes.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1217 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-12 03:08:05 +00:00
Marshall Greenblatt
a39b499db8 Linux: Fix files included by make_distrib for cefclient mode
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1214 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-11 23:30:13 +00:00
Marshall Greenblatt
4b6ac3a662 Mac: Fix make_distrib.py script errors
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1213 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-11 23:13:28 +00:00
Marshall Greenblatt
b18edbac6f make_distrib improvements:
- Windows: Change the directory and build structure to match other platforms.
- Windows: Create archives of both Debug and Release symbols.
- Windows: Create a separate archive for documentation.
- Add a new "client" mode flag that creates a distribution of cefclient.
- Add "no-docs" and "no-archive" flags.
- Break README.txt files into separate components that can be shared between platforms and distribution modes.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1212 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-11 23:07:43 +00:00
Marshall Greenblatt
35c03f7b5a Remove V8 worker bindings (issue #451).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1211 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-11 22:54:26 +00:00
Marshall Greenblatt
0ffaf01b5b Remove V8 worker bindings (issue #451).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1209 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-11 20:46:04 +00:00
Marshall Greenblatt
9a34a5d5da Linux: Simplify gtk-related dependencies in cef.gyp.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1206 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-10 23:53:25 +00:00
Marshall Greenblatt
ef5142d9b3 - Fix ninja build on all platforms (issue #922).
- Update make_distrib.py to support ninja builds via a new "ninja-build" flag (issue #922).
- Improvements to automate.py:
-- Allow specification of the depot_tools directory via a "depot-tools" flag (issue #592).
-- Add ninja build support via a "ninja-build" flag (issue #922).
-- Allow relative paths for download directories (issue #942).
-- Add the ability to print commands without executing them via a "dry-run" flag.
-- Specifying the "force-clean" flag will also remove the build output directory.
-- Add support for a minimal distribution mode where only release binaries and resources are packaged.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1203 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-10 23:46:50 +00:00
Marshall Greenblatt
3184473656 Mac: Fix inclusion of resource files in binary distributions.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1200 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-10 22:50:20 +00:00
Marshall Greenblatt
e65fcf9710 Add support for a minimal distribution mode where only release binaries and resources are packaged.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1197 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-10 21:02:37 +00:00
Marshall Greenblatt
006ac136a8 Improvements to automate.py:
- Allow specification of the depot_tools directory via a "depot-tools" flag (issue #592).
- Add ninja build support via a "ninja-build" flag (issue #922).
- Allow relative paths for download directories (issue #942).
- Add the ability to print commands without executing them via a "dry-run" flag.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1194 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-09 23:02:58 +00:00
Marshall Greenblatt
e98c1c41a8 - Windows: Fix ninja build (issue #922).
- Update make_distrib.py to support ninja builds via a new "ninja-build" flag (issue #922).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1193 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-09 21:37:44 +00:00
Marshall Greenblatt
f0cdfd8dd2 Mac: Fix ninja build (issue #922)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1192 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-09 17:47:14 +00:00
Marshall Greenblatt
d19bb1d2b5 Linux: Update README.txt for binary distribution (issue #939).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1189 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-08 14:06:45 +00:00
Marshall Greenblatt
a48706b407 Linux: Add make build files to binary distribution (issue #939).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1186 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-08 01:32:10 +00:00
Marshall Greenblatt
607a8a9338 cefclient: Enable DevTools by default.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1181 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-05 21:29:47 +00:00
Marshall Greenblatt
67d59cb2b9 Add CefBrowserHost::WasHidden() method for notifying a windowless browser that it has been hidden or shown (issue #909).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1180 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-05 17:37:40 +00:00
Marshall Greenblatt
ba2fa28c05 Fix documentation errors (issue #934).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1179 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-05 17:19:26 +00:00
Marshall Greenblatt
0343aa5236 Add CefBrowserHost::SetMouseCursorChangeDisabled() method for disabling mouse cursor changes (issue #884).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1178 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-05 17:05:37 +00:00
Marshall Greenblatt
f70030adab Add support for the V8 LoadTimes extension (issue #917).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1177 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-04 18:10:17 +00:00
Marshall Greenblatt
9e0ba3801e Add CefRequestHandler::OnCertificateError() callback (issue #345).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1176 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-04 17:50:35 +00:00
Marshall Greenblatt
bba0221e23 cefclient: Simplify tests and related resource loading.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1175 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-04 00:53:32 +00:00
Marshall Greenblatt
da41e8e585 cefclient: Simplify tests and related resource loading.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1174 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-04 00:10:53 +00:00
Marshall Greenblatt
64b570a994 cefclient: Simplify tests and related resource loading.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1173 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-03 23:31:49 +00:00
Marshall Greenblatt
758470dfca cefclient: Request all browser windows to close in response to the application’s Quit/Exit menu item (issue #853).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1172 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-03 19:29:47 +00:00
Marshall Greenblatt
5533ceb06b cefclient: Simplify tests and related resource loading.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1171 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-03 18:20:59 +00:00
Marshall Greenblatt
9643f3287e mac: Fix compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1170 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-03 17:31:10 +00:00
Marshall Greenblatt
8486ec564e Update to Chromium revision 190564.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1169 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-02 21:04:22 +00:00
Marshall Greenblatt
03e5a75ea4 Update to Chromium revision 190564.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1168 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-02 17:21:37 +00:00
Marshall Greenblatt
e1f8c276f8 cefclient: Add example of window manipulation via JavaScript (issue #925).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1166 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-04-01 17:57:28 +00:00
Marshall Greenblatt
ea735c2663 - Windows: Update build_projects.bat to use MSBuild if available (issue #688).
- Linux: Update build_projects.sh to include the target name in the make command.


git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1165 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-26 21:51:59 +00:00
Marshall Greenblatt
a065d0e2a1 Linux: Update build_projects.sh to include the target name in the make command.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1164 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-26 21:51:15 +00:00
Marshall Greenblatt
835e420f3b Minor improvements to API has generation (issue #914).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1163 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-26 21:37:08 +00:00
Marshall Greenblatt
2635019605 Windows: Update build_projects.bat to use MSBuild if available (issue #688).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1162 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-26 21:33:11 +00:00
Marshall Greenblatt
21b6c4e280 Use the platform API hash instead of build revision for checking libcef compatibility (issue #914).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1161 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-25 22:15:33 +00:00
Marshall Greenblatt
e185bcb54d Add CEF API hash and version info retrieval functions (issue #914).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1160 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-25 21:54:53 +00:00
Marshall Greenblatt
fe30a139a7 Windows: Fix wrong Visual Studio Output Directory in binary distribution project files (issue #919).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1155 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-21 21:53:22 +00:00
Marshall Greenblatt
0a2aafaea0 Windows: Fix wrong Visual Studio Output Directory in binary distribution project files (issue #919).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1154 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-21 21:53:01 +00:00
Marshall Greenblatt
959ef067bb Update AUTHORS.txt file.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1152 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-20 18:44:11 +00:00
Marshall Greenblatt
bcfbb23f9c Update AUTHORS.txt file.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1151 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-20 18:43:59 +00:00
Marshall Greenblatt
38970b4984 Linux: Fix incorrect code comments (issue #853).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1150 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-19 23:05:39 +00:00
Marshall Greenblatt
7ded60a218 - Change the way that application shutdown works in order to support JavaScript 'onbeforeunload' handling (issue #853). See comments in cef_life_span_handler.h for a detailed description of the new shutdown process.
- Fix a crash on Linux during window destruction (issue #681).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1149 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-19 22:59:33 +00:00
Marshall Greenblatt
e3b297416f Revert revision 1135 and revision 1137 changes to disable printing due to build errors (issue #505).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1148 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-16 03:21:22 +00:00
Marshall Greenblatt
25e54b1800 Add new CefNowFromSystemTraceTime() method (issue #908).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1147 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-15 19:57:20 +00:00
Marshall Greenblatt
b835143515 Windows: Update distribution DLLs and README.txt to match current Chromium requirements (issue #913).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1146 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-15 18:33:29 +00:00
Marshall Greenblatt
2364bf8227 Mac: Fix compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1141 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-13 18:14:36 +00:00
Marshall Greenblatt
af4245af33 Mac/Linux: Fix compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1140 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-13 18:13:04 +00:00
Marshall Greenblatt
72e03b3cd5 Update to Chromium revision 187216.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1139 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-13 17:05:03 +00:00
Marshall Greenblatt
f0abe2369c Mac: Fix compile errors due to Chromium update.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1138 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-12 21:46:38 +00:00
Marshall Greenblatt
518e36fb9c Disable printing because no implementation is currently available (issue #505).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1137 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-12 21:44:12 +00:00
Marshall Greenblatt
c3b02b7231 Update to Chromium revision 187216.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1136 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-12 20:23:24 +00:00
Marshall Greenblatt
254cba733a Disable printing because no implementation is currently available (issue #505).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1135 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-08 18:54:33 +00:00
Marshall Greenblatt
b2014012b0 Disable color input type because no implementation is currently available (issue #899).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1134 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-08 18:23:37 +00:00
Marshall Greenblatt
485244b1bb Disable WebKit MediaStream feature if WebRTC support is disabled (issue #531).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1133 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-08 00:52:57 +00:00
Marshall Greenblatt
63f6b6b09a Add support for x-webkit-speech (issue #758).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1132 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-08 00:41:26 +00:00
Marshall Greenblatt
920ee60499 Fix WebRTC support (issue #531).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1131 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-07 01:20:24 +00:00
Marshall Greenblatt
9b9c283ec2 Make sure RenderViewCreated is called at least one time since it does not appear to currently be called for popup windows (issue #892).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1128 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-05 18:27:46 +00:00
Marshall Greenblatt
d70ab2b99c Windows: cefclient: Fix delivery of mouse up events with offscreen rendering example (issue #902).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1126 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-05 18:09:41 +00:00
Marshall Greenblatt
96dc4fb367 Windows: Include custom cursor resources in libcef.dll (issue #692).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1124 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-05 17:59:28 +00:00
Marshall Greenblatt
a6fb4d52d1 Mac: Fix compile error (issue #630).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1121 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-04 22:57:27 +00:00
Marshall Greenblatt
944658ccbb Mac: Add default tooltip implementation (issue #770).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1119 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-04 22:18:39 +00:00
Marshall Greenblatt
f250f9ccea Fix geolocation initialization race condition.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1117 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-04 21:10:59 +00:00
Marshall Greenblatt
5b5efb5c8b Add CefApp::OnRegisterCustomSchemes callback to address url_util thread safety issues (issue #630).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1115 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-03-04 20:16:47 +00:00
Marshall Greenblatt
497fcc6cdc Mac: Fix compile errors due to Chromium update.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1114 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-28 22:33:49 +00:00
Marshall Greenblatt
095bc4b7f8 Update to Chromium revision 184577.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1113 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-28 21:54:02 +00:00
Marshall Greenblatt
8986d281e3 Mac: Fix compile errors due to Chromium update.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1112 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-27 18:34:27 +00:00
Marshall Greenblatt
c10f203620 Update to Chromium revision 184577.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1111 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-27 17:56:03 +00:00
Marshall Greenblatt
d9a4c5690b Fix proxy V8 initialization failure resulting from Chromium update.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1110 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-26 22:54:26 +00:00
Marshall Greenblatt
0ae0f6cd85 Mac: Fix compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1109 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-26 00:28:38 +00:00
Marshall Greenblatt
116b6de654 Update to Chromium revision 181864.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1108 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-25 23:44:37 +00:00
Marshall Greenblatt
83f568d071 Mac: Fix compile errors
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1107 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-23 01:46:13 +00:00
Marshall Greenblatt
6f922731b4 Update to Chromium revision 181864.
- Adds support for chrome://view-http-cache/*, chrome://appcache-internals/, chrome://blob-internals/, chrome://tcmalloc/ and chrome://histograms/

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1106 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-23 00:43:28 +00:00
Marshall Greenblatt
fd97bbf292 Fix Mac compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1104 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-22 18:00:45 +00:00
Marshall Greenblatt
a9d458f345 Add new CefSettings.ignore_certificate_errors option to ignore errors related to invalid SSL certificates (issue #).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1102 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-13 23:43:16 +00:00
Marshall Greenblatt
7f3d1ccf78 Add a new CefBrowserHost::StartDownload method for starting a download that can then be handled via CefDownloadHandler (issue #883).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1100 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-13 22:47:04 +00:00
Marshall Greenblatt
d65179c135 Add the ability to persist session cookies (issue #881).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1098 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-13 19:53:41 +00:00
Marshall Greenblatt
bb3a804033 Fix crash when destroying the browser window while a context menu is displayed.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1096 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-13 17:11:50 +00:00
Marshall Greenblatt
6604af5462 Fix popup window behavioral errors introduced by revision 1085 changes (issue #816).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1093 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-09 22:38:24 +00:00
Marshall Greenblatt
88025e3283 Update README.txt file for binary distributions.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1091 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-08 17:09:51 +00:00
Marshall Greenblatt
c5b0633bdd Send OnTitleChange() notifications when navigating history (issue #766).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1087 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-08 16:42:22 +00:00
Marshall Greenblatt
02587eba55 Add a new CefLifeSpanHandler::CanCreatePopup() method for canceling the creation of popup windows (issue #816).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1085 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-08 00:07:41 +00:00
Marshall Greenblatt
830182196c Improve the way that settings are specified (issue #878).
- Change CefBrowserSettings members that previously used a boolean to instead use a cef_state_t enumeration with default, enabled and disabled states.
- Remove CefBrowserSettings members that are unlikely to be used and that can also be set using Chromium command-line switches.
- Change the CEF command-line switch naming pattern to match Chromium and move the implementation out of cefclient.
- Improve documentation by listing the command-line switch, if any, associated with each setting.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1083 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-07 19:59:40 +00:00
Marshall Greenblatt
81d27df883 Introduce chrome proxy implementation based on command-line flags (issue #600).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1080 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-06 20:41:54 +00:00
Marshall Greenblatt
bccce6258f When running in single-process mode wait for the render thread to stop before shutting down the context (issue #570).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1078 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-02 00:21:59 +00:00
Marshall Greenblatt
9d07fba418 Revert revision 978 changes: When running in single-process mode wait for the render thread to stop before shutting down the context (issue #570).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1076 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-01 20:02:10 +00:00
Marshall Greenblatt
6983ac5ae3 Linux: Update the drag&drop implementation to match other platforms (issue #876).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1074 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-01 17:54:45 +00:00
Marshall Greenblatt
868fa28fa1 Linux: Fix drag/drop crash in WebCore::DragData::modifierKeyState (issue #875).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1070 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-02-01 17:43:19 +00:00
Marshall Greenblatt
9ed494e647 Linux: Fix drag/drop crash in WebCore::DragData::modifierKeyState (issue #875).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1066 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-30 16:38:12 +00:00
Marshall Greenblatt
2344b20e38 Windows: Change CefBrowser::SetOSModalLoop to CefSetOSModalLoop because the functionality is not connected with any particular browser (issue #194).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1062 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-28 18:48:54 +00:00
Marshall Greenblatt
f39b3d7f90 Windows: update the binary distribution usage instructions.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1060 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-26 03:28:15 +00:00
Marshall Greenblatt
ee6faa0706 - Remove cefclient dependency on ATL.
- Allow more cefclient tests to work in the off-screen rendering example.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1058 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-26 03:19:50 +00:00
Marshall Greenblatt
26fb351f4a Fix header include paths.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1056 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-24 22:33:23 +00:00
Marshall Greenblatt
0ab1178b99 Windows: Add default implementation for JavaScript prompt dialog (issue #861).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1049 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 23:19:40 +00:00
Marshall Greenblatt
52c203d4cf Windows: Avoid assertion when entering zero-length text in the default JavaScript prompt dialog (issue #862).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1045 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 22:46:05 +00:00
Marshall Greenblatt
c333f29373 Linux: Improve label for JavaScript dialogs (issue #488).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1043 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 21:53:10 +00:00
Marshall Greenblatt
ff577b4e4f Mac: Add default implementation for JavaScript confirm/prompt dialogs (issue #795).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1041 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 21:37:07 +00:00
Marshall Greenblatt
29108bda5f Linux: Emit "delete_event" signal instead of calling gtk_widget_destroy (issue #780).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1038 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 20:18:25 +00:00
Marshall Greenblatt
e8fd7a97b8 Linux: Emit "delete_event" signal instead of calling gtk_widget_destroy (issue #780).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1037 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 20:18:03 +00:00
Marshall Greenblatt
57174f07d4 Set SVN properties on gyp_cef.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1034 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 20:12:20 +00:00
Marshall Greenblatt
709eeb68ab Set SVN properties on gyp_cef.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1033 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 20:11:41 +00:00
Marshall Greenblatt
762ce24da4 Show time value on load in cefclient dialogs.html.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1031 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 20:04:16 +00:00
Marshall Greenblatt
df3537658b Linux: Add default implementation for JavaScript alert/confirm/prompt/filechooser dialogs.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1029 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 20:00:45 +00:00
Marshall Greenblatt
3998917e10 Windows: Display select filters based on the "accept" attribute for input type="file" (issue #791).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1027 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 18:00:25 +00:00
Marshall Greenblatt
c720dbdb23 Mac: Call makeFirstResponder:nil from windowDidResignKey: in cefclient to remove focus from the browser view when the window becomes inactive (issue #565).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1025 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 17:30:48 +00:00
Marshall Greenblatt
3b834de6bb Mac: Fix crash with input element of type "file" when the default file name is empty (issue #823).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1023 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 17:23:56 +00:00
Marshall Greenblatt
fc0fd84371 Fix assertion when returning NULL from CefClient::GetGeolocationHandler (issue #857).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1019 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-18 17:09:48 +00:00
Marshall Greenblatt
9f2399e918 Linux: Fix compile error due to fwrite() and warn_unused_result.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1017 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-17 22:25:57 +00:00
Marshall Greenblatt
8f95df96c7 Allow empty |browser| parameter to CefSchemeHandlerFactory::Create (issue #834).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1015 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-17 21:27:39 +00:00
Marshall Greenblatt
5e014e1f34 Add new CefDisplayHandler::OnFaviconURLChange callback (issue #779).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1013 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-17 21:13:43 +00:00
Marshall Greenblatt
df3ca9e022 Fix documentation error in CefRequestHandler (issue #836).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1011 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-17 19:05:04 +00:00
Marshall Greenblatt
f1ebd3561f Enable IME for all text input types (issue #765).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1009 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-17 19:00:57 +00:00
Marshall Greenblatt
53d8a95c98 Allow empty |mimeType| argument to GetDownloadHandler (issue #405).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1007 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-17 18:46:41 +00:00
Marshall Greenblatt
e91039b864 Update copyright year on auto-generated files.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1005 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-17 18:39:09 +00:00
Marshall Greenblatt
e842db12ba Specifying the 'force-clean' flag to the automate script should remove the build output directory.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1004 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-17 18:16:15 +00:00
Marshall Greenblatt
933e01fb0e Specifying the 'force-clean' flag to the automate script should remove the build output directory.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1003 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-17 18:15:42 +00:00
Marshall Greenblatt
4c44ce466e Windows: Fix make_distrib.py for libcef.dll.pdb rename (issue #856).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1000 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-16 20:28:35 +00:00
Marshall Greenblatt
9a051fa002 Windows: Fix make_distrib.py for libcef.dll.pdb rename.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@999 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-16 20:28:00 +00:00
Marshall Greenblatt
43d44578ba Linux: Fix compile errors (issue #852).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@997 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-16 20:20:09 +00:00
Marshall Greenblatt
55729ae7f9 Mac: Remove temporary workaround for an Xcode 4 build error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@992 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-15 22:46:04 +00:00
Marshall Greenblatt
463258f668 Mac: Remove temporary workaround for an Xcode 4 build error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@991 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-15 22:45:49 +00:00
Marshall Greenblatt
8ebca9e04d Linux: Fix compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@989 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-15 22:38:36 +00:00
Marshall Greenblatt
3b9cb32e4a Update to Chromium revision 176706.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@988 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-15 21:38:59 +00:00
Marshall Greenblatt
d56fc817d5 Update to Chromium revision 176706.
- See crbug.com/167209 for a description of why NSPrincipalClass needs to be specified in helper-Info.plist.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@987 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-15 19:12:28 +00:00
Marshall Greenblatt
5061db7c1b Update to Chromium revision 173683.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@982 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-14 21:38:54 +00:00
Marshall Greenblatt
2acdc55727 Update to Chromium revision 173683.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@981 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-14 19:21:17 +00:00
Marshall Greenblatt
60319f0cea Avoid re-registration of a RenderViewHost with NotificationRegistrar which can occur after a renderer crashes.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@980 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-11 23:20:13 +00:00
Marshall Greenblatt
7d3bac19a9 Windows: Improvements to off-screen rendering support (issue #518).
- Implement support for transparency. Change the backing store to use Skia instead of GDI and to keep alpha values.
- Implement support for select popups. Requires a patch to Chromium (content_popups.patch).
- Implicitly disable accelerated compositing when using off-screen rendering.
- Introduce a new CefMouseEvent structure for representing mouse event information passed to CefBrowser methods.
- Merge cef_key_event_modifiers_t into cef_event_flags_t.
- Add a new argument to CefBrowser::Invalidate telling the browser whether to invalidate the select popup or the main view.
- Add a new cefclient "transparent-painting-enabled" command-line flag to test transparent off-screen rendering.
- Add a new cefclient "Transparency" test.
- Fix the cefclient off-screen rendering rotation effect to work even when the underlying web content is not updating.
- Add unit tests for transparent painting and select popups.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@979 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-11 23:00:39 +00:00
Marshall Greenblatt
a463095bd9 When running in single-process mode wait for the render thread to stop before shutting down the context (issue #570).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@978 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-06 16:39:25 +00:00
Marshall Greenblatt
10ed5d699f Fix an assertion when exiting the browser after a popup window has been canceled (issue #830).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@975 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-04 12:36:39 +00:00
Marshall Greenblatt
afe3cb1d67 Support custom V8 bindings on WebWorker threads (issue #451).
- Add CefRenderProcessHandler callbacks for WebWorker context creation, release and uncaught exceptions.
- Add CefTaskRunner class that supports posting of tasks to standard threads and WebWorker threads.
- Organize V8 internal state information on a per-thread/per-Isolate basis.
- Add webkit_451.patch that provides the WebKit implementation.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@972 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-03 17:24:24 +00:00
Marshall Greenblatt
f30fbb3d48 Add support to patch_util.py for patches containing new files.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@971 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-03 17:14:34 +00:00
Marshall Greenblatt
dc5c4c50ac Remove NOTREACHED assertion in CefRegisterSchemeHandlerFactory because it may be hit during registration of internal schemes if CEF is shut down quickly (issue #571).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@970 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-03 12:55:42 +00:00
Marshall Greenblatt
22ed9d9140 Update the copyright year on auto-generated files.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@969 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-01-02 10:13:43 +00:00
Marshall Greenblatt
d67415aefd Simplify code by moving WebKit initialization from CefRenderProcessObserver to CefContentRendererClient.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@968 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-31 10:41:15 +00:00
Marshall Greenblatt
e574751caa Allow creation of V8 wrapper objects on any thread with a V8 isolate (issue #451).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@967 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-30 21:16:59 +00:00
Marshall Greenblatt
e33ea0aff4 - Move browser object tracking from CefContext to CefContentBrowserClient and introduce a new CefBrowserInfo class to simplify ID management (issue #830).
- Add a new CefBrowser::IsSame method (issue #830).
- Improve CefRenderProcessHandler::OnBrowserCreated documentation (issue #830).
- Add a new NavigationTest.CrossOrigin test for cross-origin navigation (issue #830).
- Fix existing NavigationTest tests to run in single-process mode.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@963 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-30 11:17:49 +00:00
Marshall Greenblatt
0605b8e8fd Don't leak the V8 unit test setup into other tests.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@960 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-22 16:55:25 +00:00
Marshall Greenblatt
991a513473 Add new CefBrowser::GetIdentifier method (issue #811).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@953 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-19 16:47:38 +00:00
Marshall Greenblatt
f782b4b1e0 Windows: Improve menu responsiveness (issue #194).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@950 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-19 16:23:51 +00:00
Marshall Greenblatt
9accdc8b01 Allow empty |client| parameter to CreateBrowser and CreateBrowserSync.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@949 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-12 14:43:57 +00:00
Marshall Greenblatt
b66a48bb1c Linux: Fix compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@944 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-06 20:50:39 +00:00
Marshall Greenblatt
086f3cb47d Mac: Update drag&drop image creation.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@943 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-06 20:49:39 +00:00
Marshall Greenblatt
33fad449b6 Linux: Fix compiler warning about fwrite() return value being ignored.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@939 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-04 22:37:35 +00:00
Marshall Greenblatt
2a17f00844 Make off-screen rendering example work with multi-threaded message loop mode (issue #804).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@938 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-04 01:16:13 +00:00
Marshall Greenblatt
c3bbaac18f - Fix a crash caused by CefBrowserHostImpl being deleted before CefCookieStoreProxy (issue #810).
- Add documentation explaining the relationship between network request processing classes.
- Remove stale code in url_request_context_getter_proxy.cc.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@935 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-04 01:12:11 +00:00
Marshall Greenblatt
ea920a4d9e Update to Chromium revision 170167.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@933 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-30 19:08:20 +00:00
Marshall Greenblatt
f53c281acd Update to Chromium revision 170167.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@932 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-30 18:30:34 +00:00
Marshall Greenblatt
4a3b1ec9e2 Add a switch to enable DCHECKs in release builds (issue #790).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@931 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-28 19:04:11 +00:00
Marshall Greenblatt
faf218df4a Add a switch to enable DCHECKs in release builds (issue #790).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@930 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-28 19:03:15 +00:00
Marshall Greenblatt
cc2801d1d5 Linux: Fix compile error due to uninitialized enum variable (issue #785).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@929 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-27 16:07:35 +00:00
Marshall Greenblatt
43fcf821f5 Don't display IME characters twice with off-screen rendering example (issue #801).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@928 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-27 15:21:47 +00:00
Marshall Greenblatt
6110b7ebfa Mac: Fix use of deprecated runModalForDirectory:file: signal (issue #792).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@927 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-26 20:01:27 +00:00
Marshall Greenblatt
357dfc75af Update spi_webcore_364.patch file.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@926 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-26 18:20:41 +00:00
Marshall Greenblatt
4d21c4ffca Update spi_webcore_364.patch file.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@925 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-26 18:20:14 +00:00
Marshall Greenblatt
8d37ead057 Pass actual HTTP response code to CefLoadHandler::OnLoadEnd (issue #521).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@922 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-21 22:11:22 +00:00
Marshall Greenblatt
9ce5dc6293 Fix Geolocation by adding Google API key support (issue #365).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@920 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-21 15:57:11 +00:00
Marshall Greenblatt
6b7716f64b Windows: Add off-screen rendering support (issue #518).
- Popup menus, drag&drop and GPU acceleration are not currently supported.
- Testing is enabled in cefclient by passing the "off-screen-rendering-enabled" command-line flag.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@919 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-21 00:40:15 +00:00
Marshall Greenblatt
cd32e16c61 Fix inspector hook in V8Test.OnUncaughtExceptionDevTools (issue #736).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@916 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-20 20:49:44 +00:00
Marshall Greenblatt
4c6c536b4b Fix inspector hook in V8Test.OnUncaughtExceptionDevTools (issue #736).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@913 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-20 20:21:38 +00:00
Marshall Greenblatt
1e871cc2c8 - Pass information to the renderer process synchronously on render thread creation and new browser creation to avoid race conditions (issue #744).
- Add the ability to pass extra information to child processes using a new CefBrowserProcessHandler::OnRenderProcessThreadCreated callback (issue #744).
- Fix OnBeforeChildProcessLaunch documentation (issue #754).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@910 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-20 20:08:36 +00:00
Marshall Greenblatt
8a504d3d25 Update to Chromium revision 167921.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@909 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-16 18:28:07 +00:00
Marshall Greenblatt
f9b937e42e Update to Chromium revision 167921.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@908 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-16 17:18:54 +00:00
Marshall Greenblatt
dbca88a741 Update to Chromium revision 167921.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@907 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-16 02:58:25 +00:00
Marshall Greenblatt
79f3683beb Add new CefRenderProcessHandler::OnBeforeNavigation callback (issue #722).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@904 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-09 18:47:09 +00:00
Marshall Greenblatt
255fdad295 Update to Chromium revision 165669.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@902 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-06 17:13:58 +00:00
Marshall Greenblatt
1177da898b Fix potential crash if a context with no bindings is released (issue #736).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@900 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-05 22:32:57 +00:00
Marshall Greenblatt
de4327e0c5 Fix potential crash if a context with no bindings is released (issue #736).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@899 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-05 22:32:37 +00:00
Marshall Greenblatt
cd87a0b38a Fix Linux/OS-X compile errors (issue #751).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@898 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-05 20:19:50 +00:00
Marshall Greenblatt
d7493c57a1 - Update to Chromium revision 165669.
- Fix Linux/OS-X compile errors (issue #751).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@897 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-05 20:18:20 +00:00
Marshall Greenblatt
f18f7fd27f Add CefV8ContextHandler::OnUncaughtException callback (issue #736).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@894 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-02 21:38:40 +00:00
Marshall Greenblatt
e599cc1fab Add CefV8ContextHandler::OnUncaughtException callback (issue #736).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@890 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-02 18:16:28 +00:00
Marshall Greenblatt
202cdc4eb4 Reduce persistent CEF V8 memory usage by tracking objects on a per-context basis and not persisting objects when the underlying V8 handle is unused (issue #484).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@885 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-30 20:50:58 +00:00
Marshall Greenblatt
f4e653adca Reduce persistent CEF V8 memory usage by tracking objects on a per-context basis and not persisting objects when the underlying V8 handle is unused (issue #484).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@884 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-30 20:49:43 +00:00
Marshall Greenblatt
59fe4fbab3 Support implicit detachment of CEF V8 references when the associated context is released (issue #484).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@883 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-29 21:54:57 +00:00
Marshall Greenblatt
3ac5952636 Support implicit detachment of CEF V8 references when the associated context is released (issue #484).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@882 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-29 21:50:46 +00:00
Marshall Greenblatt
0cea9668fe Support implicit detachment of CEF V8 references when the associated context is released (issue #484).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@881 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-29 21:46:02 +00:00
Marshall Greenblatt
95b29d590d Add performance tests for CEF V8 methods (issue #484).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@880 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-26 20:42:41 +00:00
Marshall Greenblatt
ce76bfc1e1 Add performance tests for CEF V8 methods (issue #484).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@879 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-26 20:39:24 +00:00
Marshall Greenblatt
a9a7b8940d Pass resource-related command-line flags to all process types (issue #759).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@878 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-25 21:19:20 +00:00
Marshall Greenblatt
e9c567599d Always set "lang" command-line flag, and use instead of "locale", to avoid an assertion in RenderThreadImpl::GetLocale() (issue #759).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@875 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-22 20:56:38 +00:00
Marshall Greenblatt
21c2b1ecdd Add a new CefGetGeolocation function for retrieving geolocation information via an API callback (issue #764).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@871 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-19 19:52:07 +00:00
Marshall Greenblatt
e45ff9e838 Add a new CefGetGeolocation function for retrieving geolocation information via an API callback (issue #764).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@868 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-19 18:39:44 +00:00
Marshall Greenblatt
e1f2be1785 - Expose tracing functionality via new cef_trace.h and cef_trace_event.h headers (issue #711).
- Add about:tracing UI support (issue #711).
- Avoid unnecessary string type conversions for values and process messages.
- Add support for a 'note' attribute in patch.cfg.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@865 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-17 22:45:49 +00:00
Marshall Greenblatt
eda69594ef - Provide default implementations of the file chooser dialogs (open, open multiple, save) on all platforms (issue #761).
- Add a new CefBrowserHost::RunFileDialog method that displays the specified file chooser dialog and returns the results asynchronously (issue #761).
- Add a new CefDialogHandler::OnFileDialog callback that allows the application to provide custom UI for file chooser dialogs (issue #761).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@862 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-16 19:28:07 +00:00
Marshall Greenblatt
dc5ba49aaf Linux: Fix compile error due to header location change (issue #757).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@860 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-12 23:53:37 +00:00
Marshall Greenblatt
f51f171b43 Add CefV8ContextHandler::OnUncaughtException callback (issue #736).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@857 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-12 16:38:24 +00:00
Marshall Greenblatt
cd03d80623 Fix location of VERSION files in make_distrib.py.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@855 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-11 20:45:13 +00:00
Marshall Greenblatt
e490ebd78d Mac: Fix display of Flash plugins (issue #741).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@852 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-11 19:10:24 +00:00
Marshall Greenblatt
1098949521 - Add about:version, about:credits and about:license internal URLs (issue #731).
- Centralize retrieval of the CEF major version number from a new VERSION file.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@845 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-08 17:47:37 +00:00
Marshall Greenblatt
167c601f29 Update to Chromium revision 160122.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@844 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-04 19:17:45 +00:00
Marshall Greenblatt
163cc7d9cc Update to Chromium revision 160122.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@843 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-04 19:17:13 +00:00
Marshall Greenblatt
13afc1226f Update to Chromium revision 157509.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@838 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-03 21:50:01 +00:00
Marshall Greenblatt
ca817dc4cd Fix interference of V8 unittest setup with other tests (issue #712).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@836 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-03 21:35:04 +00:00
Marshall Greenblatt
2592b05444 Update to Chromium revision 157509.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@835 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-03 19:52:50 +00:00
Marshall Greenblatt
ecf5ff4c6e Mac: Fix errors in binary distribution.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@833 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-02 18:29:11 +00:00
Marshall Greenblatt
91cde9eeb0 Remove support for HTML5 audio & video tags (issue #530).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@831 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-02 17:01:30 +00:00
Marshall Greenblatt
1210ebacea Remove support for HTML5 audio & video tags (issue #530).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@829 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-02 16:40:31 +00:00
Marshall Greenblatt
49640d17a3 - Eliminate use of scoped directories (issue #670).
- Create a temporary cache_path directory if none is specified (issue #735).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@827 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-01 21:49:08 +00:00
Marshall Greenblatt
7a0ff637f0 Add CefZoomHandler interface to support custom zoom handling (issue #733).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@824 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-10-01 20:35:35 +00:00
Marshall Greenblatt
a3ac7b446f Add new CefRequestHandler::OnBeforePluginLoad callback and functions for controlling plugin loading and life span (issue #645).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@822 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-28 20:14:02 +00:00
Marshall Greenblatt
ccb2b296ac Fix assertion when executing V8 callbacks during extension load (issue #712).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@821 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-28 17:45:46 +00:00
Marshall Greenblatt
410bbcfea4 Add support for V8 startup tests and a new V8Test.Extension test (issue #712).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@818 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-28 17:11:10 +00:00
Marshall Greenblatt
149ae3df88 Add CefRequestHandler::OnQuotaRequest callback for handling webkitStorageInfo.requestQuota requests (issue #732).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@816 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-27 22:52:15 +00:00
Marshall Greenblatt
c4a2ee9b8d Create temporary cache_path directory if none is specified (issue #735).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@814 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-27 21:25:29 +00:00
Marshall Greenblatt
61b0934996 Allow title change notifications after the document has loaded (issue #704).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@812 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-27 21:02:36 +00:00
Marshall Greenblatt
8957947cff Add CefBrowserProcessHandler::OnBeforeChildProcessLaunch and CefCommandLine::PrependWrapper to support custom construction of the command line for child processes (issue #628).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@810 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-27 17:07:31 +00:00
Marshall Greenblatt
cc3b8c9cf3 Allow use of an empty key string with CefV8Value methods (issue #718).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@808 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-26 21:39:21 +00:00
Marshall Greenblatt
7de4dc5aad Allow use of an empty key string with CefV8Value methods (issue #718).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@806 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-26 21:26:32 +00:00
Marshall Greenblatt
790ec83c42 Allow use of CefV8Context Enter/Exit to avoid V8RecursionScope assertions when using V8 directly (issue #708).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@805 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-26 17:41:44 +00:00
Marshall Greenblatt
d3dafb3073 Win: Erase in-progress IME composition on cancel (issue #701).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@803 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-26 17:34:13 +00:00
Marshall Greenblatt
2cfc1fefc0 Mac: Trigger keydown events for single keystrokes (issue #664).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@799 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-26 16:42:42 +00:00
Marshall Greenblatt
b42dc21a99 Mac: Add version number to dylib files (issue #730).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@797 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-26 15:48:31 +00:00
Marshall Greenblatt
4d30b132c6 - Mac: Add plugin_carbon_interpose target to fix plugin crash (issue #680).
- Mac: Add version number to dylib files (issue #730).


git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@795 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-26 00:09:05 +00:00
Marshall Greenblatt
11012b9c8c Fix crash when pending navigation executes after the browser window has been destroyed (issue #724).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@791 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-20 19:48:39 +00:00
Marshall Greenblatt
f6fcf8e1f6 Fix VS2008 compile error in CefByteReadHandler::Seek due to missing abs(long long) function.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@787 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-19 15:44:20 +00:00
Marshall Greenblatt
10d1a71890 Fix VS2008 compile error in CefByteReadHandler::Seek due to missing abs(long long) function.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@786 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-19 15:43:33 +00:00
Marshall Greenblatt
c0496ac63b Fix compile warning in CefByteReadHandler::Read.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@783 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-14 21:51:50 +00:00
Marshall Greenblatt
7c80586970 Fix compile warning in CefByteReadHandler::Read.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@782 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-14 21:51:29 +00:00
Marshall Greenblatt
3cf6d92539 Add geolocation support (issue #365).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@780 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-14 19:04:45 +00:00
Marshall Greenblatt
2705f19cf6 Windows: Fix loading of custom cursor resources (issue #692).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@778 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-10 22:19:19 +00:00
Marshall Greenblatt
b7656f50fd Fix DCHECK failure when calling OnSetFocus from LoadRequest (issue #685).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@776 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-10 19:47:58 +00:00
Marshall Greenblatt
e620a6831f Propagate logging command-line parameters to all processes (issue #717).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@774 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-10 16:13:51 +00:00
Marshall Greenblatt
0d086ee6fb Implement CefDisplayHandler OnStatusMessage and OnConsoleMessage callbacks (issue #662).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@772 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-07 21:01:27 +00:00
Marshall Greenblatt
6834d879d3 Add "url" command-line option to cefclient (issue #715).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@770 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-07 20:35:43 +00:00
Marshall Greenblatt
4e6607a343 Remove explicit include on mozilla sources.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@768 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-06 22:05:06 +00:00
Marshall Greenblatt
720e87d67b Move devtools resources to a separate devtools_resources.pak file (issue #714).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@765 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-06 17:42:16 +00:00
Marshall Greenblatt
43bc8b9529 Update binary distribution README.txt files (issue #714).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@764 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-06 15:36:33 +00:00
Marshall Greenblatt
5ac06eb984 Move devtools resources to a separate devtools_resources.pak file (issue #714).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@762 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-05 22:34:30 +00:00
Marshall Greenblatt
234acdd760 Improve GetZoomLevel/SetZoomLevel documentation (issue #666).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@760 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-04 21:19:29 +00:00
Marshall Greenblatt
1ed3754569 Improve GetZoomLevel/SetZoomLevel documentation (issue #666).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@759 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-04 21:19:12 +00:00
Marshall Greenblatt
7185bed3b9 Rename PROXY_TYPE values to avoid naming conflict (issue #548).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@757 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-04 18:55:58 +00:00
Marshall Greenblatt
df879561ec Rename PROXY_TYPE values to avoid naming conflict (issue #548).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@756 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-04 18:55:35 +00:00
Marshall Greenblatt
4c761a68f7 Add patch to fix opening of password protected files with CefZipReader (issue #496).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@754 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-04 17:09:23 +00:00
Marshall Greenblatt
fc02e9eee7 Add patch to fix opening of password protected files with CefZipReader (issue #496).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@753 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-04 17:08:51 +00:00
Marshall Greenblatt
c8a5cc9e33 Allow creation of V8 objects from CEF callbacks (issue #708).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@752 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-04 15:18:04 +00:00
Marshall Greenblatt
c15048d75f - Add CefCommandLine::GetArgv method (issue #707).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@751 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-09-04 15:12:50 +00:00
Marshall Greenblatt
30ecc8a4db Update to Chromium revision 153668.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@750 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-29 20:11:26 +00:00
Marshall Greenblatt
e99d9c86a6 Revert the CefMenuModel separator changes added in revision 747.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@749 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-29 16:58:40 +00:00
Marshall Greenblatt
2e83d58814 Update to Chromium revision 153668.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@748 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-28 22:26:35 +00:00
Marshall Greenblatt
6a8f3a9410 Improve the handling of invalidation/painting for off-screen rendering (issue #695).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@745 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-21 19:48:29 +00:00
Marshall Greenblatt
a2ca607a77 Optimize the cefclient off-screen rendering example (issue #697).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@743 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-16 19:21:47 +00:00
Marshall Greenblatt
606612399c Add the ability to customize the animation frame rate (issue #697).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@741 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-15 15:13:11 +00:00
Marshall Greenblatt
03ced41cf2 Add the ability to customize the animation frame rate (issue #697).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@739 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-14 23:33:57 +00:00
Marshall Greenblatt
a189761144 Improve the handling of invalidation/painting for off-screen rendering (issue #695).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@737 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-13 16:27:44 +00:00
Marshall Greenblatt
6ab23a802f Fix crashes/assertions when CefBrowserImpl is destroyed on a non-UI thread (issue #694).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@736 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-13 16:24:53 +00:00
Marshall Greenblatt
26a2281486 Only release the request context proxy if it exists (issue #677).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@734 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-07 17:18:08 +00:00
Marshall Greenblatt
ba1dc0fe45 Add checks to CefStringBase constructors for NULL pointers (issue #671).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@733 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-07 17:05:42 +00:00
Marshall Greenblatt
b6720c17e0 Add checks to CefStringBase constructors for NULL pointers (issue #671).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@732 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-07 17:05:24 +00:00
Marshall Greenblatt
3b8ebef27b Update to Chromium revision 149431.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@731 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-07 13:58:35 +00:00
Marshall Greenblatt
b39ca211ae Update to Chromium revision 149431.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@730 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-08-04 00:59:58 +00:00
Marshall Greenblatt
c91f8132d5 Add new CefV8StackTrace and CefV8StackFrame interfaces to support retrieval of the JavaScript stack trace for the currently active V8 context (issue #682).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@728 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-07-25 11:52:03 +00:00
Marshall Greenblatt
ea6c91fbdb Add new CefV8StackTrace and CefV8StackFrame interfaces to support retrieval of the JavaScript stack trace for the currently active V8 context (issue #682).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@727 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-07-25 11:50:35 +00:00
Marshall Greenblatt
46b9f02fb5 Add new CefV8StackTrace and CefV8StackFrame interfaces to support retrieval of the JavaScript stack trace for the currently active V8 context (issue #682).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@725 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-07-25 09:45:49 +00:00
Marshall Greenblatt
e3ce676b0f Fix documentation error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@720 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-28 20:37:33 +00:00
Marshall Greenblatt
0c81037621 Allow an empty |download_path| argument to CefBeforeDownloadCallback::Continue (issue #516).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@716 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-28 17:46:40 +00:00
Marshall Greenblatt
421001ba9d - Add download handling support via new CefDownloadHandler and CefDownloadItem interfaces (issue #516).
- Fix setting of CefKeyEvent.focus_on_editable_field when the underlying RenderViewHost changes.
- Fix potential crash if URLRequest objects are still in-progress upon shutdown.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@715 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-28 17:21:18 +00:00
Marshall Greenblatt
14bbc90ddb Mac: Fix compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@714 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-26 18:03:47 +00:00
Marshall Greenblatt
9f708dfcd2 - Add example to cefclient of launching DevTools in an external browser window and process using new CefGetPath and CefLaunchProcess functions (issue #639).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@713 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-26 16:47:05 +00:00
Marshall Greenblatt
1dc36b0297 Update the DevTools URLs when a new RenderView is created (issue #639).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@712 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-26 16:25:10 +00:00
Marshall Greenblatt
d13cc9de1c Add OnProtocolExecution callback to CefRequestHandler (issue #582).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@711 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-25 21:21:27 +00:00
Marshall Greenblatt
89c70a8b11 Add OnRenderProcessTerminated and OnPluginCrashed notifications to CefLoadHandler (issue #633).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@710 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-25 19:49:17 +00:00
Marshall Greenblatt
6f2897cb50 Store all persistent data in the CefSettings.cache_path directory (issue #510).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@709 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-25 18:22:50 +00:00
Marshall Greenblatt
f7c91a7d6b JavaScript window.close() should close the browser window (issue #614).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@708 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-25 18:05:00 +00:00
Marshall Greenblatt
9546ff9c77 Add support for customizing log file path and log severity level (issue #613).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@707 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-25 17:52:54 +00:00
Marshall Greenblatt
b7d0517886 Windows: Add dialog for input type="file" (issue #632).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@706 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-25 15:58:49 +00:00
Marshall Greenblatt
c167b5f3a6 Fix Mac/Linux compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@705 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-22 19:25:44 +00:00
Marshall Greenblatt
a6aded4716 Implement persistent localStorage with the new DOM storage backend (issue #603).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@704 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-22 14:56:07 +00:00
Marshall Greenblatt
1f42df1b61 Update to Chromium revision 142910.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@703 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-22 00:10:10 +00:00
Marshall Greenblatt
65cc337f03 Update to Chromium revision 142910.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@702 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-21 22:50:34 +00:00
Marshall Greenblatt
c56def5569 Update to Chromium revision 140240.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@701 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-21 20:35:13 +00:00
Marshall Greenblatt
93e1f9722b Allow empty message parameters passed to CefJSDialogHandler.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@699 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-20 19:44:45 +00:00
Marshall Greenblatt
1ed3ac28b4 - Add persistent HTML5 application cache support (issue #543).
- Standardize the approach for creating new directories.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@698 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-20 19:44:00 +00:00
Marshall Greenblatt
9df142f832 - Add CefURLRequest support (issue #517).
- Add CefBrowserProcessHandler interface (issue #650).
- Internally re-register supported schemes with CefCookieManager after changing the storage path (issue #651).
- Add CefResourceHandler callbacks for blocking cookie loading and saving (issue #652).
- Allow custom scheme handlers for requests that do not originate from browser content (issue #653).
- Use 'int' instead of 'RequestFlags' for CefRequest::GetFlags and SetFlags (issue #654).
- Rename cef_request.h CreateObject methods to Create (issue #655).
- Add #ifdef guards to cef_tuple.h to allow the use of both cef_runnable.h and base/bind.h in the same unit test source file.
- Retrieve cookieable schemes as part of ClientApp::RegisterCustomSchemes and register with the global cookie manager.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@697 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-19 16:29:49 +00:00
Marshall Greenblatt
7e6932cd00 Mac: Fix IBAction typo (issue #648).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@696 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-14 15:38:17 +00:00
Marshall Greenblatt
fd5c3c0d75 Add zoom support (issue #514).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@695 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-12 19:50:24 +00:00
Marshall Greenblatt
85bf734046 - Remove unimplemented and unused settings (issue #643).
- Set the kJavaScriptFlags switch based on CefSettings.javascript_flags.
- Fix indentation in CefResourceRequestJob::Start().

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@694 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-12 15:53:39 +00:00
Marshall Greenblatt
315414ec26 Mac: Avoid re-entering OnSetFocus in becomeFirstResponder (issue #508).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@692 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 20:41:55 +00:00
Marshall Greenblatt
15c579aa77 Mac: Add support for cef_time_t.day_of_week (issue #629).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@691 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 20:38:42 +00:00
Marshall Greenblatt
b900cdfc8b Mac: Add support for cef_time_t.day_of_week (issue #629).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@690 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 20:35:26 +00:00
Marshall Greenblatt
11fb746e95 Fix spelling error in OnProcessMessageReceived (issue #636).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@689 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 20:03:49 +00:00
Marshall Greenblatt
1161d18c82 Mac: Add dialogs for input type="file" (issue #632).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@688 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 19:48:55 +00:00
Marshall Greenblatt
61e9bc6007 Mac: Fix the need to press the delete key twice to delete a character after changing the IME language (issue #635).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@686 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 18:43:58 +00:00
Marshall Greenblatt
a09896d0d0 Update the AUTHORS.txt file.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@684 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 17:40:01 +00:00
Marshall Greenblatt
3ab23316db Update the AUTHORS.txt file.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@683 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 17:39:30 +00:00
Marshall Greenblatt
a782ae94df - Mac: Add CefDownloadManagerDelegate::ChooseDownloadPath implementation (issue #634).
- Persist downloaded files after CEF exits (issue #634).
- Shutdown the DownloadManager when CEF exits.
- Don't show an error message when downloading files with cefclient.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@682 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 17:35:23 +00:00
Marshall Greenblatt
f79d18d510 Mac: Fix compile error (issue #508).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@681 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 16:51:51 +00:00
Marshall Greenblatt
d8caf27e3b - Add keyboard and focus notifications (issue #508).
- Add CefDOMNode::IsEditable method.
- List interfaces alphabetically in CefClient.
- Correct error checking for code and command input.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@680 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-11 15:52:49 +00:00
Marshall Greenblatt
3715c23777 Update to Chromium revision 140240.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@679 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-08 16:01:01 +00:00
Marshall Greenblatt
06806ee190 Mac: Add IME support (issue #557).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@676 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-07 18:41:32 +00:00
Marshall Greenblatt
a9449d612c Fix keyboard shortcut handling on Windows (issue #615) and Mac (issue #618).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@675 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-07 17:38:12 +00:00
Marshall Greenblatt
f74e3f4bc9 Make the |target_domain| parameter to CefAddCrossOriginWhitelistEntry and CefRemoveCrossOriginWhitelistEntry optional (issue #609).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@668 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-04 18:45:44 +00:00
Marshall Greenblatt
8403acb14b Make the |target_domain| parameter to CefAddCrossOriginWhitelistEntry and CefRemoveCrossOriginWhitelistEntry optional.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@667 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-04 18:44:14 +00:00
Marshall Greenblatt
b8a3120222 Update the make_distrib.py script to fix "allow-partial" on Windows and for consistency across platforms (issue #621).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@666 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-04 17:19:12 +00:00
Marshall Greenblatt
06bc30a802 Clear the input array passed to CefBrowser::GetFrameIdentifiers so that the correct values are returned via the C/C++ wrapper API, and add a test (issue #626).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@665 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-04 17:03:31 +00:00
Marshall Greenblatt
0bfea3e1b1 Mac: Delay destroying the browser window until pending drag operations have completed (issue #610).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@663 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-01 18:40:04 +00:00
Marshall Greenblatt
c601933e8b Fix misspelling of the Referer HTTP header (issue #619).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@661 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-01 17:42:20 +00:00
Marshall Greenblatt
af01dd2d82 Fix misspelling of the Referer HTTP header (issue #619).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@660 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-06-01 17:41:30 +00:00
Marshall Greenblatt
1b0784cca3 Mac: Add headerpad_max_install_names linker setting to all projects that rewrite framework links.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@659 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-31 15:27:46 +00:00
Marshall Greenblatt
38f216a9c2 Update to Chromium revision 139606.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@658 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-31 15:19:33 +00:00
Marshall Greenblatt
dbe75b1326 Avoid crash due to missing prerenderer support (issue #608).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@657 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-30 20:35:41 +00:00
Marshall Greenblatt
5c2e5eab8d - Windows: Delay destroying the browser window until pending drag operations have completed (issue #610).
- Revert: Windows: Reset the window procedure in the WebWidgetHost destructor to avoid crashes if messages are delivered after the window is destroyed.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@655 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-30 18:05:23 +00:00
Marshall Greenblatt
584bd26331 Windows: Allow the JS dialog message hook to be shared across multiple browser windows (issue #605).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@654 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-29 18:06:22 +00:00
Marshall Greenblatt
71773b5bbc Windows: Avoid resizing the child window to 0x0 when the parent window is minimized (issue #606).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@653 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-29 17:39:39 +00:00
Marshall Greenblatt
b3f982dd73 Avoid crash due to missing prerenderer support (issue #608).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@652 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-29 17:18:33 +00:00
Marshall Greenblatt
cf5665ca3e - Make sure BrowserRequestContextProxy is only used on the IO thread (issue #542).
- Windows: Reset the window procedure in the WebWidgetHost destructor to avoid crashes if messages are delivered after the window is destroyed.
- Add thread-related DCHECKS in browser_resource_loader_bridge.cc.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@650 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-25 20:44:34 +00:00
Marshall Greenblatt
ab96ec27a4 Change cefclient off-screen rendering example to account for premultiplied alpha values (issue #584).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@648 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-25 14:23:30 +00:00
Marshall Greenblatt
f82acbf9e0 Improve the documentation for CefBrowerHost::GetDevToolsURL (issue #583).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@647 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-24 14:19:43 +00:00
Marshall Greenblatt
53e4ce626d Linux: Fix compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@646 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-23 21:51:09 +00:00
Marshall Greenblatt
8d5bad43d3 Mac: Fix compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@645 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-23 20:33:32 +00:00
Marshall Greenblatt
801ff3ca43 - Update to Chromium revision 138235.
- Move to the new DOM storage backend. Persistent localStorage support will need to be re-implemented (issue #603).
- Add CefV8Value::CreateUInt method and indicate that integer types are 32bit via usage of int32 and uint32 types (issue #331).
- Add CefV8Context::Eval method for synchronous JavaScript execution that returns a value or exception (issue #444).
- Move exception handling from an ExecuteFunction argument to a CefV8Value attribute (issue #546).
- Make user data an attribute for all CefV8Value object types and not just CreateObject (issue #547).
- Un-fork SQLitePersistentCookieStore by adding stub implementations for sqlite_diagnostics and browser_thread.
- Update tools/cef_parser.py to match the CEF3 version.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@644 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-23 19:01:04 +00:00
Marshall Greenblatt
b5f2f5db3e Improve the cefclient transparency test by adding the ability to view individual pixel values (issue #584).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@643 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-23 17:37:56 +00:00
Marshall Greenblatt
19e96f94fe Fix CefContextMenuParamsImpl::GetYCoord() to return the correct value (issue #602).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@642 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-22 21:10:00 +00:00
Marshall Greenblatt
a3cc27784c Allow wmode="transparent" for Flash when using off-screen rendering (issue #527).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@640 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-22 18:19:26 +00:00
Marshall Greenblatt
7a0d59b9cb Add missing break statements in CefContext::GetDataResource (issue #236).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@638 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-22 16:45:21 +00:00
Marshall Greenblatt
929cd40273 Win: Fix mouse wheel scrolling in second monitor (issue #595).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@635 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-18 21:58:07 +00:00
Marshall Greenblatt
df4544e949 Linux: Fix compile error due to gdk_pixbuf_unref deprecation (issue #593).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@634 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-18 21:41:24 +00:00
Marshall Greenblatt
0b003c55a9 Pass target URL to OnBeforePopup (issue #596).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@633 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-18 21:37:42 +00:00
Marshall Greenblatt
8b1748bbf5 Destroy CefResponseManager on the correct thread (issue #570).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@632 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-18 21:18:01 +00:00
Marshall Greenblatt
9c9711c2d8 Update to Chromium revision 137849.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@631 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-18 20:32:28 +00:00
Marshall Greenblatt
761187a673 - Update to Chromium revision 136953.
- Add chrome-devtools scheme handler implementation.
- Change the CefBrowser::GetDevToolsURL() method to allow retrieval of both http and chrome-devtools URLs.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@630 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-18 15:04:56 +00:00
Marshall Greenblatt
fb2d3f9490 - Add off-screen rendering support for Mac OS-X (issue #540).
- Add patch for ninja build support on Mac OS-X.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@624 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-16 16:56:38 +00:00
Marshall Greenblatt
808e89e01e Fix usage of ReadRawData return value in ResourceRequestJob implementation (issue #534).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@619 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-04 18:36:45 +00:00
Marshall Greenblatt
89ea7caae9 Fix usage of ReadRawData return value in scheme handler implementation (issue #534).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@617 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-04 18:34:12 +00:00
Marshall Greenblatt
c7fa722bf5 Fix tools_gyp.patch reference path.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@616 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-04 16:27:09 +00:00
Marshall Greenblatt
0ceab51f94 Fix StringPrintf format error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@614 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-02 16:28:22 +00:00
Marshall Greenblatt
4158d13cce Fix compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@613 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-02 15:56:15 +00:00
Marshall Greenblatt
10a336e500 Update to Chromium revision 134688.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@612 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-05-01 17:47:54 +00:00
Marshall Greenblatt
dfd4a8ba99 Fix StringPrintf format error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@611 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-27 22:18:57 +00:00
Marshall Greenblatt
db3a9817ed Add direct DOM access (issue #511).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@610 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-27 21:19:06 +00:00
Marshall Greenblatt
4fe0ddf640 Add ability to directly retrieve plugin information (issue #575).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@609 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-27 19:12:01 +00:00
Marshall Greenblatt
9017c0e74e - Update to Chromium revision 133962.
- Mac: Fix path discovery for non-native frameworks (issue #576).
- Avoid loading Chrome-specific pack files (issue #578).
- Make DevTools remote debugging URLs harder to guess (issue #583)
- Add CefBrowser::GetDevToolsURL() method (issue #583).
- Add DevTools example to cefclient (must run with --remote-debugging-port=XXXX command-line flag) (issue #583).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@608 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-26 22:20:18 +00:00
Marshall Greenblatt
7987af5acf Fix memory leak when returning zero-length strings from V8 (issue #581).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@604 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-25 20:01:10 +00:00
Marshall Greenblatt
00fbc510da Fix memory leak when returning zero-length strings from V8 (issue #581).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@603 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-25 20:00:28 +00:00
Marshall Greenblatt
6c8f4644aa - Update to Chromium revision 133430.
- Move custom scheme registration to CefApp::OnRegisterCustomSchemes(). This is required by the introduction of ContentClient::AddAdditionalSchemes() and fixes a race condition when registering standard schemes in different processes.
- Execute V8 functions using V8Proxy. This is required for inspector instrumentation to work correctly and fixes an assertion in WebCore related to V8RecursionScope.
- Enable verbose V8 TryCatch logging.
- Mac: Expose UnderlayOpenGLHostingWindow interface that should be used for all CEF windows.
- Add CefSettings.remote_debugging_port option.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@602 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-24 18:01:48 +00:00
Marshall Greenblatt
97561ac51a Add ability to directly retrieve plugin information (issue #575).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@600 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-20 20:40:53 +00:00
Marshall Greenblatt
ecec216eb9 Mac: Add flagsChanged: signal handler so that modifier keys are correctly passed to JS (issue #574).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@598 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-20 18:47:47 +00:00
Marshall Greenblatt
fdbabb4378 Add context menu support (issue #509):
- Add new CefContextMenuHandler, CefContextMenuParams and CefMenuModel classes.
- Add cef_strings.grd and related infrastructure for supporting translation of CEF strings.
- Generate include/cef_pack_resources.h and include/cef_pack_strings.h files at build time that include all IDs used by CEF pack files.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@597 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-19 21:28:12 +00:00
Marshall Greenblatt
effbca00e2 Add context menu support (issue #509):
- Add new CefContextMenuHandler, CefContextMenuParams and CefMenuModel classes.
- Add cef_strings.grd and related infrastructure for supporting translation of CEF strings.
- Generate include/cef_pack_resources.h and include/cef_pack_strings.h files at build time that include all IDs used by CEF pack files.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@596 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-19 21:18:22 +00:00
Marshall Greenblatt
7bc494880f Add context menu support (issue #509):
- Add new CefContextMenuHandler, CefContextMenuParams and CefMenuModel classes.
- Add cef_strings.grd and related infrastructure for supporting translation of CEF strings.
- Generate include/cef_pack_resources.h and include/cef_pack_strings.h files at build time that include all IDs used by CEF pack files.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@595 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-19 20:31:46 +00:00
Marshall Greenblatt
07bba96106 Add support for JavaScript alert, confirm, prompt and onbeforeunload dialogs (issue #507).
- Add CefJSDialogHandler and CefJSDialogCallback interfaces.
- Add default dialog implementations for Windows and Mac OS-X.
- Add "JavaScript Dialogs" example to cefclient.
- Change TestHandler::AddResource to ignore the query component when matching URLs.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@594 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-16 21:15:27 +00:00
Marshall Greenblatt
7ce5e9924e Don't DCHECK the |value| argument passed to cef_string_list_append().
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@593 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-13 15:23:52 +00:00
Marshall Greenblatt
8d74f7cae4 Add JavaScript binding example to cefclient.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@592 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-12 22:21:19 +00:00
Marshall Greenblatt
c7d9fb4abe Add JavaScript binding example to cefclient.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@591 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-12 21:58:35 +00:00
Marshall Greenblatt
647c74cf96 Add JavaScript binding example to cefclient.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@590 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-12 20:21:50 +00:00
Marshall Greenblatt
b5c62d3bbb Update to Chromium revision 131752.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@589 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-11 19:42:34 +00:00
Marshall Greenblatt
f3dc5779b5 Update to Chromium revision 131752.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@588 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-11 19:42:02 +00:00
Marshall Greenblatt
b061ea934e Update to Chromium revision 131752.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@587 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-11 19:37:06 +00:00
Marshall Greenblatt
9d200c109a - Update to Chromium revision 131752.
- Add support for multi_threaded_message_loop run mode on Windows (issue #522).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@586 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-11 18:00:55 +00:00
Marshall Greenblatt
1cd6e3b3e7 Fix Mac compile error.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@585 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-05 16:15:42 +00:00
Marshall Greenblatt
211a176537 Update to Chromium revision 130586.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@584 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-05 03:02:46 +00:00
Marshall Greenblatt
39727dd26f Update to Chromium revision 129376.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@581 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-05 00:37:45 +00:00
Marshall Greenblatt
c8848da3bb Update to Chromium revision 129376.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@580 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-04 22:38:30 +00:00
Marshall Greenblatt
0930631a5f Update to Chromium revision 129376.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@579 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-04 22:32:24 +00:00
Marshall Greenblatt
f94336aade CEF3: Update to Chromium revision 130586.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@578 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-04 18:18:09 +00:00
Marshall Greenblatt
0b3ef6e2cd CEF3: Add CefCookieManager::SetSupportedSchemes method which supports cookie storage for non-http(s) schemes (issue #567).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@577 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-03 22:14:28 +00:00
Marshall Greenblatt
825080f86d Add CefCookieManager::SetSupportedSchemes method which supports cookie storage for non-http(s) schemes (issue #567).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@574 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-03 19:24:37 +00:00
Marshall Greenblatt
34adee805c Branch CEF3 files from /branches/cef3 to /trunk/cef3 (issue #564).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@571 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-03 01:34:16 +00:00
Marshall Greenblatt
b568f160d9 Rename CEF1 files from /trunk to /trunk/cef1 (issue #564).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@570 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-03 01:27:13 +00:00
Marshall Greenblatt
0a1fd8b040 Avoid calling OnSetFocus multiple times (issue #563).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@569 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-02 19:05:42 +00:00
Marshall Greenblatt
b59fc7633d Execute the CefFocusHandler::OnSetFocus callback for calls to CefBrowser::SetFocus and mouse clicks on the view (issue #563).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@568 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-02 16:28:56 +00:00
Marshall Greenblatt
0872b047a4 Fix problem with CefBrowser::GetMainFrame() clearing the frame URL value (issue #556).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@561 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-03-30 17:18:31 +00:00
Marshall Greenblatt
3b23cc1815 Fix race condition in CefCookieManagerImpl constructor (issue #542).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@556 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-03-29 16:51:31 +00:00
Marshall Greenblatt
4f1dd4f96c Fix compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@546 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-03-23 00:19:51 +00:00
Marshall Greenblatt
c814366421 - Add CefCookieManager interface and CefRequestHandler::GetCookieManager for custom cookie handling (issue #542).
- Support getting and setting cookies with custom scheme handlers (issue #555).
- Support calling CefFrame::GetIdentifier and CefFrame::GetURL on any thread (issue #556).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@542 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-03-22 22:08:05 +00:00
Marshall Greenblatt
e258cbc536 Revert revision 534 changes: Add CefCookieManager interface and CefRequestHandler::GetCookieManager for custom cookie handling (issue #542).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@541 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-03-21 16:14:14 +00:00
Marshall Greenblatt
ef43df264a Add CefCookieManager interface and CefRequestHandler::GetCookieManager for custom cookie handling (issue #542).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@534 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-03-15 22:38:02 +00:00
Marshall Greenblatt
97d6924f7e Invalidate the entire scroll rect when using off-screen rendering mode (issue #469).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@526 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-03-13 15:05:56 +00:00
Marshall Greenblatt
b5516ace67 Windows: Fix crash in cefclient when entering long URLs via the address bar (issue #532).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@514 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-21 22:50:08 +00:00
Marshall Greenblatt
9114952cfb Update to Chromium revision 122508.
- Don't define toolkit_views in combination with tookit_uses_gtk (the current Linux default).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@510 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-18 00:24:20 +00:00
Marshall Greenblatt
52aade3759 Update to Chromium revision 122508.
- CefDragData::GetFileExtension() has been removed.
- Audio playback no longer works (issue #530).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@509 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-18 00:19:52 +00:00
Marshall Greenblatt
c24c257eb8 Use includes instead of forward class declarations in header files to simplify usage (issue #142).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@506 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-17 17:31:19 +00:00
Marshall Greenblatt
16ec14510b Update to Chromium revision 119867.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@505 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-17 16:12:48 +00:00
Marshall Greenblatt
a3e0935ce3 Update to Chromium revision 119867.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@504 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-17 14:51:20 +00:00
Marshall Greenblatt
c04103744c Setting the OnBeforeResourceLoad redirectUrl value should behave the same as using request->SetURL() (issue #529).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@502 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-16 20:13:07 +00:00
Marshall Greenblatt
1a092a0c1a Add the ability to (issue #236):
1. Disable pack file loading via CefSettings.pack_loading_disabled.
2. Customize pack file load paths via CefSettings.pack_file_path and CefSettings.locales_dir_path.
3. Provide custom resource bundle handling via CefResourceBundleHandler.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@501 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-16 17:11:49 +00:00
Marshall Greenblatt
def9fdb540 Fix memory leak in CefV8ValueImpl::ExecuteFunctionWithContext (issue #526).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@497 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-15 16:19:59 +00:00
Marshall Greenblatt
ce0eb1c92b Fix memory leak due to CToCpp argument lists not being deleted (issue #526).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@491 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-14 17:41:35 +00:00
Marshall Greenblatt
55b363354f Mac: Fix the "no autorelease pool in place" error by initializing an NSAutoreleasePool on every thread (issue #502).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@482 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-10 16:22:47 +00:00
Marshall Greenblatt
9bcab6db78 Linux: Remove the gdk_drag_context_get_suggested_action accessor that requires gtk+ 2.21 or greater.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@481 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-08 16:45:40 +00:00
Marshall Greenblatt
3309ccf917 Linux: Add gdk.h include to hopefully fix compile errors on some distros.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@480 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-08 15:24:27 +00:00
Marshall Greenblatt
5e101281d0 Revert revision 476: Add patch to fix GDI object leak in FontCacheChromiumWin.cpp createFontIndirectAndGetWinName (issue #499).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@479 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-07 21:04:17 +00:00
Marshall Greenblatt
7789edd124 Add patch to fix GDI object leak in FontCacheChromiumWin.cpp createFontIndirectAndGetWinName (issue #499).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@476 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-02-07 20:47:14 +00:00
Marshall Greenblatt
2497090b12 - Linux: Add support for HTML5 drag&drop (issue #40).
- Linux: Fix GTK cefclient to properly shutdown on CTRL+c (issue #40).
- Linux: Fix compile error due to v8_impl.cc revision 469 changes.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@475 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-23 19:04:54 +00:00
Marshall Greenblatt
80704d6512 Update the AUTHORS.txt file to include the names of past contributors (issue #474).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@474 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-23 17:18:57 +00:00
Marshall Greenblatt
67bb4333f4 Fix bug in CefZipArchive::Clear() (issue #486).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@472 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-23 15:50:48 +00:00
Marshall Greenblatt
4fde292443 Mac: Fix compile error due to revision 469 changes.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@471 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-20 14:44:09 +00:00
Marshall Greenblatt
5a112a21dd Don't add the "--expose-gc" V8 flag by default for all CEF users (issue #483).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@470 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-19 19:12:15 +00:00
Marshall Greenblatt
0352efec64 Add methods to CefV8Value for specifying the amount of externally allocated memory associated with the V8 object (issue #478).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@469 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-19 18:52:59 +00:00
Marshall Greenblatt
ea3dcc8492 Fix the check_style.py patch_RepositoryName function to work with git.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@468 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-19 17:19:40 +00:00
Marshall Greenblatt
9f53a6dae6 Add missing svn:eol-style attribute to browser_devtools_scheme_handler.[h|cc]
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@467 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-19 15:43:50 +00:00
Marshall Greenblatt
1e811415aa Update the AUTHORS.txt file to include the names of past contributors (issue #474).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@466 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-17 15:05:18 +00:00
Marshall Greenblatt
29d626dd72 Update the AUTHORS.txt file to include the names of past contributors (issue #474).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@464 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-11 21:52:13 +00:00
Marshall Greenblatt
1073577d03 Make CEF compliant with Google/Chromium style (issue #473).
- Add a new check_style tool based on Google's cpplint that can be used to verify compliance of pending changes and specific files/directories.
- Update existing CEF source code to be compliant with the style requirements.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@463 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-09 23:46:23 +00:00
Marshall Greenblatt
9cc61f448b Add #ifndef guards in cef_build.h to avoid conflicts with other projects using Chromium code.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@461 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-05 20:16:27 +00:00
Marshall Greenblatt
2cc21dbb2f Remove unneeded header include from request_impl.cc.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@460 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-05 19:48:14 +00:00
Marshall Greenblatt
8dc8c273f6 Add svn:// protocol support to svn_util.py.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@459 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-05 19:47:45 +00:00
Marshall Greenblatt
6cf84686a5 - Add automate/automate-git.py for automated building using git (issue #472).
- Add git support to make_version_header.py (issue #472).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@458 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-05 19:43:23 +00:00
Marshall Greenblatt
b8ba27a671 Add the ability to restrict V8 extension loading by frame using a new CefPermissionHandler::OnBeforeScriptExtensionLoad() callback (issue #471).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@457 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-05 19:34:20 +00:00
Marshall Greenblatt
ad65bb8532 Mac: Add support for building the 'Run cef_unittests' target from the command line.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@453 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-03 17:55:08 +00:00
Marshall Greenblatt
253dcf8cd4 Linux: Initialize the 'proxy_type' variable to make the compiler happy.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@452 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-03 17:26:13 +00:00
Marshall Greenblatt
1d489846ed Remove WebURLRequestTest.CANCEL test with WUR_STATE_LOADING due to flakiness.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@451 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-31 01:46:46 +00:00
Marshall Greenblatt
8d1abe7d70 Linux: Fix cefclient shutdown crash.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@450 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-31 01:01:42 +00:00
Marshall Greenblatt
3d734d9f90 Linux: Fix window destruction crash.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@449 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-31 00:57:52 +00:00
Marshall Greenblatt
8d6c760bbd - Add support for running unit tests without multi-threaded message loop mode (issue #338).
- Mac: Fix unit test expectations.
- Mac: cef_time_t.day_of_week is not supported.


git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@448 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-30 20:55:16 +00:00
Marshall Greenblatt
893176fe5a Create separate implementation file for TestHandler methods and globals.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@446 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-29 20:32:02 +00:00
Marshall Greenblatt
8ece0ba240 Update to Chromium revision 115967.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@445 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-29 20:26:26 +00:00
Marshall Greenblatt
9b979dfa14 Fix eol-style attribute on cef_paths.gypi.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@444 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-29 18:24:41 +00:00
Marshall Greenblatt
62aedf6b30 Mac: Fix compile errors due to revision 442 changes.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@443 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-23 18:04:12 +00:00
Marshall Greenblatt
ff976bc07f Break cef.h into multiple headers (issue #142).
- Move wrapper classes from cef_wrapper.h to wrapper/ directory.
- Move C API functions/classes from cef_capi.h to capi/ directory.
- Move global function implementations from cef_context.cc to *_impl.cc files.
- Output auto-generated file paths in cef_paths.gypi.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@442 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-23 17:36:30 +00:00
Marshall Greenblatt
97add0e3b7 Remove empty /mac/data directory (issue #460).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@441 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-22 17:11:01 +00:00
Marshall Greenblatt
cc3a3a68d8 Remove CefV8Value::CreateObject variant that accepts only one argument (issue #449).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@440 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-22 17:08:35 +00:00
Marshall Greenblatt
7b24eeeeb0 Linux: Fix compile errors due to Chromium update.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@439 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-21 21:48:04 +00:00
Marshall Greenblatt
ed9d640f12 Mac: Fix compile errors due to Chromium update.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@438 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-21 20:02:39 +00:00
Marshall Greenblatt
feab13e9fb Include CEF and Chromium version information in binary distributions (issue #325).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@436 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-21 19:22:33 +00:00
Marshall Greenblatt
bdb588b77a Update to Chromium revision 115322.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@435 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-21 18:35:55 +00:00
Marshall Greenblatt
ec797bafe5 Make the |url| parameter to OnBeforePopup() optional.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@434 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-20 22:07:45 +00:00
Marshall Greenblatt
6b195a8739 Add support to check_revision.py for building release branches (issue #325).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@432 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-20 16:35:15 +00:00
Marshall Greenblatt
59d7310ac7 Windows: Update the libcef.dll version number to include the Chrome branch version (issue #325).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@429 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-19 23:21:42 +00:00
Marshall Greenblatt
9cc8ea09dc Add support to automate.py for building release branches (issue #325).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@428 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-19 23:11:56 +00:00
2517 changed files with 444299 additions and 90302 deletions

35
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen and what happened instead.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Versions (please complete the following information):**
- OS: [e.g. Windows 10, MacOS 13.2, Ubuntu 22.10]
- CEF Version: [e.g. 111.2.2]
**Additional context**
Does the problem reproduce with the cefclient or cefsimple sample application at the same version?
Does the problem reproduce with Google Chrome at the same version?
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

55
.gitignore vendored Normal file
View File

@@ -0,0 +1,55 @@
*.gypcmd
*.mk
*.ncb
*.opensdf
*.props
*.pyc
*.rules
*.sdf
*.sln
*.sublime-project
*.sublime-workspace
*.suo
*.targets
*.user
*.vcproj
*.vcxproj
*.vcxproj.filters
*.vpj
*.vpw
*.vpwhistu
*.vtg
*.xcodeproj
*.xcworkspace
*_proto.xml
*_proto_cpp.xml
*~
!Android.mk
.*.sw?
.DS_Store
.classpath
.cproject
.gdb_history
.gdbinit
.landmines
.metadata
.project
.pydevproject
.vscode
# Settings directory for eclipse
/.settings
.checkstyle
cscope.*
Session.vim
tags
Thumbs.db
# IDE's
.vs/
.kdev4/
*.kdev4
# CEF generated directories
/binary_distrib
/docs
# CEF generated files
/include/cef_version.h
.ccls-cache/

9
.style.cfg Normal file
View File

@@ -0,0 +1,9 @@
# Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file
# Configuration settings for tools/fix_style.py
{
# Directories containing these path components will be ignored.
'ignore_directories': ['yapf'],
}

2
.style.yapf Normal file
View File

@@ -0,0 +1,2 @@
[style]
based_on_style = chromium

View File

@@ -1,6 +1,8 @@
# This file is an addendum to the Chromium AUTHORS file.
# Names should be added to this file like so:
# Name or Organization <email address>
# This file is an addendum to the Chromium AUTHORS file. It lists authors
# through March 16, 2015 when Git was introduced for source code management.
# A list of additional authors added after that date can be found by executing
# this command on a local Git checkout:
# git log --all --format="%aN <%aE>" | sort -u
Marshall Greenblatt <magreenblatt@gmail.com>
Jamie Kirkpatrick <jkp@spotify.com>
@@ -24,3 +26,10 @@ Russell (Rusty) Richards <fe3o4y@gmail.com>
Brian Power <powerbf.it@gmail.com>
Corey Lucier <clucier@adobe.com>
Mihai Tica <mitica@adobe.com>
Czarek Tomczak <czarek.tomczak@gmail.com>
Felix Bruns <felixbruns@spotify.com>
YuTeh Shen <shenyute@gmail.com>
Andrei Kurushin <ajax16384@gmail.com>
Gonzo Berman <gberman@factset.com>
Jakub Trzebiatowski <kuba.trzebiatowski@gmail.com>
Nishant Kaushik <nishantk@adobe.com>

2451
BUILD.gn Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -3,18 +3,9 @@
# below before building CEF. Chromium compatibility information for older CEF
# revisions is available by viewing this file's change history.
#
# To configure a specific Chromium URL:
# gclient config chromium_url
#
# To update to a specific Chromium revision:
# gclient sync --revision src@chromium_revision --jobs 8 --force
#
# This file is integrated with the CEF Automation Tool. See the
# tools/automate/automate.README.txt file for more information.
#
# For general gclient usage information visit:
# http://dev.chromium.org/developers/how-tos/get-the-code
# Instructions for building CEF are available at:
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'release_url': 'http://src.chromium.org/svn/releases/17.0.963.15',
'chromium_checkout': 'refs/tags/127.0.6533.43'
}

65
CHROMIUM_UPDATE.txt Normal file
View File

@@ -0,0 +1,65 @@
# The Chromium Embedded Framework (CEF) project is built on top of the Chromium
# project source tree. When updating Chromium to a new version certain files and
# patterns should be observed for changes. If changes are detected then the CEF
# source code or patch files will likely need to be updated.
#
# Add `--log-chromium-changes` to the automate-git.py command-line to output
# the following files in the <download-dir>:
#
# * chromium_update_changes.diff
# Files in the chromium/src directory that have changed. See the 'files'
# section below.
#
# * chromium_update_patterns.txt
# Files in the chromium/src directory that contain invalid/unexpected
# patterns. See the 'patterns' section below. Failure of this step is
# considered a fatal error during update.
#
# * chromium_update_patches.txt
# Output from attempting to update existing Chromium patch files using the
# patch_updater.py tool. Failure of this step is considered a fatal error
# during update.
#
# For complete update instructions see:
# https://bitbucket.org/chromiumembedded/cef/wiki/ChromiumUpdate.md
{
# Files in the chromium/src directory that should be evaluated for changes.
# Similar changes may need to be applied to the CEF source code.
'files': [
'chrome/browser/browser_process.h',
'chrome/browser/extensions/api/tabs/tabs_api.*',
'chrome/browser/extensions/chrome_component_extension_resource_manager.*',
'chrome/browser/extensions/chrome_extension_web_contents_observer.*',
'chrome/browser/extensions/component_loader.*',
'chrome/browser/extensions/extension_service.*',
'chrome/browser/profiles/profile.h',
'chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.*',
'chrome/common/extensions/api/*_features.json',
'chrome/renderer/chrome_content_renderer_client.*',
'chrome/renderer/extensions/chrome_extensions_renderer_client.*',
'components/content_settings/core/common/content_settings_types.mojom',
'components/permissions/request_type.h',
'content/browser/renderer_host/render_widget_host_view_base.*',
'content/public/browser/content_browser_client.*',
'content/public/browser/render_widget_host_view.h',
'content/public/browser/web_contents_delegate.h',
'content/public/common/content_features.cc',
'content/shell/BUILD.gn',
'content/shell/app/*',
'content/shell/browser/shell_*',
'content/shell/browser/renderer_host/shell_*',
'content/shell/common/shell_*',
'content/shell/gpu/shell_*',
'content/shell/renderer/shell_*',
'content/shell/utility/shell_*',
'extensions/shell/*',
'net/base/features.cc',
'net/cookies/cookie_store.h',
'services/network/public/cpp/features.cc',
'ui/base/ui_base_features.cc',
],
# Patterns that should not be found in the chromium/src directory after
# applying patch files.
'patterns': [],
}

257
CMakeLists.txt.in Normal file
View File

@@ -0,0 +1,257 @@
# Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
# OVERVIEW
#
# CMake is a cross-platform open-source build system that can generate project
# files in many different formats. It can be downloaded from
# http://www.cmake.org or installed via a platform package manager.
#
# CMake-generated project formats that have been tested with this CEF binary
# distribution include:
#
# Linux: Ninja, GCC 7.5.0+, Unix Makefiles
# MacOS: Ninja, Xcode 12.2 to 15.0
# Windows: Ninja, Visual Studio 2022
#
# Ninja is a cross-platform open-source tool for running fast builds using
# pre-installed platform toolchains (GNU, clang, Xcode or MSVC). It can be
# downloaded from http://martine.github.io/ninja/ or installed via a platform
# package manager.
#
# CMAKE STRUCTURE
#
# This CEF binary distribution includes the following CMake files:
#
# CMakeLists.txt Bootstrap that sets up the CMake environment.
# cmake/*.cmake CEF configuration files shared by all targets.
# libcef_dll/CMakeLists.txt Defines the libcef_dll_wrapper target.
# tests/*/CMakeLists.txt Defines the test application target.
#
# See the "TODO:" comments below for guidance on how to integrate this CEF
# binary distribution into a new or existing CMake project.
#
# BUILD REQUIREMENTS
#
# The below requirements must be met to build this CEF binary distribution.
#
# - CMake version 3.21 or newer.
#
# - Linux requirements:
# Currently supported distributions include Debian 10 (Buster), Ubuntu 18
# (Bionic Beaver), and related. Ubuntu 18.04 64-bit with GCC 7.5.0+ is
# recommended. Newer versions will likely also work but may not have been
# tested.
# Required packages include:
# build-essential
# libgtk3.0-dev (required by the cefclient target only)
#
# - MacOS requirements:
# Xcode 12.2 to 15.0 building on MacOS 10.15.4 (Catalina) or newer. Only
# 64-bit builds are supported. The Xcode command-line tools must also be
# installed. Newer Xcode versions may not have been been tested and are not
# recommended.
#
# - Windows requirements:
# Visual Studio 2022 building on Windows 10 or newer. Windows 10/11 64-bit is
# recommended. Newer versions will likely also work but may not have been
# tested.
#
# BUILD EXAMPLES
#
# The below commands will generate project files and create a Debug build of all
# CEF targets using CMake and the platform toolchain.
#
# Start by creating and entering the CMake build output directory:
# > cd path/to/cef_binary_*
# > mkdir build && cd build
#
# To perform a Linux build using a 32-bit CEF binary distribution on a 32-bit
# Linux platform or a 64-bit CEF binary distribution on a 64-bit Linux platform:
# Using Unix Makefiles:
# > cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
# > make -j4 cefclient cefsimple
#
# Using Ninja:
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a MacOS build using a 64-bit CEF binary distribution:
# Using the Xcode IDE:
# > cmake -G "Xcode" -DPROJECT_ARCH="x86_64" ..
# Open build\cef.xcodeproj in Xcode and select Product > Build.
#
# Using Ninja:
# > cmake -G "Ninja" -DPROJECT_ARCH="x86_64" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a MacOS build using an ARM64 CEF binary distribution:
# Using the Xcode IDE:
# > cmake -G "Xcode" -DPROJECT_ARCH="arm64" ..
# Open build\cef.xcodeproj in Xcode and select Product > Build.
#
# Using Ninja:
# > cmake -G "Ninja" -DPROJECT_ARCH="arm64" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a Windows build using a 32-bit CEF binary distribution:
# Using the Visual Studio 2022 IDE:
# > cmake -G "Visual Studio 17" -A Win32 ..
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
#
# Using Ninja with Visual Studio 2022 command-line tools:
# (this path may be different depending on your Visual Studio installation)
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars32.bat"
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a Windows build using a 64-bit CEF binary distribution:
# Using the Visual Studio 2022 IDE:
# > cmake -G "Visual Studio 17" -A x64 ..
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
#
# Using Ninja with Visual Studio 2022 command-line tools:
# (this path may be different depending on your Visual Studio installation)
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat"
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a Windows build using an ARM64 CEF binary distribution:
# Using the Visual Studio 2022 IDE:
# > cmake -G "Visual Studio 17" -A arm64 ..
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
#
# Using Ninja with Visual Studio 2022 command-line tools:
# (this path may be different depending on your Visual Studio installation)
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefsimple
#
# Global setup.
#
# For VS2022 and Xcode 12+ support.
cmake_minimum_required(VERSION 3.21)
# Only generate Debug and Release configuration types.
set(CMAKE_CONFIGURATION_TYPES Debug Release)
# Project name.
# TODO: Change this line to match your project name when you copy this file.
project(cef)
# Use folders in the resulting project files.
set_property(GLOBAL PROPERTY OS_FOLDERS ON)
#
# CEF_ROOT setup.
# This variable must be set to locate the binary distribution.
# TODO: Choose one of the below examples and comment out the rest.
#
# Example 1: The current directory contains both the complete binary
# distribution and your project.
# A. Comment in these lines:
#
set(CEF_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")
# Example 2: The binary distribution is in a separate directory from your
# project. Locate the binary distribution using the CEF_ROOT CMake
# variable.
# A. Create a directory structure for your project like the following:
# myproject/
# CMakeLists.txt <= top-level CMake configuration
# mytarget/
# CMakeLists.txt <= CMake configuration for `mytarget`
# ... other `mytarget` source files
# B. Copy this file to "myproject/CMakeLists.txt" as the top-level CMake
# configuration.
# C. Create the target-specific "myproject/mytarget/CMakeLists.txt" file for
# your application. See the included cefclient and cefsimple CMakeLists.txt
# files as an example.
# D. Comment in these lines:
#
# set(CEF_ROOT "c:/path/to/cef_binary_3.2704.xxxx.gyyyyyyy_windows32")
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")
# Example 3: The binary distribution is in a separate directory from your
# project. Locate the binary distribution using the CEF_ROOT
# environment variable.
# A. Create a directory structure for your project like the following:
# myproject/
# CMakeLists.txt <= top-level CMake configuration
# cmake/
# FindCEF.cmake <= CEF CMake configuration entry point
# mytarget/
# CMakeLists.txt <= CMake configuration for `mytarget`
# ... other `mytarget` source files
# B. Copy this file to "myproject/CMakeLists.txt" as the top-level CMake
# configuration.
# C. Copy the cmake/FindCEF.cmake file to "myproject/cmake/FindCEF.cmake".
# D. Create the target-specific "myproject/mytarget/CMakeLists.txt" file for
# your application. See the included cefclient and cefsimple CMakeLists.txt
# files as an example.
# E. Set the CEF_ROOT environment variable before executing CMake. For example:
# > set CEF_ROOT=c:\path\to\cef_binary_3.2704.xxxx.gyyyyyyy_windows32
# F. Comment in these lines:
#
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
#
# Load the CEF configuration.
#
# Execute FindCEF.cmake which must exist in CMAKE_MODULE_PATH.
find_package(CEF REQUIRED)
#
# Define CEF-based targets.
#
# Include the libcef_dll_wrapper target.
# Comes from the libcef_dll/CMakeLists.txt file in the binary distribution
# directory.
add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
# Include application targets.
# Comes from the <target>/CMakeLists.txt file in the current directory.
# TODO: Change these lines to match your project target when you copy this file.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
add_subdirectory(tests/cefsimple)
add_subdirectory(tests/gtest)
add_subdirectory(tests/ceftests)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/cefclient")
add_subdirectory(tests/cefclient)
endif()
# Display configuration settings.
PRINT_CEF_CONFIG()
#
# Define the API documentation target.
#
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile")
find_package(Doxygen)
if(DOXYGEN_FOUND)
add_custom_target(apidocs ALL
# Generate documentation in the docs/html directory.
COMMAND "${DOXYGEN_EXECUTABLE}" Doxyfile
# Write a docs/index.html file.
COMMAND ${CMAKE_COMMAND} -E echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL='html/index.html'\"/></head></html>" > docs/index.html
WORKING_DIRECTORY "${CEF_ROOT}"
COMMENT "Generating API documentation with Doxygen..."
VERBATIM )
else()
message(WARNING "Doxygen must be installed to generate API documentation.")
endif()
endif()

2782
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2008-2011 Marshall A. Greenblatt. Portions Copyright (c)
// Copyright (c) 2008-2020 Marshall A. Greenblatt. Portions Copyright (c)
// 2006-2009 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without

84
README.md Normal file
View File

@@ -0,0 +1,84 @@
The Chromium Embedded Framework (CEF) is a simple framework for embedding Chromium-based browsers in other applications.
# Quick Links
* Project Page - https://bitbucket.org/chromiumembedded/cef
* Tutorial - https://bitbucket.org/chromiumembedded/cef/wiki/Tutorial
* General Usage - https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage
* Master Build Quick-Start - https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart
* Branches and Building - https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
* Announcements - https://groups.google.com/forum/#!forum/cef-announce
* Support Forum - http://www.magpcss.org/ceforum/
* Issue Tracker - https://github.com/chromiumembedded/cef/issues
* C++ API Docs - [Stable release docs](https://cef-builds.spotifycdn.com/docs/stable.html) / [Beta release docs](https://cef-builds.spotifycdn.com/docs/beta.html)
* Downloads - https://cef-builds.spotifycdn.com/index.html
* Donations - http://www.magpcss.org/ceforum/donate.php
# Introduction
CEF is a BSD-licensed open source project founded by Marshall Greenblatt in 2008 and based on the [Google Chromium](http://www.chromium.org/Home) project. Unlike the Chromium project itself, which focuses mainly on Google Chrome application development, CEF focuses on facilitating embedded browser use cases in third-party applications. CEF insulates the user from the underlying Chromium and Blink code complexity by offering production-quality stable APIs, release branches tracking specific Chromium releases, and binary distributions. Most features in CEF have default implementations that provide rich functionality while requiring little or no integration work from the user. There are currently over 100 million installed instances of CEF around the world embedded in products from a wide range of companies and industries. A partial list of companies and products using CEF is available on the [CEF Wikipedia page](http://en.wikipedia.org/wiki/Chromium_Embedded_Framework#Applications_using_CEF). Some use cases for CEF include:
* Embedding an HTML5-compliant Web browser control in an existing native application.
* Creating a light-weight native “shell” application that hosts a user interface developed primarily using Web technologies.
* Rendering Web content “off-screen” in applications that have their own custom drawing frameworks.
* Acting as a host for automated testing of existing Web properties and applications.
CEF supports a wide range of programming languages and operating systems and can be easily integrated into both new and existing applications. It was designed from the ground up with both performance and ease of use in mind. The base framework includes C and C++ programming interfaces exposed via native libraries that insulate the host application from Chromium and Blink implementation details. It provides close integration between the browser and the host application including support for custom plugins, protocols, JavaScript objects and JavaScript extensions. The host application can optionally control resource loading, navigation, context menus, printing and more, while taking advantage of the same performance and HTML5 technologies available in the Google Chrome Web browser.
Numerous individuals and organizations contribute time and resources to support CEF development, but more involvement from the community is always welcome. This includes support for both the core CEF project and external projects that integrate CEF with additional programming languages and frameworks (see the "External Projects" section below). If you are interested in donating time to help with CEF development please see the "Helping Out" section below. If you are interested in donating money to support general CEF development and infrastructure efforts please visit the [CEF Donations](http://www.magpcss.org/ceforum/donate.php) page.
# Getting Started
Users new to CEF development should start by reading the [Tutorial](https://bitbucket.org/chromiumembedded/cef/wiki/Tutorial) Wiki page for an overview of CEF usage and then proceed to the [GeneralUsage](https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage) Wiki page for a more in-depth discussion or architectural and usage issues. Complete API documentation is available [here](https://cef-builds.spotifycdn.com/docs/stable.html). CEF support and related discussion is available on the [CEF Forum](http://www.magpcss.org/ceforum/).
# Binary Distributions
Binary distributions, which include all files necessary to build a CEF-based application, are available on the [Downloads](https://cef-builds.spotifycdn.com/index.html) page. Binary distributions are stand-alone and do not require the download of CEF or Chromium source code. Symbol files for debugging binary distributions of libcef can also be downloaded from the above links.
# Source Distributions
The CEF project is an extension of the Chromium project. CEF maintains development and release branches that track Chromium branches. CEF source code can be downloaded, built and packaged manually or with automated tools. Visit the [BranchesAndBuilding](https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding) Wiki page for more information.
# External Projects
The base CEF framework includes support for the C and C++ programming languages. Thanks to the hard work of external maintainers CEF can integrate with a number of other programming languages and frameworks. These external projects are not maintained by CEF so please contact the respective project maintainer if you have any questions or issues.
* .Net (CEF3) - https://github.com/cefsharp/CefSharp
* .Net (CEF1) - https://bitbucket.org/fddima/cefglue
* .Net/Mono (CEF3) - https://gitlab.com/xiliumhq/chromiumembedded/cefglue
* Delphi - https://github.com/hgourvest/dcef3
* Delphi - https://github.com/salvadordf/CEF4Delphi
* Go - https://github.com/CzarekTomczak/cef2go
* Go - https://github.com/energye/energy
* Java - https://bitbucket.org/chromiumembedded/java-cef
* Python - http://code.google.com/p/cefpython/
If you're the maintainer of a project not listed above and would like your project listed here please either post to the [CEF Forum](http://www.magpcss.org/ceforum/) or contact Marshall directly.
# Helping Out
CEF is still very much a work in progress. Some ways that you can help out:
\- Vote for issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) that are important to you. This helps with development prioritization.
\- Report any bugs that you find or feature requests that are important to you. Make sure to first search for existing issues before creating new ones. Please use the [CEF Forum](http://magpcss.org/ceforum) and not the issue tracker for usage questions. Each CEF issue should:
* Include the CEF revision or binary distribution version.
* Include information about your OS and compiler version.
* If the issue is a bug please provide detailed reproduction information.
* If the issue is a feature please describe why the feature is beneficial.
\- Write unit tests for new or existing functionality.
\- Pull requests and patches are welcome. View open issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) or search for TODO(cef) in the source code for ideas.
If you would like to contribute source code changes to CEF please follow the below guidelines:
\- Create or find an appropriate issue for each distinct bug, feature or change.
\- Submit a [pull request](https://bitbucket.org/chromiumembedded/cef/wiki/ContributingWithGit) or create a patch with your changes and attach it to the CEF issue. Changes should:
* Be submitted against the current [CEF master branch](https://bitbucket.org/chromiumembedded/cef/src/?at=master) unless explicitly fixing a bug in a CEF release branch.
* Follow the style of existing CEF source files. In general CEF uses the [Chromium C++ style guide](https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md).
* Include new or modified unit tests as appropriate to the functionality.
* Not include unnecessary or unrelated changes.

1
VERSION.in Normal file
View File

@@ -0,0 +1 @@
CEF_MAJOR=3

989
cef.gyp
View File

@@ -1,989 +0,0 @@
# Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
{
'variables': {
'pkg-config': 'pkg-config',
'chromium_code': 1,
'repack_locales_cmd': ['python', 'tools/repack_locales.py'],
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/cef',
},
'conditions': [
[ 'os_posix==1 and OS!="mac" and OS!="android" and gcc_version==46', {
'target_defaults': {
# Disable warnings about c++0x compatibility, as some names (such
# as nullptr) conflict with upcoming c++0x types.
'cflags_cc': ['-Wno-c++0x-compat'],
},
}],
],
'includes': [
# Bring in the source file lists for cefclient.
'cef_paths.gypi',
],
'targets': [
{
'target_name': 'cefclient',
'type': 'executable',
'mac_bundle': 1,
'msvs_guid': '6617FED9-C5D4-4907-BF55-A90062A6683F',
'dependencies': [
'../third_party/npapi/npapi.gyp:npapi',
'libcef',
'libcef_dll_wrapper',
],
'defines': [
'USING_CEF_SHARED',
],
'include_dirs': [
'.',
'..',
],
'sources': [
'<@(includes_common)',
'<@(cefclient_sources_common)',
],
'mac_bundle_resources': [
'<@(cefclient_bundle_resources_mac)',
'<(grit_out_dir)/devtools_resources.pak',
],
'mac_bundle_resources!': [
# TODO(mark): Come up with a fancier way to do this (mac_info_plist?)
# that automatically sets the correct INFOPLIST_FILE setting and adds
# the file to a source group.
'tests/cefclient/mac/Info.plist',
],
'xcode_settings': {
'INFOPLIST_FILE': 'tests/cefclient/mac/Info.plist',
},
'conditions': [
['OS=="win"', {
'variables': {
'repack_path': '../tools/grit/grit/format/repack.py',
},
'actions': [
{
'action_name': 'repack_locales',
'inputs': [
'tools/repack_locales.py',
# NOTE: Ideally the common command args would be shared
# amongst inputs/outputs/action, but the args include shell
# variables which need to be passed intact, and command
# expansion wants to expand the shell variables. Adding the
# explicit quoting here was the only way it seemed to work.
'>!@(<(repack_locales_cmd) -i -g \"<(grit_out_dir)\" -s \"<(SHARED_INTERMEDIATE_DIR)\" -x \"<(INTERMEDIATE_DIR)\" <(locales))',
],
'outputs': [
'>!@(<(repack_locales_cmd) -o -g \"<(grit_out_dir)\" -s \"<(SHARED_INTERMEDIATE_DIR)\" -x \"<(INTERMEDIATE_DIR)\" <(locales))',
],
'action': [
'<@(repack_locales_cmd)',
'-g', '<(grit_out_dir)',
'-s', '<(SHARED_INTERMEDIATE_DIR)',
'-x', '<(INTERMEDIATE_DIR)',
'<@(locales)',
],
},
],
'copies': [
{
'destination': '<(PRODUCT_DIR)/locales',
'files': [
'<!@pymod_do_main(repack_locales -o -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(INTERMEDIATE_DIR) <(locales))'
],
},
{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(grit_out_dir)/devtools_resources.pak'
],
},
],
'msvs_settings': {
'VCLinkerTool': {
# Set /SUBSYSTEM:WINDOWS.
'SubSystem': '2',
'EntryPointSymbol' : 'wWinMainCRTStartup',
},
},
'link_settings': {
'libraries': [
'-lcomctl32.lib',
'-lshlwapi.lib',
'-lrpcrt4.lib',
'-lopengl32.lib',
'-lglu32.lib',
],
},
'sources': [
'<@(includes_win)',
'<@(cefclient_sources_win)',
],
}],
[ 'OS=="mac"', {
'product_name': 'cefclient',
'variables': {
'repack_path': '../tools/grit/grit/format/repack.py',
},
'actions': [
{
'action_name': 'repack_locales',
'process_outputs_as_mac_bundle_resources': 1,
'inputs': [
'tools/repack_locales.py',
# NOTE: Ideally the common command args would be shared
# amongst inputs/outputs/action, but the args include shell
# variables which need to be passed intact, and command
# expansion wants to expand the shell variables. Adding the
# explicit quoting here was the only way it seemed to work.
'>!@(<(repack_locales_cmd) -i -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))',
],
'outputs': [
'>!@(<(repack_locales_cmd) -o -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))',
],
'action': [
'<@(repack_locales_cmd)',
'-g', '<(grit_out_dir)',
'-s', '<(SHARED_INTERMEDIATE_DIR)',
'-x', '<(INTERMEDIATE_DIR)',
'<@(locales)',
],
},
{
'action_name': 'repack_resources',
'process_outputs_as_mac_bundle_resources': 1,
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak',
],
},
'inputs': [
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(INTERMEDIATE_DIR)/repack/chrome.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
},
],
'copies': [
{
# Add library dependencies to the bundle.
'destination': '<(PRODUCT_DIR)/cefclient.app/Contents/MacOS/',
'files': [
'<(PRODUCT_DIR)/libcef.dylib',
'<(PRODUCT_DIR)/ffmpegsumo.so',
],
},
{
# Add the WebCore resources to the bundle.
'destination': '<(PRODUCT_DIR)/cefclient.app/Contents/',
'files': [
'../third_party/WebKit/Source/WebCore/Resources/',
],
},
],
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
'$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
],
},
'sources': [
'<@(includes_mac)',
'<@(cefclient_sources_mac)',
],
}],
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'sources': [
'<@(includes_linux)',
'<@(cefclient_sources_linux)',
],
'variables': {
'repack_path': '../tools/grit/grit/format/repack.py',
},
'actions': [
{
'action_name': 'repack_locales',
'inputs': [
'tools/repack_locales.py',
# NOTE: Ideally the common command args would be shared
# amongst inputs/outputs/action, but the args include shell
# variables which need to be passed intact, and command
# expansion wants to expand the shell variables. Adding the
# explicit quoting here was the only way it seemed to work.
'>!@(<(repack_locales_cmd) -i -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))',
],
'outputs': [
'>!@(<(repack_locales_cmd) -o -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))',
],
'action': [
'<@(repack_locales_cmd)',
'-g', '<(grit_out_dir)',
'-s', '<(SHARED_INTERMEDIATE_DIR)',
'-x', '<(INTERMEDIATE_DIR)',
'<@(locales)',
],
},
{
'action_name': 'repack_resources',
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak',
],
},
'inputs': [
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(INTERMEDIATE_DIR)/repack/chrome.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
},
],
'copies': [
{
'destination': '<(PRODUCT_DIR)/locales',
'files': [
'<!@pymod_do_main(repack_locales -o -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(INTERMEDIATE_DIR) <(locales))'
],
},
{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(INTERMEDIATE_DIR)/repack/chrome.pak',
'<(grit_out_dir)/devtools_resources.pak',
],
},
{
'destination': '<(PRODUCT_DIR)/files',
'files': [
'<@(cefclient_bundle_resources_linux)',
],
},
],
}],
],
},
{
'target_name': 'cef_unittests',
'type': 'executable',
'mac_bundle': 1,
'msvs_guid': '8500027C-B11A-11DE-A16E-B80256D89593',
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
'../base/base.gyp:test_support_base',
'../testing/gtest.gyp:gtest',
'../third_party/icu/icu.gyp:icui18n',
'../third_party/icu/icu.gyp:icuuc',
'libcef',
'libcef_dll_wrapper',
],
'sources': [
'tests/cefclient/cefclient_switches.cpp',
'tests/cefclient/cefclient_switches.h',
'tests/unittests/command_line_unittest.cc',
'tests/unittests/content_filter_unittest.cc',
'tests/unittests/cookie_unittest.cc',
'tests/unittests/dom_unittest.cc',
'tests/unittests/navigation_unittest.cc',
'tests/unittests/request_unittest.cc',
'tests/unittests/run_all_unittests.cc',
'tests/unittests/scheme_handler_unittest.cc',
'tests/unittests/stream_unittest.cc',
'tests/unittests/string_unittest.cc',
'tests/unittests/storage_unittest.cc',
'tests/unittests/test_handler.cc',
'tests/unittests/test_handler.h',
'tests/unittests/test_suite.cc',
'tests/unittests/test_suite.h',
'tests/unittests/url_unittest.cc',
'tests/unittests/v8_unittest.cc',
'tests/unittests/web_urlrequest_unittest.cc',
'tests/unittests/xml_reader_unittest.cc',
'tests/unittests/zip_reader_unittest.cc',
],
'mac_bundle_resources': [
'tests/unittests/mac/unittests.icns',
'tests/unittests/mac/English.lproj/InfoPlist.strings',
'tests/unittests/mac/English.lproj/MainMenu.xib',
'tests/unittests/mac/Info.plist',
],
'mac_bundle_resources!': [
# TODO(mark): Come up with a fancier way to do this (mac_info_plist?)
# that automatically sets the correct INFOPLIST_FILE setting and adds
# the file to a source group.
'tests/unittests/mac/Info.plist',
],
'xcode_settings': {
'INFOPLIST_FILE': 'tests/unittests/mac/Info.plist',
},
'include_dirs': [
'.',
'..',
],
'conditions': [
[ 'OS=="mac"', {
'product_name': 'cef_unittests',
'variables': {
'repack_path': '../tools/grit/grit/format/repack.py',
},
'run_as': {
'action': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/MacOS/${PRODUCT_NAME}'],
},
'actions': [
{
'action_name': 'repack_locales',
'process_outputs_as_mac_bundle_resources': 1,
'inputs': [
'tools/repack_locales.py',
# NOTE: Ideally the common command args would be shared
# amongst inputs/outputs/action, but the args include shell
# variables which need to be passed intact, and command
# expansion wants to expand the shell variables. Adding the
# explicit quoting here was the only way it seemed to work.
'>!@(<(repack_locales_cmd) -i -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))',
],
'outputs': [
'>!@(<(repack_locales_cmd) -o -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))',
],
'action': [
'<@(repack_locales_cmd)',
'-g', '<(grit_out_dir)',
'-s', '<(SHARED_INTERMEDIATE_DIR)',
'-x', '<(INTERMEDIATE_DIR)',
'<@(locales)',
],
},
{
'action_name': 'repack_resources',
'process_outputs_as_mac_bundle_resources': 1,
'variables': {
'pak_inputs': [
'<(grit_out_dir)/devtools_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak',
],
},
'inputs': [
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(INTERMEDIATE_DIR)/repack/chrome.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
},
],
'copies': [
{
# Add library dependencies to the bundle.
'destination': '<(PRODUCT_DIR)/cef_unittests.app/Contents/MacOS/',
'files': [
'<(PRODUCT_DIR)/libcef.dylib',
'<(PRODUCT_DIR)/ffmpegsumo.so',
],
},
],
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
],
},
'sources': [
'tests/unittests/run_all_unittests_mac.mm',
],
}],
],
},
{
'target_name': 'libcef',
'type': 'shared_library',
'msvs_guid': 'C13650D5-CF1A-4259-BE45-B1EBA6280E47',
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
'../build/temp_gyp/googleurl.gyp:googleurl',
'../media/media.gyp:media',
'../net/net.gyp:net',
'../net/net.gyp:net_resources',
'../printing/printing.gyp:printing',
'../sdch/sdch.gyp:sdch',
'../skia/skia.gyp:skia',
'../third_party/bzip2/bzip2.gyp:bzip2',
'../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
'../third_party/icu/icu.gyp:icui18n',
'../third_party/icu/icu.gyp:icuuc',
'../third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
'../third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
'../third_party/libpng/libpng.gyp:libpng',
'../third_party/libxml/libxml.gyp:libxml',
'../third_party/libxslt/libxslt.gyp:libxslt',
'../third_party/modp_b64/modp_b64.gyp:modp_b64',
'../third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore',
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
'../third_party/zlib/zlib.gyp:zlib',
'../ui/ui.gyp:gfx_resources',
'../ui/ui.gyp:ui',
'../v8/tools/gyp/v8.gyp:v8',
'../webkit/support/webkit_support.gyp:appcache',
'../webkit/support/webkit_support.gyp:blob',
'../webkit/support/webkit_support.gyp:database',
'../webkit/support/webkit_support.gyp:fileapi',
'../webkit/support/webkit_support.gyp:glue',
'../webkit/support/webkit_support.gyp:quota',
'../webkit/support/webkit_support.gyp:webkit_gpu',
'../webkit/support/webkit_support.gyp:webkit_media',
'../webkit/support/webkit_support.gyp:webkit_resources',
'../webkit/support/webkit_support.gyp:webkit_strings',
'libcef_static',
],
'defines': [
'BUILDING_CEF_SHARED',
],
'include_dirs': [
'.',
'..',
],
# Avoid "RC1102: internal error : too many arguments to RCPP" error by
# explicitly specifying a short list of resource include directories.
'resource_include_dirs' : [
'.',
'..',
],
'sources': [
'<@(includes_common)',
'libcef_dll/cef_logging.h',
'libcef_dll/cpptoc/browser_cpptoc.cc',
'libcef_dll/cpptoc/browser_cpptoc.h',
'libcef_dll/cpptoc/command_line_cpptoc.cc',
'libcef_dll/cpptoc/command_line_cpptoc.h',
'libcef_dll/cpptoc/cookie_manager_cpptoc.cc',
'libcef_dll/cpptoc/cookie_manager_cpptoc.h',
'libcef_dll/cpptoc/cpptoc.h',
'libcef_dll/cpptoc/domdocument_cpptoc.cc',
'libcef_dll/cpptoc/domdocument_cpptoc.h',
'libcef_dll/cpptoc/domevent_cpptoc.cc',
'libcef_dll/cpptoc/domevent_cpptoc.h',
'libcef_dll/cpptoc/domnode_cpptoc.cc',
'libcef_dll/cpptoc/domnode_cpptoc.h',
'libcef_dll/cpptoc/drag_data_cpptoc.cc',
'libcef_dll/cpptoc/drag_data_cpptoc.h',
'libcef_dll/cpptoc/frame_cpptoc.cc',
'libcef_dll/cpptoc/frame_cpptoc.h',
'libcef_dll/cpptoc/geolocation_callback_cpptoc.cc',
'libcef_dll/cpptoc/geolocation_callback_cpptoc.h',
'libcef_dll/cpptoc/post_data_cpptoc.cc',
'libcef_dll/cpptoc/post_data_cpptoc.h',
'libcef_dll/cpptoc/post_data_element_cpptoc.cc',
'libcef_dll/cpptoc/post_data_element_cpptoc.h',
'libcef_dll/cpptoc/request_cpptoc.cc',
'libcef_dll/cpptoc/request_cpptoc.h',
'libcef_dll/cpptoc/response_cpptoc.cc',
'libcef_dll/cpptoc/response_cpptoc.h',
'libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc',
'libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h',
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
'libcef_dll/cpptoc/stream_reader_cpptoc.h',
'libcef_dll/cpptoc/stream_writer_cpptoc.cc',
'libcef_dll/cpptoc/stream_writer_cpptoc.h',
'libcef_dll/cpptoc/v8context_cpptoc.cc',
'libcef_dll/cpptoc/v8context_cpptoc.h',
'libcef_dll/cpptoc/v8exception_cpptoc.cc',
'libcef_dll/cpptoc/v8exception_cpptoc.h',
'libcef_dll/cpptoc/v8stack_frame_cpptoc.cc',
'libcef_dll/cpptoc/v8stack_frame_cpptoc.h',
'libcef_dll/cpptoc/v8stack_trace_cpptoc.cc',
'libcef_dll/cpptoc/v8stack_trace_cpptoc.h',
'libcef_dll/cpptoc/v8value_cpptoc.cc',
'libcef_dll/cpptoc/v8value_cpptoc.h',
'libcef_dll/cpptoc/web_plugin_info_cpptoc.cc',
'libcef_dll/cpptoc/web_plugin_info_cpptoc.h',
'libcef_dll/cpptoc/web_urlrequest_cpptoc.cc',
'libcef_dll/cpptoc/web_urlrequest_cpptoc.h',
'libcef_dll/cpptoc/xml_reader_cpptoc.cc',
'libcef_dll/cpptoc/xml_reader_cpptoc.h',
'libcef_dll/cpptoc/zip_reader_cpptoc.cc',
'libcef_dll/cpptoc/zip_reader_cpptoc.h',
'libcef_dll/ctocpp/app_ctocpp.cc',
'libcef_dll/ctocpp/app_ctocpp.h',
'libcef_dll/ctocpp/client_ctocpp.cc',
'libcef_dll/ctocpp/client_ctocpp.h',
'libcef_dll/ctocpp/content_filter_ctocpp.cc',
'libcef_dll/ctocpp/content_filter_ctocpp.h',
'libcef_dll/ctocpp/cookie_visitor_ctocpp.cc',
'libcef_dll/ctocpp/cookie_visitor_ctocpp.h',
'libcef_dll/ctocpp/ctocpp.h',
'libcef_dll/ctocpp/display_handler_ctocpp.cc',
'libcef_dll/ctocpp/display_handler_ctocpp.h',
'libcef_dll/ctocpp/domevent_listener_ctocpp.cc',
'libcef_dll/ctocpp/domevent_listener_ctocpp.h',
'libcef_dll/ctocpp/domvisitor_ctocpp.cc',
'libcef_dll/ctocpp/domvisitor_ctocpp.h',
'libcef_dll/ctocpp/download_handler_ctocpp.cc',
'libcef_dll/ctocpp/download_handler_ctocpp.h',
'libcef_dll/ctocpp/drag_handler_ctocpp.cc',
'libcef_dll/ctocpp/drag_handler_ctocpp.h',
'libcef_dll/ctocpp/find_handler_ctocpp.cc',
'libcef_dll/ctocpp/find_handler_ctocpp.h',
'libcef_dll/ctocpp/focus_handler_ctocpp.cc',
'libcef_dll/ctocpp/focus_handler_ctocpp.h',
'libcef_dll/ctocpp/geolocation_handler_ctocpp.cc',
'libcef_dll/ctocpp/geolocation_handler_ctocpp.h',
'libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc',
'libcef_dll/ctocpp/jsdialog_handler_ctocpp.h',
'libcef_dll/ctocpp/keyboard_handler_ctocpp.cc',
'libcef_dll/ctocpp/keyboard_handler_ctocpp.h',
'libcef_dll/ctocpp/life_span_handler_ctocpp.cc',
'libcef_dll/ctocpp/life_span_handler_ctocpp.h',
'libcef_dll/ctocpp/load_handler_ctocpp.cc',
'libcef_dll/ctocpp/load_handler_ctocpp.h',
'libcef_dll/ctocpp/menu_handler_ctocpp.cc',
'libcef_dll/ctocpp/menu_handler_ctocpp.h',
'libcef_dll/ctocpp/permission_handler_ctocpp.cc',
'libcef_dll/ctocpp/permission_handler_ctocpp.h',
'libcef_dll/ctocpp/print_handler_ctocpp.cc',
'libcef_dll/ctocpp/print_handler_ctocpp.h',
'libcef_dll/ctocpp/proxy_handler_ctocpp.cc',
'libcef_dll/ctocpp/proxy_handler_ctocpp.h',
'libcef_dll/ctocpp/read_handler_ctocpp.cc',
'libcef_dll/ctocpp/read_handler_ctocpp.h',
'libcef_dll/ctocpp/render_handler_ctocpp.cc',
'libcef_dll/ctocpp/render_handler_ctocpp.h',
'libcef_dll/ctocpp/request_handler_ctocpp.cc',
'libcef_dll/ctocpp/request_handler_ctocpp.h',
'libcef_dll/ctocpp/scheme_handler_ctocpp.cc',
'libcef_dll/ctocpp/scheme_handler_ctocpp.h',
'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc',
'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h',
'libcef_dll/ctocpp/storage_visitor_ctocpp.cc',
'libcef_dll/ctocpp/storage_visitor_ctocpp.h',
'libcef_dll/ctocpp/task_ctocpp.cc',
'libcef_dll/ctocpp/task_ctocpp.h',
'libcef_dll/ctocpp/v8accessor_ctocpp.cc',
'libcef_dll/ctocpp/v8accessor_ctocpp.h',
'libcef_dll/ctocpp/v8context_handler_ctocpp.cc',
'libcef_dll/ctocpp/v8context_handler_ctocpp.h',
'libcef_dll/ctocpp/v8handler_ctocpp.cc',
'libcef_dll/ctocpp/v8handler_ctocpp.h',
'libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc',
'libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h',
'libcef_dll/ctocpp/write_handler_ctocpp.cc',
'libcef_dll/ctocpp/write_handler_ctocpp.h',
'libcef_dll/libcef_dll.cc',
'libcef_dll/libcef_dll2.cc',
'libcef_dll/resource.h',
'libcef_dll/transfer_util.cpp',
'libcef_dll/transfer_util.h',
],
'xcode_settings': {
'INSTALL_PATH': '@executable_path',
# The libcef_static target contains ObjC categories. Passing the -ObjC flag
# is necessary to properly load them and avoid a "selector not recognized"
# runtime error. See http://developer.apple.com/library/mac/#qa/qa1490/_index.html
# for more information.
'OTHER_LDFLAGS': ['-Wl,-ObjC'],
},
'conditions': [
['OS=="win"', {
'dependencies': [
'../breakpad/breakpad.gyp:breakpad_handler',
'../third_party/angle/src/build_angle.gyp:libEGL',
'../third_party/angle/src/build_angle.gyp:libGLESv2',
'../ui/views/views.gyp:views',
],
'sources': [
'<@(includes_win)',
'$(OutDir)/obj/global_intermediate/webkit/webkit_chromium_resources.rc',
'$(OutDir)/obj/global_intermediate/webkit/webkit_resources.rc',
'libcef_dll/libcef_dll.rc',
],
'link_settings': {
'libraries': [
'-lcomctl32.lib',
'-llocationapi.lib',
],
},
'msvs_settings': {
'VCLinkerTool': {
# Generate a PDB symbol file for both Debug and Release builds.
'GenerateDebugInformation': 'true',
},
},
}],
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'dependencies':[
'../base/allocator/allocator.gyp:allocator',
],
'direct_dependent_settings': {
'cflags': [
'<!@(<(pkg-config) --cflags gtk+-2.0 gthread-2.0)',
],
},
'link_settings': {
'ldflags': [
'<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)',
],
'libraries': [
'<!@(<(pkg-config) --libs-only-l gtk+-2.0 gthread-2.0)',
],
},
}],
],
},
{
'target_name': 'libcef_dll_wrapper',
'type': 'static_library',
'msvs_guid': 'A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9',
'dependencies': [
'../third_party/npapi/npapi.gyp:npapi',
'libcef',
],
'defines': [
'USING_CEF_SHARED',
],
'include_dirs': [
'.',
'..',
],
'sources': [
'<@(includes_common)',
'<@(libcef_dll_wrapper_sources_common)',
],
},
{
'target_name': 'cef_extra_resources',
'type': 'none',
'dependencies': [
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:generate_devtools_grd',
],
# These resources end up in chrome.pak because they are resources
# used by internal pages. Putting them in a spearate pak file makes
# it easier for us to reference them internally.
'actions': [
{
'action_name': 'devtools_resources',
# This can't use ../build/grit_action.gypi because the grd file
# is generated a build time, so the trick of using grit_info to get
# the real inputs/outputs at GYP time isn't possible.
'variables': {
'grit_cmd': ['python', '../tools/grit/grit.py'],
'grit_grd_file': '<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd',
},
'inputs': [
'<(grit_grd_file)',
'<!@pymod_do_main(grit_info --inputs)',
],
'outputs': [
'<(grit_out_dir)/grit/devtools_resources.h',
'<(grit_out_dir)/devtools_resources.pak',
'<(grit_out_dir)/grit/devtools_resources_map.cc',
'<(grit_out_dir)/grit/devtools_resources_map.h',
],
'action': ['<@(grit_cmd)',
'-i', '<(grit_grd_file)', 'build',
'-o', '<(grit_out_dir)',
'-D', 'SHARED_INTERMEDIATE_DIR=<(SHARED_INTERMEDIATE_DIR)',
'<@(grit_defines)' ],
'message': 'Generating resources from <(grit_grd_file)',
},
],
'includes': [ '../build/grit_target.gypi' ],
},
{
'target_name': 'libcef_static',
'type': 'static_library',
'msvs_guid': 'FA39524D-3067-4141-888D-28A86C66F2B9',
'defines': [
'BUILDING_CEF_SHARED',
],
'include_dirs': [
'.',
'..',
'../third_party/WebKit/Source/WebKit/chromium/public',
'<(grit_out_dir)',
],
'dependencies': [
'cef_extra_resources',
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
'../build/temp_gyp/googleurl.gyp:googleurl',
'../media/media.gyp:media',
'../net/net.gyp:net',
'../net/net.gyp:net_resources',
'../printing/printing.gyp:printing',
'../sdch/sdch.gyp:sdch',
'../skia/skia.gyp:skia',
'../third_party/bzip2/bzip2.gyp:bzip2',
'../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
'../third_party/icu/icu.gyp:icui18n',
'../third_party/icu/icu.gyp:icuuc',
'../third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
'../third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
'../third_party/libpng/libpng.gyp:libpng',
'../third_party/libxml/libxml.gyp:libxml',
'../third_party/libxslt/libxslt.gyp:libxslt',
'../third_party/modp_b64/modp_b64.gyp:modp_b64',
'../third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore',
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
'../third_party/zlib/zlib.gyp:zlib',
'../ui/ui.gyp:gfx_resources',
'../ui/ui.gyp:ui',
'../v8/tools/gyp/v8.gyp:v8',
'../webkit/support/webkit_support.gyp:appcache',
'../webkit/support/webkit_support.gyp:blob',
'../webkit/support/webkit_support.gyp:database',
'../webkit/support/webkit_support.gyp:fileapi',
'../webkit/support/webkit_support.gyp:glue',
'../webkit/support/webkit_support.gyp:quota',
'../webkit/support/webkit_support.gyp:webkit_gpu',
'../webkit/support/webkit_support.gyp:webkit_media',
'../webkit/support/webkit_support.gyp:webkit_resources',
'../webkit/support/webkit_support.gyp:webkit_strings',
],
'sources': [
'<@(includes_common)',
'libcef/browser_appcache_system.cc',
'libcef/browser_appcache_system.h',
'libcef/browser_database_system.cc',
'libcef/browser_database_system.h',
'libcef/browser_devtools_agent.cc',
'libcef/browser_devtools_agent.h',
'libcef/browser_devtools_callargs.cc',
'libcef/browser_devtools_callargs.h',
'libcef/browser_devtools_client.cc',
'libcef/browser_devtools_client.h',
'libcef/browser_devtools_scheme_handler.cc',
'libcef/browser_devtools_scheme_handler.h',
'libcef/browser_file_system.cc',
'libcef/browser_file_system.h',
'libcef/browser_file_writer.cc',
'libcef/browser_file_writer.h',
'libcef/browser_impl.cc',
'libcef/browser_impl.h',
'libcef/browser_navigation_controller.cc',
'libcef/browser_navigation_controller.h',
'libcef/browser_persistent_cookie_store.cc',
'libcef/browser_persistent_cookie_store.h',
'libcef/browser_request_context.cc',
'libcef/browser_request_context.h',
'libcef/browser_request_context_proxy.cc',
'libcef/browser_request_context_proxy.h',
'libcef/browser_resource_loader_bridge.cc',
'libcef/browser_resource_loader_bridge.h',
'libcef/browser_settings.cc',
'libcef/browser_settings.h',
'libcef/browser_socket_stream_bridge.cc',
'libcef/browser_socket_stream_bridge.h',
'libcef/browser_thread_stub.cc',
'libcef/browser_webcookiejar_impl.cc',
'libcef/browser_webcookiejar_impl.h',
'libcef/browser_webblobregistry_impl.cc',
'libcef/browser_webblobregistry_impl.h',
'libcef/browser_webstoragearea_impl.cc',
'libcef/browser_webstoragearea_impl.h',
'libcef/browser_webstoragenamespace_impl.cc',
'libcef/browser_webstoragenamespace_impl.h',
'libcef/browser_webkit_glue.cc',
'libcef/browser_webkit_glue.h',
'libcef/browser_webkit_init.cc',
'libcef/browser_webkit_init.h',
'libcef/browser_webview_delegate.cc',
'libcef/browser_webview_delegate.h',
'libcef/browser_zoom_map.cc',
'libcef/browser_zoom_map.h',
'libcef/cef_context.cc',
'libcef/cef_context.h',
'libcef/cef_process.cc',
'libcef/cef_process.h',
'libcef/cef_process_io_thread.cc',
'libcef/cef_process_io_thread.h',
'libcef/cef_process_sub_thread.cc',
'libcef/cef_process_sub_thread.h',
'libcef/cef_process_ui_thread.cc',
'libcef/cef_process_ui_thread.h',
'libcef/cef_string_list.cc',
'libcef/cef_string_map.cc',
'libcef/cef_string_multimap.cc',
'libcef/cef_string_types.cc',
'libcef/cef_thread.cc',
'libcef/cef_thread.h',
'libcef/cef_time.cc',
'libcef/cef_time_util.h',
'libcef/command_line_impl.cc',
'libcef/cookie_manager_impl.cc',
'libcef/cookie_manager_impl.h',
'libcef/cookie_store_proxy.cc',
'libcef/cookie_store_proxy.h',
'libcef/drag_data_impl.cc',
'libcef/drag_data_impl.h',
'libcef/drag_download_file.cc',
'libcef/drag_download_file.h',
'libcef/drag_download_util.cc',
'libcef/drag_download_util.h',
'libcef/dom_storage_area.cc',
'libcef/dom_storage_area.h',
'libcef/dom_storage_common.h',
'libcef/dom_storage_context.cc',
'libcef/dom_storage_context.h',
'libcef/dom_storage_namespace.cc',
'libcef/dom_storage_namespace.h',
'libcef/dom_document_impl.cc',
'libcef/dom_document_impl.h',
'libcef/dom_event_impl.cc',
'libcef/dom_event_impl.h',
'libcef/dom_node_impl.cc',
'libcef/dom_node_impl.h',
'libcef/download_util.cc',
'libcef/download_util.h',
'libcef/external_protocol_handler.h',
'libcef/geolocation_client.cc',
'libcef/geolocation_client.h',
'libcef/http_header_utils.cc',
'libcef/http_header_utils.h',
'libcef/origin_whitelist_impl.cc',
'libcef/request_impl.cc',
'libcef/request_impl.h',
'libcef/response_impl.cc',
'libcef/response_impl.h',
'libcef/scheme_impl.cc',
'libcef/simple_clipboard_impl.cc',
'libcef/simple_clipboard_impl.h',
'libcef/stream_impl.cc',
'libcef/stream_impl.h',
'libcef/tracker.h',
'libcef/v8_impl.cc',
'libcef/v8_impl.h',
'libcef/web_plugin_impl.cc',
'libcef/web_urlrequest_impl.cc',
'libcef/web_urlrequest_impl.h',
'libcef/webview_host.cc',
'libcef/webview_host.h',
'libcef/webwidget_host.cc',
'libcef/webwidget_host.h',
'libcef/xml_reader_impl.cc',
'libcef/xml_reader_impl.h',
'libcef/zip_reader_impl.cc',
'libcef/zip_reader_impl.h',
# DevTools resource IDs generated by grit
'<(grit_out_dir)/grit/devtools_resources_map.cc',
# Geolocation implementation
'../content/browser/cancelable_request.cc',
'../content/browser/geolocation/access_token_store.cc',
'../content/browser/geolocation/device_data_provider.cc',
'../content/browser/geolocation/empty_device_data_provider.cc',
'../content/browser/geolocation/geolocation_provider.cc',
'../content/browser/geolocation/location_arbitrator.cc',
'../content/browser/geolocation/location_provider.cc',
'../content/browser/geolocation/network_location_provider.cc',
'../content/browser/geolocation/network_location_request.cc',
'../content/browser/geolocation/wifi_data_provider_common.cc',
'../content/common/geoposition.cc',
'../content/common/net/url_fetcher_impl.cc',
],
'conditions': [
['OS=="win"', {
'dependencies': [
'../breakpad/breakpad.gyp:breakpad_handler',
'../third_party/angle/src/build_angle.gyp:libEGL',
'../third_party/angle/src/build_angle.gyp:libGLESv2',
'../ui/views/views.gyp:views',
],
'sources': [
'<@(includes_win)',
'libcef/browser_drag_delegate_win.cc',
'libcef/browser_drag_delegate_win.h',
'libcef/browser_impl_win.cc',
'libcef/browser_webkit_glue_win.cc',
'libcef/browser_webview_delegate_win.cc',
'libcef/cef_process_ui_thread_win.cc',
'libcef/external_protocol_handler_win.cc',
'libcef/printing/print_settings.cc',
'libcef/printing/print_settings.h',
'libcef/printing/win_printing_context.cc',
'libcef/printing/win_printing_context.h',
'libcef/web_drag_source_win.cc',
'libcef/web_drag_source_win.h',
'libcef/web_drag_utils_win.cc',
'libcef/web_drag_utils_win.h',
'libcef/web_drop_target_win.cc',
'libcef/web_drop_target_win.h',
'libcef/webview_host_win.cc',
'libcef/webwidget_host_win.cc',
# Geolocation implementation
'../content/browser/geolocation/wifi_data_provider_common_win.cc',
'../content/browser/geolocation/wifi_data_provider_win.cc',
'../content/browser/geolocation/win7_location_api_win.cc',
'../content/browser/geolocation/win7_location_provider_win.cc',
],
}],
[ 'OS=="mac"', {
'sources': [
'<@(includes_mac)',
'libcef/browser_impl_mac.mm',
'libcef/browser_webkit_glue_mac.mm',
'libcef/browser_webview_delegate_mac.mm',
'libcef/browser_webview_mac.h',
'libcef/browser_webview_mac.mm',
'libcef/cef_process_ui_thread_mac.mm',
'libcef/external_popup_menu_mac.h',
'libcef/external_popup_menu_mac.mm',
'libcef/external_protocol_handler_mac.mm',
'libcef/webview_host_mac.mm',
'libcef/webwidget_host_mac.mm',
'libcef/web_drag_source_mac.h',
'libcef/web_drag_source_mac.mm',
'libcef/web_drag_utils_mac.h',
'libcef/web_drag_utils_mac.mm',
'libcef/web_drop_target_mac.h',
'libcef/web_drop_target_mac.mm',
# Necessary Mozilla sources
'../third_party/mozilla/NSPasteboard+Utils.h',
'../third_party/mozilla/NSPasteboard+Utils.mm',
'../third_party/mozilla/NSString+Utils.h',
'../third_party/mozilla/NSString+Utils.mm',
'../third_party/mozilla/NSURL+Utils.h',
'../third_party/mozilla/NSURL+Utils.m',
# Geolocation implementation
'../content/browser/geolocation/core_location_data_provider_mac.mm',
'../content/browser/geolocation/core_location_provider_mac.mm',
'../content/browser/geolocation/wifi_data_provider_corewlan_mac.mm',
'../content/browser/geolocation/wifi_data_provider_mac.cc',
],
}],
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'dependencies': [
'../build/linux/system.gyp:dbus',
'../dbus/dbus.gyp:dbus',
],
'sources': [
'<@(includes_linux)',
'libcef/browser_impl_gtk.cc',
'libcef/browser_webkit_glue_gtk.cc',
'libcef/browser_webview_delegate_gtk.cc',
'libcef/cef_process_ui_thread_gtk.cc',
'libcef/external_protocol_handler_gtk.cc',
'libcef/webview_host_gtk.cc',
'libcef/webwidget_host_gtk.cc',
# Geolocation implementation
'../content/browser/geolocation/gps_location_provider_linux.cc',
'../content/browser/geolocation/libgps_wrapper_linux.cc',
'../content/browser/geolocation/wifi_data_provider_linux.cc',
],
}],
],
},
]
}

View File

@@ -1,24 +0,0 @@
# Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
{
'variables': {
'conditions': [
# Directory for CEF source files.
[ 'OS=="win"', {
'cef_directory' : '<!(echo %CEF_DIRECTORY%)',
# Keep the build output in the CEF directory.
'build_dir_prefix': '..\\<!(echo %CEF_DIRECTORY%)\\',
# Use SKIA text rendering for transparency support.
'enable_skia_text': 1,
}, { # OS!="win"
'cef_directory' : '<!(echo $CEF_DIRECTORY)',
}],
[ 'OS=="mac"', {
# Don't use the chrome style plugin with CEF.
'clang_use_chrome_plugins': 0,
}],
]
},
}

View File

@@ -1,2 +1,2 @@
@echo off
..\third_party\python_26\python.exe tools\gclient_hook.py
python3.bat tools\gclient_hook.py

View File

@@ -1,2 +1,2 @@
#!/bin/sh
python tools/gclient_hook.py
python3 tools/gclient_hook.py

File diff suppressed because it is too large Load Diff

659
cef_paths2.gypi Normal file
View File

@@ -0,0 +1,659 @@
# Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
{
'variables': {
'includes_common': [
'include/base/cef_atomic_flag.h',
'include/base/cef_atomic_ref_count.h',
'include/base/cef_auto_reset.h',
'include/base/cef_bind.h',
'include/base/cef_build.h',
'include/base/cef_callback.h',
'include/base/cef_callback_forward.h',
'include/base/cef_callback_helpers.h',
'include/base/cef_callback_list.h',
'include/base/cef_cancelable_callback.h',
'include/base/cef_compiler_specific.h',
'include/base/cef_lock.h',
'include/base/cef_logging.h',
'include/base/cef_macros.h',
'include/base/cef_platform_thread.h',
'include/base/cef_ref_counted.h',
'include/base/cef_scoped_refptr.h',
'include/base/cef_thread_checker.h',
'include/base/cef_trace_event.h',
'include/base/cef_tuple.h',
'include/base/cef_weak_ptr.h',
'include/base/internal/cef_bind_internal.h',
'include/base/internal/cef_callback_internal.h',
'include/base/internal/cef_color_id_macros.inc',
'include/base/internal/cef_lock_impl.h',
'include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h',
'include/base/internal/cef_scoped_policy.h',
'include/base/internal/cef_thread_checker_impl.h',
'include/cef_api_hash.h',
'include/cef_base.h',
'include/cef_version.h',
'include/internal/cef_export.h',
'include/internal/cef_ptr.h',
'include/internal/cef_string_wrappers.h',
'include/internal/cef_time_wrappers.h',
'include/internal/cef_types_wrappers.h',
],
'includes_common_capi': [
'include/internal/cef_logging_internal.h',
'include/internal/cef_string.h',
'include/internal/cef_string_list.h',
'include/internal/cef_string_map.h',
'include/internal/cef_string_multimap.h',
'include/internal/cef_string_types.h',
'include/internal/cef_thread_internal.h',
'include/internal/cef_time.h',
'include/internal/cef_trace_event_internal.h',
'include/internal/cef_types.h',
'include/internal/cef_types_content_settings.h',
'include/internal/cef_types_geometry.h',
'include/internal/cef_types_runtime.h',
'include/internal/cef_types_color.h',
],
'includes_capi': [
'include/capi/cef_base_capi.h',
],
'includes_wrapper': [
'include/wrapper/cef_byte_read_handler.h',
'include/wrapper/cef_closure_task.h',
'include/wrapper/cef_helpers.h',
'include/wrapper/cef_message_router.h',
'include/wrapper/cef_resource_manager.h',
'include/wrapper/cef_scoped_temp_dir.h',
'include/wrapper/cef_stream_resource_handler.h',
'include/wrapper/cef_xml_object.h',
'include/wrapper/cef_zip_archive.h',
],
'includes_wrapper_mac': [
'include/wrapper/cef_library_loader.h',
],
'includes_win': [
'include/cef_sandbox_win.h',
'include/internal/cef_win.h',
],
'includes_win_capi': [
'include/internal/cef_app_win.h',
'include/internal/cef_types_win.h',
],
'includes_mac': [
'include/base/cef_scoped_typeref_mac.h',
'include/base/internal/cef_scoped_block_mac.h',
'include/cef_application_mac.h',
'include/cef_sandbox_mac.h',
'include/internal/cef_mac.h',
],
'includes_mac_capi': [
'include/internal/cef_types_mac.h',
],
'includes_linux': [
'include/internal/cef_linux.h',
],
'includes_linux_capi': [
'include/internal/cef_types_linux.h',
],
'libcef_sources_common': [
'libcef_dll/cpptoc/cpptoc_ref_counted.h',
'libcef_dll/cpptoc/cpptoc_scoped.h',
'libcef_dll/ctocpp/base_ref_counted_ctocpp.cc',
'libcef_dll/ctocpp/base_ref_counted_ctocpp.h',
'libcef_dll/ctocpp/base_scoped_ctocpp.cc',
'libcef_dll/ctocpp/base_scoped_ctocpp.h',
'libcef_dll/ctocpp/ctocpp_ref_counted.h',
'libcef_dll/ctocpp/ctocpp_scoped.h',
'libcef_dll/libcef_dll.cc',
'libcef_dll/libcef_dll2.cc',
'libcef_dll/ptr_util.h',
'libcef_dll/resource.h',
'libcef_dll/shutdown_checker.cc',
'libcef_dll/shutdown_checker.h',
'libcef_dll/template_util.h',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',
],
'libcef_dll_wrapper_sources_base': [
'libcef_dll/base/cef_atomic_flag.cc',
'libcef_dll/base/cef_callback_helpers.cc',
'libcef_dll/base/cef_callback_internal.cc',
'libcef_dll/base/cef_lock.cc',
'libcef_dll/base/cef_lock_impl.cc',
'libcef_dll/base/cef_logging.cc',
'libcef_dll/base/cef_ref_counted.cc',
'libcef_dll/base/cef_thread_checker_impl.cc',
'libcef_dll/base/cef_weak_ptr.cc',
],
'libcef_dll_wrapper_sources_common': [
'libcef_dll/cpptoc/base_ref_counted_cpptoc.cc',
'libcef_dll/cpptoc/base_ref_counted_cpptoc.h',
'libcef_dll/cpptoc/base_scoped_cpptoc.cc',
'libcef_dll/cpptoc/base_scoped_cpptoc.h',
'libcef_dll/cpptoc/cpptoc_ref_counted.h',
'libcef_dll/cpptoc/cpptoc_scoped.h',
'libcef_dll/ctocpp/ctocpp_ref_counted.h',
'libcef_dll/ctocpp/ctocpp_scoped.h',
'libcef_dll/shutdown_checker.cc',
'libcef_dll/shutdown_checker.h',
'libcef_dll/template_util.h',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',
'libcef_dll/wrapper/cef_browser_info_map.h',
'libcef_dll/wrapper/cef_byte_read_handler.cc',
'libcef_dll/wrapper/cef_closure_task.cc',
'libcef_dll/wrapper/cef_message_router.cc',
'libcef_dll/wrapper/cef_message_router_utils.cc',
'libcef_dll/wrapper/cef_message_router_utils.h',
'libcef_dll/wrapper/cef_resource_manager.cc',
'libcef_dll/wrapper/cef_scoped_temp_dir.cc',
'libcef_dll/wrapper/cef_stream_resource_handler.cc',
'libcef_dll/wrapper/cef_xml_object.cc',
'libcef_dll/wrapper/cef_zip_archive.cc',
'libcef_dll/wrapper/libcef_dll_wrapper.cc',
'libcef_dll/wrapper/libcef_dll_wrapper2.cc',
],
'libcef_dll_wrapper_sources_mac': [
'libcef_dll/wrapper/cef_library_loader_mac.mm',
'libcef_dll/wrapper/libcef_dll_dylib.cc',
],
'shared_sources_browser': [
'tests/shared/browser/client_app_browser.cc',
'tests/shared/browser/client_app_browser.h',
'tests/shared/browser/file_util.cc',
'tests/shared/browser/file_util.h',
'tests/shared/browser/geometry_util.cc',
'tests/shared/browser/geometry_util.h',
'tests/shared/browser/main_message_loop.cc',
'tests/shared/browser/main_message_loop.h',
'tests/shared/browser/main_message_loop_external_pump.cc',
'tests/shared/browser/main_message_loop_external_pump.h',
'tests/shared/browser/main_message_loop_std.cc',
'tests/shared/browser/main_message_loop_std.h',
'tests/shared/browser/resource_util.h',
],
'shared_sources_common': [
'tests/shared/common/binary_value_utils.cc',
'tests/shared/common/binary_value_utils.h',
'tests/shared/common/client_app.cc',
'tests/shared/common/client_app.h',
'tests/shared/common/client_app_other.cc',
'tests/shared/common/client_app_other.h',
'tests/shared/common/client_switches.cc',
'tests/shared/common/client_switches.h',
'tests/shared/common/string_util.cc',
'tests/shared/common/string_util.h',
],
'shared_sources_renderer': [
'tests/shared/renderer/client_app_renderer.cc',
'tests/shared/renderer/client_app_renderer.h',
],
'shared_sources_resources': [
'tests/shared/resources/osr_test.html',
'tests/shared/resources/pdf.html',
'tests/shared/resources/pdf.pdf',
'tests/shared/resources/window_icon.1x.png',
'tests/shared/resources/window_icon.2x.png',
],
'shared_sources_linux': [
'tests/shared/browser/main_message_loop_external_pump_linux.cc',
'tests/shared/browser/resource_util_posix.cc',
],
'shared_sources_mac': [
'tests/shared/browser/main_message_loop_external_pump_mac.mm',
'tests/shared/browser/resource_util_mac.mm',
'tests/shared/browser/resource_util_posix.cc',
],
'shared_sources_mac_helper': [
'tests/shared/process_helper_mac.cc',
],
'shared_sources_win': [
'tests/shared/browser/main_message_loop_external_pump_win.cc',
'tests/shared/browser/resource_util_win.cc',
'tests/shared/browser/util_win.cc',
'tests/shared/browser/util_win.h',
],
'cefclient_sources_browser': [
'tests/cefclient/browser/base_client_handler.cc',
'tests/cefclient/browser/base_client_handler.h',
'tests/cefclient/browser/binary_transfer_test.cc',
'tests/cefclient/browser/binary_transfer_test.h',
'tests/cefclient/browser/binding_test.cc',
'tests/cefclient/browser/binding_test.h',
'tests/cefclient/browser/browser_window.cc',
'tests/cefclient/browser/browser_window.h',
'tests/cefclient/browser/bytes_write_handler.cc',
'tests/cefclient/browser/bytes_write_handler.h',
'tests/cefclient/browser/client_app_delegates_browser.cc',
'tests/cefclient/browser/client_browser.cc',
'tests/cefclient/browser/client_browser.h',
'tests/cefclient/browser/client_handler.cc',
'tests/cefclient/browser/client_handler.h',
'tests/cefclient/browser/client_handler_osr.cc',
'tests/cefclient/browser/client_handler_osr.h',
'tests/cefclient/browser/client_handler_std.cc',
'tests/cefclient/browser/client_handler_std.h',
'tests/cefclient/browser/client_prefs.cc',
'tests/cefclient/browser/client_prefs.h',
'tests/cefclient/browser/client_types.h',
'tests/cefclient/browser/default_client_handler.h',
'tests/cefclient/browser/dialog_test.cc',
'tests/cefclient/browser/dialog_test.h',
'tests/cefclient/browser/hang_test.cc',
'tests/cefclient/browser/hang_test.h',
'tests/cefclient/browser/image_cache.cc',
'tests/cefclient/browser/image_cache.h',
'tests/cefclient/browser/main_context.cc',
'tests/cefclient/browser/main_context.h',
'tests/cefclient/browser/main_context_impl.cc',
'tests/cefclient/browser/main_context_impl.h',
'tests/cefclient/browser/media_router_test.cc',
'tests/cefclient/browser/media_router_test.h',
'tests/cefclient/browser/osr_dragdrop_events.h',
'tests/cefclient/browser/osr_renderer.h',
'tests/cefclient/browser/osr_renderer.cc',
'tests/cefclient/browser/osr_renderer_settings.h',
'tests/cefclient/browser/preferences_test.cc',
'tests/cefclient/browser/preferences_test.h',
'tests/cefclient/browser/resource.h',
'tests/cefclient/browser/response_filter_test.cc',
'tests/cefclient/browser/response_filter_test.h',
'tests/cefclient/browser/root_window.cc',
'tests/cefclient/browser/root_window.h',
'tests/cefclient/browser/root_window_create.cc',
'tests/cefclient/browser/root_window_manager.cc',
'tests/cefclient/browser/root_window_manager.h',
'tests/cefclient/browser/root_window_views.cc',
'tests/cefclient/browser/root_window_views.h',
'tests/cefclient/browser/scheme_test.cc',
'tests/cefclient/browser/scheme_test.h',
'tests/cefclient/browser/server_test.cc',
'tests/cefclient/browser/server_test.h',
'tests/cefclient/browser/temp_window.h',
'tests/cefclient/browser/test_runner.cc',
'tests/cefclient/browser/test_runner.h',
'tests/cefclient/browser/urlrequest_test.cc',
'tests/cefclient/browser/urlrequest_test.h',
'tests/cefclient/browser/views_menu_bar.cc',
'tests/cefclient/browser/views_menu_bar.h',
'tests/cefclient/browser/views_overlay_controls.cc',
'tests/cefclient/browser/views_overlay_controls.h',
'tests/cefclient/browser/views_style.cc',
'tests/cefclient/browser/views_style.h',
'tests/cefclient/browser/views_window.cc',
'tests/cefclient/browser/views_window.h',
'tests/cefclient/browser/window_test.cc',
'tests/cefclient/browser/window_test.h',
'tests/cefclient/browser/window_test_runner.cc',
'tests/cefclient/browser/window_test_runner.h',
'tests/cefclient/browser/window_test_runner_views.cc',
'tests/cefclient/browser/window_test_runner_views.h',
],
'cefclient_sources_common': [
'tests/cefclient/common/client_app_delegates_common.cc',
'tests/cefclient/common/scheme_test_common.cc',
'tests/cefclient/common/scheme_test_common.h',
],
'cefclient_sources_renderer': [
'tests/cefclient/renderer/client_app_delegates_renderer.cc',
'tests/cefclient/renderer/client_renderer.cc',
'tests/cefclient/renderer/client_renderer.h',
'tests/cefclient/renderer/ipc_performance_test.cc',
'tests/cefclient/renderer/ipc_performance_test.h',
'tests/cefclient/renderer/performance_test.cc',
'tests/cefclient/renderer/performance_test.h',
'tests/cefclient/renderer/performance_test_setup.h',
'tests/cefclient/renderer/performance_test_tests.cc',
],
'cefclient_sources_resources': [
'tests/cefclient/resources/binary_transfer.html',
'tests/cefclient/resources/binding.html',
'tests/cefclient/resources/dialogs.html',
'tests/cefclient/resources/draggable.html',
'tests/cefclient/resources/hang.html',
'tests/cefclient/resources/ipc_performance.html',
'tests/cefclient/resources/localstorage.html',
'tests/cefclient/resources/logo.png',
'tests/cefclient/resources/media_router.html',
'tests/cefclient/resources/menu_icon.1x.png',
'tests/cefclient/resources/menu_icon.2x.png',
'tests/cefclient/resources/other_tests.html',
'tests/cefclient/resources/performance.html',
'tests/cefclient/resources/performance2.html',
'tests/cefclient/resources/preferences.html',
'tests/cefclient/resources/response_filter.html',
'tests/cefclient/resources/server.html',
'tests/cefclient/resources/transparency.html',
'tests/cefclient/resources/urlrequest.html',
'tests/cefclient/resources/websocket.html',
'tests/cefclient/resources/window.html',
'tests/cefclient/resources/xmlhttprequest.html',
],
'cefclient_sources_win': [
'tests/cefclient/browser/browser_window_osr_win.cc',
'tests/cefclient/browser/browser_window_osr_win.h',
'tests/cefclient/browser/browser_window_std_win.cc',
'tests/cefclient/browser/browser_window_std_win.h',
'tests/cefclient/browser/main_context_impl_win.cc',
'tests/cefclient/browser/main_message_loop_multithreaded_win.cc',
'tests/cefclient/browser/main_message_loop_multithreaded_win.h',
'tests/cefclient/browser/osr_accessibility_helper.cc',
'tests/cefclient/browser/osr_accessibility_helper.h',
'tests/cefclient/browser/osr_accessibility_node.cc',
'tests/cefclient/browser/osr_accessibility_node.h',
'tests/cefclient/browser/osr_accessibility_node_win.cc',
'tests/cefclient/browser/osr_dragdrop_win.cc',
'tests/cefclient/browser/osr_dragdrop_win.h',
'tests/cefclient/browser/osr_ime_handler_win.cc',
'tests/cefclient/browser/osr_ime_handler_win.h',
'tests/cefclient/browser/osr_d3d11_win.cc',
'tests/cefclient/browser/osr_d3d11_win.h',
'tests/cefclient/browser/osr_render_handler_win.cc',
'tests/cefclient/browser/osr_render_handler_win.h',
'tests/cefclient/browser/osr_render_handler_win_d3d11.cc',
'tests/cefclient/browser/osr_render_handler_win_d3d11.h',
'tests/cefclient/browser/osr_render_handler_win_gl.cc',
'tests/cefclient/browser/osr_render_handler_win_gl.h',
'tests/cefclient/browser/osr_window_win.cc',
'tests/cefclient/browser/osr_window_win.h',
'tests/cefclient/browser/resource_util_win_idmap.cc',
'tests/cefclient/browser/root_window_win.cc',
'tests/cefclient/browser/root_window_win.h',
'tests/cefclient/browser/temp_window_win.cc',
'tests/cefclient/browser/temp_window_win.h',
'tests/cefclient/browser/window_test_runner_win.cc',
'tests/cefclient/browser/window_test_runner_win.h',
'tests/cefclient/cefclient_win.cc',
'tests/cefclient/resources/win/cefclient.rc',
],
'cefclient_sources_resources_win': [
'tests/cefclient/resources/win/cefclient.exe.manifest',
'tests/cefclient/resources/win/cefclient.ico',
'tests/cefclient/resources/win/small.ico',
],
'cefclient_sources_mac': [
'tests/cefclient/browser/browser_window_osr_mac.h',
'tests/cefclient/browser/browser_window_osr_mac.mm',
'tests/cefclient/browser/browser_window_std_mac.h',
'tests/cefclient/browser/browser_window_std_mac.mm',
'tests/cefclient/browser/main_context_impl_posix.cc',
'tests/cefclient/browser/osr_accessibility_helper.cc',
'tests/cefclient/browser/osr_accessibility_helper.h',
'tests/cefclient/browser/osr_accessibility_node.cc',
'tests/cefclient/browser/osr_accessibility_node.h',
'tests/cefclient/browser/osr_accessibility_node_mac.mm',
'tests/cefclient/browser/root_window_mac.h',
'tests/cefclient/browser/root_window_mac.mm',
'tests/cefclient/browser/temp_window_mac.h',
'tests/cefclient/browser/temp_window_mac.mm',
'tests/cefclient/browser/text_input_client_osr_mac.h',
'tests/cefclient/browser/text_input_client_osr_mac.mm',
'tests/cefclient/browser/views_window_mac.mm',
'tests/cefclient/browser/window_test_runner_mac.h',
'tests/cefclient/browser/window_test_runner_mac.mm',
'tests/cefclient/cefclient_mac.mm',
],
'cefclient_bundle_resources_mac': [
'tests/cefclient/resources/mac/cefclient.icns',
'tests/cefclient/resources/mac/English.lproj/InfoPlist.strings',
'tests/cefclient/resources/mac/English.lproj/MainMenu.xib',
'tests/cefclient/resources/mac/Info.plist',
],
'cefclient_sources_linux': [
'tests/cefclient/browser/browser_window_osr_gtk.cc',
'tests/cefclient/browser/browser_window_osr_gtk.h',
'tests/cefclient/browser/browser_window_std_gtk.cc',
'tests/cefclient/browser/browser_window_std_gtk.h',
'tests/cefclient/browser/dialog_handler_gtk.cc',
'tests/cefclient/browser/dialog_handler_gtk.h',
'tests/cefclient/browser/main_context_impl_posix.cc',
'tests/cefclient/browser/main_message_loop_multithreaded_gtk.cc',
'tests/cefclient/browser/main_message_loop_multithreaded_gtk.h',
'tests/cefclient/browser/print_handler_gtk.cc',
'tests/cefclient/browser/print_handler_gtk.h',
'tests/cefclient/browser/resource_util_linux.cc',
'tests/cefclient/browser/root_window_gtk.cc',
'tests/cefclient/browser/root_window_gtk.h',
'tests/cefclient/browser/temp_window_x11.cc',
'tests/cefclient/browser/temp_window_x11.h',
'tests/cefclient/browser/util_gtk.cc',
'tests/cefclient/browser/util_gtk.h',
'tests/cefclient/browser/window_test_runner_gtk.cc',
'tests/cefclient/browser/window_test_runner_gtk.h',
'tests/cefclient/cefclient_gtk.cc',
],
'cefsimple_sources_common': [
'tests/cefsimple/simple_app.cc',
'tests/cefsimple/simple_app.h',
'tests/cefsimple/simple_handler.cc',
'tests/cefsimple/simple_handler.h',
],
'cefsimple_sources_win': [
'tests/cefsimple/cefsimple.rc',
'tests/cefsimple/cefsimple_win.cc',
'tests/cefsimple/simple_handler_win.cc',
'tests/cefsimple/resource.h',
],
'cefsimple_sources_resources_win': [
'tests/cefsimple/cefsimple.exe.manifest',
'tests/cefsimple/res/cefsimple.ico',
'tests/cefsimple/res/small.ico',
],
'cefsimple_sources_mac': [
'tests/cefsimple/cefsimple_mac.mm',
'tests/cefsimple/simple_handler_mac.mm',
],
'cefsimple_sources_mac_helper': [
'tests/cefsimple/process_helper_mac.cc',
],
'cefsimple_bundle_resources_mac': [
'tests/cefsimple/mac/cefsimple.icns',
'tests/cefsimple/mac/English.lproj/InfoPlist.strings',
'tests/cefsimple/mac/English.lproj/MainMenu.xib',
'tests/cefsimple/mac/Info.plist',
],
'cefsimple_sources_linux': [
'tests/cefsimple/cefsimple_linux.cc',
'tests/cefsimple/simple_handler_linux.cc',
],
'ceftests_data_resources': [
'tests/ceftests/resources/net/data/ssl/certificates/expired_cert.pem',
'tests/ceftests/resources/net/data/ssl/certificates/localhost_cert.pem',
'tests/ceftests/resources/net/data/ssl/certificates/ok_cert.pem',
'tests/ceftests/resources/net/data/ssl/certificates/root_ca_cert.pem',
],
'ceftests_sources_common': [
'tests/ceftests/audio_output_unittest.cc',
'tests/ceftests/browser_info_map_unittest.cc',
'tests/ceftests/certificate_error_unittest.cc',
'tests/ceftests/command_line_unittest.cc',
'tests/ceftests/cookie_unittest.cc',
'tests/ceftests/cors_unittest.cc',
'tests/ceftests/devtools_message_unittest.cc',
'tests/ceftests/dialog_unittest.cc',
'tests/ceftests/display_unittest.cc',
'tests/ceftests/dom_unittest.cc',
'tests/ceftests/download_unittest.cc',
'tests/ceftests/draggable_regions_unittest.cc',
'tests/ceftests/file_util_unittest.cc',
'tests/ceftests/frame_handler_unittest.cc',
'tests/ceftests/frame_unittest.cc',
'tests/ceftests/hsts_redirect_unittest.cc',
'tests/ceftests/image_unittest.cc',
'tests/ceftests/image_util.cc',
'tests/ceftests/image_util.h',
'tests/ceftests/jsdialog_unittest.cc',
'tests/ceftests/life_span_unittest.cc',
'tests/ceftests/media_access_unittest.cc',
'tests/ceftests/message_router_binary_unittest.cc',
'tests/ceftests/message_router_harness_unittest.cc',
'tests/ceftests/message_router_multi_query_unittest.cc',
'tests/ceftests/message_router_single_query_unittest.cc',
'tests/ceftests/message_router_threshold_unittest.cc',
'tests/ceftests/message_router_unittest_utils.cc',
'tests/ceftests/message_router_unittest_utils.h',
'tests/ceftests/navigation_unittest.cc',
'tests/ceftests/os_rendering_unittest.cc',
'tests/ceftests/osr_accessibility_unittest.cc',
'tests/ceftests/osr_display_unittest.cc',
'tests/ceftests/parser_unittest.cc',
'tests/ceftests/pdf_viewer_unittest.cc',
'tests/ceftests/permission_prompt_unittest.cc',
'tests/ceftests/preference_unittest.cc',
'tests/ceftests/print_unittest.cc',
'tests/ceftests/process_message_unittest.cc',
'tests/ceftests/request_context_unittest.cc',
'tests/ceftests/request_handler_unittest.cc',
'tests/ceftests/request_unittest.cc',
'tests/ceftests/response_unittest.cc',
'tests/ceftests/resource.h',
'tests/ceftests/resource_manager_unittest.cc',
'tests/ceftests/resource_request_handler_unittest.cc',
'tests/ceftests/routing_test_handler.cc',
'tests/ceftests/routing_test_handler.h',
'tests/ceftests/run_all_unittests.cc',
'tests/ceftests/scheme_handler_unittest.cc',
'tests/ceftests/scoped_temp_dir_unittest.cc',
'tests/ceftests/server_unittest.cc',
'tests/ceftests/send_shared_process_message_unittest.cc',
"tests/ceftests/shared_process_message_unittest.cc",
'tests/ceftests/stream_unittest.cc',
'tests/ceftests/stream_resource_handler_unittest.cc',
'tests/ceftests/string_unittest.cc',
'tests/ceftests/client_app_delegates.cc',
'tests/ceftests/task_unittest.cc',
'tests/ceftests/test_handler.cc',
'tests/ceftests/test_handler.h',
'tests/ceftests/test_request.cc',
'tests/ceftests/test_request.h',
'tests/ceftests/test_server.cc',
'tests/ceftests/test_server.h',
'tests/ceftests/test_server_observer.h',
'tests/ceftests/test_server_observer.cc',
'tests/ceftests/test_server_observer_unittest.cc',
'tests/ceftests/test_server_manager.h',
'tests/ceftests/test_server_manager.cc',
'tests/ceftests/test_server_runner.h',
'tests/ceftests/test_server_runner.cc',
'tests/ceftests/test_server_runner_normal.cc',
'tests/ceftests/test_server_runner_test.cc',
'tests/ceftests/test_server_unittest.cc',
'tests/ceftests/test_suite.cc',
'tests/ceftests/test_suite.h',
'tests/ceftests/test_util.cc',
'tests/ceftests/test_util.h',
'tests/ceftests/time_unittest.cc',
'tests/ceftests/thread_helper.cc',
'tests/ceftests/thread_helper.h',
'tests/ceftests/thread_unittest.cc',
'tests/ceftests/tracing_unittest.cc',
'tests/ceftests/track_callback.h',
'tests/ceftests/translator_unittest.cc',
'tests/ceftests/urlrequest_unittest.cc',
'tests/ceftests/v8_unittest.cc',
'tests/ceftests/values_unittest.cc',
'tests/ceftests/version_unittest.cc',
'tests/ceftests/views/button_unittest.cc',
'tests/ceftests/views/panel_unittest.cc',
'tests/ceftests/views/scroll_view_unittest.cc',
'tests/ceftests/views/test_window_delegate.cc',
'tests/ceftests/views/test_window_delegate.h',
'tests/ceftests/views/textfield_unittest.cc',
'tests/ceftests/views/window_unittest.cc',
'tests/ceftests/waitable_event_unittest.cc',
'tests/ceftests/webui_unittest.cc',
'tests/ceftests/xml_reader_unittest.cc',
'tests/ceftests/zip_reader_unittest.cc',
],
'ceftests_sources_win': [
'tests/ceftests/resource_util_win_dir.cc',
'tests/ceftests/resource_util_win_idmap.cc',
'tests/ceftests/resources/win/ceftests.rc',
],
'ceftests_sources_resources_win': [
'tests/ceftests/resources/win/ceftests.exe.manifest',
'tests/ceftests/resources/win/ceftests.ico',
'tests/ceftests/resources/win/small.ico',
],
'ceftests_sources_mac': [
'tests/ceftests/os_rendering_unittest_mac.h',
'tests/ceftests/os_rendering_unittest_mac.mm',
'tests/ceftests/run_all_unittests_mac.mm',
],
'ceftests_sources_mac_helper': [
'tests/shared/browser/file_util.cc',
'tests/shared/browser/file_util.h',
'tests/shared/browser/resource_util.h',
'tests/shared/browser/resource_util_mac.mm',
'tests/shared/browser/resource_util_posix.cc',
'tests/ceftests/audio_output_unittest.cc',
'tests/ceftests/client_app_delegates.cc',
'tests/ceftests/cookie_unittest.cc',
'tests/ceftests/cors_unittest.cc',
'tests/ceftests/dom_unittest.cc',
'tests/ceftests/frame_unittest.cc',
'tests/ceftests/media_access_unittest.cc',
'tests/ceftests/message_router_binary_unittest.cc',
'tests/ceftests/message_router_harness_unittest.cc',
'tests/ceftests/message_router_multi_query_unittest.cc',
'tests/ceftests/message_router_single_query_unittest.cc',
'tests/ceftests/message_router_threshold_unittest.cc',
'tests/ceftests/message_router_unittest_utils.cc',
'tests/ceftests/message_router_unittest_utils.h',
'tests/ceftests/navigation_unittest.cc',
'tests/ceftests/pdf_viewer_unittest.cc',
'tests/ceftests/permission_prompt_unittest.cc',
'tests/ceftests/preference_unittest.cc',
'tests/ceftests/process_message_unittest.cc',
'tests/ceftests/request_handler_unittest.cc',
'tests/ceftests/request_unittest.cc',
'tests/ceftests/response_unittest.cc',
'tests/ceftests/resource_request_handler_unittest.cc',
'tests/ceftests/routing_test_handler.cc',
'tests/ceftests/routing_test_handler.h',
'tests/ceftests/scheme_handler_unittest.cc',
'tests/ceftests/send_shared_process_message_unittest.cc',
"tests/ceftests/shared_process_message_unittest.cc",
'tests/ceftests/urlrequest_unittest.cc',
'tests/ceftests/test_handler.cc',
'tests/ceftests/test_handler.h',
'tests/ceftests/test_request.cc',
'tests/ceftests/test_request.h',
'tests/ceftests/test_server.cc',
'tests/ceftests/test_server.h',
'tests/ceftests/test_server_observer.h',
'tests/ceftests/test_server_observer.cc',
'tests/ceftests/test_server_manager.h',
'tests/ceftests/test_server_manager.cc',
'tests/ceftests/test_server_runner.h',
'tests/ceftests/test_server_runner.cc',
'tests/ceftests/test_server_runner_normal.cc',
'tests/ceftests/test_server_runner_test.cc',
'tests/ceftests/test_suite.cc',
'tests/ceftests/test_suite.h',
'tests/ceftests/test_util.cc',
'tests/ceftests/test_util.h',
'tests/ceftests/track_callback.h',
'tests/ceftests/thread_helper.cc',
'tests/ceftests/thread_helper.h',
'tests/ceftests/thread_unittest.cc',
'tests/ceftests/tracing_unittest.cc',
'tests/ceftests/v8_unittest.cc',
],
'ceftests_bundle_resources_mac': [
'tests/ceftests/resources/mac/ceftests.icns',
'tests/ceftests/resources/mac/English.lproj/InfoPlist.strings',
'tests/ceftests/resources/mac/English.lproj/MainMenu.xib',
'tests/ceftests/resources/mac/Info.plist',
],
'ceftests_sources_linux': [
'tests/ceftests/resource_util_linux.cc',
],
},
}

39
cmake/FindCEF.cmake.in Normal file
View File

@@ -0,0 +1,39 @@
# Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
#
# This file is the CEF CMake configuration entry point and should be loaded
# using `find_package(CEF REQUIRED)`. See the top-level CMakeLists.txt file
# included with the CEF binary distribution for usage information.
#
# Find the CEF binary distribution root directory.
set(_CEF_ROOT "")
if(CEF_ROOT AND IS_DIRECTORY "${CEF_ROOT}")
set(_CEF_ROOT "${CEF_ROOT}")
set(_CEF_ROOT_EXPLICIT 1)
else()
set(_ENV_CEF_ROOT "")
if(DEFINED ENV{CEF_ROOT})
file(TO_CMAKE_PATH "$ENV{CEF_ROOT}" _ENV_CEF_ROOT)
endif()
if(_ENV_CEF_ROOT AND IS_DIRECTORY "${_ENV_CEF_ROOT}")
set(_CEF_ROOT "${_ENV_CEF_ROOT}")
set(_CEF_ROOT_EXPLICIT 1)
endif()
unset(_ENV_CEF_ROOT)
endif()
if(NOT DEFINED _CEF_ROOT_EXPLICIT)
message(FATAL_ERROR "Must specify a CEF_ROOT value via CMake or environment variable.")
endif()
if(NOT IS_DIRECTORY "${_CEF_ROOT}/cmake")
message(FATAL_ERROR "No CMake bootstrap found for CEF binary distribution at: ${CEF_ROOT}.")
endif()
# Execute additional cmake files from the CEF binary distribution.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${_CEF_ROOT}/cmake")
include("cef_variables")
include("cef_macros")

387
cmake/cef_macros.cmake.in Normal file
View File

@@ -0,0 +1,387 @@
# Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
# Must be loaded via FindCEF.cmake.
if(NOT DEFINED _CEF_ROOT_EXPLICIT)
message(FATAL_ERROR "Use find_package(CEF) to load this file.")
endif()
#
# Shared macros.
#
# Print the current CEF configuration.
macro(PRINT_CEF_CONFIG)
message(STATUS "*** CEF CONFIGURATION SETTINGS ***")
message(STATUS "Generator: ${CMAKE_GENERATOR}")
message(STATUS "Platform: ${CMAKE_SYSTEM_NAME}")
message(STATUS "Project architecture: ${PROJECT_ARCH}")
if(GEN_NINJA OR GEN_MAKEFILES)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
endif()
message(STATUS "Binary distribution root: ${_CEF_ROOT}")
if(OS_MAC)
message(STATUS "Base SDK: ${CMAKE_OSX_SYSROOT}")
message(STATUS "Target SDK: ${CEF_TARGET_SDK}")
endif()
if(OS_WINDOWS)
message(STATUS "Visual Studio ATL support: ${USE_ATL}")
endif()
message(STATUS "CEF sandbox: ${USE_SANDBOX}")
set(_libraries ${CEF_STANDARD_LIBS})
if(OS_WINDOWS AND USE_SANDBOX)
list(APPEND _libraries ${CEF_SANDBOX_STANDARD_LIBS})
endif()
message(STATUS "Standard libraries: ${_libraries}")
message(STATUS "Compile defines: ${CEF_COMPILER_DEFINES}")
message(STATUS "Compile defines (Debug): ${CEF_COMPILER_DEFINES_DEBUG}")
message(STATUS "Compile defines (Release): ${CEF_COMPILER_DEFINES_RELEASE}")
message(STATUS "C compile flags: ${CEF_COMPILER_FLAGS} ${CEF_C_COMPILER_FLAGS}")
message(STATUS "C compile flags (Debug): ${CEF_COMPILER_FLAGS_DEBUG} ${CEF_C_COMPILER_FLAGS_DEBUG}")
message(STATUS "C compile flags (Release): ${CEF_COMPILER_FLAGS_RELEASE} ${CEF_C_COMPILER_FLAGS_RELEASE}")
message(STATUS "C++ compile flags: ${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS}")
message(STATUS "C++ compile flags (Debug): ${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}")
message(STATUS "C++ compile flags (Release): ${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}")
message(STATUS "Exe link flags: ${CEF_LINKER_FLAGS} ${CEF_EXE_LINKER_FLAGS}")
message(STATUS "Exe link flags (Debug): ${CEF_LINKER_FLAGS_DEBUG} ${CEF_EXE_LINKER_FLAGS_DEBUG}")
message(STATUS "Exe link flags (Release): ${CEF_LINKER_FLAGS_RELEASE} ${CEF_EXE_LINKER_FLAGS_RELEASE}")
message(STATUS "Shared link flags: ${CEF_LINKER_FLAGS} ${CEF_SHARED_LINKER_FLAGS}")
message(STATUS "Shared link flags (Debug): ${CEF_LINKER_FLAGS_DEBUG} ${CEF_SHARED_LINKER_FLAGS_DEBUG}")
message(STATUS "Shared link flags (Release): ${CEF_LINKER_FLAGS_RELEASE} ${CEF_SHARED_LINKER_FLAGS_RELEASE}")
if(OS_LINUX OR OS_WINDOWS)
message(STATUS "CEF Binary files: ${CEF_BINARY_FILES}")
message(STATUS "CEF Resource files: ${CEF_RESOURCE_FILES}")
endif()
endmacro()
# Append platform specific sources to a list of sources.
macro(APPEND_PLATFORM_SOURCES name_of_list)
if(OS_LINUX AND ${name_of_list}_LINUX)
list(APPEND ${name_of_list} ${${name_of_list}_LINUX})
endif()
if(OS_POSIX AND ${name_of_list}_POSIX)
list(APPEND ${name_of_list} ${${name_of_list}_POSIX})
endif()
if(OS_WINDOWS AND ${name_of_list}_WINDOWS)
list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS})
endif()
if(OS_MAC AND ${name_of_list}_MAC)
list(APPEND ${name_of_list} ${${name_of_list}_MAC})
endif()
endmacro()
# Determine the target output directory based on platform and generator.
macro(SET_CEF_TARGET_OUT_DIR)
if(GEN_NINJA OR GEN_MAKEFILES)
# By default Ninja and Make builds don't create a subdirectory named after
# the configuration.
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
# Output binaries (executables, libraries) to the correct directory.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR})
else()
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
endif()
endmacro()
# Copy a list of files from one directory to another. Relative file paths are maintained.
macro(COPY_FILES target file_list source_dir target_dir)
foreach(FILENAME ${file_list})
set(source_file ${source_dir}/${FILENAME})
# Remove the target file path component.
get_filename_component(target_name ${FILENAME} NAME)
set(target_file ${target_dir}/${target_name})
COPY_SINGLE_FILE(${target} ${source_file} ${target_file})
endforeach()
endmacro()
# Copy a list of files from one directory to another. Relative file paths are maintained.
macro(COPY_RESOURCES target file_list prefix_list source_dir target_dir)
foreach(FILENAME ${file_list})
set(source_file ${source_dir}/${FILENAME})
# Remove one or more prefixes from the source paths.
set(TARGET_FILENAME "${FILENAME}")
foreach(PREFIX ${prefix_list})
string(REGEX REPLACE "^.*${PREFIX}" "" TARGET_FILENAME ${TARGET_FILENAME})
endforeach()
set(target_file ${target_dir}/${TARGET_FILENAME})
COPY_SINGLE_FILE(${target} ${source_file} ${target_file})
endforeach()
endmacro()
macro(COPY_SINGLE_FILE target source_file target_file)
string(FIND ${source_file} "$<CONFIGURATION>" _pos)
if(NOT ${_pos} EQUAL -1)
# Must test with an actual configuration directory.
string(REPLACE "$<CONFIGURATION>" "Release" existing_source_file ${source_file})
if(NOT EXISTS ${existing_source_file})
string(REPLACE "$<CONFIGURATION>" "Debug" existing_source_file ${source_file})
endif()
else()
set(existing_source_file ${source_file})
endif()
if(IS_DIRECTORY ${existing_source_file})
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${source_file}" "${target_file}"
VERBATIM
)
else()
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${source_file}" "${target_file}"
VERBATIM
)
endif()
endmacro()
#
# Linux macros.
#
if(OS_LINUX)
# Use pkg-config to find Linux libraries and update compiler/linker variables.
macro(FIND_LINUX_LIBRARIES libraries)
# Read pkg-config info into variables.
execute_process(COMMAND pkg-config --cflags ${libraries} OUTPUT_VARIABLE FLL_CFLAGS)
execute_process(COMMAND pkg-config --libs-only-L --libs-only-other ${libraries} OUTPUT_VARIABLE FLL_LDFLAGS)
execute_process(COMMAND pkg-config --libs-only-l ${libraries} OUTPUT_VARIABLE FLL_LIBS)
# Strip leading and trailing whitepspace.
STRING(STRIP "${FLL_CFLAGS}" FLL_CFLAGS)
STRING(STRIP "${FLL_LDFLAGS}" FLL_LDFLAGS)
STRING(STRIP "${FLL_LIBS}" FLL_LIBS)
# Convert to a list.
separate_arguments(FLL_CFLAGS)
separate_arguments(FLL_LDFLAGS)
separate_arguments(FLL_LIBS)
# Update build variables.
list(APPEND CEF_C_COMPILER_FLAGS ${FLL_CFLAGS})
list(APPEND CEF_CXX_COMPILER_FLAGS ${FLL_CFLAGS})
list(APPEND CEF_EXE_LINKER_FLAGS ${FLL_LDFLAGS})
list(APPEND CEF_SHARED_LINKER_FLAGS ${FLL_LDFLAGS})
list(APPEND CEF_STANDARD_LIBS ${FLL_LIBS})
endmacro()
# Set SUID permissions on the specified executable.
macro(SET_LINUX_SUID_PERMISSIONS target executable)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo ""
COMMAND ${CMAKE_COMMAND} -E echo "*** Run the following command manually to set SUID permissions ***"
COMMAND ${CMAKE_COMMAND} -E echo "EXE=\"${executable}\" && sudo -- chown root:root $EXE && sudo -- chmod 4755 $EXE"
COMMAND ${CMAKE_COMMAND} -E echo ""
VERBATIM
)
endmacro()
endif(OS_LINUX)
#
# Mac OS X macros.
#
if(OS_MAC)
# Manually process and copy over resource files.
macro(COPY_MAC_RESOURCES resource_list prefix_list target source_dir app_path)
foreach(FILENAME ${resource_list})
# Remove one or more prefixes from the source paths.
set(TARGET_FILENAME "${FILENAME}")
foreach(PREFIX ${prefix_list})
string(REGEX REPLACE "^.*${PREFIX}" "" TARGET_FILENAME ${TARGET_FILENAME})
endforeach()
# Determine the absolute source and target paths.
set(TARGET_PATH "${app_path}/Contents/Resources/${TARGET_FILENAME}")
if(IS_ABSOLUTE ${FILENAME})
set(SOURCE_PATH ${FILENAME})
else()
set(SOURCE_PATH "${source_dir}/${FILENAME}")
endif()
if(${FILENAME} MATCHES ".xib$")
# Change the target file extension.
string(REGEX REPLACE ".xib$" ".nib" TARGET_PATH ${TARGET_PATH})
get_filename_component(TARGET_DIRECTORY ${TARGET_PATH} PATH)
add_custom_command(
TARGET ${target}
POST_BUILD
# Create the target directory.
COMMAND ${CMAKE_COMMAND} -E make_directory "${TARGET_DIRECTORY}"
# Compile the XIB file to a NIB.
COMMAND /usr/bin/ibtool --output-format binary1 --compile "${TARGET_PATH}" "${SOURCE_PATH}"
VERBATIM
)
elseif(NOT ${TARGET_FILENAME} STREQUAL "Info.plist")
# Copy the file as-is.
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${SOURCE_PATH}" "${TARGET_PATH}"
VERBATIM
)
endif()
endforeach()
endmacro()
endif(OS_MAC)
#
# Windows macros.
#
if(OS_WINDOWS)
# Add custom manifest files to an executable target.
macro(ADD_WINDOWS_MANIFEST manifest_path target extension)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND "mt.exe" -nologo
-manifest \"${manifest_path}/${target}.${extension}.manifest\" \"${manifest_path}/compatibility.manifest\"
-outputresource:"${CEF_TARGET_OUT_DIR}/${target}.${extension}"\;\#1
COMMENT "Adding manifest..."
)
endmacro()
endif(OS_WINDOWS)
#
# Target configuration macros.
#
# Add a logical target that can be used to link the specified libraries into an
# executable target.
macro(ADD_LOGICAL_TARGET target debug_lib release_lib)
add_library(${target} ${CEF_LIBTYPE} IMPORTED)
set_target_properties(${target} PROPERTIES
IMPORTED_LOCATION "${release_lib}"
IMPORTED_LOCATION_DEBUG "${debug_lib}"
IMPORTED_LOCATION_RELEASE "${release_lib}"
)
endmacro()
# Set common target properties. Use SET_LIBRARY_TARGET_PROPERTIES() or
# SET_EXECUTABLE_TARGET_PROPERTIES() instead of calling this macro directly.
macro(SET_COMMON_TARGET_PROPERTIES target)
# Compile flags.
target_compile_options(${target} PRIVATE ${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS})
target_compile_options(${target} PRIVATE $<$<CONFIG:Debug>:${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}>)
target_compile_options(${target} PRIVATE $<$<CONFIG:Release>:${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}>)
# Compile definitions.
target_compile_definitions(${target} PRIVATE ${CEF_COMPILER_DEFINES})
target_compile_definitions(${target} PRIVATE $<$<CONFIG:Debug>:${CEF_COMPILER_DEFINES_DEBUG}>)
target_compile_definitions(${target} PRIVATE $<$<CONFIG:Release>:${CEF_COMPILER_DEFINES_RELEASE}>)
# Include directories.
target_include_directories(${target} PRIVATE ${CEF_INCLUDE_PATH})
# Linker flags.
if(CEF_LINKER_FLAGS)
string(REPLACE ";" " " _flags_str "${CEF_LINKER_FLAGS}")
set_property(TARGET ${target} PROPERTY LINK_FLAGS ${_flags_str})
endif()
if(CEF_LINKER_FLAGS_DEBUG)
string(REPLACE ";" " " _flags_str "${CEF_LINKER_FLAGS_DEBUG}")
set_property(TARGET ${target} PROPERTY LINK_FLAGS_DEBUG ${_flags_str})
endif()
if(CEF_LINKER_FLAGS_RELEASE)
string(REPLACE ";" " " _flags_str "${CEF_LINKER_FLAGS_RELEASE}")
set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
endif()
if(OS_MAC)
# Set Xcode target properties.
set_target_properties(${target} PROPERTIES
XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO
XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "gnu++11" # -std=gnu++11
XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME NO # -fno-objc-link-runtime
XCODE_ATTRIBUTE_CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS YES # -Wobjc-missing-property-synthesis
XCODE_ATTRIBUTE_COPY_PHASE_STRIP NO
XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING[variant=Release] YES # -Wl,-dead_strip
XCODE_ATTRIBUTE_GCC_C_LANGUAGE_STANDARD "c99" # -std=c99
XCODE_ATTRIBUTE_GCC_CW_ASM_SYNTAX NO # No -fasm-blocks
XCODE_ATTRIBUTE_GCC_DYNAMIC_NO_PIC NO
XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS NO # -fno-exceptions
XCODE_ATTRIBUTE_GCC_ENABLE_CPP_RTTI NO # -fno-rtti
XCODE_ATTRIBUTE_GCC_ENABLE_PASCAL_STRINGS NO # No -mpascal-strings
XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN YES # -fvisibility-inlines-hidden
XCODE_ATTRIBUTE_GCC_OBJC_CALL_CXX_CDTORS YES # -fobjc-call-cxx-cdtors
XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES # -fvisibility=hidden
XCODE_ATTRIBUTE_GCC_THREADSAFE_STATICS NO # -fno-threadsafe-statics
XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS YES # -Werror
XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0"
XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES # -Wnewline-eof
XCODE_ATTRIBUTE_USE_HEADERMAP NO
OSX_ARCHITECTURES_DEBUG "${CMAKE_OSX_ARCHITECTURES}"
OSX_ARCHITECTURES_RELEASE "${CMAKE_OSX_ARCHITECTURES}"
)
endif()
endmacro()
# Set library-specific properties.
macro(SET_LIBRARY_TARGET_PROPERTIES target)
SET_COMMON_TARGET_PROPERTIES(${target})
# Shared library linker flags.
if(CEF_SHARED_LINKER_FLAGS)
string(REPLACE ";" " " _flags_str "${CEF_SHARED_LINKER_FLAGS}")
set_property(TARGET ${target} PROPERTY LINK_FLAGS ${_flags_str})
endif()
if(CEF_SHARED_LINKER_FLAGS_DEBUG)
string(REPLACE ";" " " _flags_str "${CEF_SHARED_LINKER_FLAGS_DEBUG}")
set_property(TARGET ${target} PROPERTY LINK_FLAGS_DEBUG ${_flags_str})
endif()
if(CEF_SHARED_LINKER_FLAGS_RELEASE)
string(REPLACE ";" " " _flags_str "${CEF_SHARED_LINKER_FLAGS_RELEASE}")
set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
endif()
endmacro()
# Set executable-specific properties.
macro(SET_EXECUTABLE_TARGET_PROPERTIES target)
SET_COMMON_TARGET_PROPERTIES(${target})
# Executable linker flags.
if(CEF_EXE_LINKER_FLAGS)
string(REPLACE ";" " " _flags_str "${CEF_EXE_LINKER_FLAGS}")
set_property(TARGET ${target} PROPERTY LINK_FLAGS ${_flags_str})
endif()
if(CEF_EXE_LINKER_FLAGS_DEBUG)
string(REPLACE ";" " " _flags_str "${CEF_EXE_LINKER_FLAGS_DEBUG}")
set_property(TARGET ${target} PROPERTY LINK_FLAGS_DEBUG ${_flags_str})
endif()
if(CEF_EXE_LINKER_FLAGS_RELEASE)
string(REPLACE ";" " " _flags_str "${CEF_EXE_LINKER_FLAGS_RELEASE}")
set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
endif()
endmacro()

View File

@@ -0,0 +1,640 @@
# Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
# Must be loaded via FindCEF.cmake.
if(NOT DEFINED _CEF_ROOT_EXPLICIT)
message(FATAL_ERROR "Use find_package(CEF) to load this file.")
endif()
#
# Shared configuration.
#
# Determine the platform.
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(OS_MAC 1)
set(OS_MACOSX 1) # For backwards compatibility.
set(OS_POSIX 1)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(OS_LINUX 1)
set(OS_POSIX 1)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
set(OS_WINDOWS 1)
endif()
# Determine the project architecture.
if(NOT DEFINED PROJECT_ARCH)
if(("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64") OR
("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM64"))
set(PROJECT_ARCH "arm64")
elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
set(PROJECT_ARCH "x86_64")
else()
set(PROJECT_ARCH "x86")
endif()
endif()
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
set(GEN_NINJA 1)
elseif(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(GEN_MAKEFILES 1)
endif()
# Determine the build type.
if(NOT CMAKE_BUILD_TYPE AND (GEN_NINJA OR GEN_MAKEFILES))
# CMAKE_BUILD_TYPE should be specified when using Ninja or Unix Makefiles.
set(CMAKE_BUILD_TYPE Release)
message(WARNING "No CMAKE_BUILD_TYPE value selected, using ${CMAKE_BUILD_TYPE}")
endif()
# Path to the include directory.
set(CEF_INCLUDE_PATH "${_CEF_ROOT}")
# Path to the libcef_dll_wrapper target.
set(CEF_LIBCEF_DLL_WRAPPER_PATH "${_CEF_ROOT}/libcef_dll")
# Shared compiler/linker flags.
list(APPEND CEF_COMPILER_DEFINES
# Allow C++ programs to use stdint.h macros specified in the C99 standard that aren't
# in the C++ standard (e.g. UINT8_MAX, INT64_MIN, etc)
__STDC_CONSTANT_MACROS __STDC_FORMAT_MACROS
)
# Configure use of the sandbox.
option(USE_SANDBOX "Enable or disable use of the sandbox." ON)
#
# Linux configuration.
#
if(OS_LINUX)
# Platform-specific compiler/linker flags.
set(CEF_LIBTYPE SHARED)
list(APPEND CEF_COMPILER_FLAGS
-fno-strict-aliasing # Avoid assumptions regarding non-aliasing of objects of different types
-fPIC # Generate position-independent code for shared libraries
-fstack-protector # Protect some vulnerable functions from stack-smashing (security feature)
-funwind-tables # Support stack unwinding for backtrace()
-fvisibility=hidden # Give hidden visibility to declarations that are not explicitly marked as visible
--param=ssp-buffer-size=4 # Set the minimum buffer size protected by SSP (security feature, related to stack-protector)
-pipe # Use pipes rather than temporary files for communication between build stages
-pthread # Use the pthread library
-Wall # Enable all warnings
-Werror # Treat warnings as errors
-Wno-missing-field-initializers # Don't warn about missing field initializers
-Wno-unused-parameter # Don't warn about unused parameters
-Wno-error=comment # Don't warn about code in comments
-Wno-comment # Don't warn about code in comments
-Wno-deprecated-declarations # Don't warn about using deprecated methods
)
list(APPEND CEF_C_COMPILER_FLAGS
-std=c99 # Use the C99 language standard
)
list(APPEND CEF_CXX_COMPILER_FLAGS
-fno-exceptions # Disable exceptions
-fno-rtti # Disable real-time type information
-fno-threadsafe-statics # Don't generate thread-safe statics
-fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions
-std=c++17 # Use the C++17 language standard
-Wsign-compare # Warn about mixed signed/unsigned type comparisons
)
list(APPEND CEF_COMPILER_FLAGS_DEBUG
-O0 # Disable optimizations
-g # Generate debug information
)
list(APPEND CEF_COMPILER_FLAGS_RELEASE
-O2 # Optimize for maximum speed
-fdata-sections # Enable linker optimizations to improve locality of reference for data sections
-ffunction-sections # Enable linker optimizations to improve locality of reference for function sections
-fno-ident # Ignore the #ident directive
-U_FORTIFY_SOURCE # Undefine _FORTIFY_SOURCE in case it was previously defined
-D_FORTIFY_SOURCE=2 # Add memory and string function protection (security feature, related to stack-protector)
)
list(APPEND CEF_LINKER_FLAGS
-fPIC # Generate position-independent code for shared libraries
-pthread # Use the pthread library
-Wl,--disable-new-dtags # Don't generate new-style dynamic tags in ELF
-Wl,--fatal-warnings # Treat warnings as errors
-Wl,-rpath,. # Set rpath so that libraries can be placed next to the executable
-Wl,-z,noexecstack # Mark the stack as non-executable (security feature)
-Wl,-z,now # Resolve symbols on program start instead of on first use (security feature)
-Wl,-z,relro # Mark relocation sections as read-only (security feature)
)
list(APPEND CEF_LINKER_FLAGS_RELEASE
-Wl,-O1 # Enable linker optimizations
-Wl,--as-needed # Only link libraries that export symbols used by the binary
-Wl,--gc-sections # Remove unused code resulting from -fdata-sections and -function-sections
)
list(APPEND CEF_COMPILER_DEFINES
_FILE_OFFSET_BITS=64 # Allow the Large File Support (LFS) interface to replace the old interface
)
list(APPEND CEF_COMPILER_DEFINES_RELEASE
NDEBUG # Not a debug build
)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-Wno-undefined-var-template COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
if(COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
list(APPEND CEF_CXX_COMPILER_FLAGS
-Wno-undefined-var-template # Don't warn about potentially uninstantiated static members
)
endif()
CHECK_C_COMPILER_FLAG(-Wno-unused-local-typedefs COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS)
if(COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS)
list(APPEND CEF_C_COMPILER_FLAGS
-Wno-unused-local-typedefs # Don't warn about unused local typedefs
)
endif()
CHECK_CXX_COMPILER_FLAG(-Wno-literal-suffix COMPILER_SUPPORTS_NO_LITERAL_SUFFIX)
if(COMPILER_SUPPORTS_NO_LITERAL_SUFFIX)
list(APPEND CEF_CXX_COMPILER_FLAGS
-Wno-literal-suffix # Don't warn about invalid suffixes on literals
)
endif()
CHECK_CXX_COMPILER_FLAG(-Wno-narrowing COMPILER_SUPPORTS_NO_NARROWING)
if(COMPILER_SUPPORTS_NO_NARROWING)
list(APPEND CEF_CXX_COMPILER_FLAGS
-Wno-narrowing # Don't warn about type narrowing
)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
list(APPEND CEF_CXX_COMPILER_FLAGS
-Wno-attributes # The cfi-icall attribute is not supported by the GNU C++ compiler
)
endif()
if(PROJECT_ARCH STREQUAL "x86_64")
# 64-bit architecture.
list(APPEND CEF_COMPILER_FLAGS
-m64
-march=x86-64
)
list(APPEND CEF_LINKER_FLAGS
-m64
)
elseif(PROJECT_ARCH STREQUAL "x86")
# 32-bit architecture.
list(APPEND CEF_COMPILER_FLAGS
-msse2
-mfpmath=sse
-mmmx
-m32
)
list(APPEND CEF_LINKER_FLAGS
-m32
)
endif()
# Standard libraries.
set(CEF_STANDARD_LIBS
X11
)
# CEF directory paths.
set(CEF_RESOURCE_DIR "${_CEF_ROOT}/Resources")
set(CEF_BINARY_DIR "${_CEF_ROOT}/${CMAKE_BUILD_TYPE}")
set(CEF_BINARY_DIR_DEBUG "${_CEF_ROOT}/Debug")
set(CEF_BINARY_DIR_RELEASE "${_CEF_ROOT}/Release")
# CEF library paths.
set(CEF_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/libcef.so")
set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/libcef.so")
# List of CEF binary files.
set(CEF_BINARY_FILES
chrome-sandbox
libcef.so
libEGL.so
libGLESv2.so
libvk_swiftshader.so
libvulkan.so.1
snapshot_blob.bin
v8_context_snapshot.bin
vk_swiftshader_icd.json
)
# List of CEF resource files.
set(CEF_RESOURCE_FILES
chrome_100_percent.pak
chrome_200_percent.pak
resources.pak
icudtl.dat
locales
)
if(USE_SANDBOX)
list(APPEND CEF_COMPILER_DEFINES
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
)
endif()
endif()
#
# Mac OS X configuration.
#
if(OS_MAC)
# Platform-specific compiler/linker flags.
# See also Xcode target properties in cef_macros.cmake.
set(CEF_LIBTYPE SHARED)
list(APPEND CEF_COMPILER_FLAGS
-fno-strict-aliasing # Avoid assumptions regarding non-aliasing of objects of different types
-fstack-protector # Protect some vulnerable functions from stack-smashing (security feature)
-funwind-tables # Support stack unwinding for backtrace()
-fvisibility=hidden # Give hidden visibility to declarations that are not explicitly marked as visible
-Wall # Enable all warnings
-Werror # Treat warnings as errors
-Wextra # Enable additional warnings
-Wendif-labels # Warn whenever an #else or an #endif is followed by text
-Wnewline-eof # Warn about no newline at end of file
-Wno-missing-field-initializers # Don't warn about missing field initializers
-Wno-unused-parameter # Don't warn about unused parameters
)
list(APPEND CEF_C_COMPILER_FLAGS
-std=c99 # Use the C99 language standard
)
list(APPEND CEF_CXX_COMPILER_FLAGS
-fno-exceptions # Disable exceptions
-fno-rtti # Disable real-time type information
-fno-threadsafe-statics # Don't generate thread-safe statics
-fobjc-call-cxx-cdtors # Call the constructor/destructor of C++ instance variables in ObjC objects
-fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions
-std=c++17 # Use the C++17 language standard
-Wno-narrowing # Don't warn about type narrowing
-Wsign-compare # Warn about mixed signed/unsigned type comparisons
)
list(APPEND CEF_COMPILER_FLAGS_DEBUG
-O0 # Disable optimizations
-g # Generate debug information
)
list(APPEND CEF_COMPILER_FLAGS_RELEASE
-O3 # Optimize for maximum speed plus a few extras
)
list(APPEND CEF_LINKER_FLAGS
-Wl,-search_paths_first # Search for static or shared library versions in the same pass
-Wl,-ObjC # Support creation of ObjC static libraries
-Wl,-pie # Generate position-independent code suitable for executables only
)
list(APPEND CEF_LINKER_FLAGS_RELEASE
-Wl,-dead_strip # Strip dead code
)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-Wno-undefined-var-template COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
if(COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
list(APPEND CEF_CXX_COMPILER_FLAGS
-Wno-undefined-var-template # Don't warn about potentially uninstantiated static members
)
endif()
# Standard libraries.
set(CEF_STANDARD_LIBS
-lpthread
"-framework AppKit"
"-framework Cocoa"
"-framework IOSurface"
)
# Find the newest available base SDK.
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
foreach(OS_VERSION 14.2 14.0 10.15)
set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
set(CMAKE_OSX_SYSROOT ${SDK})
endif()
endforeach()
# Target SDK.
set(CEF_TARGET_SDK "10.15")
list(APPEND CEF_COMPILER_FLAGS
-mmacosx-version-min=${CEF_TARGET_SDK}
)
set(CMAKE_OSX_DEPLOYMENT_TARGET ${CEF_TARGET_SDK})
# Target architecture.
if(PROJECT_ARCH STREQUAL "x86_64")
set(CMAKE_OSX_ARCHITECTURES "x86_64")
elseif(PROJECT_ARCH STREQUAL "arm64")
set(CMAKE_OSX_ARCHITECTURES "arm64")
else()
set(CMAKE_OSX_ARCHITECTURES "i386")
endif()
# Prevent Xcode 11 from doing automatic codesigning.
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
# CEF directory paths.
set(CEF_BINARY_DIR "${_CEF_ROOT}/$<CONFIGURATION>")
set(CEF_BINARY_DIR_DEBUG "${_CEF_ROOT}/Debug")
set(CEF_BINARY_DIR_RELEASE "${_CEF_ROOT}/Release")
if(USE_SANDBOX)
list(APPEND CEF_COMPILER_DEFINES
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
)
list(APPEND CEF_STANDARD_LIBS
-lsandbox
)
# CEF sandbox library paths.
set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a")
set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a")
endif()
# CEF Helper app suffixes.
# Format is "<name suffix>:<target suffix>:<plist suffix>".
set(CEF_HELPER_APP_SUFFIXES
"::"
" (Alerts):_alerts:.alerts"
" (GPU):_gpu:.gpu"
" (Plugin):_plugin:.plugin"
" (Renderer):_renderer:.renderer"
)
endif()
#
# Windows configuration.
#
if(OS_WINDOWS)
if (GEN_NINJA)
# When using the Ninja generator clear the CMake defaults to avoid excessive
# console warnings (see issue #2120).
set(CMAKE_CXX_FLAGS "")
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_RELEASE "")
endif()
if(USE_SANDBOX)
# Check if the current MSVC version is compatible with the cef_sandbox.lib
# static library. We require VS2015 or newer.
if(MSVC_VERSION LESS 1900)
message(WARNING "CEF sandbox is not compatible with the current MSVC version (${MSVC_VERSION})")
set(USE_SANDBOX OFF)
endif()
endif()
# Consumers who run into LNK4099 warnings can pass /Z7 instead (see issue #385).
set(CEF_DEBUG_INFO_FLAG "/Zi" CACHE STRING "Optional flag specifying specific /Z flag to use")
# Consumers using different runtime types may want to pass different flags
set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Optional flag specifying which runtime to use")
if (CEF_RUNTIME_LIBRARY_FLAG)
list(APPEND CEF_COMPILER_FLAGS_DEBUG ${CEF_RUNTIME_LIBRARY_FLAG}d)
list(APPEND CEF_COMPILER_FLAGS_RELEASE ${CEF_RUNTIME_LIBRARY_FLAG})
endif()
# Platform-specific compiler/linker flags.
set(CEF_LIBTYPE STATIC)
list(APPEND CEF_COMPILER_FLAGS
/MP # Multiprocess compilation
/Gy # Enable function-level linking
/GR- # Disable run-time type information
/W4 # Warning level 4
/WX # Treat warnings as errors
/wd4100 # Ignore "unreferenced formal parameter" warning
/wd4127 # Ignore "conditional expression is constant" warning
/wd4244 # Ignore "conversion possible loss of data" warning
/wd4324 # Ignore "structure was padded due to alignment specifier" warning
/wd4481 # Ignore "nonstandard extension used: override" warning
/wd4512 # Ignore "assignment operator could not be generated" warning
/wd4701 # Ignore "potentially uninitialized local variable" warning
/wd4702 # Ignore "unreachable code" warning
/wd4996 # Ignore "function or variable may be unsafe" warning
${CEF_DEBUG_INFO_FLAG}
)
list(APPEND CEF_COMPILER_FLAGS_DEBUG
/RTC1 # Disable optimizations
/Od # Enable basic run-time checks
)
list(APPEND CEF_COMPILER_FLAGS_RELEASE
/O2 # Optimize for maximum speed
/Ob2 # Inline any suitable function
/GF # Enable string pooling
)
list(APPEND CEF_CXX_COMPILER_FLAGS
/std:c++17 # Use the C++17 language standard
)
list(APPEND CEF_LINKER_FLAGS_DEBUG
/DEBUG # Generate debug information
)
list(APPEND CEF_EXE_LINKER_FLAGS
/MANIFEST:NO # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
/LARGEADDRESSAWARE # Allow 32-bit processes to access 3GB of RAM
# Delayload most libraries as the dlls are simply not required at startup (or
# at all, depending on the process type). Some dlls open handles when they are
# loaded, and we may not want them to be loaded in renderers or other sandboxed
# processes. Conversely, some dlls must be loaded before sandbox lockdown. In
# unsandboxed processes they will load when first needed. The linker will
# automatically ignore anything which is not linked to the binary at all (it is
# harmless to have an unmatched /delayload). This list should be kept in sync
# with Chromium's "delayloads" target from the //build/config/win/BUILD.gn file.
/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll
/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll
/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll
/DELAYLOAD:advapi32.dll
/DELAYLOAD:comctl32.dll
/DELAYLOAD:comdlg32.dll
/DELAYLOAD:credui.dll
/DELAYLOAD:cryptui.dll
/DELAYLOAD:d3d11.dll
/DELAYLOAD:d3d9.dll
/DELAYLOAD:dwmapi.dll
/DELAYLOAD:dxgi.dll
/DELAYLOAD:dxva2.dll
/DELAYLOAD:esent.dll
/DELAYLOAD:gdi32.dll
/DELAYLOAD:hid.dll
/DELAYLOAD:imagehlp.dll
/DELAYLOAD:imm32.dll
/DELAYLOAD:msi.dll
/DELAYLOAD:netapi32.dll
/DELAYLOAD:ncrypt.dll
/DELAYLOAD:ole32.dll
/DELAYLOAD:oleacc.dll
/DELAYLOAD:propsys.dll
/DELAYLOAD:psapi.dll
/DELAYLOAD:rpcrt4.dll
/DELAYLOAD:rstrtmgr.dll
/DELAYLOAD:setupapi.dll
/DELAYLOAD:shell32.dll
/DELAYLOAD:shlwapi.dll
/DELAYLOAD:uiautomationcore.dll
/DELAYLOAD:urlmon.dll
/DELAYLOAD:user32.dll
/DELAYLOAD:usp10.dll
/DELAYLOAD:uxtheme.dll
/DELAYLOAD:wer.dll
/DELAYLOAD:wevtapi.dll
/DELAYLOAD:wininet.dll
/DELAYLOAD:winusb.dll
/DELAYLOAD:wsock32.dll
/DELAYLOAD:wtsapi32.dll
)
list(APPEND CEF_COMPILER_DEFINES
WIN32 _WIN32 _WINDOWS # Windows platform
UNICODE _UNICODE # Unicode build
# Targeting Windows 10. We can't say `=_WIN32_WINNT_WIN10` here because
# some files do `#if WINVER < 0x0600` without including windows.h before,
# and then _WIN32_WINNT_WIN10 isn't yet known to be 0x0A00.
WINVER=0x0A00
_WIN32_WINNT=0x0A00
NTDDI_VERSION=NTDDI_WIN10_FE
NOMINMAX # Use the standard's templated min/max
WIN32_LEAN_AND_MEAN # Exclude less common API declarations
_HAS_EXCEPTIONS=0 # Disable exceptions
)
list(APPEND CEF_COMPILER_DEFINES_RELEASE
NDEBUG _NDEBUG # Not a debug build
)
if(PROJECT_ARCH STREQUAL "x86")
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB minimum
# needed by CEF's main thread. This saves significant memory on threads
# (like those in the Windows thread pool, and others) whose stack size we
# can only control through this setting. The main thread (in 32-bit builds
# only) uses fibers to switch to a 4MiB stack at runtime via
# CefRunWinMainWithPreferredStackSize().
list(APPEND CEF_EXE_LINKER_FLAGS
/STACK:0x80000
)
else()
# Increase the initial stack size to 8MiB from the default 1MiB.
list(APPEND CEF_EXE_LINKER_FLAGS
/STACK:0x800000
)
endif()
# Standard libraries.
set(CEF_STANDARD_LIBS
comctl32.lib
gdi32.lib
rpcrt4.lib
shlwapi.lib
ws2_32.lib
)
# CEF directory paths.
set(CEF_RESOURCE_DIR "${_CEF_ROOT}/Resources")
set(CEF_BINARY_DIR "${_CEF_ROOT}/$<CONFIGURATION>")
set(CEF_BINARY_DIR_DEBUG "${_CEF_ROOT}/Debug")
set(CEF_BINARY_DIR_RELEASE "${_CEF_ROOT}/Release")
# CEF library paths.
set(CEF_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/libcef.lib")
set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/libcef.lib")
# List of CEF binary files.
set(CEF_BINARY_FILES
chrome_elf.dll
d3dcompiler_47.dll
libcef.dll
libEGL.dll
libGLESv2.dll
snapshot_blob.bin
v8_context_snapshot.bin
vk_swiftshader.dll
vk_swiftshader_icd.json
vulkan-1.dll
)
if(PROJECT_ARCH STREQUAL "x86_64")
list(APPEND CEF_BINARY_FILES
dxil.dll
dxcompiler.dll
)
endif()
# List of CEF resource files.
set(CEF_RESOURCE_FILES
chrome_100_percent.pak
chrome_200_percent.pak
resources.pak
icudtl.dat
locales
)
if(USE_SANDBOX)
list(APPEND CEF_COMPILER_DEFINES
PSAPI_VERSION=1 # Required by cef_sandbox.lib
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
)
list(APPEND CEF_COMPILER_DEFINES_DEBUG
_HAS_ITERATOR_DEBUGGING=0 # Disable iterator debugging
)
# Libraries required by cef_sandbox.lib.
set(CEF_SANDBOX_STANDARD_LIBS
Advapi32.lib
dbghelp.lib
Delayimp.lib
ntdll.lib
OleAut32.lib
PowrProf.lib
Propsys.lib
psapi.lib
SetupAPI.lib
Shell32.lib
Shcore.lib
Userenv.lib
version.lib
wbemuuid.lib
WindowsApp.lib
winmm.lib
)
# CEF sandbox library paths.
set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.lib")
set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.lib")
endif()
# Configure use of ATL.
option(USE_ATL "Enable or disable use of ATL." ON)
if(USE_ATL)
# Locate the atlmfc directory if it exists. It may be at any depth inside
# the VC directory. The cl.exe path returned by CMAKE_CXX_COMPILER may also
# be at different depths depending on the toolchain version
# (e.g. "VC/bin/cl.exe", "VC/bin/amd64_x86/cl.exe",
# "VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe", etc).
set(HAS_ATLMFC 0)
get_filename_component(VC_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
while(NOT ${VC_DIR_NAME} STREQUAL "VC")
get_filename_component(VC_DIR ${VC_DIR} DIRECTORY)
if(IS_DIRECTORY "${VC_DIR}/atlmfc")
set(HAS_ATLMFC 1)
break()
endif()
get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
endwhile()
# Determine if the Visual Studio install supports ATL.
if(NOT HAS_ATLMFC)
message(WARNING "ATL is not supported by your VC installation.")
set(USE_ATL OFF)
endif()
endif()
if(USE_ATL)
list(APPEND CEF_COMPILER_DEFINES
CEF_USE_ATL # Used by apps to test if ATL support is enabled
)
endif()
endif()

View File

@@ -0,0 +1,97 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_ATOMIC_FLAG_H_
#define CEF_INCLUDE_BASE_CEF_ATOMIC_FLAG_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/synchronization/atomic_flag.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <stdint.h>
#include <atomic>
#include "include/base/cef_thread_checker.h"
namespace base {
///
/// A flag that can safely be set from one thread and read from other threads.
///
/// This class IS NOT intended for synchronization between threads.
///
class AtomicFlag {
public:
AtomicFlag();
AtomicFlag(const AtomicFlag&) = delete;
AtomicFlag& operator=(const AtomicFlag&) = delete;
~AtomicFlag();
///
/// Set the flag. Must always be called from the same thread.
///
void Set();
///
/// Returns true iff the flag was set. If this returns true, the current
/// thread is guaranteed to be synchronized with all memory operations on the
/// thread which invoked Set() up until at least the first call to Set() on
/// it.
///
bool IsSet() const {
// Inline here: this has a measurable performance impact on base::WeakPtr.
return flag_.load(std::memory_order_acquire) != 0;
}
///
/// Resets the flag. Be careful when using this: callers might not expect
/// IsSet() to return false after returning true once.
///
void UnsafeResetForTesting();
private:
std::atomic<uint_fast8_t> flag_{0};
base::ThreadChecker set_thread_checker_;
};
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_ATOMIC_FLAG_H_

View File

@@ -0,0 +1,123 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This is a low level implementation of atomic semantics for reference
// counting. Please use cef_ref_counted.h directly instead.
//
// The Chromium implementation includes annotations to avoid some false
// positives when using data race detection tools. Annotations are not
// currently supported by the CEF implementation.
#ifndef CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
#define CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/atomic_ref_count.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <atomic>
namespace base {
class AtomicRefCount {
public:
constexpr AtomicRefCount() : ref_count_(0) {}
explicit constexpr AtomicRefCount(int initial_value)
: ref_count_(initial_value) {}
///
/// Increment a reference count.
/// Returns the previous value of the count.
///
int Increment() { return Increment(1); }
///
/// Increment a reference count by "increment", which must exceed 0.
/// Returns the previous value of the count.
///
int Increment(int increment) {
return ref_count_.fetch_add(increment, std::memory_order_relaxed);
}
///
/// Decrement a reference count, and return whether the result is non-zero.
/// Insert barriers to ensure that state written before the reference count
/// became zero will be visible to a thread that has just made the count zero.
///
bool Decrement() {
// TODO(jbroman): Technically this doesn't need to be an acquire operation
// unless the result is 1 (i.e., the ref count did indeed reach zero).
// However, there are toolchain issues that make that not work as well at
// present (notably TSAN doesn't like it).
return ref_count_.fetch_sub(1, std::memory_order_acq_rel) != 1;
}
///
/// Return whether the reference count is one. If the reference count is used
/// in the conventional way, a refrerence count of 1 implies that the current
/// thread owns the reference and no other thread shares it. This call
/// performs the test for a reference count of one, and performs the memory
/// barrier needed for the owning thread to act on the object, knowing that it
/// has exclusive access to the object.
///
bool IsOne() const { return ref_count_.load(std::memory_order_acquire) == 1; }
///
/// Return whether the reference count is zero. With conventional object
/// referencing counting, the object will be destroyed, so the reference count
/// should never be zero. Hence this is generally used for a debug check.
///
bool IsZero() const {
return ref_count_.load(std::memory_order_acquire) == 0;
}
///
/// Returns the current reference count (with no barriers). This is subtle,
/// and should be used only for debugging.
///
int SubtleRefCountForDebug() const {
return ref_count_.load(std::memory_order_relaxed);
}
private:
std::atomic_int ref_count_;
};
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_

View File

@@ -0,0 +1,90 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// base::AutoReset<> is useful for setting a variable to a new value only within
// a particular scope. An base::AutoReset<> object resets a variable to its
// original value upon destruction, making it an alternative to writing
// "var = false;" or "var = old_val;" at all of a block's exit points.
//
// This should be obvious, but note that an base::AutoReset<> instance should
// have a shorter lifetime than its scoped_variable, to prevent invalid memory
// writes when the base::AutoReset<> object is destroyed.
#ifndef CEF_INCLUDE_BASE_CEF_AUTO_RESET_H_
#define CEF_INCLUDE_BASE_CEF_AUTO_RESET_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/auto_reset.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <utility>
namespace base {
template <typename T>
class AutoReset {
public:
template <typename U>
AutoReset(T* scoped_variable, U&& new_value)
: scoped_variable_(scoped_variable),
original_value_(
std::exchange(*scoped_variable_, std::forward<U>(new_value))) {}
AutoReset(AutoReset&& other)
: scoped_variable_(std::exchange(other.scoped_variable_, nullptr)),
original_value_(std::move(other.original_value_)) {}
AutoReset& operator=(AutoReset&& rhs) {
scoped_variable_ = std::exchange(rhs.scoped_variable_, nullptr);
original_value_ = std::move(rhs.original_value_);
return *this;
}
~AutoReset() {
if (scoped_variable_) {
*scoped_variable_ = std::move(original_value_);
}
}
private:
T* scoped_variable_;
T original_value_;
};
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_AUTO_RESET_H_

390
include/base/cef_bind.h Normal file
View File

@@ -0,0 +1,390 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///
/// \file
/// base::BindOnce() and base::BindRepeating() are helpers for creating
/// base::OnceCallback and base::RepeatingCallback objects respectively.
///
/// For a runnable object of n-arity, the base::Bind*() family allows partial
/// application of the first m arguments. The remaining n - m arguments must be
/// passed when invoking the callback with Run().
///
/// <pre>
/// // The first argument is bound at callback creation; the remaining
/// // two must be passed when calling Run() on the callback object.
/// base::OnceCallback<long(int, long)> cb = base::BindOnce(
/// [](short x, int y, long z) { return x * y * z; }, 42);
/// </pre>
///
/// When binding to a method, the receiver object must also be specified at
/// callback creation time. When Run() is invoked, the method will be invoked on
/// the specified receiver object.
///
/// <pre>
/// class C : public base::RefCounted<C> { void F(); };
/// auto instance = base::MakeRefCounted<C>();
/// auto cb = base::BindOnce(&C::F, instance);
/// std::move(cb).Run(); // Identical to instance->F()
/// </pre>
///
/// See https://chromium.googlesource.com/chromium/src/+/lkgr/docs/callback.md
/// for the full documentation.
///
// Implementation notes
//
// If you're reading the implementation, before proceeding further, you should
// read the top comment of base/internal/cef_bind_internal.h for a definition
// of common terms and concepts.
#ifndef CEF_INCLUDE_BASE_CEF_BIND_H_
#define CEF_INCLUDE_BASE_CEF_BIND_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/functional/bind.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>
#include "include/base/cef_build.h"
#include "include/base/cef_compiler_specific.h"
#include "include/base/internal/cef_bind_internal.h"
#if defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
#include "include/base/internal/cef_scoped_block_mac.h"
#endif
namespace base {
///
/// Bind as OnceCallback.
///
template <typename Functor, typename... Args>
inline OnceCallback<cef_internal::MakeUnboundRunType<Functor, Args...>>
BindOnce(Functor&& functor, Args&&... args) {
static_assert(!cef_internal::IsOnceCallback<std::decay_t<Functor>>() ||
(std::is_rvalue_reference<Functor&&>() &&
!std::is_const<std::remove_reference_t<Functor>>()),
"BindOnce requires non-const rvalue for OnceCallback binding."
" I.e.: base::BindOnce(std::move(callback)).");
static_assert(
std::conjunction<cef_internal::AssertBindArgIsNotBasePassed<
std::decay_t<Args>>...>::value,
"Use std::move() instead of base::Passed() with base::BindOnce()");
return cef_internal::BindImpl<OnceCallback>(std::forward<Functor>(functor),
std::forward<Args>(args)...);
}
///
/// Bind as RepeatingCallback.
///
template <typename Functor, typename... Args>
inline RepeatingCallback<cef_internal::MakeUnboundRunType<Functor, Args...>>
BindRepeating(Functor&& functor, Args&&... args) {
static_assert(
!cef_internal::IsOnceCallback<std::decay_t<Functor>>(),
"BindRepeating cannot bind OnceCallback. Use BindOnce with std::move().");
return cef_internal::BindImpl<RepeatingCallback>(
std::forward<Functor>(functor), std::forward<Args>(args)...);
}
///
/// Special cases for binding to a base::Callback without extra bound arguments.
/// We CHECK() the validity of callback to guard against null pointers
/// accidentally ending up in posted tasks, causing hard-to-debug crashes.
///
template <typename Signature>
OnceCallback<Signature> BindOnce(OnceCallback<Signature> callback) {
CHECK(callback);
return callback;
}
template <typename Signature>
OnceCallback<Signature> BindOnce(RepeatingCallback<Signature> callback) {
CHECK(callback);
return callback;
}
template <typename Signature>
RepeatingCallback<Signature> BindRepeating(
RepeatingCallback<Signature> callback) {
CHECK(callback);
return callback;
}
///
/// Unretained() allows binding a non-refcounted class, and to disable
/// refcounting on arguments that are refcounted objects.
///
/// EXAMPLE OF Unretained():
///
/// <pre>
/// class Foo {
/// public:
/// void func() { cout << "Foo:f" << endl; }
/// };
///
/// // In some function somewhere.
/// Foo foo;
/// OnceClosure foo_callback =
/// BindOnce(&Foo::func, Unretained(&foo));
/// std::move(foo_callback).Run(); // Prints "Foo:f".
/// </pre>
///
/// Without the Unretained() wrapper on |&foo|, the above call would fail
/// to compile because Foo does not support the AddRef() and Release() methods.
///
template <typename T>
inline cef_internal::UnretainedWrapper<T> Unretained(T* o) {
return cef_internal::UnretainedWrapper<T>(o);
}
///
/// RetainedRef() accepts a ref counted object and retains a reference to it.
/// When the callback is called, the object is passed as a raw pointer.
///
/// EXAMPLE OF RetainedRef():
///
/// <pre>
/// void foo(RefCountedBytes* bytes) {}
///
/// scoped_refptr<RefCountedBytes> bytes = ...;
/// OnceClosure callback = BindOnce(&foo, base::RetainedRef(bytes));
/// std::move(callback).Run();
/// </pre>
///
/// Without RetainedRef, the scoped_refptr would try to implicitly convert to
/// a raw pointer and fail compilation:
///
/// <pre>
/// OnceClosure callback = BindOnce(&foo, bytes); // ERROR!
/// </pre>
///
template <typename T>
inline cef_internal::RetainedRefWrapper<T> RetainedRef(T* o) {
return cef_internal::RetainedRefWrapper<T>(o);
}
template <typename T>
inline cef_internal::RetainedRefWrapper<T> RetainedRef(scoped_refptr<T> o) {
return cef_internal::RetainedRefWrapper<T>(std::move(o));
}
///
/// Owned() transfers ownership of an object to the callback resulting from
/// bind; the object will be deleted when the callback is deleted.
///
/// EXAMPLE OF Owned():
///
/// <pre>
/// void foo(int* arg) { cout << *arg << endl }
///
/// int* pn = new int(1);
/// RepeatingClosure foo_callback = BindRepeating(&foo, Owned(pn));
///
/// foo_callback.Run(); // Prints "1"
/// foo_callback.Run(); // Prints "1"
/// *pn = 2;
/// foo_callback.Run(); // Prints "2"
///
/// foo_callback.Reset(); // |pn| is deleted. Also will happen when
/// // |foo_callback| goes out of scope.
/// </pre>
///
/// Without Owned(), someone would have to know to delete |pn| when the last
/// reference to the callback is deleted.
///
template <typename T>
inline cef_internal::OwnedWrapper<T> Owned(T* o) {
return cef_internal::OwnedWrapper<T>(o);
}
template <typename T, typename Deleter>
inline cef_internal::OwnedWrapper<T, Deleter> Owned(
std::unique_ptr<T, Deleter>&& ptr) {
return cef_internal::OwnedWrapper<T, Deleter>(std::move(ptr));
}
///
/// OwnedRef() stores an object in the callback resulting from
/// bind and passes a reference to the object to the bound function.
///
/// EXAMPLE OF OwnedRef():
///
/// <pre>
/// void foo(int& arg) { cout << ++arg << endl }
///
/// int counter = 0;
/// RepeatingClosure foo_callback = BindRepeating(&foo, OwnedRef(counter));
///
/// foo_callback.Run(); // Prints "1"
/// foo_callback.Run(); // Prints "2"
/// foo_callback.Run(); // Prints "3"
///
/// cout << counter; // Prints "0", OwnedRef creates a copy of counter.
/// </pre>
///
/// Supports OnceCallbacks as well, useful to pass placeholder arguments:
///
/// <pre>
/// void bar(int& ignore, const std::string& s) { cout << s << endl }
///
/// OnceClosure bar_callback = BindOnce(&bar, OwnedRef(0), "Hello");
///
/// std::move(bar_callback).Run(); // Prints "Hello"
/// </pre>
///
/// Without OwnedRef() it would not be possible to pass a mutable reference to
/// an object owned by the callback.
///
template <typename T>
cef_internal::OwnedRefWrapper<std::decay_t<T>> OwnedRef(T&& t) {
return cef_internal::OwnedRefWrapper<std::decay_t<T>>(std::forward<T>(t));
}
///
/// Passed() is for transferring movable-but-not-copyable types (eg. unique_ptr)
/// through a RepeatingCallback. Logically, this signifies a destructive
/// transfer of the state of the argument into the target function. Invoking
/// RepeatingCallback::Run() twice on a callback that was created with a
/// Passed() argument will CHECK() because the first invocation would have
/// already transferred ownership to the target function.
///
/// Note that Passed() is not necessary with BindOnce(), as std::move() does the
/// same thing. Avoid Passed() in favor of std::move() with BindOnce().
///
/// EXAMPLE OF Passed():
///
/// <pre>
/// void TakesOwnership(std::unique_ptr<Foo> arg) { }
/// std::unique_ptr<Foo> CreateFoo() { return std::make_unique<Foo>();
/// }
///
/// auto f = std::make_unique<Foo>();
///
/// // |cb| is given ownership of Foo(). |f| is now NULL.
/// // You can use std::move(f) in place of &f, but it's more verbose.
/// RepeatingClosure cb = BindRepeating(&TakesOwnership, Passed(&f));
///
/// // Run was never called so |cb| still owns Foo() and deletes
/// // it on Reset().
/// cb.Reset();
///
/// // |cb| is given a new Foo created by CreateFoo().
/// cb = BindRepeating(&TakesOwnership, Passed(CreateFoo()));
///
/// // |arg| in TakesOwnership() is given ownership of Foo(). |cb|
/// // no longer owns Foo() and, if reset, would not delete Foo().
/// cb.Run(); // Foo() is now transferred to |arg| and deleted.
/// cb.Run(); // This CHECK()s since Foo() already been used once.
/// </pre>
///
/// We offer 2 syntaxes for calling Passed(). The first takes an rvalue and is
/// best suited for use with the return value of a function or other temporary
/// rvalues. The second takes a pointer to the scoper and is just syntactic
/// sugar to avoid having to write Passed(std::move(scoper)).
///
/// Both versions of Passed() prevent T from being an lvalue reference. The
/// first via use of enable_if, and the second takes a T* which will not bind to
/// T&.
///
template <typename T,
std::enable_if_t<!std::is_lvalue_reference<T>::value>* = nullptr>
inline cef_internal::PassedWrapper<T> Passed(T&& scoper) {
return cef_internal::PassedWrapper<T>(std::move(scoper));
}
template <typename T>
inline cef_internal::PassedWrapper<T> Passed(T* scoper) {
return cef_internal::PassedWrapper<T>(std::move(*scoper));
}
///
/// IgnoreResult() is used to adapt a function or callback with a return type to
/// one with a void return. This is most useful if you have a function with,
/// say, a pesky ignorable bool return that you want to use with PostTask or
/// something else that expect a callback with a void return.
///
/// EXAMPLE OF IgnoreResult():
///
/// <pre>
/// int DoSomething(int arg) { cout << arg << endl; }
///
/// // Assign to a callback with a void return type.
/// OnceCallback<void(int)> cb = BindOnce(IgnoreResult(&DoSomething));
/// std::move(cb).Run(1); // Prints "1".
///
/// // Prints "2" on |ml|.
/// ml->PostTask(FROM_HERE, BindOnce(IgnoreResult(&DoSomething), 2);
/// </pre>
///
template <typename T>
inline cef_internal::IgnoreResultHelper<T> IgnoreResult(T data) {
return cef_internal::IgnoreResultHelper<T>(std::move(data));
}
#if defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
///
/// RetainBlock() is used to adapt an Objective-C block when Automated Reference
/// Counting (ARC) is disabled. This is unnecessary when ARC is enabled, as the
/// BindOnce and BindRepeating already support blocks then.
///
/// EXAMPLE OF RetainBlock():
///
/// <pre>
/// // Wrap the block and bind it to a callback.
/// OnceCallback<void(int)> cb =
/// BindOnce(RetainBlock(^(int n) { NSLog(@"%d", n); }));
/// std::move(cb).Run(1); // Logs "1".
/// </pre>
///
template <typename R, typename... Args>
base::mac::ScopedBlock<R (^)(Args...)> RetainBlock(R (^block)(Args...)) {
return base::mac::ScopedBlock<R (^)(Args...)>(block,
base::scoped_policy::RETAIN);
}
#endif // defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_BIND_H_

284
include/base/cef_build.h Normal file
View File

@@ -0,0 +1,284 @@
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/// \file
/// This file adds defines about the platform we're currently building on.
///
/// <pre>
/// Operating System:
/// OS_AIX / OS_ANDROID / OS_ASMJS / OS_FREEBSD / OS_FUCHSIA / OS_IOS /
/// OS_LINUX / OS_MAC / OS_NACL (SFI or NONSFI) / OS_NETBSD / OS_OPENBSD /
/// OS_QNX / OS_SOLARIS / OS_WIN
/// Operating System family:
/// OS_APPLE: IOS or MAC
/// OS_BSD: FREEBSD or NETBSD or OPENBSD
/// OS_POSIX: AIX or ANDROID or ASMJS or CHROMEOS or FREEBSD or IOS or LINUX
/// or MAC or NACL or NETBSD or OPENBSD or QNX or SOLARIS
///
/// /!\ Note: OS_CHROMEOS is set by the build system, not this file
///
/// Compiler:
/// COMPILER_MSVC / COMPILER_GCC
///
/// Processor:
/// ARCH_CPU_ARM64 / ARCH_CPU_ARMEL / ARCH_CPU_MIPS / ARCH_CPU_MIPS64 /
/// ARCH_CPU_MIPS64EL / ARCH_CPU_MIPSEL / ARCH_CPU_PPC64 / ARCH_CPU_S390 /
/// ARCH_CPU_S390X / ARCH_CPU_X86 / ARCH_CPU_X86_64
/// Processor family:
/// ARCH_CPU_ARM_FAMILY: ARMEL or ARM64
/// ARCH_CPU_MIPS_FAMILY: MIPS64EL or MIPSEL or MIPS64 or MIPS
/// ARCH_CPU_PPC64_FAMILY: PPC64
/// ARCH_CPU_S390_FAMILY: S390 or S390X
/// ARCH_CPU_X86_FAMILY: X86 or X86_64
/// Processor features:
/// ARCH_CPU_31_BITS / ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
/// ARCH_CPU_BIG_ENDIAN / ARCH_CPU_LITTLE_ENDIAN
/// </pre>
///
#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "build/build_config.h"
#include "cef/libcef/features/features.h"
// The following #defines are used in cef/include/ headers and CEF client-side
// code. CEF library-side code should use BUILDFLAG checks directly instead of
// these #defines. CEF client-side code will get these #defines from
// cef_config.h so any changes must also be reflected in
// tools/make_config_header.py.
#if BUILDFLAG(IS_LINUX)
#include "ui/base/ozone_buildflags.h"
#if BUILDFLAG(IS_OZONE_X11)
#define CEF_X11 1
#endif
#endif
#if !BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
#define DISABLE_ALLOY_BOOTSTRAP 1
#endif
#else // !USING_CHROMIUM_INCLUDES
#include "include/cef_config.h"
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
// A set of macros to use for platform detection.
#if defined(ANDROID)
#define OS_ANDROID 1
#elif defined(__APPLE__)
// Only include TargetConditionals after testing ANDROID as some Android builds
// on the Mac have this header available and it's not needed unless the target
// is really an Apple platform.
#include <TargetConditionals.h>
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#define OS_IOS 1
#else
#define OS_MAC 1
// For backwards compatibility.
#define OS_MACOSX 1
#endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#elif defined(__linux__)
#if !defined(OS_CHROMEOS)
// Do not define OS_LINUX on Chrome OS build.
// The OS_CHROMEOS macro is defined in GN.
#define OS_LINUX 1
#endif // !defined(OS_CHROMEOS)
// Include a system header to pull in features.h for glibc/uclibc macros.
#include <unistd.h>
#if defined(__GLIBC__) && !defined(__UCLIBC__)
// We really are using glibc, not uClibc pretending to be glibc.
#define LIBC_GLIBC 1
#endif
#elif defined(_WIN32)
#define OS_WIN 1
#elif defined(__Fuchsia__)
#define OS_FUCHSIA 1
#elif defined(__FreeBSD__)
#define OS_FREEBSD 1
#elif defined(__NetBSD__)
#define OS_NETBSD 1
#elif defined(__OpenBSD__)
#define OS_OPENBSD 1
#elif defined(__sun)
#define OS_SOLARIS 1
#elif defined(__QNXNTO__)
#define OS_QNX 1
#elif defined(_AIX)
#define OS_AIX 1
#elif defined(__asmjs__) || defined(__wasm__)
#define OS_ASMJS 1
#else
#error Please add support for your platform in include/base/cef_build.h
#endif
// NOTE: Adding a new port? Please follow
// https://chromium.googlesource.com/chromium/src/+/master/docs/new_port_policy.md
#if defined(OS_MAC) || defined(OS_IOS)
#define OS_APPLE 1
#endif
// For access to standard BSD features, use OS_BSD instead of a
// more specific macro.
#if defined(OS_FREEBSD) || defined(OS_NETBSD) || defined(OS_OPENBSD)
#define OS_BSD 1
#endif
// For access to standard POSIXish features, use OS_POSIX instead of a
// more specific macro.
#if defined(OS_AIX) || defined(OS_ANDROID) || defined(OS_ASMJS) || \
defined(OS_FREEBSD) || defined(OS_IOS) || defined(OS_LINUX) || \
defined(OS_CHROMEOS) || defined(OS_MAC) || defined(OS_NACL) || \
defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_QNX) || \
defined(OS_SOLARIS)
#define OS_POSIX 1
#endif
// Compiler detection. Note: clang masquerades as GCC on POSIX and as MSVC on
// Windows.
#if defined(__GNUC__)
#define COMPILER_GCC 1
#elif defined(_MSC_VER)
#define COMPILER_MSVC 1
#else
#error Please add support for your compiler in build/build_config.h
#endif
// Processor architecture detection. For more info on what's defined, see:
// http://msdn.microsoft.com/en-us/library/b0084kay.aspx
// http://www.agner.org/optimize/calling_conventions.pdf
// or with gcc, run: "echo | gcc -E -dM -"
#if defined(_M_X64) || defined(__x86_64__)
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86_64 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(_M_IX86) || defined(__i386__)
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86 1
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__s390x__)
#define ARCH_CPU_S390_FAMILY 1
#define ARCH_CPU_S390X 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_BIG_ENDIAN 1
#elif defined(__s390__)
#define ARCH_CPU_S390_FAMILY 1
#define ARCH_CPU_S390 1
#define ARCH_CPU_31_BITS 1
#define ARCH_CPU_BIG_ENDIAN 1
#elif (defined(__PPC64__) || defined(__PPC__)) && defined(__BIG_ENDIAN__)
#define ARCH_CPU_PPC64_FAMILY 1
#define ARCH_CPU_PPC64 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_BIG_ENDIAN 1
#elif defined(__PPC64__)
#define ARCH_CPU_PPC64_FAMILY 1
#define ARCH_CPU_PPC64 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__ARMEL__)
#define ARCH_CPU_ARM_FAMILY 1
#define ARCH_CPU_ARMEL 1
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__aarch64__) || defined(_M_ARM64)
#define ARCH_CPU_ARM_FAMILY 1
#define ARCH_CPU_ARM64 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__pnacl__) || defined(__asmjs__) || defined(__wasm__)
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__MIPSEL__)
#if defined(__LP64__)
#define ARCH_CPU_MIPS_FAMILY 1
#define ARCH_CPU_MIPS64EL 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#else
#define ARCH_CPU_MIPS_FAMILY 1
#define ARCH_CPU_MIPSEL 1
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#endif
#elif defined(__MIPSEB__)
#if defined(__LP64__)
#define ARCH_CPU_MIPS_FAMILY 1
#define ARCH_CPU_MIPS64 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_BIG_ENDIAN 1
#else
#define ARCH_CPU_MIPS_FAMILY 1
#define ARCH_CPU_MIPS 1
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_BIG_ENDIAN 1
#endif
#else
#error Please add support for your architecture in include/base/cef_build.h
#endif
// Type detection for wchar_t.
#if defined(OS_WIN)
#define WCHAR_T_IS_16_BIT
#elif defined(OS_FUCHSIA)
#define WCHAR_T_IS_32_BIT
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
#define WCHAR_T_IS_32_BIT
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
// compile in this mode (in particular, Chrome doesn't). This is intended for
// other projects using base who manage their own dependencies and make sure
// short wchar works for them.
#define WCHAR_T_IS_16_BIT
#else
#error Please add support for your compiler in include/base/cef_build.h
#endif
#if defined(OS_ANDROID)
// The compiler thinks std::string::const_iterator and "const char*" are
// equivalent types.
#define STD_STRING_ITERATOR_IS_CHAR_POINTER
// The compiler thinks std::u16string::const_iterator and "char16_t*" are
// equivalent types.
#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
#endif
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_

250
include/base/cef_callback.h Normal file
View File

@@ -0,0 +1,250 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/// \file
/// A callback is similar in concept to a function pointer: it wraps a runnable
/// object such as a function, method, lambda, or even another callback,
/// allowing the runnable object to be invoked later via the callback object.
///
/// Unlike function pointers, callbacks are created with base::BindOnce() or
/// base::BindRepeating() and support partial function application.
///
/// A base::OnceCallback may be Run() at most once; a base::RepeatingCallback
/// may be Run() any number of times. |is_null()| is guaranteed to return true
/// for a moved-from callback.
///
/// <pre>
/// // The lambda takes two arguments, but the first argument |x| is bound at
/// // callback creation.
/// base::OnceCallback<int(int)> cb = base::BindOnce([] (int x, int y) {
/// return x + y;
/// }, 1);
/// // Run() only needs the remaining unbound argument |y|.
/// printf("1 + 2 = %d\n", std::move(cb).Run(2)); // Prints 3
/// printf("cb is null? %s\n",
/// cb.is_null() ? "true" : "false"); // Prints true
/// std::move(cb).Run(2); // Crashes since |cb| has already run.
/// </pre>
///
/// Callbacks also support cancellation. A common use is binding the receiver
/// object as a WeakPtr<T>. If that weak pointer is invalidated, calling Run()
/// will be a no-op. Note that |IsCancelled()| and |is_null()| are distinct:
/// simply cancelling a callback will not also make it null.
///
/// See https://chromium.googlesource.com/chromium/src/+/lkgr/docs/callback.md
/// for the full documentation.
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_H_
#define CEF_INCLUDE_BASE_CEF_CALLBACK_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/functional/callback.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <stddef.h>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback_forward.h"
#include "include/base/cef_logging.h"
#include "include/base/internal/cef_callback_internal.h"
namespace base {
template <typename R, typename... Args>
class OnceCallback<R(Args...)> : public cef_internal::CallbackBase {
public:
using ResultType = R;
using RunType = R(Args...);
using PolymorphicInvoke = R (*)(cef_internal::BindStateBase*,
cef_internal::PassingType<Args>...);
constexpr OnceCallback() = default;
OnceCallback(std::nullptr_t) = delete;
explicit OnceCallback(cef_internal::BindStateBase* bind_state)
: cef_internal::CallbackBase(bind_state) {}
OnceCallback(const OnceCallback&) = delete;
OnceCallback& operator=(const OnceCallback&) = delete;
OnceCallback(OnceCallback&&) noexcept = default;
OnceCallback& operator=(OnceCallback&&) noexcept = default;
OnceCallback(RepeatingCallback<RunType> other)
: cef_internal::CallbackBase(std::move(other)) {}
OnceCallback& operator=(RepeatingCallback<RunType> other) {
static_cast<cef_internal::CallbackBase&>(*this) = std::move(other);
return *this;
}
R Run(Args... args) const& {
static_assert(!sizeof(*this),
"OnceCallback::Run() may only be invoked on a non-const "
"rvalue, i.e. std::move(callback).Run().");
NOTREACHED();
}
R Run(Args... args) && {
// Move the callback instance into a local variable before the invocation,
// that ensures the internal state is cleared after the invocation.
// It's not safe to touch |this| after the invocation, since running the
// bound function may destroy |this|.
OnceCallback cb = std::move(*this);
PolymorphicInvoke f =
reinterpret_cast<PolymorphicInvoke>(cb.polymorphic_invoke());
return f(cb.bind_state_.get(), std::forward<Args>(args)...);
}
// Then() returns a new OnceCallback that receives the same arguments as
// |this|, and with the return type of |then|. The returned callback will:
// 1) Run the functor currently bound to |this| callback.
// 2) Run the |then| callback with the result from step 1 as its single
// argument.
// 3) Return the value from running the |then| callback.
//
// Since this method generates a callback that is a replacement for `this`,
// `this` will be consumed and reset to a null callback to ensure the
// originally-bound functor can be run at most once.
template <typename ThenR, typename... ThenArgs>
OnceCallback<ThenR(Args...)> Then(OnceCallback<ThenR(ThenArgs...)> then) && {
CHECK(then);
return BindOnce(
cef_internal::ThenHelper<
OnceCallback, OnceCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
std::move(*this), std::move(then));
}
// This overload is required; even though RepeatingCallback is implicitly
// convertible to OnceCallback, that conversion will not used when matching
// for template argument deduction.
template <typename ThenR, typename... ThenArgs>
OnceCallback<ThenR(Args...)> Then(
RepeatingCallback<ThenR(ThenArgs...)> then) && {
CHECK(then);
return BindOnce(
cef_internal::ThenHelper<
OnceCallback,
RepeatingCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
std::move(*this), std::move(then));
}
};
template <typename R, typename... Args>
class RepeatingCallback<R(Args...)>
: public cef_internal::CallbackBaseCopyable {
public:
using ResultType = R;
using RunType = R(Args...);
using PolymorphicInvoke = R (*)(cef_internal::BindStateBase*,
cef_internal::PassingType<Args>...);
constexpr RepeatingCallback() = default;
RepeatingCallback(std::nullptr_t) = delete;
explicit RepeatingCallback(cef_internal::BindStateBase* bind_state)
: cef_internal::CallbackBaseCopyable(bind_state) {}
// Copyable and movable.
RepeatingCallback(const RepeatingCallback&) = default;
RepeatingCallback& operator=(const RepeatingCallback&) = default;
RepeatingCallback(RepeatingCallback&&) noexcept = default;
RepeatingCallback& operator=(RepeatingCallback&&) noexcept = default;
bool operator==(const RepeatingCallback& other) const {
return EqualsInternal(other);
}
bool operator!=(const RepeatingCallback& other) const {
return !operator==(other);
}
R Run(Args... args) const& {
PolymorphicInvoke f =
reinterpret_cast<PolymorphicInvoke>(this->polymorphic_invoke());
return f(this->bind_state_.get(), std::forward<Args>(args)...);
}
R Run(Args... args) && {
// Move the callback instance into a local variable before the invocation,
// that ensures the internal state is cleared after the invocation.
// It's not safe to touch |this| after the invocation, since running the
// bound function may destroy |this|.
RepeatingCallback cb = std::move(*this);
PolymorphicInvoke f =
reinterpret_cast<PolymorphicInvoke>(cb.polymorphic_invoke());
return f(std::move(cb).bind_state_.get(), std::forward<Args>(args)...);
}
// Then() returns a new RepeatingCallback that receives the same arguments as
// |this|, and with the return type of |then|. The
// returned callback will:
// 1) Run the functor currently bound to |this| callback.
// 2) Run the |then| callback with the result from step 1 as its single
// argument.
// 3) Return the value from running the |then| callback.
//
// If called on an rvalue (e.g. std::move(cb).Then(...)), this method
// generates a callback that is a replacement for `this`. Therefore, `this`
// will be consumed and reset to a null callback to ensure the
// originally-bound functor will be run at most once.
template <typename ThenR, typename... ThenArgs>
RepeatingCallback<ThenR(Args...)> Then(
RepeatingCallback<ThenR(ThenArgs...)> then) const& {
CHECK(then);
return BindRepeating(
cef_internal::ThenHelper<
RepeatingCallback,
RepeatingCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
*this, std::move(then));
}
template <typename ThenR, typename... ThenArgs>
RepeatingCallback<ThenR(Args...)> Then(
RepeatingCallback<ThenR(ThenArgs...)> then) && {
CHECK(then);
return BindRepeating(
cef_internal::ThenHelper<
RepeatingCallback,
RepeatingCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
std::move(*this), std::move(then));
}
};
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_H_

View File

@@ -0,0 +1,63 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_
#define INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/functional/callback_forward.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
namespace base {
template <typename Signature>
class OnceCallback;
template <typename Signature>
class RepeatingCallback;
///
/// Syntactic sugar to make OnceClosure<void()> and RepeatingClosure<void()>
/// easier to declare since they will be used in a lot of APIs with delayed
/// execution.
///
using OnceClosure = OnceCallback<void()>;
using RepeatingClosure = RepeatingCallback<void()>;
} // namespace base
#endif // !!USING_CHROMIUM_INCLUDES
#endif // INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_

View File

@@ -0,0 +1,261 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This defines helpful methods for dealing with Callbacks. Because Callbacks
// are implemented using templates, with a class per callback signature, adding
// methods to Callback<> itself is unattractive (lots of extra code gets
// generated). Instead, consider adding methods here.
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_
#define CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/functional/callback_helpers.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <atomic>
#include <memory>
#include <type_traits>
#include <utility>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_logging.h"
namespace base {
namespace internal {
template <typename T>
struct IsBaseCallbackImpl : std::false_type {};
template <typename R, typename... Args>
struct IsBaseCallbackImpl<OnceCallback<R(Args...)>> : std::true_type {};
template <typename R, typename... Args>
struct IsBaseCallbackImpl<RepeatingCallback<R(Args...)>> : std::true_type {};
template <typename T>
struct IsOnceCallbackImpl : std::false_type {};
template <typename R, typename... Args>
struct IsOnceCallbackImpl<OnceCallback<R(Args...)>> : std::true_type {};
} // namespace internal
///
/// IsBaseCallback<T>::value is true when T is any of the Closure or Callback
/// family of types.
///
template <typename T>
using IsBaseCallback = internal::IsBaseCallbackImpl<std::decay_t<T>>;
///
/// IsOnceCallback<T>::value is true when T is a OnceClosure or OnceCallback
/// type.
///
template <typename T>
using IsOnceCallback = internal::IsOnceCallbackImpl<std::decay_t<T>>;
///
/// SFINAE friendly enabler allowing to overload methods for both Repeating and
/// OnceCallbacks.
///
/// Usage:
/// <pre>
/// template <template <typename> class CallbackType,
/// ... other template args ...,
/// typename = EnableIfIsBaseCallback<CallbackType>>
/// void DoStuff(CallbackType<...> cb, ...);
/// </pre>
///
template <template <typename> class CallbackType>
using EnableIfIsBaseCallback =
std::enable_if_t<IsBaseCallback<CallbackType<void()>>::value>;
namespace internal {
template <typename... Args>
class OnceCallbackHolder final {
public:
OnceCallbackHolder(OnceCallback<void(Args...)> callback,
bool ignore_extra_runs)
: callback_(std::move(callback)), ignore_extra_runs_(ignore_extra_runs) {
DCHECK(callback_);
}
OnceCallbackHolder(const OnceCallbackHolder&) = delete;
OnceCallbackHolder& operator=(const OnceCallbackHolder&) = delete;
void Run(Args... args) {
if (has_run_.exchange(true)) {
CHECK(ignore_extra_runs_) << "Both OnceCallbacks returned by "
"base::SplitOnceCallback() were run. "
"At most one of the pair should be run.";
return;
}
DCHECK(callback_);
std::move(callback_).Run(std::forward<Args>(args)...);
}
private:
volatile std::atomic_bool has_run_{false};
base::OnceCallback<void(Args...)> callback_;
const bool ignore_extra_runs_;
};
} // namespace internal
///
/// Wraps the given OnceCallback into a RepeatingCallback that relays its
/// invocation to the original OnceCallback on the first invocation. The
/// following invocations are just ignored.
///
/// Note that this deliberately subverts the Once/Repeating paradigm of
/// Callbacks but helps ease the migration from old-style Callbacks. Avoid if
/// possible; use if necessary for migration.
///
// TODO(tzik): Remove it. https://crbug.com/730593
template <typename... Args>
RepeatingCallback<void(Args...)> AdaptCallbackForRepeating(
OnceCallback<void(Args...)> callback) {
using Helper = internal::OnceCallbackHolder<Args...>;
return base::BindRepeating(
&Helper::Run, std::make_unique<Helper>(std::move(callback),
/*ignore_extra_runs=*/true));
}
///
/// Wraps the given OnceCallback and returns two OnceCallbacks with an identical
/// signature. On first invokation of either returned callbacks, the original
/// callback is invoked. Invoking the remaining callback results in a crash.
///
template <typename... Args>
std::pair<OnceCallback<void(Args...)>, OnceCallback<void(Args...)>>
SplitOnceCallback(OnceCallback<void(Args...)> callback) {
using Helper = internal::OnceCallbackHolder<Args...>;
auto wrapped_once = base::BindRepeating(
&Helper::Run, std::make_unique<Helper>(std::move(callback),
/*ignore_extra_runs=*/false));
return std::make_pair(wrapped_once, wrapped_once);
}
///
/// ScopedClosureRunner is akin to std::unique_ptr<> for Closures. It ensures
/// that the Closure is executed no matter how the current scope exits.
/// If you are looking for "ScopedCallback", "CallbackRunner", or
/// "CallbackScoper" this is the class you want.
///
class ScopedClosureRunner {
public:
ScopedClosureRunner();
explicit ScopedClosureRunner(OnceClosure closure);
ScopedClosureRunner(ScopedClosureRunner&& other);
// Runs the current closure if it's set, then replaces it with the closure
// from |other|. This is akin to how unique_ptr frees the contained pointer in
// its move assignment operator. If you need to explicitly avoid running any
// current closure, use ReplaceClosure().
ScopedClosureRunner& operator=(ScopedClosureRunner&& other);
~ScopedClosureRunner();
explicit operator bool() const { return !!closure_; }
// Calls the current closure and resets it, so it wont be called again.
void RunAndReset();
// Replaces closure with the new one releasing the old one without calling it.
void ReplaceClosure(OnceClosure closure);
// Releases the Closure without calling.
[[nodiscard]] OnceClosure Release();
private:
OnceClosure closure_;
};
///
/// Creates a null callback.
///
class NullCallback {
public:
template <typename R, typename... Args>
operator RepeatingCallback<R(Args...)>() const {
return RepeatingCallback<R(Args...)>();
}
template <typename R, typename... Args>
operator OnceCallback<R(Args...)>() const {
return OnceCallback<R(Args...)>();
}
};
///
/// Creates a callback that does nothing when called.
///
class DoNothing {
public:
template <typename... Args>
operator RepeatingCallback<void(Args...)>() const {
return Repeatedly<Args...>();
}
template <typename... Args>
operator OnceCallback<void(Args...)>() const {
return Once<Args...>();
}
// Explicit way of specifying a specific callback type when the compiler can't
// deduce it.
template <typename... Args>
static RepeatingCallback<void(Args...)> Repeatedly() {
return BindRepeating([](Args... args) {});
}
template <typename... Args>
static OnceCallback<void(Args...)> Once() {
return BindOnce([](Args... args) {});
}
};
///
/// Useful for creating a Closure that will delete a pointer when invoked. Only
/// use this when necessary. In most cases MessageLoop::DeleteSoon() is a better
/// fit.
///
template <typename T>
void DeletePointer(T* obj) {
delete obj;
}
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_

View File

@@ -0,0 +1,403 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2013
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///
/// \file
/// A container for a list of callbacks. Provides callers the ability to
/// manually or automatically unregister callbacks at any time, including during
/// callback notification.
///
/// TYPICAL USAGE:
///
/// <pre>
/// class MyWidget {
/// public:
/// using CallbackList = base::RepeatingCallbackList<void(const Foo&)>;
///
/// // Registers |cb| to be called whenever NotifyFoo() is executed.
/// CallbackListSubscription RegisterCallback(CallbackList::CallbackType cb) {
/// return callback_list_.Add(std::move(cb));
/// }
///
/// private:
/// // Calls all registered callbacks, with |foo| as the supplied arg.
/// void NotifyFoo(const Foo& foo) {
/// callback_list_.Notify(foo);
/// }
///
/// CallbackList callback_list_;
/// };
///
///
/// class MyWidgetListener {
/// private:
/// void OnFoo(const Foo& foo) {
/// // Called whenever MyWidget::NotifyFoo() is executed, unless
/// // |foo_subscription_| has been destroyed.
/// }
///
/// // Automatically deregisters the callback when deleted (e.g. in
/// // ~MyWidgetListener()). Unretained(this) is safe here since the
/// // ScopedClosureRunner does not outlive |this|.
/// CallbackListSubscription foo_subscription_ =
/// MyWidget::Get()->RegisterCallback(
/// base::BindRepeating(&MyWidgetListener::OnFoo,
/// base::Unretained(this)));
/// };
/// </pre>
///
/// UNSUPPORTED:
///
/// * Destroying the CallbackList during callback notification.
///
/// This is possible to support, but not currently necessary.
///
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
#define CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/functional/callback_list.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <algorithm>
#include <list>
#include <memory>
#include <utility>
#include "include/base/cef_auto_reset.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_callback_helpers.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_weak_ptr.h"
namespace base {
namespace internal {
template <typename CallbackListImpl>
class CallbackListBase;
} // namespace internal
template <typename Signature>
class OnceCallbackList;
template <typename Signature>
class RepeatingCallbackList;
// A trimmed-down version of ScopedClosureRunner that can be used to guarantee a
// closure is run on destruction. This is designed to be used by
// CallbackListBase to run CancelCallback() when this subscription dies;
// consumers can avoid callbacks on dead objects by ensuring the subscription
// returned by CallbackListBase::Add() does not outlive the bound object in the
// callback. A typical way to do this is to bind a callback to a member function
// on `this` and store the returned subscription as a member variable.
class CallbackListSubscription {
public:
CallbackListSubscription();
CallbackListSubscription(CallbackListSubscription&& subscription);
CallbackListSubscription& operator=(CallbackListSubscription&& subscription);
~CallbackListSubscription();
explicit operator bool() const { return !!closure_; }
private:
template <typename T>
friend class internal::CallbackListBase;
explicit CallbackListSubscription(base::OnceClosure closure);
void Run();
OnceClosure closure_;
};
namespace internal {
// From base/stl_util.h.
template <class T, class Allocator, class Predicate>
size_t EraseIf(std::list<T, Allocator>& container, Predicate pred) {
size_t old_size = container.size();
container.remove_if(pred);
return old_size - container.size();
}
// A traits class to break circular type dependencies between CallbackListBase
// and its subclasses.
template <typename CallbackList>
struct CallbackListTraits;
// NOTE: It's important that Callbacks provide iterator stability when items are
// added to the end, so e.g. a std::vector<> is not suitable here.
template <typename Signature>
struct CallbackListTraits<OnceCallbackList<Signature>> {
using CallbackType = OnceCallback<Signature>;
using Callbacks = std::list<CallbackType>;
};
template <typename Signature>
struct CallbackListTraits<RepeatingCallbackList<Signature>> {
using CallbackType = RepeatingCallback<Signature>;
using Callbacks = std::list<CallbackType>;
};
template <typename CallbackListImpl>
class CallbackListBase {
public:
using CallbackType =
typename CallbackListTraits<CallbackListImpl>::CallbackType;
static_assert(IsBaseCallback<CallbackType>::value, "");
// TODO(crbug.com/1103086): Update references to use this directly and by
// value, then remove.
using Subscription = CallbackListSubscription;
CallbackListBase() = default;
CallbackListBase(const CallbackListBase&) = delete;
CallbackListBase& operator=(const CallbackListBase&) = delete;
~CallbackListBase() {
// Destroying the list during iteration is unsupported and will cause a UAF.
CHECK(!iterating_);
}
// Registers |cb| for future notifications. Returns a CallbackListSubscription
// whose destruction will cancel |cb|.
[[nodiscard]] CallbackListSubscription Add(CallbackType cb) {
DCHECK(!cb.is_null());
return CallbackListSubscription(base::BindOnce(
&CallbackListBase::CancelCallback, weak_ptr_factory_.GetWeakPtr(),
callbacks_.insert(callbacks_.end(), std::move(cb))));
}
// Registers |cb| for future notifications. Provides no way for the caller to
// cancel, so this is only safe for cases where the callback is guaranteed to
// live at least as long as this list (e.g. if it's bound on the same object
// that owns the list).
// TODO(pkasting): Attempt to use Add() instead and see if callers can relax
// other lifetime/ordering mechanisms as a result.
void AddUnsafe(CallbackType cb) {
DCHECK(!cb.is_null());
callbacks_.push_back(std::move(cb));
}
// Registers |removal_callback| to be run after elements are removed from the
// list of registered callbacks.
void set_removal_callback(const RepeatingClosure& removal_callback) {
removal_callback_ = removal_callback;
}
// Returns whether the list of registered callbacks is empty (from an external
// perspective -- meaning no remaining callbacks are live).
bool empty() const {
return std::all_of(callbacks_.cbegin(), callbacks_.cend(),
[](const auto& callback) { return callback.is_null(); });
}
// Calls all registered callbacks that are not canceled beforehand. If any
// callbacks are unregistered, notifies any registered removal callback at the
// end.
//
// Arguments must be copyable, since they must be supplied to all callbacks.
// Move-only types would be destructively modified by passing them to the
// first callback and not reach subsequent callbacks as intended.
//
// Notify() may be called re-entrantly, in which case the nested call
// completes before the outer one continues. Callbacks are only ever added at
// the end and canceled callbacks are not pruned from the list until the
// outermost iteration completes, so existing iterators should never be
// invalidated. However, this does mean that a callback added during a nested
// call can be notified by outer calls -- meaning it will be notified about
// things that happened before it was added -- if its subscription outlives
// the reentrant Notify() call.
template <typename... RunArgs>
void Notify(RunArgs&&... args) {
if (empty()) {
return; // Nothing to do.
}
{
AutoReset<bool> iterating(&iterating_, true);
// Skip any callbacks that are canceled during iteration.
// NOTE: Since RunCallback() may call Add(), it's not safe to cache the
// value of callbacks_.end() across loop iterations.
const auto next_valid = [this](const auto it) {
return std::find_if_not(it, callbacks_.end(), [](const auto& callback) {
return callback.is_null();
});
};
for (auto it = next_valid(callbacks_.begin()); it != callbacks_.end();
it = next_valid(it)) {
// NOTE: Intentionally does not call std::forward<RunArgs>(args)...,
// since that would allow move-only arguments.
static_cast<CallbackListImpl*>(this)->RunCallback(it++, args...);
}
}
// Re-entrant invocations shouldn't prune anything from the list. This can
// invalidate iterators from underneath higher call frames. It's safe to
// simply do nothing, since the outermost frame will continue through here
// and prune all null callbacks below.
if (iterating_) {
return;
}
// Any null callbacks remaining in the list were canceled due to
// Subscription destruction during iteration, and can safely be erased now.
const size_t erased_callbacks =
EraseIf(callbacks_, [](const auto& cb) { return cb.is_null(); });
// Run |removal_callback_| if any callbacks were canceled. Note that we
// cannot simply compare list sizes before and after iterating, since
// notification may result in Add()ing new callbacks as well as canceling
// them. Also note that if this is a OnceCallbackList, the OnceCallbacks
// that were executed above have all been removed regardless of whether
// they're counted in |erased_callbacks_|.
if (removal_callback_ &&
(erased_callbacks || IsOnceCallback<CallbackType>::value)) {
removal_callback_.Run(); // May delete |this|!
}
}
protected:
using Callbacks = typename CallbackListTraits<CallbackListImpl>::Callbacks;
// Holds non-null callbacks, which will be called during Notify().
Callbacks callbacks_;
private:
// Cancels the callback pointed to by |it|, which is guaranteed to be valid.
void CancelCallback(const typename Callbacks::iterator& it) {
if (static_cast<CallbackListImpl*>(this)->CancelNullCallback(it)) {
return;
}
if (iterating_) {
// Calling erase() here is unsafe, since the loop in Notify() may be
// referencing this same iterator, e.g. if adjacent callbacks'
// Subscriptions are both destroyed when the first one is Run(). Just
// reset the callback and let Notify() clean it up at the end.
it->Reset();
} else {
callbacks_.erase(it);
if (removal_callback_) {
removal_callback_.Run(); // May delete |this|!
}
}
}
// Set while Notify() is traversing |callbacks_|. Used primarily to avoid
// invalidating iterators that may be in use.
bool iterating_ = false;
// Called after elements are removed from |callbacks_|.
RepeatingClosure removal_callback_;
WeakPtrFactory<CallbackListBase> weak_ptr_factory_{this};
};
} // namespace internal
template <typename Signature>
class OnceCallbackList
: public internal::CallbackListBase<OnceCallbackList<Signature>> {
private:
friend internal::CallbackListBase<OnceCallbackList>;
using Traits = internal::CallbackListTraits<OnceCallbackList>;
// Runs the current callback, which may cancel it or any other callbacks.
template <typename... RunArgs>
void RunCallback(typename Traits::Callbacks::iterator it, RunArgs&&... args) {
// OnceCallbacks still have Subscriptions with outstanding iterators;
// splice() removes them from |callbacks_| without invalidating those.
null_callbacks_.splice(null_callbacks_.end(), this->callbacks_, it);
// NOTE: Intentionally does not call std::forward<RunArgs>(args)...; see
// comments in Notify().
std::move(*it).Run(args...);
}
// If |it| refers to an already-canceled callback, does any necessary cleanup
// and returns true. Otherwise returns false.
bool CancelNullCallback(const typename Traits::Callbacks::iterator& it) {
if (it->is_null()) {
null_callbacks_.erase(it);
return true;
}
return false;
}
// Holds null callbacks whose Subscriptions are still alive, so the
// Subscriptions will still contain valid iterators. Only needed for
// OnceCallbacks, since RepeatingCallbacks are not canceled except by
// Subscription destruction.
typename Traits::Callbacks null_callbacks_;
};
template <typename Signature>
class RepeatingCallbackList
: public internal::CallbackListBase<RepeatingCallbackList<Signature>> {
private:
friend internal::CallbackListBase<RepeatingCallbackList>;
using Traits = internal::CallbackListTraits<RepeatingCallbackList>;
// Runs the current callback, which may cancel it or any other callbacks.
template <typename... RunArgs>
void RunCallback(typename Traits::Callbacks::iterator it, RunArgs&&... args) {
// NOTE: Intentionally does not call std::forward<RunArgs>(args)...; see
// comments in Notify().
it->Run(args...);
}
// If |it| refers to an already-canceled callback, does any necessary cleanup
// and returns true. Otherwise returns false.
bool CancelNullCallback(const typename Traits::Callbacks::iterator& it) {
// Because at most one Subscription can point to a given callback, and
// RepeatingCallbacks are only reset by CancelCallback(), no one should be
// able to request cancellation of a canceled RepeatingCallback.
DCHECK(!it->is_null());
return false;
}
};
///
/// Syntactic sugar to parallel that used for Callbacks.
///
using OnceClosureList = OnceCallbackList<void()>;
using RepeatingClosureList = RepeatingCallbackList<void()>;
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_

View File

@@ -0,0 +1,195 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///
/// \file
/// CancelableCallback is a wrapper around base::Callback that allows
/// cancellation of a callback. CancelableCallback takes a reference on the
/// wrapped callback until this object is destroyed or Reset()/Cancel() are
/// called.
///
/// NOTE:
///
/// Calling CancelableCallback::Cancel() brings the object back to its natural,
/// default-constructed state, i.e., CancelableCallback::callback() will return
/// a null callback.
///
/// THREAD-SAFETY:
///
/// CancelableCallback objects must be created on, posted to, cancelled on, and
/// destroyed on the same thread.
///
///
/// EXAMPLE USAGE:
///
/// In the following example, the test is verifying that RunIntensiveTest()
/// Quit()s the message loop within 4 seconds. The cancelable callback is posted
/// to the message loop, the intensive test runs, the message loop is run,
/// then the callback is cancelled.
///
/// <pre>
/// RunLoop run_loop;
///
/// void TimeoutCallback(const std::string& timeout_message) {
/// FAIL() << timeout_message;
/// run_loop.QuitWhenIdle();
/// }
///
/// CancelableOnceClosure timeout(
/// base::BindOnce(&TimeoutCallback, "Test timed out."));
/// ThreadTaskRunnerHandle::Get()->PostDelayedTask(FROM_HERE,
/// timeout.callback(),
/// TimeDelta::FromSeconds(4));
/// RunIntensiveTest();
/// run_loop.Run();
/// // Hopefully this is hit before the timeout callback runs.
/// timeout.Cancel();
/// </pre>
///
#ifndef CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
#define CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/cancelable_callback.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <utility>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_compiler_specific.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_weak_ptr.h"
#include "include/base/internal/cef_callback_internal.h"
namespace base {
namespace internal {
template <typename CallbackType>
class CancelableCallbackImpl {
public:
CancelableCallbackImpl() = default;
CancelableCallbackImpl(const CancelableCallbackImpl&) = delete;
CancelableCallbackImpl& operator=(const CancelableCallbackImpl&) = delete;
// |callback| must not be null.
explicit CancelableCallbackImpl(CallbackType callback)
: callback_(std::move(callback)) {
DCHECK(callback_);
}
~CancelableCallbackImpl() = default;
// Cancels and drops the reference to the wrapped callback.
void Cancel() {
weak_ptr_factory_.InvalidateWeakPtrs();
callback_.Reset();
}
// Returns true if the wrapped callback has been cancelled.
bool IsCancelled() const { return callback_.is_null(); }
// Sets |callback| as the closure that may be cancelled. |callback| may not
// be null. Outstanding and any previously wrapped callbacks are cancelled.
void Reset(CallbackType callback) {
DCHECK(callback);
// Outstanding tasks (e.g., posted to a message loop) must not be called.
Cancel();
callback_ = std::move(callback);
}
// Returns a callback that can be disabled by calling Cancel().
CallbackType callback() const {
if (!callback_) {
return CallbackType();
}
CallbackType forwarder;
MakeForwarder(&forwarder);
return forwarder;
}
private:
template <typename... Args>
void MakeForwarder(RepeatingCallback<void(Args...)>* out) const {
using ForwarderType = void (CancelableCallbackImpl::*)(Args...);
ForwarderType forwarder = &CancelableCallbackImpl::ForwardRepeating;
*out = BindRepeating(forwarder, weak_ptr_factory_.GetWeakPtr());
}
template <typename... Args>
void MakeForwarder(OnceCallback<void(Args...)>* out) const {
using ForwarderType = void (CancelableCallbackImpl::*)(Args...);
ForwarderType forwarder = &CancelableCallbackImpl::ForwardOnce;
*out = BindOnce(forwarder, weak_ptr_factory_.GetWeakPtr());
}
template <typename... Args>
void ForwardRepeating(Args... args) {
callback_.Run(std::forward<Args>(args)...);
}
template <typename... Args>
void ForwardOnce(Args... args) {
weak_ptr_factory_.InvalidateWeakPtrs();
std::move(callback_).Run(std::forward<Args>(args)...);
}
// The stored closure that may be cancelled.
CallbackType callback_;
mutable base::WeakPtrFactory<CancelableCallbackImpl> weak_ptr_factory_{this};
};
} // namespace internal
///
/// Consider using base::WeakPtr directly instead of base::CancelableCallback
/// for the task cancellation.
///
template <typename Signature>
using CancelableOnceCallback =
internal::CancelableCallbackImpl<OnceCallback<Signature>>;
using CancelableOnceClosure = CancelableOnceCallback<void()>;
template <typename Signature>
using CancelableRepeatingCallback =
internal::CancelableCallbackImpl<RepeatingCallback<Signature>>;
using CancelableRepeatingClosure = CancelableRepeatingCallback<void()>;
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_

View File

@@ -0,0 +1,382 @@
// Copyright (c) 2021 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_
#define CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/compiler_specific.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/cef_build.h"
// This is a wrapper around `__has_cpp_attribute`, which can be used to test for
// the presence of an attribute. In case the compiler does not support this
// macro it will simply evaluate to 0.
//
// References:
// https://wg21.link/sd6#testing-for-the-presence-of-an-attribute-__has_cpp_attribute
// https://wg21.link/cpp.cond#:__has_cpp_attribute
#if defined(__has_cpp_attribute)
#define HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
#else
#define HAS_CPP_ATTRIBUTE(x) 0
#endif
// A wrapper around `__has_builtin`, similar to HAS_CPP_ATTRIBUTE.
#if defined(__has_builtin)
#define HAS_BUILTIN(x) __has_builtin(x)
#else
#define HAS_BUILTIN(x) 0
#endif
// __has_feature and __has_attribute don't exist for MSVC.
#if !defined(__has_feature)
#define __has_feature(x) 0
#endif // !defined(__has_feature)
#if !defined(__has_attribute)
#define __has_attribute(x) 0
#endif // !defined(__has_attribute)
// Annotate a function indicating it should not be inlined.
// Use like:
// NOINLINE void DoStuff() { ... }
#if defined(COMPILER_GCC)
#define NOINLINE __attribute__((noinline))
#elif defined(COMPILER_MSVC)
#define NOINLINE __declspec(noinline)
#else
#define NOINLINE
#endif
#if defined(COMPILER_GCC) && defined(NDEBUG)
#define ALWAYS_INLINE inline __attribute__((__always_inline__))
#elif defined(COMPILER_MSVC) && defined(NDEBUG)
#define ALWAYS_INLINE __forceinline
#else
#define ALWAYS_INLINE inline
#endif
// Annotate a function indicating it should never be tail called. Useful to make
// sure callers of the annotated function are never omitted from call-stacks.
// To provide the complementary behavior (prevent the annotated function from
// being omitted) look at NOINLINE. Also note that this doesn't prevent code
// folding of multiple identical caller functions into a single signature. To
// prevent code folding, see NO_CODE_FOLDING() in base/debug/alias.h.
// Use like:
// void NOT_TAIL_CALLED FooBar();
#if defined(__clang__) && __has_attribute(not_tail_called)
#define NOT_TAIL_CALLED __attribute__((not_tail_called))
#else
#define NOT_TAIL_CALLED
#endif
// Specify memory alignment for structs, classes, etc.
// Use like:
// class ALIGNAS(16) MyClass { ... }
// ALIGNAS(16) int array[4];
//
// In most places you can use the C++11 keyword "alignas", which is preferred.
//
// But compilers have trouble mixing __attribute__((...)) syntax with
// alignas(...) syntax.
//
// Doesn't work in clang or gcc:
// struct alignas(16) __attribute__((packed)) S { char c; };
// Works in clang but not gcc:
// struct __attribute__((packed)) alignas(16) S2 { char c; };
// Works in clang and gcc:
// struct alignas(16) S3 { char c; } __attribute__((packed));
//
// There are also some attributes that must be specified *before* a class
// definition: visibility (used for exporting functions/classes) is one of
// these attributes. This means that it is not possible to use alignas() with a
// class that is marked as exported.
#if defined(COMPILER_MSVC)
#define ALIGNAS(byte_alignment) __declspec(align(byte_alignment))
#elif defined(COMPILER_GCC)
#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
#endif
// In case the compiler supports it NO_UNIQUE_ADDRESS evaluates to the C++20
// attribute [[no_unique_address]]. This allows annotating data members so that
// they need not have an address distinct from all other non-static data members
// of its class.
//
// References:
// * https://en.cppreference.com/w/cpp/language/attributes/no_unique_address
// * https://wg21.link/dcl.attr.nouniqueaddr
#if HAS_CPP_ATTRIBUTE(no_unique_address)
#define NO_UNIQUE_ADDRESS [[no_unique_address]]
#else
#define NO_UNIQUE_ADDRESS
#endif
// Tell the compiler a function is using a printf-style format string.
// |format_param| is the one-based index of the format string parameter;
// |dots_param| is the one-based index of the "..." parameter.
// For v*printf functions (which take a va_list), pass 0 for dots_param.
// (This is undocumented but matches what the system C headers do.)
// For member functions, the implicit this parameter counts as index 1.
#if defined(COMPILER_GCC) || defined(__clang__)
#define PRINTF_FORMAT(format_param, dots_param) \
__attribute__((format(printf, format_param, dots_param)))
#else
#define PRINTF_FORMAT(format_param, dots_param)
#endif
// WPRINTF_FORMAT is the same, but for wide format strings.
// This doesn't appear to yet be implemented in any compiler.
// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 .
#define WPRINTF_FORMAT(format_param, dots_param)
// If available, it would look like:
// __attribute__((format(wprintf, format_param, dots_param)))
// Sanitizers annotations.
#if defined(__has_attribute)
#if __has_attribute(no_sanitize)
#define NO_SANITIZE(what) __attribute__((no_sanitize(what)))
#endif
#endif
#if !defined(NO_SANITIZE)
#define NO_SANITIZE(what)
#endif
// MemorySanitizer annotations.
#if defined(MEMORY_SANITIZER) && !defined(OS_NACL)
#include <sanitizer/msan_interface.h>
// Mark a memory region fully initialized.
// Use this to annotate code that deliberately reads uninitialized data, for
// example a GC scavenging root set pointers from the stack.
#define MSAN_UNPOISON(p, size) __msan_unpoison(p, size)
// Check a memory region for initializedness, as if it was being used here.
// If any bits are uninitialized, crash with an MSan report.
// Use this to sanitize data which MSan won't be able to track, e.g. before
// passing data to another process via shared memory.
#define MSAN_CHECK_MEM_IS_INITIALIZED(p, size) \
__msan_check_mem_is_initialized(p, size)
#else // MEMORY_SANITIZER
#define MSAN_UNPOISON(p, size)
#define MSAN_CHECK_MEM_IS_INITIALIZED(p, size)
#endif // MEMORY_SANITIZER
// DISABLE_CFI_PERF -- Disable Control Flow Integrity for perf reasons.
#if !defined(DISABLE_CFI_PERF)
#if defined(__clang__) && defined(OFFICIAL_BUILD)
#define DISABLE_CFI_PERF __attribute__((no_sanitize("cfi")))
#else
#define DISABLE_CFI_PERF
#endif
#endif
// DISABLE_CFI_ICALL -- Disable Control Flow Integrity indirect call checks.
#if !defined(DISABLE_CFI_ICALL)
#if defined(OS_WIN)
// Windows also needs __declspec(guard(nocf)).
#define DISABLE_CFI_ICALL NO_SANITIZE("cfi-icall") __declspec(guard(nocf))
#else
#define DISABLE_CFI_ICALL NO_SANITIZE("cfi-icall")
#endif
#endif
#if !defined(DISABLE_CFI_ICALL)
#define DISABLE_CFI_ICALL
#endif
// Macro useful for writing cross-platform function pointers.
#if !defined(CDECL)
#if defined(OS_WIN)
#define CDECL __cdecl
#else // defined(OS_WIN)
#define CDECL
#endif // defined(OS_WIN)
#endif // !defined(CDECL)
// Macro for hinting that an expression is likely to be false.
#if !defined(UNLIKELY)
#if defined(COMPILER_GCC) || defined(__clang__)
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
#else
#define UNLIKELY(x) (x)
#endif // defined(COMPILER_GCC)
#endif // !defined(UNLIKELY)
#if !defined(LIKELY)
#if defined(COMPILER_GCC) || defined(__clang__)
#define LIKELY(x) __builtin_expect(!!(x), 1)
#else
#define LIKELY(x) (x)
#endif // defined(COMPILER_GCC)
#endif // !defined(LIKELY)
// Compiler feature-detection.
// clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension
#if defined(__has_feature)
#define HAS_FEATURE(FEATURE) __has_feature(FEATURE)
#else
#define HAS_FEATURE(FEATURE) 0
#endif
#if defined(COMPILER_GCC)
#define PRETTY_FUNCTION __PRETTY_FUNCTION__
#elif defined(COMPILER_MSVC)
#define PRETTY_FUNCTION __FUNCSIG__
#else
// See https://en.cppreference.com/w/c/language/function_definition#func
#define PRETTY_FUNCTION __func__
#endif
#if !defined(CPU_ARM_NEON)
#if defined(__arm__)
#if !defined(__ARMEB__) && !defined(__ARM_EABI__) && !defined(__EABI__) && \
!defined(__VFP_FP__) && !defined(_WIN32_WCE) && !defined(ANDROID)
#error Chromium does not support middle endian architecture
#endif
#if defined(__ARM_NEON__)
#define CPU_ARM_NEON 1
#endif
#endif // defined(__arm__)
#endif // !defined(CPU_ARM_NEON)
#if !defined(HAVE_MIPS_MSA_INTRINSICS)
#if defined(__mips_msa) && defined(__mips_isa_rev) && (__mips_isa_rev >= 5)
#define HAVE_MIPS_MSA_INTRINSICS 1
#endif
#endif
#if defined(__clang__) && __has_attribute(uninitialized)
// Attribute "uninitialized" disables -ftrivial-auto-var-init=pattern for
// the specified variable.
// Library-wide alternative is
// 'configs -= [ "//build/config/compiler:default_init_stack_vars" ]' in .gn
// file.
//
// See "init_stack_vars" in build/config/compiler/BUILD.gn and
// http://crbug.com/977230
// "init_stack_vars" is enabled for non-official builds and we hope to enable it
// in official build in 2020 as well. The flag writes fixed pattern into
// uninitialized parts of all local variables. In rare cases such initialization
// is undesirable and attribute can be used:
// 1. Degraded performance
// In most cases compiler is able to remove additional stores. E.g. if memory is
// never accessed or properly initialized later. Preserved stores mostly will
// not affect program performance. However if compiler failed on some
// performance critical code we can get a visible regression in a benchmark.
// 2. memset, memcpy calls
// Compiler may replaces some memory writes with memset or memcpy calls. This is
// not -ftrivial-auto-var-init specific, but it can happen more likely with the
// flag. It can be a problem if code is not linked with C run-time library.
//
// Note: The flag is security risk mitigation feature. So in future the
// attribute uses should be avoided when possible. However to enable this
// mitigation on the most of the code we need to be less strict now and minimize
// number of exceptions later. So if in doubt feel free to use attribute, but
// please document the problem for someone who is going to cleanup it later.
// E.g. platform, bot, benchmark or test name in patch description or next to
// the attribute.
#define STACK_UNINITIALIZED __attribute__((uninitialized))
#else
#define STACK_UNINITIALIZED
#endif
// The ANALYZER_ASSUME_TRUE(bool arg) macro adds compiler-specific hints
// to Clang which control what code paths are statically analyzed,
// and is meant to be used in conjunction with assert & assert-like functions.
// The expression is passed straight through if analysis isn't enabled.
//
// ANALYZER_SKIP_THIS_PATH() suppresses static analysis for the current
// codepath and any other branching codepaths that might follow.
#if defined(__clang_analyzer__)
inline constexpr bool AnalyzerNoReturn() __attribute__((analyzer_noreturn)) {
return false;
}
inline constexpr bool AnalyzerAssumeTrue(bool arg) {
// AnalyzerNoReturn() is invoked and analysis is terminated if |arg| is
// false.
return arg || AnalyzerNoReturn();
}
#define ANALYZER_ASSUME_TRUE(arg) ::AnalyzerAssumeTrue(!!(arg))
#define ANALYZER_SKIP_THIS_PATH() static_cast<void>(::AnalyzerNoReturn())
#define ANALYZER_ALLOW_UNUSED(var) static_cast<void>(var);
#else // !defined(__clang_analyzer__)
#define ANALYZER_ASSUME_TRUE(arg) (arg)
#define ANALYZER_SKIP_THIS_PATH()
#define ANALYZER_ALLOW_UNUSED(var) static_cast<void>(var);
#endif // defined(__clang_analyzer__)
// Use nomerge attribute to disable optimization of merging multiple same calls.
#if defined(__clang__) && __has_attribute(nomerge)
#define NOMERGE [[clang::nomerge]]
#else
#define NOMERGE
#endif
// Marks a type as being eligible for the "trivial" ABI despite having a
// non-trivial destructor or copy/move constructor. Such types can be relocated
// after construction by simply copying their memory, which makes them eligible
// to be passed in registers. The canonical example is std::unique_ptr.
//
// Use with caution; this has some subtle effects on constructor/destructor
// ordering and will be very incorrect if the type relies on its address
// remaining constant. When used as a function argument (by value), the value
// may be constructed in the caller's stack frame, passed in a register, and
// then used and destructed in the callee's stack frame. A similar thing can
// occur when values are returned.
//
// TRIVIAL_ABI is not needed for types which have a trivial destructor and
// copy/move constructors, such as base::TimeTicks and other POD.
//
// It is also not likely to be effective on types too large to be passed in one
// or two registers on typical target ABIs.
//
// See also:
// https://clang.llvm.org/docs/AttributeReference.html#trivial-abi
// https://libcxx.llvm.org/docs/DesignDocs/UniquePtrTrivialAbi.html
#if defined(__clang__) && __has_attribute(trivial_abi)
#define TRIVIAL_ABI [[clang::trivial_abi]]
#else
#define TRIVIAL_ABI
#endif
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_

182
include/base/cef_lock.h Normal file
View File

@@ -0,0 +1,182 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_LOCK_H_
#define CEF_INCLUDE_BASE_CEF_LOCK_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/synchronization/lock.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/cef_logging.h"
#include "include/base/cef_platform_thread.h"
#include "include/base/internal/cef_lock_impl.h"
namespace base {
namespace cef_internal {
///
/// A convenient wrapper for an OS specific critical section. The only real
/// intelligence in this class is in debug mode for the support for the
/// AssertAcquired() method.
///
class Lock {
public:
#if !DCHECK_IS_ON() // Optimized wrapper implementation
Lock() : lock_() {}
Lock(const Lock&) = delete;
Lock& operator=(const Lock&) = delete;
~Lock() {}
void Acquire() { lock_.Lock(); }
void Release() { lock_.Unlock(); }
///
/// If the lock is not held, take it and return true. If the lock is already
/// held by another thread, immediately return false. This must not be called
/// by a thread already holding the lock (what happens is undefined and an
/// assertion may fail).
///
bool Try() { return lock_.Try(); }
// Null implementation if not debug.
void AssertAcquired() const {}
#else
Lock();
~Lock();
// NOTE: Although windows critical sections support recursive locks, we do not
// allow this, and we will commonly fire a DCHECK() if a thread attempts to
// acquire the lock a second time (while already holding it).
void Acquire() {
lock_.Lock();
CheckUnheldAndMark();
}
void Release() {
CheckHeldAndUnmark();
lock_.Unlock();
}
bool Try() {
bool rv = lock_.Try();
if (rv) {
CheckUnheldAndMark();
}
return rv;
}
void AssertAcquired() const;
#endif // !DCHECK_IS_ON()
private:
#if DCHECK_IS_ON()
// Members and routines taking care of locks assertions.
// Note that this checks for recursive locks and allows them
// if the variable is set. This is allowed by the underlying implementation
// on windows but not on Posix, so we're doing unneeded checks on Posix.
// It's worth it to share the code.
void CheckHeldAndUnmark();
void CheckUnheldAndMark();
// All private data is implicitly protected by lock_.
// Be VERY careful to only access members under that lock.
base::PlatformThreadRef owning_thread_ref_;
#endif // DCHECK_IS_ON()
// Platform specific underlying lock implementation.
LockImpl lock_;
};
///
/// A helper class that acquires the given Lock while the AutoLock is in scope.
///
class AutoLock {
public:
struct AlreadyAcquired {};
explicit AutoLock(Lock& lock) : lock_(lock) { lock_.Acquire(); }
AutoLock(Lock& lock, const AlreadyAcquired&) : lock_(lock) {
lock_.AssertAcquired();
}
AutoLock(const AutoLock&) = delete;
AutoLock& operator=(const AutoLock&) = delete;
~AutoLock() {
lock_.AssertAcquired();
lock_.Release();
}
private:
Lock& lock_;
};
///
/// AutoUnlock is a helper that will Release() the |lock| argument in the
/// constructor, and re-Acquire() it in the destructor.
///
class AutoUnlock {
public:
explicit AutoUnlock(Lock& lock) : lock_(lock) {
// We require our caller to have the lock.
lock_.AssertAcquired();
lock_.Release();
}
AutoUnlock(const AutoUnlock&) = delete;
AutoUnlock& operator=(const AutoUnlock&) = delete;
~AutoUnlock() { lock_.Acquire(); }
private:
Lock& lock_;
};
} // namespace cef_internal
// Implement classes in the cef_internal namespace and then expose them to the
// base namespace. This avoids conflicts with the base.lib implementation when
// linking sandbox support on Windows.
using cef_internal::AutoLock;
using cef_internal::AutoUnlock;
using cef_internal::Lock;
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_LOCK_H_

785
include/base/cef_logging.h Normal file
View File

@@ -0,0 +1,785 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///
/// \file
/// A bunch of macros for logging.
///
/// NOTE: The contents of this file are only available to applications that link
/// against the libcef_dll_wrapper target.
///
/// WARNING: Logging macros should not be used in the main/browser process
/// before calling CefInitialize or in sub-processes before calling
/// CefExecuteProcess.
///
/// INSTRUCTIONS:
///
/// The way to log things is to stream things to LOG(<a particular severity
/// level>). E.g.,
///
/// <pre>
/// LOG(INFO) << "Found " << num_cookies << " cookies";
/// </pre>
///
/// You can also do conditional logging:
///
/// <pre>
/// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
/// </pre>
///
/// The CHECK(condition) macro is active in both debug and release builds and
/// effectively performs a LOG(FATAL) which terminates the process and
/// generates a crashdump unless a debugger is attached.
///
/// There are also "debug mode" logging macros like the ones above:
///
/// <pre>
/// DLOG(INFO) << "Found cookies";
///
/// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
/// </pre>
///
/// All "debug mode" logging is compiled away to nothing for non-debug mode
/// compiles. LOG_IF and development flags also work well together
/// because the code can be compiled away sometimes.
///
/// We also have
///
/// <pre>
/// LOG_ASSERT(assertion);
/// DLOG_ASSERT(assertion);
/// </pre>
///
/// which is syntactic sugar for "{,D}LOG_IF(FATAL, assert fails) << assertion;"
///
/// There are "verbose level" logging macros. They look like
///
/// <pre>
/// VLOG(1) << "I'm printed when you run the program with --v=1 or more";
/// VLOG(2) << "I'm printed when you run the program with --v=2 or more";
/// </pre>
///
/// These always log at the INFO log level (when they log at all).
/// The verbose logging can also be turned on module-by-module. For instance,
/// <pre>
/// --vmodule=profile=2,icon_loader=1,browser_*=3,*/chromeos/*=4 --v=0
/// </pre>
/// will cause:
/// 1. VLOG(2) and lower messages to be printed from profile.{h,cc}
/// 2. VLOG(1) and lower messages to be printed from icon_loader.{h,cc}
/// 3. VLOG(3) and lower messages to be printed from files prefixed with
/// "browser"
/// 4. VLOG(4) and lower messages to be printed from files under a
/// "chromeos" directory.
/// 5. VLOG(0) and lower messages to be printed from elsewhere
///
/// The wildcarding functionality shown by (c) supports both '*' (match
/// 0 or more characters) and '?' (match any single character)
/// wildcards. Any pattern containing a forward or backward slash will
/// be tested against the whole pathname and not just the module.
/// E.g., "*/foo/bar/*=2" would change the logging level for all code
/// in source files under a "foo/bar" directory.
///
/// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as
///
/// <pre>
/// if (VLOG_IS_ON(2)) {
/// // do some logging preparation and logging
/// // that can't be accomplished with just VLOG(2) << ...;
/// }
/// </pre>
///
/// There is also a VLOG_IF "verbose level" condition macro for sample
/// cases, when some extra computation and preparation for logs is not
/// needed.
///
/// <pre>
/// VLOG_IF(1, (size > 1024))
/// << "I'm printed when size is more than 1024 and when you run the "
/// "program with --v=1 or more";
/// </pre>
///
/// We also override the standard 'assert' to use 'DLOG_ASSERT'.
///
/// Lastly, there is:
///
/// <pre>
/// PLOG(ERROR) << "Couldn't do foo";
/// DPLOG(ERROR) << "Couldn't do foo";
/// PLOG_IF(ERROR, cond) << "Couldn't do foo";
/// DPLOG_IF(ERROR, cond) << "Couldn't do foo";
/// PCHECK(condition) << "Couldn't do foo";
/// DPCHECK(condition) << "Couldn't do foo";
/// </pre>
///
/// which append the last system error to the message in string form (taken from
/// GetLastError() on Windows and errno on POSIX).
///
/// The supported severity levels for macros that allow you to specify one
/// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL.
///
/// Very important: logging a message at the FATAL severity level causes
/// the program to terminate (after the message is logged).
///
/// There is the special severity of DFATAL, which logs FATAL in debug mode,
/// ERROR in normal mode.
///
#ifndef CEF_INCLUDE_BASE_CEF_LOGGING_H_
#define CEF_INCLUDE_BASE_CEF_LOGGING_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/logging.h"
#include "base/notreached.h"
#elif defined(DCHECK)
// Do nothing if the macros provided by this header already exist.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts.
// Always define the DCHECK_IS_ON macro which is used from other CEF headers.
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
#define DCHECK_IS_ON() false
#else
#define DCHECK_IS_ON() true
#endif
#else // !defined(DCHECK)
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <cassert>
#include <cstring>
#include <sstream>
#include <string>
#include "include/base/cef_build.h"
#include "include/internal/cef_logging_internal.h"
namespace cef {
namespace logging {
// Gets the current log level.
inline int GetMinLogLevel() {
return cef_get_min_log_level();
}
// Gets the current vlog level for the given file (usually taken from
// __FILE__). Note that |N| is the size *with* the null terminator.
template <size_t N>
int GetVlogLevel(const char (&file)[N]) {
return cef_get_vlog_level(file, N);
}
typedef int LogSeverity;
const LogSeverity LOG_VERBOSE = -1; // This is level 1 verbosity
// Note: the log severities are used to index into the array of names,
// see log_severity_names.
const LogSeverity LOG_INFO = 0;
const LogSeverity LOG_WARNING = 1;
const LogSeverity LOG_ERROR = 2;
const LogSeverity LOG_FATAL = 3;
const LogSeverity LOG_NUM_SEVERITIES = 4;
// LOG_DFATAL is LOG_FATAL in debug mode, ERROR in normal mode
#ifdef NDEBUG
const LogSeverity LOG_DFATAL = LOG_ERROR;
#else
const LogSeverity LOG_DFATAL = LOG_FATAL;
#endif
// A few definitions of macros that don't generate much code. These are used
// by LOG() and LOG_IF, etc. Since these are used all over our code, it's
// better to have compact code for these operations.
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_INFO, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_WARNING, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_ERROR, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_FATAL, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_DFATAL, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(LogMessage)
#define COMPACT_GOOGLE_LOG_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
#define COMPACT_GOOGLE_LOG_ERROR COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage)
#define COMPACT_GOOGLE_LOG_FATAL COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage)
#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage)
#if defined(OS_WIN)
// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets
// substituted with 0, and it expands to COMPACT_GOOGLE_LOG_0. To allow us
// to keep using this syntax, we define this macro to do the same thing
// as COMPACT_GOOGLE_LOG_ERROR, and also define ERROR the same way that
// the Windows SDK does for consistency.
#define ERROR 0
#define COMPACT_GOOGLE_LOG_EX_0(ClassName, ...) \
COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR
// Needed for LOG_IS_ON(ERROR).
const LogSeverity LOG_0 = LOG_ERROR;
#endif
// As special cases, we can assume that LOG_IS_ON(FATAL) always holds. Also,
// LOG_IS_ON(DFATAL) always holds in debug mode. In particular, CHECK()s will
// always fire if they fail.
#define LOG_IS_ON(severity) \
((::cef::logging::LOG_##severity) >= ::cef::logging::GetMinLogLevel())
// We can't do any caching tricks with VLOG_IS_ON() like the
// google-glog version since it requires GCC extensions. This means
// that using the v-logging functions in conjunction with --vmodule
// may be slow.
#define VLOG_IS_ON(verboselevel) \
((verboselevel) <= ::cef::logging::GetVlogLevel(__FILE__))
// Helper macro which avoids evaluating the arguments to a stream if
// the condition doesn't hold.
#define LAZY_STREAM(stream, condition) \
!(condition) ? (void)0 : ::cef::logging::LogMessageVoidify() & (stream)
// We use the preprocessor's merging operator, "##", so that, e.g.,
// LOG(INFO) becomes the token COMPACT_GOOGLE_LOG_INFO. There's some funny
// subtle difference between ostream member streaming functions (e.g.,
// ostream::operator<<(int) and ostream non-member streaming functions
// (e.g., ::operator<<(ostream&, string&): it turns out that it's
// impossible to stream something like a string directly to an unnamed
// ostream. We employ a neat hack by calling the stream() member
// function of LogMessage which seems to avoid the problem.
#define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_##severity.stream()
#define LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
#define LOG_IF(severity, condition) \
LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity) && (condition))
#define SYSLOG(severity) LOG(severity)
#define SYSLOG_IF(severity, condition) LOG_IF(severity, condition)
// The VLOG macros log with negative verbosities.
#define VLOG_STREAM(verbose_level) \
cef::logging::LogMessage(__FILE__, __LINE__, -verbose_level).stream()
#define VLOG(verbose_level) \
LAZY_STREAM(VLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level))
#define VLOG_IF(verbose_level, condition) \
LAZY_STREAM(VLOG_STREAM(verbose_level), \
VLOG_IS_ON(verbose_level) && (condition))
#if defined(OS_WIN)
#define VPLOG_STREAM(verbose_level) \
cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \
::cef::logging::GetLastSystemErrorCode()) \
.stream()
#elif defined(OS_POSIX)
#define VPLOG_STREAM(verbose_level) \
cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \
::cef::logging::GetLastSystemErrorCode()) \
.stream()
#endif
#define VPLOG(verbose_level) \
LAZY_STREAM(VPLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level))
#define VPLOG_IF(verbose_level, condition) \
LAZY_STREAM(VPLOG_STREAM(verbose_level), \
VLOG_IS_ON(verbose_level) && (condition))
// TODO(akalin): Add more VLOG variants, e.g. VPLOG.
#define LOG_ASSERT(condition) \
LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". "
#define SYSLOG_ASSERT(condition) \
SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". "
#if defined(OS_WIN)
#define PLOG_STREAM(severity) \
COMPACT_GOOGLE_LOG_EX_##severity(Win32ErrorLogMessage, \
::cef::logging::GetLastSystemErrorCode()) \
.stream()
#elif defined(OS_POSIX)
#define PLOG_STREAM(severity) \
COMPACT_GOOGLE_LOG_EX_##severity(ErrnoLogMessage, \
::cef::logging::GetLastSystemErrorCode()) \
.stream()
#endif
#define PLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
#define PLOG_IF(severity, condition) \
LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition))
// The actual stream used isn't important.
#define EAT_STREAM_PARAMETERS \
true ? (void)0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL)
// CHECK dies with a fatal error if condition is not true. It is *not*
// controlled by NDEBUG, so the check will be executed regardless of
// compilation mode.
//
// We make sure CHECK et al. always evaluates their arguments, as
// doing CHECK(FunctionWithSideEffect()) is a common idiom.
#define CHECK(condition) \
LAZY_STREAM(LOG_STREAM(FATAL), !(condition)) \
<< "Check failed: " #condition ". "
#define PCHECK(condition) \
LAZY_STREAM(PLOG_STREAM(FATAL), !(condition)) \
<< "Check failed: " #condition ". "
// Helper macro for binary operators.
// Don't use this macro directly in your code, use CHECK_EQ et al below.
//
// TODO(akalin): Rewrite this so that constructs like if (...)
// CHECK_EQ(...) else { ... } work properly.
#define CHECK_OP(name, op, val1, val2) \
if (std::string* _result = cef::logging::Check##name##Impl( \
(val1), (val2), #val1 " " #op " " #val2)) \
cef::logging::LogMessage(__FILE__, __LINE__, _result).stream()
// Build the error message string. This is separate from the "Impl"
// function template because it is not performance critical and so can
// be out of line, while the "Impl" code should be inline. Caller
// takes ownership of the returned string.
template <class t1, class t2>
std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
std::ostringstream ss;
ss << names << " (" << v1 << " vs. " << v2 << ")";
std::string* msg = new std::string(ss.str());
return msg;
}
// MSVC doesn't like complex extern templates and DLLs.
#if !defined(COMPILER_MSVC)
// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated
// in logging.cc.
extern template std::string* MakeCheckOpString<int, int>(const int&,
const int&,
const char* names);
extern template std::string* MakeCheckOpString<unsigned long, unsigned long>(
const unsigned long&,
const unsigned long&,
const char* names);
extern template std::string* MakeCheckOpString<unsigned long, unsigned int>(
const unsigned long&,
const unsigned int&,
const char* names);
extern template std::string* MakeCheckOpString<unsigned int, unsigned long>(
const unsigned int&,
const unsigned long&,
const char* names);
extern template std::string* MakeCheckOpString<std::string, std::string>(
const std::string&,
const std::string&,
const char* name);
#endif
// Helper functions for CHECK_OP macro.
// The (int, int) specialization works around the issue that the compiler
// will not instantiate the template version of the function on values of
// unnamed enum type - see comment below.
#define DEFINE_CHECK_OP_IMPL(name, op) \
template <class t1, class t2> \
inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \
const char* names) { \
if (v1 op v2) \
return NULL; \
else \
return MakeCheckOpString(v1, v2, names); \
} \
inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \
if (v1 op v2) \
return NULL; \
else \
return MakeCheckOpString(v1, v2, names); \
}
DEFINE_CHECK_OP_IMPL(EQ, ==)
DEFINE_CHECK_OP_IMPL(NE, !=)
DEFINE_CHECK_OP_IMPL(LE, <=)
DEFINE_CHECK_OP_IMPL(LT, <)
DEFINE_CHECK_OP_IMPL(GE, >=)
DEFINE_CHECK_OP_IMPL(GT, >)
#undef DEFINE_CHECK_OP_IMPL
#define CHECK_EQ(val1, val2) CHECK_OP(EQ, ==, val1, val2)
#define CHECK_NE(val1, val2) CHECK_OP(NE, !=, val1, val2)
#define CHECK_LE(val1, val2) CHECK_OP(LE, <=, val1, val2)
#define CHECK_LT(val1, val2) CHECK_OP(LT, <, val1, val2)
#define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2)
#define CHECK_GT(val1, val2) CHECK_OP(GT, >, val1, val2)
#if defined(NDEBUG)
#define ENABLE_DLOG 0
#else
#define ENABLE_DLOG 1
#endif
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
#define DCHECK_IS_ON() 0
#else
#define DCHECK_IS_ON() 1
#endif
// Definitions for DLOG et al.
#if ENABLE_DLOG
#define DLOG_IS_ON(severity) LOG_IS_ON(severity)
#define DLOG_IF(severity, condition) LOG_IF(severity, condition)
#define DLOG_ASSERT(condition) LOG_ASSERT(condition)
#define DPLOG_IF(severity, condition) PLOG_IF(severity, condition)
#define DVLOG_IF(verboselevel, condition) VLOG_IF(verboselevel, condition)
#define DVPLOG_IF(verboselevel, condition) VPLOG_IF(verboselevel, condition)
#else // ENABLE_DLOG
// If ENABLE_DLOG is off, we want to avoid emitting any references to
// |condition| (which may reference a variable defined only if NDEBUG
// is not defined). Contrast this with DCHECK et al., which has
// different behavior.
#define DLOG_IS_ON(severity) false
#define DLOG_IF(severity, condition) EAT_STREAM_PARAMETERS
#define DLOG_ASSERT(condition) EAT_STREAM_PARAMETERS
#define DPLOG_IF(severity, condition) EAT_STREAM_PARAMETERS
#define DVLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS
#define DVPLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS
#endif // ENABLE_DLOG
// DEBUG_MODE is for uses like
// if (DEBUG_MODE) foo.CheckThatFoo();
// instead of
// #ifndef NDEBUG
// foo.CheckThatFoo();
// #endif
//
// We tie its state to ENABLE_DLOG.
enum { DEBUG_MODE = ENABLE_DLOG };
#undef ENABLE_DLOG
#define DLOG(severity) LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity))
#define DPLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
#define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel))
#define DVPLOG(verboselevel) DVPLOG_IF(verboselevel, VLOG_IS_ON(verboselevel))
// Definitions for DCHECK et al.
#if DCHECK_IS_ON()
#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \
COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL
const LogSeverity LOG_DCHECK = LOG_FATAL;
#else // DCHECK_IS_ON()
// These are just dummy values.
#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \
COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_INFO
const LogSeverity LOG_DCHECK = LOG_INFO;
#endif // DCHECK_IS_ON()
// DCHECK et al. make sure to reference |condition| regardless of
// whether DCHECKs are enabled; this is so that we don't get unused
// variable warnings if the only use of a variable is in a DCHECK.
// This behavior is different from DLOG_IF et al.
#define DCHECK(condition) \
LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
<< "Check failed: " #condition ". "
#define DPCHECK(condition) \
LAZY_STREAM(PLOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
<< "Check failed: " #condition ". "
// Helper macro for binary operators.
// Don't use this macro directly in your code, use DCHECK_EQ et al below.
#define DCHECK_OP(name, op, val1, val2) \
if (DCHECK_IS_ON()) \
if (std::string* _result = cef::logging::Check##name##Impl( \
(val1), (val2), #val1 " " #op " " #val2)) \
cef::logging::LogMessage(__FILE__, __LINE__, ::cef::logging::LOG_DCHECK, \
_result) \
.stream()
// Equality/Inequality checks - compare two values, and log a
// LOG_DCHECK message including the two values when the result is not
// as expected. The values must have operator<<(ostream, ...)
// defined.
//
// You may append to the error message like so:
// DCHECK_NE(1, 2) << ": The world must be ending!";
//
// We are very careful to ensure that each argument is evaluated exactly
// once, and that anything which is legal to pass as a function argument is
// legal here. In particular, the arguments may be temporary expressions
// which will end up being destroyed at the end of the apparent statement,
// for example:
// DCHECK_EQ(string("abc")[1], 'b');
//
// WARNING: These may not compile correctly if one of the arguments is a pointer
// and the other is NULL. To work around this, simply static_cast NULL to the
// type of the desired pointer.
#define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2)
#define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2)
#define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2)
#define DCHECK_LT(val1, val2) DCHECK_OP(LT, <, val1, val2)
#define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2)
#define DCHECK_GT(val1, val2) DCHECK_OP(GT, >, val1, val2)
#define NOTREACHED() DCHECK(false)
// Redefine the standard assert to use our nice log files
#undef assert
#define assert(x) DLOG_ASSERT(x)
// This class more or less represents a particular log message. You
// create an instance of LogMessage and then stream stuff to it.
// When you finish streaming to it, ~LogMessage is called and the
// full message gets streamed to the appropriate destination.
//
// You shouldn't actually use LogMessage's constructor to log things,
// though. You should use the LOG() macro (and variants thereof)
// above.
class LogMessage {
public:
// Used for LOG(severity).
LogMessage(const char* file, int line, LogSeverity severity);
// Used for CHECK_EQ(), etc. Takes ownership of the given string.
// Implied severity = LOG_FATAL.
LogMessage(const char* file, int line, std::string* result);
// Used for DCHECK_EQ(), etc. Takes ownership of the given string.
LogMessage(const char* file,
int line,
LogSeverity severity,
std::string* result);
LogMessage(const LogMessage&) = delete;
LogMessage& operator=(const LogMessage&) = delete;
~LogMessage();
std::ostream& stream() { return stream_; }
private:
LogSeverity severity_;
std::ostringstream stream_;
// The file and line information passed in to the constructor.
const char* file_;
const int line_;
#if defined(OS_WIN)
// Stores the current value of GetLastError in the constructor and restores
// it in the destructor by calling SetLastError.
// This is useful since the LogMessage class uses a lot of Win32 calls
// that will lose the value of GLE and the code that called the log function
// will have lost the thread error value when the log call returns.
class SaveLastError {
public:
SaveLastError();
~SaveLastError();
unsigned long get_error() const { return last_error_; }
protected:
unsigned long last_error_;
};
SaveLastError last_error_;
#endif
};
// A non-macro interface to the log facility; (useful
// when the logging level is not a compile-time constant).
inline void LogAtLevel(int const log_level, std::string const& msg) {
LogMessage(__FILE__, __LINE__, log_level).stream() << msg;
}
// This class is used to explicitly ignore values in the conditional
// logging macros. This avoids compiler warnings like "value computed
// is not used" and "statement has no effect".
class LogMessageVoidify {
public:
LogMessageVoidify() {}
// This has to be an operator with a precedence lower than << but
// higher than ?:
void operator&(std::ostream&) {}
};
#if defined(OS_WIN)
typedef unsigned long SystemErrorCode;
#elif defined(OS_POSIX)
typedef int SystemErrorCode;
#endif
// Alias for ::GetLastError() on Windows and errno on POSIX. Avoids having to
// pull in windows.h just for GetLastError() and DWORD.
SystemErrorCode GetLastSystemErrorCode();
std::string SystemErrorCodeToString(SystemErrorCode error_code);
#if defined(OS_WIN)
// Appends a formatted system message of the GetLastError() type.
class Win32ErrorLogMessage {
public:
Win32ErrorLogMessage(const char* file,
int line,
LogSeverity severity,
SystemErrorCode err);
Win32ErrorLogMessage(const Win32ErrorLogMessage&) = delete;
Win32ErrorLogMessage& operator=(const Win32ErrorLogMessage&) = delete;
// Appends the error message before destructing the encapsulated class.
~Win32ErrorLogMessage();
std::ostream& stream() { return log_message_.stream(); }
private:
SystemErrorCode err_;
LogMessage log_message_;
};
#elif defined(OS_POSIX)
// Appends a formatted system message of the errno type
class ErrnoLogMessage {
public:
ErrnoLogMessage(const char* file,
int line,
LogSeverity severity,
SystemErrorCode err);
ErrnoLogMessage(const ErrnoLogMessage&) = delete;
ErrnoLogMessage& operator=(const ErrnoLogMessage&) = delete;
// Appends the error message before destructing the encapsulated class.
~ErrnoLogMessage();
std::ostream& stream() { return log_message_.stream(); }
private:
SystemErrorCode err_;
LogMessage log_message_;
};
#endif // OS_WIN
} // namespace logging
} // namespace cef
// These functions are provided as a convenience for logging, which is where we
// use streams (it is against Google style to use streams in other places). It
// is designed to allow you to emit non-ASCII Unicode strings to the log file,
// which is normally ASCII. It is relatively slow, so try not to use it for
// common cases. Non-ASCII characters will be converted to UTF-8 by these
// operators.
std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
return out << wstr.c_str();
}
#if defined(WCHAR_T_IS_32_BIT)
std::ostream& operator<<(std::ostream& out, const char16_t* wstr);
#elif defined(WCHAR_T_IS_16_BIT)
inline std::ostream& operator<<(std::ostream& out, const char16_t* wstr) {
return operator<<(out, reinterpret_cast<const wchar_t*>(wstr));
}
#endif
// The NOTIMPLEMENTED() macro annotates codepaths which have
// not been implemented yet.
//
// The implementation of this macro is controlled by NOTIMPLEMENTED_POLICY:
// 0 -- Do nothing (stripped by compiler)
// 1 -- Warn at compile time
// 2 -- Fail at compile time
// 3 -- Fail at runtime (DCHECK)
// 4 -- [default] LOG(ERROR) at runtime
// 5 -- LOG(ERROR) at runtime, only once per call-site
#ifndef NOTIMPLEMENTED_POLICY
#if defined(OS_ANDROID) && defined(OFFICIAL_BUILD)
#define NOTIMPLEMENTED_POLICY 0
#else
// Select default policy: LOG(ERROR)
#define NOTIMPLEMENTED_POLICY 4
#endif
#endif
#if defined(COMPILER_GCC)
// On Linux, with GCC, we can use __PRETTY_FUNCTION__ to get the demangled name
// of the current function in the NOTIMPLEMENTED message.
#define NOTIMPLEMENTED_MSG "Not implemented reached in " << __PRETTY_FUNCTION__
#else
#define NOTIMPLEMENTED_MSG "NOT IMPLEMENTED"
#endif
#if NOTIMPLEMENTED_POLICY == 0
#define NOTIMPLEMENTED() EAT_STREAM_PARAMETERS
#elif NOTIMPLEMENTED_POLICY == 1
// TODO, figure out how to generate a warning
#define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED)
#elif NOTIMPLEMENTED_POLICY == 2
#define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED)
#elif NOTIMPLEMENTED_POLICY == 3
#define NOTIMPLEMENTED() NOTREACHED()
#elif NOTIMPLEMENTED_POLICY == 4
#define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG
#elif NOTIMPLEMENTED_POLICY == 5
#define NOTIMPLEMENTED() \
do { \
static bool logged_once = false; \
LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG; \
logged_once = true; \
} while (0); \
EAT_STREAM_PARAMETERS
#endif
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_LOGGING_H_

63
include/base/cef_macros.h Normal file
View File

@@ -0,0 +1,63 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_MACROS_H_
#define CEF_INCLUDE_BASE_CEF_MACROS_H_
#pragma once
#if !defined(USING_CHROMIUM_INCLUDES)
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
// ALL DISALLOW_xxx MACROS ARE DEPRECATED; DO NOT USE IN NEW CODE.
// Use explicit deletions instead. For more information see
// https://chromium.googlesource.com/chromium/src/+/lkgr/styleguide/c++/c++-dos-and-donts.md#explicitly-declare-class-copyability_movability
// DEPRECATED: See above. Makes a class uncopyable.
#define DISALLOW_COPY(TypeName) TypeName(const TypeName&) = delete
// DEPRECATED: See above. Makes a class unassignable.
#define DISALLOW_ASSIGN(TypeName) TypeName& operator=(const TypeName&) = delete
// DEPRECATED: See above. Makes a class uncopyable and unassignable.
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
DISALLOW_COPY(TypeName); \
DISALLOW_ASSIGN(TypeName)
// DEPRECATED: See above. Disallow all implicit constructors, namely the
// default constructor, copy constructor and operator= functions.
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
TypeName() = delete; \
DISALLOW_COPY_AND_ASSIGN(TypeName)
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_MACROS_H_

View File

@@ -0,0 +1,110 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// WARNING: You should *NOT* be using this class directly. PlatformThread is
// the low-level platform-specific abstraction to the OS's threading interface.
// You should instead be using a message-loop driven Thread, see thread.h.
#ifndef CEF_INCLUDE_BASE_PLATFORM_THREAD_H_
#define CEF_INCLUDE_BASE_PLATFORM_THREAD_H_
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/threading/platform_thread.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/cef_build.h"
#include "include/internal/cef_thread_internal.h"
namespace base {
///
/// Used for logging. Always an integer value.
///
typedef cef_platform_thread_id_t PlatformThreadId;
///
/// Used for thread checking and debugging.
/// Meant to be as fast as possible.
/// These are produced by PlatformThread::CurrentRef(), and used to later
/// check if we are on the same thread or not by using ==. These are safe
/// to copy between threads, but can't be copied to another process as they
/// have no meaning there. Also, the internal identifier can be re-used
/// after a thread dies, so a PlatformThreadRef cannot be reliably used
/// to distinguish a new thread from an old, dead thread.
///
class PlatformThreadRef {
public:
typedef cef_platform_thread_handle_t RefType;
PlatformThreadRef() : id_(0) {}
explicit PlatformThreadRef(RefType id) : id_(id) {}
bool operator==(PlatformThreadRef other) const { return id_ == other.id_; }
bool is_null() const { return id_ == 0; }
private:
RefType id_;
};
///
/// A namespace for low-level thread functions.
/// Chromium uses a class with static methods but CEF uses an actual namespace
/// to avoid linker problems with the sandbox libaries on Windows.
///
namespace PlatformThread {
///
/// Gets the current thread id, which may be useful for logging purposes.
///
inline PlatformThreadId CurrentId() {
return cef_get_current_platform_thread_id();
}
///
/// Gets the current thread reference, which can be used to check if
/// we're on the right thread quickly.
///
inline PlatformThreadRef CurrentRef() {
return PlatformThreadRef(cef_get_current_platform_thread_handle());
}
} // namespace PlatformThread
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_PLATFORM_THREAD_H_

View File

@@ -0,0 +1,511 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_
#define CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/memory/ref_counted.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <stddef.h>
#include <utility>
#include "include/base/cef_atomic_ref_count.h"
#include "include/base/cef_build.h"
#include "include/base/cef_compiler_specific.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_scoped_refptr.h"
#include "include/base/cef_thread_checker.h"
namespace base {
namespace cef_subtle {
class RefCountedBase {
public:
bool HasOneRef() const { return ref_count_ == 1; }
bool HasAtLeastOneRef() const { return ref_count_ >= 1; }
protected:
explicit RefCountedBase(StartRefCountFromZeroTag) {
#if DCHECK_IS_ON()
thread_checker_.DetachFromThread();
#endif
}
explicit RefCountedBase(StartRefCountFromOneTag) : ref_count_(1) {
#if DCHECK_IS_ON()
needs_adopt_ref_ = true;
thread_checker_.DetachFromThread();
#endif
}
RefCountedBase(const RefCountedBase&) = delete;
RefCountedBase& operator=(const RefCountedBase&) = delete;
~RefCountedBase() {
#if DCHECK_IS_ON()
DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()";
#endif
}
void AddRef() const {
#if DCHECK_IS_ON()
DCHECK(!in_dtor_);
DCHECK(!needs_adopt_ref_)
<< "This RefCounted object is created with non-zero reference count."
<< " The first reference to such a object has to be made by AdoptRef or"
<< " MakeRefCounted.";
if (ref_count_ >= 1) {
DCHECK(CalledOnValidThread());
}
#endif
AddRefImpl();
}
// Returns true if the object should self-delete.
bool Release() const {
ReleaseImpl();
#if DCHECK_IS_ON()
DCHECK(!in_dtor_);
if (ref_count_ == 0) {
in_dtor_ = true;
}
if (ref_count_ >= 1) {
DCHECK(CalledOnValidThread());
}
if (ref_count_ == 1) {
thread_checker_.DetachFromThread();
}
#endif
return ref_count_ == 0;
}
// Returns true if it is safe to read or write the object, from a thread
// safety standpoint. Should be DCHECK'd from the methods of RefCounted
// classes if there is a danger of objects being shared across threads.
//
// This produces fewer false positives than adding a separate ThreadChecker
// into the subclass, because it automatically detaches from the thread when
// the reference count is 1 (and never fails if there is only one reference).
//
// This means unlike a separate ThreadChecker, it will permit a singly
// referenced object to be passed between threads (not holding a reference on
// the sending thread), but will trap if the sending thread holds onto a
// reference, or if the object is accessed from multiple threads
// simultaneously.
bool IsOnValidThread() const {
#if DCHECK_IS_ON()
return ref_count_ <= 1 || CalledOnValidThread();
#else
return true;
#endif
}
private:
template <typename U>
friend scoped_refptr<U> base::AdoptRef(U*);
void Adopted() const {
#if DCHECK_IS_ON()
DCHECK(needs_adopt_ref_);
needs_adopt_ref_ = false;
#endif
}
#if defined(ARCH_CPU_64_BITS)
void AddRefImpl() const;
void ReleaseImpl() const;
#else
void AddRefImpl() const { ++ref_count_; }
void ReleaseImpl() const { --ref_count_; }
#endif
#if DCHECK_IS_ON()
bool CalledOnValidThread() const;
#endif
mutable uint32_t ref_count_ = 0;
static_assert(std::is_unsigned<decltype(ref_count_)>::value,
"ref_count_ must be an unsigned type.");
#if DCHECK_IS_ON()
mutable bool needs_adopt_ref_ = false;
mutable bool in_dtor_ = false;
mutable ThreadChecker thread_checker_;
#endif
};
class RefCountedThreadSafeBase {
public:
bool HasOneRef() const;
bool HasAtLeastOneRef() const;
protected:
explicit constexpr RefCountedThreadSafeBase(StartRefCountFromZeroTag) {}
explicit constexpr RefCountedThreadSafeBase(StartRefCountFromOneTag)
: ref_count_(1) {
#if DCHECK_IS_ON()
needs_adopt_ref_ = true;
#endif
}
RefCountedThreadSafeBase(const RefCountedThreadSafeBase&) = delete;
RefCountedThreadSafeBase& operator=(const RefCountedThreadSafeBase&) = delete;
#if DCHECK_IS_ON()
~RefCountedThreadSafeBase();
#else
~RefCountedThreadSafeBase() = default;
#endif
// Release and AddRef are suitable for inlining on X86 because they generate
// very small code threads. On other platforms (ARM), it causes a size
// regression and is probably not worth it.
#if defined(ARCH_CPU_X86_FAMILY)
// Returns true if the object should self-delete.
bool Release() const { return ReleaseImpl(); }
void AddRef() const { AddRefImpl(); }
void AddRefWithCheck() const { AddRefWithCheckImpl(); }
#else
// Returns true if the object should self-delete.
bool Release() const;
void AddRef() const;
void AddRefWithCheck() const;
#endif
private:
template <typename U>
friend scoped_refptr<U> base::AdoptRef(U*);
void Adopted() const {
#if DCHECK_IS_ON()
DCHECK(needs_adopt_ref_);
needs_adopt_ref_ = false;
#endif
}
ALWAYS_INLINE void AddRefImpl() const {
#if DCHECK_IS_ON()
DCHECK(!in_dtor_);
DCHECK(!needs_adopt_ref_)
<< "This RefCounted object is created with non-zero reference count."
<< " The first reference to such a object has to be made by AdoptRef or"
<< " MakeRefCounted.";
#endif
ref_count_.Increment();
}
ALWAYS_INLINE void AddRefWithCheckImpl() const {
#if DCHECK_IS_ON()
DCHECK(!in_dtor_);
DCHECK(!needs_adopt_ref_)
<< "This RefCounted object is created with non-zero reference count."
<< " The first reference to such a object has to be made by AdoptRef or"
<< " MakeRefCounted.";
#endif
CHECK(ref_count_.Increment() > 0);
}
ALWAYS_INLINE bool ReleaseImpl() const {
#if DCHECK_IS_ON()
DCHECK(!in_dtor_);
DCHECK(!ref_count_.IsZero());
#endif
if (!ref_count_.Decrement()) {
#if DCHECK_IS_ON()
in_dtor_ = true;
#endif
return true;
}
return false;
}
mutable AtomicRefCount ref_count_{0};
#if DCHECK_IS_ON()
mutable bool needs_adopt_ref_ = false;
mutable bool in_dtor_ = false;
#endif
};
// ScopedAllowCrossThreadRefCountAccess disables the check documented on
// RefCounted below for rare pre-existing use cases where thread-safety was
// guaranteed through other means (e.g. explicit sequencing of calls across
// execution threads when bouncing between threads in order). New callers
// should refrain from using this (callsites handling thread-safety through
// locks should use RefCountedThreadSafe per the overhead of its atomics being
// negligible compared to locks anyways and callsites doing explicit sequencing
// should properly std::move() the ref to avoid hitting this check).
// TODO(tzik): Cleanup existing use cases and remove
// ScopedAllowCrossThreadRefCountAccess.
class ScopedAllowCrossThreadRefCountAccess final {
public:
#if DCHECK_IS_ON()
ScopedAllowCrossThreadRefCountAccess();
~ScopedAllowCrossThreadRefCountAccess();
#else
ScopedAllowCrossThreadRefCountAccess() {}
~ScopedAllowCrossThreadRefCountAccess() {}
#endif
};
} // namespace cef_subtle
using ScopedAllowCrossThreadRefCountAccess =
cef_subtle::ScopedAllowCrossThreadRefCountAccess;
///
/// The reference count starts from zero by default, and we intended to migrate
/// to start-from-one ref count. Put REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() to
/// the ref counted class to opt-in.
///
/// If an object has start-from-one ref count, the first scoped_refptr need to
/// be created by base::AdoptRef() or base::MakeRefCounted(). We can use
/// base::MakeRefCounted() to create create both type of ref counted object.
///
/// The motivations to use start-from-one ref count are:
/// - Start-from-one ref count doesn't need the ref count increment for the
/// first reference.
/// - It can detect an invalid object acquisition for a being-deleted object
/// that has zero ref count. That tends to happen on custom deleter that
/// delays the deletion.
/// TODO(tzik): Implement invalid acquisition detection.
/// - Behavior parity to Blink's WTF::RefCounted, whose count starts from one.
/// And start-from-one ref count is a step to merge WTF::RefCounted into
/// base::RefCounted.
///
#define REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() \
static constexpr ::base::cef_subtle::StartRefCountFromOneTag \
kRefCountPreference = ::base::cef_subtle::kStartRefCountFromOneTag
template <class T, typename Traits>
class RefCounted;
///
/// Default traits for RefCounted<T>. Deletes the object when its ref count
/// reaches 0. Overload to delete it on a different thread etc.
///
template <typename T>
struct DefaultRefCountedTraits {
static void Destruct(const T* x) {
RefCounted<T, DefaultRefCountedTraits>::DeleteInternal(x);
}
};
///
/// A base class for reference counted classes. Otherwise, known as a cheap
/// knock-off of WebKit's RefCounted<T> class. To use this, just extend your
/// class from it like so:
///
/// <pre>
/// class MyFoo : public base::RefCounted<MyFoo> {
/// ...
/// private:
/// friend class base::RefCounted<MyFoo>;
/// ~MyFoo();
/// };
/// </pre>
///
/// Usage Notes:
/// 1. You should always make your destructor non-public, to avoid any code
/// deleting the object accidentally while there are references to it.
/// 2. You should always make the ref-counted base class a friend of your class,
/// so that it can access the destructor.
///
/// The ref count manipulation to RefCounted is NOT thread safe and has DCHECKs
/// to trap unsafe cross thread usage. A subclass instance of RefCounted can be
/// passed to another execution thread only when its ref count is 1. If the ref
/// count is more than 1, the RefCounted class verifies the ref updates are made
/// on the same execution thread as the previous ones. The subclass can also
/// manually call IsOnValidThread to trap other non-thread-safe accesses; see
/// the documentation for that method.
///
template <class T, typename Traits = DefaultRefCountedTraits<T>>
class RefCounted : public cef_subtle::RefCountedBase {
public:
static constexpr cef_subtle::StartRefCountFromZeroTag kRefCountPreference =
cef_subtle::kStartRefCountFromZeroTag;
RefCounted() : cef_subtle::RefCountedBase(T::kRefCountPreference) {}
RefCounted(const RefCounted&) = delete;
RefCounted& operator=(const RefCounted&) = delete;
void AddRef() const { cef_subtle::RefCountedBase::AddRef(); }
void Release() const {
if (cef_subtle::RefCountedBase::Release()) {
// Prune the code paths which the static analyzer may take to simulate
// object destruction. Use-after-free errors aren't possible given the
// lifetime guarantees of the refcounting system.
ANALYZER_SKIP_THIS_PATH();
Traits::Destruct(static_cast<const T*>(this));
}
}
protected:
~RefCounted() = default;
private:
friend struct DefaultRefCountedTraits<T>;
template <typename U>
static void DeleteInternal(const U* x) {
delete x;
}
};
// Forward declaration.
template <class T, typename Traits>
class RefCountedThreadSafe;
///
/// Default traits for RefCountedThreadSafe<T>. Deletes the object when its ref
/// count reaches 0. Overload to delete it on a different thread etc.
///
template <typename T>
struct DefaultRefCountedThreadSafeTraits {
static void Destruct(const T* x) {
// Delete through RefCountedThreadSafe to make child classes only need to be
// friend with RefCountedThreadSafe instead of this struct, which is an
// implementation detail.
RefCountedThreadSafe<T, DefaultRefCountedThreadSafeTraits>::DeleteInternal(
x);
}
};
///
/// A thread-safe variant of RefCounted<T>
///
/// <pre>
/// class MyFoo : public base::RefCountedThreadSafe<MyFoo> {
/// ...
/// };
/// </pre>
///
/// If you're using the default trait, then you should add compile time
/// asserts that no one else is deleting your object. i.e.
/// <pre>
/// private:
/// friend class base::RefCountedThreadSafe<MyFoo>;
/// ~MyFoo();
/// </pre>
///
/// We can use REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() with RefCountedThreadSafe
/// too. See the comment above the RefCounted definition for details.
///
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T>>
class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
public:
static constexpr cef_subtle::StartRefCountFromZeroTag kRefCountPreference =
cef_subtle::kStartRefCountFromZeroTag;
explicit RefCountedThreadSafe()
: cef_subtle::RefCountedThreadSafeBase(T::kRefCountPreference) {}
RefCountedThreadSafe(const RefCountedThreadSafe&) = delete;
RefCountedThreadSafe& operator=(const RefCountedThreadSafe&) = delete;
void AddRef() const { AddRefImpl(T::kRefCountPreference); }
void Release() const {
if (cef_subtle::RefCountedThreadSafeBase::Release()) {
ANALYZER_SKIP_THIS_PATH();
Traits::Destruct(static_cast<const T*>(this));
}
}
protected:
~RefCountedThreadSafe() = default;
private:
friend struct DefaultRefCountedThreadSafeTraits<T>;
template <typename U>
static void DeleteInternal(const U* x) {
delete x;
}
void AddRefImpl(cef_subtle::StartRefCountFromZeroTag) const {
cef_subtle::RefCountedThreadSafeBase::AddRef();
}
void AddRefImpl(cef_subtle::StartRefCountFromOneTag) const {
cef_subtle::RefCountedThreadSafeBase::AddRefWithCheck();
}
};
///
/// A thread-safe wrapper for some piece of data so we can place other
/// things in scoped_refptrs<>.
///
template <typename T>
class RefCountedData
: public base::RefCountedThreadSafe<base::RefCountedData<T>> {
public:
RefCountedData() : data() {}
RefCountedData(const T& in_value) : data(in_value) {}
RefCountedData(T&& in_value) : data(std::move(in_value)) {}
template <typename... Args>
explicit RefCountedData(std::in_place_t, Args&&... args)
: data(std::forward<Args>(args)...) {}
T data;
private:
friend class base::RefCountedThreadSafe<base::RefCountedData<T>>;
~RefCountedData() = default;
};
template <typename T>
bool operator==(const RefCountedData<T>& lhs, const RefCountedData<T>& rhs) {
return lhs.data == rhs.data;
}
template <typename T>
bool operator!=(const RefCountedData<T>& lhs, const RefCountedData<T>& rhs) {
return !(lhs == rhs);
}
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_

View File

@@ -0,0 +1,420 @@
// Copyright (c) 2017 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_SCOPED_REFPTR_H_
#define CEF_INCLUDE_BASE_CEF_SCOPED_REFPTR_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/memory/scoped_refptr.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <stddef.h>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "include/base/cef_logging.h"
template <class T>
class scoped_refptr;
namespace base {
template <class, typename>
class RefCounted;
template <class, typename>
class RefCountedThreadSafe;
class SequencedTaskRunner;
class WrappedPromise;
template <typename T>
scoped_refptr<T> AdoptRef(T* t);
namespace internal {
class BasePromise;
} // namespace internal
namespace cef_subtle {
enum AdoptRefTag { kAdoptRefTag };
enum StartRefCountFromZeroTag { kStartRefCountFromZeroTag };
enum StartRefCountFromOneTag { kStartRefCountFromOneTag };
template <typename T, typename U, typename V>
constexpr bool IsRefCountPreferenceOverridden(const T*,
const RefCounted<U, V>*) {
return !std::is_same<std::decay_t<decltype(T::kRefCountPreference)>,
std::decay_t<decltype(U::kRefCountPreference)>>::value;
}
template <typename T, typename U, typename V>
constexpr bool IsRefCountPreferenceOverridden(
const T*,
const RefCountedThreadSafe<U, V>*) {
return !std::is_same<std::decay_t<decltype(T::kRefCountPreference)>,
std::decay_t<decltype(U::kRefCountPreference)>>::value;
}
constexpr bool IsRefCountPreferenceOverridden(...) {
return false;
}
} // namespace cef_subtle
// Creates a scoped_refptr from a raw pointer without incrementing the reference
// count. Use this only for a newly created object whose reference count starts
// from 1 instead of 0.
template <typename T>
scoped_refptr<T> AdoptRef(T* obj) {
using Tag = std::decay_t<decltype(T::kRefCountPreference)>;
static_assert(std::is_same<cef_subtle::StartRefCountFromOneTag, Tag>::value,
"Use AdoptRef only if the reference count starts from one.");
DCHECK(obj);
DCHECK(obj->HasOneRef());
obj->Adopted();
return scoped_refptr<T>(obj, cef_subtle::kAdoptRefTag);
}
namespace cef_subtle {
template <typename T>
scoped_refptr<T> AdoptRefIfNeeded(T* obj, StartRefCountFromZeroTag) {
return scoped_refptr<T>(obj);
}
template <typename T>
scoped_refptr<T> AdoptRefIfNeeded(T* obj, StartRefCountFromOneTag) {
return AdoptRef(obj);
}
} // namespace cef_subtle
// Constructs an instance of T, which is a ref counted type, and wraps the
// object into a scoped_refptr<T>.
template <typename T, typename... Args>
scoped_refptr<T> MakeRefCounted(Args&&... args) {
T* obj = new T(std::forward<Args>(args)...);
return cef_subtle::AdoptRefIfNeeded(obj, T::kRefCountPreference);
}
// Takes an instance of T, which is a ref counted type, and wraps the object
// into a scoped_refptr<T>.
template <typename T>
scoped_refptr<T> WrapRefCounted(T* t) {
return scoped_refptr<T>(t);
}
} // namespace base
///
/// A smart pointer class for reference counted objects. Use this class instead
/// of calling AddRef and Release manually on a reference counted object to
/// avoid common memory leaks caused by forgetting to Release an object
/// reference. Sample usage:
///
/// <pre>
/// class MyFoo : public RefCounted<MyFoo> {
/// ...
/// private:
/// friend class RefCounted<MyFoo>; // Allow destruction by RefCounted<>.
/// ~MyFoo(); // Destructor must be
/// private/protected.
/// };
///
/// void some_function() {
/// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
/// foo->Method(param);
/// // |foo| is released when this function returns
/// }
///
/// void some_other_function() {
/// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
/// ...
/// foo.reset(); // explicitly releases |foo|
/// ...
/// if (foo)
/// foo->Method(param);
/// }
/// </pre>
///
/// The above examples show how scoped_refptr<T> acts like a pointer to T.
/// Given two scoped_refptr<T> classes, it is also possible to exchange
/// references between the two objects, like so:
///
/// <pre>
/// {
/// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
/// scoped_refptr<MyFoo> b;
///
/// b.swap(a);
/// // now, |b| references the MyFoo object, and |a| references nullptr.
/// }
/// </pre>
///
/// To make both |a| and |b| in the above example reference the same MyFoo
/// object, simply use the assignment operator:
///
/// <pre>
/// {
/// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
/// scoped_refptr<MyFoo> b;
///
/// b = a;
/// // now, |a| and |b| each own a reference to the same MyFoo object.
/// }
/// </pre>
///
/// Also see Chromium's ownership and calling conventions:
/// https://chromium.googlesource.com/chromium/src/+/lkgr/styleguide/c++/c++.md#object-ownership-and-calling-conventions
/// Specifically:
/// If the function (at least sometimes) takes a ref on a refcounted object,
/// declare the param as scoped_refptr<T>. The caller can decide whether it
/// wishes to transfer ownership (by calling std::move(t) when passing t) or
/// retain its ref (by simply passing t directly).
/// In other words, use scoped_refptr like you would a std::unique_ptr except
/// in the odd case where it's required to hold on to a ref while handing one
/// to another component (if a component merely needs to use t on the stack
/// without keeping a ref: pass t as a raw T*).
///
template <class T>
class TRIVIAL_ABI scoped_refptr {
public:
typedef T element_type;
constexpr scoped_refptr() = default;
// Allow implicit construction from nullptr.
constexpr scoped_refptr(std::nullptr_t) {}
// Constructs from a raw pointer. Note that this constructor allows implicit
// conversion from T* to scoped_refptr<T> which is strongly discouraged. If
// you are creating a new ref-counted object please use
// base::MakeRefCounted<T>() or base::WrapRefCounted<T>(). Otherwise you
// should move or copy construct from an existing scoped_refptr<T> to the
// ref-counted object.
scoped_refptr(T* p) : ptr_(p) {
if (ptr_) {
AddRef(ptr_);
}
}
// Copy constructor. This is required in addition to the copy conversion
// constructor below.
scoped_refptr(const scoped_refptr& r) : scoped_refptr(r.ptr_) {}
// Copy conversion constructor.
template <typename U,
typename = typename std::enable_if<
std::is_convertible<U*, T*>::value>::type>
scoped_refptr(const scoped_refptr<U>& r) : scoped_refptr(r.ptr_) {}
// Move constructor. This is required in addition to the move conversion
// constructor below.
scoped_refptr(scoped_refptr&& r) noexcept : ptr_(r.ptr_) { r.ptr_ = nullptr; }
// Move conversion constructor.
template <typename U,
typename = typename std::enable_if<
std::is_convertible<U*, T*>::value>::type>
scoped_refptr(scoped_refptr<U>&& r) noexcept : ptr_(r.ptr_) {
r.ptr_ = nullptr;
}
~scoped_refptr() {
static_assert(!base::cef_subtle::IsRefCountPreferenceOverridden(
static_cast<T*>(nullptr), static_cast<T*>(nullptr)),
"It's unsafe to override the ref count preference."
" Please remove REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE"
" from subclasses.");
if (ptr_) {
Release(ptr_);
}
}
T* get() const { return ptr_; }
T& operator*() const {
DCHECK(ptr_);
return *ptr_;
}
T* operator->() const {
DCHECK(ptr_);
return ptr_;
}
scoped_refptr& operator=(std::nullptr_t) {
reset();
return *this;
}
scoped_refptr& operator=(T* p) { return *this = scoped_refptr(p); }
// Unified assignment operator.
scoped_refptr& operator=(scoped_refptr r) noexcept {
swap(r);
return *this;
}
// Sets managed object to null and releases reference to the previous managed
// object, if it existed.
void reset() { scoped_refptr().swap(*this); }
// Returns the owned pointer (if any), releasing ownership to the caller. The
// caller is responsible for managing the lifetime of the reference.
[[nodiscard]] T* release();
void swap(scoped_refptr& r) noexcept { std::swap(ptr_, r.ptr_); }
explicit operator bool() const { return ptr_ != nullptr; }
template <typename U>
bool operator==(const scoped_refptr<U>& rhs) const {
return ptr_ == rhs.get();
}
template <typename U>
bool operator!=(const scoped_refptr<U>& rhs) const {
return !operator==(rhs);
}
template <typename U>
bool operator<(const scoped_refptr<U>& rhs) const {
return ptr_ < rhs.get();
}
protected:
T* ptr_ = nullptr;
private:
template <typename U>
friend scoped_refptr<U> base::AdoptRef(U*);
friend class ::base::SequencedTaskRunner;
// Friend access so these classes can use the constructor below as part of a
// binary size optimization.
friend class ::base::internal::BasePromise;
friend class ::base::WrappedPromise;
scoped_refptr(T* p, base::cef_subtle::AdoptRefTag) : ptr_(p) {}
// Friend required for move constructors that set r.ptr_ to null.
template <typename U>
friend class scoped_refptr;
// Non-inline helpers to allow:
// class Opaque;
// extern template class scoped_refptr<Opaque>;
// Otherwise the compiler will complain that Opaque is an incomplete type.
static void AddRef(T* ptr);
static void Release(T* ptr);
};
template <typename T>
T* scoped_refptr<T>::release() {
T* ptr = ptr_;
ptr_ = nullptr;
return ptr;
}
// static
template <typename T>
void scoped_refptr<T>::AddRef(T* ptr) {
ptr->AddRef();
}
// static
template <typename T>
void scoped_refptr<T>::Release(T* ptr) {
ptr->Release();
}
template <typename T, typename U>
bool operator==(const scoped_refptr<T>& lhs, const U* rhs) {
return lhs.get() == rhs;
}
template <typename T, typename U>
bool operator==(const T* lhs, const scoped_refptr<U>& rhs) {
return lhs == rhs.get();
}
template <typename T>
bool operator==(const scoped_refptr<T>& lhs, std::nullptr_t null) {
return !static_cast<bool>(lhs);
}
template <typename T>
bool operator==(std::nullptr_t null, const scoped_refptr<T>& rhs) {
return !static_cast<bool>(rhs);
}
template <typename T, typename U>
bool operator!=(const scoped_refptr<T>& lhs, const U* rhs) {
return !operator==(lhs, rhs);
}
template <typename T, typename U>
bool operator!=(const T* lhs, const scoped_refptr<U>& rhs) {
return !operator==(lhs, rhs);
}
template <typename T>
bool operator!=(const scoped_refptr<T>& lhs, std::nullptr_t null) {
return !operator==(lhs, null);
}
template <typename T>
bool operator!=(std::nullptr_t null, const scoped_refptr<T>& rhs) {
return !operator==(null, rhs);
}
template <typename T>
std::ostream& operator<<(std::ostream& out, const scoped_refptr<T>& p) {
return out << p.get();
}
template <typename T>
void swap(scoped_refptr<T>& lhs, scoped_refptr<T>& rhs) noexcept {
lhs.swap(rhs);
}
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_SCOPED_REFPTR_H_

View File

@@ -0,0 +1,190 @@
// Copyright (c) 2021 Marshall A. Greenblatt. Portions copyright (c) 2013
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_SCOPED_TYPEREF_MAC_H_
#define CEF_INCLUDE_BASE_CEF_SCOPED_TYPEREF_MAC_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/mac/scoped_typeref.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/cef_logging.h"
#include "include/base/internal/cef_scoped_policy.h"
namespace base {
template <typename T>
struct ScopedTypeRefTraits;
///
/// ScopedTypeRef<> is patterned after std::unique_ptr<>, but maintains
/// ownership of a reference to any type that is maintained by Retain and
/// Release methods.
///
/// The Traits structure must provide the Retain and Release methods for type T.
/// A default ScopedTypeRefTraits is used but not defined, and should be defined
/// for each type to use this interface. For example, an appropriate definition
/// of ScopedTypeRefTraits for CGLContextObj would be:
///
/// <pre>
/// template<>
/// struct ScopedTypeRefTraits<CGLContextObj> {
/// static CGLContextObj InvalidValue() { return nullptr; }
/// static CGLContextObj Retain(CGLContextObj object) {
/// CGLContextRetain(object);
/// return object;
/// }
/// static void Release(CGLContextObj object) { CGLContextRelease(object); }
/// };
/// </pre>
///
/// For the many types that have pass-by-pointer create functions, the function
/// InitializeInto() is provided to allow direct initialization and assumption
/// of ownership of the object. For example, continuing to use the above
/// CGLContextObj specialization:
///
/// <pre>
/// base::ScopedTypeRef<CGLContextObj> context;
/// CGLCreateContext(pixel_format, share_group, context.InitializeInto());
/// </pre>
///
/// For initialization with an existing object, the caller may specify whether
/// the ScopedTypeRef<> being initialized is assuming the caller's existing
/// ownership of the object (and should not call Retain in initialization) or if
/// it should not assume this ownership and must create its own (by calling
/// Retain in initialization). This behavior is based on the |policy| parameter,
/// with |ASSUME| for the former and |RETAIN| for the latter. The default policy
/// is to |ASSUME|.
///
template <typename T, typename Traits = ScopedTypeRefTraits<T>>
class ScopedTypeRef {
public:
using element_type = T;
explicit constexpr ScopedTypeRef(
element_type object = Traits::InvalidValue(),
base::scoped_policy::OwnershipPolicy policy = base::scoped_policy::ASSUME)
: object_(object) {
if (object_ && policy == base::scoped_policy::RETAIN) {
object_ = Traits::Retain(object_);
}
}
ScopedTypeRef(const ScopedTypeRef<T, Traits>& that) : object_(that.object_) {
if (object_) {
object_ = Traits::Retain(object_);
}
}
// This allows passing an object to a function that takes its superclass.
template <typename R, typename RTraits>
explicit ScopedTypeRef(const ScopedTypeRef<R, RTraits>& that_as_subclass)
: object_(that_as_subclass.get()) {
if (object_) {
object_ = Traits::Retain(object_);
}
}
ScopedTypeRef(ScopedTypeRef<T, Traits>&& that) : object_(that.object_) {
that.object_ = Traits::InvalidValue();
}
~ScopedTypeRef() {
if (object_) {
Traits::Release(object_);
}
}
ScopedTypeRef& operator=(const ScopedTypeRef<T, Traits>& that) {
reset(that.get(), base::scoped_policy::RETAIN);
return *this;
}
// This is to be used only to take ownership of objects that are created
// by pass-by-pointer create functions. To enforce this, require that the
// object be reset to NULL before this may be used.
[[nodiscard]] element_type* InitializeInto() {
DCHECK(!object_);
return &object_;
}
void reset(const ScopedTypeRef<T, Traits>& that) {
reset(that.get(), base::scoped_policy::RETAIN);
}
void reset(element_type object = Traits::InvalidValue(),
base::scoped_policy::OwnershipPolicy policy =
base::scoped_policy::ASSUME) {
if (object && policy == base::scoped_policy::RETAIN) {
object = Traits::Retain(object);
}
if (object_) {
Traits::Release(object_);
}
object_ = object;
}
bool operator==(const element_type& that) const { return object_ == that; }
bool operator!=(const element_type& that) const { return object_ != that; }
operator element_type() const { return object_; }
element_type get() const { return object_; }
void swap(ScopedTypeRef& that) {
element_type temp = that.object_;
that.object_ = object_;
object_ = temp;
}
// ScopedTypeRef<>::release() is like std::unique_ptr<>::release. It is NOT
// a wrapper for Release(). To force a ScopedTypeRef<> object to call
// Release(), use ScopedTypeRef<>::reset().
[[nodiscard]] element_type release() {
element_type temp = object_;
object_ = Traits::InvalidValue();
return temp;
}
private:
element_type object_;
};
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_SCOPED_TYPEREF_MAC_H_

View File

@@ -0,0 +1,125 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_THREAD_CHECKER_H_
#define CEF_INCLUDE_BASE_THREAD_CHECKER_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/threading/thread_checker.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/cef_logging.h"
#include "include/base/internal/cef_thread_checker_impl.h"
///
/// Apart from debug builds, we also enable the thread checker in
/// builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots
/// with this define will get the same level of thread checking as
/// debug bots.
///
#if DCHECK_IS_ON()
#define ENABLE_THREAD_CHECKER 1
#else
#define ENABLE_THREAD_CHECKER 0
#endif
namespace base {
namespace cef_internal {
///
/// Do nothing implementation, for use in release mode.
///
/// Note: You should almost always use the ThreadChecker class to get the
/// right version for your build configuration.
///
class ThreadCheckerDoNothing {
public:
bool CalledOnValidThread() const { return true; }
void DetachFromThread() {}
};
} // namespace cef_internal
///
/// ThreadChecker is a helper class used to help verify that some methods of a
/// class are called from the same thread. It provides identical functionality
/// to base::NonThreadSafe, but it is meant to be held as a member variable,
/// rather than inherited from base::NonThreadSafe.
///
/// While inheriting from base::NonThreadSafe may give a clear indication about
/// the thread-safety of a class, it may also lead to violations of the style
/// guide with regard to multiple inheritance. The choice between having a
/// ThreadChecker member and inheriting from base::NonThreadSafe should be based
/// on whether:
/// - Derived classes need to know the thread they belong to, as opposed to
/// having that functionality fully encapsulated in the base class.
/// - Derived classes should be able to reassign the base class to another
/// thread, via DetachFromThread.
///
/// If neither of these are true, then having a ThreadChecker member and calling
/// CalledOnValidThread is the preferable solution.
///
/// Example:
///
/// <pre>
/// class MyClass {
/// public:
/// void Foo() {
/// DCHECK(thread_checker_.CalledOnValidThread());
/// ... (do stuff) ...
/// }
///
/// private:
/// ThreadChecker thread_checker_;
/// }
/// </pre>
///
/// In Release mode, CalledOnValidThread will always return true.
///
#if ENABLE_THREAD_CHECKER
class ThreadChecker : public cef_internal::ThreadCheckerImpl {};
#else
class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {};
#endif // ENABLE_THREAD_CHECKER
#undef ENABLE_THREAD_CHECKER
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_THREAD_CHECKER_H_

View File

@@ -0,0 +1,384 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///
/// \file
/// Trace events are for tracking application performance and resource usage.
/// Macros are provided to track:
/// Begin and end of function calls
/// Counters
///
/// Events are issued against categories. Whereas LOG's categories are
/// statically defined, TRACE categories are created implicitly with a string.
/// For example: <pre>
/// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent")
/// </pre>
///
/// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope:
/// <pre>
/// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly")
/// doSomethingCostly()
/// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly")
/// </pre>
/// Note: Our tools can't always determine the correct BEGIN/END pairs unless
/// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you
/// need them to be in separate scopes.
///
/// A common use case is to trace entire function scopes. This issues a trace
/// BEGIN and END automatically:
/// <pre>
/// void doSomethingCostly() {
/// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly");
/// ...
/// }
/// </pre>
///
/// Additional parameters can be associated with an event:
/// <pre>
/// void doSomethingCostly2(int howMuch) {
/// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly",
/// "howMuch", howMuch);
/// ...
/// }
/// </pre>
///
/// The trace system will automatically add to this information the current
/// process id, thread id, and a timestamp in microseconds.
///
/// To trace an asynchronous procedure such as an IPC send/receive, use
/// ASYNC_BEGIN and ASYNC_END:
/// <pre>
/// [single threaded sender code]
/// static int send_count = 0;
/// ++send_count;
/// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count);
/// Send(new MyMessage(send_count));
/// [receive code]
/// void OnMyMessage(send_count) {
/// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count);
/// }
/// </pre>
/// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs.
/// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process.
/// Pointers can be used for the ID parameter, and they will be mangled
/// internally so that the same pointer on two different processes will not
/// match. For example:
/// <pre>
/// class MyTracedClass {
/// public:
/// MyTracedClass() {
/// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this);
/// }
/// ~MyTracedClass() {
/// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this);
/// }
/// }
/// </pre>
///
/// The trace event also supports counters, which is a way to track a quantity
/// as it varies over time. Counters are created with the following macro:
/// <pre>
/// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue);
/// </pre>
///
/// Counters are process-specific. The macro itself can be issued from any
/// thread, however.
///
/// Sometimes, you want to track two counters at once. You can do this with two
/// counter macros:
/// <pre>
/// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]);
/// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]);
/// </pre>
/// Or you can do it with a combined macro:
/// <pre>
/// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter",
/// "bytesPinned", g_myCounterValue[0],
/// "bytesAllocated", g_myCounterValue[1]);
/// </pre>
/// This indicates to the tracing UI that these counters should be displayed
/// in a single graph, as a summed area chart.
///
/// Since counters are in a global namespace, you may want to disembiguate with
/// a unique ID, by using the TRACE_COUNTER_ID* variations.
///
/// By default, trace collection is compiled in, but turned off at runtime.
/// Collecting trace data is the responsibility of the embedding application. In
/// CEF's case, calling BeginTracing will turn on tracing on all active
/// processes.
///
///
/// Memory scoping note:
/// Tracing copies the pointers, not the string content, of the strings passed
/// in for category, name, and arg_names. Thus, the following code will cause
/// problems:
/// <pre>
/// char* str = strdup("impprtantName");
/// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD!
/// free(str); // Trace system now has dangling pointer
/// </pre>
///
///
/// Thread Safety:
/// All macros are thread safe and can be used from any process.
///
#ifndef CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_
#define CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
/// When building CEF include the Chromium header directly.
#include "base/trace_event/trace_event.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/internal/cef_trace_event_internal.h"
///
/// Records a pair of begin and end events called "name" for the current
/// scope, with 0, 1 or 2 associated arguments. If the category is not
/// enabled, then this does nothing.
/// - category and name strings must have application lifetime (statics or
/// literals). They may not include " chars.
///
#define TRACE_EVENT0(category, name) \
cef_trace_event_begin(category, name, NULL, 0, NULL, 0); \
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0); \
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val); \
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
// Implementation detail: trace event macros create temporary variable names.
// These macros give each temporary variable a unique name based on the line
// number to prevent name collisions.
#define CEF_INTERNAL_TRACE_EVENT_UID3(a, b) cef_trace_event_unique_##a##b
#define CEF_INTERNAL_TRACE_EVENT_UID2(a, b) CEF_INTERNAL_TRACE_EVENT_UID3(a, b)
#define CEF_INTERNAL_TRACE_EVENT_UID(name_prefix) \
CEF_INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__)
// Implementation detail: internal macro to end end event when the scope ends.
#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \
cef_trace_event::CefTraceEndOnScopeClose CEF_INTERNAL_TRACE_EVENT_UID( \
profileScope)(category, name)
///
/// Records a single event called "name" immediately, with 0, 1 or 2
/// associated arguments. If the category is not enabled, then this
/// does nothing.
/// - category and name strings must have application lifetime (statics or
/// literals). They may not include " chars.
///
#define TRACE_EVENT_INSTANT0(category, name) \
cef_trace_event_instant(category, name, NULL, 0, NULL, 0)
#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0)
#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val)
///
/// Records a single BEGIN event called "name" immediately, with 0, 1 or 2
/// associated arguments. If the category is not enabled, then this
/// does nothing.
/// - category and name strings must have application lifetime (statics or
/// literals). They may not include " chars.
///
#define TRACE_EVENT_BEGIN0(category, name) \
cef_trace_event_begin(category, name, NULL, 0, NULL, 0)
#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0)
#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val)
///
/// Records a single END event for "name" immediately. If the category
/// is not enabled, then this does nothing.
/// - category and name strings must have application lifetime (statics or
/// literals). They may not include " chars.
///
#define TRACE_EVENT_END0(category, name) \
cef_trace_event_end(category, name, NULL, 0, NULL, 0)
#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0)
#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, arg2_val)
///
/// Records the value of a counter called "name" immediately. Value
/// must be representable as a 32 bit integer.
/// - category and name strings must have application lifetime (statics or
/// literals). They may not include " chars.
///
#define TRACE_COUNTER1(category, name, value) \
cef_trace_counter(category, name, NULL, value, NULL, 0)
///
/// Records the values of a multi-parted counter called "name" immediately.
/// The UI will treat value1 and value2 as parts of a whole, displaying their
/// values as a stacked-bar chart.
/// - category and name strings must have application lifetime (statics or
/// literals). They may not include " chars.
///
#define TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, \
value2_val) \
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
value2_val)
///
/// Records the value of a counter called "name" immediately. Value
/// must be representable as a 32 bit integer.
/// - category and name strings must have application lifetime (statics or
/// literals). They may not include " chars.
/// - |id| is used to disambiguate counters with the same name. It must either
/// be a pointer or an integer value up to 64 bits. If it's a pointer, the
/// bits will be xored with a hash of the process ID so that the same pointer
/// on two different processes will not collide.
///
#define TRACE_COUNTER_ID1(category, name, id, value) \
cef_trace_counter_id(category, name, id, NULL, value, NULL, 0)
///
/// Records the values of a multi-parted counter called "name" immediately.
/// The UI will treat value1 and value2 as parts of a whole, displaying their
/// values as a stacked-bar chart.
/// - category and name strings must have application lifetime (statics or
/// literals). They may not include " chars.
/// - |id| is used to disambiguate counters with the same name. It must either
/// be a pointer or an integer value up to 64 bits. If it's a pointer, the
/// bits will be xored with a hash of the process ID so that the same pointer
/// on two different processes will not collide.
///
#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \
value2_name, value2_val) \
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
value2_name, value2_val)
///
/// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
/// associated arguments. If the category is not enabled, then this
/// does nothing.
/// - category and name strings must have application lifetime (statics or
/// literals). They may not include " chars.
/// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event.
/// ASYNC events are considered to match if their category, name and id values
/// all match. |id| must either be a pointer or an integer value up to 64
/// bits. If it's a pointer, the bits will be xored with a hash of the process
/// ID sothat the same pointer on two different processes will not collide.
/// An asynchronous operation can consist of multiple phases. The first phase is
/// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the
/// ASYNC_STEP_BEGIN macros. When the operation completes, call ASYNC_END.
/// An async operation can span threads and processes, but all events in that
/// operation must use the same |name| and |id|. Each event can have its own
/// args.
///
#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0)
#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, 0)
#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val)
///
/// Records a single ASYNC_STEP_INTO event for |step| immediately. If the
/// category is not enabled, then this does nothing. The |name| and |id| must
/// match the ASYNC_BEGIN event above. The |step| param identifies this step
/// within the async event. This should be called at the beginning of the next
/// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
/// ASYNC_STEP_PAST events.
///
#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \
cef_trace_event_async_step_into(category, name, id, step, NULL, 0)
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_into(category, name, id, step, arg1_name, arg1_val)
///
/// Records a single ASYNC_STEP_PAST event for |step| immediately. If the
/// category is not enabled, then this does nothing. The |name| and |id| must
/// match the ASYNC_BEGIN event above. The |step| param identifies this step
/// within the async event. This should be called at the beginning of the next
/// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
/// ASYNC_STEP_INTO events.
///
#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \
cef_trace_event_async_step_past(category, name, id, step, NULL, 0)
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_past(category, name, id, step, arg1_name, arg1_val)
///
/// Records a single ASYNC_END event for "name" immediately. If the category
/// is not enabled, then this does nothing.
///
#define TRACE_EVENT_ASYNC_END0(category, name, id) \
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0)
#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0)
#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val)
namespace cef_trace_event {
///
/// Used by TRACE_EVENTx macro. Do not use directly.
///
class CefTraceEndOnScopeClose {
public:
CefTraceEndOnScopeClose(const char* category, const char* name)
: category_(category), name_(name) {}
~CefTraceEndOnScopeClose() {
cef_trace_event_end(category_, name_, NULL, 0, NULL, 0);
}
private:
const char* category_;
const char* name_;
};
} // namespace cef_trace_event
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_

153
include/base/cef_tuple.h Normal file
View File

@@ -0,0 +1,153 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///
/// \file
/// Use std::tuple as tuple type. This file contains helper functions for
/// working with std::tuples.
/// The functions DispatchToMethod and DispatchToFunction take a function
/// pointer or instance and method pointer, and unpack a tuple into arguments to
/// the call.
///
/// Example usage:
/// <pre>
/// // These two methods of creating a Tuple are identical.
/// std::tuple<int, const char*> tuple_a(1, "wee");
/// std::tuple<int, const char*> tuple_b = std::make_tuple(1, "wee");
///
/// void SomeFunc(int a, const char* b) { }
/// DispatchToFunction(&SomeFunc, tuple_a); // SomeFunc(1, "wee")
/// DispatchToFunction(
/// &SomeFunc, std::make_tuple(10, "foo")); // SomeFunc(10, "foo")
///
/// struct { void SomeMeth(int a, int b, int c) { } } foo;
/// DispatchToMethod(&foo, &Foo::SomeMeth, std::make_tuple(1, 2, 3));
/// // foo->SomeMeth(1, 2, 3);
/// </pre>
///
#ifndef CEF_INCLUDE_BASE_CEF_TUPLE_H_
#define CEF_INCLUDE_BASE_CEF_TUPLE_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/tuple.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <stddef.h>
#include <tuple>
#include <utility>
#include "include/base/cef_build.h"
namespace base {
// Dispatchers ----------------------------------------------------------------
//
// Helper functions that call the given method on an object, with the unpacked
// tuple arguments. Notice that they all have the same number of arguments,
// so you need only write:
// DispatchToMethod(object, &Object::method, args);
// This is very useful for templated dispatchers, since they don't need to know
// what type |args| is.
// Non-Static Dispatchers with no out params.
template <typename ObjT, typename Method, typename Tuple, size_t... Ns>
inline void DispatchToMethodImpl(const ObjT& obj,
Method method,
Tuple&& args,
std::index_sequence<Ns...>) {
(obj->*method)(std::get<Ns>(std::forward<Tuple>(args))...);
}
template <typename ObjT, typename Method, typename Tuple>
inline void DispatchToMethod(const ObjT& obj, Method method, Tuple&& args) {
constexpr size_t size = std::tuple_size<std::decay_t<Tuple>>::value;
DispatchToMethodImpl(obj, method, std::forward<Tuple>(args),
std::make_index_sequence<size>());
}
// Static Dispatchers with no out params.
template <typename Function, typename Tuple, size_t... Ns>
inline void DispatchToFunctionImpl(Function function,
Tuple&& args,
std::index_sequence<Ns...>) {
(*function)(std::get<Ns>(std::forward<Tuple>(args))...);
}
template <typename Function, typename Tuple>
inline void DispatchToFunction(Function function, Tuple&& args) {
constexpr size_t size = std::tuple_size<std::decay_t<Tuple>>::value;
DispatchToFunctionImpl(function, std::forward<Tuple>(args),
std::make_index_sequence<size>());
}
// Dispatchers with out parameters.
template <typename ObjT,
typename Method,
typename InTuple,
typename OutTuple,
size_t... InNs,
size_t... OutNs>
inline void DispatchToMethodImpl(const ObjT& obj,
Method method,
InTuple&& in,
OutTuple* out,
std::index_sequence<InNs...>,
std::index_sequence<OutNs...>) {
(obj->*method)(std::get<InNs>(std::forward<InTuple>(in))...,
&std::get<OutNs>(*out)...);
}
template <typename ObjT, typename Method, typename InTuple, typename OutTuple>
inline void DispatchToMethod(const ObjT& obj,
Method method,
InTuple&& in,
OutTuple* out) {
constexpr size_t in_size = std::tuple_size<std::decay_t<InTuple>>::value;
constexpr size_t out_size = std::tuple_size<OutTuple>::value;
DispatchToMethodImpl(obj, method, std::forward<InTuple>(in), out,
std::make_index_sequence<in_size>(),
std::make_index_sequence<out_size>());
}
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_TUPLE_H_

469
include/base/cef_weak_ptr.h Normal file
View File

@@ -0,0 +1,469 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///
/// \file
/// Weak pointers are pointers to an object that do not affect its lifetime.
/// They may be invalidated (i.e. reset to nullptr) by the object, or its
/// owner, at any time, most commonly when the object is about to be deleted.
///
/// Weak pointers are useful when an object needs to be accessed safely by one
/// or more objects other than its owner, and those callers can cope with the
/// object vanishing and e.g. tasks posted to it being silently dropped.
/// Reference-counting such an object would complicate the ownership graph and
/// make it harder to reason about the object's lifetime.
///
/// EXAMPLE:
///
/// <pre>
/// class Controller {
/// public:
/// void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); }
/// void WorkComplete(const Result& result) { ... }
/// private:
/// // Member variables should appear before the WeakPtrFactory, to ensure
/// // that any WeakPtrs to Controller are invalidated before its members
/// // variable's destructors are executed, rendering them invalid.
/// WeakPtrFactory<Controller> weak_factory_{this};
/// };
///
/// class Worker {
/// public:
/// static void StartNew(WeakPtr<Controller> controller) {
/// Worker* worker = new Worker(std::move(controller));
/// // Kick off asynchronous processing...
/// }
/// private:
/// Worker(WeakPtr<Controller> controller)
/// : controller_(std::move(controller)) {}
/// void DidCompleteAsynchronousProcessing(const Result& result) {
/// if (controller_)
/// controller_->WorkComplete(result);
/// }
/// WeakPtr<Controller> controller_;
/// };
/// </pre>
///
/// With this implementation a caller may use SpawnWorker() to dispatch multiple
/// Workers and subsequently delete the Controller, without waiting for all
/// Workers to have completed.
///
/// <b>IMPORTANT: Thread-safety</b>
///
/// Weak pointers may be passed safely between threads, but must always be
/// dereferenced and invalidated on the same ThreaddTaskRunner otherwise
/// checking the pointer would be racey.
///
/// To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory
/// is dereferenced, the factory and its WeakPtrs become bound to the calling
/// thread or current ThreaddWorkerPool token, and cannot be dereferenced or
/// invalidated on any other task runner. Bound WeakPtrs can still be handed
/// off to other task runners, e.g. to use to post tasks back to object on the
/// bound thread.
///
/// If all WeakPtr objects are destroyed or invalidated then the factory is
/// unbound from the ThreadedTaskRunner/Thread. The WeakPtrFactory may then be
/// destroyed, or new WeakPtr objects may be used, from a different thread.
///
/// Thus, at least one WeakPtr object must exist and have been dereferenced on
/// the correct thread to enforce that other WeakPtr objects will enforce they
/// are used on the desired thread.
#ifndef CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
#define CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/memory/weak_ptr.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <cstddef>
#include <type_traits>
#include "include/base/cef_atomic_flag.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_ref_counted.h"
#include "include/base/cef_thread_checker.h"
namespace base {
template <typename T>
class SupportsWeakPtr;
template <typename T>
class WeakPtr;
namespace cef_internal {
// These classes are part of the WeakPtr implementation.
// DO NOT USE THESE CLASSES DIRECTLY YOURSELF.
class WeakReference {
public:
// Although Flag is bound to a specific ThreaddTaskRunner, it may be
// deleted from another via base::WeakPtr::~WeakPtr().
class Flag : public RefCountedThreadSafe<Flag> {
public:
Flag();
void Invalidate();
bool IsValid() const;
bool MaybeValid() const;
void DetachFromThread();
private:
friend class base::RefCountedThreadSafe<Flag>;
~Flag();
base::ThreadChecker thread_checker_;
AtomicFlag invalidated_;
};
WeakReference();
explicit WeakReference(const scoped_refptr<Flag>& flag);
~WeakReference();
WeakReference(WeakReference&& other) noexcept;
WeakReference(const WeakReference& other);
WeakReference& operator=(WeakReference&& other) noexcept = default;
WeakReference& operator=(const WeakReference& other) = default;
bool IsValid() const;
bool MaybeValid() const;
private:
scoped_refptr<const Flag> flag_;
};
class WeakReferenceOwner {
public:
WeakReferenceOwner();
~WeakReferenceOwner();
WeakReference GetRef() const;
bool HasRefs() const { return !flag_->HasOneRef(); }
void Invalidate();
private:
scoped_refptr<WeakReference::Flag> flag_;
};
// This class simplifies the implementation of WeakPtr's type conversion
// constructor by avoiding the need for a public accessor for ref_. A
// WeakPtr<T> cannot access the private members of WeakPtr<U>, so this
// base class gives us a way to access ref_ in a protected fashion.
class WeakPtrBase {
public:
WeakPtrBase();
~WeakPtrBase();
WeakPtrBase(const WeakPtrBase& other) = default;
WeakPtrBase(WeakPtrBase&& other) noexcept = default;
WeakPtrBase& operator=(const WeakPtrBase& other) = default;
WeakPtrBase& operator=(WeakPtrBase&& other) noexcept = default;
void reset() {
ref_ = cef_internal::WeakReference();
ptr_ = 0;
}
protected:
WeakPtrBase(const WeakReference& ref, uintptr_t ptr);
WeakReference ref_;
// This pointer is only valid when ref_.is_valid() is true. Otherwise, its
// value is undefined (as opposed to nullptr).
uintptr_t ptr_;
};
// This class provides a common implementation of common functions that would
// otherwise get instantiated separately for each distinct instantiation of
// SupportsWeakPtr<>.
class SupportsWeakPtrBase {
public:
// A safe static downcast of a WeakPtr<Base> to WeakPtr<Derived>. This
// conversion will only compile if there is exists a Base which inherits
// from SupportsWeakPtr<Base>. See base::AsWeakPtr() below for a helper
// function that makes calling this easier.
//
// Precondition: t != nullptr
template <typename Derived>
static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
static_assert(
std::is_base_of<cef_internal::SupportsWeakPtrBase, Derived>::value,
"AsWeakPtr argument must inherit from SupportsWeakPtr");
return AsWeakPtrImpl<Derived>(t);
}
private:
// This template function uses type inference to find a Base of Derived
// which is an instance of SupportsWeakPtr<Base>. We can then safely
// static_cast the Base* to a Derived*.
template <typename Derived, typename Base>
static WeakPtr<Derived> AsWeakPtrImpl(SupportsWeakPtr<Base>* t) {
WeakPtr<Base> ptr = t->AsWeakPtr();
return WeakPtr<Derived>(
ptr.ref_, static_cast<Derived*>(reinterpret_cast<Base*>(ptr.ptr_)));
}
};
} // namespace cef_internal
template <typename T>
class WeakPtrFactory;
///
/// The WeakPtr class holds a weak reference to |T*|.
///
/// This class is designed to be used like a normal pointer. You should always
/// null-test an object of this class before using it or invoking a method that
/// may result in the underlying object being destroyed.
///
/// EXAMPLE:
///
/// <pre>
/// class Foo { ... };
/// WeakPtr<Foo> foo;
/// if (foo)
/// foo->method();
/// </pre>
///
template <typename T>
class WeakPtr : public cef_internal::WeakPtrBase {
public:
WeakPtr() = default;
WeakPtr(std::nullptr_t) {}
///
/// Allow conversion from U to T provided U "is a" T. Note that this
/// is separate from the (implicit) copy and move constructors.
///
template <typename U>
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other) {
// Need to cast from U* to T* to do pointer adjustment in case of multiple
// inheritance. This also enforces the "U is a T" rule.
T* t = reinterpret_cast<U*>(other.ptr_);
ptr_ = reinterpret_cast<uintptr_t>(t);
}
template <typename U>
WeakPtr(WeakPtr<U>&& other) noexcept : WeakPtrBase(std::move(other)) {
// Need to cast from U* to T* to do pointer adjustment in case of multiple
// inheritance. This also enforces the "U is a T" rule.
T* t = reinterpret_cast<U*>(other.ptr_);
ptr_ = reinterpret_cast<uintptr_t>(t);
}
T* get() const {
return ref_.IsValid() ? reinterpret_cast<T*>(ptr_) : nullptr;
}
T& operator*() const {
CHECK(ref_.IsValid());
return *get();
}
T* operator->() const {
CHECK(ref_.IsValid());
return get();
}
///
/// Allow conditionals to test validity, e.g. `if (weak_ptr) {...}`;
///
explicit operator bool() const { return get() != nullptr; }
///
/// Returns false if the WeakPtr is confirmed to be invalid. This call is safe
/// to make from any thread, e.g. to optimize away unnecessary work, but
/// operator bool() must always be called, on the correct thread, before
/// actually using the pointer.
///
/// Warning: as with any object, this call is only thread-safe if the WeakPtr
/// instance isn't being re-assigned or reset() racily with this call.
///
bool MaybeValid() const { return ref_.MaybeValid(); }
///
/// Returns whether the object |this| points to has been invalidated. This can
/// be used to distinguish a WeakPtr to a destroyed object from one that has
/// been explicitly set to null.
///
bool WasInvalidated() const { return ptr_ && !ref_.IsValid(); }
private:
friend class cef_internal::SupportsWeakPtrBase;
template <typename U>
friend class WeakPtr;
friend class SupportsWeakPtr<T>;
friend class WeakPtrFactory<T>;
WeakPtr(const cef_internal::WeakReference& ref, T* ptr)
: WeakPtrBase(ref, reinterpret_cast<uintptr_t>(ptr)) {}
};
///
/// Allow callers to compare WeakPtrs against nullptr to test validity.
///
template <class T>
bool operator!=(const WeakPtr<T>& weak_ptr, std::nullptr_t) {
return !(weak_ptr == nullptr);
}
template <class T>
bool operator!=(std::nullptr_t, const WeakPtr<T>& weak_ptr) {
return weak_ptr != nullptr;
}
template <class T>
bool operator==(const WeakPtr<T>& weak_ptr, std::nullptr_t) {
return weak_ptr.get() == nullptr;
}
template <class T>
bool operator==(std::nullptr_t, const WeakPtr<T>& weak_ptr) {
return weak_ptr == nullptr;
}
namespace cef_internal {
class WeakPtrFactoryBase {
protected:
WeakPtrFactoryBase(uintptr_t ptr);
~WeakPtrFactoryBase();
cef_internal::WeakReferenceOwner weak_reference_owner_;
uintptr_t ptr_;
};
} // namespace cef_internal
///
/// A class may be composed of a WeakPtrFactory and thereby control how it
/// exposes weak pointers to itself. This is helpful if you only need weak
/// pointers within the implementation of a class. This class is also useful
/// when working with primitive types. For example, you could have a
/// WeakPtrFactory<bool> that is used to pass around a weak reference to a
/// bool.
///
template <class T>
class WeakPtrFactory : public cef_internal::WeakPtrFactoryBase {
public:
WeakPtrFactory() = delete;
explicit WeakPtrFactory(T* ptr)
: WeakPtrFactoryBase(reinterpret_cast<uintptr_t>(ptr)) {}
WeakPtrFactory(const WeakPtrFactory&) = delete;
WeakPtrFactory& operator=(const WeakPtrFactory&) = delete;
~WeakPtrFactory() = default;
WeakPtr<T> GetWeakPtr() const {
return WeakPtr<T>(weak_reference_owner_.GetRef(),
reinterpret_cast<T*>(ptr_));
}
///
/// Call this method to invalidate all existing weak pointers.
///
void InvalidateWeakPtrs() {
DCHECK(ptr_);
weak_reference_owner_.Invalidate();
}
///
/// Call this method to determine if any weak pointers exist.
///
bool HasWeakPtrs() const {
DCHECK(ptr_);
return weak_reference_owner_.HasRefs();
}
};
///
/// A class may extend from SupportsWeakPtr to let others take weak pointers to
/// it. This avoids the class itself implementing boilerplate to dispense weak
/// pointers. However, since SupportsWeakPtr's destructor won't invalidate
/// weak pointers to the class until after the derived class' members have been
/// destroyed, its use can lead to subtle use-after-destroy issues.
///
template <class T>
class SupportsWeakPtr : public cef_internal::SupportsWeakPtrBase {
public:
SupportsWeakPtr() = default;
SupportsWeakPtr(const SupportsWeakPtr&) = delete;
SupportsWeakPtr& operator=(const SupportsWeakPtr&) = delete;
WeakPtr<T> AsWeakPtr() {
return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(this));
}
protected:
~SupportsWeakPtr() = default;
private:
cef_internal::WeakReferenceOwner weak_reference_owner_;
};
///
/// Helper function that uses type deduction to safely return a WeakPtr<Derived>
/// when Derived doesn't directly extend SupportsWeakPtr<Derived>, instead it
/// extends a Base that extends SupportsWeakPtr<Base>.
///
/// EXAMPLE:
/// <pre>
/// class Base : public base::SupportsWeakPtr<Producer> {};
/// class Derived : public Base {};
///
/// Derived derived;
/// base::WeakPtr<Derived> ptr = base::AsWeakPtr(&derived);
/// </pre>
///
/// Note that the following doesn't work (invalid type conversion) since
/// Derived::AsWeakPtr() is WeakPtr<Base> SupportsWeakPtr<Base>::AsWeakPtr(),
/// and there's no way to safely cast WeakPtr<Base> to WeakPtr<Derived> at
/// the caller.
///
/// <pre>
/// base::WeakPtr<Derived> ptr = derived.AsWeakPtr(); // Fails.
/// </pre>
///
template <typename Derived>
WeakPtr<Derived> AsWeakPtr(Derived* t) {
return cef_internal::SupportsWeakPtrBase::StaticAsWeakPtr<Derived>(t);
}
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,275 @@
// Copyright (c) 2012 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Do not include this header file directly. Use base/cef_bind.h or
// base/cef_callback.h instead.
// This file contains utility functions and classes that help the
// implementation, and management of the Callback objects.
#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_
#define CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_
#include "include/base/cef_callback_forward.h"
#include "include/base/cef_ref_counted.h"
namespace base {
struct FakeBindState;
namespace cef_internal {
class BindStateBase;
class FinallyExecutorCommon;
class ThenAndCatchExecutorCommon;
template <typename ReturnType>
class PostTaskExecutor;
template <typename Functor, typename... BoundArgs>
struct BindState;
class CallbackBase;
class CallbackBaseCopyable;
struct BindStateBaseRefCountTraits {
static void Destruct(const BindStateBase*);
};
template <typename T>
using PassingType = std::conditional_t<std::is_scalar<T>::value, T, T&&>;
// BindStateBase is used to provide an opaque handle that the Callback
// class can use to represent a function object with bound arguments. It
// behaves as an existential type that is used by a corresponding
// DoInvoke function to perform the function execution. This allows
// us to shield the Callback class from the types of the bound argument via
// "type erasure."
// At the base level, the only task is to add reference counting data. Avoid
// using or inheriting any virtual functions. Creating a vtable for every
// BindState template instantiation results in a lot of bloat. Its only task is
// to call the destructor which can be done with a function pointer.
class BindStateBase
: public RefCountedThreadSafe<BindStateBase, BindStateBaseRefCountTraits> {
public:
REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE();
enum CancellationQueryMode {
IS_CANCELLED,
MAYBE_VALID,
};
using InvokeFuncStorage = void (*)();
BindStateBase(const BindStateBase&) = delete;
BindStateBase& operator=(const BindStateBase&) = delete;
private:
BindStateBase(InvokeFuncStorage polymorphic_invoke,
void (*destructor)(const BindStateBase*));
BindStateBase(InvokeFuncStorage polymorphic_invoke,
void (*destructor)(const BindStateBase*),
bool (*query_cancellation_traits)(const BindStateBase*,
CancellationQueryMode mode));
~BindStateBase() = default;
friend struct BindStateBaseRefCountTraits;
friend class RefCountedThreadSafe<BindStateBase, BindStateBaseRefCountTraits>;
friend class CallbackBase;
friend class CallbackBaseCopyable;
// Allowlist subclasses that access the destructor of BindStateBase.
template <typename Functor, typename... BoundArgs>
friend struct BindState;
friend struct ::base::FakeBindState;
bool IsCancelled() const {
return query_cancellation_traits_(this, IS_CANCELLED);
}
bool MaybeValid() const {
return query_cancellation_traits_(this, MAYBE_VALID);
}
// In C++, it is safe to cast function pointers to function pointers of
// another type. It is not okay to use void*. We create a InvokeFuncStorage
// that that can store our function pointer, and then cast it back to
// the original type on usage.
InvokeFuncStorage polymorphic_invoke_;
// Pointer to a function that will properly destroy |this|.
void (*destructor_)(const BindStateBase*);
bool (*query_cancellation_traits_)(const BindStateBase*,
CancellationQueryMode mode);
};
// Holds the Callback methods that don't require specialization to reduce
// template bloat.
// CallbackBase<MoveOnly> is a direct base class of MoveOnly callbacks, and
// CallbackBase<Copyable> uses CallbackBase<MoveOnly> for its implementation.
class CallbackBase {
public:
inline CallbackBase(CallbackBase&& c) noexcept;
CallbackBase& operator=(CallbackBase&& c) noexcept;
explicit CallbackBase(const CallbackBaseCopyable& c);
CallbackBase& operator=(const CallbackBaseCopyable& c);
explicit CallbackBase(CallbackBaseCopyable&& c) noexcept;
CallbackBase& operator=(CallbackBaseCopyable&& c) noexcept;
// Returns true if Callback is null (doesn't refer to anything).
bool is_null() const { return !bind_state_; }
explicit operator bool() const { return !is_null(); }
// Returns true if the callback invocation will be nop due to an cancellation.
// It's invalid to call this on uninitialized callback.
//
// Must be called on the Callback's destination sequence.
bool IsCancelled() const;
// If this returns false, the callback invocation will be a nop due to a
// cancellation. This may(!) still return true, even on a cancelled callback.
//
// This function is thread-safe.
bool MaybeValid() const;
// Returns the Callback into an uninitialized state.
void Reset();
protected:
friend class FinallyExecutorCommon;
friend class ThenAndCatchExecutorCommon;
template <typename ReturnType>
friend class PostTaskExecutor;
using InvokeFuncStorage = BindStateBase::InvokeFuncStorage;
// Returns true if this callback equals |other|. |other| may be null.
bool EqualsInternal(const CallbackBase& other) const;
constexpr inline CallbackBase();
// Allow initializing of |bind_state_| via the constructor to avoid default
// initialization of the scoped_refptr.
explicit inline CallbackBase(BindStateBase* bind_state);
InvokeFuncStorage polymorphic_invoke() const {
return bind_state_->polymorphic_invoke_;
}
// Force the destructor to be instantiated inside this translation unit so
// that our subclasses will not get inlined versions. Avoids more template
// bloat.
~CallbackBase();
scoped_refptr<BindStateBase> bind_state_;
};
constexpr CallbackBase::CallbackBase() = default;
CallbackBase::CallbackBase(CallbackBase&&) noexcept = default;
CallbackBase::CallbackBase(BindStateBase* bind_state)
: bind_state_(AdoptRef(bind_state)) {}
// CallbackBase<Copyable> is a direct base class of Copyable Callbacks.
class CallbackBaseCopyable : public CallbackBase {
public:
CallbackBaseCopyable(const CallbackBaseCopyable& c);
CallbackBaseCopyable(CallbackBaseCopyable&& c) noexcept = default;
CallbackBaseCopyable& operator=(const CallbackBaseCopyable& c);
CallbackBaseCopyable& operator=(CallbackBaseCopyable&& c) noexcept;
protected:
constexpr CallbackBaseCopyable() = default;
explicit CallbackBaseCopyable(BindStateBase* bind_state)
: CallbackBase(bind_state) {}
~CallbackBaseCopyable() = default;
};
// Helpers for the `Then()` implementation.
template <typename OriginalCallback, typename ThenCallback>
struct ThenHelper;
// Specialization when original callback returns `void`.
template <template <typename> class OriginalCallback,
template <typename>
class ThenCallback,
typename... OriginalArgs,
typename ThenR,
typename... ThenArgs>
struct ThenHelper<OriginalCallback<void(OriginalArgs...)>,
ThenCallback<ThenR(ThenArgs...)>> {
static_assert(sizeof...(ThenArgs) == 0,
"|then| callback cannot accept parameters if |this| has a "
"void return type.");
static auto CreateTrampoline() {
return [](OriginalCallback<void(OriginalArgs...)> c1,
ThenCallback<ThenR(ThenArgs...)> c2, OriginalArgs... c1_args) {
std::move(c1).Run(std::forward<OriginalArgs>(c1_args)...);
return std::move(c2).Run();
};
}
};
// Specialization when original callback returns a non-void type.
template <template <typename> class OriginalCallback,
template <typename>
class ThenCallback,
typename OriginalR,
typename... OriginalArgs,
typename ThenR,
typename... ThenArgs>
struct ThenHelper<OriginalCallback<OriginalR(OriginalArgs...)>,
ThenCallback<ThenR(ThenArgs...)>> {
static_assert(sizeof...(ThenArgs) == 1,
"|then| callback must accept exactly one parameter if |this| "
"has a non-void return type.");
// TODO(dcheng): This should probably check is_convertible as well (same with
// `AssertBindArgsValidity`).
static_assert(std::is_constructible<ThenArgs..., OriginalR&&>::value,
"|then| callback's parameter must be constructible from "
"return type of |this|.");
static auto CreateTrampoline() {
return [](OriginalCallback<OriginalR(OriginalArgs...)> c1,
ThenCallback<ThenR(ThenArgs...)> c2, OriginalArgs... c1_args) {
return std::move(c2).Run(
std::move(c1).Run(std::forward<OriginalArgs>(c1_args)...));
};
}
};
} // namespace cef_internal
} // namespace base
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_

View File

@@ -0,0 +1,50 @@
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The following macros are used to declare both the color id enumerations and
// the stringized names of the enumeration elements for use in dump_colors. To
// stringize the element names, define STRINGIZE_COLOR_IDS prior to including
// this file. This file is intended to be included just before and just after
// the enumeration or string array declarations.
#if !defined(COLOR_ID_MACROS_DEFINED)
#define COLOR_ID_MACROS_DEFINED
#if defined(STRINGIZE_COLOR_IDS)
// Convert first token to string, throw away the rest.
#define D1(enum_name) #enum_name
#define D2(enum_name, enum_value) #enum_name
#else // defined(STRINGIZE_COLOR_IDS)
// Declare enum with optional assigned value.
#define D1(enum_name) enum_name
#define D2(enum_name, enum_value) enum_name = enum_value
#endif // defined(STRINGIZE_COLOR_IDS)
// Select which token in the declaration is the assigned value.
// Use first and optional third token, ignore optional second.
#define E1(enum_name) D1(enum_name)
#define E2(enum_name, old_enum_name) D1(enum_name)
#define E3(enum_name, old_enum_name, enum_value) D2(enum_name, enum_value)
#define GET_E(_1, _2, _3, macro_name, ...) macro_name
#if defined(COMPILER_MSVC)
// Workaround for MSVC not properly expanding __VA_ARGS__.
#define EXPAND(x) x
#define E_CPONLY(...) EXPAND(E(__VA_ARGS__))
#define E(...) EXPAND(GET_E(__VA_ARGS__, E3, E2, E1)(__VA_ARGS__)),
#else // !defined(COMPILER_MSVC)
#define E_CPONLY(...) E(__VA_ARGS__)
#define E(...) GET_E(__VA_ARGS__, E3, E2, E1)(__VA_ARGS__),
#endif // !defined(COMPILER_MSVC)
#else // !defined(COLOR_ID_MACROS_DEFINED)
#undef D1
#undef D2
#undef E1
#undef E2
#undef E3
#if defined(COMPILER_MSVC)
#undef EXPAND
#endif
#undef E_CPONLY
#undef GET_E
#undef E
#undef COLOR_ID_MACROS_DEFINED
#endif // !defined(COLOR_ID_MACROS_DEFINED)

View File

@@ -0,0 +1,87 @@
// Copyright (c) 2011 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Do not include this header file directly. Use base/cef_lock.h instead.
#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_
#define CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_
#include "include/base/cef_build.h"
#if defined(OS_WIN)
#include <windows.h>
#elif defined(OS_POSIX)
#include <pthread.h>
#endif
namespace base {
namespace cef_internal {
// This class implements the underlying platform-specific spin-lock mechanism
// used for the Lock class. Most users should not use LockImpl directly, but
// should instead use Lock.
class LockImpl {
public:
#if defined(OS_WIN)
typedef CRITICAL_SECTION NativeHandle;
#elif defined(OS_POSIX)
typedef pthread_mutex_t NativeHandle;
#endif
LockImpl();
LockImpl(const LockImpl&) = delete;
LockImpl& operator=(const LockImpl&) = delete;
~LockImpl();
// If the lock is not held, take it and return true. If the lock is already
// held by something else, immediately return false.
bool Try();
// Take the lock, blocking until it is available if necessary.
void Lock();
// Release the lock. This must only be called by the lock's holder: after
// a successful call to Try, or a call to Lock.
void Unlock();
// Return the native underlying lock.
// TODO(awalker): refactor lock and condition variables so that this is
// unnecessary.
NativeHandle* native_handle() { return &native_handle_; }
private:
NativeHandle native_handle_;
};
} // namespace cef_internal
} // namespace base
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_

View File

@@ -0,0 +1,8 @@
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// Include net error codes from the Chromium source location. When creating a
// CEF binary distribution this file will be replaced with the Chromium version.
#include "net/base/net_error_list.h"

View File

@@ -0,0 +1,73 @@
// Copyright (c) 2011 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Do not include this header file directly. Use base/cef_callback.h instead.
#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_
#define CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_
#include <type_traits>
// It is dangerous to post a task with a T* argument where T is a subtype of
// RefCounted(Base|ThreadSafeBase), since by the time the parameter is used, the
// object may already have been deleted since it was not held with a
// scoped_refptr. Example: http://crbug.com/27191
// The following set of traits are designed to generate a compile error
// whenever this antipattern is attempted.
namespace base {
// This is a base internal implementation file used by task.h and callback.h.
// Not for public consumption, so we wrap it in namespace internal.
namespace cef_internal {
template <typename T, typename = void>
struct IsRefCountedType : std::false_type {};
template <typename T>
struct IsRefCountedType<T,
std::void_t<decltype(std::declval<T*>()->AddRef()),
decltype(std::declval<T*>()->Release())>>
: std::true_type {};
// Human readable translation: you needed to be a scoped_refptr if you are a raw
// pointer type and are convertible to a RefCounted(Base|ThreadSafeBase) type.
template <typename T>
struct NeedsScopedRefptrButGetsRawPtr
: std::conjunction<std::is_pointer<T>,
IsRefCountedType<std::remove_pointer_t<T>>> {
static_assert(!std::is_reference<T>::value,
"NeedsScopedRefptrButGetsRawPtr requires non-reference type.");
};
} // namespace cef_internal
} // namespace base
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_

View File

@@ -0,0 +1,67 @@
// Copyright (c) 2013 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Do not include this header file directly. Use base/mac/scoped_block.h
// instead.
#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_SCOPED_BLOCK_MAC_H_
#define CEF_INCLUDE_BASE_INTERNAL_CEF_SCOPED_BLOCK_MAC_H_
#include <Block.h>
#include "include/base/cef_scoped_typeref_mac.h"
#if defined(__has_feature) && __has_feature(objc_arc)
#error \
"Cannot include include/base/internal/cef_scoped_block_mac.h in file built with ARC."
#endif
namespace base {
namespace mac {
namespace cef_internal {
template <typename B>
struct ScopedBlockTraits {
static B InvalidValue() { return nullptr; }
static B Retain(B block) { return Block_copy(block); }
static void Release(B block) { Block_release(block); }
};
} // namespace cef_internal
// ScopedBlock<> is patterned after ScopedCFTypeRef<>, but uses Block_copy() and
// Block_release() instead of CFRetain() and CFRelease().
template <typename B>
using ScopedBlock = ScopedTypeRef<B, cef_internal::ScopedBlockTraits<B>>;
} // namespace mac
} // namespace base
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_SCOPED_BLOCK_MAC_H_

View File

@@ -0,0 +1,53 @@
// Copyright (c) 2012 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Do not include this header file directly. Use base/memory/scoped_policy.h
// instead.
#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_SCOPED_POLICY_H_
#define CEF_INCLUDE_BASE_INTERNAL_CEF_SCOPED_POLICY_H_
namespace base {
namespace scoped_policy {
// Defines the ownership policy for a scoped object.
enum OwnershipPolicy {
// The scoped object takes ownership of an object by taking over an existing
// ownership claim.
ASSUME,
// The scoped object will retain the object and any initial ownership is
// not changed.
RETAIN
};
} // namespace scoped_policy
} // namespace base
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_SCOPED_POLICY_H_

View File

@@ -0,0 +1,72 @@
// Copyright (c) 2011 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Do not include this header file directly. Use base/cef_thread_checker.h
// instead.
#ifndef CEF_INCLUDE_BASE_INTERNAL_THREAD_CHECKER_IMPL_H_
#define CEF_INCLUDE_BASE_INTERNAL_THREAD_CHECKER_IMPL_H_
#include "include/base/cef_lock.h"
#include "include/base/cef_platform_thread.h"
namespace base {
namespace cef_internal {
// Real implementation of ThreadChecker, for use in debug mode, or
// for temporary use in release mode (e.g. to CHECK on a threading issue
// seen only in the wild).
//
// Note: You should almost always use the ThreadChecker class to get the
// right version for your build configuration.
class ThreadCheckerImpl {
public:
ThreadCheckerImpl();
~ThreadCheckerImpl();
bool CalledOnValidThread() const;
// Changes the thread that is checked for in CalledOnValidThread. This may
// be useful when an object may be created on one thread and then used
// exclusively on another thread.
void DetachFromThread();
private:
void EnsureThreadIdAssigned() const;
mutable base::Lock lock_;
// This is mutable so that CalledOnValidThread can set it.
// It's guarded by |lock_|.
mutable PlatformThreadRef valid_thread_id_;
};
} // namespace cef_internal
} // namespace base
#endif // CEF_INCLUDE_BASE_INTERNAL_THREAD_CHECKER_IMPL_H_

View File

@@ -0,0 +1,81 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6ea5d772fb4961ae4a658b4b730aa608fa93309f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to receive accessibility notification when
/// accessibility events have been registered. The functions of this structure
/// will be called on the UI thread.
///
typedef struct _cef_accessibility_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called after renderer process sends accessibility tree changes to the
/// browser process.
///
void(CEF_CALLBACK* on_accessibility_tree_change)(
struct _cef_accessibility_handler_t* self,
struct _cef_value_t* value);
///
/// Called after renderer process sends accessibility location changes to the
/// browser process.
///
void(CEF_CALLBACK* on_accessibility_location_change)(
struct _cef_accessibility_handler_t* self,
struct _cef_value_t* value);
} cef_accessibility_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_

205
include/capi/cef_app_capi.h Normal file
View File

@@ -0,0 +1,205 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dfa0d4d2da319b2fd5e92324fd14301b500ceb5c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_process_handler_capi.h"
#include "include/capi/cef_command_line_capi.h"
#include "include/capi/cef_render_process_handler_capi.h"
#include "include/capi/cef_resource_bundle_handler_capi.h"
#include "include/capi/cef_scheme_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_app_t;
///
/// Implement this structure to provide handler implementations. Methods will be
/// called by the process and/or thread indicated.
///
typedef struct _cef_app_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Provides an opportunity to view and/or modify command-line arguments
/// before processing by CEF and Chromium. The |process_type| value will be
/// NULL for the browser process. Do not keep a reference to the
/// cef_command_line_t object passed to this function. The
/// cef_settings_t.command_line_args_disabled value can be used to start with
/// an NULL command-line object. Any values specified in CefSettings that
/// equate to command-line arguments will be set before this function is
/// called. Be cautious when using this function to modify command-line
/// arguments for non-browser processes as this may result in undefined
/// behavior including crashes.
///
void(CEF_CALLBACK* on_before_command_line_processing)(
struct _cef_app_t* self,
const cef_string_t* process_type,
struct _cef_command_line_t* command_line);
///
/// Provides an opportunity to register custom schemes. Do not keep a
/// reference to the |registrar| object. This function is called on the main
/// thread for each process and the registered schemes should be the same
/// across all processes.
///
void(CEF_CALLBACK* on_register_custom_schemes)(
struct _cef_app_t* self,
struct _cef_scheme_registrar_t* registrar);
///
/// Return the handler for resource bundle events. If
/// cef_settings_t.pack_loading_disabled is true (1) a handler must be
/// returned. If no handler is returned resources will be loaded from pack
/// files. This function is called by the browser and render processes on
/// multiple threads.
///
struct _cef_resource_bundle_handler_t*(
CEF_CALLBACK* get_resource_bundle_handler)(struct _cef_app_t* self);
///
/// Return the handler for functionality specific to the browser process. This
/// function is called on multiple threads in the browser process.
///
struct _cef_browser_process_handler_t*(
CEF_CALLBACK* get_browser_process_handler)(struct _cef_app_t* self);
///
/// Return the handler for functionality specific to the render process. This
/// function is called on the render process main thread.
///
struct _cef_render_process_handler_t*(
CEF_CALLBACK* get_render_process_handler)(struct _cef_app_t* self);
} cef_app_t;
///
/// This function should be called from the application entry point function to
/// execute a secondary process. It can be used to run secondary processes from
/// the browser client executable (default behavior) or from a separate
/// executable specified by the cef_settings_t.browser_subprocess_path value. If
/// called for the browser process (identified by no "type" command-line value)
/// it will return immediately with a value of -1. If called for a recognized
/// secondary process it will block until the process should exit and then
/// return the process exit code. The |application| parameter may be NULL. The
/// |windows_sandbox_info| parameter is only used on Windows and may be NULL
/// (see cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_execute_process(const cef_main_args_t* args,
cef_app_t* application,
void* windows_sandbox_info);
///
/// This function should be called on the main application thread to initialize
/// the CEF browser process. The |application| parameter may be NULL. Returns
/// true (1) if initialization succeeds. Returns false (0) if initialization
/// fails or if early exit is desired (for example, due to process singleton
/// relaunch behavior). If this function returns false (0) then the application
/// should exit immediately without calling any other CEF functions except,
/// optionally, CefGetErrorCode. The |windows_sandbox_info| parameter is only
/// used on Windows and may be NULL (see cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_initialize(const cef_main_args_t* args,
const struct _cef_settings_t* settings,
cef_app_t* application,
void* windows_sandbox_info);
///
/// This function can optionally be called on the main application thread after
/// CefInitialize to retrieve the initialization exit code. When CefInitialize
/// returns true (1) the exit code will be 0 (CEF_RESULT_CODE_NORMAL_EXIT).
/// Otherwise, see cef_resultcode_t for possible exit code values including
/// browser process initialization errors and normal early exit conditions (such
/// as CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED for process singleton
/// relaunch behavior).
///
CEF_EXPORT int cef_get_exit_code(void);
///
/// This function should be called on the main application thread to shut down
/// the CEF browser process before the application exits. Do not call any other
/// CEF functions after calling this function.
///
CEF_EXPORT void cef_shutdown(void);
///
/// Perform a single iteration of CEF message loop processing. This function is
/// provided for cases where the CEF message loop must be integrated into an
/// existing application message loop. Use of this function is not recommended
/// for most users; use either the cef_run_message_loop() function or
/// cef_settings_t.multi_threaded_message_loop if possible. When using this
/// function care must be taken to balance performance against excessive CPU
/// usage. It is recommended to enable the cef_settings_t.external_message_pump
/// option when using this function so that
/// cef_browser_process_handler_t::on_schedule_message_pump_work() callbacks can
/// facilitate the scheduling process. This function should only be called on
/// the main application thread and only if cef_initialize() is called with a
/// cef_settings_t.multi_threaded_message_loop value of false (0). This function
/// will not block.
///
CEF_EXPORT void cef_do_message_loop_work(void);
///
/// Run the CEF message loop. Use this function instead of an application-
/// provided message loop to get the best balance between performance and CPU
/// usage. This function should only be called on the main application thread
/// and only if cef_initialize() is called with a
/// cef_settings_t.multi_threaded_message_loop value of false (0). This function
/// will block until a quit message is received by the system.
///
CEF_EXPORT void cef_run_message_loop(void);
///
/// Quit the CEF message loop that was started by calling
/// cef_run_message_loop(). This function should only be called on the main
/// application thread and only if cef_run_message_loop() was used.
///
CEF_EXPORT void cef_quit_message_loop(void);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_

View File

@@ -0,0 +1,121 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d98482eba93dcd8b6a6f69b2732162733c73203d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to handle audio events.
///
typedef struct _cef_audio_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called on the UI thread to allow configuration of audio stream parameters.
/// Return true (1) to proceed with audio stream capture, or false (0) to
/// cancel it. All members of |params| can optionally be configured here, but
/// they are also pre-filled with some sensible defaults.
///
int(CEF_CALLBACK* get_audio_parameters)(struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser,
cef_audio_parameters_t* params);
///
/// Called on a browser audio capture thread when the browser starts streaming
/// audio. OnAudioStreamStopped will always be called after
/// OnAudioStreamStarted; both functions may be called multiple times for the
/// same browser. |params| contains the audio parameters like sample rate and
/// channel layout. |channels| is the number of channels.
///
void(CEF_CALLBACK* on_audio_stream_started)(
struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser,
const cef_audio_parameters_t* params,
int channels);
///
/// Called on the audio stream thread when a PCM packet is received for the
/// stream. |data| is an array representing the raw PCM data as a floating
/// point type, i.e. 4-byte value(s). |frames| is the number of frames in the
/// PCM packet. |pts| is the presentation timestamp (in milliseconds since the
/// Unix Epoch) and represents the time at which the decompressed packet
/// should be presented to the user. Based on |frames| and the
/// |channel_layout| value passed to OnAudioStreamStarted you can calculate
/// the size of the |data| array in bytes.
///
void(CEF_CALLBACK* on_audio_stream_packet)(struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser,
const float** data,
int frames,
int64_t pts);
///
/// Called on the UI thread when the stream has stopped. OnAudioSteamStopped
/// will always be called after OnAudioStreamStarted; both functions may be
/// called multiple times for the same stream.
///
void(CEF_CALLBACK* on_audio_stream_stopped)(struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser);
///
/// Called on the UI or audio stream thread when an error occurred. During the
/// stream creation phase this callback will be called on the UI thread while
/// in the capturing phase it will be called on the audio stream thread. The
/// stream will be stopped immediately.
///
void(CEF_CALLBACK* on_audio_stream_error)(struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* message);
} cef_audio_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_

View File

@@ -0,0 +1,76 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b63947918eca8c31790cae16b2e8a0be7e9464dd$
//
#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Callback structure used for asynchronous continuation of authentication
/// requests.
///
typedef struct _cef_auth_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Continue the authentication request.
///
void(CEF_CALLBACK* cont)(struct _cef_auth_callback_t* self,
const cef_string_t* username,
const cef_string_t* password);
///
/// Cancel the authentication request.
///
void(CEF_CALLBACK* cancel)(struct _cef_auth_callback_t* self);
} cef_auth_callback_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_

View File

@@ -0,0 +1,107 @@
// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
#include <stdint.h>
#include "include/internal/cef_export.h"
#include "include/internal/cef_string.h"
#include "include/internal/cef_string_list.h"
#include "include/internal/cef_string_map.h"
#include "include/internal/cef_string_multimap.h"
#include "include/internal/cef_types.h"
#ifdef __cplusplus
extern "C" {
#endif
///
// All ref-counted framework structures must include this structure first.
///
typedef struct _cef_base_ref_counted_t {
///
// Size of the data structure.
///
size_t size;
///
// Called to increment the reference count for the object. Should be called
// for every new copy of a pointer to a given object.
///
void(CEF_CALLBACK* add_ref)(struct _cef_base_ref_counted_t* self);
///
// Called to decrement the reference count for the object. If the reference
// count falls to 0 the object should self-delete. Returns true (1) if the
// resulting reference count is 0.
///
int(CEF_CALLBACK* release)(struct _cef_base_ref_counted_t* self);
///
// Returns true (1) if the current reference count is 1.
///
int(CEF_CALLBACK* has_one_ref)(struct _cef_base_ref_counted_t* self);
///
// Returns true (1) if the current reference count is at least 1.
///
int(CEF_CALLBACK* has_at_least_one_ref)(struct _cef_base_ref_counted_t* self);
} cef_base_ref_counted_t;
///
// All scoped framework structures must include this structure first.
///
typedef struct _cef_base_scoped_t {
///
// Size of the data structure.
///
size_t size;
///
// Called to delete this object. May be NULL if the object is not owned.
///
void(CEF_CALLBACK* del)(struct _cef_base_scoped_t* self);
} cef_base_scoped_t;
// Check that the structure |s|, which is defined with a size_t member at the
// top, is large enough to contain the specified member |f|.
#define CEF_MEMBER_EXISTS(s, f) \
((intptr_t) & \
((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= *reinterpret_cast<size_t*>(s))
#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,177 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d958d5bed7f909f6313facef3440fb8ba07a5c01$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_client_capi.h"
#include "include/capi/cef_command_line_capi.h"
#include "include/capi/cef_preference_capi.h"
#include "include/capi/cef_request_context_handler_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Structure used to implement browser process callbacks. The functions of this
/// structure will be called on the browser process main thread unless otherwise
/// indicated.
///
typedef struct _cef_browser_process_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Provides an opportunity to register custom preferences prior to global and
/// request context initialization.
///
/// If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be
/// accessed via cef_preference_manager_t::GetGlobalPreferences after
/// OnContextInitialized is called. Global preferences are registered a single
/// time at application startup. See related cef_settings_t.cache_path and
/// cef_settings_t.persist_user_preferences configuration.
///
/// If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be
/// accessed via the cef_request_context_t after
/// cef_request_context_handler_t::OnRequestContextInitialized is called.
/// Request context preferences are registered each time a new
/// cef_request_context_t is created. It is intended but not required that all
/// request contexts have the same registered preferences. See related
/// cef_request_context_settings_t.cache_path and
/// cef_request_context_settings_t.persist_user_preferences configuration.
///
/// Do not keep a reference to the |registrar| object. This function is called
/// on the browser process UI thread.
///
void(CEF_CALLBACK* on_register_custom_preferences)(
struct _cef_browser_process_handler_t* self,
cef_preferences_type_t type,
struct _cef_preference_registrar_t* registrar);
///
/// Called on the browser process UI thread immediately after the CEF context
/// has been initialized.
///
void(CEF_CALLBACK* on_context_initialized)(
struct _cef_browser_process_handler_t* self);
///
/// Called before a child process is launched. Will be called on the browser
/// process UI thread when launching a render process and on the browser
/// process IO thread when launching a GPU process. Provides an opportunity to
/// modify the child process command line. Do not keep a reference to
/// |command_line| outside of this function.
///
void(CEF_CALLBACK* on_before_child_process_launch)(
struct _cef_browser_process_handler_t* self,
struct _cef_command_line_t* command_line);
///
/// Implement this function to provide app-specific behavior when an already
/// running app is relaunched with the same CefSettings.root_cache_path value.
/// For example, activate an existing app window or create a new app window.
/// |command_line| will be read-only. Do not keep a reference to
/// |command_line| outside of this function. Return true (1) if the relaunch
/// is handled or false (0) for default relaunch behavior. Default behavior
/// will create a new default styled Chrome window.
///
/// To avoid cache corruption only a single app instance is allowed to run for
/// a given CefSettings.root_cache_path value. On relaunch the app checks a
/// process singleton lock and then forwards the new launch arguments to the
/// already running app process before exiting early. Client apps should
/// therefore check the cef_initialize() return value for early exit before
/// proceeding.
///
/// This function will be called on the browser process UI thread.
///
int(CEF_CALLBACK* on_already_running_app_relaunch)(
struct _cef_browser_process_handler_t* self,
struct _cef_command_line_t* command_line,
const cef_string_t* current_directory);
///
/// Called from any thread when work has been scheduled for the browser
/// process main (UI) thread. This callback is used in combination with
/// cef_settings_t.external_message_pump and cef_do_message_loop_work() in
/// cases where the CEF message loop must be integrated into an existing
/// application message loop (see additional comments and warnings on
/// CefDoMessageLoopWork). This callback should schedule a
/// cef_do_message_loop_work() call to happen on the main (UI) thread.
/// |delay_ms| is the requested delay in milliseconds. If |delay_ms| is <= 0
/// then the call should happen reasonably soon. If |delay_ms| is > 0 then the
/// call should be scheduled to happen after the specified delay and any
/// currently pending scheduled call should be cancelled.
///
void(CEF_CALLBACK* on_schedule_message_pump_work)(
struct _cef_browser_process_handler_t* self,
int64_t delay_ms);
///
/// Return the default client for use with a newly created browser window
/// (cef_browser_t object). If null is returned the cef_browser_t will be
/// unmanaged (no callbacks will be executed for that cef_browser_t) and
/// application shutdown will be blocked until the browser window is closed
/// manually. This function is currently only used with the Chrome runtime
/// when creating new browser windows via Chrome UI.
///
struct _cef_client_t*(CEF_CALLBACK* get_default_client)(
struct _cef_browser_process_handler_t* self);
///
/// Return the default handler for use with a new user or incognito profile
/// (cef_request_context_t object). If null is returned the
/// cef_request_context_t will be unmanaged (no callbacks will be executed for
/// that cef_request_context_t). This function is currently only used with the
/// Chrome runtime when creating new browser windows via Chrome UI.
///
struct _cef_request_context_handler_t*(
CEF_CALLBACK* get_default_request_context_handler)(
struct _cef_browser_process_handler_t* self);
} cef_browser_process_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_

View File

@@ -0,0 +1,88 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=46bc048bec64590735298a95633167d66e445844$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Generic callback structure used for asynchronous continuation.
///
typedef struct _cef_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Continue processing.
///
void(CEF_CALLBACK* cont)(struct _cef_callback_t* self);
///
/// Cancel processing.
///
void(CEF_CALLBACK* cancel)(struct _cef_callback_t* self);
} cef_callback_t;
///
/// Generic callback structure used for asynchronous completion.
///
typedef struct _cef_completion_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Method that will be called once the task is complete.
///
void(CEF_CALLBACK* on_complete)(struct _cef_completion_callback_t* self);
} cef_completion_callback_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_

View File

@@ -0,0 +1,210 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=09bd4140605645c9dfbd81e7e22d029d0bb50129$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
#pragma once
#include "include/capi/cef_audio_handler_capi.h"
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_command_handler_capi.h"
#include "include/capi/cef_context_menu_handler_capi.h"
#include "include/capi/cef_dialog_handler_capi.h"
#include "include/capi/cef_display_handler_capi.h"
#include "include/capi/cef_download_handler_capi.h"
#include "include/capi/cef_drag_handler_capi.h"
#include "include/capi/cef_find_handler_capi.h"
#include "include/capi/cef_focus_handler_capi.h"
#include "include/capi/cef_frame_handler_capi.h"
#include "include/capi/cef_jsdialog_handler_capi.h"
#include "include/capi/cef_keyboard_handler_capi.h"
#include "include/capi/cef_life_span_handler_capi.h"
#include "include/capi/cef_load_handler_capi.h"
#include "include/capi/cef_permission_handler_capi.h"
#include "include/capi/cef_print_handler_capi.h"
#include "include/capi/cef_process_message_capi.h"
#include "include/capi/cef_render_handler_capi.h"
#include "include/capi/cef_request_handler_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to provide handler implementations.
///
typedef struct _cef_client_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Return the handler for audio rendering events.
///
struct _cef_audio_handler_t*(CEF_CALLBACK* get_audio_handler)(
struct _cef_client_t* self);
///
/// Return the handler for commands. If no handler is provided the default
/// implementation will be used.
///
struct _cef_command_handler_t*(CEF_CALLBACK* get_command_handler)(
struct _cef_client_t* self);
///
/// Return the handler for context menus. If no handler is provided the
/// default implementation will be used.
///
struct _cef_context_menu_handler_t*(CEF_CALLBACK* get_context_menu_handler)(
struct _cef_client_t* self);
///
/// Return the handler for dialogs. If no handler is provided the default
/// implementation will be used.
///
struct _cef_dialog_handler_t*(CEF_CALLBACK* get_dialog_handler)(
struct _cef_client_t* self);
///
/// Return the handler for browser display state events.
///
struct _cef_display_handler_t*(CEF_CALLBACK* get_display_handler)(
struct _cef_client_t* self);
///
/// Return the handler for download events. If no handler is returned
/// downloads will not be allowed.
///
struct _cef_download_handler_t*(CEF_CALLBACK* get_download_handler)(
struct _cef_client_t* self);
///
/// Return the handler for drag events.
///
struct _cef_drag_handler_t*(CEF_CALLBACK* get_drag_handler)(
struct _cef_client_t* self);
///
/// Return the handler for find result events.
///
struct _cef_find_handler_t*(CEF_CALLBACK* get_find_handler)(
struct _cef_client_t* self);
///
/// Return the handler for focus events.
///
struct _cef_focus_handler_t*(CEF_CALLBACK* get_focus_handler)(
struct _cef_client_t* self);
///
/// Return the handler for events related to cef_frame_t lifespan. This
/// function will be called once during cef_browser_t creation and the result
/// will be cached for performance reasons.
///
struct _cef_frame_handler_t*(CEF_CALLBACK* get_frame_handler)(
struct _cef_client_t* self);
///
/// Return the handler for permission requests.
///
struct _cef_permission_handler_t*(CEF_CALLBACK* get_permission_handler)(
struct _cef_client_t* self);
///
/// Return the handler for JavaScript dialogs. If no handler is provided the
/// default implementation will be used.
///
struct _cef_jsdialog_handler_t*(CEF_CALLBACK* get_jsdialog_handler)(
struct _cef_client_t* self);
///
/// Return the handler for keyboard events.
///
struct _cef_keyboard_handler_t*(CEF_CALLBACK* get_keyboard_handler)(
struct _cef_client_t* self);
///
/// Return the handler for browser life span events.
///
struct _cef_life_span_handler_t*(CEF_CALLBACK* get_life_span_handler)(
struct _cef_client_t* self);
///
/// Return the handler for browser load status events.
///
struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)(
struct _cef_client_t* self);
///
/// Return the handler for printing on Linux. If a print handler is not
/// provided then printing will not be supported on the Linux platform.
///
struct _cef_print_handler_t*(CEF_CALLBACK* get_print_handler)(
struct _cef_client_t* self);
///
/// Return the handler for off-screen rendering events.
///
struct _cef_render_handler_t*(CEF_CALLBACK* get_render_handler)(
struct _cef_client_t* self);
///
/// Return the handler for browser request events.
///
struct _cef_request_handler_t*(CEF_CALLBACK* get_request_handler)(
struct _cef_client_t* self);
///
/// Called when a new message is received from a different process. Return
/// true (1) if the message was handled or false (0) otherwise. It is safe to
/// keep a reference to |message| outside of this callback.
///
int(CEF_CALLBACK* on_process_message_received)(
struct _cef_client_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
cef_process_id_t source_process,
struct _cef_process_message_t* message);
} cef_client_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_

View File

@@ -0,0 +1,120 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dd183a473b1e8c5ee8bdcf99949fc5274c4cc892$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to handle events related to commands. The functions
/// of this structure will be called on the UI thread.
///
typedef struct _cef_command_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called to execute a Chrome command triggered via menu selection or
/// keyboard shortcut. Values for |command_id| can be found in the
/// cef_command_ids.h file. |disposition| provides information about the
/// intended command target. Return true (1) if the command was handled or
/// false (0) for the default implementation. For context menu commands this
/// will be called after cef_context_menu_handler_t::OnContextMenuCommand.
/// Only used with the Chrome runtime.
///
int(CEF_CALLBACK* on_chrome_command)(
struct _cef_command_handler_t* self,
struct _cef_browser_t* browser,
int command_id,
cef_window_open_disposition_t disposition);
///
/// Called to check if a Chrome app menu item should be visible. Values for
/// |command_id| can be found in the cef_command_ids.h file. Only called for
/// menu items that would be visible by default. Only used with the Chrome
/// runtime.
///
int(CEF_CALLBACK* is_chrome_app_menu_item_visible)(
struct _cef_command_handler_t* self,
struct _cef_browser_t* browser,
int command_id);
///
/// Called to check if a Chrome app menu item should be enabled. Values for
/// |command_id| can be found in the cef_command_ids.h file. Only called for
/// menu items that would be enabled by default. Only used with the Chrome
/// runtime.
///
int(CEF_CALLBACK* is_chrome_app_menu_item_enabled)(
struct _cef_command_handler_t* self,
struct _cef_browser_t* browser,
int command_id);
///
/// Called during browser creation to check if a Chrome page action icon
/// should be visible. Only called for icons that would be visible by default.
/// Only used with the Chrome runtime.
///
int(CEF_CALLBACK* is_chrome_page_action_icon_visible)(
struct _cef_command_handler_t* self,
cef_chrome_page_action_icon_type_t icon_type);
///
/// Called during browser creation to check if a Chrome toolbar button should
/// be visible. Only called for buttons that would be visible by default. Only
/// used with the Chrome runtime.
///
int(CEF_CALLBACK* is_chrome_toolbar_button_visible)(
struct _cef_command_handler_t* self,
cef_chrome_toolbar_button_type_t button_type);
} cef_command_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_

View File

@@ -0,0 +1,215 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=fce786b3f054d6581438e2906b77e573c797372a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Structure used to create and/or parse command line arguments. Arguments with
/// "--", "-" and, on Windows, "/" prefixes are considered switches. Switches
/// will always precede any arguments without switch prefixes. Switches can
/// optionally have a value specified using the "=" delimiter (e.g.
/// "-switch=value"). An argument of "--" will terminate switch parsing with all
/// subsequent tokens, regardless of prefix, being interpreted as non-switch
/// arguments. Switch names should be lowercase ASCII and will be converted to
/// such if necessary. Switch values will retain the original case and UTF8
/// encoding. This structure can be used before cef_initialize() is called.
///
typedef struct _cef_command_line_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns true (1) if this object is valid. Do not call any other functions
/// if this function returns false (0).
///
int(CEF_CALLBACK* is_valid)(struct _cef_command_line_t* self);
///
/// Returns true (1) if the values of this object are read-only. Some APIs may
/// expose read-only objects.
///
int(CEF_CALLBACK* is_read_only)(struct _cef_command_line_t* self);
///
/// Returns a writable copy of this object.
///
struct _cef_command_line_t*(CEF_CALLBACK* copy)(
struct _cef_command_line_t* self);
///
/// Initialize the command line with the specified |argc| and |argv| values.
/// The first argument must be the name of the program. This function is only
/// supported on non-Windows platforms.
///
void(CEF_CALLBACK* init_from_argv)(struct _cef_command_line_t* self,
int argc,
const char* const* argv);
///
/// Initialize the command line with the string returned by calling
/// GetCommandLineW(). This function is only supported on Windows.
///
void(CEF_CALLBACK* init_from_string)(struct _cef_command_line_t* self,
const cef_string_t* command_line);
///
/// Reset the command-line switches and arguments but leave the program
/// component unchanged.
///
void(CEF_CALLBACK* reset)(struct _cef_command_line_t* self);
///
/// Retrieve the original command line string as a vector of strings. The argv
/// array: `{ program, [(--|-|/)switch[=value]]*, [--], [argument]* }`
///
void(CEF_CALLBACK* get_argv)(struct _cef_command_line_t* self,
cef_string_list_t argv);
///
/// Constructs and returns the represented command line string. Use this
/// function cautiously because quoting behavior is unclear.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_command_line_string)(
struct _cef_command_line_t* self);
///
/// Get the program part of the command line string (the first item).
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_program)(
struct _cef_command_line_t* self);
///
/// Set the program part of the command line string (the first item).
///
void(CEF_CALLBACK* set_program)(struct _cef_command_line_t* self,
const cef_string_t* program);
///
/// Returns true (1) if the command line has switches.
///
int(CEF_CALLBACK* has_switches)(struct _cef_command_line_t* self);
///
/// Returns true (1) if the command line contains the given switch.
///
int(CEF_CALLBACK* has_switch)(struct _cef_command_line_t* self,
const cef_string_t* name);
///
/// Returns the value associated with the given switch. If the switch has no
/// value or isn't present this function returns the NULL string.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_switch_value)(
struct _cef_command_line_t* self,
const cef_string_t* name);
///
/// Returns the map of switch names and values. If a switch has no value an
/// NULL string is returned.
///
void(CEF_CALLBACK* get_switches)(struct _cef_command_line_t* self,
cef_string_map_t switches);
///
/// Add a switch to the end of the command line.
///
void(CEF_CALLBACK* append_switch)(struct _cef_command_line_t* self,
const cef_string_t* name);
///
/// Add a switch with the specified value to the end of the command line. If
/// the switch has no value pass an NULL value string.
///
void(CEF_CALLBACK* append_switch_with_value)(struct _cef_command_line_t* self,
const cef_string_t* name,
const cef_string_t* value);
///
/// True if there are remaining command line arguments.
///
int(CEF_CALLBACK* has_arguments)(struct _cef_command_line_t* self);
///
/// Get the remaining command line arguments.
///
void(CEF_CALLBACK* get_arguments)(struct _cef_command_line_t* self,
cef_string_list_t arguments);
///
/// Add an argument to the end of the command line.
///
void(CEF_CALLBACK* append_argument)(struct _cef_command_line_t* self,
const cef_string_t* argument);
///
/// Insert a command before the current command. Common for debuggers, like
/// "valgrind" or "gdb --args".
///
void(CEF_CALLBACK* prepend_wrapper)(struct _cef_command_line_t* self,
const cef_string_t* wrapper);
} cef_command_line_t;
///
/// Create a new cef_command_line_t instance.
///
CEF_EXPORT cef_command_line_t* cef_command_line_create(void);
///
/// Returns the singleton global cef_command_line_t object. The returned object
/// will be read-only.
///
CEF_EXPORT cef_command_line_t* cef_command_line_get_global(void);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_

View File

@@ -0,0 +1,367 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=3ae7dbb24ec7a95a2f4d4e390c9b6622221c2f42$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_menu_model_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_context_menu_params_t;
///
/// Callback structure used for continuation of custom context menu display.
///
typedef struct _cef_run_context_menu_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Complete context menu display by selecting the specified |command_id| and
/// |event_flags|.
///
void(CEF_CALLBACK* cont)(struct _cef_run_context_menu_callback_t* self,
int command_id,
cef_event_flags_t event_flags);
///
/// Cancel context menu display.
///
void(CEF_CALLBACK* cancel)(struct _cef_run_context_menu_callback_t* self);
} cef_run_context_menu_callback_t;
///
/// Callback structure used for continuation of custom quick menu display.
///
typedef struct _cef_run_quick_menu_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Complete quick menu display by selecting the specified |command_id| and
/// |event_flags|.
///
void(CEF_CALLBACK* cont)(struct _cef_run_quick_menu_callback_t* self,
int command_id,
cef_event_flags_t event_flags);
///
/// Cancel quick menu display.
///
void(CEF_CALLBACK* cancel)(struct _cef_run_quick_menu_callback_t* self);
} cef_run_quick_menu_callback_t;
///
/// Implement this structure to handle context menu events. The functions of
/// this structure will be called on the UI thread.
///
typedef struct _cef_context_menu_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called before a context menu is displayed. |params| provides information
/// about the context menu state. |model| initially contains the default
/// context menu. The |model| can be cleared to show no context menu or
/// modified to show a custom menu. Do not keep references to |params| or
/// |model| outside of this callback.
///
void(CEF_CALLBACK* on_before_context_menu)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
struct _cef_context_menu_params_t* params,
struct _cef_menu_model_t* model);
///
/// Called to allow custom display of the context menu. |params| provides
/// information about the context menu state. |model| contains the context
/// menu model resulting from OnBeforeContextMenu. For custom display return
/// true (1) and execute |callback| either synchronously or asynchronously
/// with the selected command ID. For default display return false (0). Do not
/// keep references to |params| or |model| outside of this callback.
///
int(CEF_CALLBACK* run_context_menu)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
struct _cef_context_menu_params_t* params,
struct _cef_menu_model_t* model,
struct _cef_run_context_menu_callback_t* callback);
///
/// Called to execute a command selected from the context menu. Return true
/// (1) if the command was handled or false (0) for the default
/// implementation. See cef_menu_id_t for the command ids that have default
/// implementations. All user-defined command ids should be between
/// MENU_ID_USER_FIRST and MENU_ID_USER_LAST. |params| will have the same
/// values as what was passed to on_before_context_menu(). Do not keep a
/// reference to |params| outside of this callback.
///
int(CEF_CALLBACK* on_context_menu_command)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
struct _cef_context_menu_params_t* params,
int command_id,
cef_event_flags_t event_flags);
///
/// Called when the context menu is dismissed irregardless of whether the menu
/// was canceled or a command was selected.
///
void(CEF_CALLBACK* on_context_menu_dismissed)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame);
///
/// Called to allow custom display of the quick menu for a windowless browser.
/// |location| is the top left corner of the selected region. |size| is the
/// size of the selected region. |edit_state_flags| is a combination of flags
/// that represent the state of the quick menu. Return true (1) if the menu
/// will be handled and execute |callback| either synchronously or
/// asynchronously with the selected command ID. Return false (0) to cancel
/// the menu.
///
int(CEF_CALLBACK* run_quick_menu)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_point_t* location,
const cef_size_t* size,
cef_quick_menu_edit_state_flags_t edit_state_flags,
struct _cef_run_quick_menu_callback_t* callback);
///
/// Called to execute a command selected from the quick menu for a windowless
/// browser. Return true (1) if the command was handled or false (0) for the
/// default implementation. See cef_menu_id_t for command IDs that have
/// default implementations.
///
int(CEF_CALLBACK* on_quick_menu_command)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
int command_id,
cef_event_flags_t event_flags);
///
/// Called when the quick menu for a windowless browser is dismissed
/// irregardless of whether the menu was canceled or a command was selected.
///
void(CEF_CALLBACK* on_quick_menu_dismissed)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame);
} cef_context_menu_handler_t;
///
/// Provides information about the context menu state. The functions of this
/// structure can only be accessed on browser process the UI thread.
///
typedef struct _cef_context_menu_params_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns the X coordinate of the mouse where the context menu was invoked.
/// Coords are relative to the associated RenderView's origin.
///
int(CEF_CALLBACK* get_xcoord)(struct _cef_context_menu_params_t* self);
///
/// Returns the Y coordinate of the mouse where the context menu was invoked.
/// Coords are relative to the associated RenderView's origin.
///
int(CEF_CALLBACK* get_ycoord)(struct _cef_context_menu_params_t* self);
///
/// Returns flags representing the type of node that the context menu was
/// invoked on.
///
cef_context_menu_type_flags_t(CEF_CALLBACK* get_type_flags)(
struct _cef_context_menu_params_t* self);
///
/// Returns the URL of the link, if any, that encloses the node that the
/// context menu was invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_link_url)(
struct _cef_context_menu_params_t* self);
///
/// Returns the link URL, if any, to be used ONLY for "copy link address". We
/// don't validate this field in the frontend process.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_unfiltered_link_url)(
struct _cef_context_menu_params_t* self);
///
/// Returns the source URL, if any, for the element that the context menu was
/// invoked on. Example of elements with source URLs are img, audio, and
/// video.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_source_url)(
struct _cef_context_menu_params_t* self);
///
/// Returns true (1) if the context menu was invoked on an image which has
/// non-NULL contents.
///
int(CEF_CALLBACK* has_image_contents)(
struct _cef_context_menu_params_t* self);
///
/// Returns the title text or the alt text if the context menu was invoked on
/// an image.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_title_text)(
struct _cef_context_menu_params_t* self);
///
/// Returns the URL of the top level page that the context menu was invoked
/// on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_page_url)(
struct _cef_context_menu_params_t* self);
///
/// Returns the URL of the subframe that the context menu was invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_frame_url)(
struct _cef_context_menu_params_t* self);
///
/// Returns the character encoding of the subframe that the context menu was
/// invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_frame_charset)(
struct _cef_context_menu_params_t* self);
///
/// Returns the type of context node that the context menu was invoked on.
///
cef_context_menu_media_type_t(CEF_CALLBACK* get_media_type)(
struct _cef_context_menu_params_t* self);
///
/// Returns flags representing the actions supported by the media element, if
/// any, that the context menu was invoked on.
///
cef_context_menu_media_state_flags_t(CEF_CALLBACK* get_media_state_flags)(
struct _cef_context_menu_params_t* self);
///
/// Returns the text of the selection, if any, that the context menu was
/// invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_selection_text)(
struct _cef_context_menu_params_t* self);
///
/// Returns the text of the misspelled word, if any, that the context menu was
/// invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_misspelled_word)(
struct _cef_context_menu_params_t* self);
///
/// Returns true (1) if suggestions exist, false (0) otherwise. Fills in
/// |suggestions| from the spell check service for the misspelled word if
/// there is one.
///
int(CEF_CALLBACK* get_dictionary_suggestions)(
struct _cef_context_menu_params_t* self,
cef_string_list_t suggestions);
///
/// Returns true (1) if the context menu was invoked on an editable node.
///
int(CEF_CALLBACK* is_editable)(struct _cef_context_menu_params_t* self);
///
/// Returns true (1) if the context menu was invoked on an editable node where
/// spell-check is enabled.
///
int(CEF_CALLBACK* is_spell_check_enabled)(
struct _cef_context_menu_params_t* self);
///
/// Returns flags representing the actions supported by the editable node, if
/// any, that the context menu was invoked on.
///
cef_context_menu_edit_state_flags_t(CEF_CALLBACK* get_edit_state_flags)(
struct _cef_context_menu_params_t* self);
///
/// Returns true (1) if the context menu contains items specified by the
/// renderer process.
///
int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self);
} cef_context_menu_params_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_

View File

@@ -0,0 +1,199 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=76ba2e59636aa71c8c6286093198a1e64d012c62$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_callback_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_cookie_visitor_t;
struct _cef_delete_cookies_callback_t;
struct _cef_set_cookie_callback_t;
///
/// Structure used for managing cookies. The functions of this structure may be
/// called on any thread unless otherwise indicated.
///
typedef struct _cef_cookie_manager_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Visit all cookies on the UI thread. The returned cookies are ordered by
/// longest path, then by earliest creation date. Returns false (0) if cookies
/// cannot be accessed.
///
int(CEF_CALLBACK* visit_all_cookies)(struct _cef_cookie_manager_t* self,
struct _cef_cookie_visitor_t* visitor);
///
/// Visit a subset of cookies on the UI thread. The results are filtered by
/// the given url scheme, host, domain and path. If |includeHttpOnly| is true
/// (1) HTTP-only cookies will also be included in the results. The returned
/// cookies are ordered by longest path, then by earliest creation date.
/// Returns false (0) if cookies cannot be accessed.
///
int(CEF_CALLBACK* visit_url_cookies)(struct _cef_cookie_manager_t* self,
const cef_string_t* url,
int includeHttpOnly,
struct _cef_cookie_visitor_t* visitor);
///
/// Sets a cookie given a valid URL and explicit user-provided cookie
/// attributes. This function expects each attribute to be well-formed. It
/// will check for disallowed characters (e.g. the ';' character is disallowed
/// within the cookie value attribute) and fail without setting the cookie if
/// such characters are found. If |callback| is non-NULL it will be executed
/// asnychronously on the UI thread after the cookie has been set. Returns
/// false (0) if an invalid URL is specified or if cookies cannot be accessed.
///
int(CEF_CALLBACK* set_cookie)(struct _cef_cookie_manager_t* self,
const cef_string_t* url,
const struct _cef_cookie_t* cookie,
struct _cef_set_cookie_callback_t* callback);
///
/// Delete all cookies that match the specified parameters. If both |url| and
/// |cookie_name| values are specified all host and domain cookies matching
/// both will be deleted. If only |url| is specified all host cookies (but not
/// domain cookies) irrespective of path will be deleted. If |url| is NULL all
/// cookies for all hosts and domains will be deleted. If |callback| is non-
/// NULL it will be executed asnychronously on the UI thread after the cookies
/// have been deleted. Returns false (0) if a non-NULL invalid URL is
/// specified or if cookies cannot be accessed. Cookies can alternately be
/// deleted using the Visit*Cookies() functions.
///
int(CEF_CALLBACK* delete_cookies)(
struct _cef_cookie_manager_t* self,
const cef_string_t* url,
const cef_string_t* cookie_name,
struct _cef_delete_cookies_callback_t* callback);
///
/// Flush the backing store (if any) to disk. If |callback| is non-NULL it
/// will be executed asnychronously on the UI thread after the flush is
/// complete. Returns false (0) if cookies cannot be accessed.
///
int(CEF_CALLBACK* flush_store)(struct _cef_cookie_manager_t* self,
struct _cef_completion_callback_t* callback);
} cef_cookie_manager_t;
///
/// Returns the global cookie manager. By default data will be stored at
/// cef_settings_t.cache_path if specified or in memory otherwise. If |callback|
/// is non-NULL it will be executed asnychronously on the UI thread after the
/// manager's storage has been initialized. Using this function is equivalent to
/// calling cef_request_context_t::cef_request_context_get_global_context()-
/// >GetDefaultCookieManager().
///
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
struct _cef_completion_callback_t* callback);
///
/// Structure to implement for visiting cookie values. The functions of this
/// structure will always be called on the UI thread.
///
typedef struct _cef_cookie_visitor_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Method that will be called once for each cookie. |count| is the 0-based
/// index for the current cookie. |total| is the total number of cookies. Set
/// |deleteCookie| to true (1) to delete the cookie currently being visited.
/// Return false (0) to stop visiting cookies. This function may never be
/// called if no cookies are found.
///
int(CEF_CALLBACK* visit)(struct _cef_cookie_visitor_t* self,
const struct _cef_cookie_t* cookie,
int count,
int total,
int* deleteCookie);
} cef_cookie_visitor_t;
///
/// Structure to implement to be notified of asynchronous completion via
/// cef_cookie_manager_t::set_cookie().
///
typedef struct _cef_set_cookie_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Method that will be called upon completion. |success| will be true (1) if
/// the cookie was set successfully.
///
void(CEF_CALLBACK* on_complete)(struct _cef_set_cookie_callback_t* self,
int success);
} cef_set_cookie_callback_t;
///
/// Structure to implement to be notified of asynchronous completion via
/// cef_cookie_manager_t::delete_cookies().
///
typedef struct _cef_delete_cookies_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Method that will be called upon completion. |num_deleted| will be the
/// number of cookies that were deleted.
///
void(CEF_CALLBACK* on_complete)(struct _cef_delete_cookies_callback_t* self,
int num_deleted);
} cef_delete_cookies_callback_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_

View File

@@ -0,0 +1,154 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=46a6432f66cce88d8597c3d070681b09a712dc54$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Crash reporting is configured using an INI-style config file named
/// "crash_reporter.cfg". On Windows and Linux this file must be placed next to
/// the main application executable. On macOS this file must be placed in the
/// top-level app bundle Resources directory (e.g.
/// "<appname>.app/Contents/Resources"). File contents are as follows:
///
/// <pre>
/// # Comments start with a hash character and must be on their own line.
///
/// [Config]
/// ProductName=<Value of the "prod" crash key; defaults to "cef">
/// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
/// AppName=<Windows only; App-specific folder name component for storing crash
/// information; default to "CEF">
/// ExternalHandler=<Windows only; Name of the external handler exe to use
/// instead of re-launching the main exe; default to empty>
/// BrowserCrashForwardingEnabled=<macOS only; True if browser process crashes
/// should be forwarded to the system crash
/// reporter; default to false>
/// ServerURL=<crash server URL; default to empty>
/// RateLimitEnabled=<True if uploads should be rate limited; default to true>
/// MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled;
/// default to 5>
/// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value
/// will cause older reports to be deleted; default to 20>
/// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted;
/// default to 5>
///
/// [CrashKeys]
/// my_key1=<small|medium|large>
/// my_key2=<small|medium|large>
/// </pre>
///
/// <b>Config section:</b>
///
/// If "ProductName" and/or "ProductVersion" are set then the specified values
/// will be included in the crash dump metadata. On macOS if these values are
/// set to NULL then they will be retrieved from the Info.plist file using the
/// "CFBundleName" and "CFBundleShortVersionString" keys respectively.
///
/// If "AppName" is set on Windows then crash report information (metrics,
/// database and dumps) will be stored locally on disk under the
/// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other
/// platforms the cef_settings_t.root_cache_path value will be used.
///
/// If "ExternalHandler" is set on Windows then the specified exe will be
/// launched as the crashpad-handler instead of re-launching the main process
/// exe. The value can be an absolute path or a path relative to the main exe
/// directory. On Linux the cef_settings_t.browser_subprocess_path value will be
/// used. On macOS the existing subprocess app bundle will be used.
///
/// If "BrowserCrashForwardingEnabled" is set to true (1) on macOS then browser
/// process crashes will be forwarded to the system crash reporter. This results
/// in the crash UI dialog being displayed to the user and crash reports being
/// logged under "~/Library/Logs/DiagnosticReports". Forwarding of crash reports
/// from non-browser processes and Debug builds is always disabled.
///
/// If "ServerURL" is set then crashes will be uploaded as a multi-part POST
/// request to the specified URL. Otherwise, reports will only be stored locally
/// on disk.
///
/// If "RateLimitEnabled" is set to true (1) then crash report uploads will be
/// rate limited as follows:
/// 1. If "MaxUploadsPerDay" is set to a positive value then at most the
/// specified number of crashes will be uploaded in each 24 hour period.
/// 2. If crash upload fails due to a network or server error then an
/// incremental backoff delay up to a maximum of 24 hours will be applied
/// for retries.
/// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the
/// "MaxUploadsPerDay" value will be reduced to 1 until the client is
/// restarted. This helps to avoid an upload flood when the network or
/// server error is resolved.
/// Rate limiting is not supported on Linux.
///
/// If "MaxDatabaseSizeInMb" is set to a positive value then crash report
/// storage on disk will be limited to that size in megabytes. For example, on
/// Windows each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20
/// equates to about 34 crash reports stored on disk. Not supported on Linux.
///
/// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports
/// older than the specified age in days will be deleted. Not supported on
/// Linux.
///
/// <b>CrashKeys section:</b>
///
/// A maximum of 26 crash keys of each size can be specified for use by the
/// application. Crash key values will be truncated based on the specified size
/// (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of
/// crash keys can be set from any thread or process using the
/// CefSetCrashKeyValue function. These key/value pairs will be sent to the
/// crash server along with the crash dump file.
///
CEF_EXPORT int cef_crash_reporting_enabled(void);
///
/// Sets or clears a specific key-value pair from the crash metadata.
///
CEF_EXPORT void cef_set_crash_key_value(const cef_string_t* key,
const cef_string_t* value);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_

View File

@@ -0,0 +1,148 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dd94c50619e92bf5bed4fe61479813ee559f779d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_browser_t;
///
/// Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The
/// functions of this structure will be called on the browser process UI thread.
///
typedef struct _cef_dev_tools_message_observer_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Method that will be called on receipt of a DevTools protocol message.
/// |browser| is the originating browser instance. |message| is a UTF8-encoded
/// JSON dictionary representing either a function result or an event.
/// |message| is only valid for the scope of this callback and should be
/// copied if necessary. Return true (1) if the message was handled or false
/// (0) if the message should be further processed and passed to the
/// OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate.
///
/// Method result dictionaries include an "id" (int) value that identifies the
/// orginating function call sent from
/// cef_browser_host_t::SendDevToolsMessage, and optionally either a "result"
/// (dictionary) or "error" (dictionary) value. The "error" dictionary will
/// contain "code" (int) and "message" (string) values. Event dictionaries
/// include a "function" (string) value and optionally a "params" (dictionary)
/// value. See the DevTools protocol documentation at
/// https://chromedevtools.github.io/devtools-protocol/ for details of
/// supported function calls and the expected "result" or "params" dictionary
/// contents. JSON dictionaries can be parsed using the CefParseJSON function
/// if desired, however be aware of performance considerations when parsing
/// large messages (some of which may exceed 1MB in size).
///
int(CEF_CALLBACK* on_dev_tools_message)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser,
const void* message,
size_t message_size);
///
/// Method that will be called after attempted execution of a DevTools
/// protocol function. |browser| is the originating browser instance.
/// |message_id| is the "id" value that identifies the originating function
/// call message. If the function succeeded |success| will be true (1) and
/// |result| will be the UTF8-encoded JSON "result" dictionary value (which
/// may be NULL). If the function failed |success| will be false (0) and
/// |result| will be the UTF8-encoded JSON "error" dictionary value. |result|
/// is only valid for the scope of this callback and should be copied if
/// necessary. See the OnDevToolsMessage documentation for additional details
/// on |result| contents.
///
void(CEF_CALLBACK* on_dev_tools_method_result)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser,
int message_id,
int success,
const void* result,
size_t result_size);
///
/// Method that will be called on receipt of a DevTools protocol event.
/// |browser| is the originating browser instance. |function| is the
/// "function" value. |params| is the UTF8-encoded JSON "params" dictionary
/// value (which may be NULL). |params| is only valid for the scope of this
/// callback and should be copied if necessary. See the OnDevToolsMessage
/// documentation for additional details on |params| contents.
///
void(CEF_CALLBACK* on_dev_tools_event)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser,
const cef_string_t* method,
const void* params,
size_t params_size);
///
/// Method that will be called when the DevTools agent has attached. |browser|
/// is the originating browser instance. This will generally occur in response
/// to the first message sent while the agent is detached.
///
void(CEF_CALLBACK* on_dev_tools_agent_attached)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser);
///
/// Method that will be called when the DevTools agent has detached. |browser|
/// is the originating browser instance. Any function results that were
/// pending before the agent became detached will not be delivered, and any
/// active event subscriptions will be canceled.
///
void(CEF_CALLBACK* on_dev_tools_agent_detached)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser);
} cef_dev_tools_message_observer_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_

View File

@@ -0,0 +1,120 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=bf7208a86ee17f63fd7163cef8c3a13373a1f1c8$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Callback structure for asynchronous continuation of file dialog requests.
///
typedef struct _cef_file_dialog_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Continue the file selection. |file_paths| should be a single value or a
/// list of values depending on the dialog mode. An NULL |file_paths| value is
/// treated the same as calling cancel().
///
void(CEF_CALLBACK* cont)(struct _cef_file_dialog_callback_t* self,
cef_string_list_t file_paths);
///
/// Cancel the file selection.
///
void(CEF_CALLBACK* cancel)(struct _cef_file_dialog_callback_t* self);
} cef_file_dialog_callback_t;
///
/// Implement this structure to handle dialog events. The functions of this
/// structure will be called on the browser process UI thread.
///
typedef struct _cef_dialog_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called to run a file chooser dialog. |mode| represents the type of dialog
/// to display. |title| to the title to be used for the dialog and may be NULL
/// to show the default title ("Open" or "Save" depending on the mode).
/// |default_file_path| is the path with optional directory and/or file name
/// component that should be initially selected in the dialog.
/// |accept_filters| are used to restrict the selectable file types and may be
/// any combination of valid lower-cased MIME types (e.g. "text/*" or
/// "image/*") and individual file extensions (e.g. ".txt" or ".png").
/// |accept_extensions| provides the semicolon-delimited expansion of MIME
/// types to file extensions (if known, or NULL string otherwise).
/// |accept_descriptions| provides the descriptions for MIME types (if known,
/// or NULL string otherwise). For example, the "image/*" mime type might have
/// extensions ".png;.jpg;.bmp;..." and description "Image Files".
/// |accept_filters|, |accept_extensions| and |accept_descriptions| will all
/// be the same size. To display a custom dialog return true (1) and execute
/// |callback| either inline or at a later time. To display the default dialog
/// return false (0). If this function returns false (0) it may be called an
/// additional time for the same dialog (both before and after MIME type
/// expansion).
///
int(CEF_CALLBACK* on_file_dialog)(
struct _cef_dialog_handler_t* self,
struct _cef_browser_t* browser,
cef_file_dialog_mode_t mode,
const cef_string_t* title,
const cef_string_t* default_file_path,
cef_string_list_t accept_filters,
cef_string_list_t accept_extensions,
cef_string_list_t accept_descriptions,
struct _cef_file_dialog_callback_t* callback);
} cef_dialog_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_

View File

@@ -0,0 +1,178 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5a99c5e88ea0e123087234b2795fa625fed183f2$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to handle events related to browser display state.
/// The functions of this structure will be called on the UI thread.
///
typedef struct _cef_display_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called when a frame's address has changed.
///
void(CEF_CALLBACK* on_address_change)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_string_t* url);
///
/// Called when the page title changes.
///
void(CEF_CALLBACK* on_title_change)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* title);
///
/// Called when the page icon changes.
///
void(CEF_CALLBACK* on_favicon_urlchange)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
cef_string_list_t icon_urls);
///
/// Called when web content in the page has toggled fullscreen mode. If
/// |fullscreen| is true (1) the content will automatically be sized to fill
/// the browser content area. If |fullscreen| is false (0) the content will
/// automatically return to its original size and position. With the Alloy
/// runtime the client is responsible for triggering the fullscreen transition
/// (for example, by calling cef_window_t::SetFullscreen when using Views).
/// With the Chrome runtime the fullscreen transition will be triggered
/// automatically. The cef_window_delegate_t::OnWindowFullscreenTransition
/// function will be called during the fullscreen transition for notification
/// purposes.
///
void(CEF_CALLBACK* on_fullscreen_mode_change)(
struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
int fullscreen);
///
/// Called when the browser is about to display a tooltip. |text| contains the
/// text that will be displayed in the tooltip. To handle the display of the
/// tooltip yourself return true (1). Otherwise, you can optionally modify
/// |text| and then return false (0) to allow the browser to display the
/// tooltip. When window rendering is disabled the application is responsible
/// for drawing tooltips and the return value is ignored.
///
int(CEF_CALLBACK* on_tooltip)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
cef_string_t* text);
///
/// Called when the browser receives a status message. |value| contains the
/// text that will be displayed in the status message.
///
void(CEF_CALLBACK* on_status_message)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* value);
///
/// Called to display a console message. Return true (1) to stop the message
/// from being output to the console.
///
int(CEF_CALLBACK* on_console_message)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
cef_log_severity_t level,
const cef_string_t* message,
const cef_string_t* source,
int line);
///
/// Called when auto-resize is enabled via
/// cef_browser_host_t::SetAutoResizeEnabled and the contents have auto-
/// resized. |new_size| will be the desired size in view coordinates. Return
/// true (1) if the resize was handled or false (0) for default handling.
///
int(CEF_CALLBACK* on_auto_resize)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
const cef_size_t* new_size);
///
/// Called when the overall page loading progress has changed. |progress|
/// ranges from 0.0 to 1.0.
///
void(CEF_CALLBACK* on_loading_progress_change)(
struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
double progress);
///
/// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
/// |custom_cursor_info| will be populated with the custom cursor information.
/// Return true (1) if the cursor change was handled or false (0) for default
/// handling.
///
int(CEF_CALLBACK* on_cursor_change)(
struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
cef_cursor_handle_t cursor,
cef_cursor_type_t type,
const cef_cursor_info_t* custom_cursor_info);
///
/// Called when the browser's access to an audio and/or video source has
/// changed.
///
void(CEF_CALLBACK* on_media_access_change)(
struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
int has_video_access,
int has_audio_access);
} cef_display_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_

345
include/capi/cef_dom_capi.h Normal file
View File

@@ -0,0 +1,345 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a4d2f79163205ed4367916546240a6aedc2165f9$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_domdocument_t;
struct _cef_domnode_t;
///
/// Structure to implement for visiting the DOM. The functions of this structure
/// will be called on the render process main thread.
///
typedef struct _cef_domvisitor_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Method executed for visiting the DOM. The document object passed to this
/// function represents a snapshot of the DOM at the time this function is
/// executed. DOM objects are only valid for the scope of this function. Do
/// not keep references to or attempt to access any DOM objects outside the
/// scope of this function.
///
void(CEF_CALLBACK* visit)(struct _cef_domvisitor_t* self,
struct _cef_domdocument_t* document);
} cef_domvisitor_t;
///
/// Structure used to represent a DOM document. The functions of this structure
/// should only be called on the render process main thread thread.
///
typedef struct _cef_domdocument_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns the document type.
///
cef_dom_document_type_t(CEF_CALLBACK* get_type)(
struct _cef_domdocument_t* self);
///
/// Returns the root document node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_document)(
struct _cef_domdocument_t* self);
///
/// Returns the BODY node of an HTML document.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_body)(
struct _cef_domdocument_t* self);
///
/// Returns the HEAD node of an HTML document.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_head)(
struct _cef_domdocument_t* self);
///
/// Returns the title of an HTML document.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_title)(
struct _cef_domdocument_t* self);
///
/// Returns the document element with the specified ID value.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_element_by_id)(
struct _cef_domdocument_t* self,
const cef_string_t* id);
///
/// Returns the node that currently has keyboard focus.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_focused_node)(
struct _cef_domdocument_t* self);
///
/// Returns true (1) if a portion of the document is selected.
///
int(CEF_CALLBACK* has_selection)(struct _cef_domdocument_t* self);
///
/// Returns the selection offset within the start node.
///
int(CEF_CALLBACK* get_selection_start_offset)(
struct _cef_domdocument_t* self);
///
/// Returns the selection offset within the end node.
///
int(CEF_CALLBACK* get_selection_end_offset)(struct _cef_domdocument_t* self);
///
/// Returns the contents of this selection as markup.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_selection_as_markup)(
struct _cef_domdocument_t* self);
///
/// Returns the contents of this selection as text.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_selection_as_text)(
struct _cef_domdocument_t* self);
///
/// Returns the base URL for the document.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_base_url)(
struct _cef_domdocument_t* self);
///
/// Returns a complete URL based on the document base URL and the specified
/// partial URL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_complete_url)(
struct _cef_domdocument_t* self,
const cef_string_t* partialURL);
} cef_domdocument_t;
///
/// Structure used to represent a DOM node. The functions of this structure
/// should only be called on the render process main thread.
///
typedef struct _cef_domnode_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns the type for this node.
///
cef_dom_node_type_t(CEF_CALLBACK* get_type)(struct _cef_domnode_t* self);
///
/// Returns true (1) if this is a text node.
///
int(CEF_CALLBACK* is_text)(struct _cef_domnode_t* self);
///
/// Returns true (1) if this is an element node.
///
int(CEF_CALLBACK* is_element)(struct _cef_domnode_t* self);
///
/// Returns true (1) if this is an editable node.
///
int(CEF_CALLBACK* is_editable)(struct _cef_domnode_t* self);
///
/// Returns true (1) if this is a form control element node.
///
int(CEF_CALLBACK* is_form_control_element)(struct _cef_domnode_t* self);
///
/// Returns the type of this form control element node.
///
cef_dom_form_control_type_t(CEF_CALLBACK* get_form_control_element_type)(
struct _cef_domnode_t* self);
///
/// Returns true (1) if this object is pointing to the same handle as |that|
/// object.
///
int(CEF_CALLBACK* is_same)(struct _cef_domnode_t* self,
struct _cef_domnode_t* that);
///
/// Returns the name of this node.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_domnode_t* self);
///
/// Returns the value of this node.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_value)(struct _cef_domnode_t* self);
///
/// Set the value of this node. Returns true (1) on success.
///
int(CEF_CALLBACK* set_value)(struct _cef_domnode_t* self,
const cef_string_t* value);
///
/// Returns the contents of this node as markup.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_as_markup)(
struct _cef_domnode_t* self);
///
/// Returns the document associated with this node.
///
struct _cef_domdocument_t*(CEF_CALLBACK* get_document)(
struct _cef_domnode_t* self);
///
/// Returns the parent node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_parent)(struct _cef_domnode_t* self);
///
/// Returns the previous sibling node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_previous_sibling)(
struct _cef_domnode_t* self);
///
/// Returns the next sibling node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_next_sibling)(
struct _cef_domnode_t* self);
///
/// Returns true (1) if this node has child nodes.
///
int(CEF_CALLBACK* has_children)(struct _cef_domnode_t* self);
///
/// Return the first child node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_first_child)(
struct _cef_domnode_t* self);
///
/// Returns the last child node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_last_child)(
struct _cef_domnode_t* self);
///
/// Returns the tag name of this element.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_element_tag_name)(
struct _cef_domnode_t* self);
///
/// Returns true (1) if this element has attributes.
///
int(CEF_CALLBACK* has_element_attributes)(struct _cef_domnode_t* self);
///
/// Returns true (1) if this element has an attribute named |attrName|.
///
int(CEF_CALLBACK* has_element_attribute)(struct _cef_domnode_t* self,
const cef_string_t* attrName);
///
/// Returns the element attribute named |attrName|.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_element_attribute)(
struct _cef_domnode_t* self,
const cef_string_t* attrName);
///
/// Returns a map of all element attributes.
///
void(CEF_CALLBACK* get_element_attributes)(struct _cef_domnode_t* self,
cef_string_map_t attrMap);
///
/// Set the value for the element attribute named |attrName|. Returns true (1)
/// on success.
///
int(CEF_CALLBACK* set_element_attribute)(struct _cef_domnode_t* self,
const cef_string_t* attrName,
const cef_string_t* value);
///
/// Returns the inner text of the element.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_element_inner_text)(
struct _cef_domnode_t* self);
///
/// Returns the bounds of the element in device pixels. Use
/// "window.devicePixelRatio" to convert to/from CSS pixels.
///
cef_rect_t(CEF_CALLBACK* get_element_bounds)(struct _cef_domnode_t* self);
} cef_domnode_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_

View File

@@ -0,0 +1,151 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7ecfb07a95315ff81937e9f68d419122fc88f1b7$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_download_item_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Callback structure used to asynchronously continue a download.
///
typedef struct _cef_before_download_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Call to continue the download. Set |download_path| to the full file path
/// for the download including the file name or leave blank to use the
/// suggested name and the default temp directory. Set |show_dialog| to true
/// (1) if you do wish to show the default "Save As" dialog.
///
void(CEF_CALLBACK* cont)(struct _cef_before_download_callback_t* self,
const cef_string_t* download_path,
int show_dialog);
} cef_before_download_callback_t;
///
/// Callback structure used to asynchronously cancel a download.
///
typedef struct _cef_download_item_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Call to cancel the download.
///
void(CEF_CALLBACK* cancel)(struct _cef_download_item_callback_t* self);
///
/// Call to pause the download.
///
void(CEF_CALLBACK* pause)(struct _cef_download_item_callback_t* self);
///
/// Call to resume the download.
///
void(CEF_CALLBACK* resume)(struct _cef_download_item_callback_t* self);
} cef_download_item_callback_t;
///
/// Structure used to handle file downloads. The functions of this structure
/// will called on the browser process UI thread.
///
typedef struct _cef_download_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called before a download begins in response to a user-initiated action
/// (e.g. alt + link click or link click that returns a `Content-Disposition:
/// attachment` response from the server). |url| is the target download URL
/// and |request_function| is the target function (GET, POST, etc). Return
/// true (1) to proceed with the download or false (0) to cancel the download.
///
int(CEF_CALLBACK* can_download)(struct _cef_download_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* url,
const cef_string_t* request_method);
///
/// Called before a download begins. |suggested_name| is the suggested name
/// for the download file. Return true (1) and execute |callback| either
/// asynchronously or in this function to continue or cancel the download.
/// Return false (0) to proceed with default handling (cancel with Alloy
/// style, download shelf with Chrome style). Do not keep a reference to
/// |download_item| outside of this function.
///
int(CEF_CALLBACK* on_before_download)(
struct _cef_download_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_download_item_t* download_item,
const cef_string_t* suggested_name,
struct _cef_before_download_callback_t* callback);
///
/// Called when a download's status or progress information has been updated.
/// This may be called multiple times before and after on_before_download().
/// Execute |callback| either asynchronously or in this function to cancel the
/// download if desired. Do not keep a reference to |download_item| outside of
/// this function.
///
void(CEF_CALLBACK* on_download_updated)(
struct _cef_download_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_download_item_t* download_item,
struct _cef_download_item_callback_t* callback);
} cef_download_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_

View File

@@ -0,0 +1,174 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=9af8ade3addfd112db41792c4e80682a8143e8c4$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Structure used to represent a download item.
///
typedef struct _cef_download_item_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns true (1) if this object is valid. Do not call any other functions
/// if this function returns false (0).
///
int(CEF_CALLBACK* is_valid)(struct _cef_download_item_t* self);
///
/// Returns true (1) if the download is in progress.
///
int(CEF_CALLBACK* is_in_progress)(struct _cef_download_item_t* self);
///
/// Returns true (1) if the download is complete.
///
int(CEF_CALLBACK* is_complete)(struct _cef_download_item_t* self);
///
/// Returns true (1) if the download has been canceled.
///
int(CEF_CALLBACK* is_canceled)(struct _cef_download_item_t* self);
///
/// Returns true (1) if the download has been interrupted.
///
int(CEF_CALLBACK* is_interrupted)(struct _cef_download_item_t* self);
///
/// Returns the most recent interrupt reason.
///
cef_download_interrupt_reason_t(CEF_CALLBACK* get_interrupt_reason)(
struct _cef_download_item_t* self);
///
/// Returns a simple speed estimate in bytes/s.
///
int64_t(CEF_CALLBACK* get_current_speed)(struct _cef_download_item_t* self);
///
/// Returns the rough percent complete or -1 if the receive total size is
/// unknown.
///
int(CEF_CALLBACK* get_percent_complete)(struct _cef_download_item_t* self);
///
/// Returns the total number of bytes.
///
int64_t(CEF_CALLBACK* get_total_bytes)(struct _cef_download_item_t* self);
///
/// Returns the number of received bytes.
///
int64_t(CEF_CALLBACK* get_received_bytes)(struct _cef_download_item_t* self);
///
/// Returns the time that the download started.
///
cef_basetime_t(CEF_CALLBACK* get_start_time)(
struct _cef_download_item_t* self);
///
/// Returns the time that the download ended.
///
cef_basetime_t(CEF_CALLBACK* get_end_time)(struct _cef_download_item_t* self);
///
/// Returns the full path to the downloaded or downloading file.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_full_path)(
struct _cef_download_item_t* self);
///
/// Returns the unique identifier for this download.
///
uint32_t(CEF_CALLBACK* get_id)(struct _cef_download_item_t* self);
///
/// Returns the URL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_url)(
struct _cef_download_item_t* self);
///
/// Returns the original URL before any redirections.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_original_url)(
struct _cef_download_item_t* self);
///
/// Returns the suggested file name.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_suggested_file_name)(
struct _cef_download_item_t* self);
///
/// Returns the content disposition.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_content_disposition)(
struct _cef_download_item_t* self);
///
/// Returns the mime type.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_mime_type)(
struct _cef_download_item_t* self);
} cef_download_item_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_

View File

@@ -0,0 +1,240 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a096775255ddc4d7616095e48e7370bd87bf4bb5$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_image_capi.h"
#include "include/capi/cef_stream_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Structure used to represent drag data. The functions of this structure may
/// be called on any thread.
///
typedef struct _cef_drag_data_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns a copy of the current object.
///
struct _cef_drag_data_t*(CEF_CALLBACK* clone)(struct _cef_drag_data_t* self);
///
/// Returns true (1) if this object is read-only.
///
int(CEF_CALLBACK* is_read_only)(struct _cef_drag_data_t* self);
///
/// Returns true (1) if the drag data is a link.
///
int(CEF_CALLBACK* is_link)(struct _cef_drag_data_t* self);
///
/// Returns true (1) if the drag data is a text or html fragment.
///
int(CEF_CALLBACK* is_fragment)(struct _cef_drag_data_t* self);
///
/// Returns true (1) if the drag data is a file.
///
int(CEF_CALLBACK* is_file)(struct _cef_drag_data_t* self);
///
/// Return the link URL that is being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_link_url)(
struct _cef_drag_data_t* self);
///
/// Return the title associated with the link being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_link_title)(
struct _cef_drag_data_t* self);
///
/// Return the metadata, if any, associated with the link being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_link_metadata)(
struct _cef_drag_data_t* self);
///
/// Return the plain text fragment that is being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_fragment_text)(
struct _cef_drag_data_t* self);
///
/// Return the text/html fragment that is being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_fragment_html)(
struct _cef_drag_data_t* self);
///
/// Return the base URL that the fragment came from. This value is used for
/// resolving relative URLs and may be NULL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_fragment_base_url)(
struct _cef_drag_data_t* self);
///
/// Return the name of the file being dragged out of the browser window.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_file_name)(
struct _cef_drag_data_t* self);
///
/// Write the contents of the file being dragged out of the web view into
/// |writer|. Returns the number of bytes sent to |writer|. If |writer| is
/// NULL this function will return the size of the file contents in bytes.
/// Call get_file_name() to get a suggested name for the file.
///
size_t(CEF_CALLBACK* get_file_contents)(struct _cef_drag_data_t* self,
struct _cef_stream_writer_t* writer);
///
/// Retrieve the list of file names that are being dragged into the browser
/// window.
///
int(CEF_CALLBACK* get_file_names)(struct _cef_drag_data_t* self,
cef_string_list_t names);
///
/// Retrieve the list of file paths that are being dragged into the browser
/// window.
///
int(CEF_CALLBACK* get_file_paths)(struct _cef_drag_data_t* self,
cef_string_list_t paths);
///
/// Set the link URL that is being dragged.
///
void(CEF_CALLBACK* set_link_url)(struct _cef_drag_data_t* self,
const cef_string_t* url);
///
/// Set the title associated with the link being dragged.
///
void(CEF_CALLBACK* set_link_title)(struct _cef_drag_data_t* self,
const cef_string_t* title);
///
/// Set the metadata associated with the link being dragged.
///
void(CEF_CALLBACK* set_link_metadata)(struct _cef_drag_data_t* self,
const cef_string_t* data);
///
/// Set the plain text fragment that is being dragged.
///
void(CEF_CALLBACK* set_fragment_text)(struct _cef_drag_data_t* self,
const cef_string_t* text);
///
/// Set the text/html fragment that is being dragged.
///
void(CEF_CALLBACK* set_fragment_html)(struct _cef_drag_data_t* self,
const cef_string_t* html);
///
/// Set the base URL that the fragment came from.
///
void(CEF_CALLBACK* set_fragment_base_url)(struct _cef_drag_data_t* self,
const cef_string_t* base_url);
///
/// Reset the file contents. You should do this before calling
/// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
/// to drag in this kind of data.
///
void(CEF_CALLBACK* reset_file_contents)(struct _cef_drag_data_t* self);
///
/// Add a file that is being dragged into the webview.
///
void(CEF_CALLBACK* add_file)(struct _cef_drag_data_t* self,
const cef_string_t* path,
const cef_string_t* display_name);
///
/// Clear list of filenames.
///
void(CEF_CALLBACK* clear_filenames)(struct _cef_drag_data_t* self);
///
/// Get the image representation of drag data. May return NULL if no image
/// representation is available.
///
struct _cef_image_t*(CEF_CALLBACK* get_image)(struct _cef_drag_data_t* self);
///
/// Get the image hotspot (drag start location relative to image dimensions).
///
cef_point_t(CEF_CALLBACK* get_image_hotspot)(struct _cef_drag_data_t* self);
///
/// Returns true (1) if an image representation of drag data is available.
///
int(CEF_CALLBACK* has_image)(struct _cef_drag_data_t* self);
} cef_drag_data_t;
///
/// Create a new cef_drag_data_t object.
///
CEF_EXPORT cef_drag_data_t* cef_drag_data_create(void);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_

View File

@@ -0,0 +1,92 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0723a2a59d46e465ac94f198351dc871f0b35b96$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_drag_data_capi.h"
#include "include/capi/cef_frame_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to handle events related to dragging. The functions
/// of this structure will be called on the UI thread.
///
typedef struct _cef_drag_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called when an external drag event enters the browser window. |dragData|
/// contains the drag event data and |mask| represents the type of drag
/// operation. Return false (0) for default drag handling behavior or true (1)
/// to cancel the drag event.
///
int(CEF_CALLBACK* on_drag_enter)(struct _cef_drag_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_drag_data_t* dragData,
cef_drag_operations_mask_t mask);
///
/// Called whenever draggable regions for the browser window change. These can
/// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
/// draggable regions are never defined in a document this function will also
/// never be called. If the last draggable region is removed from a document
/// this function will be called with an NULL vector.
///
void(CEF_CALLBACK* on_draggable_regions_changed)(
struct _cef_drag_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
size_t regionsCount,
cef_draggable_region_t const* regions);
} cef_drag_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_

View File

@@ -0,0 +1,132 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=634054ad25154c30fb4ec630fe7fb79b0cf1f9b3$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_extension_handler_t;
struct _cef_request_context_t;
///
/// Object representing an extension. Methods may be called on any thread unless
/// otherwise indicated.
///
/// WARNING: This API is deprecated and will be removed in ~M127.
///
typedef struct _cef_extension_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns the unique extension identifier. This is calculated based on the
/// extension public key, if available, or on the extension path. See
/// https://developer.chrome.com/extensions/manifest/key for details.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
struct _cef_extension_t* self);
///
/// Returns the absolute path to the extension directory on disk. This value
/// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to
/// cef_request_context_t::LoadExtension.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_path)(struct _cef_extension_t* self);
///
/// Returns the extension manifest contents as a cef_dictionary_value_t
/// object. See https://developer.chrome.com/extensions/manifest for details.
///
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_manifest)(
struct _cef_extension_t* self);
///
/// Returns true (1) if this object is the same extension as |that| object.
/// Extensions are considered the same if identifier, path and loader context
/// match.
///
int(CEF_CALLBACK* is_same)(struct _cef_extension_t* self,
struct _cef_extension_t* that);
///
/// Returns the handler for this extension. Will return NULL for internal
/// extensions or if no handler was passed to
/// cef_request_context_t::LoadExtension.
///
struct _cef_extension_handler_t*(CEF_CALLBACK* get_handler)(
struct _cef_extension_t* self);
///
/// Returns the request context that loaded this extension. Will return NULL
/// for internal extensions or if the extension has been unloaded. See the
/// cef_request_context_t::LoadExtension documentation for more information
/// about loader contexts. Must be called on the browser process UI thread.
///
struct _cef_request_context_t*(CEF_CALLBACK* get_loader_context)(
struct _cef_extension_t* self);
///
/// Returns true (1) if this extension is currently loaded. Must be called on
/// the browser process UI thread.
///
int(CEF_CALLBACK* is_loaded)(struct _cef_extension_t* self);
///
/// Unload this extension if it is not an internal extension and is currently
/// loaded. Will result in a call to
/// cef_extension_handler_t::OnExtensionUnloaded on success.
///
void(CEF_CALLBACK* unload)(struct _cef_extension_t* self);
} cef_extension_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_

View File

@@ -0,0 +1,214 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ebac34c9b85de780ce7524211c5dd61a80d4576c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_extension_capi.h"
#include "include/capi/cef_stream_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_client_t;
///
/// Callback structure used for asynchronous continuation of
/// cef_extension_handler_t::GetExtensionResource.
///
typedef struct _cef_get_extension_resource_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Continue the request. Read the resource contents from |stream|.
///
void(CEF_CALLBACK* cont)(struct _cef_get_extension_resource_callback_t* self,
struct _cef_stream_reader_t* stream);
///
/// Cancel the request.
///
void(CEF_CALLBACK* cancel)(
struct _cef_get_extension_resource_callback_t* self);
} cef_get_extension_resource_callback_t;
///
/// Implement this structure to handle events related to browser extensions. The
/// functions of this structure will be called on the UI thread. See
/// cef_request_context_t::LoadExtension for information about extension
/// loading.
///
/// WARNING: This API is deprecated and will be removed in ~M127.
///
typedef struct _cef_extension_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called if the cef_request_context_t::LoadExtension request fails. |result|
/// will be the error code.
///
void(CEF_CALLBACK* on_extension_load_failed)(
struct _cef_extension_handler_t* self,
cef_errorcode_t result);
///
/// Called if the cef_request_context_t::LoadExtension request succeeds.
/// |extension| is the loaded extension.
///
void(CEF_CALLBACK* on_extension_loaded)(struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension);
///
/// Called after the cef_extension_t::Unload request has completed.
///
void(CEF_CALLBACK* on_extension_unloaded)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension);
///
/// Called when an extension needs a browser to host a background script
/// specified via the "background" manifest key. The browser will have no
/// visible window and cannot be displayed. |extension| is the extension that
/// is loading the background script. |url| is an internally generated
/// reference to an HTML page that will be used to load the background script
/// via a "<script>" src attribute. To allow creation of the browser
/// optionally modify |client| and |settings| and return false (0). To cancel
/// creation of the browser (and consequently cancel load of the background
/// script) return true (1). Successful creation will be indicated by a call
/// to cef_life_span_handler_t::OnAfterCreated, and
/// cef_browser_host_t::IsBackgroundHost will return true (1) for the
/// resulting browser. See https://developer.chrome.com/extensions/event_pages
/// for more information about extension background script usage.
///
int(CEF_CALLBACK* on_before_background_browser)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
const cef_string_t* url,
struct _cef_client_t** client,
struct _cef_browser_settings_t* settings);
///
/// Called when an extension API (e.g. chrome.tabs.create) requests creation
/// of a new browser. |extension| and |browser| are the source of the API
/// call. |active_browser| may optionally be specified via the windowId
/// property or returned via the get_active_browser() callback and provides
/// the default |client| and |settings| values for the new browser. |index| is
/// the position value optionally specified via the index property. |url| is
/// the URL that will be loaded in the browser. |active| is true (1) if the
/// new browser should be active when opened. To allow creation of the
/// browser optionally modify |windowInfo|, |client| and |settings| and return
/// false (0). To cancel creation of the browser return true (1). Successful
/// creation will be indicated by a call to
/// cef_life_span_handler_t::OnAfterCreated. Any modifications to |windowInfo|
/// will be ignored if |active_browser| is wrapped in a cef_browser_view_t.
///
int(CEF_CALLBACK* on_before_browser)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
struct _cef_browser_t* browser,
struct _cef_browser_t* active_browser,
int index,
const cef_string_t* url,
int active,
struct _cef_window_info_t* windowInfo,
struct _cef_client_t** client,
struct _cef_browser_settings_t* settings);
///
/// Called when no tabId is specified to an extension API call that accepts a
/// tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the
/// source of the API call. Return the browser that will be acted on by the
/// API call or return NULL to act on |browser|. The returned browser must
/// share the same cef_request_context_t as |browser|. Incognito browsers
/// should not be considered unless the source extension has incognito access
/// enabled, in which case |include_incognito| will be true (1).
///
struct _cef_browser_t*(CEF_CALLBACK* get_active_browser)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
struct _cef_browser_t* browser,
int include_incognito);
///
/// Called when the tabId associated with |target_browser| is specified to an
/// extension API call that accepts a tabId parameter (e.g. chrome.tabs.*).
/// |extension| and |browser| are the source of the API call. Return true (1)
/// to allow access of false (0) to deny access. Access to incognito browsers
/// should not be allowed unless the source extension has incognito access
/// enabled, in which case |include_incognito| will be true (1).
///
int(CEF_CALLBACK* can_access_browser)(struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
struct _cef_browser_t* browser,
int include_incognito,
struct _cef_browser_t* target_browser);
///
/// Called to retrieve an extension resource that would normally be loaded
/// from disk (e.g. if a file parameter is specified to
/// chrome.tabs.executeScript). |extension| and |browser| are the source of
/// the resource request. |file| is the requested relative file path. To
/// handle the resource request return true (1) and execute |callback| either
/// synchronously or asynchronously. For the default behavior which reads the
/// resource from the extension directory on disk return false (0).
/// Localization substitutions will not be applied to resources handled via
/// this function.
///
int(CEF_CALLBACK* get_extension_resource)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
struct _cef_browser_t* browser,
const cef_string_t* file,
struct _cef_get_extension_resource_callback_t* callback);
} cef_extension_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_

View File

@@ -0,0 +1,132 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=e10581d1f6aeb104646ae106aaa5fb36016643dd$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Creates a directory and all parent directories if they don't already exist.
/// Returns true (1) on successful creation or if the directory already exists.
/// The directory is only readable by the current user. Calling this function on
/// the browser process UI or IO threads is not allowed.
///
CEF_EXPORT int cef_create_directory(const cef_string_t* full_path);
///
/// Get the temporary directory provided by the system.
///
/// WARNING: In general, you should use the temp directory variants below
/// instead of this function. Those variants will ensure that the proper
/// permissions are set so that other users on the system can't edit them while
/// they're open (which could lead to security issues).
///
CEF_EXPORT int cef_get_temp_directory(cef_string_t* temp_dir);
///
/// Creates a new directory. On Windows if |prefix| is provided the new
/// directory name is in the format of "prefixyyyy". Returns true (1) on success
/// and sets |new_temp_path| to the full path of the directory that was created.
/// The directory is only readable by the current user. Calling this function on
/// the browser process UI or IO threads is not allowed.
///
CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix,
cef_string_t* new_temp_path);
///
/// Creates a directory within another directory. Extra characters will be
/// appended to |prefix| to ensure that the new directory does not have the same
/// name as an existing directory. Returns true (1) on success and sets
/// |new_dir| to the full path of the directory that was created. The directory
/// is only readable by the current user. Calling this function on the browser
/// process UI or IO threads is not allowed.
///
CEF_EXPORT int cef_create_temp_directory_in_directory(
const cef_string_t* base_dir,
const cef_string_t* prefix,
cef_string_t* new_dir);
///
/// Returns true (1) if the given path exists and is a directory. Calling this
/// function on the browser process UI or IO threads is not allowed.
///
CEF_EXPORT int cef_directory_exists(const cef_string_t* path);
///
/// Deletes the given path whether it's a file or a directory. If |path| is a
/// directory all contents will be deleted. If |recursive| is true (1) any sub-
/// directories and their contents will also be deleted (equivalent to executing
/// "rm -rf", so use with caution). On POSIX environments if |path| is a
/// symbolic link then only the symlink will be deleted. Returns true (1) on
/// successful deletion or if |path| does not exist. Calling this function on
/// the browser process UI or IO threads is not allowed.
///
CEF_EXPORT int cef_delete_file(const cef_string_t* path, int recursive);
///
/// Writes the contents of |src_dir| into a zip archive at |dest_file|. If
/// |include_hidden_files| is true (1) files starting with "." will be included.
/// Returns true (1) on success. Calling this function on the browser process
/// UI or IO threads is not allowed.
///
CEF_EXPORT int cef_zip_directory(const cef_string_t* src_dir,
const cef_string_t* dest_file,
int include_hidden_files);
///
/// Loads the existing "Certificate Revocation Lists" file that is managed by
/// Google Chrome. This file can generally be found in Chrome's User Data
/// directory (e.g. "C:\Users\[User]\AppData\Local\Google\Chrome\User Data\" on
/// Windows) and is updated periodically by Chrome's component updater service.
/// Must be called in the browser process after the context has been
/// initialized. See https://dev.chromium.org/Home/chromium-security/crlsets for
/// background.
///
CEF_EXPORT void cef_load_crlsets_file(const cef_string_t* path);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_

View File

@@ -0,0 +1,82 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=da0a9242b309fbd70d19949fb1c5b4ec4475ef94$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to handle events related to find results. The
/// functions of this structure will be called on the UI thread.
///
typedef struct _cef_find_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called to report find results returned by cef_browser_host_t::find().
/// |identifer| is a unique incremental identifier for the currently active
/// search, |count| is the number of matches currently identified,
/// |selectionRect| is the location of where the match was found (in window
/// coordinates), |activeMatchOrdinal| is the current position in the search
/// results, and |finalUpdate| is true (1) if this is the last find
/// notification.
///
void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self,
struct _cef_browser_t* browser,
int identifier,
int count,
const cef_rect_t* selectionRect,
int activeMatchOrdinal,
int finalUpdate);
} cef_find_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_

View File

@@ -0,0 +1,93 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6eefc2c650908461fb7536dd3314c77a3f89dceb$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_dom_capi.h"
#include "include/capi/cef_frame_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to handle events related to focus. The functions of
/// this structure will be called on the UI thread.
///
typedef struct _cef_focus_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called when the browser component is about to loose focus. For instance,
/// if focus was on the last HTML element and the user pressed the TAB key.
/// |next| will be true (1) if the browser is giving focus to the next
/// component and false (0) if the browser is giving focus to the previous
/// component.
///
void(CEF_CALLBACK* on_take_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser,
int next);
///
/// Called when the browser component is requesting focus. |source| indicates
/// where the focus request is originating from. Return false (0) to allow the
/// focus to be set or true (1) to cancel setting the focus.
///
int(CEF_CALLBACK* on_set_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser,
cef_focus_source_t source);
///
/// Called when the browser component has received focus.
///
void(CEF_CALLBACK* on_got_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser);
} cef_focus_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_

View File

@@ -0,0 +1,257 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=8f347a95168778ec0e686cdef93be3bc517e2f68$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_dom_capi.h"
#include "include/capi/cef_process_message_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_stream_capi.h"
#include "include/capi/cef_string_visitor_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_browser_t;
struct _cef_urlrequest_client_t;
struct _cef_urlrequest_t;
struct _cef_v8context_t;
///
/// Structure used to represent a frame in the browser window. When used in the
/// browser process the functions of this structure may be called on any thread
/// unless otherwise indicated in the comments. When used in the render process
/// the functions of this structure may only be called on the main thread.
///
typedef struct _cef_frame_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// True if this object is currently attached to a valid frame.
///
int(CEF_CALLBACK* is_valid)(struct _cef_frame_t* self);
///
/// Execute undo in this frame.
///
void(CEF_CALLBACK* undo)(struct _cef_frame_t* self);
///
/// Execute redo in this frame.
///
void(CEF_CALLBACK* redo)(struct _cef_frame_t* self);
///
/// Execute cut in this frame.
///
void(CEF_CALLBACK* cut)(struct _cef_frame_t* self);
///
/// Execute copy in this frame.
///
void(CEF_CALLBACK* copy)(struct _cef_frame_t* self);
///
/// Execute paste in this frame.
///
void(CEF_CALLBACK* paste)(struct _cef_frame_t* self);
///
/// Execute delete in this frame.
///
void(CEF_CALLBACK* del)(struct _cef_frame_t* self);
///
/// Execute select all in this frame.
///
void(CEF_CALLBACK* select_all)(struct _cef_frame_t* self);
///
/// Save this frame's HTML source to a temporary file and open it in the
/// default text viewing application. This function can only be called from
/// the browser process.
///
void(CEF_CALLBACK* view_source)(struct _cef_frame_t* self);
///
/// Retrieve this frame's HTML source as a string sent to the specified
/// visitor.
///
void(CEF_CALLBACK* get_source)(struct _cef_frame_t* self,
struct _cef_string_visitor_t* visitor);
///
/// Retrieve this frame's display text as a string sent to the specified
/// visitor.
///
void(CEF_CALLBACK* get_text)(struct _cef_frame_t* self,
struct _cef_string_visitor_t* visitor);
///
/// Load the request represented by the |request| object.
///
/// WARNING: This function will fail with "bad IPC message" reason
/// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
/// origin using some other mechanism (LoadURL, link click, etc).
///
void(CEF_CALLBACK* load_request)(struct _cef_frame_t* self,
struct _cef_request_t* request);
///
/// Load the specified |url|.
///
void(CEF_CALLBACK* load_url)(struct _cef_frame_t* self,
const cef_string_t* url);
///
/// Execute a string of JavaScript code in this frame. The |script_url|
/// parameter is the URL where the script in question can be found, if any.
/// The renderer may request this URL to show the developer the source of the
/// error. The |start_line| parameter is the base line number to use for
/// error reporting.
///
void(CEF_CALLBACK* execute_java_script)(struct _cef_frame_t* self,
const cef_string_t* code,
const cef_string_t* script_url,
int start_line);
///
/// Returns true (1) if this is the main (top-level) frame.
///
int(CEF_CALLBACK* is_main)(struct _cef_frame_t* self);
///
/// Returns true (1) if this is the focused frame.
///
int(CEF_CALLBACK* is_focused)(struct _cef_frame_t* self);
///
/// Returns the name for this frame. If the frame has an assigned name (for
/// example, set via the iframe "name" attribute) then that value will be
/// returned. Otherwise a unique name will be constructed based on the frame
/// parent hierarchy. The main (top-level) frame will always have an NULL name
/// value.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_frame_t* self);
///
/// Returns the globally unique identifier for this frame or NULL if the
/// underlying frame does not yet exist.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
struct _cef_frame_t* self);
///
/// Returns the parent of this frame or NULL if this is the main (top-level)
/// frame.
///
struct _cef_frame_t*(CEF_CALLBACK* get_parent)(struct _cef_frame_t* self);
///
/// Returns the URL currently loaded in this frame.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_frame_t* self);
///
/// Returns the browser that this frame belongs to.
///
struct _cef_browser_t*(CEF_CALLBACK* get_browser)(struct _cef_frame_t* self);
///
/// Get the V8 context associated with the frame. This function can only be
/// called from the render process.
///
struct _cef_v8context_t*(CEF_CALLBACK* get_v8context)(
struct _cef_frame_t* self);
///
/// Visit the DOM document. This function can only be called from the render
/// process.
///
void(CEF_CALLBACK* visit_dom)(struct _cef_frame_t* self,
struct _cef_domvisitor_t* visitor);
///
/// Create a new URL request that will be treated as originating from this
/// frame and the associated browser. Use cef_urlrequest_t::Create instead if
/// you do not want the request to have this association, in which case it may
/// be handled differently (see documentation on that function). A request
/// created with this function may only originate from the browser process,
/// and will behave as follows:
/// - It may be intercepted by the client via CefResourceRequestHandler or
/// CefSchemeHandlerFactory.
/// - POST data may only contain a single element of type PDE_TYPE_FILE or
/// PDE_TYPE_BYTES.
///
/// The |request| object will be marked as read-only after calling this
/// function.
///
struct _cef_urlrequest_t*(CEF_CALLBACK* create_urlrequest)(
struct _cef_frame_t* self,
struct _cef_request_t* request,
struct _cef_urlrequest_client_t* client);
///
/// Send a message to the specified |target_process|. Ownership of the message
/// contents will be transferred and the |message| reference will be
/// invalidated. Message delivery is not guaranteed in all cases (for example,
/// if the browser is closing, navigating, or if the target process crashes).
/// Send an ACK message back from the target process if confirmation is
/// required.
///
void(CEF_CALLBACK* send_process_message)(
struct _cef_frame_t* self,
cef_process_id_t target_process,
struct _cef_process_message_t* message);
} cef_frame_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_

View File

@@ -0,0 +1,195 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=fc6fbee765ce2b649f5293c8c4b076d36014e4aa$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to handle events related to cef_frame_t life span.
/// The order of callbacks is:
///
/// (1) During initial cef_browser_host_t creation and navigation of the main
/// frame:
/// - cef_frame_handler_t::OnFrameCreated => The initial main frame object has
/// been created. Any commands will be queued until the frame is attached.
/// - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object
/// has been assigned to the browser.
/// - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and
/// can be used.
/// - cef_frame_handler_t::OnFrameAttached => The initial main frame object is
/// now connected to its peer in the renderer process. Commands can be routed.
///
/// (2) During further cef_browser_host_t navigation/loading of the main frame
/// and/or sub-frames:
/// - cef_frame_handler_t::OnFrameCreated => A new main frame or sub-frame
/// object has been created. Any commands will be queued until the frame is
/// attached.
/// - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame
/// object is now connected to its peer in the renderer process. Commands can
/// be routed.
/// - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub-
/// frame object has lost its connection to the renderer process. If multiple
/// objects are detached at the same time then notifications will be sent for
/// any sub-frame objects before the main frame object. Commands can no longer
/// be routed and will be discarded.
/// - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has
/// been assigned to the browser. This will only occur with cross-origin
/// navigation or re-navigation after renderer process termination (due to
/// crashes, etc).
///
/// (3) During final cef_browser_host_t destruction of the main frame:
/// - cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost
/// their connection to the renderer process. Commands can no longer be routed
/// and will be discarded.
/// - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed.
/// - cef_frame_handler_t::OnFrameDetached => The main frame object have lost
/// its connection to the renderer process. Notifications will be sent for any
/// sub-frame objects before the main frame object. Commands can no longer be
/// routed and will be discarded.
/// - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has
/// been removed from the browser.
///
/// Cross-origin navigation and/or loading receives special handling.
///
/// When the main frame navigates to a different origin the OnMainFrameChanged
/// callback (2) will be executed with the old and new main frame objects.
///
/// When a new sub-frame is loaded in, or an existing sub-frame is navigated to,
/// a different origin from the parent frame, a temporary sub-frame object will
/// first be created in the parent's renderer process. That temporary sub-frame
/// will then be discarded after the real cross-origin sub-frame is created in
/// the new/target renderer process. The client will receive cross-origin
/// navigation callbacks (2) for the transition from the temporary sub-frame to
/// the real sub-frame. The temporary sub-frame will not receive or execute
/// commands during this transitional period (any sent commands will be
/// discarded).
///
/// When a new popup browser is created in a different origin from the parent
/// browser, a temporary main frame object for the popup will first be created
/// in the parent's renderer process. That temporary main frame will then be
/// discarded after the real cross-origin main frame is created in the
/// new/target renderer process. The client will receive creation and initial
/// navigation callbacks (1) for the temporary main frame, followed by cross-
/// origin navigation callbacks (2) for the transition from the temporary main
/// frame to the real main frame. The temporary main frame may receive and
/// execute commands during this transitional period (any sent commands may be
/// executed, but the behavior is potentially undesirable since they execute in
/// the parent browser's renderer process and not the new/target renderer
/// process).
///
/// Callbacks will not be executed for placeholders that may be created during
/// pre-commit navigation for sub-frames that do not yet exist in the renderer
/// process. Placeholders will have cef_frame_t::get_identifier() == -4.
///
/// The functions of this structure will be called on the UI thread unless
/// otherwise indicated.
///
typedef struct _cef_frame_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called when a new frame is created. This will be the first notification
/// that references |frame|. Any commands that require transport to the
/// associated renderer process (LoadRequest, SendProcessMessage, GetSource,
/// etc.) will be queued until OnFrameAttached is called for |frame|.
///
void(CEF_CALLBACK* on_frame_created)(struct _cef_frame_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame);
///
/// Called when a frame can begin routing commands to/from the associated
/// renderer process. |reattached| will be true (1) if the frame was re-
/// attached after exiting the BackForwardCache. Any commands that were queued
/// have now been dispatched.
///
void(CEF_CALLBACK* on_frame_attached)(struct _cef_frame_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
int reattached);
///
/// Called when a frame loses its connection to the renderer process and will
/// be destroyed. Any pending or future commands will be discarded and
/// cef_frame_t::is_valid() will now return false (0) for |frame|. If called
/// after cef_life_span_handler_t::on_before_close() during browser
/// destruction then cef_browser_t::is_valid() will return false (0) for
/// |browser|.
///
void(CEF_CALLBACK* on_frame_detached)(struct _cef_frame_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame);
///
/// Called when the main frame changes due to (a) initial browser creation,
/// (b) final browser destruction, (c) cross-origin navigation or (d) re-
/// navigation after renderer process termination (due to crashes, etc).
/// |old_frame| will be NULL and |new_frame| will be non-NULL when a main
/// frame is assigned to |browser| for the first time. |old_frame| will be
/// non-NULL and |new_frame| will be NULL and when a main frame is removed
/// from |browser| for the last time. Both |old_frame| and |new_frame| will be
/// non-NULL for cross-origin navigations or re-navigation after renderer
/// process termination. This function will be called after on_frame_created()
/// for |new_frame| and/or after on_frame_detached() for |old_frame|. If
/// called after cef_life_span_handler_t::on_before_close() during browser
/// destruction then cef_browser_t::is_valid() will return false (0) for
/// |browser|.
///
void(CEF_CALLBACK* on_main_frame_changed)(struct _cef_frame_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* old_frame,
struct _cef_frame_t* new_frame);
} cef_frame_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_

View File

@@ -0,0 +1,58 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=990e80ab5ae04298e6b70cbc0a67115825563251$
//
#ifndef CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Returns true (1) if the application text direction is right-to-left.
///
CEF_EXPORT int cef_is_rtl(void);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_

View File

@@ -0,0 +1,206 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7512ccf755017d5b1866b753890b498e8163006d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Container for a single image represented at different scale factors. All
/// image representations should be the same size in density independent pixel
/// (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels
/// then the image at scale factor 2.0 should be 200x200 pixels -- both images
/// will display with a DIP size of 100x100 units. The functions of this
/// structure can be called on any browser process thread.
///
typedef struct _cef_image_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns true (1) if this Image is NULL.
///
int(CEF_CALLBACK* is_empty)(struct _cef_image_t* self);
///
/// Returns true (1) if this Image and |that| Image share the same underlying
/// storage. Will also return true (1) if both images are NULL.
///
int(CEF_CALLBACK* is_same)(struct _cef_image_t* self,
struct _cef_image_t* that);
///
/// Add a bitmap image representation for |scale_factor|. Only 32-bit
/// RGBA/BGRA formats are supported. |pixel_width| and |pixel_height| are the
/// bitmap representation size in pixel coordinates. |pixel_data| is the array
/// of pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in
/// size. |color_type| and |alpha_type| values specify the pixel format.
///
int(CEF_CALLBACK* add_bitmap)(struct _cef_image_t* self,
float scale_factor,
int pixel_width,
int pixel_height,
cef_color_type_t color_type,
cef_alpha_type_t alpha_type,
const void* pixel_data,
size_t pixel_data_size);
///
/// Add a PNG image representation for |scale_factor|. |png_data| is the image
/// data of size |png_data_size|. Any alpha transparency in the PNG data will
/// be maintained.
///
int(CEF_CALLBACK* add_png)(struct _cef_image_t* self,
float scale_factor,
const void* png_data,
size_t png_data_size);
///
/// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
/// image data of size |jpeg_data_size|. The JPEG format does not support
/// transparency so the alpha byte will be set to 0xFF for all pixels.
///
int(CEF_CALLBACK* add_jpeg)(struct _cef_image_t* self,
float scale_factor,
const void* jpeg_data,
size_t jpeg_data_size);
///
/// Returns the image width in density independent pixel (DIP) units.
///
size_t(CEF_CALLBACK* get_width)(struct _cef_image_t* self);
///
/// Returns the image height in density independent pixel (DIP) units.
///
size_t(CEF_CALLBACK* get_height)(struct _cef_image_t* self);
///
/// Returns true (1) if this image contains a representation for
/// |scale_factor|.
///
int(CEF_CALLBACK* has_representation)(struct _cef_image_t* self,
float scale_factor);
///
/// Removes the representation for |scale_factor|. Returns true (1) on
/// success.
///
int(CEF_CALLBACK* remove_representation)(struct _cef_image_t* self,
float scale_factor);
///
/// Returns information for the representation that most closely matches
/// |scale_factor|. |actual_scale_factor| is the actual scale factor for the
/// representation. |pixel_width| and |pixel_height| are the representation
/// size in pixel coordinates. Returns true (1) on success.
///
int(CEF_CALLBACK* get_representation_info)(struct _cef_image_t* self,
float scale_factor,
float* actual_scale_factor,
int* pixel_width,
int* pixel_height);
///
/// Returns the bitmap representation that most closely matches
/// |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |color_type|
/// and |alpha_type| values specify the desired output pixel format.
/// |pixel_width| and |pixel_height| are the output representation size in
/// pixel coordinates. Returns a cef_binary_value_t containing the pixel data
/// on success or NULL on failure.
///
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_bitmap)(
struct _cef_image_t* self,
float scale_factor,
cef_color_type_t color_type,
cef_alpha_type_t alpha_type,
int* pixel_width,
int* pixel_height);
///
/// Returns the PNG representation that most closely matches |scale_factor|.
/// If |with_transparency| is true (1) any alpha transparency in the image
/// will be represented in the resulting PNG data. |pixel_width| and
/// |pixel_height| are the output representation size in pixel coordinates.
/// Returns a cef_binary_value_t containing the PNG image data on success or
/// NULL on failure.
///
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_png)(
struct _cef_image_t* self,
float scale_factor,
int with_transparency,
int* pixel_width,
int* pixel_height);
///
/// Returns the JPEG representation that most closely matches |scale_factor|.
/// |quality| determines the compression level with 0 == lowest and 100 ==
/// highest. The JPEG format does not support alpha transparency and the alpha
/// channel, if any, will be discarded. |pixel_width| and |pixel_height| are
/// the output representation size in pixel coordinates. Returns a
/// cef_binary_value_t containing the JPEG image data on success or NULL on
/// failure.
///
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_jpeg)(
struct _cef_image_t* self,
float scale_factor,
int quality,
int* pixel_width,
int* pixel_height);
} cef_image_t;
///
/// Create a new cef_image_t. It will initially be NULL. Use the Add*()
/// functions to add representations at different scale factors.
///
CEF_EXPORT cef_image_t* cef_image_create(void);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_

View File

@@ -0,0 +1,141 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c6810367ba3a17824247dcb17f87040cd021c295$
//
#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Callback structure used for asynchronous continuation of JavaScript dialog
/// requests.
///
typedef struct _cef_jsdialog_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Continue the JS dialog request. Set |success| to true (1) if the OK button
/// was pressed. The |user_input| value should be specified for prompt
/// dialogs.
///
void(CEF_CALLBACK* cont)(struct _cef_jsdialog_callback_t* self,
int success,
const cef_string_t* user_input);
} cef_jsdialog_callback_t;
///
/// Implement this structure to handle events related to JavaScript dialogs. The
/// functions of this structure will be called on the UI thread.
///
typedef struct _cef_jsdialog_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
/// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
/// and user-friendly display string. The |default_prompt_text| value will be
/// specified for prompt dialogs only. Set |suppress_message| to true (1) and
/// return false (0) to suppress the message (suppressing messages is
/// preferable to immediately executing the callback as this is used to detect
/// presumably malicious behavior like spamming alert messages in
/// onbeforeunload). Set |suppress_message| to false (0) and return false (0)
/// to use the default implementation (the default implementation will show
/// one modal dialog at a time and suppress any additional dialog requests
/// until the displayed dialog is dismissed). Return true (1) if the
/// application will use a custom dialog or if the callback has been executed
/// immediately. Custom dialogs may be either modal or modeless. If a custom
/// dialog is used the application must execute |callback| once the custom
/// dialog is dismissed.
///
int(CEF_CALLBACK* on_jsdialog)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* origin_url,
cef_jsdialog_type_t dialog_type,
const cef_string_t* message_text,
const cef_string_t* default_prompt_text,
struct _cef_jsdialog_callback_t* callback,
int* suppress_message);
///
/// Called to run a dialog asking the user if they want to leave a page.
/// Return false (0) to use the default dialog implementation. Return true (1)
/// if the application will use a custom dialog or if the callback has been
/// executed immediately. Custom dialogs may be either modal or modeless. If a
/// custom dialog is used the application must execute |callback| once the
/// custom dialog is dismissed.
///
int(CEF_CALLBACK* on_before_unload_dialog)(
struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* message_text,
int is_reload,
struct _cef_jsdialog_callback_t* callback);
///
/// Called to cancel any pending dialogs and reset any saved dialog state.
/// Will be called due to events like page navigation irregardless of whether
/// any dialogs are currently pending.
///
void(CEF_CALLBACK* on_reset_dialog_state)(
struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser);
///
/// Called when the dialog is closed.
///
void(CEF_CALLBACK* on_dialog_closed)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser);
} cef_jsdialog_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_

View File

@@ -0,0 +1,90 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0bfe161c51cc6378b2e8e2e2b2c017b750b46864$
//
#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to handle events related to keyboard input. The
/// functions of this structure will be called on the UI thread.
///
typedef struct _cef_keyboard_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called before a keyboard event is sent to the renderer. |event| contains
/// information about the keyboard event. |os_event| is the operating system
/// event message, if any. Return true (1) if the event was handled or false
/// (0) otherwise. If the event will be handled in on_key_event() as a
/// keyboard shortcut set |is_keyboard_shortcut| to true (1) and return false
/// (0).
///
int(CEF_CALLBACK* on_pre_key_event)(struct _cef_keyboard_handler_t* self,
struct _cef_browser_t* browser,
const cef_key_event_t* event,
cef_event_handle_t os_event,
int* is_keyboard_shortcut);
///
/// Called after the renderer and JavaScript in the page has had a chance to
/// handle the event. |event| contains information about the keyboard event.
/// |os_event| is the operating system event message, if any. Return true (1)
/// if the keyboard event was handled or false (0) otherwise.
///
int(CEF_CALLBACK* on_key_event)(struct _cef_keyboard_handler_t* self,
struct _cef_browser_t* browser,
const cef_key_event_t* event,
cef_event_handle_t os_event);
} cef_keyboard_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_

View File

@@ -0,0 +1,253 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=54edf9e9c2a12acdc4cab55079a4a5cb8e2a1e43$
//
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_client_t;
///
/// Implement this structure to handle events related to browser life span. The
/// functions of this structure will be called on the UI thread unless otherwise
/// indicated.
///
typedef struct _cef_life_span_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called on the UI thread before a new popup browser is created. The
/// |browser| and |frame| values represent the source of the popup request.
/// The |target_url| and |target_frame_name| values indicate where the popup
/// browser should navigate and may be NULL if not specified with the request.
/// The |target_disposition| value indicates where the user intended to open
/// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
/// be true (1) if the popup was opened via explicit user gesture (e.g.
/// clicking a link) or false (0) if the popup opened automatically (e.g. via
/// the DomContentLoaded event). The |popupFeatures| structure contains
/// additional information about the requested popup window. To allow creation
/// of the popup browser optionally modify |windowInfo|, |client|, |settings|
/// and |no_javascript_access| and return false (0). To cancel creation of the
/// popup browser return true (1). The |client| and |settings| values will
/// default to the source browser's values. If the |no_javascript_access|
/// value is set to false (0) the new browser will not be scriptable and may
/// not be hosted in the same renderer process as the source browser. Any
/// modifications to |windowInfo| will be ignored if the parent browser is
/// wrapped in a cef_browser_view_t. Popup browser creation will be canceled
/// if the parent browser is destroyed before the popup browser creation
/// completes (indicated by a call to OnAfterCreated for the popup browser).
/// The |extra_info| parameter provides an opportunity to specify extra
/// information specific to the created popup browser that will be passed to
/// cef_render_process_handler_t::on_browser_created() in the render process.
///
int(CEF_CALLBACK* on_before_popup)(
struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_string_t* target_url,
const cef_string_t* target_frame_name,
cef_window_open_disposition_t target_disposition,
int user_gesture,
const cef_popup_features_t* popupFeatures,
struct _cef_window_info_t* windowInfo,
struct _cef_client_t** client,
struct _cef_browser_settings_t* settings,
struct _cef_dictionary_value_t** extra_info,
int* no_javascript_access);
///
/// Called on the UI thread before a new DevTools popup browser is created.
/// The |browser| value represents the source of the popup request. Optionally
/// modify |windowInfo|, |client|, |settings| and |extra_info| values. The
/// |client|, |settings| and |extra_info| values will default to the source
/// browser's values. Any modifications to |windowInfo| will be ignored if the
/// parent browser is Views-hosted (wrapped in a cef_browser_view_t).
///
/// The |extra_info| parameter provides an opportunity to specify extra
/// information specific to the created popup browser that will be passed to
/// cef_render_process_handler_t::on_browser_created() in the render process.
/// The existing |extra_info| object, if any, will be read-only but may be
/// replaced with a new object.
///
/// Views-hosted source browsers will create Views-hosted DevTools popups
/// unless |use_default_window| is set to to true (1). DevTools popups can be
/// blocked by returning true (1) from cef_command_handler_t::OnChromeCommand
/// for IDC_DEV_TOOLS. Only used with the Chrome runtime.
///
void(CEF_CALLBACK* on_before_dev_tools_popup)(
struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_window_info_t* windowInfo,
struct _cef_client_t** client,
struct _cef_browser_settings_t* settings,
struct _cef_dictionary_value_t** extra_info,
int* use_default_window);
///
/// Called after a new browser is created. It is now safe to begin performing
/// actions with |browser|. cef_frame_handler_t callbacks related to initial
/// main frame creation will arrive before this callback. See
/// cef_frame_handler_t documentation for additional usage information.
///
void(CEF_CALLBACK* on_after_created)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
///
/// Called when a browser has received a request to close. This may result
/// directly from a call to cef_browser_host_t::*close_browser() or indirectly
/// if the browser is parented to a top-level window created by CEF and the
/// user attempts to close that window (by clicking the 'X', for example). The
/// do_close() function will be called after the JavaScript 'onunload' event
/// has been fired.
///
/// An application should handle top-level owner window close notifications by
/// calling cef_browser_host_t::try_close_browser() or
/// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
/// to close immediately (see the examples below). This gives CEF an
/// opportunity to process the 'onbeforeunload' event and optionally cancel
/// the close before do_close() is called.
///
/// When windowed rendering is enabled CEF will internally create a window or
/// view to host the browser. In that case returning false (0) from do_close()
/// will send the standard close notification to the browser's top-level owner
/// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
/// Linux or cef_window_delegate_t::can_close() callback from Views). If the
/// browser's host window/view has already been destroyed (via view hierarchy
/// tear-down, for example) then do_close() will not be called for that
/// browser since is no longer possible to cancel the close.
///
/// When windowed rendering is disabled returning false (0) from do_close()
/// will cause the browser object to be destroyed immediately.
///
/// If the browser's top-level owner window requires a non-standard close
/// notification then send that notification from do_close() and return true
/// (1).
///
/// The cef_life_span_handler_t::on_before_close() function will be called
/// after do_close() (if do_close() is called) and immediately before the
/// browser object is destroyed. The application should only exit after
/// on_before_close() has been called for all existing browsers.
///
/// The below examples describe what should happen during window close when
/// the browser is parented to an application-provided top-level window.
///
/// Example 1: Using cef_browser_host_t::try_close_browser(). This is
/// recommended for clients using standard close handling and windows created
/// on the browser process UI thread. 1. User clicks the window close button
/// which sends a close notification
/// to the application's top-level window.
/// 2. Application's top-level window receives the close notification and
/// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
/// TryCloseBrowser() returns false so the client cancels the window
/// close.
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
/// confirmation dialog (which can be overridden via
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
/// 6. CEF sends a close notification to the application's top-level window
/// (because DoClose() returned false by default).
/// 7. Application's top-level window receives the close notification and
/// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
/// allows the window close.
/// 8. Application's top-level window is destroyed. 9. Application's
/// on_before_close() handler is called and the browser object
/// is destroyed.
/// 10. Application exits by calling cef_quit_message_loop() if no other
/// browsers
/// exist.
///
/// Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and
/// implementing the do_close() callback. This is recommended for clients
/// using non-standard close handling or windows that were not created on the
/// browser process UI thread. 1. User clicks the window close button which
/// sends a close notification
/// to the application's top-level window.
/// 2. Application's top-level window receives the close notification and:
/// A. Calls CefBrowserHost::CloseBrowser(false).
/// B. Cancels the window close.
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
/// confirmation dialog (which can be overridden via
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
/// 6. Application's do_close() handler is called. Application will:
/// A. Set a flag to indicate that the next close attempt will be allowed.
/// B. Return false.
/// 7. CEF sends an close notification to the application's top-level window.
/// 8. Application's top-level window receives the close notification and
/// allows the window to close based on the flag from #6B.
/// 9. Application's top-level window is destroyed. 10. Application's
/// on_before_close() handler is called and the browser object
/// is destroyed.
/// 11. Application exits by calling cef_quit_message_loop() if no other
/// browsers
/// exist.
///
int(CEF_CALLBACK* do_close)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
///
/// Called just before a browser is destroyed. Release all references to the
/// browser object and do not attempt to execute any functions on the browser
/// object (other than IsValid, GetIdentifier or IsSame) after this callback
/// returns. cef_frame_handler_t callbacks related to final main frame
/// destruction will arrive after this callback and cef_browser_t::IsValid
/// will return false (0) at that time. Any in-progress network requests
/// associated with |browser| will be aborted when the browser is destroyed,
/// and cef_resource_request_handler_t callbacks related to those requests may
/// still arrive on the IO thread after this callback. See cef_frame_handler_t
/// and do_close() documentation for additional usage information.
///
void(CEF_CALLBACK* on_before_close)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
} cef_life_span_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_

View File

@@ -0,0 +1,126 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=eb842e65cd2e7c4a8a6baa2813b57ac0d3977261$
//
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_frame_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Implement this structure to handle events related to browser load status.
/// The functions of this structure will be called on the browser process UI
/// thread or render process main thread (TID_RENDERER).
///
typedef struct _cef_load_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called when the loading state has changed. This callback will be executed
/// twice -- once when loading is initiated either programmatically or by user
/// action, and once when loading is terminated due to completion,
/// cancellation of failure. It will be called before any calls to OnLoadStart
/// and after all calls to OnLoadError and/or OnLoadEnd.
///
void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser,
int isLoading,
int canGoBack,
int canGoForward);
///
/// Called after a navigation has been committed and before the browser begins
/// loading contents in the frame. The |frame| value will never be NULL --
/// call the is_main() function to check if this frame is the main frame.
/// |transition_type| provides information about the source of the navigation
/// and an accurate value is only available in the browser process. Multiple
/// frames may be loading at the same time. Sub-frames may start or continue
/// loading after the main frame load has ended. This function will not be
/// called for same page navigations (fragments, history state, etc.) or for
/// navigations that fail or are canceled before commit. For notification of
/// overall browser load status use OnLoadingStateChange instead.
///
void(CEF_CALLBACK* on_load_start)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
cef_transition_type_t transition_type);
///
/// Called when the browser is done loading a frame. The |frame| value will
/// never be NULL -- call the is_main() function to check if this frame is the
/// main frame. Multiple frames may be loading at the same time. Sub-frames
/// may start or continue loading after the main frame load has ended. This
/// function will not be called for same page navigations (fragments, history
/// state, etc.) or for navigations that fail or are canceled before commit.
/// For notification of overall browser load status use OnLoadingStateChange
/// instead.
///
void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
int httpStatusCode);
///
/// Called when a navigation fails or is canceled. This function may be called
/// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
/// after commit. |errorCode| is the error code number, |errorText| is the
/// error text and |failedUrl| is the URL that failed to load. See
/// net\base\net_error_list.h for complete descriptions of the error codes.
///
void(CEF_CALLBACK* on_load_error)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
cef_errorcode_t errorCode,
const cef_string_t* errorText,
const cef_string_t* failedUrl);
} cef_load_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_

View File

@@ -0,0 +1,108 @@
// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=91101808168ec0faf1f39b1924579e31478a6616$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ACCESS_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_MEDIA_ACCESS_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
// Callback structure used for asynchronous continuation of media access
// permission requests.
///
typedef struct _cef_media_access_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Call to allow or deny media access. If this callback was initiated in
// response to a getUserMedia (indicated by
// CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE and/or
// CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE being set) the
// |allowed_permissions| are required to match those given in
// |required_permissions| in the OnRequestMediaAccessPermission.
///
void(CEF_CALLBACK* cont)(struct _cef_media_access_callback_t* self,
int allowed_permissions);
///
// Cancel the media access request.
///
void(CEF_CALLBACK* cancel)(struct _cef_media_access_callback_t* self);
} cef_media_access_callback_t;
///
// Implement this structure to handle events related to media access permission
// requests. The functions of this structure will be called on the browser
// process UI thread.
///
typedef struct _cef_media_access_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Called when a page requests permission to access media. |requesting_url| is
// the URL requesting permission. Return true (1) and call
// cef_media_access_callback_t::cont() either in this function or at a later
// time to continue or cancel the request. Return false (0) to cancel the
// request immediately.
///
int(CEF_CALLBACK* on_request_media_access_permission)(
struct _cef_media_access_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_string_t* requesting_url,
int32_t requested_permissions,
struct _cef_media_access_callback_t* callback);
} cef_media_access_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_MEDIA_ACCESS_HANDLER_CAPI_H_

View File

@@ -0,0 +1,342 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=8eec1100e8470cbe3ebc54d5962416d2fa4d57fb$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_callback_capi.h"
#include "include/capi/cef_registration_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_media_observer_t;
struct _cef_media_route_create_callback_t;
struct _cef_media_route_t;
struct _cef_media_sink_device_info_callback_t;
struct _cef_media_sink_t;
struct _cef_media_source_t;
///
/// Supports discovery of and communication with media devices on the local
/// network via the Cast and DIAL protocols. The functions of this structure may
/// be called on any browser process thread unless otherwise indicated.
///
typedef struct _cef_media_router_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Add an observer for MediaRouter events. The observer will remain
/// registered until the returned Registration object is destroyed.
///
struct _cef_registration_t*(CEF_CALLBACK* add_observer)(
struct _cef_media_router_t* self,
struct _cef_media_observer_t* observer);
///
/// Returns a MediaSource object for the specified media source URN. Supported
/// URN schemes include "cast:" and "dial:", and will be already known by the
/// client application (e.g. "cast:<appId>?clientId=<clientId>").
///
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
struct _cef_media_router_t* self,
const cef_string_t* urn);
///
/// Trigger an asynchronous call to cef_media_observer_t::OnSinks on all
/// registered observers.
///
void(CEF_CALLBACK* notify_current_sinks)(struct _cef_media_router_t* self);
///
/// Create a new route between |source| and |sink|. Source and sink must be
/// valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and
/// a route between them must not already exist. |callback| will be executed
/// on success or failure. If route creation succeeds it will also trigger an
/// asynchronous call to cef_media_observer_t::OnRoutes on all registered
/// observers.
///
void(CEF_CALLBACK* create_route)(
struct _cef_media_router_t* self,
struct _cef_media_source_t* source,
struct _cef_media_sink_t* sink,
struct _cef_media_route_create_callback_t* callback);
///
/// Trigger an asynchronous call to cef_media_observer_t::OnRoutes on all
/// registered observers.
///
void(CEF_CALLBACK* notify_current_routes)(struct _cef_media_router_t* self);
} cef_media_router_t;
///
/// Returns the MediaRouter object associated with the global request context.
/// If |callback| is non-NULL it will be executed asnychronously on the UI
/// thread after the manager's storage has been initialized. Equivalent to
/// calling cef_request_context_t::cef_request_context_get_global_context()-
/// >get_media_router().
///
CEF_EXPORT cef_media_router_t* cef_media_router_get_global(
struct _cef_completion_callback_t* callback);
///
/// Implemented by the client to observe MediaRouter events and registered via
/// cef_media_router_t::AddObserver. The functions of this structure will be
/// called on the browser process UI thread.
///
typedef struct _cef_media_observer_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// The list of available media sinks has changed or
/// cef_media_router_t::NotifyCurrentSinks was called.
///
void(CEF_CALLBACK* on_sinks)(struct _cef_media_observer_t* self,
size_t sinksCount,
struct _cef_media_sink_t* const* sinks);
///
/// The list of available media routes has changed or
/// cef_media_router_t::NotifyCurrentRoutes was called.
///
void(CEF_CALLBACK* on_routes)(struct _cef_media_observer_t* self,
size_t routesCount,
struct _cef_media_route_t* const* routes);
///
/// The connection state of |route| has changed.
///
void(CEF_CALLBACK* on_route_state_changed)(
struct _cef_media_observer_t* self,
struct _cef_media_route_t* route,
cef_media_route_connection_state_t state);
///
/// A message was received over |route|. |message| is only valid for the scope
/// of this callback and should be copied if necessary.
///
void(CEF_CALLBACK* on_route_message_received)(
struct _cef_media_observer_t* self,
struct _cef_media_route_t* route,
const void* message,
size_t message_size);
} cef_media_observer_t;
///
/// Represents the route between a media source and sink. Instances of this
/// object are created via cef_media_router_t::CreateRoute and retrieved via
/// cef_media_observer_t::OnRoutes. Contains the status and metadata of a
/// routing operation. The functions of this structure may be called on any
/// browser process thread unless otherwise indicated.
///
typedef struct _cef_media_route_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns the ID for this route.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_route_t* self);
///
/// Returns the source associated with this route.
///
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
struct _cef_media_route_t* self);
///
/// Returns the sink associated with this route.
///
struct _cef_media_sink_t*(CEF_CALLBACK* get_sink)(
struct _cef_media_route_t* self);
///
/// Send a message over this route. |message| will be copied if necessary.
///
void(CEF_CALLBACK* send_route_message)(struct _cef_media_route_t* self,
const void* message,
size_t message_size);
///
/// Terminate this route. Will result in an asynchronous call to
/// cef_media_observer_t::OnRoutes on all registered observers.
///
void(CEF_CALLBACK* terminate)(struct _cef_media_route_t* self);
} cef_media_route_t;
///
/// Callback structure for cef_media_router_t::CreateRoute. The functions of
/// this structure will be called on the browser process UI thread.
///
typedef struct _cef_media_route_create_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Method that will be executed when the route creation has finished.
/// |result| will be CEF_MRCR_OK if the route creation succeeded. |error| will
/// be a description of the error if the route creation failed. |route| is the
/// resulting route, or NULL if the route creation failed.
///
void(CEF_CALLBACK* on_media_route_create_finished)(
struct _cef_media_route_create_callback_t* self,
cef_media_route_create_result_t result,
const cef_string_t* error,
struct _cef_media_route_t* route);
} cef_media_route_create_callback_t;
///
/// Represents a sink to which media can be routed. Instances of this object are
/// retrieved via cef_media_observer_t::OnSinks. The functions of this structure
/// may be called on any browser process thread unless otherwise indicated.
///
typedef struct _cef_media_sink_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns the ID for this sink.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_sink_t* self);
///
/// Returns the name of this sink.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_media_sink_t* self);
///
/// Returns the icon type for this sink.
///
cef_media_sink_icon_type_t(CEF_CALLBACK* get_icon_type)(
struct _cef_media_sink_t* self);
///
/// Asynchronously retrieves device info.
///
void(CEF_CALLBACK* get_device_info)(
struct _cef_media_sink_t* self,
struct _cef_media_sink_device_info_callback_t* callback);
///
/// Returns true (1) if this sink accepts content via Cast.
///
int(CEF_CALLBACK* is_cast_sink)(struct _cef_media_sink_t* self);
///
/// Returns true (1) if this sink accepts content via DIAL.
///
int(CEF_CALLBACK* is_dial_sink)(struct _cef_media_sink_t* self);
///
/// Returns true (1) if this sink is compatible with |source|.
///
int(CEF_CALLBACK* is_compatible_with)(struct _cef_media_sink_t* self,
struct _cef_media_source_t* source);
} cef_media_sink_t;
///
/// Callback structure for cef_media_sink_t::GetDeviceInfo. The functions of
/// this structure will be called on the browser process UI thread.
///
typedef struct _cef_media_sink_device_info_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Method that will be executed asyncronously once device information has
/// been retrieved.
///
void(CEF_CALLBACK* on_media_sink_device_info)(
struct _cef_media_sink_device_info_callback_t* self,
const struct _cef_media_sink_device_info_t* device_info);
} cef_media_sink_device_info_callback_t;
///
/// Represents a source from which media can be routed. Instances of this object
/// are retrieved via cef_media_router_t::GetSource. The functions of this
/// structure may be called on any browser process thread unless otherwise
/// indicated.
///
typedef struct _cef_media_source_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns the ID (media source URN or URL) for this source.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_source_t* self);
///
/// Returns true (1) if this source outputs its content via Cast.
///
int(CEF_CALLBACK* is_cast_source)(struct _cef_media_source_t* self);
///
/// Returns true (1) if this source outputs its content via DIAL.
///
int(CEF_CALLBACK* is_dial_source)(struct _cef_media_source_t* self);
} cef_media_source_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_

View File

@@ -0,0 +1,517 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5dae0b1a1271e79a5fd9b2c6e71e7a719a450161$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_menu_model_delegate_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Supports creation and modification of menus. See cef_menu_id_t for the
/// command ids that have default implementations. All user-defined command ids
/// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of
/// this structure can only be accessed on the browser process the UI thread.
///
typedef struct _cef_menu_model_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns true (1) if this menu is a submenu.
///
int(CEF_CALLBACK* is_sub_menu)(struct _cef_menu_model_t* self);
///
/// Clears the menu. Returns true (1) on success.
///
int(CEF_CALLBACK* clear)(struct _cef_menu_model_t* self);
///
/// Returns the number of items in this menu.
///
size_t(CEF_CALLBACK* get_count)(struct _cef_menu_model_t* self);
///
/// Add a separator to the menu. Returns true (1) on success.
///
int(CEF_CALLBACK* add_separator)(struct _cef_menu_model_t* self);
///
/// Add an item to the menu. Returns true (1) on success.
///
int(CEF_CALLBACK* add_item)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* label);
///
/// Add a check item to the menu. Returns true (1) on success.
///
int(CEF_CALLBACK* add_check_item)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* label);
///
/// Add a radio item to the menu. Only a single item with the specified
/// |group_id| can be checked at a time. Returns true (1) on success.
///
int(CEF_CALLBACK* add_radio_item)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* label,
int group_id);
///
/// Add a sub-menu to the menu. The new sub-menu is returned.
///
struct _cef_menu_model_t*(CEF_CALLBACK* add_sub_menu)(
struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* label);
///
/// Insert a separator in the menu at the specified |index|. Returns true (1)
/// on success.
///
int(CEF_CALLBACK* insert_separator_at)(struct _cef_menu_model_t* self,
size_t index);
///
/// Insert an item in the menu at the specified |index|. Returns true (1) on
/// success.
///
int(CEF_CALLBACK* insert_item_at)(struct _cef_menu_model_t* self,
size_t index,
int command_id,
const cef_string_t* label);
///
/// Insert a check item in the menu at the specified |index|. Returns true (1)
/// on success.
///
int(CEF_CALLBACK* insert_check_item_at)(struct _cef_menu_model_t* self,
size_t index,
int command_id,
const cef_string_t* label);
///
/// Insert a radio item in the menu at the specified |index|. Only a single
/// item with the specified |group_id| can be checked at a time. Returns true
/// (1) on success.
///
int(CEF_CALLBACK* insert_radio_item_at)(struct _cef_menu_model_t* self,
size_t index,
int command_id,
const cef_string_t* label,
int group_id);
///
/// Insert a sub-menu in the menu at the specified |index|. The new sub-menu
/// is returned.
///
struct _cef_menu_model_t*(CEF_CALLBACK* insert_sub_menu_at)(
struct _cef_menu_model_t* self,
size_t index,
int command_id,
const cef_string_t* label);
///
/// Removes the item with the specified |command_id|. Returns true (1) on
/// success.
///
int(CEF_CALLBACK* remove)(struct _cef_menu_model_t* self, int command_id);
///
/// Removes the item at the specified |index|. Returns true (1) on success.
///
int(CEF_CALLBACK* remove_at)(struct _cef_menu_model_t* self, size_t index);
///
/// Returns the index associated with the specified |command_id| or -1 if not
/// found due to the command id not existing in the menu.
///
int(CEF_CALLBACK* get_index_of)(struct _cef_menu_model_t* self,
int command_id);
///
/// Returns the command id at the specified |index| or -1 if not found due to
/// invalid range or the index being a separator.
///
int(CEF_CALLBACK* get_command_id_at)(struct _cef_menu_model_t* self,
size_t index);
///
/// Sets the command id at the specified |index|. Returns true (1) on success.
///
int(CEF_CALLBACK* set_command_id_at)(struct _cef_menu_model_t* self,
size_t index,
int command_id);
///
/// Returns the label for the specified |command_id| or NULL if not found.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_label)(struct _cef_menu_model_t* self,
int command_id);
///
/// Returns the label at the specified |index| or NULL if not found due to
/// invalid range or the index being a separator.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(
CEF_CALLBACK* get_label_at)(struct _cef_menu_model_t* self, size_t index);
///
/// Sets the label for the specified |command_id|. Returns true (1) on
/// success.
///
int(CEF_CALLBACK* set_label)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* label);
///
/// Set the label at the specified |index|. Returns true (1) on success.
///
int(CEF_CALLBACK* set_label_at)(struct _cef_menu_model_t* self,
size_t index,
const cef_string_t* label);
///
/// Returns the item type for the specified |command_id|.
///
cef_menu_item_type_t(CEF_CALLBACK* get_type)(struct _cef_menu_model_t* self,
int command_id);
///
/// Returns the item type at the specified |index|.
///
cef_menu_item_type_t(
CEF_CALLBACK* get_type_at)(struct _cef_menu_model_t* self, size_t index);
///
/// Returns the group id for the specified |command_id| or -1 if invalid.
///
int(CEF_CALLBACK* get_group_id)(struct _cef_menu_model_t* self,
int command_id);
///
/// Returns the group id at the specified |index| or -1 if invalid.
///
int(CEF_CALLBACK* get_group_id_at)(struct _cef_menu_model_t* self,
size_t index);
///
/// Sets the group id for the specified |command_id|. Returns true (1) on
/// success.
///
int(CEF_CALLBACK* set_group_id)(struct _cef_menu_model_t* self,
int command_id,
int group_id);
///
/// Sets the group id at the specified |index|. Returns true (1) on success.
///
int(CEF_CALLBACK* set_group_id_at)(struct _cef_menu_model_t* self,
size_t index,
int group_id);
///
/// Returns the submenu for the specified |command_id| or NULL if invalid.
///
struct _cef_menu_model_t*(CEF_CALLBACK* get_sub_menu)(
struct _cef_menu_model_t* self,
int command_id);
///
/// Returns the submenu at the specified |index| or NULL if invalid.
///
struct _cef_menu_model_t*(CEF_CALLBACK* get_sub_menu_at)(
struct _cef_menu_model_t* self,
size_t index);
///
/// Returns true (1) if the specified |command_id| is visible.
///
int(CEF_CALLBACK* is_visible)(struct _cef_menu_model_t* self, int command_id);
///
/// Returns true (1) if the specified |index| is visible.
///
int(CEF_CALLBACK* is_visible_at)(struct _cef_menu_model_t* self,
size_t index);
///
/// Change the visibility of the specified |command_id|. Returns true (1) on
/// success.
///
int(CEF_CALLBACK* set_visible)(struct _cef_menu_model_t* self,
int command_id,
int visible);
///
/// Change the visibility at the specified |index|. Returns true (1) on
/// success.
///
int(CEF_CALLBACK* set_visible_at)(struct _cef_menu_model_t* self,
size_t index,
int visible);
///
/// Returns true (1) if the specified |command_id| is enabled.
///
int(CEF_CALLBACK* is_enabled)(struct _cef_menu_model_t* self, int command_id);
///
/// Returns true (1) if the specified |index| is enabled.
///
int(CEF_CALLBACK* is_enabled_at)(struct _cef_menu_model_t* self,
size_t index);
///
/// Change the enabled status of the specified |command_id|. Returns true (1)
/// on success.
///
int(CEF_CALLBACK* set_enabled)(struct _cef_menu_model_t* self,
int command_id,
int enabled);
///
/// Change the enabled status at the specified |index|. Returns true (1) on
/// success.
///
int(CEF_CALLBACK* set_enabled_at)(struct _cef_menu_model_t* self,
size_t index,
int enabled);
///
/// Returns true (1) if the specified |command_id| is checked. Only applies to
/// check and radio items.
///
int(CEF_CALLBACK* is_checked)(struct _cef_menu_model_t* self, int command_id);
///
/// Returns true (1) if the specified |index| is checked. Only applies to
/// check and radio items.
///
int(CEF_CALLBACK* is_checked_at)(struct _cef_menu_model_t* self,
size_t index);
///
/// Check the specified |command_id|. Only applies to check and radio items.
/// Returns true (1) on success.
///
int(CEF_CALLBACK* set_checked)(struct _cef_menu_model_t* self,
int command_id,
int checked);
///
/// Check the specified |index|. Only applies to check and radio items.
/// Returns true (1) on success.
///
int(CEF_CALLBACK* set_checked_at)(struct _cef_menu_model_t* self,
size_t index,
int checked);
///
/// Returns true (1) if the specified |command_id| has a keyboard accelerator
/// assigned.
///
int(CEF_CALLBACK* has_accelerator)(struct _cef_menu_model_t* self,
int command_id);
///
/// Returns true (1) if the specified |index| has a keyboard accelerator
/// assigned.
///
int(CEF_CALLBACK* has_accelerator_at)(struct _cef_menu_model_t* self,
size_t index);
///
/// Set the keyboard accelerator for the specified |command_id|. |key_code|
/// can be any virtual key or character value. Returns true (1) on success.
///
int(CEF_CALLBACK* set_accelerator)(struct _cef_menu_model_t* self,
int command_id,
int key_code,
int shift_pressed,
int ctrl_pressed,
int alt_pressed);
///
/// Set the keyboard accelerator at the specified |index|. |key_code| can be
/// any virtual key or character value. Returns true (1) on success.
///
int(CEF_CALLBACK* set_accelerator_at)(struct _cef_menu_model_t* self,
size_t index,
int key_code,
int shift_pressed,
int ctrl_pressed,
int alt_pressed);
///
/// Remove the keyboard accelerator for the specified |command_id|. Returns
/// true (1) on success.
///
int(CEF_CALLBACK* remove_accelerator)(struct _cef_menu_model_t* self,
int command_id);
///
/// Remove the keyboard accelerator at the specified |index|. Returns true (1)
/// on success.
///
int(CEF_CALLBACK* remove_accelerator_at)(struct _cef_menu_model_t* self,
size_t index);
///
/// Retrieves the keyboard accelerator for the specified |command_id|. Returns
/// true (1) on success.
///
int(CEF_CALLBACK* get_accelerator)(struct _cef_menu_model_t* self,
int command_id,
int* key_code,
int* shift_pressed,
int* ctrl_pressed,
int* alt_pressed);
///
/// Retrieves the keyboard accelerator for the specified |index|. Returns true
/// (1) on success.
///
int(CEF_CALLBACK* get_accelerator_at)(struct _cef_menu_model_t* self,
size_t index,
int* key_code,
int* shift_pressed,
int* ctrl_pressed,
int* alt_pressed);
///
/// Set the explicit color for |command_id| and |color_type| to |color|.
/// Specify a |color| value of 0 to remove the explicit color. If no explicit
/// color or default color is set for |color_type| then the system color will
/// be used. Returns true (1) on success.
///
int(CEF_CALLBACK* set_color)(struct _cef_menu_model_t* self,
int command_id,
cef_menu_color_type_t color_type,
cef_color_t color);
///
/// Set the explicit color for |command_id| and |index| to |color|. Specify a
/// |color| value of 0 to remove the explicit color. Specify an |index| value
/// of -1 to set the default color for items that do not have an explicit
/// color set. If no explicit color or default color is set for |color_type|
/// then the system color will be used. Returns true (1) on success.
///
int(CEF_CALLBACK* set_color_at)(struct _cef_menu_model_t* self,
int index,
cef_menu_color_type_t color_type,
cef_color_t color);
///
/// Returns in |color| the color that was explicitly set for |command_id| and
/// |color_type|. If a color was not set then 0 will be returned in |color|.
/// Returns true (1) on success.
///
int(CEF_CALLBACK* get_color)(struct _cef_menu_model_t* self,
int command_id,
cef_menu_color_type_t color_type,
cef_color_t* color);
///
/// Returns in |color| the color that was explicitly set for |command_id| and
/// |color_type|. Specify an |index| value of -1 to return the default color
/// in |color|. If a color was not set then 0 will be returned in |color|.
/// Returns true (1) on success.
///
int(CEF_CALLBACK* get_color_at)(struct _cef_menu_model_t* self,
int index,
cef_menu_color_type_t color_type,
cef_color_t* color);
///
/// Sets the font list for the specified |command_id|. If |font_list| is NULL
/// the system font will be used. Returns true (1) on success. The format is
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
/// - STYLES is an optional space-separated list of style names (case-
/// sensitive "Bold" and "Italic" are supported), and
/// - SIZE is an integer font size in pixels with the suffix "px".
///
/// Here are examples of valid font description strings:
/// - "Arial, Helvetica, Bold Italic 14px"
/// - "Arial, 14px"
///
int(CEF_CALLBACK* set_font_list)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* font_list);
///
/// Sets the font list for the specified |index|. Specify an |index| value of
/// - 1 to set the default font. If |font_list| is NULL the system font will
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
/// - STYLES is an optional space-separated list of style names (case-
/// sensitive "Bold" and "Italic" are supported), and
/// - SIZE is an integer font size in pixels with the suffix "px".
///
/// Here are examples of valid font description strings:
/// - "Arial, Helvetica, Bold Italic 14px"
/// - "Arial, 14px"
///
int(CEF_CALLBACK* set_font_list_at)(struct _cef_menu_model_t* self,
int index,
const cef_string_t* font_list);
} cef_menu_model_t;
///
/// Create a new MenuModel with the specified |delegate|.
///
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
struct _cef_menu_model_delegate_t* delegate);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_

View File

@@ -0,0 +1,123 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=01bdeaf96ea01591689b52b0955504644d6614b8$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_menu_model_t;
///
/// Implement this structure to handle menu model events. The functions of this
/// structure will be called on the browser process UI thread unless otherwise
/// indicated.
///
typedef struct _cef_menu_model_delegate_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Perform the action associated with the specified |command_id| and optional
/// |event_flags|.
///
void(CEF_CALLBACK* execute_command)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
int command_id,
cef_event_flags_t event_flags);
///
/// Called when the user moves the mouse outside the menu and over the owning
/// window.
///
void(CEF_CALLBACK* mouse_outside_menu)(
struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
const cef_point_t* screen_point);
///
/// Called on unhandled open submenu keyboard commands. |is_rtl| will be true
/// (1) if the menu is displaying a right-to-left language.
///
void(CEF_CALLBACK* unhandled_open_submenu)(
struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
int is_rtl);
///
/// Called on unhandled close submenu keyboard commands. |is_rtl| will be true
/// (1) if the menu is displaying a right-to-left language.
///
void(CEF_CALLBACK* unhandled_close_submenu)(
struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
int is_rtl);
///
/// The menu is about to show.
///
void(CEF_CALLBACK* menu_will_show)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model);
///
/// The menu has closed.
///
void(CEF_CALLBACK* menu_closed)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model);
///
/// Optionally modify a menu item label. Return true (1) if |label| was
/// modified.
///
int(CEF_CALLBACK* format_label)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
cef_string_t* label);
} cef_menu_model_delegate_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_

View File

@@ -0,0 +1,133 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dbdac05f2ebd8e8a357eacfe5095676a5bd5b1ac$
//
#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_ssl_status_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Structure used to represent an entry in navigation history.
///
typedef struct _cef_navigation_entry_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns true (1) if this object is valid. Do not call any other functions
/// if this function returns false (0).
///
int(CEF_CALLBACK* is_valid)(struct _cef_navigation_entry_t* self);
///
/// Returns the actual URL of the page. For some pages this may be data: URL
/// or similar. Use get_display_url() to return a display-friendly version.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_url)(
struct _cef_navigation_entry_t* self);
///
/// Returns a display-friendly version of the URL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_display_url)(
struct _cef_navigation_entry_t* self);
///
/// Returns the original URL that was entered by the user before any
/// redirects.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_original_url)(
struct _cef_navigation_entry_t* self);
///
/// Returns the title set by the page. This value may be NULL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_title)(
struct _cef_navigation_entry_t* self);
///
/// Returns the transition type which indicates what the user did to move to
/// this page from the previous page.
///
cef_transition_type_t(CEF_CALLBACK* get_transition_type)(
struct _cef_navigation_entry_t* self);
///
/// Returns true (1) if this navigation includes post data.
///
int(CEF_CALLBACK* has_post_data)(struct _cef_navigation_entry_t* self);
///
/// Returns the time for the last known successful navigation completion. A
/// navigation may be completed more than once if the page is reloaded. May be
/// 0 if the navigation has not yet completed.
///
cef_basetime_t(CEF_CALLBACK* get_completion_time)(
struct _cef_navigation_entry_t* self);
///
/// Returns the HTTP status code for the last known successful navigation
/// response. May be 0 if the response has not yet been received or if the
/// navigation has not yet completed.
///
int(CEF_CALLBACK* get_http_status_code)(struct _cef_navigation_entry_t* self);
///
/// Returns the SSL information for this navigation entry.
///
struct _cef_sslstatus_t*(CEF_CALLBACK* get_sslstatus)(
struct _cef_navigation_entry_t* self);
} cef_navigation_entry_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_

View File

@@ -0,0 +1,112 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f146fd9172033e77e90994841df9fa55ff71aa4b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Add an entry to the cross-origin access whitelist.
///
/// The same-origin policy restricts how scripts hosted from different origins
/// (scheme + domain + port) can communicate. By default, scripts can only
/// access resources with the same origin. Scripts hosted on the HTTP and HTTPS
/// schemes (but no other schemes) can use the "Access-Control-Allow-Origin"
/// header to allow cross-origin requests. For example,
/// https://source.example.com can make XMLHttpRequest requests on
/// http://target.example.com if the http://target.example.com request returns
/// an "Access-Control-Allow-Origin: https://source.example.com" response
/// header.
///
/// Scripts in separate frames or iframes and hosted from the same protocol and
/// domain suffix can execute cross-origin JavaScript if both pages set the
/// document.domain value to the same domain suffix. For example,
/// scheme://foo.example.com and scheme://bar.example.com can communicate using
/// JavaScript if both domains set document.domain="example.com".
///
/// This function is used to allow access to origins that would otherwise
/// violate the same-origin policy. Scripts hosted underneath the fully
/// qualified |source_origin| URL (like http://www.example.com) will be allowed
/// access to all resources hosted on the specified |target_protocol| and
/// |target_domain|. If |target_domain| is non-NULL and
/// |allow_target_subdomains| is false (0) only exact domain matches will be
/// allowed. If |target_domain| contains a top- level domain component (like
/// "example.com") and |allow_target_subdomains| is true (1) sub-domain matches
/// will be allowed. If |target_domain| is NULL and |allow_target_subdomains| if
/// true (1) all domains and IP addresses will be allowed.
///
/// This function cannot be used to bypass the restrictions on local or display
/// isolated schemes. See the comments on CefRegisterCustomScheme for more
/// information.
///
/// This function may be called on any thread. Returns false (0) if
/// |source_origin| is invalid or the whitelist cannot be accessed.
///
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
const cef_string_t* source_origin,
const cef_string_t* target_protocol,
const cef_string_t* target_domain,
int allow_target_subdomains);
///
/// Remove an entry from the cross-origin access whitelist. Returns false (0) if
/// |source_origin| is invalid or the whitelist cannot be accessed.
///
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
const cef_string_t* source_origin,
const cef_string_t* target_protocol,
const cef_string_t* target_domain,
int allow_target_subdomains);
///
/// Remove all entries from the cross-origin access whitelist. Returns false (0)
/// if the whitelist cannot be accessed.
///
CEF_EXPORT int cef_clear_cross_origin_whitelist(void);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_

View File

@@ -0,0 +1,184 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=8accded29b97df1549e86e58d8976fe0f800359a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Combines specified |base_url| and |relative_url| into |resolved_url|.
/// Returns false (0) if one of the URLs is NULL or invalid.
///
CEF_EXPORT int cef_resolve_url(const cef_string_t* base_url,
const cef_string_t* relative_url,
cef_string_t* resolved_url);
///
/// Parse the specified |url| into its component parts. Returns false (0) if the
/// URL is NULL or invalid.
///
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
struct _cef_urlparts_t* parts);
///
/// Creates a URL from the specified |parts|, which must contain a non-NULL spec
/// or a non-NULL host and path (at a minimum), but not both. Returns false (0)
/// if |parts| isn't initialized as described.
///
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
cef_string_t* url);
///
/// This is a convenience function for formatting a URL in a concise and human-
/// friendly way to help users make security-related decisions (or in other
/// circumstances when people need to distinguish sites, origins, or otherwise-
/// simplified URLs from each other). Internationalized domain names (IDN) may
/// be presented in Unicode if the conversion is considered safe. The returned
/// value will (a) omit the path for standard schemes, excepting file and
/// filesystem, and (b) omit the port if it is the default for the scheme. Do
/// not use this for URLs which will be parsed or sent to other applications.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t
cef_format_url_for_security_display(const cef_string_t* origin_url);
///
/// Returns the mime type for the specified file extension or an NULL string if
/// unknown.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t
cef_get_mime_type(const cef_string_t* extension);
///
/// Get the extensions associated with the given mime type. This should be
/// passed in lower case. There could be multiple extensions for a given mime
/// type, like "html,htm" for "text/html", or "txt,text,html,..." for "text/*".
/// Any existing elements in the provided vector will not be erased.
///
CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type,
cef_string_list_t extensions);
///
/// Encodes |data| as a base64 string.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data,
size_t data_size);
///
/// Decodes the base64 encoded string |data|. The returned value will be NULL if
/// the decoding fails.
///
CEF_EXPORT struct _cef_binary_value_t* cef_base64decode(
const cef_string_t* data);
///
/// Escapes characters in |text| which are unsuitable for use as a query
/// parameter value. Everything except alphanumerics and -_.!~*'() will be
/// converted to "%XX". If |use_plus| is true (1) spaces will change to "+". The
/// result is basically the same as encodeURIComponent in Javacript.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text,
int use_plus);
///
/// Unescapes |text| and returns the result. Unescaping consists of looking for
/// the exact pattern "%XX" where each X is a hex digit and converting to the
/// character with the numerical value of those digits (e.g. "i%20=%203%3b"
/// unescapes to "i = 3;"). If |convert_to_utf8| is true (1) this function will
/// attempt to interpret the initial decoded result as UTF-8. If the result is
/// convertable into UTF-8 it will be returned as converted. Otherwise the
/// initial decoded result will be returned. The |unescape_rule| parameter
/// supports further customization the decoding process.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t
cef_uridecode(const cef_string_t* text,
int convert_to_utf8,
cef_uri_unescape_rule_t unescape_rule);
///
/// Parses the specified |json_string| and returns a dictionary or list
/// representation. If JSON parsing fails this function returns NULL.
///
CEF_EXPORT struct _cef_value_t* cef_parse_json(
const cef_string_t* json_string,
cef_json_parser_options_t options);
///
/// Parses the specified UTF8-encoded |json| buffer of size |json_size| and
/// returns a dictionary or list representation. If JSON parsing fails this
/// function returns NULL.
///
CEF_EXPORT struct _cef_value_t* cef_parse_json_buffer(
const void* json,
size_t json_size,
cef_json_parser_options_t options);
///
/// Parses the specified |json_string| and returns a dictionary or list
/// representation. If JSON parsing fails this function returns NULL and
/// populates |error_msg_out| with a formatted error message.
///
CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
const cef_string_t* json_string,
cef_json_parser_options_t options,
cef_string_t* error_msg_out);
///
/// Generates a JSON string from the specified root |node| which should be a
/// dictionary or list value. Returns an NULL string on failure. This function
/// requires exclusive access to |node| including any underlying data.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t
cef_write_json(struct _cef_value_t* node, cef_json_writer_options_t options);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_

View File

@@ -0,0 +1,59 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ee0c50b4e1f51fb2286da24bb9244ae74f3b0c6f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Retrieve the path associated with the specified |key|. Returns true (1) on
/// success. Can be called on any thread in the browser process.
///
CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_

View File

@@ -0,0 +1,164 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c9b3913701581cd6a1077fa3a39d197f338a2507$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Callback structure used for asynchronous continuation of media access
/// permission requests.
///
typedef struct _cef_media_access_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Call to allow or deny media access. If this callback was initiated in
/// response to a getUserMedia (indicated by
/// CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE and/or
/// CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE being set) then
/// |allowed_permissions| must match |required_permissions| passed to
/// OnRequestMediaAccessPermission.
///
void(CEF_CALLBACK* cont)(struct _cef_media_access_callback_t* self,
uint32_t allowed_permissions);
///
/// Cancel the media access request.
///
void(CEF_CALLBACK* cancel)(struct _cef_media_access_callback_t* self);
} cef_media_access_callback_t;
///
/// Callback structure used for asynchronous continuation of permission prompts.
///
typedef struct _cef_permission_prompt_callback_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Complete the permissions request with the specified |result|.
///
void(CEF_CALLBACK* cont)(struct _cef_permission_prompt_callback_t* self,
cef_permission_request_result_t result);
} cef_permission_prompt_callback_t;
///
/// Implement this structure to handle events related to permission requests.
/// The functions of this structure will be called on the browser process UI
/// thread.
///
typedef struct _cef_permission_handler_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Called when a page requests permission to access media.
/// |requesting_origin| is the URL origin requesting permission.
/// |requested_permissions| is a combination of values from
/// cef_media_access_permission_types_t that represent the requested
/// permissions. Return true (1) and call cef_media_access_callback_t
/// functions either in this function or at a later time to continue or cancel
/// the request. Return false (0) to proceed with default handling. With the
/// Chrome runtime, default handling will display the permission request UI.
/// With the Alloy runtime, default handling will deny the request. This
/// function will not be called if the "--enable-media-stream" command-line
/// switch is used to grant all permissions.
///
int(CEF_CALLBACK* on_request_media_access_permission)(
struct _cef_permission_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_string_t* requesting_origin,
uint32_t requested_permissions,
struct _cef_media_access_callback_t* callback);
///
/// Called when a page should show a permission prompt. |prompt_id| uniquely
/// identifies the prompt. |requesting_origin| is the URL origin requesting
/// permission. |requested_permissions| is a combination of values from
/// cef_permission_request_types_t that represent the requested permissions.
/// Return true (1) and call cef_permission_prompt_callback_t::Continue either
/// in this function or at a later time to continue or cancel the request.
/// Return false (0) to proceed with default handling. With the Chrome
/// runtime, default handling will display the permission prompt UI. With the
/// Alloy runtime, default handling is CEF_PERMISSION_RESULT_IGNORE.
///
int(CEF_CALLBACK* on_show_permission_prompt)(
struct _cef_permission_handler_t* self,
struct _cef_browser_t* browser,
uint64_t prompt_id,
const cef_string_t* requesting_origin,
uint32_t requested_permissions,
struct _cef_permission_prompt_callback_t* callback);
///
/// Called when a permission prompt handled via OnShowPermissionPrompt is
/// dismissed. |prompt_id| will match the value that was passed to
/// OnShowPermissionPrompt. |result| will be the value passed to
/// cef_permission_prompt_callback_t::Continue or CEF_PERMISSION_RESULT_IGNORE
/// if the dialog was dismissed for other reasons such as navigation, browser
/// closure, etc. This function will not be called if OnShowPermissionPrompt
/// returned false (0) for |prompt_id|.
///
void(CEF_CALLBACK* on_dismiss_permission_prompt)(
struct _cef_permission_handler_t* self,
struct _cef_browser_t* browser,
uint64_t prompt_id,
cef_permission_request_result_t result);
} cef_permission_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_

View File

@@ -0,0 +1,148 @@
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1c0e469a283538945834404bcd5934b9bb9a0756$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Structure that manages custom preference registrations.
///
typedef struct _cef_preference_registrar_t {
///
/// Base structure.
///
cef_base_scoped_t base;
///
/// Register a preference with the specified |name| and |default_value|. To
/// avoid conflicts with built-in preferences the |name| value should contain
/// an application-specific prefix followed by a period (e.g. "myapp.value").
/// The contents of |default_value| will be copied. The data type for the
/// preference will be inferred from |default_value|'s type and cannot be
/// changed after registration. Returns true (1) on success. Returns false (0)
/// if |name| is already registered or if |default_value| has an invalid type.
/// This function must be called from within the scope of the
/// cef_browser_process_handler_t::OnRegisterCustomPreferences callback.
///
int(CEF_CALLBACK* add_preference)(struct _cef_preference_registrar_t* self,
const cef_string_t* name,
struct _cef_value_t* default_value);
} cef_preference_registrar_t;
///
/// Manage access to preferences. Many built-in preferences are registered by
/// Chromium. Custom preferences can be registered in
/// cef_browser_process_handler_t::OnRegisterCustomPreferences.
///
typedef struct _cef_preference_manager_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns true (1) if a preference with the specified |name| exists. This
/// function must be called on the browser process UI thread.
///
int(CEF_CALLBACK* has_preference)(struct _cef_preference_manager_t* self,
const cef_string_t* name);
///
/// Returns the value for the preference with the specified |name|. Returns
/// NULL if the preference does not exist. The returned object contains a copy
/// of the underlying preference value and modifications to the returned
/// object will not modify the underlying preference value. This function must
/// be called on the browser process UI thread.
///
struct _cef_value_t*(CEF_CALLBACK* get_preference)(
struct _cef_preference_manager_t* self,
const cef_string_t* name);
///
/// Returns all preferences as a dictionary. If |include_defaults| is true (1)
/// then preferences currently at their default value will be included. The
/// returned object contains a copy of the underlying preference values and
/// modifications to the returned object will not modify the underlying
/// preference values. This function must be called on the browser process UI
/// thread.
///
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_all_preferences)(
struct _cef_preference_manager_t* self,
int include_defaults);
///
/// Returns true (1) if the preference with the specified |name| can be
/// modified using SetPreference. As one example preferences set via the
/// command-line usually cannot be modified. This function must be called on
/// the browser process UI thread.
///
int(CEF_CALLBACK* can_set_preference)(struct _cef_preference_manager_t* self,
const cef_string_t* name);
///
/// Set the |value| associated with preference |name|. Returns true (1) if the
/// value is set successfully and false (0) otherwise. If |value| is NULL the
/// preference will be restored to its default value. If setting the
/// preference fails then |error| will be populated with a detailed
/// description of the problem. This function must be called on the browser
/// process UI thread.
///
int(CEF_CALLBACK* set_preference)(struct _cef_preference_manager_t* self,
const cef_string_t* name,
struct _cef_value_t* value,
cef_string_t* error);
} cef_preference_manager_t;
///
/// Returns the global preference manager object.
///
CEF_EXPORT cef_preference_manager_t* cef_preference_manager_get_global(void);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_

View File

@@ -0,0 +1,116 @@
// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1f5dd49cfc5aeb4b673c10750de01768f5cd2694$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PREFERENCE_MANAGER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PREFERENCE_MANAGER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// Manage access to preferences.
///
typedef struct _cef_preference_manager_t {
///
/// Base structure.
///
cef_base_ref_counted_t base;
///
/// Returns true (1) if a preference with the specified |name| exists. This
/// function must be called on the browser process UI thread.
///
int(CEF_CALLBACK* has_preference)(struct _cef_preference_manager_t* self,
const cef_string_t* name);
///
/// Returns the value for the preference with the specified |name|. Returns
/// NULL if the preference does not exist. The returned object contains a copy
/// of the underlying preference value and modifications to the returned
/// object will not modify the underlying preference value. This function must
/// be called on the browser process UI thread.
///
struct _cef_value_t*(CEF_CALLBACK* get_preference)(
struct _cef_preference_manager_t* self,
const cef_string_t* name);
///
/// Returns all preferences as a dictionary. If |include_defaults| is true (1)
/// then preferences currently at their default value will be included. The
/// returned object contains a copy of the underlying preference values and
/// modifications to the returned object will not modify the underlying
/// preference values. This function must be called on the browser process UI
/// thread.
///
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_all_preferences)(
struct _cef_preference_manager_t* self,
int include_defaults);
///
/// Returns true (1) if the preference with the specified |name| can be
/// modified using SetPreference. As one example preferences set via the
/// command-line usually cannot be modified. This function must be called on
/// the browser process UI thread.
///
int(CEF_CALLBACK* can_set_preference)(struct _cef_preference_manager_t* self,
const cef_string_t* name);
///
/// Set the |value| associated with preference |name|. Returns true (1) if the
/// value is set successfully and false (0) otherwise. If |value| is NULL the
/// preference will be restored to its default value. If setting the
/// preference fails then |error| will be populated with a detailed
/// description of the problem. This function must be called on the browser
/// process UI thread.
///
int(CEF_CALLBACK* set_preference)(struct _cef_preference_manager_t* self,
const cef_string_t* name,
struct _cef_value_t* value,
cef_string_t* error);
} cef_preference_manager_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_PREFERENCE_MANAGER_CAPI_H_

Some files were not shown because too many files have changed in this diff Show More