mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
41 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ffd843c47c | ||
|
d7afec5dbd | ||
|
48e5f3d239 | ||
|
1b7ab74bcf | ||
|
49678210ec | ||
|
f7effc7aab | ||
|
3f66e81a78 | ||
|
b34508375a | ||
|
e8462d6b01 | ||
|
ab288d40f1 | ||
|
d0e0aaa382 | ||
|
71c8a797f3 | ||
|
7fd1fdae9e | ||
|
2d6e4cf9c6 | ||
|
a9b41ef611 | ||
|
4366a9b7b2 | ||
|
21e54ba6cc | ||
|
b53a2b0fcb | ||
|
7190ce8f68 | ||
|
709fd2b485 | ||
|
175be9a74b | ||
|
6881f83630 | ||
|
c956572b48 | ||
|
01ce16f127 | ||
|
7fe3d037c4 | ||
|
4e029f4dc2 | ||
|
bf6e3f5e98 | ||
|
2be7dee3fa | ||
|
bd987e54f0 | ||
|
356a488133 | ||
|
c31696628a | ||
|
b2968a0a5e | ||
|
be607a0ec9 | ||
|
4e7013cbfe | ||
|
d3b835eb2b | ||
|
4bb6c87876 | ||
|
adda1d223c | ||
|
7e034c9d6b | ||
|
02029b3689 | ||
|
c83b6a1bff | ||
|
743d0419f0 |
@@ -29,3 +29,4 @@ Felix Bruns <felixbruns@spotify.com>
|
|||||||
YuTeh Shen <shenyute@gmail.com>
|
YuTeh Shen <shenyute@gmail.com>
|
||||||
Andrei Kurushin <ajax16384@gmail.com>
|
Andrei Kurushin <ajax16384@gmail.com>
|
||||||
Gonzo Berman <gberman@factset.com>
|
Gonzo Berman <gberman@factset.com>
|
||||||
|
Jakub Trzebiatowski <kuba.trzebiatowski@gmail.com>
|
||||||
|
19
BUILD.gn
19
BUILD.gn
@@ -148,6 +148,12 @@ if (is_clang) {
|
|||||||
# https://bitbucket.org/chromiumembedded/cef/issues/1617
|
# https://bitbucket.org/chromiumembedded/cef/issues/1617
|
||||||
assert(!is_component_build)
|
assert(!is_component_build)
|
||||||
|
|
||||||
|
if (is_mac) {
|
||||||
|
# Always generate dSYM files. The make_distrib script will fail if
|
||||||
|
# enable_dsyms=true is not explicitly set when is_official_build=false.
|
||||||
|
assert(enable_dsyms)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Local variables.
|
# Local variables.
|
||||||
@@ -233,8 +239,6 @@ static_library("libcef_static") {
|
|||||||
"libcef/browser/chrome_profile_manager_stub.h",
|
"libcef/browser/chrome_profile_manager_stub.h",
|
||||||
"libcef/browser/chrome_profile_stub.cc",
|
"libcef/browser/chrome_profile_stub.cc",
|
||||||
"libcef/browser/chrome_profile_stub.h",
|
"libcef/browser/chrome_profile_stub.h",
|
||||||
"libcef/browser/component_updater/cef_component_updater_configurator.cc",
|
|
||||||
"libcef/browser/component_updater/cef_component_updater_configurator.h",
|
|
||||||
"libcef/browser/content_browser_client.cc",
|
"libcef/browser/content_browser_client.cc",
|
||||||
"libcef/browser/content_browser_client.h",
|
"libcef/browser/content_browser_client.h",
|
||||||
"libcef/browser/context.cc",
|
"libcef/browser/context.cc",
|
||||||
@@ -380,12 +384,12 @@ static_library("libcef_static") {
|
|||||||
"libcef/browser/scheme_impl.cc",
|
"libcef/browser/scheme_impl.cc",
|
||||||
"libcef/browser/speech_recognition_manager_delegate.cc",
|
"libcef/browser/speech_recognition_manager_delegate.cc",
|
||||||
"libcef/browser/speech_recognition_manager_delegate.h",
|
"libcef/browser/speech_recognition_manager_delegate.h",
|
||||||
"libcef/browser/ssl_cert_principal_impl.cc",
|
|
||||||
"libcef/browser/ssl_cert_principal_impl.h",
|
|
||||||
"libcef/browser/ssl_host_state_delegate.cc",
|
"libcef/browser/ssl_host_state_delegate.cc",
|
||||||
"libcef/browser/ssl_host_state_delegate.h",
|
"libcef/browser/ssl_host_state_delegate.h",
|
||||||
"libcef/browser/ssl_info_impl.cc",
|
"libcef/browser/ssl_info_impl.cc",
|
||||||
"libcef/browser/ssl_info_impl.h",
|
"libcef/browser/ssl_info_impl.h",
|
||||||
|
"libcef/browser/ssl_status_impl.cc",
|
||||||
|
"libcef/browser/ssl_status_impl.h",
|
||||||
"libcef/browser/storage_partition_proxy.cc",
|
"libcef/browser/storage_partition_proxy.cc",
|
||||||
"libcef/browser/storage_partition_proxy.h",
|
"libcef/browser/storage_partition_proxy.h",
|
||||||
"libcef/browser/stream_impl.cc",
|
"libcef/browser/stream_impl.cc",
|
||||||
@@ -396,6 +400,10 @@ static_library("libcef_static") {
|
|||||||
"libcef/browser/thread_util.h",
|
"libcef/browser/thread_util.h",
|
||||||
"libcef/browser/web_plugin_impl.cc",
|
"libcef/browser/web_plugin_impl.cc",
|
||||||
"libcef/browser/web_plugin_impl.h",
|
"libcef/browser/web_plugin_impl.h",
|
||||||
|
"libcef/browser/x509_certificate_impl.cc",
|
||||||
|
"libcef/browser/x509_certificate_impl.h",
|
||||||
|
"libcef/browser/x509_cert_principal_impl.cc",
|
||||||
|
"libcef/browser/x509_cert_principal_impl.h",
|
||||||
"libcef/browser/xml_reader_impl.cc",
|
"libcef/browser/xml_reader_impl.cc",
|
||||||
"libcef/browser/xml_reader_impl.h",
|
"libcef/browser/xml_reader_impl.h",
|
||||||
"libcef/browser/zip_reader_impl.cc",
|
"libcef/browser/zip_reader_impl.cc",
|
||||||
@@ -464,6 +472,8 @@ static_library("libcef_static") {
|
|||||||
"libcef/common/value_base.h",
|
"libcef/common/value_base.h",
|
||||||
"libcef/common/values_impl.cc",
|
"libcef/common/values_impl.cc",
|
||||||
"libcef/common/values_impl.h",
|
"libcef/common/values_impl.h",
|
||||||
|
"libcef/common/widevine_loader.cc",
|
||||||
|
"libcef/common/widevine_loader.h",
|
||||||
"libcef/renderer/browser_impl.cc",
|
"libcef/renderer/browser_impl.cc",
|
||||||
"libcef/renderer/browser_impl.h",
|
"libcef/renderer/browser_impl.h",
|
||||||
"libcef/renderer/content_renderer_client.cc",
|
"libcef/renderer/content_renderer_client.cc",
|
||||||
@@ -560,7 +570,6 @@ static_library("libcef_static") {
|
|||||||
"//chrome/common",
|
"//chrome/common",
|
||||||
"//chrome/renderer",
|
"//chrome/renderer",
|
||||||
"//components/cdm/renderer",
|
"//components/cdm/renderer",
|
||||||
"//components/component_updater",
|
|
||||||
"//components/content_settings/core/browser",
|
"//components/content_settings/core/browser",
|
||||||
"//components/content_settings/core/common",
|
"//components/content_settings/core/common",
|
||||||
"//components/crash/content/app:app_breakpad_mac_win_to_be_deleted",
|
"//components/crash/content/app:app_breakpad_mac_win_to_be_deleted",
|
||||||
|
@@ -7,5 +7,5 @@
|
|||||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||||
|
|
||||||
{
|
{
|
||||||
'chromium_checkout': '1ae106dbab4bddd85132d5b75c670794311f4c57',
|
'chromium_checkout': 'refs/tags/54.0.2840.99',
|
||||||
}
|
}
|
||||||
|
@@ -61,6 +61,7 @@
|
|||||||
'include/cef_response_filter.h',
|
'include/cef_response_filter.h',
|
||||||
'include/cef_scheme.h',
|
'include/cef_scheme.h',
|
||||||
'include/cef_ssl_info.h',
|
'include/cef_ssl_info.h',
|
||||||
|
'include/cef_ssl_status.h',
|
||||||
'include/cef_stream.h',
|
'include/cef_stream.h',
|
||||||
'include/cef_string_visitor.h',
|
'include/cef_string_visitor.h',
|
||||||
'include/cef_task.h',
|
'include/cef_task.h',
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
'include/cef_v8.h',
|
'include/cef_v8.h',
|
||||||
'include/cef_values.h',
|
'include/cef_values.h',
|
||||||
'include/cef_web_plugin.h',
|
'include/cef_web_plugin.h',
|
||||||
|
'include/cef_x509_certificate.h',
|
||||||
'include/cef_xml_reader.h',
|
'include/cef_xml_reader.h',
|
||||||
'include/cef_zip_reader.h',
|
'include/cef_zip_reader.h',
|
||||||
'include/test/cef_translator_test.h',
|
'include/test/cef_translator_test.h',
|
||||||
@@ -143,6 +145,7 @@
|
|||||||
'include/capi/cef_response_filter_capi.h',
|
'include/capi/cef_response_filter_capi.h',
|
||||||
'include/capi/cef_scheme_capi.h',
|
'include/capi/cef_scheme_capi.h',
|
||||||
'include/capi/cef_ssl_info_capi.h',
|
'include/capi/cef_ssl_info_capi.h',
|
||||||
|
'include/capi/cef_ssl_status_capi.h',
|
||||||
'include/capi/cef_stream_capi.h',
|
'include/capi/cef_stream_capi.h',
|
||||||
'include/capi/cef_string_visitor_capi.h',
|
'include/capi/cef_string_visitor_capi.h',
|
||||||
'include/capi/cef_task_capi.h',
|
'include/capi/cef_task_capi.h',
|
||||||
@@ -151,6 +154,7 @@
|
|||||||
'include/capi/cef_v8_capi.h',
|
'include/capi/cef_v8_capi.h',
|
||||||
'include/capi/cef_values_capi.h',
|
'include/capi/cef_values_capi.h',
|
||||||
'include/capi/cef_web_plugin_capi.h',
|
'include/capi/cef_web_plugin_capi.h',
|
||||||
|
'include/capi/cef_x509_certificate_capi.h',
|
||||||
'include/capi/cef_xml_reader_capi.h',
|
'include/capi/cef_xml_reader_capi.h',
|
||||||
'include/capi/cef_zip_reader_capi.h',
|
'include/capi/cef_zip_reader_capi.h',
|
||||||
'include/capi/test/cef_translator_test_capi.h',
|
'include/capi/test/cef_translator_test_capi.h',
|
||||||
@@ -314,6 +318,8 @@
|
|||||||
'libcef_dll/cpptoc/process_message_cpptoc.h',
|
'libcef_dll/cpptoc/process_message_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/read_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/read_handler_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/read_handler_ctocpp.h',
|
'libcef_dll/ctocpp/read_handler_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/register_cdm_callback_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/render_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/render_handler_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/render_handler_ctocpp.h',
|
'libcef_dll/ctocpp/render_handler_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/render_process_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/render_process_handler_ctocpp.cc',
|
||||||
@@ -344,16 +350,18 @@
|
|||||||
'libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h',
|
'libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h',
|
'libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/sslcert_principal_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/sslcert_principal_cpptoc.h',
|
|
||||||
'libcef_dll/cpptoc/sslinfo_cpptoc.cc',
|
'libcef_dll/cpptoc/sslinfo_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/sslinfo_cpptoc.h',
|
'libcef_dll/cpptoc/sslinfo_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/sslstatus_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/sslstatus_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc',
|
'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h',
|
'libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/scheme_registrar_cpptoc.cc',
|
'libcef_dll/cpptoc/scheme_registrar_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/scheme_registrar_cpptoc.h',
|
'libcef_dll/cpptoc/scheme_registrar_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/views/scroll_view_cpptoc.cc',
|
'libcef_dll/cpptoc/views/scroll_view_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/views/scroll_view_cpptoc.h',
|
'libcef_dll/cpptoc/views/scroll_view_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.h',
|
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
|
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
|
||||||
@@ -394,6 +402,8 @@
|
|||||||
'libcef_dll/cpptoc/v8exception_cpptoc.h',
|
'libcef_dll/cpptoc/v8exception_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/v8handler_ctocpp.cc',
|
'libcef_dll/ctocpp/v8handler_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/v8handler_ctocpp.h',
|
'libcef_dll/ctocpp/v8handler_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/v8interceptor_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/v8interceptor_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/v8stack_frame_cpptoc.cc',
|
'libcef_dll/cpptoc/v8stack_frame_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/v8stack_frame_cpptoc.h',
|
'libcef_dll/cpptoc/v8stack_frame_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/v8stack_trace_cpptoc.cc',
|
'libcef_dll/cpptoc/v8stack_trace_cpptoc.cc',
|
||||||
@@ -418,6 +428,10 @@
|
|||||||
'libcef_dll/ctocpp/views/window_delegate_ctocpp.h',
|
'libcef_dll/ctocpp/views/window_delegate_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/write_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/write_handler_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/write_handler_ctocpp.h',
|
'libcef_dll/ctocpp/write_handler_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/x509cert_principal_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/x509cert_principal_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/x509certificate_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/x509certificate_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/xml_reader_cpptoc.cc',
|
'libcef_dll/cpptoc/xml_reader_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/xml_reader_cpptoc.h',
|
'libcef_dll/cpptoc/xml_reader_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/zip_reader_cpptoc.cc',
|
'libcef_dll/cpptoc/zip_reader_cpptoc.cc',
|
||||||
@@ -562,6 +576,8 @@
|
|||||||
'libcef_dll/ctocpp/process_message_ctocpp.h',
|
'libcef_dll/ctocpp/process_message_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/read_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/read_handler_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/read_handler_cpptoc.h',
|
'libcef_dll/cpptoc/read_handler_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/register_cdm_callback_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/render_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/render_handler_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/render_handler_cpptoc.h',
|
'libcef_dll/cpptoc/render_handler_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/render_process_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/render_process_handler_cpptoc.cc',
|
||||||
@@ -592,16 +608,18 @@
|
|||||||
'libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h',
|
'libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h',
|
'libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/sslcert_principal_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/sslcert_principal_ctocpp.h',
|
|
||||||
'libcef_dll/ctocpp/sslinfo_ctocpp.cc',
|
'libcef_dll/ctocpp/sslinfo_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/sslinfo_ctocpp.h',
|
'libcef_dll/ctocpp/sslinfo_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/sslstatus_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/sslstatus_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc',
|
'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h',
|
'libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/scheme_registrar_ctocpp.cc',
|
'libcef_dll/ctocpp/scheme_registrar_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/scheme_registrar_ctocpp.h',
|
'libcef_dll/ctocpp/scheme_registrar_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/views/scroll_view_ctocpp.cc',
|
'libcef_dll/ctocpp/views/scroll_view_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/views/scroll_view_ctocpp.h',
|
'libcef_dll/ctocpp/views/scroll_view_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.h',
|
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/stream_reader_ctocpp.cc',
|
'libcef_dll/ctocpp/stream_reader_ctocpp.cc',
|
||||||
@@ -642,6 +660,8 @@
|
|||||||
'libcef_dll/ctocpp/v8exception_ctocpp.h',
|
'libcef_dll/ctocpp/v8exception_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/v8handler_cpptoc.cc',
|
'libcef_dll/cpptoc/v8handler_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/v8handler_cpptoc.h',
|
'libcef_dll/cpptoc/v8handler_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/v8interceptor_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/v8interceptor_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/v8stack_frame_ctocpp.cc',
|
'libcef_dll/ctocpp/v8stack_frame_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/v8stack_frame_ctocpp.h',
|
'libcef_dll/ctocpp/v8stack_frame_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/v8stack_trace_ctocpp.cc',
|
'libcef_dll/ctocpp/v8stack_trace_ctocpp.cc',
|
||||||
@@ -666,6 +686,10 @@
|
|||||||
'libcef_dll/cpptoc/views/window_delegate_cpptoc.h',
|
'libcef_dll/cpptoc/views/window_delegate_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/write_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/write_handler_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/write_handler_cpptoc.h',
|
'libcef_dll/cpptoc/write_handler_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/x509cert_principal_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/x509cert_principal_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/x509certificate_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/x509certificate_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/xml_reader_ctocpp.cc',
|
'libcef_dll/ctocpp/xml_reader_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/xml_reader_ctocpp.h',
|
'libcef_dll/ctocpp/xml_reader_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/zip_reader_ctocpp.cc',
|
'libcef_dll/ctocpp/zip_reader_ctocpp.cc',
|
||||||
|
@@ -81,6 +81,7 @@
|
|||||||
],
|
],
|
||||||
'includes_linux': [
|
'includes_linux': [
|
||||||
'include/base/internal/cef_atomicops_atomicword_compat.h',
|
'include/base/internal/cef_atomicops_atomicword_compat.h',
|
||||||
|
'include/base/internal/cef_atomicops_arm_gcc.h',
|
||||||
'include/base/internal/cef_atomicops_x86_gcc.h',
|
'include/base/internal/cef_atomicops_x86_gcc.h',
|
||||||
'include/internal/cef_linux.h',
|
'include/internal/cef_linux.h',
|
||||||
'include/internal/cef_types_linux.h',
|
'include/internal/cef_types_linux.h',
|
||||||
@@ -149,6 +150,8 @@
|
|||||||
'tests/cefclient/browser/client_types.h',
|
'tests/cefclient/browser/client_types.h',
|
||||||
'tests/cefclient/browser/dialog_test.cc',
|
'tests/cefclient/browser/dialog_test.cc',
|
||||||
'tests/cefclient/browser/dialog_test.h',
|
'tests/cefclient/browser/dialog_test.h',
|
||||||
|
'tests/cefclient/browser/drm_test.cc',
|
||||||
|
'tests/cefclient/browser/drm_test.h',
|
||||||
'tests/cefclient/browser/geometry_util.cc',
|
'tests/cefclient/browser/geometry_util.cc',
|
||||||
'tests/cefclient/browser/geometry_util.h',
|
'tests/cefclient/browser/geometry_util.h',
|
||||||
'tests/cefclient/browser/main_context.cc',
|
'tests/cefclient/browser/main_context.cc',
|
||||||
@@ -214,6 +217,7 @@
|
|||||||
'tests/cefclient/resources/binding.html',
|
'tests/cefclient/resources/binding.html',
|
||||||
'tests/cefclient/resources/dialogs.html',
|
'tests/cefclient/resources/dialogs.html',
|
||||||
'tests/cefclient/resources/draggable.html',
|
'tests/cefclient/resources/draggable.html',
|
||||||
|
'tests/cefclient/resources/drm.html',
|
||||||
'tests/cefclient/resources/localstorage.html',
|
'tests/cefclient/resources/localstorage.html',
|
||||||
'tests/cefclient/resources/logo.png',
|
'tests/cefclient/resources/logo.png',
|
||||||
'tests/cefclient/resources/menu_icon.1x.png',
|
'tests/cefclient/resources/menu_icon.1x.png',
|
||||||
|
@@ -185,26 +185,20 @@ endif(OS_LINUX)
|
|||||||
|
|
||||||
if(OS_MACOSX)
|
if(OS_MACOSX)
|
||||||
|
|
||||||
# Fix the framework link in the helper executable.
|
# Fix the framework rpath in the helper executable.
|
||||||
macro(FIX_MACOSX_HELPER_FRAMEWORK_LINK target app_path)
|
macro(FIX_MACOSX_HELPER_FRAMEWORK_RPATH target)
|
||||||
add_custom_command(TARGET ${target}
|
# The helper is in $app_name.app/Contents/Frameworks/$app_name Helper.app/Contents/MacOS/
|
||||||
POST_BUILD
|
# so set rpath up to Contents/ so that the loader can find Frameworks/.
|
||||||
COMMAND install_name_tool -change "@executable_path/Chromium Embedded Framework"
|
set_target_properties(${target} PROPERTIES INSTALL_RPATH "@executable_path/../../../..")
|
||||||
"@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework"
|
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
||||||
"${app_path}/Contents/MacOS/${target}"
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# Fix the framework link in the main executable.
|
# Fix the framework rpath in the main executable.
|
||||||
macro(FIX_MACOSX_MAIN_FRAMEWORK_LINK target app_path)
|
macro(FIX_MACOSX_MAIN_FRAMEWORK_RPATH target)
|
||||||
add_custom_command(TARGET ${target}
|
# The main app is at $app_name.app/Contents/MacOS/$app_name
|
||||||
POST_BUILD
|
# so set rpath up to Contents/ so that the loader can find Frameworks/.
|
||||||
COMMAND install_name_tool -change "@executable_path/Chromium Embedded Framework"
|
set_target_properties(${target} PROPERTIES INSTALL_RPATH "@executable_path/..")
|
||||||
"@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework"
|
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
||||||
"${app_path}/Contents/MacOS/${target}"
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# Manually process and copy over resource files.
|
# Manually process and copy over resource files.
|
||||||
|
@@ -370,7 +370,8 @@ if(OS_WINDOWS)
|
|||||||
/DEBUG # Generate debug information
|
/DEBUG # Generate debug information
|
||||||
)
|
)
|
||||||
list(APPEND CEF_EXE_LINKER_FLAGS
|
list(APPEND CEF_EXE_LINKER_FLAGS
|
||||||
/MANIFEST:NO # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
|
/MANIFEST:NO # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
|
||||||
|
/LARGEADDRESSAWARE # Allow 32-bit processes to access 3GB of RAM
|
||||||
)
|
)
|
||||||
list(APPEND CEF_COMPILER_DEFINES
|
list(APPEND CEF_COMPILER_DEFINES
|
||||||
WIN32 _WIN32 _WINDOWS # Windows platform
|
WIN32 _WIN32 _WINDOWS # Windows platform
|
||||||
|
@@ -183,6 +183,8 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
|
|||||||
#include "include/base/internal/cef_atomicops_mac.h"
|
#include "include/base/internal/cef_atomicops_mac.h"
|
||||||
#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
|
#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
|
||||||
#include "include/base/internal/cef_atomicops_x86_gcc.h"
|
#include "include/base/internal/cef_atomicops_x86_gcc.h"
|
||||||
|
#elif defined(COMPILER_GCC) && defined(__ARM_ARCH)
|
||||||
|
#include "include/base/internal/cef_atomicops_arm_gcc.h"
|
||||||
#else
|
#else
|
||||||
#error "Atomic operations are not supported on your platform"
|
#error "Atomic operations are not supported on your platform"
|
||||||
#endif
|
#endif
|
||||||
|
320
include/base/internal/cef_atomicops_arm_gcc.h
Normal file
320
include/base/internal/cef_atomicops_arm_gcc.h
Normal file
@@ -0,0 +1,320 @@
|
|||||||
|
// 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/cef_atomicops.h
|
||||||
|
// instead.
|
||||||
|
//
|
||||||
|
// LinuxKernelCmpxchg and Barrier_AtomicIncrement are from Google Gears.
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ARM_GCC_H_
|
||||||
|
#define CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ARM_GCC_H_
|
||||||
|
|
||||||
|
#if defined(OS_QNX)
|
||||||
|
#include <sys/cpuinline.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
namespace subtle {
|
||||||
|
|
||||||
|
// Memory barriers on ARM are funky, but the kernel is here to help:
|
||||||
|
//
|
||||||
|
// * ARMv5 didn't support SMP, there is no memory barrier instruction at
|
||||||
|
// all on this architecture, or when targeting its machine code.
|
||||||
|
//
|
||||||
|
// * Some ARMv6 CPUs support SMP. A full memory barrier can be produced by
|
||||||
|
// writing a random value to a very specific coprocessor register.
|
||||||
|
//
|
||||||
|
// * On ARMv7, the "dmb" instruction is used to perform a full memory
|
||||||
|
// barrier (though writing to the co-processor will still work).
|
||||||
|
// However, on single core devices (e.g. Nexus One, or Nexus S),
|
||||||
|
// this instruction will take up to 200 ns, which is huge, even though
|
||||||
|
// it's completely un-needed on these devices.
|
||||||
|
//
|
||||||
|
// * There is no easy way to determine at runtime if the device is
|
||||||
|
// single or multi-core. However, the kernel provides a useful helper
|
||||||
|
// function at a fixed memory address (0xffff0fa0), which will always
|
||||||
|
// perform a memory barrier in the most efficient way. I.e. on single
|
||||||
|
// core devices, this is an empty function that exits immediately.
|
||||||
|
// On multi-core devices, it implements a full memory barrier.
|
||||||
|
//
|
||||||
|
// * This source could be compiled to ARMv5 machine code that runs on a
|
||||||
|
// multi-core ARMv6 or ARMv7 device. In this case, memory barriers
|
||||||
|
// are needed for correct execution. Always call the kernel helper, even
|
||||||
|
// when targeting ARMv5TE.
|
||||||
|
//
|
||||||
|
|
||||||
|
inline void MemoryBarrier() {
|
||||||
|
#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||||
|
// Note: This is a function call, which is also an implicit compiler barrier.
|
||||||
|
typedef void (*KernelMemoryBarrierFunc)();
|
||||||
|
((KernelMemoryBarrierFunc)0xffff0fa0)();
|
||||||
|
#elif defined(OS_QNX)
|
||||||
|
__cpu_membarrier();
|
||||||
|
#else
|
||||||
|
#error MemoryBarrier() is not implemented on this platform.
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// An ARM toolchain would only define one of these depending on which
|
||||||
|
// variant of the target architecture is being used. This tests against
|
||||||
|
// any known ARMv6 or ARMv7 variant, where it is possible to directly
|
||||||
|
// use ldrex/strex instructions to implement fast atomic operations.
|
||||||
|
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
|
||||||
|
defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || \
|
||||||
|
defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
|
||||||
|
defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
|
||||||
|
defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__)
|
||||||
|
|
||||||
|
inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
|
||||||
|
Atomic32 old_value,
|
||||||
|
Atomic32 new_value) {
|
||||||
|
Atomic32 prev_value;
|
||||||
|
int reloop;
|
||||||
|
do {
|
||||||
|
// The following is equivalent to:
|
||||||
|
//
|
||||||
|
// prev_value = LDREX(ptr)
|
||||||
|
// reloop = 0
|
||||||
|
// if (prev_value != old_value)
|
||||||
|
// reloop = STREX(ptr, new_value)
|
||||||
|
__asm__ __volatile__(" ldrex %0, [%3]\n"
|
||||||
|
" mov %1, #0\n"
|
||||||
|
" cmp %0, %4\n"
|
||||||
|
#ifdef __thumb2__
|
||||||
|
" it eq\n"
|
||||||
|
#endif
|
||||||
|
" strexeq %1, %5, [%3]\n"
|
||||||
|
: "=&r"(prev_value), "=&r"(reloop), "+m"(*ptr)
|
||||||
|
: "r"(ptr), "r"(old_value), "r"(new_value)
|
||||||
|
: "cc", "memory");
|
||||||
|
} while (reloop != 0);
|
||||||
|
return prev_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
|
||||||
|
Atomic32 old_value,
|
||||||
|
Atomic32 new_value) {
|
||||||
|
Atomic32 result = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
|
||||||
|
MemoryBarrier();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
|
||||||
|
Atomic32 old_value,
|
||||||
|
Atomic32 new_value) {
|
||||||
|
MemoryBarrier();
|
||||||
|
return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||||
|
Atomic32 increment) {
|
||||||
|
Atomic32 value;
|
||||||
|
int reloop;
|
||||||
|
do {
|
||||||
|
// Equivalent to:
|
||||||
|
//
|
||||||
|
// value = LDREX(ptr)
|
||||||
|
// value += increment
|
||||||
|
// reloop = STREX(ptr, value)
|
||||||
|
//
|
||||||
|
__asm__ __volatile__(" ldrex %0, [%3]\n"
|
||||||
|
" add %0, %0, %4\n"
|
||||||
|
" strex %1, %0, [%3]\n"
|
||||||
|
: "=&r"(value), "=&r"(reloop), "+m"(*ptr)
|
||||||
|
: "r"(ptr), "r"(increment)
|
||||||
|
: "cc", "memory");
|
||||||
|
} while (reloop);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||||
|
Atomic32 increment) {
|
||||||
|
// TODO(digit): Investigate if it's possible to implement this with
|
||||||
|
// a single MemoryBarrier() operation between the LDREX and STREX.
|
||||||
|
// See http://crbug.com/246514
|
||||||
|
MemoryBarrier();
|
||||||
|
Atomic32 result = NoBarrier_AtomicIncrement(ptr, increment);
|
||||||
|
MemoryBarrier();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
|
||||||
|
Atomic32 new_value) {
|
||||||
|
Atomic32 old_value;
|
||||||
|
int reloop;
|
||||||
|
do {
|
||||||
|
// old_value = LDREX(ptr)
|
||||||
|
// reloop = STREX(ptr, new_value)
|
||||||
|
__asm__ __volatile__(" ldrex %0, [%3]\n"
|
||||||
|
" strex %1, %4, [%3]\n"
|
||||||
|
: "=&r"(old_value), "=&r"(reloop), "+m"(*ptr)
|
||||||
|
: "r"(ptr), "r"(new_value)
|
||||||
|
: "cc", "memory");
|
||||||
|
} while (reloop != 0);
|
||||||
|
return old_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This tests against any known ARMv5 variant.
|
||||||
|
#elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
|
||||||
|
defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__)
|
||||||
|
|
||||||
|
// The kernel also provides a helper function to perform an atomic
|
||||||
|
// compare-and-swap operation at the hard-wired address 0xffff0fc0.
|
||||||
|
// On ARMv5, this is implemented by a special code path that the kernel
|
||||||
|
// detects and treats specially when thread pre-emption happens.
|
||||||
|
// On ARMv6 and higher, it uses LDREX/STREX instructions instead.
|
||||||
|
//
|
||||||
|
// Note that this always perform a full memory barrier, there is no
|
||||||
|
// need to add calls MemoryBarrier() before or after it. It also
|
||||||
|
// returns 0 on success, and 1 on exit.
|
||||||
|
//
|
||||||
|
// Available and reliable since Linux 2.6.24. Both Android and ChromeOS
|
||||||
|
// use newer kernel revisions, so this should not be a concern.
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
inline int LinuxKernelCmpxchg(Atomic32 old_value,
|
||||||
|
Atomic32 new_value,
|
||||||
|
volatile Atomic32* ptr) {
|
||||||
|
typedef int (*KernelCmpxchgFunc)(Atomic32, Atomic32, volatile Atomic32*);
|
||||||
|
return ((KernelCmpxchgFunc)0xffff0fc0)(old_value, new_value, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
|
||||||
|
Atomic32 old_value,
|
||||||
|
Atomic32 new_value) {
|
||||||
|
Atomic32 prev_value;
|
||||||
|
for (;;) {
|
||||||
|
prev_value = *ptr;
|
||||||
|
if (prev_value != old_value)
|
||||||
|
return prev_value;
|
||||||
|
if (!LinuxKernelCmpxchg(old_value, new_value, ptr))
|
||||||
|
return old_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
|
||||||
|
Atomic32 new_value) {
|
||||||
|
Atomic32 old_value;
|
||||||
|
do {
|
||||||
|
old_value = *ptr;
|
||||||
|
} while (LinuxKernelCmpxchg(old_value, new_value, ptr));
|
||||||
|
return old_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||||
|
Atomic32 increment) {
|
||||||
|
return Barrier_AtomicIncrement(ptr, increment);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||||
|
Atomic32 increment) {
|
||||||
|
for (;;) {
|
||||||
|
// Atomic exchange the old value with an incremented one.
|
||||||
|
Atomic32 old_value = *ptr;
|
||||||
|
Atomic32 new_value = old_value + increment;
|
||||||
|
if (!LinuxKernelCmpxchg(old_value, new_value, ptr)) {
|
||||||
|
// The exchange took place as expected.
|
||||||
|
return new_value;
|
||||||
|
}
|
||||||
|
// Otherwise, *ptr changed mid-loop and we need to retry.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
|
||||||
|
Atomic32 old_value,
|
||||||
|
Atomic32 new_value) {
|
||||||
|
Atomic32 prev_value;
|
||||||
|
for (;;) {
|
||||||
|
prev_value = *ptr;
|
||||||
|
if (prev_value != old_value) {
|
||||||
|
// Always ensure acquire semantics.
|
||||||
|
MemoryBarrier();
|
||||||
|
return prev_value;
|
||||||
|
}
|
||||||
|
if (!LinuxKernelCmpxchg(old_value, new_value, ptr))
|
||||||
|
return old_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
|
||||||
|
Atomic32 old_value,
|
||||||
|
Atomic32 new_value) {
|
||||||
|
// This could be implemented as:
|
||||||
|
// MemoryBarrier();
|
||||||
|
// return NoBarrier_CompareAndSwap();
|
||||||
|
//
|
||||||
|
// But would use 3 barriers per succesful CAS. To save performance,
|
||||||
|
// use Acquire_CompareAndSwap(). Its implementation guarantees that:
|
||||||
|
// - A succesful swap uses only 2 barriers (in the kernel helper).
|
||||||
|
// - An early return due to (prev_value != old_value) performs
|
||||||
|
// a memory barrier with no store, which is equivalent to the
|
||||||
|
// generic implementation above.
|
||||||
|
return Acquire_CompareAndSwap(ptr, old_value, new_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
# error "Your CPU's ARM architecture is not supported yet"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// NOTE: Atomicity of the following load and store operations is only
|
||||||
|
// guaranteed in case of 32-bit alignement of |ptr| values.
|
||||||
|
|
||||||
|
inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
|
||||||
|
*ptr = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
|
||||||
|
*ptr = value;
|
||||||
|
MemoryBarrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
|
||||||
|
MemoryBarrier();
|
||||||
|
*ptr = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { return *ptr; }
|
||||||
|
|
||||||
|
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
|
||||||
|
Atomic32 value = *ptr;
|
||||||
|
MemoryBarrier();
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
|
||||||
|
MemoryBarrier();
|
||||||
|
return *ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace base::subtle
|
||||||
|
} // namespace base
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ARM_GCC_H_
|
@@ -700,6 +700,13 @@ typedef struct _cef_browser_host_t {
|
|||||||
///
|
///
|
||||||
void (CEF_CALLBACK *drag_source_system_drag_ended)(
|
void (CEF_CALLBACK *drag_source_system_drag_ended)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the current visible navigation entry for this browser. This
|
||||||
|
// function can only be called on the UI thread.
|
||||||
|
///
|
||||||
|
struct _cef_navigation_entry_t* (CEF_CALLBACK *get_visible_navigation_entry)(
|
||||||
|
struct _cef_browser_host_t* self);
|
||||||
} cef_browser_host_t;
|
} cef_browser_host_t;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -331,6 +331,11 @@ typedef struct _cef_domnode_t {
|
|||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)(
|
cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the bounds of the element.
|
||||||
|
///
|
||||||
|
cef_rect_t (CEF_CALLBACK *get_element_bounds)(struct _cef_domnode_t* self);
|
||||||
} cef_domnode_t;
|
} cef_domnode_t;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -102,7 +102,7 @@ typedef struct _cef_life_span_handler_t {
|
|||||||
// has been fired.
|
// has been fired.
|
||||||
//
|
//
|
||||||
// An application should handle top-level owner window close notifications by
|
// An application should handle top-level owner window close notifications by
|
||||||
// calling cef_browser_host_t::Tryclose_browser() or
|
// calling cef_browser_host_t::try_close_browser() or
|
||||||
// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
|
// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
|
||||||
// to close immediately (see the examples below). This gives CEF an
|
// to close immediately (see the examples below). This gives CEF an
|
||||||
// opportunity to process the 'onbeforeunload' event and optionally cancel the
|
// opportunity to process the 'onbeforeunload' event and optionally cancel the
|
||||||
@@ -132,7 +132,7 @@ typedef struct _cef_life_span_handler_t {
|
|||||||
// The below examples describe what should happen during window close when the
|
// The below examples describe what should happen during window close when the
|
||||||
// browser is parented to an application-provided top-level window.
|
// browser is parented to an application-provided top-level window.
|
||||||
//
|
//
|
||||||
// Example 1: Using cef_browser_host_t::Tryclose_browser(). This is
|
// Example 1: Using cef_browser_host_t::try_close_browser(). This is
|
||||||
// recommended for clients using standard close handling and windows created
|
// recommended for clients using standard close handling and windows created
|
||||||
// on the browser process UI thread. 1. User clicks the window close button
|
// on the browser process UI thread. 1. User clicks the window close button
|
||||||
// which sends a close notification to
|
// which sends a close notification to
|
||||||
|
@@ -70,6 +70,19 @@ typedef struct _cef_menu_model_delegate_t {
|
|||||||
///
|
///
|
||||||
void (CEF_CALLBACK *menu_will_show)(struct _cef_menu_model_delegate_t* self,
|
void (CEF_CALLBACK *menu_will_show)(struct _cef_menu_model_delegate_t* self,
|
||||||
struct _cef_menu_model_t* menu_model);
|
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;
|
} cef_menu_model_delegate_t;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -44,6 +44,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct _cef_sslstatus_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent an entry in navigation history.
|
// Structure used to represent an entry in navigation history.
|
||||||
@@ -116,6 +117,12 @@ typedef struct _cef_navigation_entry_t {
|
|||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_http_status_code)(
|
int (CEF_CALLBACK *get_http_status_code)(
|
||||||
struct _cef_navigation_entry_t* self);
|
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;
|
} cef_navigation_entry_t;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -47,6 +47,7 @@
|
|||||||
#include "include/capi/cef_response_capi.h"
|
#include "include/capi/cef_response_capi.h"
|
||||||
#include "include/capi/cef_response_filter_capi.h"
|
#include "include/capi/cef_response_filter_capi.h"
|
||||||
#include "include/capi/cef_ssl_info_capi.h"
|
#include "include/capi/cef_ssl_info_capi.h"
|
||||||
|
#include "include/capi/cef_x509_certificate_capi.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -75,6 +76,25 @@ typedef struct _cef_request_callback_t {
|
|||||||
} cef_request_callback_t;
|
} cef_request_callback_t;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Callback structure used to select a client certificate for authentication.
|
||||||
|
///
|
||||||
|
typedef struct _cef_select_client_certificate_callback_t {
|
||||||
|
///
|
||||||
|
// Base structure.
|
||||||
|
///
|
||||||
|
cef_base_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Chooses the specified certificate for client certificate authentication.
|
||||||
|
// NULL value means that no client certificate should be used.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *select)(
|
||||||
|
struct _cef_select_client_certificate_callback_t* self,
|
||||||
|
struct _cef_x509certificate_t* cert);
|
||||||
|
} cef_select_client_certificate_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to browser requests. The
|
// Implement this structure to handle events related to browser requests. The
|
||||||
// functions of this structure will be called on the thread indicated.
|
// functions of this structure will be called on the thread indicated.
|
||||||
@@ -241,6 +261,26 @@ typedef struct _cef_request_handler_t {
|
|||||||
const cef_string_t* request_url, struct _cef_sslinfo_t* ssl_info,
|
const cef_string_t* request_url, struct _cef_sslinfo_t* ssl_info,
|
||||||
struct _cef_request_callback_t* callback);
|
struct _cef_request_callback_t* callback);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called on the UI thread when a client certificate is being requested for
|
||||||
|
// authentication. Return false (0) to use the default behavior and
|
||||||
|
// automatically select the first certificate available. Return true (1) and
|
||||||
|
// call cef_select_client_certificate_callback_t::Select either in this
|
||||||
|
// function or at a later time to select a certificate. Do not call Select or
|
||||||
|
// call it with NULL to continue without using any certificate. |isProxy|
|
||||||
|
// indicates whether the host is an HTTPS proxy or the origin server. |host|
|
||||||
|
// and |port| contains the hostname and port of the SSL server. |certificates|
|
||||||
|
// is the list of certificates to choose from; this list has already been
|
||||||
|
// pruned by Chromium so that it only contains certificates from issuers that
|
||||||
|
// the server trusts.
|
||||||
|
///
|
||||||
|
int (CEF_CALLBACK *on_select_client_certificate)(
|
||||||
|
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||||
|
int isProxy, const cef_string_t* host, int port,
|
||||||
|
size_t certificatesCount,
|
||||||
|
struct _cef_x509certificate_t* const* certificates,
|
||||||
|
struct _cef_select_client_certificate_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the browser process UI thread when a plugin has crashed.
|
// Called on the browser process UI thread when a plugin has crashed.
|
||||||
// |plugin_path| is the path of the plugin that crashed.
|
// |plugin_path| is the path of the plugin that crashed.
|
||||||
|
@@ -40,83 +40,13 @@
|
|||||||
|
|
||||||
#include "include/capi/cef_base_capi.h"
|
#include "include/capi/cef_base_capi.h"
|
||||||
#include "include/capi/cef_values_capi.h"
|
#include "include/capi/cef_values_capi.h"
|
||||||
|
#include "include/capi/cef_x509_certificate_capi.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
// Structure representing the issuer or subject field of an X.509 certificate.
|
|
||||||
///
|
|
||||||
typedef struct _cef_sslcert_principal_t {
|
|
||||||
///
|
|
||||||
// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns a name that can be used to represent the issuer. It tries in this
|
|
||||||
// order: CN, O and OU and returns the first non-NULL one found.
|
|
||||||
///
|
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_display_name)(
|
|
||||||
struct _cef_sslcert_principal_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the common name.
|
|
||||||
///
|
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_common_name)(
|
|
||||||
struct _cef_sslcert_principal_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the locality name.
|
|
||||||
///
|
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_locality_name)(
|
|
||||||
struct _cef_sslcert_principal_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the state or province name.
|
|
||||||
///
|
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_state_or_province_name)(
|
|
||||||
struct _cef_sslcert_principal_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the country name.
|
|
||||||
///
|
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_country_name)(
|
|
||||||
struct _cef_sslcert_principal_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Retrieve the list of street addresses.
|
|
||||||
///
|
|
||||||
void (CEF_CALLBACK *get_street_addresses)(
|
|
||||||
struct _cef_sslcert_principal_t* self, cef_string_list_t addresses);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Retrieve the list of organization names.
|
|
||||||
///
|
|
||||||
void (CEF_CALLBACK *get_organization_names)(
|
|
||||||
struct _cef_sslcert_principal_t* self, cef_string_list_t names);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Retrieve the list of organization unit names.
|
|
||||||
///
|
|
||||||
void (CEF_CALLBACK *get_organization_unit_names)(
|
|
||||||
struct _cef_sslcert_principal_t* self, cef_string_list_t names);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Retrieve the list of domain components.
|
|
||||||
///
|
|
||||||
void (CEF_CALLBACK *get_domain_components)(
|
|
||||||
struct _cef_sslcert_principal_t* self, cef_string_list_t components);
|
|
||||||
} cef_sslcert_principal_t;
|
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure representing SSL information.
|
// Structure representing SSL information.
|
||||||
///
|
///
|
||||||
@@ -134,85 +64,24 @@ typedef struct _cef_sslinfo_t {
|
|||||||
struct _cef_sslinfo_t* self);
|
struct _cef_sslinfo_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the certificate status has any error, major or minor.
|
// Returns the X.509 certificate.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_cert_status_error)(struct _cef_sslinfo_t* self);
|
struct _cef_x509certificate_t* (CEF_CALLBACK *get_x509certificate)(
|
||||||
|
|
||||||
///
|
|
||||||
// Returns true (1) if the certificate status represents only minor errors
|
|
||||||
// (e.g. failure to verify certificate revocation).
|
|
||||||
///
|
|
||||||
int (CEF_CALLBACK *is_cert_status_minor_error)(struct _cef_sslinfo_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the subject of the X.509 certificate. For HTTPS server certificates
|
|
||||||
// this represents the web server. The common name of the subject should
|
|
||||||
// match the host name of the web server.
|
|
||||||
///
|
|
||||||
struct _cef_sslcert_principal_t* (CEF_CALLBACK *get_subject)(
|
|
||||||
struct _cef_sslinfo_t* self);
|
struct _cef_sslinfo_t* self);
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the issuer of the X.509 certificate.
|
|
||||||
///
|
|
||||||
struct _cef_sslcert_principal_t* (CEF_CALLBACK *get_issuer)(
|
|
||||||
struct _cef_sslinfo_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the DER encoded serial number for the X.509 certificate. The value
|
|
||||||
// possibly includes a leading 00 byte.
|
|
||||||
///
|
|
||||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_serial_number)(
|
|
||||||
struct _cef_sslinfo_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the date before which the X.509 certificate is invalid.
|
|
||||||
// CefTime.GetTimeT() will return 0 if no date was specified.
|
|
||||||
///
|
|
||||||
cef_time_t (CEF_CALLBACK *get_valid_start)(struct _cef_sslinfo_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the date after which the X.509 certificate is invalid.
|
|
||||||
// CefTime.GetTimeT() will return 0 if no date was specified.
|
|
||||||
///
|
|
||||||
cef_time_t (CEF_CALLBACK *get_valid_expiry)(struct _cef_sslinfo_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the DER encoded data for the X.509 certificate.
|
|
||||||
///
|
|
||||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_derencoded)(
|
|
||||||
struct _cef_sslinfo_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the PEM encoded data for the X.509 certificate.
|
|
||||||
///
|
|
||||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_pemencoded)(
|
|
||||||
struct _cef_sslinfo_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the number of certificates in the issuer chain. If 0, the
|
|
||||||
// certificate is self-signed.
|
|
||||||
///
|
|
||||||
size_t (CEF_CALLBACK *get_issuer_chain_size)(struct _cef_sslinfo_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the DER encoded data for the certificate issuer chain. If we failed
|
|
||||||
// to encode a certificate in the chain it is still present in the array but
|
|
||||||
// is an NULL string.
|
|
||||||
///
|
|
||||||
void (CEF_CALLBACK *get_derencoded_issuer_chain)(struct _cef_sslinfo_t* self,
|
|
||||||
size_t* chainCount, struct _cef_binary_value_t** chain);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the PEM encoded data for the certificate issuer chain. If we failed
|
|
||||||
// to encode a certificate in the chain it is still present in the array but
|
|
||||||
// is an NULL string.
|
|
||||||
///
|
|
||||||
void (CEF_CALLBACK *get_pemencoded_issuer_chain)(struct _cef_sslinfo_t* self,
|
|
||||||
size_t* chainCount, struct _cef_binary_value_t** chain);
|
|
||||||
} cef_sslinfo_t;
|
} cef_sslinfo_t;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns true (1) if the certificate status has any error, major or minor.
|
||||||
|
///
|
||||||
|
CEF_EXPORT int cef_is_cert_status_error(cef_cert_status_t status);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns true (1) if the certificate status represents only minor errors (e.g.
|
||||||
|
// failure to verify certificate revocation).
|
||||||
|
///
|
||||||
|
CEF_EXPORT int cef_is_cert_status_minor_error(cef_cert_status_t status);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
95
include/capi/cef_ssl_status_capi.h
Normal file
95
include/capi/cef_ssl_status_capi.h
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
// Copyright (c) 2016 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.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_
|
||||||
|
#define CEF_INCLUDE_CAPI_CEF_SSL_STATUS_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_x509certificate_t;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Structure representing the SSL information for a navigation entry.
|
||||||
|
///
|
||||||
|
typedef struct _cef_sslstatus_t {
|
||||||
|
///
|
||||||
|
// Base structure.
|
||||||
|
///
|
||||||
|
cef_base_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns true (1) if the status is related to a secure SSL/TLS connection.
|
||||||
|
///
|
||||||
|
int (CEF_CALLBACK *is_secure_connection)(struct _cef_sslstatus_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns a bitmask containing any and all problems verifying the server
|
||||||
|
// certificate.
|
||||||
|
///
|
||||||
|
cef_cert_status_t (CEF_CALLBACK *get_cert_status)(
|
||||||
|
struct _cef_sslstatus_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the SSL version used for the SSL connection.
|
||||||
|
///
|
||||||
|
cef_ssl_version_t (CEF_CALLBACK *get_sslversion)(
|
||||||
|
struct _cef_sslstatus_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns a bitmask containing the page security content status.
|
||||||
|
///
|
||||||
|
cef_ssl_content_status_t (CEF_CALLBACK *get_content_status)(
|
||||||
|
struct _cef_sslstatus_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the X.509 certificate.
|
||||||
|
///
|
||||||
|
struct _cef_x509certificate_t* (CEF_CALLBACK *get_x509certificate)(
|
||||||
|
struct _cef_sslstatus_t* self);
|
||||||
|
} cef_sslstatus_t;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_
|
@@ -123,14 +123,16 @@ typedef struct _cef_v8context_t {
|
|||||||
struct _cef_v8context_t* that);
|
struct _cef_v8context_t* that);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Evaluates the specified JavaScript code using this context's global object.
|
// Execute a string of JavaScript code in this V8 context. The |script_url|
|
||||||
|
// parameter is the URL where the script in question can be found, if any. The
|
||||||
|
// |start_line| parameter is the base line number to use for error reporting.
|
||||||
// On success |retval| will be set to the return value, if any, and the
|
// On success |retval| will be set to the return value, if any, and the
|
||||||
// function will return true (1). On failure |exception| will be set to the
|
// function will return true (1). On failure |exception| will be set to the
|
||||||
// exception, if any, and the function will return false (0).
|
// exception, if any, and the function will return false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *eval)(struct _cef_v8context_t* self,
|
int (CEF_CALLBACK *eval)(struct _cef_v8context_t* self,
|
||||||
const cef_string_t* code, struct _cef_v8value_t** retval,
|
const cef_string_t* code, const cef_string_t* script_url, int start_line,
|
||||||
struct _cef_v8exception_t** exception);
|
struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception);
|
||||||
} cef_v8context_t;
|
} cef_v8context_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -211,6 +213,70 @@ typedef struct _cef_v8accessor_t {
|
|||||||
} cef_v8accessor_t;
|
} cef_v8accessor_t;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Structure that should be implemented to handle V8 interceptor calls. The
|
||||||
|
// functions of this structure will be called on the thread associated with the
|
||||||
|
// V8 interceptor. Interceptor's named property handlers (with first argument of
|
||||||
|
// type CefString) are called when object is indexed by string. Indexed property
|
||||||
|
// handlers (with first argument of type int) are called when object is indexed
|
||||||
|
// by integer.
|
||||||
|
///
|
||||||
|
typedef struct _cef_v8interceptor_t {
|
||||||
|
///
|
||||||
|
// Base structure.
|
||||||
|
///
|
||||||
|
cef_base_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Handle retrieval of the interceptor value identified by |name|. |object| is
|
||||||
|
// the receiver ('this' object) of the interceptor. If retrieval succeeds, set
|
||||||
|
// |retval| to the return value. If the requested value does not exist, don't
|
||||||
|
// set either |retval| or |exception|. If retrieval fails, set |exception| to
|
||||||
|
// the exception that will be thrown. If the property has an associated
|
||||||
|
// accessor, it will be called only if you don't set |retval|. Return true (1)
|
||||||
|
// if interceptor retrieval was handled, false (0) otherwise.
|
||||||
|
///
|
||||||
|
int (CEF_CALLBACK *get_byname)(struct _cef_v8interceptor_t* self,
|
||||||
|
const cef_string_t* name, struct _cef_v8value_t* object,
|
||||||
|
struct _cef_v8value_t** retval, cef_string_t* exception);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Handle retrieval of the interceptor value identified by |index|. |object|
|
||||||
|
// is the receiver ('this' object) of the interceptor. If retrieval succeeds,
|
||||||
|
// set |retval| to the return value. If the requested value does not exist,
|
||||||
|
// don't set either |retval| or |exception|. If retrieval fails, set
|
||||||
|
// |exception| to the exception that will be thrown. Return true (1) if
|
||||||
|
// interceptor retrieval was handled, false (0) otherwise.
|
||||||
|
///
|
||||||
|
int (CEF_CALLBACK *get_byindex)(struct _cef_v8interceptor_t* self, int index,
|
||||||
|
struct _cef_v8value_t* object, struct _cef_v8value_t** retval,
|
||||||
|
cef_string_t* exception);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Handle assignment of the interceptor value identified by |name|. |object|
|
||||||
|
// is the receiver ('this' object) of the interceptor. |value| is the new
|
||||||
|
// value being assigned to the interceptor. If assignment fails, set
|
||||||
|
// |exception| to the exception that will be thrown. This setter will always
|
||||||
|
// be called, even when the property has an associated accessor. Return true
|
||||||
|
// (1) if interceptor assignment was handled, false (0) otherwise.
|
||||||
|
///
|
||||||
|
int (CEF_CALLBACK *set_byname)(struct _cef_v8interceptor_t* self,
|
||||||
|
const cef_string_t* name, struct _cef_v8value_t* object,
|
||||||
|
struct _cef_v8value_t* value, cef_string_t* exception);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Handle assignment of the interceptor value identified by |index|. |object|
|
||||||
|
// is the receiver ('this' object) of the interceptor. |value| is the new
|
||||||
|
// value being assigned to the interceptor. If assignment fails, set
|
||||||
|
// |exception| to the exception that will be thrown. Return true (1) if
|
||||||
|
// interceptor assignment was handled, false (0) otherwise.
|
||||||
|
///
|
||||||
|
int (CEF_CALLBACK *set_byindex)(struct _cef_v8interceptor_t* self, int index,
|
||||||
|
struct _cef_v8value_t* object, struct _cef_v8value_t* value,
|
||||||
|
cef_string_t* exception);
|
||||||
|
} cef_v8interceptor_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure representing a V8 exception. The functions of this structure may be
|
// Structure representing a V8 exception. The functions of this structure may be
|
||||||
// called on any render process thread.
|
// called on any render process thread.
|
||||||
@@ -358,38 +424,32 @@ typedef struct _cef_v8value_t {
|
|||||||
struct _cef_v8value_t* that);
|
struct _cef_v8value_t* that);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a bool value. The underlying data will be converted to if
|
// Return a bool value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_bool_value)(struct _cef_v8value_t* self);
|
int (CEF_CALLBACK *get_bool_value)(struct _cef_v8value_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an int value. The underlying data will be converted to if
|
// Return an int value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
int32 (CEF_CALLBACK *get_int_value)(struct _cef_v8value_t* self);
|
int32 (CEF_CALLBACK *get_int_value)(struct _cef_v8value_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an unisgned int value. The underlying data will be converted to if
|
// Return an unsigned int value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
uint32 (CEF_CALLBACK *get_uint_value)(struct _cef_v8value_t* self);
|
uint32 (CEF_CALLBACK *get_uint_value)(struct _cef_v8value_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a double value. The underlying data will be converted to if
|
// Return a double value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
double (CEF_CALLBACK *get_double_value)(struct _cef_v8value_t* self);
|
double (CEF_CALLBACK *get_double_value)(struct _cef_v8value_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a Date value. The underlying data will be converted to if
|
// Return a Date value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
cef_time_t (CEF_CALLBACK *get_date_value)(struct _cef_v8value_t* self);
|
cef_time_t (CEF_CALLBACK *get_date_value)(struct _cef_v8value_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a string value. The underlying data will be converted to if
|
// Return a string value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_string_value)(
|
cef_string_userfree_t (CEF_CALLBACK *get_string_value)(
|
||||||
@@ -652,13 +712,14 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date);
|
|||||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value);
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_v8value_t object of type object with optional accessor. This
|
// Create a new cef_v8value_t object of type object with optional accessor
|
||||||
// function should only be called from within the scope of a
|
// and/or interceptor. This function should only be called from within the scope
|
||||||
// cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t callback,
|
// of a cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t
|
||||||
// or in combination with calling enter() and exit() on a stored cef_v8context_t
|
// callback, or in combination with calling enter() and exit() on a stored
|
||||||
// reference.
|
// cef_v8context_t reference.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor);
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor,
|
||||||
|
cef_v8interceptor_t* interceptor);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_v8value_t object of type array with the specified |length|.
|
// Create a new cef_v8value_t object of type array with the specified |length|.
|
||||||
|
@@ -127,6 +127,29 @@ typedef struct _cef_web_plugin_unstable_callback_t {
|
|||||||
} cef_web_plugin_unstable_callback_t;
|
} cef_web_plugin_unstable_callback_t;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Implement this structure to receive notification when CDM registration is
|
||||||
|
// complete. The functions of this structure will be called on the browser
|
||||||
|
// process UI thread.
|
||||||
|
///
|
||||||
|
typedef struct _cef_register_cdm_callback_t {
|
||||||
|
///
|
||||||
|
// Base structure.
|
||||||
|
///
|
||||||
|
cef_base_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Method that will be called when CDM registration is complete. |result| will
|
||||||
|
// be CEF_CDM_REGISTRATION_ERROR_NONE if registration completed successfully.
|
||||||
|
// Otherwise, |result| and |error_message| will contain additional information
|
||||||
|
// about why registration failed.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *on_cdm_registration_complete)(
|
||||||
|
struct _cef_register_cdm_callback_t* self,
|
||||||
|
cef_cdm_registration_error_t result, const cef_string_t* error_message);
|
||||||
|
} cef_register_cdm_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Visit web plugin information. Can be called on any thread in the browser
|
// Visit web plugin information. Can be called on any thread in the browser
|
||||||
// process.
|
// process.
|
||||||
@@ -161,6 +184,54 @@ CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path);
|
|||||||
CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path,
|
CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path,
|
||||||
cef_web_plugin_unstable_callback_t* callback);
|
cef_web_plugin_unstable_callback_t* callback);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Register the Widevine CDM plugin.
|
||||||
|
//
|
||||||
|
// The client application is responsible for downloading an appropriate
|
||||||
|
// platform-specific CDM binary distribution from Google, extracting the
|
||||||
|
// contents, and building the required directory structure on the local machine.
|
||||||
|
// The cef_browser_host_t::StartDownload function and CefZipArchive structure
|
||||||
|
// can be used to implement this functionality in CEF. Contact Google via
|
||||||
|
// https://www.widevine.com/contact.html for details on CDM download.
|
||||||
|
//
|
||||||
|
// |path| is a directory that must contain the following files:
|
||||||
|
// 1. manifest.json file from the CDM binary distribution (see below).
|
||||||
|
// 2. widevinecdm file from the CDM binary distribution (e.g.
|
||||||
|
// widevinecdm.dll on on Windows, libwidevinecdm.dylib on OS X,
|
||||||
|
// libwidevinecdm.so on Linux).
|
||||||
|
// 3. widevidecdmadapter file from the CEF binary distribution (e.g.
|
||||||
|
// widevinecdmadapter.dll on Windows, widevinecdmadapter.plugin on OS X,
|
||||||
|
// libwidevinecdmadapter.so on Linux).
|
||||||
|
//
|
||||||
|
// If any of these files are missing or if the manifest file has incorrect
|
||||||
|
// contents the registration will fail and |callback| will receive a |result|
|
||||||
|
// value of CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS.
|
||||||
|
//
|
||||||
|
// The manifest.json file must contain the following keys:
|
||||||
|
// A. "os": Supported OS (e.g. "mac", "win" or "linux").
|
||||||
|
// B. "arch": Supported architecture (e.g. "ia32" or "x64").
|
||||||
|
// C. "x-cdm-module-versions": Module API version (e.g. "4").
|
||||||
|
// D. "x-cdm-interface-versions": Interface API version (e.g. "8").
|
||||||
|
// E. "x-cdm-host-versions": Host API version (e.g. "8").
|
||||||
|
// F. "version": CDM version (e.g. "1.4.8.903").
|
||||||
|
// G. "x-cdm-codecs": List of supported codecs (e.g. "vp8,vp9.0,avc1").
|
||||||
|
//
|
||||||
|
// A through E are used to verify compatibility with the current Chromium
|
||||||
|
// version. If the CDM is not compatible the registration will fail and
|
||||||
|
// |callback| will receive a |result| value of
|
||||||
|
// CEF_CDM_REGISTRATION_ERROR_INCOMPATIBLE.
|
||||||
|
//
|
||||||
|
// |callback| will be executed asynchronously once registration is complete.
|
||||||
|
//
|
||||||
|
// On Linux this function must be called before cef_initialize() and the
|
||||||
|
// registration cannot be changed during runtime. If registration is not
|
||||||
|
// supported at the time that cef_register_widevine_cdm() is called then
|
||||||
|
// |callback| will receive a |result| value of
|
||||||
|
// CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED.
|
||||||
|
///
|
||||||
|
CEF_EXPORT void cef_register_widevine_cdm(const cef_string_t* path,
|
||||||
|
cef_register_cdm_callback_t* callback);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
208
include/capi/cef_x509_certificate_capi.h
Normal file
208
include/capi/cef_x509_certificate_capi.h
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
// Copyright (c) 2016 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.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_
|
||||||
|
#define CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/capi/cef_base_capi.h"
|
||||||
|
#include "include/capi/cef_values_capi.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Structure representing the issuer or subject field of an X.509 certificate.
|
||||||
|
///
|
||||||
|
typedef struct _cef_x509cert_principal_t {
|
||||||
|
///
|
||||||
|
// Base structure.
|
||||||
|
///
|
||||||
|
cef_base_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns a name that can be used to represent the issuer. It tries in this
|
||||||
|
// order: Common Name (CN), Organization Name (O) and Organizational Unit Name
|
||||||
|
// (OU) and returns the first non-NULL one found.
|
||||||
|
///
|
||||||
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
|
cef_string_userfree_t (CEF_CALLBACK *get_display_name)(
|
||||||
|
struct _cef_x509cert_principal_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the common name.
|
||||||
|
///
|
||||||
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
|
cef_string_userfree_t (CEF_CALLBACK *get_common_name)(
|
||||||
|
struct _cef_x509cert_principal_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the locality name.
|
||||||
|
///
|
||||||
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
|
cef_string_userfree_t (CEF_CALLBACK *get_locality_name)(
|
||||||
|
struct _cef_x509cert_principal_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the state or province name.
|
||||||
|
///
|
||||||
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
|
cef_string_userfree_t (CEF_CALLBACK *get_state_or_province_name)(
|
||||||
|
struct _cef_x509cert_principal_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the country name.
|
||||||
|
///
|
||||||
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
|
cef_string_userfree_t (CEF_CALLBACK *get_country_name)(
|
||||||
|
struct _cef_x509cert_principal_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Retrieve the list of street addresses.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *get_street_addresses)(
|
||||||
|
struct _cef_x509cert_principal_t* self, cef_string_list_t addresses);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Retrieve the list of organization names.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *get_organization_names)(
|
||||||
|
struct _cef_x509cert_principal_t* self, cef_string_list_t names);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Retrieve the list of organization unit names.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *get_organization_unit_names)(
|
||||||
|
struct _cef_x509cert_principal_t* self, cef_string_list_t names);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Retrieve the list of domain components.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *get_domain_components)(
|
||||||
|
struct _cef_x509cert_principal_t* self, cef_string_list_t components);
|
||||||
|
} cef_x509cert_principal_t;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Structure representing a X.509 certificate.
|
||||||
|
///
|
||||||
|
typedef struct _cef_x509certificate_t {
|
||||||
|
///
|
||||||
|
// Base structure.
|
||||||
|
///
|
||||||
|
cef_base_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the subject of the X.509 certificate. For HTTPS server certificates
|
||||||
|
// this represents the web server. The common name of the subject should
|
||||||
|
// match the host name of the web server.
|
||||||
|
///
|
||||||
|
struct _cef_x509cert_principal_t* (CEF_CALLBACK *get_subject)(
|
||||||
|
struct _cef_x509certificate_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the issuer of the X.509 certificate.
|
||||||
|
///
|
||||||
|
struct _cef_x509cert_principal_t* (CEF_CALLBACK *get_issuer)(
|
||||||
|
struct _cef_x509certificate_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the DER encoded serial number for the X.509 certificate. The value
|
||||||
|
// possibly includes a leading 00 byte.
|
||||||
|
///
|
||||||
|
struct _cef_binary_value_t* (CEF_CALLBACK *get_serial_number)(
|
||||||
|
struct _cef_x509certificate_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the date before which the X.509 certificate is invalid.
|
||||||
|
// CefTime.GetTimeT() will return 0 if no date was specified.
|
||||||
|
///
|
||||||
|
cef_time_t (CEF_CALLBACK *get_valid_start)(
|
||||||
|
struct _cef_x509certificate_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the date after which the X.509 certificate is invalid.
|
||||||
|
// CefTime.GetTimeT() will return 0 if no date was specified.
|
||||||
|
///
|
||||||
|
cef_time_t (CEF_CALLBACK *get_valid_expiry)(
|
||||||
|
struct _cef_x509certificate_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the DER encoded data for the X.509 certificate.
|
||||||
|
///
|
||||||
|
struct _cef_binary_value_t* (CEF_CALLBACK *get_derencoded)(
|
||||||
|
struct _cef_x509certificate_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the PEM encoded data for the X.509 certificate.
|
||||||
|
///
|
||||||
|
struct _cef_binary_value_t* (CEF_CALLBACK *get_pemencoded)(
|
||||||
|
struct _cef_x509certificate_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the number of certificates in the issuer chain. If 0, the
|
||||||
|
// certificate is self-signed.
|
||||||
|
///
|
||||||
|
size_t (CEF_CALLBACK *get_issuer_chain_size)(
|
||||||
|
struct _cef_x509certificate_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the DER encoded data for the certificate issuer chain. If we failed
|
||||||
|
// to encode a certificate in the chain it is still present in the array but
|
||||||
|
// is an NULL string.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *get_derencoded_issuer_chain)(
|
||||||
|
struct _cef_x509certificate_t* self, size_t* chainCount,
|
||||||
|
struct _cef_binary_value_t** chain);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the PEM encoded data for the certificate issuer chain. If we failed
|
||||||
|
// to encode a certificate in the chain it is still present in the array but
|
||||||
|
// is an NULL string.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *get_pemencoded_issuer_chain)(
|
||||||
|
struct _cef_x509certificate_t* self, size_t* chainCount,
|
||||||
|
struct _cef_binary_value_t** chain);
|
||||||
|
} cef_x509certificate_t;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_
|
@@ -753,6 +753,13 @@ class CefBrowserHost : public virtual CefBase {
|
|||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual void DragSourceSystemDragEnded() =0;
|
virtual void DragSourceSystemDragEnded() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the current visible navigation entry for this browser. This method
|
||||||
|
// can only be called on the UI thread.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRefPtr<CefNavigationEntry> GetVisibleNavigationEntry() =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CEF_BROWSER_H_
|
#endif // CEF_INCLUDE_CEF_BROWSER_H_
|
||||||
|
@@ -323,6 +323,12 @@ class CefDOMNode : public virtual CefBase {
|
|||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual CefString GetElementInnerText() =0;
|
virtual CefString GetElementInnerText() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the bounds of the element.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRect GetElementBounds() =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CEF_DOM_H_
|
#endif // CEF_INCLUDE_CEF_DOM_H_
|
||||||
|
@@ -63,20 +63,20 @@ class CefMenuModelDelegate : public virtual CefBase {
|
|||||||
// The menu is about to show.
|
// The menu is about to show.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual void MenuWillShow(CefRefPtr<CefMenuModel> menu_model) {};
|
virtual void MenuWillShow(CefRefPtr<CefMenuModel> menu_model) {}
|
||||||
|
|
||||||
///
|
///
|
||||||
// The menu has closed.
|
// The menu has closed.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual void MenuClosed(CefRefPtr<CefMenuModel> menu_model) {};
|
virtual void MenuClosed(CefRefPtr<CefMenuModel> menu_model) {}
|
||||||
|
|
||||||
///
|
///
|
||||||
// Optionally modify a menu item label. Return true if |label| was modified.
|
// Optionally modify a menu item label. Return true if |label| was modified.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual bool FormatLabel(CefRefPtr<CefMenuModel> menu_model,
|
virtual bool FormatLabel(CefRefPtr<CefMenuModel> menu_model,
|
||||||
CefString& label) { return false; };
|
CefString& label) { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_VIEWS_CEF_MENU_MODEL_DELEGATE_H_
|
#endif // CEF_INCLUDE_VIEWS_CEF_MENU_MODEL_DELEGATE_H_
|
||||||
|
@@ -40,6 +40,8 @@
|
|||||||
|
|
||||||
#include "include/cef_base.h"
|
#include "include/cef_base.h"
|
||||||
|
|
||||||
|
class CefSSLStatus;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Class used to represent an entry in navigation history.
|
// Class used to represent an entry in navigation history.
|
||||||
///
|
///
|
||||||
@@ -108,6 +110,12 @@ class CefNavigationEntry : public virtual CefBase {
|
|||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual int GetHttpStatusCode() =0;
|
virtual int GetHttpStatusCode() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the SSL information for this navigation entry.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRefPtr<CefSSLStatus> GetSSLStatus() =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_
|
#endif // CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_
|
||||||
|
@@ -38,10 +38,11 @@
|
|||||||
#define CEF_INCLUDE_CEF_RENDER_HANDLER_H_
|
#define CEF_INCLUDE_CEF_RENDER_HANDLER_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "include/cef_base.h"
|
#include "include/cef_base.h"
|
||||||
#include "include/cef_browser.h"
|
#include "include/cef_browser.h"
|
||||||
#include "include/cef_drag_data.h"
|
#include "include/cef_drag_data.h"
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this interface to handle events when window rendering is disabled.
|
// Implement this interface to handle events when window rendering is disabled.
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
#define CEF_INCLUDE_CEF_REQUEST_HANDLER_H_
|
#define CEF_INCLUDE_CEF_REQUEST_HANDLER_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "include/cef_auth_callback.h"
|
#include "include/cef_auth_callback.h"
|
||||||
#include "include/cef_base.h"
|
#include "include/cef_base.h"
|
||||||
#include "include/cef_browser.h"
|
#include "include/cef_browser.h"
|
||||||
@@ -47,7 +49,7 @@
|
|||||||
#include "include/cef_response_filter.h"
|
#include "include/cef_response_filter.h"
|
||||||
#include "include/cef_request.h"
|
#include "include/cef_request.h"
|
||||||
#include "include/cef_ssl_info.h"
|
#include "include/cef_ssl_info.h"
|
||||||
|
#include "include/cef_x509_certificate.h"
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback interface used for asynchronous continuation of url requests.
|
// Callback interface used for asynchronous continuation of url requests.
|
||||||
@@ -70,6 +72,21 @@ class CefRequestCallback : public virtual CefBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Callback interface used to select a client certificate for authentication.
|
||||||
|
///
|
||||||
|
/*--cef(source=library)--*/
|
||||||
|
class CefSelectClientCertificateCallback : public virtual CefBase {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Chooses the specified certificate for client certificate authentication.
|
||||||
|
// NULL value means that no client certificate should be used.
|
||||||
|
///
|
||||||
|
/*--cef(optional_param=cert)--*/
|
||||||
|
virtual void Select(CefRefPtr<CefX509Certificate> cert) =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this interface to handle events related to browser requests. The
|
// Implement this interface to handle events related to browser requests. The
|
||||||
// methods of this class will be called on the thread indicated.
|
// methods of this class will be called on the thread indicated.
|
||||||
@@ -81,6 +98,7 @@ class CefRequestHandler : public virtual CefBase {
|
|||||||
typedef cef_termination_status_t TerminationStatus;
|
typedef cef_termination_status_t TerminationStatus;
|
||||||
typedef cef_urlrequest_status_t URLRequestStatus;
|
typedef cef_urlrequest_status_t URLRequestStatus;
|
||||||
typedef cef_window_open_disposition_t WindowOpenDisposition;
|
typedef cef_window_open_disposition_t WindowOpenDisposition;
|
||||||
|
typedef std::vector<CefRefPtr<CefX509Certificate> > X509CertificateList;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the UI thread before browser navigation. Return true to cancel
|
// Called on the UI thread before browser navigation. Return true to cancel
|
||||||
@@ -282,6 +300,29 @@ class CefRequestHandler : public virtual CefBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called on the UI thread when a client certificate is being requested for
|
||||||
|
// authentication. Return false to use the default behavior and automatically
|
||||||
|
// select the first certificate available. Return true and call
|
||||||
|
// CefSelectClientCertificateCallback::Select either in this method or at a
|
||||||
|
// later time to select a certificate. Do not call Select or call it with NULL
|
||||||
|
// to continue without using any certificate. |isProxy| indicates whether the
|
||||||
|
// host is an HTTPS proxy or the origin server. |host| and |port| contains the
|
||||||
|
// hostname and port of the SSL server. |certificates| is the list of
|
||||||
|
// certificates to choose from; this list has already been pruned by Chromium
|
||||||
|
// so that it only contains certificates from issuers that the server trusts.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual bool OnSelectClientCertificate(
|
||||||
|
CefRefPtr<CefBrowser> browser,
|
||||||
|
bool isProxy,
|
||||||
|
const CefString& host,
|
||||||
|
int port,
|
||||||
|
const X509CertificateList& certificates,
|
||||||
|
CefRefPtr<CefSelectClientCertificateCallback> callback) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the browser process UI thread when a plugin has crashed.
|
// Called on the browser process UI thread when a plugin has crashed.
|
||||||
// |plugin_path| is the path of the plugin that crashed.
|
// |plugin_path| is the path of the plugin that crashed.
|
||||||
|
@@ -38,72 +38,10 @@
|
|||||||
#define CEF_INCLUDE_CEF_SSL_INFO_H_
|
#define CEF_INCLUDE_CEF_SSL_INFO_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "include/cef_base.h"
|
#include "include/cef_base.h"
|
||||||
#include "include/cef_values.h"
|
#include "include/cef_values.h"
|
||||||
|
|
||||||
///
|
#include "include/cef_x509_certificate.h"
|
||||||
// Class representing the issuer or subject field of an X.509 certificate.
|
|
||||||
///
|
|
||||||
/*--cef(source=library)--*/
|
|
||||||
class CefSSLCertPrincipal : public virtual CefBase {
|
|
||||||
public:
|
|
||||||
///
|
|
||||||
// Returns a name that can be used to represent the issuer. It tries in this
|
|
||||||
// order: CN, O and OU and returns the first non-empty one found.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefString GetDisplayName() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the common name.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefString GetCommonName() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the locality name.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefString GetLocalityName() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the state or province name.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefString GetStateOrProvinceName() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the country name.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefString GetCountryName() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Retrieve the list of street addresses.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual void GetStreetAddresses(std::vector<CefString>& addresses) =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Retrieve the list of organization names.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual void GetOrganizationNames(std::vector<CefString>& names) =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Retrieve the list of organization unit names.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual void GetOrganizationUnitNames(std::vector<CefString>& names) =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Retrieve the list of domain components.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual void GetDomainComponents(std::vector<CefString>& components) =0;
|
|
||||||
};
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Class representing SSL information.
|
// Class representing SSL information.
|
||||||
@@ -111,8 +49,6 @@ class CefSSLCertPrincipal : public virtual CefBase {
|
|||||||
/*--cef(source=library)--*/
|
/*--cef(source=library)--*/
|
||||||
class CefSSLInfo : public virtual CefBase {
|
class CefSSLInfo : public virtual CefBase {
|
||||||
public:
|
public:
|
||||||
typedef std::vector<CefRefPtr<CefBinaryValue> > IssuerChainBinaryList;
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns a bitmask containing any and all problems verifying the server
|
// Returns a bitmask containing any and all problems verifying the server
|
||||||
// certificate.
|
// certificate.
|
||||||
@@ -121,87 +57,24 @@ class CefSSLInfo : public virtual CefBase {
|
|||||||
virtual cef_cert_status_t GetCertStatus() =0;
|
virtual cef_cert_status_t GetCertStatus() =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true if the certificate status has any error, major or minor.
|
// Returns the X.509 certificate.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual bool IsCertStatusError() =0;
|
virtual CefRefPtr<CefX509Certificate> GetX509Certificate() =0;
|
||||||
|
|
||||||
///
|
|
||||||
// Returns true if the certificate status represents only minor errors
|
|
||||||
// (e.g. failure to verify certificate revocation).
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual bool IsCertStatusMinorError() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the subject of the X.509 certificate. For HTTPS server
|
|
||||||
// certificates this represents the web server. The common name of the
|
|
||||||
// subject should match the host name of the web server.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefRefPtr<CefSSLCertPrincipal> GetSubject() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the issuer of the X.509 certificate.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefRefPtr<CefSSLCertPrincipal> GetIssuer() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the DER encoded serial number for the X.509 certificate. The value
|
|
||||||
// possibly includes a leading 00 byte.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefRefPtr<CefBinaryValue> GetSerialNumber() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the date before which the X.509 certificate is invalid.
|
|
||||||
// CefTime.GetTimeT() will return 0 if no date was specified.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefTime GetValidStart() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the date after which the X.509 certificate is invalid.
|
|
||||||
// CefTime.GetTimeT() will return 0 if no date was specified.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefTime GetValidExpiry() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the DER encoded data for the X.509 certificate.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefRefPtr<CefBinaryValue> GetDEREncoded() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the PEM encoded data for the X.509 certificate.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual CefRefPtr<CefBinaryValue> GetPEMEncoded() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the number of certificates in the issuer chain.
|
|
||||||
// If 0, the certificate is self-signed.
|
|
||||||
///
|
|
||||||
/*--cef()--*/
|
|
||||||
virtual size_t GetIssuerChainSize() =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the DER encoded data for the certificate issuer chain.
|
|
||||||
// If we failed to encode a certificate in the chain it is still
|
|
||||||
// present in the array but is an empty string.
|
|
||||||
///
|
|
||||||
/*--cef(count_func=chain:GetIssuerChainSize)--*/
|
|
||||||
virtual void GetDEREncodedIssuerChain(IssuerChainBinaryList& chain) =0;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Returns the PEM encoded data for the certificate issuer chain.
|
|
||||||
// If we failed to encode a certificate in the chain it is still
|
|
||||||
// present in the array but is an empty string.
|
|
||||||
///
|
|
||||||
/*--cef(count_func=chain:GetIssuerChainSize)--*/
|
|
||||||
virtual void GetPEMEncodedIssuerChain(IssuerChainBinaryList& chain) =0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns true if the certificate status has any error, major or minor.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
bool CefIsCertStatusError(cef_cert_status_t status);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns true if the certificate status represents only minor errors
|
||||||
|
// (e.g. failure to verify certificate revocation).
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
bool CefIsCertStatusMinorError(cef_cert_status_t status);
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CEF_SSL_INFO_H_
|
#endif // CEF_INCLUDE_CEF_SSL_INFO_H_
|
||||||
|
84
include/cef_ssl_status.h
Normal file
84
include/cef_ssl_status.h
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
// Copyright (c) 2016 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.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// The contents of this file must follow a specific format in order to
|
||||||
|
// support the CEF translator tool. See the translator.README.txt file in the
|
||||||
|
// tools directory for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_CEF_SSL_STATUS_H_
|
||||||
|
#define CEF_INCLUDE_CEF_SSL_STATUS_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/cef_base.h"
|
||||||
|
#include "include/cef_values.h"
|
||||||
|
|
||||||
|
class CefX509Certificate;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Class representing the SSL information for a navigation entry.
|
||||||
|
///
|
||||||
|
/*--cef(source=library)--*/
|
||||||
|
class CefSSLStatus : public virtual CefBase {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Returns true if the status is related to a secure SSL/TLS connection.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual bool IsSecureConnection() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns a bitmask containing any and all problems verifying the server
|
||||||
|
// certificate.
|
||||||
|
///
|
||||||
|
/*--cef(default_retval=CERT_STATUS_NONE)--*/
|
||||||
|
virtual cef_cert_status_t GetCertStatus() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the SSL version used for the SSL connection.
|
||||||
|
///
|
||||||
|
/*--cef(default_retval=SSL_CONNECTION_VERSION_UNKNOWN)--*/
|
||||||
|
virtual cef_ssl_version_t GetSSLVersion() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns a bitmask containing the page security content status.
|
||||||
|
///
|
||||||
|
/*--cef(default_retval=SSL_CONTENT_NORMAL_CONTENT)--*/
|
||||||
|
virtual cef_ssl_content_status_t GetContentStatus() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the X.509 certificate.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRefPtr<CefX509Certificate> GetX509Certificate() =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_CEF_SSL_STATUS_H_
|
108
include/cef_v8.h
108
include/cef_v8.h
@@ -206,13 +206,17 @@ class CefV8Context : public virtual CefBase {
|
|||||||
virtual bool IsSame(CefRefPtr<CefV8Context> that) =0;
|
virtual bool IsSame(CefRefPtr<CefV8Context> that) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Evaluates the specified JavaScript code using this context's global object.
|
// Execute a string of JavaScript code in this V8 context. The |script_url|
|
||||||
// On success |retval| will be set to the return value, if any, and the
|
// parameter is the URL where the script in question can be found, if any.
|
||||||
// function will return true. On failure |exception| will be set to the
|
// The |start_line| parameter is the base line number to use for error
|
||||||
|
// reporting. On success |retval| will be set to the return value, if any, and
|
||||||
|
// the function will return true. On failure |exception| will be set to the
|
||||||
// exception, if any, and the function will return false.
|
// exception, if any, and the function will return false.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef(optional_param=script_url)--*/
|
||||||
virtual bool Eval(const CefString& code,
|
virtual bool Eval(const CefString& code,
|
||||||
|
const CefString& script_url,
|
||||||
|
int start_line,
|
||||||
CefRefPtr<CefV8Value>& retval,
|
CefRefPtr<CefV8Value>& retval,
|
||||||
CefRefPtr<CefV8Exception>& exception) =0;
|
CefRefPtr<CefV8Exception>& exception) =0;
|
||||||
};
|
};
|
||||||
@@ -277,6 +281,74 @@ class CefV8Accessor : public virtual CefBase {
|
|||||||
CefString& exception) =0;
|
CefString& exception) =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// Interface that should be implemented to handle V8 interceptor calls. The
|
||||||
|
// methods of this class will be called on the thread associated with the V8
|
||||||
|
// interceptor. Interceptor's named property handlers (with first argument of
|
||||||
|
// type CefString) are called when object is indexed by string. Indexed property
|
||||||
|
// handlers (with first argument of type int) are called when object is indexed
|
||||||
|
// by integer.
|
||||||
|
///
|
||||||
|
/*--cef(source=client)--*/
|
||||||
|
class CefV8Interceptor : public virtual CefBase {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Handle retrieval of the interceptor value identified by |name|. |object| is
|
||||||
|
// the receiver ('this' object) of the interceptor. If retrieval succeeds, set
|
||||||
|
// |retval| to the return value. If the requested value does not exist, don't
|
||||||
|
// set either |retval| or |exception|. If retrieval fails, set |exception| to
|
||||||
|
// the exception that will be thrown. If the property has an associated
|
||||||
|
// accessor, it will be called only if you don't set |retval|.
|
||||||
|
// Return true if interceptor retrieval was handled, false otherwise.
|
||||||
|
///
|
||||||
|
/*--cef(capi_name=get_byname)--*/
|
||||||
|
virtual bool Get(const CefString& name,
|
||||||
|
const CefRefPtr<CefV8Value> object,
|
||||||
|
CefRefPtr<CefV8Value>& retval,
|
||||||
|
CefString& exception) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Handle retrieval of the interceptor value identified by |index|. |object|
|
||||||
|
// is the receiver ('this' object) of the interceptor. If retrieval succeeds,
|
||||||
|
// set |retval| to the return value. If the requested value does not exist,
|
||||||
|
// don't set either |retval| or |exception|. If retrieval fails, set
|
||||||
|
// |exception| to the exception that will be thrown.
|
||||||
|
// Return true if interceptor retrieval was handled, false otherwise.
|
||||||
|
///
|
||||||
|
/*--cef(capi_name=get_byindex,index_param=index)--*/
|
||||||
|
virtual bool Get(int index,
|
||||||
|
const CefRefPtr<CefV8Value> object,
|
||||||
|
CefRefPtr<CefV8Value>& retval,
|
||||||
|
CefString& exception) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Handle assignment of the interceptor value identified by |name|. |object|
|
||||||
|
// is the receiver ('this' object) of the interceptor. |value| is the new
|
||||||
|
// value being assigned to the interceptor. If assignment fails, set
|
||||||
|
// |exception| to the exception that will be thrown. This setter will always
|
||||||
|
// be called, even when the property has an associated accessor.
|
||||||
|
// Return true if interceptor assignment was handled, false otherwise.
|
||||||
|
///
|
||||||
|
/*--cef(capi_name=set_byname)--*/
|
||||||
|
virtual bool Set(const CefString& name,
|
||||||
|
const CefRefPtr<CefV8Value> object,
|
||||||
|
const CefRefPtr<CefV8Value> value,
|
||||||
|
CefString& exception) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Handle assignment of the interceptor value identified by |index|. |object|
|
||||||
|
// is the receiver ('this' object) of the interceptor. |value| is the new
|
||||||
|
// value being assigned to the interceptor. If assignment fails, set
|
||||||
|
// |exception| to the exception that will be thrown.
|
||||||
|
// Return true if interceptor assignment was handled, false otherwise.
|
||||||
|
///
|
||||||
|
/*--cef(capi_name=set_byindex,index_param=index)--*/
|
||||||
|
virtual bool Set(int index,
|
||||||
|
const CefRefPtr<CefV8Value> object,
|
||||||
|
const CefRefPtr<CefV8Value> value,
|
||||||
|
CefString& exception) =0;
|
||||||
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
// Class representing a V8 exception. The methods of this class may be called on
|
// Class representing a V8 exception. The methods of this class may be called on
|
||||||
// any render process thread.
|
// any render process thread.
|
||||||
@@ -404,14 +476,16 @@ class CefV8Value : public virtual CefBase {
|
|||||||
static CefRefPtr<CefV8Value> CreateString(const CefString& value);
|
static CefRefPtr<CefV8Value> CreateString(const CefString& value);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new CefV8Value object of type object with optional accessor. This
|
// Create a new CefV8Value object of type object with optional accessor and/or
|
||||||
// method should only be called from within the scope of a
|
// interceptor. This method should only be called from within the scope of a
|
||||||
// CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in
|
// CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in
|
||||||
// combination with calling Enter() and Exit() on a stored CefV8Context
|
// combination with calling Enter() and Exit() on a stored CefV8Context
|
||||||
// reference.
|
// reference.
|
||||||
///
|
///
|
||||||
/*--cef(optional_param=accessor)--*/
|
/*--cef(optional_param=accessor, optional_param=interceptor)--*/
|
||||||
static CefRefPtr<CefV8Value> CreateObject(CefRefPtr<CefV8Accessor> accessor);
|
static CefRefPtr<CefV8Value> CreateObject(
|
||||||
|
CefRefPtr<CefV8Accessor> accessor,
|
||||||
|
CefRefPtr<CefV8Interceptor> interceptor);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new CefV8Value object of type array with the specified |length|.
|
// Create a new CefV8Value object of type array with the specified |length|.
|
||||||
@@ -515,43 +589,37 @@ class CefV8Value : public virtual CefBase {
|
|||||||
virtual bool IsSame(CefRefPtr<CefV8Value> that) =0;
|
virtual bool IsSame(CefRefPtr<CefV8Value> that) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a bool value. The underlying data will be converted to if
|
// Return a bool value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual bool GetBoolValue() =0;
|
virtual bool GetBoolValue() =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an int value. The underlying data will be converted to if
|
// Return an int value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual int32 GetIntValue() =0;
|
virtual int32 GetIntValue() =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an unisgned int value. The underlying data will be converted to if
|
// Return an unsigned int value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual uint32 GetUIntValue() =0;
|
virtual uint32 GetUIntValue() =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a double value. The underlying data will be converted to if
|
// Return a double value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual double GetDoubleValue() =0;
|
virtual double GetDoubleValue() =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a Date value. The underlying data will be converted to if
|
// Return a Date value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual CefTime GetDateValue() =0;
|
virtual CefTime GetDateValue() =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a string value. The underlying data will be converted to if
|
// Return a string value.
|
||||||
// necessary.
|
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual CefString GetStringValue() =0;
|
virtual CefString GetStringValue() =0;
|
||||||
|
@@ -144,5 +144,71 @@ class CefWebPluginUnstableCallback : public virtual CefBase {
|
|||||||
void CefIsWebPluginUnstable(const CefString& path,
|
void CefIsWebPluginUnstable(const CefString& path,
|
||||||
CefRefPtr<CefWebPluginUnstableCallback> callback);
|
CefRefPtr<CefWebPluginUnstableCallback> callback);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Implement this interface to receive notification when CDM registration is
|
||||||
|
// complete. The methods of this class will be called on the browser process
|
||||||
|
// UI thread.
|
||||||
|
///
|
||||||
|
/*--cef(source=client)--*/
|
||||||
|
class CefRegisterCdmCallback : public virtual CefBase {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Method that will be called when CDM registration is complete. |result|
|
||||||
|
// will be CEF_CDM_REGISTRATION_ERROR_NONE if registration completed
|
||||||
|
// successfully. Otherwise, |result| and |error_message| will contain
|
||||||
|
// additional information about why registration failed.
|
||||||
|
///
|
||||||
|
/*--cef(optional_param=error_message)--*/
|
||||||
|
virtual void OnCdmRegistrationComplete(cef_cdm_registration_error_t result,
|
||||||
|
const CefString& error_message) =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// Register the Widevine CDM plugin.
|
||||||
|
//
|
||||||
|
// The client application is responsible for downloading an appropriate
|
||||||
|
// platform-specific CDM binary distribution from Google, extracting the
|
||||||
|
// contents, and building the required directory structure on the local machine.
|
||||||
|
// The CefBrowserHost::StartDownload method and CefZipArchive class can be used
|
||||||
|
// to implement this functionality in CEF. Contact Google via
|
||||||
|
// https://www.widevine.com/contact.html for details on CDM download.
|
||||||
|
//
|
||||||
|
// |path| is a directory that must contain the following files:
|
||||||
|
// 1. manifest.json file from the CDM binary distribution (see below).
|
||||||
|
// 2. widevinecdm file from the CDM binary distribution (e.g.
|
||||||
|
// widevinecdm.dll on on Windows, libwidevinecdm.dylib on OS X,
|
||||||
|
// libwidevinecdm.so on Linux).
|
||||||
|
// 3. widevidecdmadapter file from the CEF binary distribution (e.g.
|
||||||
|
// widevinecdmadapter.dll on Windows, widevinecdmadapter.plugin on OS X,
|
||||||
|
// libwidevinecdmadapter.so on Linux).
|
||||||
|
//
|
||||||
|
// If any of these files are missing or if the manifest file has incorrect
|
||||||
|
// contents the registration will fail and |callback| will receive a |result|
|
||||||
|
// value of CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS.
|
||||||
|
//
|
||||||
|
// The manifest.json file must contain the following keys:
|
||||||
|
// A. "os": Supported OS (e.g. "mac", "win" or "linux").
|
||||||
|
// B. "arch": Supported architecture (e.g. "ia32" or "x64").
|
||||||
|
// C. "x-cdm-module-versions": Module API version (e.g. "4").
|
||||||
|
// D. "x-cdm-interface-versions": Interface API version (e.g. "8").
|
||||||
|
// E. "x-cdm-host-versions": Host API version (e.g. "8").
|
||||||
|
// F. "version": CDM version (e.g. "1.4.8.903").
|
||||||
|
// G. "x-cdm-codecs": List of supported codecs (e.g. "vp8,vp9.0,avc1").
|
||||||
|
//
|
||||||
|
// A through E are used to verify compatibility with the current Chromium
|
||||||
|
// version. If the CDM is not compatible the registration will fail and
|
||||||
|
// |callback| will receive a |result| value of
|
||||||
|
// CEF_CDM_REGISTRATION_ERROR_INCOMPATIBLE.
|
||||||
|
//
|
||||||
|
// |callback| will be executed asynchronously once registration is complete.
|
||||||
|
//
|
||||||
|
// On Linux this function must be called before CefInitialize() and the
|
||||||
|
// registration cannot be changed during runtime. If registration is not
|
||||||
|
// supported at the time that CefRegisterWidevineCdm() is called then |callback|
|
||||||
|
// will receive a |result| value of CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED.
|
||||||
|
///
|
||||||
|
/*--cef(optional_param=callback)--*/
|
||||||
|
void CefRegisterWidevineCdm(const CefString& path,
|
||||||
|
CefRefPtr<CefRegisterCdmCallback> callback);
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CEF_WEB_PLUGIN_H_
|
#endif // CEF_INCLUDE_CEF_WEB_PLUGIN_H_
|
||||||
|
188
include/cef_x509_certificate.h
Normal file
188
include/cef_x509_certificate.h
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
// Copyright (c) 2016 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.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// The contents of this file must follow a specific format in order to
|
||||||
|
// support the CEF translator tool. See the translator.README.txt file in the
|
||||||
|
// tools directory for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_CEF_X509_CERTIFICATE_H_
|
||||||
|
#define CEF_INCLUDE_CEF_X509_CERTIFICATE_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "include/cef_base.h"
|
||||||
|
#include "include/cef_values.h"
|
||||||
|
|
||||||
|
///
|
||||||
|
// Class representing the issuer or subject field of an X.509 certificate.
|
||||||
|
///
|
||||||
|
/*--cef(source=library)--*/
|
||||||
|
class CefX509CertPrincipal : public virtual CefBase {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Returns a name that can be used to represent the issuer. It tries in this
|
||||||
|
// order: Common Name (CN), Organization Name (O) and Organizational Unit
|
||||||
|
// Name (OU) and returns the first non-empty one found.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefString GetDisplayName() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the common name.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefString GetCommonName() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the locality name.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefString GetLocalityName() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the state or province name.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefString GetStateOrProvinceName() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the country name.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefString GetCountryName() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Retrieve the list of street addresses.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual void GetStreetAddresses(std::vector<CefString>& addresses) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Retrieve the list of organization names.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual void GetOrganizationNames(std::vector<CefString>& names) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Retrieve the list of organization unit names.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual void GetOrganizationUnitNames(std::vector<CefString>& names) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Retrieve the list of domain components.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual void GetDomainComponents(std::vector<CefString>& components) =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// Class representing a X.509 certificate.
|
||||||
|
///
|
||||||
|
/*--cef(source=library)--*/
|
||||||
|
class CefX509Certificate : public virtual CefBase {
|
||||||
|
public:
|
||||||
|
typedef std::vector<CefRefPtr<CefBinaryValue> > IssuerChainBinaryList;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the subject of the X.509 certificate. For HTTPS server
|
||||||
|
// certificates this represents the web server. The common name of the
|
||||||
|
// subject should match the host name of the web server.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRefPtr<CefX509CertPrincipal> GetSubject() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the issuer of the X.509 certificate.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRefPtr<CefX509CertPrincipal> GetIssuer() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the DER encoded serial number for the X.509 certificate. The value
|
||||||
|
// possibly includes a leading 00 byte.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRefPtr<CefBinaryValue> GetSerialNumber() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the date before which the X.509 certificate is invalid.
|
||||||
|
// CefTime.GetTimeT() will return 0 if no date was specified.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefTime GetValidStart() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the date after which the X.509 certificate is invalid.
|
||||||
|
// CefTime.GetTimeT() will return 0 if no date was specified.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefTime GetValidExpiry() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the DER encoded data for the X.509 certificate.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRefPtr<CefBinaryValue> GetDEREncoded() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the PEM encoded data for the X.509 certificate.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRefPtr<CefBinaryValue> GetPEMEncoded() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the number of certificates in the issuer chain.
|
||||||
|
// If 0, the certificate is self-signed.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual size_t GetIssuerChainSize() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the DER encoded data for the certificate issuer chain.
|
||||||
|
// If we failed to encode a certificate in the chain it is still
|
||||||
|
// present in the array but is an empty string.
|
||||||
|
///
|
||||||
|
/*--cef(count_func=chain:GetIssuerChainSize)--*/
|
||||||
|
virtual void GetDEREncodedIssuerChain(IssuerChainBinaryList& chain) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the PEM encoded data for the certificate issuer chain.
|
||||||
|
// If we failed to encode a certificate in the chain it is still
|
||||||
|
// present in the array but is an empty string.
|
||||||
|
///
|
||||||
|
/*--cef(count_func=chain:GetIssuerChainSize)--*/
|
||||||
|
virtual void GetPEMEncodedIssuerChain(IssuerChainBinaryList& chain) =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_CEF_X509_CERTIFICATE_H_
|
@@ -376,6 +376,19 @@ typedef struct _cef_settings_t {
|
|||||||
///
|
///
|
||||||
int ignore_certificate_errors;
|
int ignore_certificate_errors;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set to true (1) to enable date-based expiration of built in network
|
||||||
|
// security information (i.e. certificate transparency logs, HSTS preloading
|
||||||
|
// and pinning information). Enabling this option improves network security
|
||||||
|
// but may cause HTTPS load failures when using CEF binaries built more than
|
||||||
|
// 10 weeks in the past. See https://www.certificate-transparency.org/ and
|
||||||
|
// https://www.chromium.org/hsts for details. Also configurable using the
|
||||||
|
// "enable-net-security-expiration" command-line switch. Can be overridden for
|
||||||
|
// individual CefRequestContext instances via the
|
||||||
|
// CefRequestContextSettings.enable_net_security_expiration value.
|
||||||
|
///
|
||||||
|
int enable_net_security_expiration;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Opaque background color used for accelerated content. By default the
|
// Opaque background color used for accelerated content. By default the
|
||||||
// background color will be white. Only the RGB compontents of the specified
|
// background color will be white. Only the RGB compontents of the specified
|
||||||
@@ -443,6 +456,17 @@ typedef struct _cef_request_context_settings_t {
|
|||||||
///
|
///
|
||||||
int ignore_certificate_errors;
|
int ignore_certificate_errors;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set to true (1) to enable date-based expiration of built in network
|
||||||
|
// security information (i.e. certificate transparency logs, HSTS preloading
|
||||||
|
// and pinning information). Enabling this option improves network security
|
||||||
|
// but may cause HTTPS load failures when using CEF binaries built more than
|
||||||
|
// 10 weeks in the past. See https://www.certificate-transparency.org/ and
|
||||||
|
// https://www.chromium.org/hsts for details. Can be set globally using the
|
||||||
|
// CefSettings.enable_net_security_expiration value.
|
||||||
|
///
|
||||||
|
int enable_net_security_expiration;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Comma delimited ordered list of language codes without any whitespace that
|
// Comma delimited ordered list of language codes without any whitespace that
|
||||||
// will be used in the "Accept-Language" HTTP header. Can be set globally
|
// will be used in the "Accept-Language" HTTP header. Can be set globally
|
||||||
@@ -2636,6 +2660,52 @@ typedef enum {
|
|||||||
CEF_MENU_ANCHOR_BOTTOMCENTER,
|
CEF_MENU_ANCHOR_BOTTOMCENTER,
|
||||||
} cef_menu_anchor_position_t;
|
} cef_menu_anchor_position_t;
|
||||||
|
|
||||||
|
// Supported SSL version values. See net/ssl/ssl_connection_status_flags.h
|
||||||
|
// for more information.
|
||||||
|
typedef enum {
|
||||||
|
SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version.
|
||||||
|
SSL_CONNECTION_VERSION_SSL2 = 1,
|
||||||
|
SSL_CONNECTION_VERSION_SSL3 = 2,
|
||||||
|
SSL_CONNECTION_VERSION_TLS1 = 3,
|
||||||
|
SSL_CONNECTION_VERSION_TLS1_1 = 4,
|
||||||
|
SSL_CONNECTION_VERSION_TLS1_2 = 5,
|
||||||
|
// Reserve 6 for TLS 1.3.
|
||||||
|
SSL_CONNECTION_VERSION_QUIC = 7,
|
||||||
|
} cef_ssl_version_t;
|
||||||
|
|
||||||
|
// Supported SSL content status flags. See content/public/common/ssl_status.h
|
||||||
|
// for more information.
|
||||||
|
typedef enum {
|
||||||
|
SSL_CONTENT_NORMAL_CONTENT = 0,
|
||||||
|
SSL_CONTENT_DISPLAYED_INSECURE_CONTENT = 1 << 0,
|
||||||
|
SSL_CONTENT_RAN_INSECURE_CONTENT = 1 << 1,
|
||||||
|
} cef_ssl_content_status_t;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Error codes for CDM registration. See cef_web_plugin.h for details.
|
||||||
|
///
|
||||||
|
typedef enum {
|
||||||
|
///
|
||||||
|
// No error. Registration completed successfully.
|
||||||
|
///
|
||||||
|
CEF_CDM_REGISTRATION_ERROR_NONE,
|
||||||
|
|
||||||
|
///
|
||||||
|
// Required files or manifest contents are missing.
|
||||||
|
///
|
||||||
|
CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS,
|
||||||
|
|
||||||
|
///
|
||||||
|
// The CDM is incompatible with the current Chromium version.
|
||||||
|
///
|
||||||
|
CEF_CDM_REGISTRATION_ERROR_INCOMPATIBLE,
|
||||||
|
|
||||||
|
///
|
||||||
|
// CDM registration is not supported at this time.
|
||||||
|
///
|
||||||
|
CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED,
|
||||||
|
} cef_cdm_registration_error_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -607,6 +607,8 @@ struct CefSettingsTraits {
|
|||||||
target->uncaught_exception_stack_size = src->uncaught_exception_stack_size;
|
target->uncaught_exception_stack_size = src->uncaught_exception_stack_size;
|
||||||
target->context_safety_implementation = src->context_safety_implementation;
|
target->context_safety_implementation = src->context_safety_implementation;
|
||||||
target->ignore_certificate_errors = src->ignore_certificate_errors;
|
target->ignore_certificate_errors = src->ignore_certificate_errors;
|
||||||
|
target->enable_net_security_expiration =
|
||||||
|
src->enable_net_security_expiration;
|
||||||
target->background_color = src->background_color;
|
target->background_color = src->background_color;
|
||||||
|
|
||||||
cef_string_set(src->accept_language_list.str,
|
cef_string_set(src->accept_language_list.str,
|
||||||
@@ -639,6 +641,8 @@ struct CefRequestContextSettingsTraits {
|
|||||||
target->persist_session_cookies = src->persist_session_cookies;
|
target->persist_session_cookies = src->persist_session_cookies;
|
||||||
target->persist_user_preferences = src->persist_user_preferences;
|
target->persist_user_preferences = src->persist_user_preferences;
|
||||||
target->ignore_certificate_errors = src->ignore_certificate_errors;
|
target->ignore_certificate_errors = src->ignore_certificate_errors;
|
||||||
|
target->enable_net_security_expiration =
|
||||||
|
src->enable_net_security_expiration;
|
||||||
cef_string_set(src->accept_language_list.str,
|
cef_string_set(src->accept_language_list.str,
|
||||||
src->accept_language_list.length, &target->accept_language_list, copy);
|
src->accept_language_list.length, &target->accept_language_list, copy);
|
||||||
}
|
}
|
||||||
|
@@ -893,6 +893,22 @@ void CefBrowserHostImpl::GetNavigationEntries(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefNavigationEntry> CefBrowserHostImpl::GetVisibleNavigationEntry() {
|
||||||
|
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||||
|
NOTREACHED() << "called on invalid thread";
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
content::NavigationEntry* entry = nullptr;
|
||||||
|
if (web_contents())
|
||||||
|
entry = web_contents()->GetController().GetVisibleEntry();
|
||||||
|
|
||||||
|
if (!entry)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
return new CefNavigationEntryImpl(entry);
|
||||||
|
}
|
||||||
|
|
||||||
void CefBrowserHostImpl::SetMouseCursorChangeDisabled(bool disabled) {
|
void CefBrowserHostImpl::SetMouseCursorChangeDisabled(bool disabled) {
|
||||||
base::AutoLock lock_scope(state_lock_);
|
base::AutoLock lock_scope(state_lock_);
|
||||||
mouse_cursor_change_disabled_ = disabled;
|
mouse_cursor_change_disabled_ = disabled;
|
||||||
|
@@ -218,6 +218,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||||||
void DragTargetDrop(const CefMouseEvent& event) override;
|
void DragTargetDrop(const CefMouseEvent& event) override;
|
||||||
void DragSourceSystemDragEnded() override;
|
void DragSourceSystemDragEnded() override;
|
||||||
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
||||||
|
CefRefPtr<CefNavigationEntry> GetVisibleNavigationEntry() override;
|
||||||
|
|
||||||
// CefBrowser methods.
|
// CefBrowser methods.
|
||||||
CefRefPtr<CefBrowserHost> GetHost() override;
|
CefRefPtr<CefBrowserHost> GetHost() override;
|
||||||
|
@@ -228,11 +228,6 @@ void CefBrowserMainParts::PostMainMessageLoopRun() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
global_browser_context_ = NULL;
|
global_browser_context_ = NULL;
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
// No CefBrowserContext instances should exist at this point.
|
|
||||||
DCHECK_EQ(0, CefBrowserContext::DebugObjCt);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserMainParts::PostDestroyThreads() {
|
void CefBrowserMainParts::PostDestroyThreads() {
|
||||||
@@ -240,9 +235,4 @@ void CefBrowserMainParts::PostDestroyThreads() {
|
|||||||
// Delete the DesktopTestViewsDelegate.
|
// Delete the DesktopTestViewsDelegate.
|
||||||
delete views::ViewsDelegate::GetInstance();
|
delete views::ViewsDelegate::GetInstance();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
// No CefURLRequestContext instances should exist at this point.
|
|
||||||
DCHECK_EQ(0, CefURLRequestContext::DebugObjCt);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@@ -41,7 +41,9 @@ class CefURLFetcherDelegate : public net::URLFetcherDelegate {
|
|||||||
// net::URLFetcherDelegate methods.
|
// net::URLFetcherDelegate methods.
|
||||||
void OnURLFetchComplete(const net::URLFetcher* source) override;
|
void OnURLFetchComplete(const net::URLFetcher* source) override;
|
||||||
void OnURLFetchDownloadProgress(const net::URLFetcher* source,
|
void OnURLFetchDownloadProgress(const net::URLFetcher* source,
|
||||||
int64 current, int64 total) override;
|
int64_t current,
|
||||||
|
int64_t total,
|
||||||
|
int64_t current_network_bytes) override;
|
||||||
void OnURLFetchUploadProgress(const net::URLFetcher* source,
|
void OnURLFetchUploadProgress(const net::URLFetcher* source,
|
||||||
int64 current, int64 total) override;
|
int64 current, int64 total) override;
|
||||||
|
|
||||||
@@ -402,7 +404,9 @@ void CefURLFetcherDelegate::OnURLFetchComplete(
|
|||||||
|
|
||||||
void CefURLFetcherDelegate::OnURLFetchDownloadProgress(
|
void CefURLFetcherDelegate::OnURLFetchDownloadProgress(
|
||||||
const net::URLFetcher* source,
|
const net::URLFetcher* source,
|
||||||
int64 current, int64 total) {
|
int64_t current,
|
||||||
|
int64_t total,
|
||||||
|
int64_t current_network_bytes) {
|
||||||
context_->OnDownloadProgress(current, total);
|
context_->OnDownloadProgress(current, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,33 +7,13 @@
|
|||||||
|
|
||||||
#include "libcef/browser/browser_context_impl.h"
|
#include "libcef/browser/browser_context_impl.h"
|
||||||
#include "libcef/browser/chrome_profile_manager_stub.h"
|
#include "libcef/browser/chrome_profile_manager_stub.h"
|
||||||
#include "libcef/browser/component_updater/cef_component_updater_configurator.h"
|
|
||||||
#include "libcef/browser/content_browser_client.h"
|
|
||||||
#include "libcef/browser/thread_util.h"
|
#include "libcef/browser/thread_util.h"
|
||||||
#include "libcef/common/cef_switches.h"
|
#include "libcef/common/cef_switches.h"
|
||||||
|
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/threading/thread_restrictions.h"
|
|
||||||
#include "chrome/browser/component_updater/widevine_cdm_component_installer.h"
|
|
||||||
#include "chrome/browser/printing/print_job_manager.h"
|
#include "chrome/browser/printing/print_job_manager.h"
|
||||||
#include "components/component_updater/component_updater_service.h"
|
|
||||||
#include "components/update_client/configurator.h"
|
|
||||||
#include "ui/message_center/message_center.h"
|
#include "ui/message_center/message_center.h"
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
void RegisterComponentsForUpdate(
|
|
||||||
component_updater::ComponentUpdateService* cus) {
|
|
||||||
base::ThreadRestrictions::ScopedAllowIO scoped_allow_io;
|
|
||||||
|
|
||||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
|
||||||
switches::kEnableWidevineCdm)) {
|
|
||||||
RegisterWidevineCdmComponent(cus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
ChromeBrowserProcessStub::ChromeBrowserProcessStub()
|
ChromeBrowserProcessStub::ChromeBrowserProcessStub()
|
||||||
: initialized_(false),
|
: initialized_(false),
|
||||||
shutdown_(false),
|
shutdown_(false),
|
||||||
@@ -57,19 +37,6 @@ void ChromeBrowserProcessStub::Initialize() {
|
|||||||
profile_manager_.reset(new ChromeProfileManagerStub());
|
profile_manager_.reset(new ChromeProfileManagerStub());
|
||||||
event_router_forwarder_ = new extensions::EventRouterForwarder();
|
event_router_forwarder_ = new extensions::EventRouterForwarder();
|
||||||
|
|
||||||
// Creating the component updater does not do anything initially. Components
|
|
||||||
// need to be registered and Start() needs to be called.
|
|
||||||
scoped_refptr<CefBrowserContextImpl> browser_context =
|
|
||||||
CefContentBrowserClient::Get()->browser_context();
|
|
||||||
scoped_refptr<update_client::Configurator> configurator =
|
|
||||||
component_updater::MakeCefComponentUpdaterConfigurator(
|
|
||||||
base::CommandLine::ForCurrentProcess(),
|
|
||||||
browser_context->request_context().get(),
|
|
||||||
browser_context->GetPrefs());
|
|
||||||
component_updater_.reset(component_updater::ComponentUpdateServiceFactory(
|
|
||||||
configurator).release());
|
|
||||||
RegisterComponentsForUpdate(component_updater_.get());
|
|
||||||
|
|
||||||
initialized_ = true;
|
initialized_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +53,6 @@ void ChromeBrowserProcessStub::Shutdown() {
|
|||||||
|
|
||||||
profile_manager_.reset();
|
profile_manager_.reset();
|
||||||
event_router_forwarder_ = nullptr;
|
event_router_forwarder_ = nullptr;
|
||||||
component_updater_.reset();
|
|
||||||
|
|
||||||
shutdown_ = true;
|
shutdown_ = true;
|
||||||
}
|
}
|
||||||
@@ -299,7 +265,8 @@ net_log::ChromeNetLog* ChromeBrowserProcessStub::net_log() {
|
|||||||
|
|
||||||
component_updater::ComponentUpdateService*
|
component_updater::ComponentUpdateService*
|
||||||
ChromeBrowserProcessStub::component_updater() {
|
ChromeBrowserProcessStub::component_updater() {
|
||||||
return component_updater_.get();
|
NOTIMPLEMENTED();
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CRLSetFetcher* ChromeBrowserProcessStub::crl_set_fetcher() {
|
CRLSetFetcher* ChromeBrowserProcessStub::crl_set_fetcher() {
|
||||||
|
@@ -17,10 +17,6 @@
|
|||||||
#include "chrome/browser/profiles/incognito_helpers.h"
|
#include "chrome/browser/profiles/incognito_helpers.h"
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
|
|
||||||
namespace component_updater {
|
|
||||||
class ComponentUpdateService;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ChromeProfileManagerStub;
|
class ChromeProfileManagerStub;
|
||||||
|
|
||||||
class BackgroundModeManager {
|
class BackgroundModeManager {
|
||||||
@@ -126,7 +122,6 @@ class ChromeBrowserProcessStub : public BrowserProcess,
|
|||||||
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
|
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
|
||||||
std::unique_ptr<ChromeProfileManagerStub> profile_manager_;
|
std::unique_ptr<ChromeProfileManagerStub> profile_manager_;
|
||||||
scoped_refptr<extensions::EventRouterForwarder> event_router_forwarder_;
|
scoped_refptr<extensions::EventRouterForwarder> event_router_forwarder_;
|
||||||
std::unique_ptr<component_updater::ComponentUpdateService> component_updater_;
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProcessStub);
|
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProcessStub);
|
||||||
};
|
};
|
||||||
|
@@ -1,182 +0,0 @@
|
|||||||
// Copyright 2014 The Chromium 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 "libcef/browser/component_updater/cef_component_updater_configurator.h"
|
|
||||||
#include "include/cef_version.h"
|
|
||||||
|
|
||||||
#include "base/version.h"
|
|
||||||
#include "chrome/common/pref_names.h"
|
|
||||||
#include "components/component_updater/configurator_impl.h"
|
|
||||||
#include "components/prefs/pref_registry_simple.h"
|
|
||||||
#include "components/prefs/pref_service.h"
|
|
||||||
#include "components/update_client/component_patcher_operation.h"
|
|
||||||
#include "content/public/browser/browser_thread.h"
|
|
||||||
|
|
||||||
namespace component_updater {
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
class CefConfigurator : public update_client::Configurator {
|
|
||||||
public:
|
|
||||||
CefConfigurator(const base::CommandLine* cmdline,
|
|
||||||
net::URLRequestContextGetter* url_request_getter,
|
|
||||||
PrefService* pref_service);
|
|
||||||
|
|
||||||
int InitialDelay() const override;
|
|
||||||
int NextCheckDelay() const override;
|
|
||||||
int StepDelay() const override;
|
|
||||||
int OnDemandDelay() const override;
|
|
||||||
int UpdateDelay() const override;
|
|
||||||
std::vector<GURL> UpdateUrl() const override;
|
|
||||||
std::vector<GURL> PingUrl() const override;
|
|
||||||
base::Version GetBrowserVersion() const override;
|
|
||||||
std::string GetChannel() const override;
|
|
||||||
std::string GetBrand() const override;
|
|
||||||
std::string GetLang() const override;
|
|
||||||
std::string GetOSLongName() const override;
|
|
||||||
std::string ExtraRequestParams() const override;
|
|
||||||
std::string GetDownloadPreference() const override;
|
|
||||||
net::URLRequestContextGetter* RequestContext() const override;
|
|
||||||
scoped_refptr<update_client::OutOfProcessPatcher>
|
|
||||||
CreateOutOfProcessPatcher() const override;
|
|
||||||
bool EnabledDeltas() const override;
|
|
||||||
bool EnabledComponentUpdates() const override;
|
|
||||||
bool EnabledBackgroundDownloader() const override;
|
|
||||||
bool EnabledCupSigning() const override;
|
|
||||||
scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner()
|
|
||||||
const override;
|
|
||||||
PrefService* GetPrefService() const override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class base::RefCountedThreadSafe<CefConfigurator>;
|
|
||||||
|
|
||||||
~CefConfigurator() override {}
|
|
||||||
|
|
||||||
ConfiguratorImpl configurator_impl_;
|
|
||||||
PrefService* pref_service_;
|
|
||||||
};
|
|
||||||
|
|
||||||
CefConfigurator::CefConfigurator(
|
|
||||||
const base::CommandLine* cmdline,
|
|
||||||
net::URLRequestContextGetter* url_request_getter,
|
|
||||||
PrefService* pref_service)
|
|
||||||
: configurator_impl_(cmdline, url_request_getter, false),
|
|
||||||
pref_service_(pref_service) {
|
|
||||||
DCHECK(pref_service_);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CefConfigurator::InitialDelay() const {
|
|
||||||
return configurator_impl_.InitialDelay();
|
|
||||||
}
|
|
||||||
|
|
||||||
int CefConfigurator::NextCheckDelay() const {
|
|
||||||
return configurator_impl_.NextCheckDelay();
|
|
||||||
}
|
|
||||||
|
|
||||||
int CefConfigurator::StepDelay() const {
|
|
||||||
return configurator_impl_.StepDelay();
|
|
||||||
}
|
|
||||||
|
|
||||||
int CefConfigurator::OnDemandDelay() const {
|
|
||||||
return configurator_impl_.OnDemandDelay();
|
|
||||||
}
|
|
||||||
|
|
||||||
int CefConfigurator::UpdateDelay() const {
|
|
||||||
return configurator_impl_.UpdateDelay();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<GURL> CefConfigurator::UpdateUrl() const {
|
|
||||||
return configurator_impl_.UpdateUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<GURL> CefConfigurator::PingUrl() const {
|
|
||||||
return configurator_impl_.PingUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
base::Version CefConfigurator::GetBrowserVersion() const {
|
|
||||||
return configurator_impl_.GetBrowserVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CefConfigurator::GetChannel() const {
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CefConfigurator::GetBrand() const {
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CefConfigurator::GetLang() const {
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CefConfigurator::GetOSLongName() const {
|
|
||||||
return configurator_impl_.GetOSLongName();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CefConfigurator::ExtraRequestParams() const {
|
|
||||||
return configurator_impl_.ExtraRequestParams();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CefConfigurator::GetDownloadPreference() const {
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
|
|
||||||
net::URLRequestContextGetter* CefConfigurator::RequestContext() const {
|
|
||||||
return configurator_impl_.RequestContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
scoped_refptr<update_client::OutOfProcessPatcher>
|
|
||||||
CefConfigurator::CreateOutOfProcessPatcher() const {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CefConfigurator::EnabledDeltas() const {
|
|
||||||
return configurator_impl_.EnabledDeltas();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CefConfigurator::EnabledComponentUpdates() const {
|
|
||||||
return pref_service_->GetBoolean(prefs::kComponentUpdatesEnabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CefConfigurator::EnabledBackgroundDownloader() const {
|
|
||||||
return configurator_impl_.EnabledBackgroundDownloader();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CefConfigurator::EnabledCupSigning() const {
|
|
||||||
return configurator_impl_.EnabledCupSigning();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns a task runner to run blocking tasks. The task runner continues to run
|
|
||||||
// after the browser shuts down, until the OS terminates the process. This
|
|
||||||
// imposes certain requirements for the code using the task runner, such as
|
|
||||||
// not accessing any global browser state while the code is running.
|
|
||||||
scoped_refptr<base::SequencedTaskRunner>
|
|
||||||
CefConfigurator::GetSequencedTaskRunner() const {
|
|
||||||
return content::BrowserThread::GetBlockingPool()
|
|
||||||
->GetSequencedTaskRunnerWithShutdownBehavior(
|
|
||||||
base::SequencedWorkerPool::GetSequenceToken(),
|
|
||||||
base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
|
|
||||||
}
|
|
||||||
|
|
||||||
PrefService* CefConfigurator::GetPrefService() const {
|
|
||||||
return pref_service_;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
void RegisterPrefsForCefComponentUpdaterConfigurator(
|
|
||||||
PrefRegistrySimple* registry) {
|
|
||||||
// The component updates are enabled by default, if the preference is not set.
|
|
||||||
registry->RegisterBooleanPref(prefs::kComponentUpdatesEnabled, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
scoped_refptr<update_client::Configurator>
|
|
||||||
MakeCefComponentUpdaterConfigurator(
|
|
||||||
const base::CommandLine* cmdline,
|
|
||||||
net::URLRequestContextGetter* context_getter,
|
|
||||||
PrefService* pref_service) {
|
|
||||||
return new CefConfigurator(cmdline, context_getter, pref_service);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace component_updater
|
|
@@ -1,39 +0,0 @@
|
|||||||
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef LIBCEF_BROWSER_COMPONENT_UPDATER_CEF_COMPONENT_UPDATER_CONFIGURATOR_H_
|
|
||||||
#define LIBCEF_BROWSER_COMPONENT_UPDATER_CEF_COMPONENT_UPDATER_CONFIGURATOR_H_
|
|
||||||
|
|
||||||
#include "base/memory/ref_counted.h"
|
|
||||||
#include "components/update_client/configurator.h"
|
|
||||||
|
|
||||||
namespace base {
|
|
||||||
class CommandLine;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace net {
|
|
||||||
class URLRequestContextGetter;
|
|
||||||
}
|
|
||||||
|
|
||||||
class PrefRegistrySimple;
|
|
||||||
class PrefService;
|
|
||||||
|
|
||||||
namespace component_updater {
|
|
||||||
|
|
||||||
// Registers preferences associated with the component updater configurator
|
|
||||||
// for CEF. The preferences must be registered with the local pref store
|
|
||||||
// before they can be queried by the configurator instance.
|
|
||||||
// This function is called before MakeCefComponentUpdaterConfigurator.
|
|
||||||
void RegisterPrefsForCefComponentUpdaterConfigurator(
|
|
||||||
PrefRegistrySimple* registry);
|
|
||||||
|
|
||||||
scoped_refptr<update_client::Configurator>
|
|
||||||
MakeCefComponentUpdaterConfigurator(
|
|
||||||
const base::CommandLine* cmdline,
|
|
||||||
net::URLRequestContextGetter* context_getter,
|
|
||||||
PrefService* pref_service);
|
|
||||||
|
|
||||||
} // namespace component_updater
|
|
||||||
|
|
||||||
#endif // LIBCEF_BROWSER_COMPONENT_UPDATER_CEF_COMPONENT_UPDATER_CONFIGURATOR_H_
|
|
@@ -27,6 +27,7 @@
|
|||||||
#include "libcef/browser/speech_recognition_manager_delegate.h"
|
#include "libcef/browser/speech_recognition_manager_delegate.h"
|
||||||
#include "libcef/browser/ssl_info_impl.h"
|
#include "libcef/browser/ssl_info_impl.h"
|
||||||
#include "libcef/browser/thread_util.h"
|
#include "libcef/browser/thread_util.h"
|
||||||
|
#include "libcef/browser/x509_certificate_impl.h"
|
||||||
#include "libcef/common/cef_messages.h"
|
#include "libcef/common/cef_messages.h"
|
||||||
#include "libcef/common/cef_switches.h"
|
#include "libcef/common/cef_switches.h"
|
||||||
#include "libcef/common/command_line_impl.h"
|
#include "libcef/common/command_line_impl.h"
|
||||||
@@ -75,6 +76,10 @@
|
|||||||
#include "ui/base/ui_base_switches.h"
|
#include "ui/base/ui_base_switches.h"
|
||||||
#include "url/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
|
#if defined(OS_LINUX)
|
||||||
|
#include "libcef/common/widevine_loader.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
#include "components/spellcheck/browser/spellcheck_message_filter_platform.h"
|
#include "components/spellcheck/browser/spellcheck_message_filter_platform.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -203,6 +208,58 @@ class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback {
|
|||||||
DISALLOW_COPY_AND_ASSIGN(CefAllowCertificateErrorCallbackImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefAllowCertificateErrorCallbackImpl);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CefSelectClientCertificateCallbackImpl :
|
||||||
|
public CefSelectClientCertificateCallback {
|
||||||
|
public:
|
||||||
|
explicit CefSelectClientCertificateCallbackImpl(
|
||||||
|
std::unique_ptr<content::ClientCertificateDelegate> delegate)
|
||||||
|
: delegate_(std::move(delegate)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
~CefSelectClientCertificateCallbackImpl() {
|
||||||
|
// If Select has not been called, call it with NULL to continue without any
|
||||||
|
// client certificate.
|
||||||
|
if (delegate_)
|
||||||
|
DoSelect(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Select(CefRefPtr<CefX509Certificate> cert) override {
|
||||||
|
if (delegate_)
|
||||||
|
DoSelect(cert);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void DoSelect(CefRefPtr<CefX509Certificate> cert) {
|
||||||
|
if (CEF_CURRENTLY_ON_UIT()) {
|
||||||
|
RunNow(std::move(delegate_), cert);
|
||||||
|
} else {
|
||||||
|
CEF_POST_TASK(CEF_UIT,
|
||||||
|
base::Bind(&CefSelectClientCertificateCallbackImpl::RunNow,
|
||||||
|
base::Passed(std::move(delegate_)), cert));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void RunNow(
|
||||||
|
std::unique_ptr<content::ClientCertificateDelegate> delegate,
|
||||||
|
CefRefPtr<CefX509Certificate> cert) {
|
||||||
|
CEF_REQUIRE_UIT();
|
||||||
|
|
||||||
|
scoped_refptr<net::X509Certificate> x509cert = NULL;
|
||||||
|
if (cert) {
|
||||||
|
CefX509CertificateImpl* certImpl =
|
||||||
|
static_cast<CefX509CertificateImpl*>(cert.get());
|
||||||
|
x509cert = certImpl->GetInternalCertObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate->ContinueWithCertificate(x509cert.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<content::ClientCertificateDelegate> delegate_;
|
||||||
|
|
||||||
|
IMPLEMENT_REFCOUNTING(CefSelectClientCertificateCallbackImpl);
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(CefSelectClientCertificateCallbackImpl);
|
||||||
|
};
|
||||||
|
|
||||||
class CefQuotaPermissionContext : public content::QuotaPermissionContext {
|
class CefQuotaPermissionContext : public content::QuotaPermissionContext {
|
||||||
public:
|
public:
|
||||||
CefQuotaPermissionContext() {
|
CefQuotaPermissionContext() {
|
||||||
@@ -574,8 +631,6 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
|
|||||||
switches::kPpapiFlashPath,
|
switches::kPpapiFlashPath,
|
||||||
switches::kPpapiFlashVersion,
|
switches::kPpapiFlashVersion,
|
||||||
switches::kUncaughtExceptionStackSize,
|
switches::kUncaughtExceptionStackSize,
|
||||||
switches::kWidevineCdmPath,
|
|
||||||
switches::kWidevineCdmVersion,
|
|
||||||
};
|
};
|
||||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
||||||
arraysize(kSwitchNames));
|
arraysize(kSwitchNames));
|
||||||
@@ -597,17 +652,25 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
|
|||||||
|
|
||||||
#if defined(OS_LINUX)
|
#if defined(OS_LINUX)
|
||||||
if (process_type == switches::kZygoteProcess) {
|
if (process_type == switches::kZygoteProcess) {
|
||||||
// Propagate the following switches to the zygone command line (along with
|
// Propagate the following switches to the zygote command line (along with
|
||||||
// any associated values) if present in the browser command line.
|
// any associated values) if present in the browser command line.
|
||||||
static const char* const kSwitchNames[] = {
|
static const char* const kSwitchNames[] = {
|
||||||
switches::kPpapiFlashPath,
|
switches::kPpapiFlashPath,
|
||||||
switches::kPpapiFlashVersion,
|
switches::kPpapiFlashVersion,
|
||||||
switches::kWidevineCdmPath,
|
|
||||||
switches::kWidevineCdmVersion,
|
|
||||||
};
|
};
|
||||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
||||||
arraysize(kSwitchNames));
|
arraysize(kSwitchNames));
|
||||||
|
|
||||||
|
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||||
|
if (!browser_cmd->HasSwitch(switches::kNoSandbox)) {
|
||||||
|
// Pass the Widevine CDM path to the Zygote process. See comments in
|
||||||
|
// CefWidevineLoader::AddPepperPlugins.
|
||||||
|
const base::FilePath& cdm_path = CefWidevineLoader::GetInstance()->path();
|
||||||
|
if (!cdm_path.empty())
|
||||||
|
command_line->AppendSwitchPath(switches::kWidevineCdmPath, cdm_path);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (browser_cmd->HasSwitch(switches::kBrowserSubprocessPath)) {
|
if (browser_cmd->HasSwitch(switches::kBrowserSubprocessPath)) {
|
||||||
// Force use of the sub-process executable path for the zygote process.
|
// Force use of the sub-process executable path for the zygote process.
|
||||||
const base::FilePath& subprocess_path =
|
const base::FilePath& subprocess_path =
|
||||||
@@ -701,9 +764,40 @@ void CefContentBrowserClient::SelectClientCertificate(
|
|||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
net::SSLCertRequestInfo* cert_request_info,
|
net::SSLCertRequestInfo* cert_request_info,
|
||||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
|
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
|
||||||
if (!cert_request_info->client_certs.empty()) {
|
CEF_REQUIRE_UIT();
|
||||||
// Use the first certificate.
|
|
||||||
delegate->ContinueWithCertificate(cert_request_info->client_certs[0].get());
|
CefRefPtr<CefRequestHandler> handler;
|
||||||
|
CefRefPtr<CefBrowserHostImpl> browser =
|
||||||
|
CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||||
|
if (browser.get()) {
|
||||||
|
CefRefPtr<CefClient> client = browser->GetClient();
|
||||||
|
if (client.get())
|
||||||
|
handler = client->GetRequestHandler();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!handler.get()) {
|
||||||
|
delegate->ContinueWithCertificate(NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRequestHandler::X509CertificateList certs;
|
||||||
|
for (std::vector<scoped_refptr<net::X509Certificate> >::iterator iter =
|
||||||
|
cert_request_info->client_certs.begin();
|
||||||
|
iter != cert_request_info->client_certs.end(); iter++) {
|
||||||
|
certs.push_back(new CefX509CertificateImpl(*iter));
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefSelectClientCertificateCallbackImpl> callbackImpl(
|
||||||
|
new CefSelectClientCertificateCallbackImpl(std::move(delegate)));
|
||||||
|
|
||||||
|
bool proceed = handler->OnSelectClientCertificate(
|
||||||
|
browser.get(), cert_request_info->is_proxy,
|
||||||
|
cert_request_info->host_and_port.host(),
|
||||||
|
cert_request_info->host_and_port.port(),
|
||||||
|
certs, callbackImpl.get());
|
||||||
|
|
||||||
|
if (!proceed && !certs.empty()) {
|
||||||
|
callbackImpl->Select(certs[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#include "libcef/browser/trace_subscriber.h"
|
#include "libcef/browser/trace_subscriber.h"
|
||||||
#include "libcef/common/cef_switches.h"
|
#include "libcef/common/cef_switches.h"
|
||||||
#include "libcef/common/main_delegate.h"
|
#include "libcef/common/main_delegate.h"
|
||||||
|
#include "libcef/common/widevine_loader.h"
|
||||||
#include "libcef/renderer/content_renderer_client.h"
|
#include "libcef/renderer/content_renderer_client.h"
|
||||||
|
|
||||||
#include "base/base_switches.h"
|
#include "base/base_switches.h"
|
||||||
@@ -367,6 +368,9 @@ void CefContext::PopulateRequestContextSettings(
|
|||||||
settings->ignore_certificate_errors =
|
settings->ignore_certificate_errors =
|
||||||
settings_.ignore_certificate_errors ||
|
settings_.ignore_certificate_errors ||
|
||||||
command_line->HasSwitch(switches::kIgnoreCertificateErrors);
|
command_line->HasSwitch(switches::kIgnoreCertificateErrors);
|
||||||
|
settings->enable_net_security_expiration =
|
||||||
|
settings_.enable_net_security_expiration ||
|
||||||
|
command_line->HasSwitch(switches::kEnableNetSecurityExpiration);
|
||||||
CefString(&settings->accept_language_list) =
|
CefString(&settings->accept_language_list) =
|
||||||
CefString(&settings_.accept_language_list);
|
CefString(&settings_.accept_language_list);
|
||||||
}
|
}
|
||||||
@@ -376,6 +380,10 @@ void CefContext::OnContextInitialized() {
|
|||||||
|
|
||||||
static_cast<ChromeBrowserProcessStub*>(g_browser_process)->Initialize();
|
static_cast<ChromeBrowserProcessStub*>(g_browser_process)->Initialize();
|
||||||
|
|
||||||
|
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||||
|
CefWidevineLoader::GetInstance()->OnContextInitialized();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Notify the handler.
|
// Notify the handler.
|
||||||
CefRefPtr<CefApp> app = CefContentClient::Get()->application();
|
CefRefPtr<CefApp> app = CefContentClient::Get()->application();
|
||||||
if (app.get()) {
|
if (app.get()) {
|
||||||
|
@@ -359,7 +359,7 @@ void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback(
|
|||||||
} else {
|
} else {
|
||||||
lister_.reset(new net::DirectoryLister(
|
lister_.reset(new net::DirectoryLister(
|
||||||
file_paths[0],
|
file_paths[0],
|
||||||
net::DirectoryLister::NO_SORT,
|
net::DirectoryLister::NO_SORT_RECURSIVE,
|
||||||
new UploadFolderHelper(
|
new UploadFolderHelper(
|
||||||
base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback,
|
base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback,
|
||||||
weak_ptr_factory_.GetWeakPtr(), mode))));
|
weak_ptr_factory_.GetWeakPtr(), mode))));
|
||||||
|
@@ -240,8 +240,12 @@ void CefFrameHostImpl::SendJavaScript(
|
|||||||
int startLine) {
|
int startLine) {
|
||||||
if (jsCode.empty())
|
if (jsCode.empty())
|
||||||
return;
|
return;
|
||||||
if (startLine < 0)
|
if (startLine <= 0) {
|
||||||
startLine = 0;
|
// A value of 0 is v8::Message::kNoLineNumberInfo in V8. There is code in
|
||||||
|
// V8 that will assert on that value (e.g. V8StackTraceImpl::Frame::Frame
|
||||||
|
// if a JS exception is thrown) so make sure |startLine| > 0.
|
||||||
|
startLine = 1;
|
||||||
|
}
|
||||||
|
|
||||||
CefRefPtr<CefBrowserHostImpl> browser;
|
CefRefPtr<CefBrowserHostImpl> browser;
|
||||||
int64 frame_id;
|
int64 frame_id;
|
||||||
|
@@ -70,18 +70,6 @@
|
|||||||
browser_ = browser;
|
browser_ = browser;
|
||||||
|
|
||||||
[window_ setDelegate:self];
|
[window_ setDelegate:self];
|
||||||
|
|
||||||
// Register for application hide/unhide notifications.
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
|
||||||
addObserver:self
|
|
||||||
selector:@selector(applicationDidHide:)
|
|
||||||
name:NSApplicationDidHideNotification
|
|
||||||
object:nil];
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
|
||||||
addObserver:self
|
|
||||||
selector:@selector(applicationDidUnhide:)
|
|
||||||
name:NSApplicationDidUnhideNotification
|
|
||||||
object:nil];
|
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "libcef/browser/navigation_entry_impl.h"
|
#include "libcef/browser/navigation_entry_impl.h"
|
||||||
|
|
||||||
|
#include "libcef/browser/ssl_status_impl.h"
|
||||||
#include "libcef/common/time_util.h"
|
#include "libcef/common/time_util.h"
|
||||||
|
|
||||||
#include "content/public/browser/navigation_entry.h"
|
#include "content/public/browser/navigation_entry.h"
|
||||||
@@ -62,3 +63,9 @@ int CefNavigationEntryImpl::GetHttpStatusCode() {
|
|||||||
CEF_VALUE_VERIFY_RETURN(false, 0);
|
CEF_VALUE_VERIFY_RETURN(false, 0);
|
||||||
return const_value().GetHttpStatusCode();
|
return const_value().GetHttpStatusCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefSSLStatus> CefNavigationEntryImpl::GetSSLStatus() {
|
||||||
|
CEF_VALUE_VERIFY_RETURN(false, nullptr);
|
||||||
|
return new CefSSLStatusImpl(const_value().GetSSL());
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -29,6 +29,7 @@ class CefNavigationEntryImpl
|
|||||||
bool HasPostData() override;
|
bool HasPostData() override;
|
||||||
CefTime GetCompletionTime() override;
|
CefTime GetCompletionTime() override;
|
||||||
int GetHttpStatusCode() override;
|
int GetHttpStatusCode() override;
|
||||||
|
CefRefPtr<CefSSLStatus> GetSSLStatus() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefNavigationEntryImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefNavigationEntryImpl);
|
||||||
|
@@ -34,6 +34,8 @@
|
|||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "content/public/common/url_constants.h"
|
#include "content/public/common/url_constants.h"
|
||||||
#include "net/cert/cert_verifier.h"
|
#include "net/cert/cert_verifier.h"
|
||||||
|
#include "net/cert/ct_known_logs.h"
|
||||||
|
#include "net/cert/ct_log_verifier.h"
|
||||||
#include "net/cert/ct_policy_enforcer.h"
|
#include "net/cert/ct_policy_enforcer.h"
|
||||||
#include "net/cert/multi_log_ct_verifier.h"
|
#include "net/cert/multi_log_ct_verifier.h"
|
||||||
#include "net/cookies/cookie_monster.h"
|
#include "net/cookies/cookie_monster.h"
|
||||||
@@ -47,8 +49,6 @@
|
|||||||
#include "net/http/http_util.h"
|
#include "net/http/http_util.h"
|
||||||
#include "net/http/transport_security_state.h"
|
#include "net/http/transport_security_state.h"
|
||||||
#include "net/proxy/proxy_service.h"
|
#include "net/proxy/proxy_service.h"
|
||||||
#include "net/ssl/channel_id_service.h"
|
|
||||||
#include "net/ssl/default_channel_id_store.h"
|
|
||||||
#include "net/ssl/ssl_config_service_defaults.h"
|
#include "net/ssl/ssl_config_service_defaults.h"
|
||||||
#include "url/url_constants.h"
|
#include "url/url_constants.h"
|
||||||
#include "net/url_request/http_user_agent_settings.h"
|
#include "net/url_request/http_user_agent_settings.h"
|
||||||
@@ -139,6 +139,18 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
|
|||||||
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
||||||
gsapi_library_name_ = pref_service->GetString(prefs::kGSSAPILibraryName);
|
gsapi_library_name_ = pref_service->GetString(prefs::kGSSAPILibraryName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
auth_server_whitelist_.Init(
|
||||||
|
prefs::kAuthServerWhitelist, pref_service,
|
||||||
|
base::Bind(&CefURLRequestContextGetterImpl::UpdateServerWhitelist,
|
||||||
|
base::Unretained(this)));
|
||||||
|
auth_server_whitelist_.MoveToThread(io_thread_proxy);
|
||||||
|
|
||||||
|
auth_negotiate_delegate_whitelist_.Init(
|
||||||
|
prefs::kAuthNegotiateDelegateWhitelist, pref_service,
|
||||||
|
base::Bind(&CefURLRequestContextGetterImpl::UpdateDelegateWhitelist,
|
||||||
|
base::Unretained(this)));
|
||||||
|
auth_negotiate_delegate_whitelist_.MoveToThread(io_thread_proxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
CefURLRequestContextGetterImpl::~CefURLRequestContextGetterImpl() {
|
CefURLRequestContextGetterImpl::~CefURLRequestContextGetterImpl() {
|
||||||
@@ -169,6 +181,8 @@ void CefURLRequestContextGetterImpl::ShutdownOnUIThread() {
|
|||||||
quick_check_enabled_.Destroy();
|
quick_check_enabled_.Destroy();
|
||||||
pac_https_url_stripping_enabled_.Destroy();
|
pac_https_url_stripping_enabled_.Destroy();
|
||||||
force_google_safesearch_.Destroy();
|
force_google_safesearch_.Destroy();
|
||||||
|
auth_server_whitelist_.Destroy();
|
||||||
|
auth_negotiate_delegate_whitelist_.Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
||||||
@@ -194,11 +208,6 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
|||||||
network_delegate->set_force_google_safesearch(&force_google_safesearch_);
|
network_delegate->set_force_google_safesearch(&force_google_safesearch_);
|
||||||
storage_->set_network_delegate(std::move(network_delegate));
|
storage_->set_network_delegate(std::move(network_delegate));
|
||||||
|
|
||||||
storage_->set_channel_id_service(base::WrapUnique(
|
|
||||||
new net::ChannelIDService(
|
|
||||||
new net::DefaultChannelIDStore(NULL),
|
|
||||||
base::WorkerPool::GetTaskRunner(true))));
|
|
||||||
|
|
||||||
const std::string& accept_language =
|
const std::string& accept_language =
|
||||||
settings_.accept_language_list.length > 0 ?
|
settings_.accept_language_list.length > 0 ?
|
||||||
CefString(&settings_.accept_language_list): "en-US,en";
|
CefString(&settings_.accept_language_list): "en-US,en";
|
||||||
@@ -207,12 +216,25 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
|||||||
|
|
||||||
storage_->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL));
|
storage_->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL));
|
||||||
storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
|
storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
|
||||||
storage_->set_transport_security_state(
|
|
||||||
base::WrapUnique(new net::TransportSecurityState));
|
std::unique_ptr<net::TransportSecurityState> transport_security_state(
|
||||||
storage_->set_cert_transparency_verifier(
|
new net::TransportSecurityState);
|
||||||
base::WrapUnique(new net::MultiLogCTVerifier));
|
transport_security_state->set_enforce_net_security_expiration(
|
||||||
storage_->set_ct_policy_enforcer(
|
settings_.enable_net_security_expiration ? true : false);
|
||||||
base::WrapUnique(new net::CTPolicyEnforcer));
|
storage_->set_transport_security_state(std::move(transport_security_state));
|
||||||
|
|
||||||
|
std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs(
|
||||||
|
net::ct::CreateLogVerifiersForKnownLogs());
|
||||||
|
std::unique_ptr<net::MultiLogCTVerifier> ct_verifier(
|
||||||
|
new net::MultiLogCTVerifier());
|
||||||
|
ct_verifier->AddLogs(ct_logs);
|
||||||
|
storage_->set_cert_transparency_verifier(std::move(ct_verifier));
|
||||||
|
|
||||||
|
std::unique_ptr<net::CTPolicyEnforcer> ct_policy_enforcer(
|
||||||
|
new net::CTPolicyEnforcer);
|
||||||
|
ct_policy_enforcer->set_enforce_net_security_expiration(
|
||||||
|
settings_.enable_net_security_expiration ? true : false);
|
||||||
|
storage_->set_ct_policy_enforcer(std::move(ct_policy_enforcer));
|
||||||
|
|
||||||
std::unique_ptr<net::ProxyService> system_proxy_service =
|
std::unique_ptr<net::ProxyService> system_proxy_service =
|
||||||
ProxyServiceFactory::CreateProxyService(
|
ProxyServiceFactory::CreateProxyService(
|
||||||
@@ -250,6 +272,10 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
|||||||
base::FilePath http_cache_path;
|
base::FilePath http_cache_path;
|
||||||
if (!cache_path.empty())
|
if (!cache_path.empty())
|
||||||
http_cache_path = cache_path.Append(FILE_PATH_LITERAL("Cache"));
|
http_cache_path = cache_path.Append(FILE_PATH_LITERAL("Cache"));
|
||||||
|
|
||||||
|
UpdateServerWhitelist();
|
||||||
|
UpdateDelegateWhitelist();
|
||||||
|
|
||||||
std::unique_ptr<net::HttpCache::DefaultBackend> main_backend(
|
std::unique_ptr<net::HttpCache::DefaultBackend> main_backend(
|
||||||
new net::HttpCache::DefaultBackend(
|
new net::HttpCache::DefaultBackend(
|
||||||
cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE,
|
cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE,
|
||||||
@@ -270,8 +296,6 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
|||||||
url_request_context_->cert_transparency_verifier();
|
url_request_context_->cert_transparency_verifier();
|
||||||
network_session_params.ct_policy_enforcer =
|
network_session_params.ct_policy_enforcer =
|
||||||
url_request_context_->ct_policy_enforcer();
|
url_request_context_->ct_policy_enforcer();
|
||||||
network_session_params.channel_id_service =
|
|
||||||
url_request_context_->channel_id_service();
|
|
||||||
network_session_params.proxy_service =
|
network_session_params.proxy_service =
|
||||||
url_request_context_->proxy_service();
|
url_request_context_->proxy_service();
|
||||||
network_session_params.ssl_config_service =
|
network_session_params.ssl_config_service =
|
||||||
@@ -433,3 +457,13 @@ void CefURLRequestContextGetterImpl::CreateProxyConfigService() {
|
|||||||
net::ProxyService::CreateSystemProxyConfigService(
|
net::ProxyService::CreateSystemProxyConfigService(
|
||||||
io_task_runner_, file_task_runner_);
|
io_task_runner_, file_task_runner_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefURLRequestContextGetterImpl::UpdateServerWhitelist() {
|
||||||
|
http_auth_preferences_->set_server_whitelist(
|
||||||
|
auth_server_whitelist_.GetValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefURLRequestContextGetterImpl::UpdateDelegateWhitelist() {
|
||||||
|
http_auth_preferences_->set_delegate_whitelist(
|
||||||
|
auth_negotiate_delegate_whitelist_.GetValue());
|
||||||
|
}
|
||||||
|
@@ -86,6 +86,8 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateProxyConfigService();
|
void CreateProxyConfigService();
|
||||||
|
void UpdateServerWhitelist();
|
||||||
|
void UpdateDelegateWhitelist();
|
||||||
|
|
||||||
const CefRequestContextSettings settings_;
|
const CefRequestContextSettings settings_;
|
||||||
|
|
||||||
@@ -116,6 +118,9 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
|
|||||||
// Member variables which are pointed to by the various context objects.
|
// Member variables which are pointed to by the various context objects.
|
||||||
mutable BooleanPrefMember force_google_safesearch_;
|
mutable BooleanPrefMember force_google_safesearch_;
|
||||||
|
|
||||||
|
StringPrefMember auth_server_whitelist_;
|
||||||
|
StringPrefMember auth_negotiate_delegate_whitelist_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextGetterImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextGetterImpl);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include "components/display_compositor/gl_helper.h"
|
#include "components/display_compositor/gl_helper.h"
|
||||||
#include "content/browser/bad_message.h"
|
#include "content/browser/bad_message.h"
|
||||||
#include "content/browser/compositor/image_transport_factory.h"
|
#include "content/browser/compositor/image_transport_factory.h"
|
||||||
|
#include "content/browser/frame_host/render_widget_host_view_guest.h"
|
||||||
#include "content/browser/renderer_host/dip_util.h"
|
#include "content/browser/renderer_host/dip_util.h"
|
||||||
#include "content/browser/renderer_host/render_widget_host_delegate.h"
|
#include "content/browser/renderer_host/render_widget_host_delegate.h"
|
||||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||||
@@ -474,6 +475,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
|
|||||||
#endif
|
#endif
|
||||||
weak_ptr_factory_(this) {
|
weak_ptr_factory_(this) {
|
||||||
DCHECK(render_widget_host_);
|
DCHECK(render_widget_host_);
|
||||||
|
DCHECK(!render_widget_host_->GetView());
|
||||||
render_widget_host_->SetView(this);
|
render_widget_host_->SetView(this);
|
||||||
|
|
||||||
// CefBrowserHostImpl might not be created at this time for popups.
|
// CefBrowserHostImpl might not be created at this time for popups.
|
||||||
@@ -1157,13 +1159,7 @@ void CefRenderWidgetHostViewOSR::Invalidate(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gfx::Rect& bounds_in_pixels = gfx::Rect(GetPhysicalBackingSize());
|
InvalidateInternal(gfx::Rect(GetPhysicalBackingSize()));
|
||||||
|
|
||||||
if (software_output_device_) {
|
|
||||||
software_output_device_->OnPaint(bounds_in_pixels);
|
|
||||||
} else if (copy_frame_generator_.get()) {
|
|
||||||
copy_frame_generator_->GenerateCopyFrame(true, bounds_in_pixels);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::SendKeyEvent(
|
void CefRenderWidgetHostViewOSR::SendKeyEvent(
|
||||||
@@ -1317,6 +1313,14 @@ void CefRenderWidgetHostViewOSR::RemoveGuestHostView(
|
|||||||
guest_host_views_.erase(guest_host);
|
guest_host_views_.erase(guest_host);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefRenderWidgetHostViewOSR::RegisterGuestViewFrameSwappedCallback(
|
||||||
|
content::RenderWidgetHostViewGuest* guest_host_view) {
|
||||||
|
guest_host_view->RegisterFrameSwappedCallback(base::MakeUnique<base::Closure>(
|
||||||
|
base::Bind(&CefRenderWidgetHostViewOSR::OnGuestViewFrameSwapped,
|
||||||
|
weak_ptr_factory_.GetWeakPtr(),
|
||||||
|
base::Unretained(guest_host_view))));
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_MACOSX)
|
||||||
|
|
||||||
ui::Compositor* CefRenderWidgetHostViewOSR::GetCompositor() const {
|
ui::Compositor* CefRenderWidgetHostViewOSR::GetCompositor() const {
|
||||||
@@ -1501,3 +1505,20 @@ void CefRenderWidgetHostViewOSR::OnScrollOffsetChanged() {
|
|||||||
}
|
}
|
||||||
is_scroll_offset_changed_pending_ = false;
|
is_scroll_offset_changed_pending_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefRenderWidgetHostViewOSR::OnGuestViewFrameSwapped(
|
||||||
|
content::RenderWidgetHostViewGuest* guest_host_view) {
|
||||||
|
InvalidateInternal(
|
||||||
|
gfx::ConvertRectToPixel(scale_factor_, guest_host_view->GetViewBounds()));
|
||||||
|
|
||||||
|
RegisterGuestViewFrameSwappedCallback(guest_host_view);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefRenderWidgetHostViewOSR::InvalidateInternal(
|
||||||
|
const gfx::Rect& bounds_in_pixels) {
|
||||||
|
if (software_output_device_) {
|
||||||
|
software_output_device_->OnPaint(bounds_in_pixels);
|
||||||
|
} else if (copy_frame_generator_.get()) {
|
||||||
|
copy_frame_generator_->GenerateCopyFrame(true, bounds_in_pixels);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
namespace content {
|
namespace content {
|
||||||
class RenderWidgetHost;
|
class RenderWidgetHost;
|
||||||
class RenderWidgetHostImpl;
|
class RenderWidgetHostImpl;
|
||||||
|
class RenderWidgetHostViewGuest;
|
||||||
class BackingStore;
|
class BackingStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,6 +253,11 @@ class CefRenderWidgetHostViewOSR
|
|||||||
void AddGuestHostView(CefRenderWidgetHostViewOSR* guest_host);
|
void AddGuestHostView(CefRenderWidgetHostViewOSR* guest_host);
|
||||||
void RemoveGuestHostView(CefRenderWidgetHostViewOSR* guest_host);
|
void RemoveGuestHostView(CefRenderWidgetHostViewOSR* guest_host);
|
||||||
|
|
||||||
|
// Register a callback that will be executed when |guest_host_view| receives
|
||||||
|
// OnSwapCompositorFrame. The callback triggers repaint of the embedder view.
|
||||||
|
void RegisterGuestViewFrameSwappedCallback(
|
||||||
|
content::RenderWidgetHostViewGuest* guest_host_view);
|
||||||
|
|
||||||
CefRefPtr<CefBrowserHostImpl> browser_impl() const { return browser_impl_; }
|
CefRefPtr<CefBrowserHostImpl> browser_impl() const { return browser_impl_; }
|
||||||
void set_browser_impl(CefRefPtr<CefBrowserHostImpl> browser) {
|
void set_browser_impl(CefRefPtr<CefBrowserHostImpl> browser) {
|
||||||
browser_impl_ = browser;
|
browser_impl_ = browser;
|
||||||
@@ -285,6 +291,11 @@ class CefRenderWidgetHostViewOSR
|
|||||||
|
|
||||||
void OnScrollOffsetChanged();
|
void OnScrollOffsetChanged();
|
||||||
|
|
||||||
|
void OnGuestViewFrameSwapped(
|
||||||
|
content::RenderWidgetHostViewGuest* guest_host_view);
|
||||||
|
|
||||||
|
void InvalidateInternal(const gfx::Rect& bounds_in_pixels);
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
friend class MacHelper;
|
friend class MacHelper;
|
||||||
|
|
||||||
|
@@ -152,7 +152,7 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
|
|||||||
void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(const gfx::Size& size) {
|
void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(const gfx::Size& size) {
|
||||||
DCHECK(window_);
|
DCHECK(window_);
|
||||||
SetWindowPos(window_->hwnd(), NULL, 0, 0, size.width(), size.height(),
|
SetWindowPos(window_->hwnd(), NULL, 0, 0, size.width(), size.height(),
|
||||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW);
|
SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
|
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
|
||||||
|
@@ -82,6 +82,12 @@ extern "C" {
|
|||||||
return validAttributesForMarkedText_.get();
|
return validAttributesForMarkedText_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSRange)selectedRange {
|
||||||
|
if (selectedRange_.location == NSNotFound || selectedRange_.length == 0)
|
||||||
|
return NSMakeRange(NSNotFound, 0);
|
||||||
|
return selectedRange_;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSRange)markedRange {
|
- (NSRange)markedRange {
|
||||||
return hasMarkedText_ ?
|
return hasMarkedText_ ?
|
||||||
renderWidgetHostView_->composition_range().ToNSRange() :
|
renderWidgetHostView_->composition_range().ToNSRange() :
|
||||||
@@ -197,7 +203,14 @@ extern "C" {
|
|||||||
- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)range
|
- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)range
|
||||||
actualRange:(NSRangePointer)actualRange {
|
actualRange:(NSRangePointer)actualRange {
|
||||||
if (actualRange)
|
if (actualRange)
|
||||||
*actualRange = range;
|
*actualRange = NSMakeRange(NSNotFound, 0);
|
||||||
|
|
||||||
|
// The caller of this method is allowed to pass nonsensical ranges. These
|
||||||
|
// can't even be converted into gfx::Ranges.
|
||||||
|
if (range.location == NSNotFound || range.length == 0)
|
||||||
|
return nil;
|
||||||
|
if (range.length >= std::numeric_limits<NSUInteger>::max() - range.location)
|
||||||
|
return nil;
|
||||||
|
|
||||||
const gfx::Range requested_range(range);
|
const gfx::Range requested_range(range);
|
||||||
if (requested_range.is_reversed())
|
if (requested_range.is_reversed())
|
||||||
@@ -215,15 +228,16 @@ extern "C" {
|
|||||||
expected_range = gfx::Range(offset, offset + expected_text->size());
|
expected_range = gfx::Range(offset, offset + expected_text->size());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!expected_range.Contains(requested_range))
|
gfx::Range actual_range = expected_range.Intersect(requested_range);
|
||||||
|
if (!actual_range.IsValid())
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
// Gets the raw bytes to avoid unnecessary string copies for generating
|
// Gets the raw bytes to avoid unnecessary string copies for generating
|
||||||
// NSString.
|
// NSString.
|
||||||
const base::char16* bytes =
|
const base::char16* bytes =
|
||||||
&(*expected_text)[requested_range.start() - expected_range.start()];
|
&(*expected_text)[actual_range.start() - expected_range.start()];
|
||||||
// Avoid integer overflow.
|
// Avoid integer overflow.
|
||||||
base::CheckedNumeric<size_t> requested_len = requested_range.length();
|
base::CheckedNumeric<size_t> requested_len = actual_range.length();
|
||||||
requested_len *= sizeof(base::char16);
|
requested_len *= sizeof(base::char16);
|
||||||
NSUInteger bytes_len = base::strict_cast<NSUInteger, size_t>(
|
NSUInteger bytes_len = base::strict_cast<NSUInteger, size_t>(
|
||||||
requested_len.ValueOrDefault(0));
|
requested_len.ValueOrDefault(0));
|
||||||
@@ -231,6 +245,9 @@ extern "C" {
|
|||||||
[[NSString alloc] initWithBytes:bytes
|
[[NSString alloc] initWithBytes:bytes
|
||||||
length:bytes_len
|
length:bytes_len
|
||||||
encoding:NSUTF16LittleEndianStringEncoding]);
|
encoding:NSUTF16LittleEndianStringEncoding]);
|
||||||
|
if (actualRange)
|
||||||
|
*actualRange = actual_range.ToNSRange();
|
||||||
|
|
||||||
return [[[NSAttributedString alloc] initWithString:ns_string] autorelease];
|
return [[[NSAttributedString alloc] initWithString:ns_string] autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -139,10 +139,13 @@ content::RenderWidgetHostViewBase* CefWebContentsViewOSR::CreateViewForWidget(
|
|||||||
embedder_host_view);
|
embedder_host_view);
|
||||||
embedder_host_view->AddGuestHostView(platform_widget);
|
embedder_host_view->AddGuestHostView(platform_widget);
|
||||||
|
|
||||||
return new content::RenderWidgetHostViewGuest(
|
content::RenderWidgetHostViewGuest* guest_host_view =
|
||||||
render_widget_host,
|
new content::RenderWidgetHostViewGuest(
|
||||||
guest_,
|
render_widget_host,
|
||||||
platform_widget->GetWeakPtr());
|
guest_,
|
||||||
|
platform_widget->GetWeakPtr());
|
||||||
|
embedder_host_view->RegisterGuestViewFrameSwappedCallback(guest_host_view);
|
||||||
|
return guest_host_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
view_ = new CefRenderWidgetHostViewOSR(transparent_, render_widget_host,
|
view_ = new CefRenderWidgetHostViewOSR(transparent_, render_widget_host,
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include "libcef/browser/prefs/browser_prefs.h"
|
#include "libcef/browser/prefs/browser_prefs.h"
|
||||||
|
|
||||||
#include "libcef/browser/component_updater/cef_component_updater_configurator.h"
|
|
||||||
#include "libcef/browser/media_capture_devices_dispatcher.h"
|
#include "libcef/browser/media_capture_devices_dispatcher.h"
|
||||||
#include "libcef/browser/net/url_request_context_getter_impl.h"
|
#include "libcef/browser/net/url_request_context_getter_impl.h"
|
||||||
#include "libcef/browser/prefs/renderer_prefs.h"
|
#include "libcef/browser/prefs/renderer_prefs.h"
|
||||||
@@ -28,12 +27,13 @@
|
|||||||
#include "components/prefs/pref_filter.h"
|
#include "components/prefs/pref_filter.h"
|
||||||
#include "components/prefs/pref_registry_simple.h"
|
#include "components/prefs/pref_registry_simple.h"
|
||||||
#include "components/prefs/pref_service.h"
|
#include "components/prefs/pref_service.h"
|
||||||
#include "components/prefs/pref_service_factory.h"
|
|
||||||
#include "components/prefs/testing_pref_store.h"
|
#include "components/prefs/testing_pref_store.h"
|
||||||
#include "components/pref_registry/pref_registry_syncable.h"
|
#include "components/pref_registry/pref_registry_syncable.h"
|
||||||
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
|
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
|
||||||
#include "components/proxy_config/proxy_config_dictionary.h"
|
#include "components/proxy_config/proxy_config_dictionary.h"
|
||||||
#include "components/spellcheck/browser/pref_names.h"
|
#include "components/spellcheck/browser/pref_names.h"
|
||||||
|
#include "components/syncable_prefs/pref_service_syncable.h"
|
||||||
|
#include "components/syncable_prefs/pref_service_syncable_factory.h"
|
||||||
#include "components/update_client/update_client.h"
|
#include "components/update_client/update_client.h"
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "extensions/browser/extension_prefs.h"
|
#include "extensions/browser/extension_prefs.h"
|
||||||
@@ -99,7 +99,9 @@ std::unique_ptr<PrefService> CreatePrefService(
|
|||||||
const base::CommandLine* command_line =
|
const base::CommandLine* command_line =
|
||||||
base::CommandLine::ForCurrentProcess();
|
base::CommandLine::ForCurrentProcess();
|
||||||
|
|
||||||
PrefServiceFactory factory;
|
// Use of PrefServiceSyncable is required by Chrome code such as
|
||||||
|
// HostContentSettingsMapFactory that calls PrefServiceSyncableFromProfile.
|
||||||
|
syncable_prefs::PrefServiceSyncableFactory factory;
|
||||||
|
|
||||||
// Used to store command-line preferences, most of which will be evaluated in
|
// Used to store command-line preferences, most of which will be evaluated in
|
||||||
// the CommandLinePrefStore constructor. Preferences set in this manner cannot
|
// the CommandLinePrefStore constructor. Preferences set in this manner cannot
|
||||||
@@ -143,7 +145,7 @@ std::unique_ptr<PrefService> CreatePrefService(
|
|||||||
|
|
||||||
if (store_on_disk) {
|
if (store_on_disk) {
|
||||||
supervised_user_settings->Init(
|
supervised_user_settings->Init(
|
||||||
cache_path, sequenced_task_runner.get(), false);
|
cache_path, sequenced_task_runner.get(), true);
|
||||||
} else {
|
} else {
|
||||||
scoped_refptr<TestingPrefStore> testing_pref_store = new TestingPrefStore();
|
scoped_refptr<TestingPrefStore> testing_pref_store = new TestingPrefStore();
|
||||||
testing_pref_store->SetInitializationCompleted();
|
testing_pref_store->SetInitializationCompleted();
|
||||||
@@ -170,8 +172,6 @@ std::unique_ptr<PrefService> CreatePrefService(
|
|||||||
renderer_prefs::RegisterProfilePrefs(registry.get());
|
renderer_prefs::RegisterProfilePrefs(registry.get());
|
||||||
update_client::RegisterPrefs(registry.get());
|
update_client::RegisterPrefs(registry.get());
|
||||||
content_settings::CookieSettings::RegisterProfilePrefs(registry.get());
|
content_settings::CookieSettings::RegisterProfilePrefs(registry.get());
|
||||||
component_updater::RegisterPrefsForCefComponentUpdaterConfigurator(
|
|
||||||
registry.get());
|
|
||||||
|
|
||||||
// Print preferences.
|
// Print preferences.
|
||||||
registry->RegisterBooleanPref(prefs::kPrintingEnabled, true);
|
registry->RegisterBooleanPref(prefs::kPrintingEnabled, true);
|
||||||
@@ -194,12 +194,19 @@ std::unique_ptr<PrefService> CreatePrefService(
|
|||||||
registry->RegisterBooleanPref(
|
registry->RegisterBooleanPref(
|
||||||
spellcheck::prefs::kSpellCheckUseSpellingService,
|
spellcheck::prefs::kSpellCheckUseSpellingService,
|
||||||
command_line->HasSwitch(switches::kEnableSpellingService));
|
command_line->HasSwitch(switches::kEnableSpellingService));
|
||||||
|
registry->RegisterBooleanPref(
|
||||||
|
spellcheck::prefs::kEnableSpellcheck,
|
||||||
|
!command_line->HasSwitch(switches::kDisableSpellChecking));
|
||||||
|
|
||||||
// Pepper flash preferences.
|
// Pepper flash preferences.
|
||||||
// Based on DeviceIDFetcher::RegisterProfilePrefs.
|
// Based on DeviceIDFetcher::RegisterProfilePrefs.
|
||||||
registry->RegisterBooleanPref(prefs::kEnableDRM, false);
|
registry->RegisterBooleanPref(prefs::kEnableDRM, false);
|
||||||
registry->RegisterStringPref(prefs::kDRMSalt, "");
|
registry->RegisterStringPref(prefs::kDRMSalt, "");
|
||||||
|
|
||||||
|
// Authentication preferences.
|
||||||
|
registry->RegisterStringPref(prefs::kAuthServerWhitelist, "");
|
||||||
|
registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, "");
|
||||||
|
|
||||||
// Plugin preferences.
|
// Plugin preferences.
|
||||||
// Based on chrome::RegisterBrowserUserPrefs.
|
// Based on chrome::RegisterBrowserUserPrefs.
|
||||||
registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false);
|
registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false);
|
||||||
@@ -231,7 +238,7 @@ std::unique_ptr<PrefService> CreatePrefService(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build the PrefService that manages the PrefRegistry and PrefStores.
|
// Build the PrefService that manages the PrefRegistry and PrefStores.
|
||||||
return factory.Create(registry.get());
|
return factory.CreateSyncable(registry.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace browser_prefs
|
} // namespace browser_prefs
|
||||||
|
@@ -3,121 +3,30 @@
|
|||||||
// can be found in the LICENSE file.
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
#include "libcef/browser/ssl_info_impl.h"
|
#include "libcef/browser/ssl_info_impl.h"
|
||||||
#include "libcef/browser/ssl_cert_principal_impl.h"
|
#include "libcef/browser/x509_certificate_impl.h"
|
||||||
#include "libcef/common/time_util.h"
|
|
||||||
|
|
||||||
#include "net/cert/cert_status_flags.h"
|
#include "net/cert/cert_status_flags.h"
|
||||||
#include "net/cert/x509_certificate.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
void EncodeCertificate(
|
|
||||||
const net::X509Certificate::OSCertHandle& os_handle,
|
|
||||||
CefRefPtr<CefBinaryValue>& der_encoded,
|
|
||||||
CefRefPtr<CefBinaryValue>& pem_encoded) {
|
|
||||||
std::string encoded;
|
|
||||||
if (net::X509Certificate::GetDEREncoded(os_handle, &encoded)) {
|
|
||||||
der_encoded = CefBinaryValue::Create(encoded.c_str(),
|
|
||||||
encoded.size());
|
|
||||||
}
|
|
||||||
encoded.clear();
|
|
||||||
if (net::X509Certificate::GetPEMEncoded(os_handle, &encoded)) {
|
|
||||||
pem_encoded = CefBinaryValue::Create(encoded.c_str(),
|
|
||||||
encoded.size());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
CefSSLInfoImpl::CefSSLInfoImpl(const net::SSLInfo& value)
|
CefSSLInfoImpl::CefSSLInfoImpl(const net::SSLInfo& value)
|
||||||
: cert_status_(CERT_STATUS_NONE) {
|
: cert_status_(CERT_STATUS_NONE) {
|
||||||
|
cert_status_ = static_cast<cef_cert_status_t>(value.cert_status);
|
||||||
if (value.cert.get()) {
|
if (value.cert.get()) {
|
||||||
cert_status_ = static_cast<cef_cert_status_t>(value.cert_status);
|
cert_ = new CefX509CertificateImpl(value.cert);
|
||||||
|
|
||||||
subject_ = new CefSSLCertPrincipalImpl(value.cert->subject());
|
|
||||||
issuer_ = new CefSSLCertPrincipalImpl(value.cert->issuer());
|
|
||||||
|
|
||||||
const std::string& serial_number = value.cert->serial_number();
|
|
||||||
serial_number_ = CefBinaryValue::Create(serial_number.c_str(),
|
|
||||||
serial_number.size());
|
|
||||||
|
|
||||||
const base::Time& valid_start = value.cert->valid_start();
|
|
||||||
if (!valid_start.is_null())
|
|
||||||
cef_time_from_basetime(valid_start, valid_start_);
|
|
||||||
|
|
||||||
const base::Time& valid_expiry = value.cert->valid_expiry();
|
|
||||||
if (!valid_expiry.is_null())
|
|
||||||
cef_time_from_basetime(valid_expiry, valid_expiry_);
|
|
||||||
|
|
||||||
net::X509Certificate::OSCertHandle os_handle = value.cert->os_cert_handle();
|
|
||||||
if (os_handle)
|
|
||||||
EncodeCertificate(os_handle, der_encoded_, pem_encoded_);
|
|
||||||
|
|
||||||
const net::X509Certificate::OSCertHandles& issuer_chain =
|
|
||||||
value.cert->GetIntermediateCertificates();
|
|
||||||
for (net::X509Certificate::OSCertHandles::const_iterator it =
|
|
||||||
issuer_chain.begin(); it != issuer_chain.end(); it++) {
|
|
||||||
CefRefPtr<CefBinaryValue> der_encoded, pem_encoded;
|
|
||||||
EncodeCertificate(*it, der_encoded, pem_encoded);
|
|
||||||
|
|
||||||
// Add each to the chain, even if one conversion unexpectedly failed.
|
|
||||||
// GetIssuerChainSize depends on these being the same length.
|
|
||||||
der_encoded_issuer_chain_.push_back(der_encoded);
|
|
||||||
pem_encoded_issuer_chain_.push_back(pem_encoded);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cef_cert_status_t CefSSLInfoImpl::GetCertStatus() {
|
cef_cert_status_t CefSSLInfoImpl::GetCertStatus() {
|
||||||
return cert_status_;
|
return cert_status_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefSSLInfoImpl::IsCertStatusError() {
|
CefRefPtr<CefX509Certificate> CefSSLInfoImpl::GetX509Certificate() {
|
||||||
return net::IsCertStatusError(cert_status_);
|
return cert_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefSSLInfoImpl::IsCertStatusMinorError() {
|
bool CefIsCertStatusError(cef_cert_status_t status) {
|
||||||
return net::IsCertStatusMinorError(cert_status_);
|
return net::IsCertStatusError(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefSSLCertPrincipal> CefSSLInfoImpl::GetSubject() {
|
bool CefIsCertStatusMinorError(cef_cert_status_t status) {
|
||||||
return subject_;
|
return net::IsCertStatusMinorError(status);
|
||||||
}
|
|
||||||
|
|
||||||
CefRefPtr<CefSSLCertPrincipal> CefSSLInfoImpl::GetIssuer() {
|
|
||||||
return issuer_;
|
|
||||||
}
|
|
||||||
|
|
||||||
CefRefPtr<CefBinaryValue> CefSSLInfoImpl::GetSerialNumber() {
|
|
||||||
return serial_number_;
|
|
||||||
}
|
|
||||||
|
|
||||||
CefTime CefSSLInfoImpl::GetValidStart() {
|
|
||||||
return valid_start_;
|
|
||||||
}
|
|
||||||
|
|
||||||
CefTime CefSSLInfoImpl::GetValidExpiry() {
|
|
||||||
return valid_expiry_;
|
|
||||||
}
|
|
||||||
|
|
||||||
CefRefPtr<CefBinaryValue> CefSSLInfoImpl::GetDEREncoded() {
|
|
||||||
return der_encoded_;
|
|
||||||
}
|
|
||||||
|
|
||||||
CefRefPtr<CefBinaryValue> CefSSLInfoImpl::GetPEMEncoded() {
|
|
||||||
return pem_encoded_;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t CefSSLInfoImpl::GetIssuerChainSize() {
|
|
||||||
return der_encoded_issuer_chain_.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefSSLInfoImpl::GetDEREncodedIssuerChain(
|
|
||||||
CefSSLInfo::IssuerChainBinaryList& chain) {
|
|
||||||
chain = der_encoded_issuer_chain_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefSSLInfoImpl::GetPEMEncodedIssuerChain(
|
|
||||||
CefSSLInfo::IssuerChainBinaryList& chain) {
|
|
||||||
chain = pem_encoded_issuer_chain_;
|
|
||||||
}
|
}
|
||||||
|
@@ -17,30 +17,11 @@ class CefSSLInfoImpl : public CefSSLInfo {
|
|||||||
|
|
||||||
// CefSSLInfo methods.
|
// CefSSLInfo methods.
|
||||||
cef_cert_status_t GetCertStatus() override;
|
cef_cert_status_t GetCertStatus() override;
|
||||||
bool IsCertStatusError() override;
|
CefRefPtr<CefX509Certificate> GetX509Certificate() override;
|
||||||
bool IsCertStatusMinorError() override;
|
|
||||||
CefRefPtr<CefSSLCertPrincipal> GetSubject() override;
|
|
||||||
CefRefPtr<CefSSLCertPrincipal> GetIssuer() override;
|
|
||||||
CefRefPtr<CefBinaryValue> GetSerialNumber() override;
|
|
||||||
CefTime GetValidStart() override;
|
|
||||||
CefTime GetValidExpiry() override;
|
|
||||||
CefRefPtr<CefBinaryValue> GetDEREncoded() override;
|
|
||||||
CefRefPtr<CefBinaryValue> GetPEMEncoded() override;
|
|
||||||
size_t GetIssuerChainSize() override;
|
|
||||||
void GetDEREncodedIssuerChain(IssuerChainBinaryList& chain) override;
|
|
||||||
void GetPEMEncodedIssuerChain(IssuerChainBinaryList& chain) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cef_cert_status_t cert_status_;
|
cef_cert_status_t cert_status_;
|
||||||
CefRefPtr<CefSSLCertPrincipal> subject_;
|
CefRefPtr<CefX509Certificate> cert_;
|
||||||
CefRefPtr<CefSSLCertPrincipal> issuer_;
|
|
||||||
CefRefPtr<CefBinaryValue> serial_number_;
|
|
||||||
CefTime valid_start_;
|
|
||||||
CefTime valid_expiry_;
|
|
||||||
CefRefPtr<CefBinaryValue> der_encoded_;
|
|
||||||
CefRefPtr<CefBinaryValue> pem_encoded_;
|
|
||||||
IssuerChainBinaryList der_encoded_issuer_chain_;
|
|
||||||
IssuerChainBinaryList pem_encoded_issuer_chain_;
|
|
||||||
|
|
||||||
IMPLEMENT_REFCOUNTING(CefSSLInfoImpl);
|
IMPLEMENT_REFCOUNTING(CefSSLInfoImpl);
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefSSLInfoImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefSSLInfoImpl);
|
||||||
|
45
libcef/browser/ssl_status_impl.cc
Normal file
45
libcef/browser/ssl_status_impl.cc
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
#include "libcef/browser/ssl_status_impl.h"
|
||||||
|
|
||||||
|
#include "libcef/browser/x509_certificate_impl.h"
|
||||||
|
|
||||||
|
#include "content/public/browser/cert_store.h"
|
||||||
|
#include "net/ssl/ssl_connection_status_flags.h"
|
||||||
|
|
||||||
|
CefSSLStatusImpl::CefSSLStatusImpl(const content::SSLStatus& value) {
|
||||||
|
cert_status_ = static_cast<cef_cert_status_t>(value.cert_status);
|
||||||
|
content_status_ = static_cast<cef_ssl_content_status_t>(value.content_status);
|
||||||
|
ssl_version_ = static_cast<cef_ssl_version_t>(
|
||||||
|
net::SSLConnectionStatusToVersion(value.connection_status));
|
||||||
|
cert_id_ = value.cert_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CefSSLStatusImpl::IsSecureConnection() {
|
||||||
|
// Secure connection if there was a certificate ID in SSLStatus.
|
||||||
|
return (cert_id_ != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_cert_status_t CefSSLStatusImpl::GetCertStatus() {
|
||||||
|
return cert_status_;
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_ssl_version_t CefSSLStatusImpl::GetSSLVersion() {
|
||||||
|
return ssl_version_;
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_ssl_content_status_t CefSSLStatusImpl::GetContentStatus() {
|
||||||
|
return content_status_;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefX509Certificate> CefSSLStatusImpl::GetX509Certificate() {
|
||||||
|
if (cert_id_) {
|
||||||
|
scoped_refptr<net::X509Certificate> cert;
|
||||||
|
content::CertStore::GetInstance()->RetrieveCert(cert_id_, &cert);
|
||||||
|
if (cert.get())
|
||||||
|
return new CefX509CertificateImpl(cert);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
35
libcef/browser/ssl_status_impl.h
Normal file
35
libcef/browser/ssl_status_impl.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_BROWSER_SSL_STATUS_IMPL_H_
|
||||||
|
#define CEF_LIBCEF_BROWSER_SSL_STATUS_IMPL_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/cef_ssl_status.h"
|
||||||
|
|
||||||
|
#include "content/public/common/ssl_status.h"
|
||||||
|
|
||||||
|
// CefSSLStatus implementation
|
||||||
|
class CefSSLStatusImpl : public CefSSLStatus {
|
||||||
|
public:
|
||||||
|
explicit CefSSLStatusImpl(const content::SSLStatus& value);
|
||||||
|
|
||||||
|
// CefSSLStatus methods.
|
||||||
|
bool IsSecureConnection() override;
|
||||||
|
cef_cert_status_t GetCertStatus() override;
|
||||||
|
cef_ssl_version_t GetSSLVersion() override;
|
||||||
|
cef_ssl_content_status_t GetContentStatus() override;
|
||||||
|
CefRefPtr<CefX509Certificate> GetX509Certificate() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
cef_cert_status_t cert_status_;
|
||||||
|
cef_ssl_version_t ssl_version_;
|
||||||
|
cef_ssl_content_status_t content_status_;
|
||||||
|
int cert_id_;
|
||||||
|
|
||||||
|
IMPLEMENT_REFCOUNTING(CefSSLStatusImpl);
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(CefSSLStatusImpl);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_BROWSER_SSL_STATUS_IMPL_H_
|
@@ -3,8 +3,10 @@
|
|||||||
// can be found in the LICENSE file.
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
#include "libcef/browser/web_plugin_impl.h"
|
#include "libcef/browser/web_plugin_impl.h"
|
||||||
|
|
||||||
#include "libcef/browser/context.h"
|
#include "libcef/browser/context.h"
|
||||||
#include "libcef/browser/thread_util.h"
|
#include "libcef/browser/thread_util.h"
|
||||||
|
#include "libcef/common/widevine_loader.h"
|
||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
@@ -28,6 +30,22 @@ void PluginsCallbackImpl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !(defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)) || \
|
||||||
|
defined(OS_LINUX)
|
||||||
|
|
||||||
|
void DeliverWidevineCdmError(const std::string& error_message,
|
||||||
|
CefRefPtr<CefRegisterCdmCallback> callback) {
|
||||||
|
LOG(ERROR) << error_message;
|
||||||
|
if (callback.get()) {
|
||||||
|
CEF_POST_TASK(CEF_UIT,
|
||||||
|
base::Bind(&CefRegisterCdmCallback::OnCdmRegistrationComplete,
|
||||||
|
callback.get(), CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED,
|
||||||
|
error_message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
@@ -150,3 +168,24 @@ void CefIsWebPluginUnstable(
|
|||||||
CEF_POST_TASK(CEF_IOT, base::Bind(CefIsWebPluginUnstable, path, callback));
|
CEF_POST_TASK(CEF_IOT, base::Bind(CefIsWebPluginUnstable, path, callback));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefRegisterWidevineCdm(const CefString& path,
|
||||||
|
CefRefPtr<CefRegisterCdmCallback> callback) {
|
||||||
|
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||||
|
#if defined(OS_LINUX)
|
||||||
|
// Enforce the requirement that CefRegisterWidevineCdm() is called before
|
||||||
|
// CefInitialize() on Linux. See comments in
|
||||||
|
// CefWidevineLoader::AddPepperPlugins for details.
|
||||||
|
if (CONTEXT_STATE_VALID()) {
|
||||||
|
DeliverWidevineCdmError(
|
||||||
|
"Widevine registration is not supported after context initialization",
|
||||||
|
callback);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif // defined(OS_LINUX)
|
||||||
|
|
||||||
|
CefWidevineLoader::GetInstance()->LoadWidevineCdm(path, callback);
|
||||||
|
#else
|
||||||
|
DeliverWidevineCdmError("Widevine registration is not supported", callback);
|
||||||
|
#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||||
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
// Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
// can be found in the LICENSE file.
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
#include "libcef/browser/ssl_cert_principal_impl.h"
|
#include "libcef/browser/x509_cert_principal_impl.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -20,47 +20,47 @@ void TransferVector(const std::vector<std::string>& source,
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
CefSSLCertPrincipalImpl::CefSSLCertPrincipalImpl(
|
CefX509CertPrincipalImpl::CefX509CertPrincipalImpl(
|
||||||
const net::CertPrincipal& value)
|
const net::CertPrincipal& value)
|
||||||
: value_(value) {
|
: value_(value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
CefString CefSSLCertPrincipalImpl::GetDisplayName() {
|
CefString CefX509CertPrincipalImpl::GetDisplayName() {
|
||||||
return value_.GetDisplayName();
|
return value_.GetDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
CefString CefSSLCertPrincipalImpl::GetCommonName() {
|
CefString CefX509CertPrincipalImpl::GetCommonName() {
|
||||||
return value_.common_name;
|
return value_.common_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefString CefSSLCertPrincipalImpl::GetLocalityName() {
|
CefString CefX509CertPrincipalImpl::GetLocalityName() {
|
||||||
return value_.locality_name;
|
return value_.locality_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefString CefSSLCertPrincipalImpl::GetStateOrProvinceName() {
|
CefString CefX509CertPrincipalImpl::GetStateOrProvinceName() {
|
||||||
return value_.state_or_province_name;
|
return value_.state_or_province_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefString CefSSLCertPrincipalImpl::GetCountryName() {
|
CefString CefX509CertPrincipalImpl::GetCountryName() {
|
||||||
return value_.country_name;
|
return value_.country_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefSSLCertPrincipalImpl::GetStreetAddresses(
|
void CefX509CertPrincipalImpl::GetStreetAddresses(
|
||||||
std::vector<CefString>& addresses) {
|
std::vector<CefString>& addresses) {
|
||||||
TransferVector(value_.street_addresses, addresses);
|
TransferVector(value_.street_addresses, addresses);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefSSLCertPrincipalImpl::GetOrganizationNames(
|
void CefX509CertPrincipalImpl::GetOrganizationNames(
|
||||||
std::vector<CefString>& names) {
|
std::vector<CefString>& names) {
|
||||||
TransferVector(value_.organization_names, names);
|
TransferVector(value_.organization_names, names);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefSSLCertPrincipalImpl::GetOrganizationUnitNames(
|
void CefX509CertPrincipalImpl::GetOrganizationUnitNames(
|
||||||
std::vector<CefString>& names) {
|
std::vector<CefString>& names) {
|
||||||
TransferVector(value_.organization_unit_names, names);
|
TransferVector(value_.organization_unit_names, names);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefSSLCertPrincipalImpl::GetDomainComponents(
|
void CefX509CertPrincipalImpl::GetDomainComponents(
|
||||||
std::vector<CefString>& components) {
|
std::vector<CefString>& components) {
|
||||||
TransferVector(value_.domain_components, components);
|
TransferVector(value_.domain_components, components);
|
||||||
}
|
}
|
@@ -1,21 +1,21 @@
|
|||||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
// Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
// can be found in the LICENSE file.
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_BROWSER_SSL_CERT_PRINCIPAL_IMPL_H_
|
#ifndef CEF_LIBCEF_BROWSER_X509_CERT_PRINCIPAL_IMPL_H_
|
||||||
#define CEF_LIBCEF_BROWSER_SSL_CERT_PRINCIPAL_IMPL_H_
|
#define CEF_LIBCEF_BROWSER_X509_CERT_PRINCIPAL_IMPL_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "include/cef_ssl_info.h"
|
#include "include/cef_x509_certificate.h"
|
||||||
|
|
||||||
#include "net/cert/x509_cert_types.h"
|
#include "net/cert/x509_cert_types.h"
|
||||||
|
|
||||||
// CefSSLCertPrincipal implementation
|
// CefX509CertPrincipal implementation
|
||||||
class CefSSLCertPrincipalImpl : public CefSSLCertPrincipal {
|
class CefX509CertPrincipalImpl : public CefX509CertPrincipal {
|
||||||
public:
|
public:
|
||||||
explicit CefSSLCertPrincipalImpl(const net::CertPrincipal& value);
|
explicit CefX509CertPrincipalImpl(const net::CertPrincipal& value);
|
||||||
|
|
||||||
// CefSSLCertPrincipal methods.
|
// CefX509CertPrincipal methods.
|
||||||
CefString GetDisplayName() override;
|
CefString GetDisplayName() override;
|
||||||
CefString GetCommonName() override;
|
CefString GetCommonName() override;
|
||||||
CefString GetLocalityName() override;
|
CefString GetLocalityName() override;
|
||||||
@@ -29,8 +29,8 @@ class CefSSLCertPrincipalImpl : public CefSSLCertPrincipal {
|
|||||||
private:
|
private:
|
||||||
net::CertPrincipal value_;
|
net::CertPrincipal value_;
|
||||||
|
|
||||||
IMPLEMENT_REFCOUNTING(CefSSLCertPrincipalImpl);
|
IMPLEMENT_REFCOUNTING(CefX509CertPrincipalImpl);
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefSSLCertPrincipalImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefX509CertPrincipalImpl);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_BROWSER_SSL_CERT_PRINCIPAL_IMPL_H_
|
#endif // CEF_LIBCEF_BROWSER_X509_CERT_PRINCIPAL_IMPL_H_
|
122
libcef/browser/x509_certificate_impl.cc
Normal file
122
libcef/browser/x509_certificate_impl.cc
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
#include "libcef/browser/x509_certificate_impl.h"
|
||||||
|
#include "libcef/browser/x509_cert_principal_impl.h"
|
||||||
|
#include "libcef/common/time_util.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
CefRefPtr<CefBinaryValue> EncodeCertificate(
|
||||||
|
const net::X509Certificate::OSCertHandle& os_handle, bool der) {
|
||||||
|
CefRefPtr<CefBinaryValue> bin_encoded;
|
||||||
|
std::string encoded;
|
||||||
|
|
||||||
|
if (( der && net::X509Certificate::GetDEREncoded(os_handle, &encoded)) ||
|
||||||
|
(!der && net::X509Certificate::GetPEMEncoded(os_handle, &encoded))) {
|
||||||
|
bin_encoded = CefBinaryValue::Create(encoded.c_str(), encoded.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
return bin_encoded;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
CefX509CertificateImpl::CefX509CertificateImpl(
|
||||||
|
scoped_refptr<net::X509Certificate> cert)
|
||||||
|
:cert_(cert) {
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefX509CertPrincipal> CefX509CertificateImpl::GetSubject() {
|
||||||
|
if (cert_)
|
||||||
|
return new CefX509CertPrincipalImpl(cert_->subject());
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefX509CertPrincipal> CefX509CertificateImpl::GetIssuer() {
|
||||||
|
if (cert_)
|
||||||
|
return new CefX509CertPrincipalImpl(cert_->issuer());
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefBinaryValue> CefX509CertificateImpl::GetSerialNumber() {
|
||||||
|
if (cert_) {
|
||||||
|
const std::string& serial = cert_->serial_number();
|
||||||
|
return CefBinaryValue::Create(serial.c_str(), serial.size());
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefTime CefX509CertificateImpl::GetValidStart() {
|
||||||
|
CefTime validity;
|
||||||
|
if (cert_) {
|
||||||
|
const base::Time& valid_time = cert_->valid_start();
|
||||||
|
if (!valid_time.is_null())
|
||||||
|
cef_time_from_basetime(valid_time, validity);
|
||||||
|
}
|
||||||
|
return validity;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefTime CefX509CertificateImpl::GetValidExpiry() {
|
||||||
|
CefTime validity;
|
||||||
|
if (cert_) {
|
||||||
|
const base::Time& valid_time = cert_->valid_expiry();
|
||||||
|
if (!valid_time.is_null())
|
||||||
|
cef_time_from_basetime(valid_time, validity);
|
||||||
|
}
|
||||||
|
return validity;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefBinaryValue> CefX509CertificateImpl::GetDEREncoded() {
|
||||||
|
if (cert_) {
|
||||||
|
net::X509Certificate::OSCertHandle os_handle = cert_->os_cert_handle();
|
||||||
|
if (os_handle)
|
||||||
|
return EncodeCertificate(os_handle, true);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefBinaryValue> CefX509CertificateImpl::GetPEMEncoded() {
|
||||||
|
if (cert_) {
|
||||||
|
net::X509Certificate::OSCertHandle os_handle = cert_->os_cert_handle();
|
||||||
|
if (os_handle)
|
||||||
|
return EncodeCertificate(os_handle, false);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t CefX509CertificateImpl::GetIssuerChainSize() {
|
||||||
|
if (cert_)
|
||||||
|
return cert_->GetIntermediateCertificates().size();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefX509CertificateImpl::GetEncodedIssuerChain(
|
||||||
|
CefX509Certificate::IssuerChainBinaryList& chain, bool der) {
|
||||||
|
chain.clear();
|
||||||
|
if (cert_) {
|
||||||
|
const net::X509Certificate::OSCertHandles& handles =
|
||||||
|
cert_->GetIntermediateCertificates();
|
||||||
|
for (net::X509Certificate::OSCertHandles::const_iterator it =
|
||||||
|
handles.begin(); it != handles.end(); it++) {
|
||||||
|
// Add each to the chain, even if one conversion unexpectedly failed.
|
||||||
|
// GetIssuerChainSize depends on these being the same length.
|
||||||
|
chain.push_back(EncodeCertificate(*it, der));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefX509CertificateImpl::GetDEREncodedIssuerChain(
|
||||||
|
CefX509Certificate::IssuerChainBinaryList& chain) {
|
||||||
|
if (der_encoded_issuer_chain_.empty())
|
||||||
|
GetEncodedIssuerChain(der_encoded_issuer_chain_, true);
|
||||||
|
chain = der_encoded_issuer_chain_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefX509CertificateImpl::GetPEMEncodedIssuerChain(
|
||||||
|
CefX509Certificate::IssuerChainBinaryList& chain) {
|
||||||
|
if (pem_encoded_issuer_chain_.empty())
|
||||||
|
GetEncodedIssuerChain(pem_encoded_issuer_chain_, false);
|
||||||
|
chain = pem_encoded_issuer_chain_;
|
||||||
|
}
|
43
libcef/browser/x509_certificate_impl.h
Normal file
43
libcef/browser/x509_certificate_impl.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_BROWSER_X509_CERTIFICATE_IMPL_H_
|
||||||
|
#define CEF_LIBCEF_BROWSER_X509_CERTIFICATE_IMPL_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/cef_x509_certificate.h"
|
||||||
|
|
||||||
|
#include "net/cert/x509_certificate.h"
|
||||||
|
|
||||||
|
// CefX509Certificate implementation
|
||||||
|
class CefX509CertificateImpl : public CefX509Certificate {
|
||||||
|
public:
|
||||||
|
explicit CefX509CertificateImpl(scoped_refptr<net::X509Certificate> cert);
|
||||||
|
|
||||||
|
// CefX509Certificate methods.
|
||||||
|
CefRefPtr<CefX509CertPrincipal> GetSubject() override;
|
||||||
|
CefRefPtr<CefX509CertPrincipal> GetIssuer() override;
|
||||||
|
CefRefPtr<CefBinaryValue> GetSerialNumber() override;
|
||||||
|
CefTime GetValidStart() override;
|
||||||
|
CefTime GetValidExpiry() override;
|
||||||
|
CefRefPtr<CefBinaryValue> GetDEREncoded() override;
|
||||||
|
CefRefPtr<CefBinaryValue> GetPEMEncoded() override;
|
||||||
|
size_t GetIssuerChainSize() override;
|
||||||
|
void GetDEREncodedIssuerChain(IssuerChainBinaryList& chain) override;
|
||||||
|
void GetPEMEncodedIssuerChain(IssuerChainBinaryList& chain) override;
|
||||||
|
|
||||||
|
scoped_refptr<net::X509Certificate> GetInternalCertObject() { return cert_; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
void GetEncodedIssuerChain(IssuerChainBinaryList& chain, bool der);
|
||||||
|
|
||||||
|
scoped_refptr<net::X509Certificate> cert_;
|
||||||
|
IssuerChainBinaryList pem_encoded_issuer_chain_;
|
||||||
|
IssuerChainBinaryList der_encoded_issuer_chain_;
|
||||||
|
|
||||||
|
IMPLEMENT_REFCOUNTING(CefX509CertificateImpl);
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(CefX509CertificateImpl);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_BROWSER_X509_CERTIFICATE_IMPL_H_
|
@@ -106,15 +106,9 @@ const char kDisableScrollBounce[] = "disable-scroll-bounce";
|
|||||||
// Disable the PDF extension.
|
// Disable the PDF extension.
|
||||||
const char kDisablePdfExtension[] = "disable-pdf-extension";
|
const char kDisablePdfExtension[] = "disable-pdf-extension";
|
||||||
|
|
||||||
// Enable Widevine CDM.
|
|
||||||
const char kEnableWidevineCdm[] = "enable-widevine-cdm";
|
|
||||||
|
|
||||||
// Path to Widevine CDM binaries.
|
// Path to Widevine CDM binaries.
|
||||||
const char kWidevineCdmPath[] = "widevine-cdm-path";
|
const char kWidevineCdmPath[] = "widevine-cdm-path";
|
||||||
|
|
||||||
// Widevine CDM version.
|
|
||||||
const char kWidevineCdmVersion[] = "widevine-cdm-version";
|
|
||||||
|
|
||||||
// Default plugin policy action.
|
// Default plugin policy action.
|
||||||
const char kPluginPolicy[] = "plugin-policy";
|
const char kPluginPolicy[] = "plugin-policy";
|
||||||
// Allow the content. This is the default value.
|
// Allow the content. This is the default value.
|
||||||
@@ -128,4 +122,7 @@ const char kPluginPolicy_Block[] = "block";
|
|||||||
// Expose preferences used only by unit tests.
|
// Expose preferences used only by unit tests.
|
||||||
const char kEnablePreferenceTesting[] = "enable-preference-testing";
|
const char kEnablePreferenceTesting[] = "enable-preference-testing";
|
||||||
|
|
||||||
|
// Enable date-based expiration of built in network security information.
|
||||||
|
const char kEnableNetSecurityExpiration[] = "enable-net-security-expiration";
|
||||||
|
|
||||||
} // namespace switches
|
} // namespace switches
|
||||||
|
@@ -45,14 +45,13 @@ extern const char kOverrideSpellCheckLang[];
|
|||||||
extern const char kEnableSystemFlash[];
|
extern const char kEnableSystemFlash[];
|
||||||
extern const char kDisableScrollBounce[];
|
extern const char kDisableScrollBounce[];
|
||||||
extern const char kDisablePdfExtension[];
|
extern const char kDisablePdfExtension[];
|
||||||
extern const char kEnableWidevineCdm[];
|
|
||||||
extern const char kWidevineCdmPath[];
|
extern const char kWidevineCdmPath[];
|
||||||
extern const char kWidevineCdmVersion[];
|
|
||||||
extern const char kPluginPolicy[];
|
extern const char kPluginPolicy[];
|
||||||
extern const char kPluginPolicy_Allow[];
|
extern const char kPluginPolicy_Allow[];
|
||||||
extern const char kPluginPolicy_Detect[];
|
extern const char kPluginPolicy_Detect[];
|
||||||
extern const char kPluginPolicy_Block[];
|
extern const char kPluginPolicy_Block[];
|
||||||
extern const char kEnablePreferenceTesting[];
|
extern const char kEnablePreferenceTesting[];
|
||||||
|
extern const char kEnableNetSecurityExpiration[];
|
||||||
|
|
||||||
} // namespace switches
|
} // namespace switches
|
||||||
|
|
||||||
|
@@ -37,12 +37,8 @@
|
|||||||
#include "ppapi/shared_impl/ppapi_permissions.h"
|
#include "ppapi/shared_impl/ppapi_permissions.h"
|
||||||
#include "ui/base/resource/resource_bundle.h"
|
#include "ui/base/resource/resource_bundle.h"
|
||||||
|
|
||||||
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
|
#if defined(OS_LINUX)
|
||||||
|
#include "libcef/common/widevine_loader.h"
|
||||||
// The following must be after widevine_cdm_version.h.
|
|
||||||
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
|
|
||||||
!defined(WIDEVINE_CDM_IS_COMPONENT)
|
|
||||||
#include "chrome/common/widevine_cdm_constants.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -182,67 +178,6 @@ bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddWidevineCdmFromCommandLine(
|
|
||||||
std::vector<content::PepperPluginInfo>* plugins) {
|
|
||||||
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
|
|
||||||
!defined(WIDEVINE_CDM_IS_COMPONENT)
|
|
||||||
static bool skip_widevine_cdm_file_check = false;
|
|
||||||
|
|
||||||
base::FilePath widevine_cdm_path =
|
|
||||||
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
|
|
||||||
switches::kWidevineCdmPath);
|
|
||||||
if (!widevine_cdm_path.empty()) {
|
|
||||||
widevine_cdm_path =
|
|
||||||
widevine_cdm_path.AppendASCII(kWidevineCdmAdapterFileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Also get the version from the command-line. Should be something like
|
|
||||||
// 1.4.8.824.
|
|
||||||
const std::string& widevine_cdm_version =
|
|
||||||
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
|
||||||
switches::kWidevineCdmVersion);
|
|
||||||
|
|
||||||
if (!widevine_cdm_path.empty() && !widevine_cdm_version.empty()) {
|
|
||||||
if (skip_widevine_cdm_file_check || base::PathExists(widevine_cdm_path)) {
|
|
||||||
content::PepperPluginInfo widevine_cdm;
|
|
||||||
widevine_cdm.is_out_of_process = true;
|
|
||||||
widevine_cdm.path = widevine_cdm_path;
|
|
||||||
widevine_cdm.name = kWidevineCdmDisplayName;
|
|
||||||
widevine_cdm.description = kWidevineCdmDescription +
|
|
||||||
std::string(" (version: ") +
|
|
||||||
widevine_cdm_version + ")";
|
|
||||||
widevine_cdm.version = widevine_cdm_version;
|
|
||||||
content::WebPluginMimeType widevine_cdm_mime_type(
|
|
||||||
kWidevineCdmPluginMimeType,
|
|
||||||
kWidevineCdmPluginExtension,
|
|
||||||
kWidevineCdmPluginMimeTypeDescription);
|
|
||||||
|
|
||||||
// Add the supported codecs as if they came from the component manifest.
|
|
||||||
// This list must match the CDM that is being shipped with Chrome.
|
|
||||||
std::vector<std::string> codecs;
|
|
||||||
codecs.push_back(kCdmSupportedCodecVp8);
|
|
||||||
codecs.push_back(kCdmSupportedCodecVp9);
|
|
||||||
#if defined(USE_PROPRIETARY_CODECS)
|
|
||||||
codecs.push_back(kCdmSupportedCodecAvc1);
|
|
||||||
#endif // defined(USE_PROPRIETARY_CODECS)
|
|
||||||
std::string codec_string = base::JoinString(
|
|
||||||
codecs, std::string(1, kCdmSupportedCodecsValueDelimiter));
|
|
||||||
widevine_cdm_mime_type.additional_param_names.push_back(
|
|
||||||
base::ASCIIToUTF16(kCdmSupportedCodecsParamName));
|
|
||||||
widevine_cdm_mime_type.additional_param_values.push_back(
|
|
||||||
base::ASCIIToUTF16(codec_string));
|
|
||||||
|
|
||||||
widevine_cdm.mime_types.push_back(widevine_cdm_mime_type);
|
|
||||||
widevine_cdm.permissions = kWidevineCdmPluginPermissions;
|
|
||||||
plugins->push_back(widevine_cdm);
|
|
||||||
|
|
||||||
skip_widevine_cdm_file_check = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
|
|
||||||
// !defined(WIDEVINE_CDM_IS_COMPONENT)
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
const char CefContentClient::kPDFPluginPath[] = "internal-pdf-viewer";
|
const char CefContentClient::kPDFPluginPath[] = "internal-pdf-viewer";
|
||||||
@@ -269,7 +204,12 @@ void CefContentClient::AddPepperPlugins(
|
|||||||
std::vector<content::PepperPluginInfo>* plugins) {
|
std::vector<content::PepperPluginInfo>* plugins) {
|
||||||
ComputeBuiltInPlugins(plugins);
|
ComputeBuiltInPlugins(plugins);
|
||||||
AddPepperFlashFromCommandLine(plugins);
|
AddPepperFlashFromCommandLine(plugins);
|
||||||
AddWidevineCdmFromCommandLine(plugins);
|
|
||||||
|
#if defined(OS_LINUX)
|
||||||
|
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||||
|
CefWidevineLoader::AddPepperPlugins(plugins);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
content::PepperPluginInfo plugin;
|
content::PepperPluginInfo plugin;
|
||||||
if (GetSystemPepperFlash(&plugin))
|
if (GetSystemPepperFlash(&plugin))
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
#include "chrome/common/chrome_constants.h"
|
#include "chrome/common/chrome_constants.h"
|
||||||
#include "chrome/common/chrome_paths.h"
|
#include "chrome/common/chrome_paths.h"
|
||||||
#include "chrome/common/chrome_switches.h"
|
#include "chrome/common/chrome_switches.h"
|
||||||
#include "components/component_updater/component_updater_paths.h"
|
|
||||||
#include "components/content_settings/core/common/content_settings_pattern.h"
|
#include "components/content_settings/core/common/content_settings_pattern.h"
|
||||||
#include "content/public/browser/browser_main_runner.h"
|
#include "content/public/browser/browser_main_runner.h"
|
||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
@@ -41,8 +40,6 @@
|
|||||||
#include "ui/base/ui_base_paths.h"
|
#include "ui/base/ui_base_paths.h"
|
||||||
#include "ui/base/ui_base_switches.h"
|
#include "ui/base/ui_base_switches.h"
|
||||||
|
|
||||||
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
|
|
||||||
|
|
||||||
#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
|
#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
|
||||||
|
|
||||||
#if defined(IPC_MESSAGE_LOG_ENABLED)
|
#if defined(IPC_MESSAGE_LOG_ENABLED)
|
||||||
@@ -559,26 +556,6 @@ void CefMainDelegate::PreSandboxStartup() {
|
|||||||
user_data_path.AppendASCII("Dictionaries"),
|
user_data_path.AppendASCII("Dictionaries"),
|
||||||
false, // May not be an absolute path.
|
false, // May not be an absolute path.
|
||||||
true); // Create if necessary.
|
true); // Create if necessary.
|
||||||
|
|
||||||
const base::FilePath& resources_path = GetResourcesFilePath();
|
|
||||||
|
|
||||||
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
|
||||||
const base::FilePath& widevine_plugin_path =
|
|
||||||
resources_path.AppendASCII(kWidevineCdmAdapterFileName);
|
|
||||||
if (base::PathExists(widevine_plugin_path)) {
|
|
||||||
PathService::Override(chrome::FILE_WIDEVINE_CDM_ADAPTER,
|
|
||||||
widevine_plugin_path);
|
|
||||||
}
|
|
||||||
#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
|
||||||
|
|
||||||
// Paths to find pre-installed components.
|
|
||||||
PathService::Override(chrome::DIR_COMPONENTS, resources_path);
|
|
||||||
PathService::Override(chrome::DIR_INTERNAL_PLUGINS, resources_path);
|
|
||||||
|
|
||||||
// Register paths to be used by the component updater.
|
|
||||||
component_updater::RegisterPathProvider(chrome::DIR_COMPONENTS,
|
|
||||||
chrome::DIR_INTERNAL_PLUGINS,
|
|
||||||
chrome::DIR_USER_DATA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command_line->HasSwitch(switches::kDisablePackLoading))
|
if (command_line->HasSwitch(switches::kDisablePackLoading))
|
||||||
|
@@ -126,14 +126,14 @@ net::URLRequest::ReferrerPolicy GetURLRequestReferrerPolicy(
|
|||||||
return net_referrer_policy;
|
return net_referrer_policy;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetURLRequestReferrer(const CefString& referrer_url) {
|
std::string GetURLRequestReferrer(const GURL& referrer_url) {
|
||||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||||
if (!GURL(referrer_url.ToString()).is_valid() ||
|
if (!referrer_url.is_valid() ||
|
||||||
command_line->HasSwitch(switches::kNoReferrers)) {
|
command_line->HasSwitch(switches::kNoReferrers)) {
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
return referrer_url;
|
return referrer_url.spec();
|
||||||
}
|
}
|
||||||
|
|
||||||
blink::WebString FilePathStringToWebString(
|
blink::WebString FilePathStringToWebString(
|
||||||
@@ -167,12 +167,12 @@ void GetHeaderMap(const net::HttpRequestHeaders& headers,
|
|||||||
// |referrer|.
|
// |referrer|.
|
||||||
void GetHeaderMap(const blink::WebURLRequest& request,
|
void GetHeaderMap(const blink::WebURLRequest& request,
|
||||||
CefRequest::HeaderMap& map,
|
CefRequest::HeaderMap& map,
|
||||||
CefString& referrer) {
|
GURL& referrer) {
|
||||||
map.clear();
|
map.clear();
|
||||||
|
|
||||||
class HeaderVisitor : public blink::WebHTTPHeaderVisitor {
|
class HeaderVisitor : public blink::WebHTTPHeaderVisitor {
|
||||||
public:
|
public:
|
||||||
HeaderVisitor(CefRequest::HeaderMap* map, CefString* referrer)
|
HeaderVisitor(CefRequest::HeaderMap* map, GURL* referrer)
|
||||||
: map_(map),
|
: map_(map),
|
||||||
referrer_(referrer) {
|
referrer_(referrer) {
|
||||||
}
|
}
|
||||||
@@ -182,14 +182,14 @@ void GetHeaderMap(const blink::WebURLRequest& request,
|
|||||||
const base::string16& nameStr = name;
|
const base::string16& nameStr = name;
|
||||||
const base::string16& valueStr = value;
|
const base::string16& valueStr = value;
|
||||||
if (base::LowerCaseEqualsASCII(nameStr, kReferrerLowerCase))
|
if (base::LowerCaseEqualsASCII(nameStr, kReferrerLowerCase))
|
||||||
*referrer_ = valueStr;
|
*referrer_ = GURL(valueStr);
|
||||||
else
|
else
|
||||||
map_->insert(std::make_pair(nameStr, valueStr));
|
map_->insert(std::make_pair(nameStr, valueStr));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CefRequest::HeaderMap* map_;
|
CefRequest::HeaderMap* map_;
|
||||||
CefString* referrer_;
|
GURL* referrer_;
|
||||||
};
|
};
|
||||||
|
|
||||||
HeaderVisitor visitor(&map, &referrer);
|
HeaderVisitor visitor(&map, &referrer);
|
||||||
@@ -268,14 +268,15 @@ bool CefRequestImpl::IsReadOnly() {
|
|||||||
|
|
||||||
CefString CefRequestImpl::GetURL() {
|
CefString CefRequestImpl::GetURL() {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
return url_;
|
return url_.spec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRequestImpl::SetURL(const CefString& url) {
|
void CefRequestImpl::SetURL(const CefString& url) {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
CHECK_READONLY_RETURN_VOID();
|
CHECK_READONLY_RETURN_VOID();
|
||||||
if (url_ != url) {
|
const GURL& new_url = GURL(url.ToString());
|
||||||
url_ = url;
|
if (url_ != new_url) {
|
||||||
|
url_ = new_url;
|
||||||
Changed(kChangedUrl);
|
Changed(kChangedUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -288,8 +289,9 @@ CefString CefRequestImpl::GetMethod() {
|
|||||||
void CefRequestImpl::SetMethod(const CefString& method) {
|
void CefRequestImpl::SetMethod(const CefString& method) {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
CHECK_READONLY_RETURN_VOID();
|
CHECK_READONLY_RETURN_VOID();
|
||||||
if (method_ != method) {
|
const std::string& new_method = method;
|
||||||
method_ = method;
|
if (method_ != new_method) {
|
||||||
|
method_ = new_method;
|
||||||
Changed(kChangedMethod);
|
Changed(kChangedMethod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,9 +303,9 @@ void CefRequestImpl::SetReferrer(const CefString& referrer_url,
|
|||||||
|
|
||||||
// Call GetAsReferrer here for consistency since the same logic will later be
|
// Call GetAsReferrer here for consistency since the same logic will later be
|
||||||
// applied by URLRequest::SetReferrer().
|
// applied by URLRequest::SetReferrer().
|
||||||
const GURL& gurl = GURL(referrer_url.ToString()).GetAsReferrer();
|
const GURL& new_referrer_url = GURL(referrer_url.ToString()).GetAsReferrer();
|
||||||
if (referrer_url_ != gurl.spec() || referrer_policy_ != policy) {
|
if (referrer_url_ != new_referrer_url || referrer_policy_ != policy) {
|
||||||
referrer_url_ = gurl.spec();
|
referrer_url_ = new_referrer_url;
|
||||||
referrer_policy_ = policy;
|
referrer_policy_ = policy;
|
||||||
Changed(kChangedReferrer);
|
Changed(kChangedReferrer);
|
||||||
}
|
}
|
||||||
@@ -311,7 +313,7 @@ void CefRequestImpl::SetReferrer(const CefString& referrer_url,
|
|||||||
|
|
||||||
CefString CefRequestImpl::GetReferrerURL() {
|
CefString CefRequestImpl::GetReferrerURL() {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
return referrer_url_;
|
return referrer_url_.spec();
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRequestImpl::ReferrerPolicy CefRequestImpl::GetReferrerPolicy() {
|
CefRequestImpl::ReferrerPolicy CefRequestImpl::GetReferrerPolicy() {
|
||||||
@@ -349,12 +351,14 @@ void CefRequestImpl::Set(const CefString& url,
|
|||||||
const HeaderMap& headerMap) {
|
const HeaderMap& headerMap) {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
CHECK_READONLY_RETURN_VOID();
|
CHECK_READONLY_RETURN_VOID();
|
||||||
if (url_ != url) {
|
const GURL& new_url = GURL(url.ToString());
|
||||||
url_ = url;
|
if (url_ != new_url) {
|
||||||
|
url_ = new_url;
|
||||||
Changed(kChangedUrl);
|
Changed(kChangedUrl);
|
||||||
}
|
}
|
||||||
if (method_ != method) {
|
const std::string& new_method = method;
|
||||||
method_ = method;
|
if (method_ != new_method) {
|
||||||
|
method_ = new_method;
|
||||||
Changed(kChangedMethod);
|
Changed(kChangedMethod);
|
||||||
}
|
}
|
||||||
postdata_ = postData;
|
postdata_ = postData;
|
||||||
@@ -378,14 +382,15 @@ void CefRequestImpl::SetFlags(int flags) {
|
|||||||
|
|
||||||
CefString CefRequestImpl::GetFirstPartyForCookies() {
|
CefString CefRequestImpl::GetFirstPartyForCookies() {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
return first_party_for_cookies_;
|
return first_party_for_cookies_.spec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRequestImpl::SetFirstPartyForCookies(const CefString& url) {
|
void CefRequestImpl::SetFirstPartyForCookies(const CefString& url) {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
CHECK_READONLY_RETURN_VOID();
|
CHECK_READONLY_RETURN_VOID();
|
||||||
if (first_party_for_cookies_ != url) {
|
const GURL& new_url = GURL(url.ToString());
|
||||||
first_party_for_cookies_ = url;
|
if (first_party_for_cookies_ != new_url) {
|
||||||
|
first_party_for_cookies_ = new_url;
|
||||||
Changed(kChangedFirstPartyForCookies);
|
Changed(kChangedFirstPartyForCookies);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -411,7 +416,7 @@ void CefRequestImpl::Set(net::URLRequest* request) {
|
|||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
url_ = request->url().spec();
|
url_ = request->url();
|
||||||
method_ = request->method();
|
method_ = request->method();
|
||||||
identifier_ = request->identifier();
|
identifier_ = request->identifier();
|
||||||
|
|
||||||
@@ -422,7 +427,7 @@ void CefRequestImpl::Set(net::URLRequest* request) {
|
|||||||
// Our consumer should have made sure that this is a safe referrer. See for
|
// Our consumer should have made sure that this is a safe referrer. See for
|
||||||
// instance WebCore::FrameLoader::HideReferrer.
|
// instance WebCore::FrameLoader::HideReferrer.
|
||||||
if (referrer.is_valid()) {
|
if (referrer.is_valid()) {
|
||||||
referrer_url_ = referrer.spec();
|
referrer_url_ = referrer;
|
||||||
switch (request->referrer_policy()) {
|
switch (request->referrer_policy()) {
|
||||||
case net::URLRequest::
|
case net::URLRequest::
|
||||||
CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
|
CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
|
||||||
@@ -459,7 +464,7 @@ void CefRequestImpl::Set(net::URLRequest* request) {
|
|||||||
static_cast<CefPostDataImpl*>(postdata_.get())->Set(*data);
|
static_cast<CefPostDataImpl*>(postdata_.get())->Set(*data);
|
||||||
}
|
}
|
||||||
|
|
||||||
first_party_for_cookies_ = request->first_party_for_cookies().spec();
|
first_party_for_cookies_ = request->first_party_for_cookies();
|
||||||
|
|
||||||
const content::ResourceRequestInfo* info =
|
const content::ResourceRequestInfo* info =
|
||||||
content::ResourceRequestInfo::ForRequest(request);
|
content::ResourceRequestInfo::ForRequest(request);
|
||||||
@@ -497,10 +502,9 @@ void CefRequestImpl::Get(net::URLRequest* request, bool changed_only) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!first_party_for_cookies_.empty() &&
|
if (!first_party_for_cookies_.is_empty() &&
|
||||||
ShouldSet(kChangedFirstPartyForCookies, changed_only)) {
|
ShouldSet(kChangedFirstPartyForCookies, changed_only)) {
|
||||||
request->set_first_party_for_cookies(
|
request->set_first_party_for_cookies(first_party_for_cookies_);
|
||||||
GURL(std::string(first_party_for_cookies_)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,12 +516,12 @@ void CefRequestImpl::Set(
|
|||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
url_ = params.url().spec();
|
url_ = params.url();
|
||||||
method_ = params.is_post() ? "POST" : "GET";
|
method_ = params.is_post() ? "POST" : "GET";
|
||||||
|
|
||||||
const content::Referrer& sanitized_referrer =
|
const content::Referrer& sanitized_referrer =
|
||||||
content::Referrer::SanitizeForRequest(params.url(), params.referrer());
|
content::Referrer::SanitizeForRequest(params.url(), params.referrer());
|
||||||
referrer_url_ = sanitized_referrer.url.spec();
|
referrer_url_ = sanitized_referrer.url;
|
||||||
referrer_policy_ =
|
referrer_policy_ =
|
||||||
static_cast<cef_referrer_policy_t>(sanitized_referrer.policy);
|
static_cast<cef_referrer_policy_t>(sanitized_referrer.policy);
|
||||||
|
|
||||||
@@ -534,8 +538,8 @@ void CefRequestImpl::Set(const blink::WebURLRequest& request) {
|
|||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
url_ = request.url().string();
|
url_ = request.url();
|
||||||
method_ = request.httpMethod();
|
method_ = request.httpMethod().utf8();
|
||||||
|
|
||||||
::GetHeaderMap(request, headermap_, referrer_url_);
|
::GetHeaderMap(request, headermap_, referrer_url_);
|
||||||
referrer_policy_ =
|
referrer_policy_ =
|
||||||
@@ -547,7 +551,7 @@ void CefRequestImpl::Set(const blink::WebURLRequest& request) {
|
|||||||
static_cast<CefPostDataImpl*>(postdata_.get())->Set(body);
|
static_cast<CefPostDataImpl*>(postdata_.get())->Set(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
first_party_for_cookies_ = request.firstPartyForCookies().string();
|
first_party_for_cookies_ = request.firstPartyForCookies();
|
||||||
|
|
||||||
if (request.getCachePolicy() == blink::WebCachePolicy::BypassingCache)
|
if (request.getCachePolicy() == blink::WebCachePolicy::BypassingCache)
|
||||||
flags_ |= UR_FLAG_SKIP_CACHE;
|
flags_ |= UR_FLAG_SKIP_CACHE;
|
||||||
@@ -561,15 +565,15 @@ void CefRequestImpl::Get(blink::WebURLRequest& request,
|
|||||||
int64& upload_data_size) const {
|
int64& upload_data_size) const {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
|
|
||||||
request.setURL(GURL(url_.ToString()));
|
request.setURL(url_);
|
||||||
request.setHTTPMethod(blink::WebString::fromUTF8(method_.ToString()));
|
request.setHTTPMethod(blink::WebString::fromUTF8(method_));
|
||||||
|
|
||||||
if (!referrer_url_.empty()) {
|
if (!referrer_url_.is_empty()) {
|
||||||
const blink::WebString& referrer =
|
const blink::WebString& referrer =
|
||||||
blink::WebSecurityPolicy::generateReferrerHeader(
|
blink::WebSecurityPolicy::generateReferrerHeader(
|
||||||
static_cast<blink::WebReferrerPolicy>(referrer_policy_),
|
static_cast<blink::WebReferrerPolicy>(referrer_policy_),
|
||||||
GURL(url_.ToString()),
|
url_,
|
||||||
blink::WebString::fromUTF8(referrer_url_));
|
blink::WebString::fromUTF8(referrer_url_.spec()));
|
||||||
if (!referrer.isEmpty()) {
|
if (!referrer.isEmpty()) {
|
||||||
request.setHTTPReferrer(
|
request.setHTTPReferrer(
|
||||||
referrer,
|
referrer,
|
||||||
@@ -597,8 +601,8 @@ void CefRequestImpl::Get(blink::WebURLRequest& request,
|
|||||||
|
|
||||||
::SetHeaderMap(headermap_, request);
|
::SetHeaderMap(headermap_, request);
|
||||||
|
|
||||||
if (!first_party_for_cookies_.empty())
|
if (!first_party_for_cookies_.is_empty())
|
||||||
request.setFirstPartyForCookies(GURL(first_party_for_cookies_.ToString()));
|
request.setFirstPartyForCookies(first_party_for_cookies_);
|
||||||
|
|
||||||
request.setCachePolicy((flags_ & UR_FLAG_SKIP_CACHE) ?
|
request.setCachePolicy((flags_ & UR_FLAG_SKIP_CACHE) ?
|
||||||
blink::WebCachePolicy::BypassingCache :
|
blink::WebCachePolicy::BypassingCache :
|
||||||
@@ -693,11 +697,11 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params,
|
|||||||
void CefRequestImpl::Get(CefNavigateParams& params) const {
|
void CefRequestImpl::Get(CefNavigateParams& params) const {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
|
|
||||||
params.url = GURL(url_.ToString());
|
params.url = url_;
|
||||||
params.method = method_;
|
params.method = method_;
|
||||||
|
|
||||||
// Referrer policy will be applied later in the request pipeline.
|
// Referrer policy will be applied later in the request pipeline.
|
||||||
params.referrer.url = GURL(referrer_url_.ToString());
|
params.referrer.url = referrer_url_;
|
||||||
params.referrer.policy =
|
params.referrer.policy =
|
||||||
static_cast<blink::WebReferrerPolicy>(referrer_policy_);
|
static_cast<blink::WebReferrerPolicy>(referrer_policy_);
|
||||||
|
|
||||||
@@ -710,7 +714,7 @@ void CefRequestImpl::Get(CefNavigateParams& params) const {
|
|||||||
impl->Get(*params.upload_data.get());
|
impl->Get(*params.upload_data.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
params.first_party_for_cookies = GURL(first_party_for_cookies_.ToString());
|
params.first_party_for_cookies = first_party_for_cookies_;
|
||||||
params.load_flags = flags_;
|
params.load_flags = flags_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -718,7 +722,7 @@ void CefRequestImpl::Get(net::URLFetcher& fetcher,
|
|||||||
int64& upload_data_size) const {
|
int64& upload_data_size) const {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
|
|
||||||
if (!referrer_url_.empty()) {
|
if (!referrer_url_.is_empty()) {
|
||||||
fetcher.SetReferrer(GetURLRequestReferrer(referrer_url_));
|
fetcher.SetReferrer(GetURLRequestReferrer(referrer_url_));
|
||||||
fetcher.SetReferrerPolicy(GetURLRequestReferrerPolicy(referrer_policy_));
|
fetcher.SetReferrerPolicy(GetURLRequestReferrerPolicy(referrer_policy_));
|
||||||
}
|
}
|
||||||
@@ -781,8 +785,8 @@ void CefRequestImpl::Get(net::URLFetcher& fetcher,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!first_party_for_cookies_.empty())
|
if (!first_party_for_cookies_.is_empty())
|
||||||
fetcher.SetInitiatorURL(GURL(first_party_for_cookies_.ToString()));
|
fetcher.SetInitiatorURL(first_party_for_cookies_);
|
||||||
|
|
||||||
if (flags_ & UR_FLAG_NO_RETRY_ON_5XX)
|
if (flags_ & UR_FLAG_NO_RETRY_ON_5XX)
|
||||||
fetcher.SetAutomaticallyRetryOn5xx(false);
|
fetcher.SetAutomaticallyRetryOn5xx(false);
|
||||||
@@ -873,9 +877,9 @@ void CefRequestImpl::Reset() {
|
|||||||
lock_.AssertAcquired();
|
lock_.AssertAcquired();
|
||||||
DCHECK(!read_only_);
|
DCHECK(!read_only_);
|
||||||
|
|
||||||
url_.clear();
|
url_ = GURL();
|
||||||
method_ = "GET";
|
method_ = "GET";
|
||||||
referrer_url_.clear();
|
referrer_url_ = GURL();
|
||||||
referrer_policy_ = REFERRER_POLICY_DEFAULT;
|
referrer_policy_ = REFERRER_POLICY_DEFAULT;
|
||||||
postdata_ = NULL;
|
postdata_ = NULL;
|
||||||
headermap_.clear();
|
headermap_.clear();
|
||||||
@@ -883,7 +887,7 @@ void CefRequestImpl::Reset() {
|
|||||||
transition_type_ = TT_EXPLICIT;
|
transition_type_ = TT_EXPLICIT;
|
||||||
identifier_ = 0U;
|
identifier_ = 0U;
|
||||||
flags_ = UR_FLAG_NONE;
|
flags_ = UR_FLAG_NONE;
|
||||||
first_party_for_cookies_.clear();
|
first_party_for_cookies_ = GURL();
|
||||||
|
|
||||||
changes_ = kChangedNone;
|
changes_ = kChangedNone;
|
||||||
}
|
}
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
#include "third_party/WebKit/public/platform/WebHTTPBody.h"
|
#include "third_party/WebKit/public/platform/WebHTTPBody.h"
|
||||||
|
#include "url/gurl.h"
|
||||||
|
|
||||||
namespace navigation_interception {
|
namespace navigation_interception {
|
||||||
class NavigationParams;
|
class NavigationParams;
|
||||||
@@ -121,9 +122,9 @@ class CefRequestImpl : public CefRequest {
|
|||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
CefString url_;
|
GURL url_;
|
||||||
CefString method_;
|
std::string method_;
|
||||||
CefString referrer_url_;
|
GURL referrer_url_;
|
||||||
ReferrerPolicy referrer_policy_;
|
ReferrerPolicy referrer_policy_;
|
||||||
CefRefPtr<CefPostData> postdata_;
|
CefRefPtr<CefPostData> postdata_;
|
||||||
HeaderMap headermap_;
|
HeaderMap headermap_;
|
||||||
@@ -133,7 +134,7 @@ class CefRequestImpl : public CefRequest {
|
|||||||
|
|
||||||
// The below members are used by CefURLRequest.
|
// The below members are used by CefURLRequest.
|
||||||
int flags_;
|
int flags_;
|
||||||
CefString first_party_for_cookies_;
|
GURL first_party_for_cookies_;
|
||||||
|
|
||||||
// True if this object is read-only.
|
// True if this object is read-only.
|
||||||
bool read_only_;
|
bool read_only_;
|
||||||
|
406
libcef/common/widevine_loader.cc
Normal file
406
libcef/common/widevine_loader.cc
Normal file
@@ -0,0 +1,406 @@
|
|||||||
|
// Copyright 2016 The Chromium Embedded Framework Authors. Portions copyright
|
||||||
|
// 2013 the Chromium 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 "libcef/common/widevine_loader.h"
|
||||||
|
|
||||||
|
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||||
|
|
||||||
|
#include "libcef/browser/context.h"
|
||||||
|
#include "libcef/browser/thread_util.h"
|
||||||
|
#include "libcef/common/cef_switches.h"
|
||||||
|
|
||||||
|
#include "base/command_line.h"
|
||||||
|
#include "base/files/file_util.h"
|
||||||
|
#include "base/json/json_string_value_serializer.h"
|
||||||
|
#include "base/memory/ptr_util.h"
|
||||||
|
#include "base/native_library.h"
|
||||||
|
#include "base/strings/string_number_conversions.h"
|
||||||
|
#include "base/strings/string_split.h"
|
||||||
|
#include "base/strings/utf_string_conversions.h"
|
||||||
|
#include "chrome/common/widevine_cdm_constants.h"
|
||||||
|
#include "content/browser/plugin_service_impl.h"
|
||||||
|
#include "content/public/browser/cdm_service.h"
|
||||||
|
#include "content/public/common/cdm_info.h"
|
||||||
|
#include "content/public/common/content_switches.h"
|
||||||
|
#include "media/cdm/supported_cdm_versions.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
base::LazyInstance<CefWidevineLoader>::Leaky g_widevine_loader =
|
||||||
|
LAZY_INSTANCE_INITIALIZER;
|
||||||
|
|
||||||
|
|
||||||
|
// Based on chrome/browser/component_updater/widevine_cdm_component_installer.cc
|
||||||
|
|
||||||
|
// Name of the Widevine CDM OS in the component manifest.
|
||||||
|
const char kWidevineCdmOs[] =
|
||||||
|
#if defined(OS_MACOSX)
|
||||||
|
"mac";
|
||||||
|
#elif defined(OS_WIN)
|
||||||
|
"win";
|
||||||
|
#else // OS_LINUX, etc. TODO(viettrungluu): Separate out Chrome OS and Android?
|
||||||
|
"linux";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Name of the Widevine CDM architecture in the component manifest.
|
||||||
|
const char kWidevineCdmArch[] =
|
||||||
|
#if defined(ARCH_CPU_X86)
|
||||||
|
"ia32"; // This differs from the component updater which uses "x86".
|
||||||
|
#elif defined(ARCH_CPU_X86_64)
|
||||||
|
"x64";
|
||||||
|
#else // TODO(viettrungluu): Support an ARM check?
|
||||||
|
"???";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The CDM OS and architecture.
|
||||||
|
const char kCdmOsName[] = "os";
|
||||||
|
const char kCdmArchName[] = "arch";
|
||||||
|
|
||||||
|
// The CDM version (e.g. "1.4.8.903").
|
||||||
|
const char kCdmVersionName[] = "version";
|
||||||
|
|
||||||
|
// The CDM manifest includes several custom values, all beginning with "x-cdm-".
|
||||||
|
// All values are strings.
|
||||||
|
// All values that are lists are delimited by commas. No trailing commas.
|
||||||
|
// For example, "1,2,4".
|
||||||
|
const char kCdmValueDelimiter = ',';
|
||||||
|
static_assert(kCdmValueDelimiter == kCdmSupportedCodecsValueDelimiter,
|
||||||
|
"cdm delimiters must match");
|
||||||
|
// The following entries are required.
|
||||||
|
// Interface versions are lists of integers (e.g. "1" or "1,2,4").
|
||||||
|
// These are checked in this file before registering the CDM.
|
||||||
|
// All match the interface versions from content_decryption_module.h that the
|
||||||
|
// CDM supports.
|
||||||
|
// Matches CDM_MODULE_VERSION.
|
||||||
|
const char kCdmModuleVersionsName[] = "x-cdm-module-versions";
|
||||||
|
// Matches supported ContentDecryptionModule_* version(s).
|
||||||
|
const char kCdmInterfaceVersionsName[] = "x-cdm-interface-versions";
|
||||||
|
// Matches supported Host_* version(s).
|
||||||
|
const char kCdmHostVersionsName[] = "x-cdm-host-versions";
|
||||||
|
// The codecs list is a list of simple codec names (e.g. "vp8,vorbis").
|
||||||
|
// The list is passed to other parts of Chrome.
|
||||||
|
const char kCdmCodecsListName[] = "x-cdm-codecs";
|
||||||
|
|
||||||
|
std::unique_ptr<base::DictionaryValue> ParseManifestFile(
|
||||||
|
const base::FilePath& manifest_path) {
|
||||||
|
CEF_REQUIRE_FILET();
|
||||||
|
|
||||||
|
// Manifest file should be < 1kb. Read at most 2kb.
|
||||||
|
std::string manifest_contents;
|
||||||
|
if (!base::ReadFileToStringWithMaxSize(manifest_path, &manifest_contents,
|
||||||
|
2048)) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONStringValueDeserializer deserializer(manifest_contents);
|
||||||
|
std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL));
|
||||||
|
|
||||||
|
if (!manifest.get() || !manifest->IsType(base::Value::TYPE_DICTIONARY))
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
// Transfer ownership to the caller.
|
||||||
|
return base::WrapUnique(
|
||||||
|
static_cast<base::DictionaryValue*>(manifest.release()));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string GetManifestValue(const base::DictionaryValue& manifest,
|
||||||
|
const std::string& key,
|
||||||
|
std::string* error_message) {
|
||||||
|
std::stringstream ss;
|
||||||
|
std::string value;
|
||||||
|
if (!manifest.GetString(key, &value)) {
|
||||||
|
ss << "Manifest missing " << key;
|
||||||
|
*error_message = ss.str();
|
||||||
|
} else if (value.empty()) {
|
||||||
|
ss << "Manifest has empty " << key;
|
||||||
|
*error_message = ss.str();
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef bool (*VersionCheckFunc)(int version);
|
||||||
|
|
||||||
|
bool CheckForCompatibleVersion(const base::DictionaryValue& manifest,
|
||||||
|
const std::string version_name,
|
||||||
|
VersionCheckFunc version_check_func,
|
||||||
|
std::string* error_message) {
|
||||||
|
std::string versions_string =
|
||||||
|
GetManifestValue(manifest, version_name, error_message);
|
||||||
|
if (versions_string.empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (const base::StringPiece& ver_str : base::SplitStringPiece(
|
||||||
|
versions_string, std::string(1, kCdmValueDelimiter),
|
||||||
|
base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
|
||||||
|
int version = 0;
|
||||||
|
if (base::StringToInt(ver_str, &version))
|
||||||
|
if (version_check_func(version))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << "Manifest has no supported " << version_name << " in '" <<
|
||||||
|
versions_string << "'";
|
||||||
|
*error_message = ss.str();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns whether the CDM's OS/platform and module/interface/host API versions,
|
||||||
|
// as specified in the manifest, are compatible with this Chromium binary.
|
||||||
|
bool IsCompatibleWithChrome(const base::DictionaryValue& manifest,
|
||||||
|
std::string* error_message) {
|
||||||
|
return GetManifestValue(manifest, kCdmOsName, error_message) ==
|
||||||
|
kWidevineCdmOs &&
|
||||||
|
GetManifestValue(manifest, kCdmArchName, error_message) ==
|
||||||
|
kWidevineCdmArch &&
|
||||||
|
CheckForCompatibleVersion(manifest,
|
||||||
|
kCdmModuleVersionsName,
|
||||||
|
media::IsSupportedCdmModuleVersion,
|
||||||
|
error_message) &&
|
||||||
|
CheckForCompatibleVersion(manifest,
|
||||||
|
kCdmInterfaceVersionsName,
|
||||||
|
media::IsSupportedCdmInterfaceVersion,
|
||||||
|
error_message) &&
|
||||||
|
CheckForCompatibleVersion(manifest,
|
||||||
|
kCdmHostVersionsName,
|
||||||
|
media::IsSupportedCdmHostVersion,
|
||||||
|
error_message);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Populate the PepperPluginInfo structure.
|
||||||
|
void GetPluginInfo(const base::FilePath& cdm_adapter_path,
|
||||||
|
const base::FilePath& cdm_path,
|
||||||
|
const std::string& cdm_version,
|
||||||
|
const std::string& cdm_codecs,
|
||||||
|
content::PepperPluginInfo* widevine_cdm) {
|
||||||
|
widevine_cdm->is_out_of_process = true;
|
||||||
|
widevine_cdm->path = cdm_adapter_path;
|
||||||
|
widevine_cdm->name = kWidevineCdmDisplayName;
|
||||||
|
widevine_cdm->description = kWidevineCdmDescription +
|
||||||
|
std::string(" (version: ") +
|
||||||
|
cdm_version + ")";
|
||||||
|
widevine_cdm->version = cdm_version;
|
||||||
|
content::WebPluginMimeType widevine_cdm_mime_type(
|
||||||
|
kWidevineCdmPluginMimeType,
|
||||||
|
kWidevineCdmPluginExtension,
|
||||||
|
kWidevineCdmPluginMimeTypeDescription);
|
||||||
|
|
||||||
|
widevine_cdm_mime_type.additional_param_names.push_back(
|
||||||
|
base::ASCIIToUTF16(kCdmSupportedCodecsParamName));
|
||||||
|
widevine_cdm_mime_type.additional_param_values.push_back(
|
||||||
|
base::ASCIIToUTF16(cdm_codecs));
|
||||||
|
|
||||||
|
widevine_cdm->mime_types.push_back(widevine_cdm_mime_type);
|
||||||
|
widevine_cdm->permissions = kWidevineCdmPluginPermissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify and load the contents of |base_path|.
|
||||||
|
cef_cdm_registration_error_t LoadWidevineCdmInfo(
|
||||||
|
const base::FilePath& base_path,
|
||||||
|
base::FilePath* cdm_adapter_path,
|
||||||
|
base::FilePath* cdm_path,
|
||||||
|
std::string* cdm_version,
|
||||||
|
std::string* cdm_codecs,
|
||||||
|
std::string* error_message) {
|
||||||
|
std::stringstream ss;
|
||||||
|
|
||||||
|
*cdm_adapter_path = base_path.AppendASCII(kWidevineCdmAdapterFileName);
|
||||||
|
if (!base::PathExists(*cdm_adapter_path)) {
|
||||||
|
ss << "Missing adapter file " << cdm_adapter_path->value();
|
||||||
|
*error_message = ss.str();
|
||||||
|
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
*cdm_path = base_path.AppendASCII(
|
||||||
|
base::GetNativeLibraryName(kWidevineCdmLibraryName));
|
||||||
|
if (!base::PathExists(*cdm_path)) {
|
||||||
|
ss << "Missing file " << cdm_path->value();
|
||||||
|
*error_message = ss.str();
|
||||||
|
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
base::FilePath manifest_path = base_path.AppendASCII("manifest.json");
|
||||||
|
if (!base::PathExists(manifest_path)) {
|
||||||
|
ss << "Missing manifest file " << manifest_path.value();
|
||||||
|
*error_message = ss.str();
|
||||||
|
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<base::DictionaryValue> manifest =
|
||||||
|
ParseManifestFile(manifest_path);
|
||||||
|
if (!manifest) {
|
||||||
|
ss << "Failed to parse manifest file " << manifest_path.value();
|
||||||
|
*error_message = ss.str();
|
||||||
|
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsCompatibleWithChrome(*manifest, error_message))
|
||||||
|
return CEF_CDM_REGISTRATION_ERROR_INCOMPATIBLE;
|
||||||
|
|
||||||
|
*cdm_version = GetManifestValue(*manifest, kCdmVersionName, error_message);
|
||||||
|
if (cdm_version->empty())
|
||||||
|
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
|
||||||
|
|
||||||
|
*cdm_codecs = GetManifestValue(*manifest, kCdmCodecsListName, error_message);
|
||||||
|
if (cdm_codecs->empty())
|
||||||
|
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
|
||||||
|
|
||||||
|
return CEF_CDM_REGISTRATION_ERROR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeliverWidevineCdmCallback(cef_cdm_registration_error_t result,
|
||||||
|
const std::string& error_message,
|
||||||
|
CefRefPtr<CefRegisterCdmCallback> callback) {
|
||||||
|
CEF_REQUIRE_UIT();
|
||||||
|
|
||||||
|
if (result != CEF_CDM_REGISTRATION_ERROR_NONE)
|
||||||
|
LOG(ERROR) << "Widevine CDM registration failed; " << error_message;
|
||||||
|
|
||||||
|
if (callback)
|
||||||
|
callback->OnCdmRegistrationComplete(result, error_message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterWidevineCdmOnUIThread(
|
||||||
|
const base::FilePath& cdm_adapter_path,
|
||||||
|
const base::FilePath& cdm_path,
|
||||||
|
const std::string& cdm_version,
|
||||||
|
const std::string& cdm_codecs,
|
||||||
|
CefRefPtr<CefRegisterCdmCallback> callback) {
|
||||||
|
CEF_REQUIRE_UIT();
|
||||||
|
|
||||||
|
content::PepperPluginInfo widevine_cdm;
|
||||||
|
GetPluginInfo(cdm_adapter_path, cdm_path, cdm_version, cdm_codecs,
|
||||||
|
&widevine_cdm);
|
||||||
|
|
||||||
|
// true = Add to beginning of list to override any existing registrations.
|
||||||
|
content::PluginService::GetInstance()->RegisterInternalPlugin(
|
||||||
|
widevine_cdm.ToWebPluginInfo(), true);
|
||||||
|
// Tell the browser to refresh the plugin list. Then tell all renderers to
|
||||||
|
// update their plugin list caches.
|
||||||
|
content::PluginService::GetInstance()->RefreshPlugins();
|
||||||
|
content::PluginService::GetInstance()->PurgePluginListCache(NULL, false);
|
||||||
|
|
||||||
|
// Also register Widevine with the CdmService.
|
||||||
|
const std::vector<std::string> codecs = base::SplitString(
|
||||||
|
cdm_codecs, std::string(1, kCdmSupportedCodecsValueDelimiter),
|
||||||
|
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||||
|
content::CdmService::GetInstance()->RegisterCdm(content::CdmInfo(
|
||||||
|
kWidevineCdmType, base::Version(cdm_version), cdm_path, codecs));
|
||||||
|
|
||||||
|
DeliverWidevineCdmCallback(CEF_CDM_REGISTRATION_ERROR_NONE, std::string(),
|
||||||
|
callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoadWidevineCdmInfoOnFileThread(
|
||||||
|
const base::FilePath& base_path,
|
||||||
|
CefRefPtr<CefRegisterCdmCallback> callback) {
|
||||||
|
CEF_REQUIRE_FILET();
|
||||||
|
|
||||||
|
base::FilePath cdm_adapter_path;
|
||||||
|
base::FilePath cdm_path;
|
||||||
|
std::string cdm_version;
|
||||||
|
std::string cdm_codecs;
|
||||||
|
std::string error_message;
|
||||||
|
cef_cdm_registration_error_t result =
|
||||||
|
LoadWidevineCdmInfo(base_path, &cdm_adapter_path, &cdm_path, &cdm_version,
|
||||||
|
&cdm_codecs, &error_message);
|
||||||
|
if (result != CEF_CDM_REGISTRATION_ERROR_NONE) {
|
||||||
|
CEF_POST_TASK(CEF_UIT, base::Bind(DeliverWidevineCdmCallback, result,
|
||||||
|
error_message, callback));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Continue execution on the UI thread.
|
||||||
|
CEF_POST_TASK(CEF_UIT,
|
||||||
|
base::Bind(RegisterWidevineCdmOnUIThread, cdm_adapter_path, cdm_path,
|
||||||
|
cdm_version, cdm_codecs, callback));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
// static
|
||||||
|
CefWidevineLoader* CefWidevineLoader::GetInstance() {
|
||||||
|
return &g_widevine_loader.Get();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefWidevineLoader::LoadWidevineCdm(
|
||||||
|
const base::FilePath& path,
|
||||||
|
CefRefPtr<CefRegisterCdmCallback> callback) {
|
||||||
|
if (!CONTEXT_STATE_VALID()) {
|
||||||
|
// Loading will proceed from OnContextInitialized().
|
||||||
|
load_pending_ = true;
|
||||||
|
path_ = path;
|
||||||
|
callback_ = callback;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Continue execution on the FILE thread.
|
||||||
|
CEF_POST_TASK(CEF_FILET,
|
||||||
|
base::Bind(LoadWidevineCdmInfoOnFileThread, path, callback));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefWidevineLoader::OnContextInitialized() {
|
||||||
|
CEF_REQUIRE_UIT();
|
||||||
|
if (load_pending_) {
|
||||||
|
load_pending_ = false;
|
||||||
|
LoadWidevineCdm(path_, callback_);
|
||||||
|
callback_ = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(OS_LINUX)
|
||||||
|
|
||||||
|
// static
|
||||||
|
void CefWidevineLoader::AddPepperPlugins(
|
||||||
|
std::vector<content::PepperPluginInfo>* plugins) {
|
||||||
|
const base::CommandLine& command_line =
|
||||||
|
*base::CommandLine::ForCurrentProcess();
|
||||||
|
|
||||||
|
// Perform early plugin registration in the zygote process when the sandbox is
|
||||||
|
// enabled to avoid "cannot open shared object file: Operation not permitted"
|
||||||
|
// errors during plugin loading. This is because the Zygote process must pre-
|
||||||
|
// load all plugins before initializing the sandbox.
|
||||||
|
if (command_line.GetSwitchValueASCII(switches::kProcessType) !=
|
||||||
|
switches::kZygoteProcess ||
|
||||||
|
command_line.HasSwitch(switches::kNoSandbox)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The Widevine CDM path is passed to the zygote process via
|
||||||
|
// CefContentBrowserClient::AppendExtraCommandLineSwitches.
|
||||||
|
const base::FilePath& base_path = command_line.GetSwitchValuePath(
|
||||||
|
switches::kWidevineCdmPath);
|
||||||
|
if (base_path.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Load contents of the plugin directory synchronously. This only occurs once
|
||||||
|
// on zygote process startup so should not have a huge performance penalty.
|
||||||
|
base::FilePath cdm_adapter_path;
|
||||||
|
base::FilePath cdm_path;
|
||||||
|
std::string cdm_version;
|
||||||
|
std::string cdm_codecs;
|
||||||
|
std::string error_message;
|
||||||
|
cef_cdm_registration_error_t result =
|
||||||
|
LoadWidevineCdmInfo(base_path, &cdm_adapter_path, &cdm_path, &cdm_version,
|
||||||
|
&cdm_codecs, &error_message);
|
||||||
|
if (result != CEF_CDM_REGISTRATION_ERROR_NONE) {
|
||||||
|
LOG(ERROR) << "Widevine CDM registration failed; " << error_message;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
content::PepperPluginInfo widevine_cdm;
|
||||||
|
GetPluginInfo(cdm_adapter_path, cdm_path, cdm_version, cdm_codecs,
|
||||||
|
&widevine_cdm);
|
||||||
|
plugins->push_back(widevine_cdm);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // defined(OS_LINUX)
|
||||||
|
|
||||||
|
CefWidevineLoader::CefWidevineLoader() {
|
||||||
|
}
|
||||||
|
|
||||||
|
CefWidevineLoader::~CefWidevineLoader() {
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
64
libcef/common/widevine_loader.h
Normal file
64
libcef/common/widevine_loader.h
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
// Copyright 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.
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_COMMON_WIDEVINE_LOADER_H_
|
||||||
|
#define CEF_LIBCEF_COMMON_WIDEVINE_LOADER_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "build/build_config.h"
|
||||||
|
|
||||||
|
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
|
||||||
|
|
||||||
|
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "include/cef_web_plugin.h"
|
||||||
|
|
||||||
|
#include "base/lazy_instance.h"
|
||||||
|
|
||||||
|
namespace content {
|
||||||
|
struct PepperPluginInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
class CefWidevineLoader {
|
||||||
|
public:
|
||||||
|
// Returns the singleton instance of this object.
|
||||||
|
static CefWidevineLoader* GetInstance();
|
||||||
|
|
||||||
|
// Load the Widevine CDM. May be called before or after context creation. See
|
||||||
|
// comments in cef_web_plugin.h.
|
||||||
|
void LoadWidevineCdm(const base::FilePath& path,
|
||||||
|
CefRefPtr<CefRegisterCdmCallback> callback);
|
||||||
|
|
||||||
|
// Plugin registration is triggered here if LoadWidevineCdm() was called
|
||||||
|
// before context creation.
|
||||||
|
void OnContextInitialized();
|
||||||
|
|
||||||
|
#if defined(OS_LINUX)
|
||||||
|
// The zygote process which is used when the sandbox is enabled on Linux
|
||||||
|
// requires early loading of pepper plugins. Other processes will receive
|
||||||
|
// load notification in the usual way.
|
||||||
|
// Called from CefContentClient::AddPepperPlugins.
|
||||||
|
static void AddPepperPlugins(std::vector<content::PepperPluginInfo>* plugins);
|
||||||
|
|
||||||
|
const base::FilePath& path() { return path_; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend struct base::DefaultLazyInstanceTraits<CefWidevineLoader>;
|
||||||
|
|
||||||
|
// Members are only accessed before context initialization or on the UI
|
||||||
|
// thread.
|
||||||
|
bool load_pending_ = false;
|
||||||
|
base::FilePath path_;
|
||||||
|
CefRefPtr<CefRegisterCdmCallback> callback_;
|
||||||
|
|
||||||
|
CefWidevineLoader();
|
||||||
|
~CefWidevineLoader();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_COMMON_WIDEVINE_LOADER_H_
|
@@ -378,6 +378,23 @@ CefString CefDOMNodeImpl::GetElementInnerText() {
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CefRect CefDOMNodeImpl::GetElementBounds() {
|
||||||
|
CefRect rect;
|
||||||
|
if (!VerifyContext())
|
||||||
|
return rect;
|
||||||
|
|
||||||
|
if (!node_.isElementNode()) {
|
||||||
|
NOTREACHED();
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
|
WebElement element = node_.to<blink::WebElement>();
|
||||||
|
blink::WebRect rc = element.boundsInViewport();
|
||||||
|
rect.Set(rc.x, rc.y, rc.width, rc.height);
|
||||||
|
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
void CefDOMNodeImpl::Detach() {
|
void CefDOMNodeImpl::Detach() {
|
||||||
document_ = NULL;
|
document_ = NULL;
|
||||||
node_.assign(WebNode());
|
node_.assign(WebNode());
|
||||||
|
@@ -44,6 +44,7 @@ class CefDOMNodeImpl : public CefDOMNode {
|
|||||||
bool SetElementAttribute(const CefString& attrName,
|
bool SetElementAttribute(const CefString& attrName,
|
||||||
const CefString& value) override;
|
const CefString& value) override;
|
||||||
CefString GetElementInnerText() override;
|
CefString GetElementInnerText() override;
|
||||||
|
CefRect GetElementBounds() override;
|
||||||
|
|
||||||
// Will be called from CefDOMDocumentImpl::Detach().
|
// Will be called from CefDOMDocumentImpl::Detach().
|
||||||
void Detach();
|
void Detach();
|
||||||
|
@@ -162,8 +162,8 @@ void CefFrameImpl::ExecuteJavaScript(const CefString& jsCode,
|
|||||||
|
|
||||||
if (jsCode.empty())
|
if (jsCode.empty())
|
||||||
return;
|
return;
|
||||||
if (startLine < 0)
|
if (startLine < 1)
|
||||||
startLine = 0;
|
startLine = 1;
|
||||||
|
|
||||||
if (frame_) {
|
if (frame_) {
|
||||||
GURL gurl = GURL(scriptUrl.ToString());
|
GURL gurl = GURL(scriptUrl.ToString());
|
||||||
|
@@ -337,6 +337,14 @@ class V8TrackObject : public CefTrackNode {
|
|||||||
return accessor_;
|
return accessor_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void SetInterceptor(CefRefPtr<CefV8Interceptor> interceptor) {
|
||||||
|
interceptor_ = interceptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline CefRefPtr<CefV8Interceptor> GetInterceptor() {
|
||||||
|
return interceptor_;
|
||||||
|
}
|
||||||
|
|
||||||
inline void SetHandler(CefRefPtr<CefV8Handler> handler) {
|
inline void SetHandler(CefRefPtr<CefV8Handler> handler) {
|
||||||
handler_ = handler;
|
handler_ = handler;
|
||||||
}
|
}
|
||||||
@@ -373,6 +381,7 @@ class V8TrackObject : public CefTrackNode {
|
|||||||
private:
|
private:
|
||||||
v8::Isolate* isolate_;
|
v8::Isolate* isolate_;
|
||||||
CefRefPtr<CefV8Accessor> accessor_;
|
CefRefPtr<CefV8Accessor> accessor_;
|
||||||
|
CefRefPtr<CefV8Interceptor> interceptor_;
|
||||||
CefRefPtr<CefV8Handler> handler_;
|
CefRefPtr<CefV8Handler> handler_;
|
||||||
CefRefPtr<CefBase> user_data_;
|
CefRefPtr<CefBase> user_data_;
|
||||||
int external_memory_;
|
int external_memory_;
|
||||||
@@ -645,6 +654,77 @@ void AccessorNameSetterCallbackImpl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Two helper functions for V8 Interceptor callbacks.
|
||||||
|
CefString PropertyToIndex(v8::Local<v8::String> str) {
|
||||||
|
CefString name;
|
||||||
|
GetCefString(str, name);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
int PropertyToIndex(uint32_t index) {
|
||||||
|
return static_cast<int>(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
// V8 Interceptor callbacks.
|
||||||
|
// T == v8::Local<v8::String> for named property handlers and
|
||||||
|
// T == uint32_t for indexed property handlers
|
||||||
|
template<typename T>
|
||||||
|
void InterceptorGetterCallbackImpl(
|
||||||
|
T property,
|
||||||
|
const v8::PropertyCallbackInfo<v8::Value>& info) {
|
||||||
|
v8::Isolate* isolate = info.GetIsolate();
|
||||||
|
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
||||||
|
|
||||||
|
v8::Handle<v8::Object> obj = info.This();
|
||||||
|
CefRefPtr<CefV8Interceptor> interceptorPtr;
|
||||||
|
|
||||||
|
V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
|
||||||
|
if (tracker)
|
||||||
|
interceptorPtr = tracker->GetInterceptor();
|
||||||
|
if (!interceptorPtr.get())
|
||||||
|
return;
|
||||||
|
|
||||||
|
CefRefPtr<CefV8Value> object = new CefV8ValueImpl(isolate, context, obj);
|
||||||
|
CefRefPtr<CefV8Value> retval;
|
||||||
|
CefString exception;
|
||||||
|
interceptorPtr->Get(PropertyToIndex(property), object, retval, exception);
|
||||||
|
if (!exception.empty()) {
|
||||||
|
info.GetReturnValue().Set(isolate->ThrowException(
|
||||||
|
v8::Exception::Error(GetV8String(isolate, exception))));
|
||||||
|
} else {
|
||||||
|
CefV8ValueImpl* retval_impl = static_cast<CefV8ValueImpl*>(retval.get());
|
||||||
|
if (retval_impl && retval_impl->IsValid()) {
|
||||||
|
info.GetReturnValue().Set(retval_impl->GetV8Value(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void InterceptorSetterCallbackImpl(
|
||||||
|
T property,
|
||||||
|
v8::Local<v8::Value> value,
|
||||||
|
const v8::PropertyCallbackInfo<v8::Value>& info) {
|
||||||
|
v8::Isolate* isolate = info.GetIsolate();
|
||||||
|
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
||||||
|
v8::Handle<v8::Object> obj = info.This();
|
||||||
|
CefRefPtr<CefV8Interceptor> interceptorPtr;
|
||||||
|
|
||||||
|
V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
|
||||||
|
if (tracker)
|
||||||
|
interceptorPtr = tracker->GetInterceptor();
|
||||||
|
|
||||||
|
if (!interceptorPtr.get())
|
||||||
|
return;
|
||||||
|
CefRefPtr<CefV8Value> object = new CefV8ValueImpl(isolate, context, obj);
|
||||||
|
CefRefPtr<CefV8Value> cefValue = new CefV8ValueImpl(isolate, context, value);
|
||||||
|
CefString exception;
|
||||||
|
interceptorPtr->Set(PropertyToIndex(property), object, cefValue, exception);
|
||||||
|
if (!exception.empty()) {
|
||||||
|
isolate->ThrowException(
|
||||||
|
v8::Exception::Error(GetV8String(isolate, exception)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// V8 extension registration.
|
// V8 extension registration.
|
||||||
|
|
||||||
class ExtensionWrapper : public v8::Extension {
|
class ExtensionWrapper : public v8::Extension {
|
||||||
@@ -1014,8 +1094,13 @@ bool CefV8ContextImpl::IsSame(CefRefPtr<CefV8Context> that) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool CefV8ContextImpl::Eval(const CefString& code,
|
bool CefV8ContextImpl::Eval(const CefString& code,
|
||||||
|
const CefString& script_url,
|
||||||
|
int start_line,
|
||||||
CefRefPtr<CefV8Value>& retval,
|
CefRefPtr<CefV8Value>& retval,
|
||||||
CefRefPtr<CefV8Exception>& exception) {
|
CefRefPtr<CefV8Exception>& exception) {
|
||||||
|
retval = NULL;
|
||||||
|
exception = NULL;
|
||||||
|
|
||||||
CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false);
|
CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false);
|
||||||
|
|
||||||
if (webkit_glue::IsScriptForbidden())
|
if (webkit_glue::IsScriptForbidden())
|
||||||
@@ -1030,33 +1115,28 @@ bool CefV8ContextImpl::Eval(const CefString& code,
|
|||||||
v8::HandleScope handle_scope(isolate);
|
v8::HandleScope handle_scope(isolate);
|
||||||
v8::Local<v8::Context> context = GetV8Context();
|
v8::Local<v8::Context> context = GetV8Context();
|
||||||
v8::Context::Scope context_scope(context);
|
v8::Context::Scope context_scope(context);
|
||||||
v8::Local<v8::Object> obj = context->Global();
|
|
||||||
|
|
||||||
// Retrieve the eval function.
|
const blink::WebString& source = code.ToString16();
|
||||||
v8::Local<v8::Value> val = obj->Get(v8::String::NewFromUtf8(isolate, "eval"));
|
const blink::WebString& source_url = script_url.ToString16();
|
||||||
if (val.IsEmpty() || !val->IsFunction())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(val);
|
|
||||||
v8::Local<v8::Value> code_val = GetV8String(isolate, code);
|
|
||||||
|
|
||||||
v8::TryCatch try_catch(isolate);
|
v8::TryCatch try_catch(isolate);
|
||||||
try_catch.SetVerbose(true);
|
try_catch.SetVerbose(true);
|
||||||
|
|
||||||
retval = NULL;
|
|
||||||
exception = NULL;
|
|
||||||
|
|
||||||
v8::MaybeLocal<v8::Value> func_rv =
|
v8::MaybeLocal<v8::Value> func_rv =
|
||||||
webkit_glue::CallV8Function(context, func, obj, 1, &code_val,
|
webkit_glue::ExecuteV8ScriptAndReturnValue(source, source_url, start_line,
|
||||||
handle_->isolate());
|
context, isolate, try_catch,
|
||||||
|
blink::AccessControlStatus::NotSharableCrossOrigin);
|
||||||
|
|
||||||
if (try_catch.HasCaught()) {
|
if (try_catch.HasCaught()) {
|
||||||
exception = new CefV8ExceptionImpl(context, try_catch.Message());
|
exception = new CefV8ExceptionImpl(context, try_catch.Message());
|
||||||
return false;
|
return false;
|
||||||
} else if (!func_rv.IsEmpty()) {
|
} else if (!func_rv.IsEmpty()) {
|
||||||
retval = new CefV8ValueImpl(isolate, context, func_rv.ToLocalChecked());
|
retval = new CefV8ValueImpl(isolate, context, func_rv.ToLocalChecked());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
|
NOTREACHED();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::Local<v8::Context> CefV8ContextImpl::GetV8Context() {
|
v8::Local<v8::Context> CefV8ContextImpl::GetV8Context() {
|
||||||
@@ -1260,7 +1340,8 @@ CefRefPtr<CefV8Value> CefV8Value::CreateString(const CefString& value) {
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
CefRefPtr<CefV8Value> CefV8Value::CreateObject(
|
CefRefPtr<CefV8Value> CefV8Value::CreateObject(
|
||||||
CefRefPtr<CefV8Accessor> accessor) {
|
CefRefPtr<CefV8Accessor> accessor,
|
||||||
|
CefRefPtr<CefV8Interceptor> interceptor) {
|
||||||
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL);
|
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL);
|
||||||
|
|
||||||
v8::Isolate* isolate = GetIsolateManager()->isolate();
|
v8::Isolate* isolate = GetIsolateManager()->isolate();
|
||||||
@@ -1272,13 +1353,28 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the new V8 object.
|
// Create the new V8 object. If an interceptor is passed, create object from
|
||||||
v8::Local<v8::Object> obj = v8::Object::New(isolate);
|
// template and set property handlers.
|
||||||
|
v8::Local<v8::Object> obj;
|
||||||
|
if (interceptor.get()) {
|
||||||
|
v8::Local<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(isolate);
|
||||||
|
tmpl->SetNamedPropertyHandler(
|
||||||
|
InterceptorGetterCallbackImpl<v8::Local<v8::String>>,
|
||||||
|
InterceptorSetterCallbackImpl<v8::Local<v8::String>>);
|
||||||
|
|
||||||
|
tmpl->SetIndexedPropertyHandler(InterceptorGetterCallbackImpl<uint32_t>,
|
||||||
|
InterceptorSetterCallbackImpl<uint32_t>);
|
||||||
|
obj = tmpl->NewInstance();
|
||||||
|
} else {
|
||||||
|
obj = v8::Object::New(isolate);
|
||||||
|
}
|
||||||
|
|
||||||
// Create a tracker object that will cause the user data and/or accessor
|
// Create a tracker object that will cause the user data and/or accessor
|
||||||
// reference to be released when the V8 object is destroyed.
|
// and/or interceptor reference to be released when the V8 object is
|
||||||
|
// destroyed.
|
||||||
V8TrackObject* tracker = new V8TrackObject(isolate);
|
V8TrackObject* tracker = new V8TrackObject(isolate);
|
||||||
tracker->SetAccessor(accessor);
|
tracker->SetAccessor(accessor);
|
||||||
|
tracker->SetInterceptor(interceptor);
|
||||||
|
|
||||||
// Attach the tracker object.
|
// Attach the tracker object.
|
||||||
tracker->AttachTo(context, obj);
|
tracker->AttachTo(context, obj);
|
||||||
|
@@ -182,6 +182,8 @@ class CefV8ContextImpl : public CefV8Context {
|
|||||||
bool Exit() override;
|
bool Exit() override;
|
||||||
bool IsSame(CefRefPtr<CefV8Context> that) override;
|
bool IsSame(CefRefPtr<CefV8Context> that) override;
|
||||||
bool Eval(const CefString& code,
|
bool Eval(const CefString& code,
|
||||||
|
const CefString& script_url,
|
||||||
|
int start_line,
|
||||||
CefRefPtr<CefV8Value>& retval,
|
CefRefPtr<CefV8Value>& retval,
|
||||||
CefRefPtr<CefV8Exception>& exception) override;
|
CefRefPtr<CefV8Exception>& exception) override;
|
||||||
|
|
||||||
|
@@ -25,12 +25,14 @@ MSVC_PUSH_WARNING_LEVEL(0);
|
|||||||
#include "third_party/WebKit/public/web/WebViewClient.h"
|
#include "third_party/WebKit/public/web/WebViewClient.h"
|
||||||
|
|
||||||
#include "third_party/WebKit/Source/bindings/core/v8/ScriptController.h"
|
#include "third_party/WebKit/Source/bindings/core/v8/ScriptController.h"
|
||||||
|
#include "third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h"
|
||||||
#include "third_party/WebKit/Source/bindings/core/v8/V8Binding.h"
|
#include "third_party/WebKit/Source/bindings/core/v8/V8Binding.h"
|
||||||
#include "third_party/WebKit/Source/core/dom/Document.h"
|
#include "third_party/WebKit/Source/core/dom/Document.h"
|
||||||
#include "third_party/WebKit/Source/core/dom/Element.h"
|
#include "third_party/WebKit/Source/core/dom/Element.h"
|
||||||
#include "third_party/WebKit/Source/core/dom/Node.h"
|
#include "third_party/WebKit/Source/core/dom/Node.h"
|
||||||
#include "third_party/WebKit/Source/core/editing/serializers/Serialization.h"
|
#include "third_party/WebKit/Source/core/editing/serializers/Serialization.h"
|
||||||
#include "third_party/WebKit/Source/core/frame/LocalFrame.h"
|
#include "third_party/WebKit/Source/core/frame/LocalFrame.h"
|
||||||
|
#include "third_party/WebKit/Source/core/frame/Settings.h"
|
||||||
#include "third_party/WebKit/Source/web/WebLocalFrameImpl.h"
|
#include "third_party/WebKit/Source/web/WebLocalFrameImpl.h"
|
||||||
#include "third_party/WebKit/Source/web/WebViewImpl.h"
|
#include "third_party/WebKit/Source/web/WebViewImpl.h"
|
||||||
MSVC_POP_WARNING();
|
MSVC_POP_WARNING();
|
||||||
@@ -184,6 +186,51 @@ v8::MaybeLocal<v8::Value> CallV8Function(v8::Local<v8::Context> context,
|
|||||||
return func_rv;
|
return func_rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
||||||
|
const blink::WebString& source,
|
||||||
|
const blink::WebString& source_url,
|
||||||
|
int start_line,
|
||||||
|
v8::Local<v8::Context> context,
|
||||||
|
v8::Isolate* isolate,
|
||||||
|
v8::TryCatch& tryCatch,
|
||||||
|
blink::AccessControlStatus accessControlStatus) {
|
||||||
|
// Based on ScriptController::executeScriptAndReturnValue
|
||||||
|
DCHECK(isolate);
|
||||||
|
|
||||||
|
if (start_line < 1)
|
||||||
|
start_line = 1;
|
||||||
|
|
||||||
|
const blink::KURL kurl = source_url.isEmpty() ?
|
||||||
|
blink::KURL() : blink::KURL(blink::ParsedURLString, source_url);
|
||||||
|
|
||||||
|
const blink::ScriptSourceCode ssc = blink::ScriptSourceCode(source, kurl,
|
||||||
|
WTF::TextPosition(WTF::OrdinalNumber::fromOneBasedInt(start_line),
|
||||||
|
WTF::OrdinalNumber::fromZeroBasedInt(0)));
|
||||||
|
|
||||||
|
v8::MaybeLocal<v8::Value> result;
|
||||||
|
|
||||||
|
blink::LocalFrame* frame =
|
||||||
|
toLocalFrame(blink::toFrameIfNotDetached(context));
|
||||||
|
DCHECK(frame);
|
||||||
|
|
||||||
|
if (frame) {
|
||||||
|
blink::V8CacheOptions v8CacheOptions(blink::V8CacheOptionsDefault);
|
||||||
|
if (frame && frame->settings())
|
||||||
|
v8CacheOptions = frame->settings()->v8CacheOptions();
|
||||||
|
|
||||||
|
v8::Local<v8::Script> script;
|
||||||
|
if (!blink::v8Call(blink::V8ScriptRunner::compileScript(ssc, isolate,
|
||||||
|
accessControlStatus, v8CacheOptions), script, tryCatch)) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = blink::V8ScriptRunner::runCompiledScript(isolate, script,
|
||||||
|
blink::toExecutionContext(context));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
bool IsScriptForbidden() {
|
bool IsScriptForbidden() {
|
||||||
return blink::ScriptForbiddenScope::isScriptForbidden();
|
return blink::ScriptForbiddenScope::isScriptForbidden();
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "include/internal/cef_types.h"
|
#include "include/internal/cef_types.h"
|
||||||
|
#include "third_party/WebKit/Source/core/fetch/AccessControlStatus.h"
|
||||||
#include "v8/include/v8.h"
|
#include "v8/include/v8.h"
|
||||||
|
|
||||||
namespace blink {
|
namespace blink {
|
||||||
@@ -52,6 +53,15 @@ v8::MaybeLocal<v8::Value> CallV8Function(v8::Local<v8::Context> context,
|
|||||||
v8::Local<v8::Value> args[],
|
v8::Local<v8::Value> args[],
|
||||||
v8::Isolate* isolate);
|
v8::Isolate* isolate);
|
||||||
|
|
||||||
|
v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
||||||
|
const blink::WebString& source,
|
||||||
|
const blink::WebString& source_url,
|
||||||
|
int start_line,
|
||||||
|
v8::Local<v8::Context> context,
|
||||||
|
v8::Isolate* isolate,
|
||||||
|
v8::TryCatch& tryCatch,
|
||||||
|
blink::AccessControlStatus accessControlStatus);
|
||||||
|
|
||||||
bool IsScriptForbidden();
|
bool IsScriptForbidden();
|
||||||
|
|
||||||
} // webkit_glue
|
} // webkit_glue
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
|
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/drag_data_cpptoc.h"
|
#include "libcef_dll/cpptoc/drag_data_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/navigation_entry_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/request_context_cpptoc.h"
|
#include "libcef_dll/cpptoc/request_context_cpptoc.h"
|
||||||
#include "libcef_dll/ctocpp/client_ctocpp.h"
|
#include "libcef_dll/ctocpp/client_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/download_image_callback_ctocpp.h"
|
#include "libcef_dll/ctocpp/download_image_callback_ctocpp.h"
|
||||||
@@ -938,6 +939,22 @@ void CEF_CALLBACK browser_host_drag_source_system_drag_ended(
|
|||||||
CefBrowserHostCppToC::Get(self)->DragSourceSystemDragEnded();
|
CefBrowserHostCppToC::Get(self)->DragSourceSystemDragEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct _cef_navigation_entry_t* CEF_CALLBACK browser_host_get_visible_navigation_entry(
|
||||||
|
struct _cef_browser_host_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefNavigationEntry> _retval = CefBrowserHostCppToC::Get(
|
||||||
|
self)->GetVisibleNavigationEntry();
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefNavigationEntryCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
@@ -1003,6 +1020,8 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() {
|
|||||||
GetStruct()->drag_source_ended_at = browser_host_drag_source_ended_at;
|
GetStruct()->drag_source_ended_at = browser_host_drag_source_ended_at;
|
||||||
GetStruct()->drag_source_system_drag_ended =
|
GetStruct()->drag_source_system_drag_ended =
|
||||||
browser_host_drag_source_system_drag_ended;
|
browser_host_drag_source_system_drag_ended;
|
||||||
|
GetStruct()->get_visible_navigation_entry =
|
||||||
|
browser_host_get_visible_navigation_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> CefRefPtr<CefBrowserHost> CefCppToC<CefBrowserHostCppToC,
|
template<> CefRefPtr<CefBrowserHost> CefCppToC<CefBrowserHostCppToC,
|
||||||
|
@@ -429,6 +429,21 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_inner_text(
|
|||||||
return _retval.DetachToUserFree();
|
return _retval.DetachToUserFree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cef_rect_t CEF_CALLBACK domnode_get_element_bounds(
|
||||||
|
struct _cef_domnode_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return CefRect();
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_rect_t _retval = CefDOMNodeCppToC::Get(self)->GetElementBounds();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
@@ -461,6 +476,7 @@ CefDOMNodeCppToC::CefDOMNodeCppToC() {
|
|||||||
GetStruct()->get_element_attributes = domnode_get_element_attributes;
|
GetStruct()->get_element_attributes = domnode_get_element_attributes;
|
||||||
GetStruct()->set_element_attribute = domnode_set_element_attribute;
|
GetStruct()->set_element_attribute = domnode_set_element_attribute;
|
||||||
GetStruct()->get_element_inner_text = domnode_get_element_inner_text;
|
GetStruct()->get_element_inner_text = domnode_get_element_inner_text;
|
||||||
|
GetStruct()->get_element_bounds = domnode_get_element_bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> CefRefPtr<CefDOMNode> CefCppToC<CefDOMNodeCppToC, CefDOMNode,
|
template<> CefRefPtr<CefDOMNode> CefCppToC<CefDOMNodeCppToC, CefDOMNode,
|
||||||
|
@@ -55,6 +55,52 @@ void CEF_CALLBACK menu_model_delegate_menu_will_show(
|
|||||||
CefMenuModelCToCpp::Wrap(menu_model));
|
CefMenuModelCToCpp::Wrap(menu_model));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK menu_model_delegate_menu_closed(
|
||||||
|
struct _cef_menu_model_delegate_t* self, cef_menu_model_t* menu_model) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
// Verify param: menu_model; type: refptr_diff
|
||||||
|
DCHECK(menu_model);
|
||||||
|
if (!menu_model)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefMenuModelDelegateCppToC::Get(self)->MenuClosed(
|
||||||
|
CefMenuModelCToCpp::Wrap(menu_model));
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK menu_model_delegate_format_label(
|
||||||
|
struct _cef_menu_model_delegate_t* self, cef_menu_model_t* menu_model,
|
||||||
|
cef_string_t* label) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: menu_model; type: refptr_diff
|
||||||
|
DCHECK(menu_model);
|
||||||
|
if (!menu_model)
|
||||||
|
return 0;
|
||||||
|
// Verify param: label; type: string_byref
|
||||||
|
DCHECK(label);
|
||||||
|
if (!label)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: label; type: string_byref
|
||||||
|
CefString labelStr(label);
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
bool _retval = CefMenuModelDelegateCppToC::Get(self)->FormatLabel(
|
||||||
|
CefMenuModelCToCpp::Wrap(menu_model),
|
||||||
|
labelStr);
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
@@ -63,6 +109,8 @@ void CEF_CALLBACK menu_model_delegate_menu_will_show(
|
|||||||
CefMenuModelDelegateCppToC::CefMenuModelDelegateCppToC() {
|
CefMenuModelDelegateCppToC::CefMenuModelDelegateCppToC() {
|
||||||
GetStruct()->execute_command = menu_model_delegate_execute_command;
|
GetStruct()->execute_command = menu_model_delegate_execute_command;
|
||||||
GetStruct()->menu_will_show = menu_model_delegate_menu_will_show;
|
GetStruct()->menu_will_show = menu_model_delegate_menu_will_show;
|
||||||
|
GetStruct()->menu_closed = menu_model_delegate_menu_closed;
|
||||||
|
GetStruct()->format_label = menu_model_delegate_format_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> CefRefPtr<CefMenuModelDelegate> CefCppToC<CefMenuModelDelegateCppToC,
|
template<> CefRefPtr<CefMenuModelDelegate> CefCppToC<CefMenuModelDelegateCppToC,
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "libcef_dll/cpptoc/navigation_entry_cpptoc.h"
|
#include "libcef_dll/cpptoc/navigation_entry_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/sslstatus_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -153,6 +154,22 @@ int CEF_CALLBACK navigation_entry_get_http_status_code(
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct _cef_sslstatus_t* CEF_CALLBACK navigation_entry_get_sslstatus(
|
||||||
|
struct _cef_navigation_entry_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefSSLStatus> _retval = CefNavigationEntryCppToC::Get(
|
||||||
|
self)->GetSSLStatus();
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefSSLStatusCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
@@ -168,6 +185,7 @@ CefNavigationEntryCppToC::CefNavigationEntryCppToC() {
|
|||||||
GetStruct()->has_post_data = navigation_entry_has_post_data;
|
GetStruct()->has_post_data = navigation_entry_has_post_data;
|
||||||
GetStruct()->get_completion_time = navigation_entry_get_completion_time;
|
GetStruct()->get_completion_time = navigation_entry_get_completion_time;
|
||||||
GetStruct()->get_http_status_code = navigation_entry_get_http_status_code;
|
GetStruct()->get_http_status_code = navigation_entry_get_http_status_code;
|
||||||
|
GetStruct()->get_sslstatus = navigation_entry_get_sslstatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> CefRefPtr<CefNavigationEntry> CefCppToC<CefNavigationEntryCppToC,
|
template<> CefRefPtr<CefNavigationEntry> CefCppToC<CefNavigationEntryCppToC,
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "include/cef_navigation_entry.h"
|
#include "include/cef_navigation_entry.h"
|
||||||
#include "include/capi/cef_navigation_entry_capi.h"
|
#include "include/capi/cef_navigation_entry_capi.h"
|
||||||
|
#include "include/cef_ssl_status.h"
|
||||||
|
#include "include/capi/cef_ssl_status_capi.h"
|
||||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||||
|
|
||||||
// Wrap a C++ class with a C structure.
|
// Wrap a C++ class with a C structure.
|
||||||
|
60
libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc
Normal file
60
libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/register_cdm_callback_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
void CEF_CALLBACK register_cdm_callback_on_cdm_registration_complete(
|
||||||
|
struct _cef_register_cdm_callback_t* self,
|
||||||
|
cef_cdm_registration_error_t result, const cef_string_t* error_message) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
// Unverified params: error_message
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRegisterCdmCallbackCppToC::Get(self)->OnCdmRegistrationComplete(
|
||||||
|
result,
|
||||||
|
CefString(error_message));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefRegisterCdmCallbackCppToC::CefRegisterCdmCallbackCppToC() {
|
||||||
|
GetStruct()->on_cdm_registration_complete =
|
||||||
|
register_cdm_callback_on_cdm_registration_complete;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefRegisterCdmCallback> CefCppToC<CefRegisterCdmCallbackCppToC,
|
||||||
|
CefRegisterCdmCallback, cef_register_cdm_callback_t>::UnwrapDerived(
|
||||||
|
CefWrapperType type, cef_register_cdm_callback_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefRegisterCdmCallbackCppToC,
|
||||||
|
CefRegisterCdmCallback, cef_register_cdm_callback_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefRegisterCdmCallbackCppToC,
|
||||||
|
CefRegisterCdmCallback, cef_register_cdm_callback_t>::kWrapperType =
|
||||||
|
WT_REGISTER_CDM_CALLBACK;
|
37
libcef_dll/cpptoc/register_cdm_callback_cpptoc.h
Normal file
37
libcef_dll/cpptoc/register_cdm_callback_cpptoc.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_REGISTER_CDM_CALLBACK_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_REGISTER_CDM_CALLBACK_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef USING_CEF_SHARED
|
||||||
|
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||||
|
#else // USING_CEF_SHARED
|
||||||
|
|
||||||
|
#include "include/cef_web_plugin.h"
|
||||||
|
#include "include/capi/cef_web_plugin_capi.h"
|
||||||
|
#include "include/cef_browser.h"
|
||||||
|
#include "include/capi/cef_browser_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
|
class CefRegisterCdmCallbackCppToC
|
||||||
|
: public CefCppToC<CefRegisterCdmCallbackCppToC, CefRegisterCdmCallback,
|
||||||
|
cef_register_cdm_callback_t> {
|
||||||
|
public:
|
||||||
|
CefRegisterCdmCallbackCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // USING_CEF_SHARED
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_REGISTER_CDM_CALLBACK_CPPTOC_H_
|
@@ -20,6 +20,8 @@
|
|||||||
#include "libcef_dll/ctocpp/request_callback_ctocpp.h"
|
#include "libcef_dll/ctocpp/request_callback_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/response_ctocpp.h"
|
#include "libcef_dll/ctocpp/response_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/sslinfo_ctocpp.h"
|
#include "libcef_dll/ctocpp/sslinfo_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/x509certificate_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -466,6 +468,56 @@ int CEF_CALLBACK request_handler_on_certificate_error(
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK request_handler_on_select_client_certificate(
|
||||||
|
struct _cef_request_handler_t* self, cef_browser_t* browser, int isProxy,
|
||||||
|
const cef_string_t* host, int port, size_t certificatesCount,
|
||||||
|
struct _cef_x509certificate_t* const* certificates,
|
||||||
|
cef_select_client_certificate_callback_t* callback) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: browser; type: refptr_diff
|
||||||
|
DCHECK(browser);
|
||||||
|
if (!browser)
|
||||||
|
return 0;
|
||||||
|
// Verify param: host; type: string_byref_const
|
||||||
|
DCHECK(host);
|
||||||
|
if (!host)
|
||||||
|
return 0;
|
||||||
|
// Verify param: certificates; type: refptr_vec_diff_byref_const
|
||||||
|
DCHECK(certificatesCount == 0 || certificates);
|
||||||
|
if (certificatesCount > 0 && !certificates)
|
||||||
|
return 0;
|
||||||
|
// Verify param: callback; type: refptr_diff
|
||||||
|
DCHECK(callback);
|
||||||
|
if (!callback)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: certificates; type: refptr_vec_diff_byref_const
|
||||||
|
std::vector<CefRefPtr<CefX509Certificate> > certificatesList;
|
||||||
|
if (certificatesCount > 0) {
|
||||||
|
for (size_t i = 0; i < certificatesCount; ++i) {
|
||||||
|
CefRefPtr<CefX509Certificate> certificatesVal =
|
||||||
|
CefX509CertificateCToCpp::Wrap(certificates[i]);
|
||||||
|
certificatesList.push_back(certificatesVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
bool _retval = CefRequestHandlerCppToC::Get(self)->OnSelectClientCertificate(
|
||||||
|
CefBrowserCToCpp::Wrap(browser),
|
||||||
|
isProxy?true:false,
|
||||||
|
CefString(host),
|
||||||
|
port,
|
||||||
|
certificatesList,
|
||||||
|
CefSelectClientCertificateCallbackCToCpp::Wrap(callback));
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
void CEF_CALLBACK request_handler_on_plugin_crashed(
|
void CEF_CALLBACK request_handler_on_plugin_crashed(
|
||||||
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
||||||
const cef_string_t* plugin_path) {
|
const cef_string_t* plugin_path) {
|
||||||
@@ -546,6 +598,8 @@ CefRequestHandlerCppToC::CefRequestHandlerCppToC() {
|
|||||||
GetStruct()->on_quota_request = request_handler_on_quota_request;
|
GetStruct()->on_quota_request = request_handler_on_quota_request;
|
||||||
GetStruct()->on_protocol_execution = request_handler_on_protocol_execution;
|
GetStruct()->on_protocol_execution = request_handler_on_protocol_execution;
|
||||||
GetStruct()->on_certificate_error = request_handler_on_certificate_error;
|
GetStruct()->on_certificate_error = request_handler_on_certificate_error;
|
||||||
|
GetStruct()->on_select_client_certificate =
|
||||||
|
request_handler_on_select_client_certificate;
|
||||||
GetStruct()->on_plugin_crashed = request_handler_on_plugin_crashed;
|
GetStruct()->on_plugin_crashed = request_handler_on_plugin_crashed;
|
||||||
GetStruct()->on_render_view_ready = request_handler_on_render_view_ready;
|
GetStruct()->on_render_view_ready = request_handler_on_render_view_ready;
|
||||||
GetStruct()->on_render_process_terminated =
|
GetStruct()->on_render_process_terminated =
|
||||||
|
@@ -0,0 +1,63 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/x509certificate_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
void CEF_CALLBACK select_client_certificate_callback_select(
|
||||||
|
struct _cef_select_client_certificate_callback_t* self,
|
||||||
|
struct _cef_x509certificate_t* cert) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
// Unverified params: cert
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefSelectClientCertificateCallbackCppToC::Get(self)->Select(
|
||||||
|
CefX509CertificateCppToC::Unwrap(cert));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefSelectClientCertificateCallbackCppToC::CefSelectClientCertificateCallbackCppToC(
|
||||||
|
) {
|
||||||
|
GetStruct()->select = select_client_certificate_callback_select;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefSelectClientCertificateCallback> CefCppToC<CefSelectClientCertificateCallbackCppToC,
|
||||||
|
CefSelectClientCertificateCallback,
|
||||||
|
cef_select_client_certificate_callback_t>::UnwrapDerived(
|
||||||
|
CefWrapperType type, cef_select_client_certificate_callback_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefSelectClientCertificateCallbackCppToC,
|
||||||
|
CefSelectClientCertificateCallback,
|
||||||
|
cef_select_client_certificate_callback_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefSelectClientCertificateCallbackCppToC,
|
||||||
|
CefSelectClientCertificateCallback,
|
||||||
|
cef_select_client_certificate_callback_t>::kWrapperType =
|
||||||
|
WT_SELECT_CLIENT_CERTIFICATE_CALLBACK;
|
@@ -0,0 +1,36 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_SELECT_CLIENT_CERTIFICATE_CALLBACK_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_SELECT_CLIENT_CERTIFICATE_CALLBACK_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef BUILDING_CEF_SHARED
|
||||||
|
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||||
|
#else // BUILDING_CEF_SHARED
|
||||||
|
|
||||||
|
#include "include/cef_request_handler.h"
|
||||||
|
#include "include/capi/cef_request_handler_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
|
class CefSelectClientCertificateCallbackCppToC
|
||||||
|
: public CefCppToC<CefSelectClientCertificateCallbackCppToC,
|
||||||
|
CefSelectClientCertificateCallback,
|
||||||
|
cef_select_client_certificate_callback_t> {
|
||||||
|
public:
|
||||||
|
CefSelectClientCertificateCallbackCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BUILDING_CEF_SHARED
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_SELECT_CLIENT_CERTIFICATE_CALLBACK_CPPTOC_H_
|
@@ -10,10 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
|
|
||||||
#include "libcef_dll/cpptoc/sslcert_principal_cpptoc.h"
|
|
||||||
#include "libcef_dll/cpptoc/sslinfo_cpptoc.h"
|
#include "libcef_dll/cpptoc/sslinfo_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/x509certificate_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -35,36 +33,7 @@ cef_cert_status_t CEF_CALLBACK sslinfo_get_cert_status(
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK sslinfo_is_cert_status_error(struct _cef_sslinfo_t* self) {
|
struct _cef_x509certificate_t* CEF_CALLBACK sslinfo_get_x509certificate(
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
bool _retval = CefSSLInfoCppToC::Get(self)->IsCertStatusError();
|
|
||||||
|
|
||||||
// Return type: bool
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CEF_CALLBACK sslinfo_is_cert_status_minor_error(
|
|
||||||
struct _cef_sslinfo_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
bool _retval = CefSSLInfoCppToC::Get(self)->IsCertStatusMinorError();
|
|
||||||
|
|
||||||
// Return type: bool
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
cef_sslcert_principal_t* CEF_CALLBACK sslinfo_get_subject(
|
|
||||||
struct _cef_sslinfo_t* self) {
|
struct _cef_sslinfo_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
@@ -73,189 +42,11 @@ cef_sslcert_principal_t* CEF_CALLBACK sslinfo_get_subject(
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefRefPtr<CefSSLCertPrincipal> _retval = CefSSLInfoCppToC::Get(
|
CefRefPtr<CefX509Certificate> _retval = CefSSLInfoCppToC::Get(
|
||||||
self)->GetSubject();
|
self)->GetX509Certificate();
|
||||||
|
|
||||||
// Return type: refptr_same
|
// Return type: refptr_same
|
||||||
return CefSSLCertPrincipalCppToC::Wrap(_retval);
|
return CefX509CertificateCppToC::Wrap(_retval);
|
||||||
}
|
|
||||||
|
|
||||||
cef_sslcert_principal_t* CEF_CALLBACK sslinfo_get_issuer(
|
|
||||||
struct _cef_sslinfo_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefRefPtr<CefSSLCertPrincipal> _retval = CefSSLInfoCppToC::Get(
|
|
||||||
self)->GetIssuer();
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefSSLCertPrincipalCppToC::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct _cef_binary_value_t* CEF_CALLBACK sslinfo_get_serial_number(
|
|
||||||
struct _cef_sslinfo_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefRefPtr<CefBinaryValue> _retval = CefSSLInfoCppToC::Get(
|
|
||||||
self)->GetSerialNumber();
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefBinaryValueCppToC::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
cef_time_t CEF_CALLBACK sslinfo_get_valid_start(struct _cef_sslinfo_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return CefTime();
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
cef_time_t _retval = CefSSLInfoCppToC::Get(self)->GetValidStart();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
cef_time_t CEF_CALLBACK sslinfo_get_valid_expiry(struct _cef_sslinfo_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return CefTime();
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
cef_time_t _retval = CefSSLInfoCppToC::Get(self)->GetValidExpiry();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct _cef_binary_value_t* CEF_CALLBACK sslinfo_get_derencoded(
|
|
||||||
struct _cef_sslinfo_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefRefPtr<CefBinaryValue> _retval = CefSSLInfoCppToC::Get(
|
|
||||||
self)->GetDEREncoded();
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefBinaryValueCppToC::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct _cef_binary_value_t* CEF_CALLBACK sslinfo_get_pemencoded(
|
|
||||||
struct _cef_sslinfo_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefRefPtr<CefBinaryValue> _retval = CefSSLInfoCppToC::Get(
|
|
||||||
self)->GetPEMEncoded();
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefBinaryValueCppToC::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t CEF_CALLBACK sslinfo_get_issuer_chain_size(struct _cef_sslinfo_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
size_t _retval = CefSSLInfoCppToC::Get(self)->GetIssuerChainSize();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CEF_CALLBACK sslinfo_get_derencoded_issuer_chain(
|
|
||||||
struct _cef_sslinfo_t* self, size_t* chainCount,
|
|
||||||
struct _cef_binary_value_t** chain) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return;
|
|
||||||
// Verify param: chain; type: refptr_vec_same_byref
|
|
||||||
DCHECK(chainCount && (*chainCount == 0 || chain));
|
|
||||||
if (!chainCount || (*chainCount > 0 && !chain))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Translate param: chain; type: refptr_vec_same_byref
|
|
||||||
std::vector<CefRefPtr<CefBinaryValue> > chainList;
|
|
||||||
if (chainCount && *chainCount > 0 && chain) {
|
|
||||||
for (size_t i = 0; i < *chainCount; ++i) {
|
|
||||||
chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefSSLInfoCppToC::Get(self)->GetDEREncodedIssuerChain(
|
|
||||||
chainList);
|
|
||||||
|
|
||||||
// Restore param: chain; type: refptr_vec_same_byref
|
|
||||||
if (chainCount && chain) {
|
|
||||||
*chainCount = std::min(chainList.size(), *chainCount);
|
|
||||||
if (*chainCount > 0) {
|
|
||||||
for (size_t i = 0; i < *chainCount; ++i) {
|
|
||||||
chain[i] = CefBinaryValueCppToC::Wrap(chainList[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CEF_CALLBACK sslinfo_get_pemencoded_issuer_chain(
|
|
||||||
struct _cef_sslinfo_t* self, size_t* chainCount,
|
|
||||||
struct _cef_binary_value_t** chain) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return;
|
|
||||||
// Verify param: chain; type: refptr_vec_same_byref
|
|
||||||
DCHECK(chainCount && (*chainCount == 0 || chain));
|
|
||||||
if (!chainCount || (*chainCount > 0 && !chain))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Translate param: chain; type: refptr_vec_same_byref
|
|
||||||
std::vector<CefRefPtr<CefBinaryValue> > chainList;
|
|
||||||
if (chainCount && *chainCount > 0 && chain) {
|
|
||||||
for (size_t i = 0; i < *chainCount; ++i) {
|
|
||||||
chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefSSLInfoCppToC::Get(self)->GetPEMEncodedIssuerChain(
|
|
||||||
chainList);
|
|
||||||
|
|
||||||
// Restore param: chain; type: refptr_vec_same_byref
|
|
||||||
if (chainCount && chain) {
|
|
||||||
*chainCount = std::min(chainList.size(), *chainCount);
|
|
||||||
if (*chainCount > 0) {
|
|
||||||
for (size_t i = 0; i < *chainCount; ++i) {
|
|
||||||
chain[i] = CefBinaryValueCppToC::Wrap(chainList[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
@@ -265,20 +56,7 @@ void CEF_CALLBACK sslinfo_get_pemencoded_issuer_chain(
|
|||||||
|
|
||||||
CefSSLInfoCppToC::CefSSLInfoCppToC() {
|
CefSSLInfoCppToC::CefSSLInfoCppToC() {
|
||||||
GetStruct()->get_cert_status = sslinfo_get_cert_status;
|
GetStruct()->get_cert_status = sslinfo_get_cert_status;
|
||||||
GetStruct()->is_cert_status_error = sslinfo_is_cert_status_error;
|
GetStruct()->get_x509certificate = sslinfo_get_x509certificate;
|
||||||
GetStruct()->is_cert_status_minor_error = sslinfo_is_cert_status_minor_error;
|
|
||||||
GetStruct()->get_subject = sslinfo_get_subject;
|
|
||||||
GetStruct()->get_issuer = sslinfo_get_issuer;
|
|
||||||
GetStruct()->get_serial_number = sslinfo_get_serial_number;
|
|
||||||
GetStruct()->get_valid_start = sslinfo_get_valid_start;
|
|
||||||
GetStruct()->get_valid_expiry = sslinfo_get_valid_expiry;
|
|
||||||
GetStruct()->get_derencoded = sslinfo_get_derencoded;
|
|
||||||
GetStruct()->get_pemencoded = sslinfo_get_pemencoded;
|
|
||||||
GetStruct()->get_issuer_chain_size = sslinfo_get_issuer_chain_size;
|
|
||||||
GetStruct()->get_derencoded_issuer_chain =
|
|
||||||
sslinfo_get_derencoded_issuer_chain;
|
|
||||||
GetStruct()->get_pemencoded_issuer_chain =
|
|
||||||
sslinfo_get_pemencoded_issuer_chain;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> CefRefPtr<CefSSLInfo> CefCppToC<CefSSLInfoCppToC, CefSSLInfo,
|
template<> CefRefPtr<CefSSLInfo> CefCppToC<CefSSLInfoCppToC, CefSSLInfo,
|
||||||
|
122
libcef_dll/cpptoc/sslstatus_cpptoc.cc
Normal file
122
libcef_dll/cpptoc/sslstatus_cpptoc.cc
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/sslstatus_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/x509certificate_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK sslstatus_is_secure_connection(struct _cef_sslstatus_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
bool _retval = CefSSLStatusCppToC::Get(self)->IsSecureConnection();
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_cert_status_t CEF_CALLBACK sslstatus_get_cert_status(
|
||||||
|
struct _cef_sslstatus_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return CERT_STATUS_NONE;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_cert_status_t _retval = CefSSLStatusCppToC::Get(self)->GetCertStatus();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_ssl_version_t CEF_CALLBACK sslstatus_get_sslversion(
|
||||||
|
struct _cef_sslstatus_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return SSL_CONNECTION_VERSION_UNKNOWN;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_ssl_version_t _retval = CefSSLStatusCppToC::Get(self)->GetSSLVersion();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_ssl_content_status_t CEF_CALLBACK sslstatus_get_content_status(
|
||||||
|
struct _cef_sslstatus_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return SSL_CONTENT_NORMAL_CONTENT;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_ssl_content_status_t _retval = CefSSLStatusCppToC::Get(
|
||||||
|
self)->GetContentStatus();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct _cef_x509certificate_t* CEF_CALLBACK sslstatus_get_x509certificate(
|
||||||
|
struct _cef_sslstatus_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefX509Certificate> _retval = CefSSLStatusCppToC::Get(
|
||||||
|
self)->GetX509Certificate();
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefX509CertificateCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefSSLStatusCppToC::CefSSLStatusCppToC() {
|
||||||
|
GetStruct()->is_secure_connection = sslstatus_is_secure_connection;
|
||||||
|
GetStruct()->get_cert_status = sslstatus_get_cert_status;
|
||||||
|
GetStruct()->get_sslversion = sslstatus_get_sslversion;
|
||||||
|
GetStruct()->get_content_status = sslstatus_get_content_status;
|
||||||
|
GetStruct()->get_x509certificate = sslstatus_get_x509certificate;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefSSLStatus> CefCppToC<CefSSLStatusCppToC, CefSSLStatus,
|
||||||
|
cef_sslstatus_t>::UnwrapDerived(CefWrapperType type, cef_sslstatus_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefSSLStatusCppToC, CefSSLStatus,
|
||||||
|
cef_sslstatus_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefSSLStatusCppToC, CefSSLStatus,
|
||||||
|
cef_sslstatus_t>::kWrapperType = WT_SSLSTATUS;
|
36
libcef_dll/cpptoc/sslstatus_cpptoc.h
Normal file
36
libcef_dll/cpptoc/sslstatus_cpptoc.h
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_SSLSTATUS_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_SSLSTATUS_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef BUILDING_CEF_SHARED
|
||||||
|
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||||
|
#else // BUILDING_CEF_SHARED
|
||||||
|
|
||||||
|
#include "include/cef_ssl_status.h"
|
||||||
|
#include "include/capi/cef_ssl_status_capi.h"
|
||||||
|
#include "include/cef_x509_certificate.h"
|
||||||
|
#include "include/capi/cef_x509_certificate_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
|
class CefSSLStatusCppToC
|
||||||
|
: public CefCppToC<CefSSLStatusCppToC, CefSSLStatus, cef_sslstatus_t> {
|
||||||
|
public:
|
||||||
|
CefSSLStatusCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BUILDING_CEF_SHARED
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_SSLSTATUS_CPPTOC_H_
|
@@ -178,8 +178,8 @@ int CEF_CALLBACK v8context_is_same(struct _cef_v8context_t* self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK v8context_eval(struct _cef_v8context_t* self,
|
int CEF_CALLBACK v8context_eval(struct _cef_v8context_t* self,
|
||||||
const cef_string_t* code, struct _cef_v8value_t** retval,
|
const cef_string_t* code, const cef_string_t* script_url, int start_line,
|
||||||
struct _cef_v8exception_t** exception) {
|
struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -197,6 +197,7 @@ int CEF_CALLBACK v8context_eval(struct _cef_v8context_t* self,
|
|||||||
DCHECK(exception);
|
DCHECK(exception);
|
||||||
if (!exception)
|
if (!exception)
|
||||||
return 0;
|
return 0;
|
||||||
|
// Unverified params: script_url
|
||||||
|
|
||||||
// Translate param: retval; type: refptr_same_byref
|
// Translate param: retval; type: refptr_same_byref
|
||||||
CefRefPtr<CefV8Value> retvalPtr;
|
CefRefPtr<CefV8Value> retvalPtr;
|
||||||
@@ -212,6 +213,8 @@ int CEF_CALLBACK v8context_eval(struct _cef_v8context_t* self,
|
|||||||
// Execute
|
// Execute
|
||||||
bool _retval = CefV8ContextCppToC::Get(self)->Eval(
|
bool _retval = CefV8ContextCppToC::Get(self)->Eval(
|
||||||
CefString(code),
|
CefString(code),
|
||||||
|
CefString(script_url),
|
||||||
|
start_line,
|
||||||
retvalPtr,
|
retvalPtr,
|
||||||
exceptionPtr);
|
exceptionPtr);
|
||||||
|
|
||||||
|
234
libcef_dll/cpptoc/v8interceptor_cpptoc.cc
Normal file
234
libcef_dll/cpptoc/v8interceptor_cpptoc.cc
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/v8interceptor_cpptoc.h"
|
||||||
|
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK v8interceptor_get_byname(struct _cef_v8interceptor_t* self,
|
||||||
|
const cef_string_t* name, struct _cef_v8value_t* object,
|
||||||
|
struct _cef_v8value_t** retval, cef_string_t* exception) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: name; type: string_byref_const
|
||||||
|
DCHECK(name);
|
||||||
|
if (!name)
|
||||||
|
return 0;
|
||||||
|
// Verify param: object; type: refptr_diff
|
||||||
|
DCHECK(object);
|
||||||
|
if (!object)
|
||||||
|
return 0;
|
||||||
|
// Verify param: retval; type: refptr_diff_byref
|
||||||
|
DCHECK(retval);
|
||||||
|
if (!retval)
|
||||||
|
return 0;
|
||||||
|
// Verify param: exception; type: string_byref
|
||||||
|
DCHECK(exception);
|
||||||
|
if (!exception)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: retval; type: refptr_diff_byref
|
||||||
|
CefRefPtr<CefV8Value> retvalPtr;
|
||||||
|
if (retval && *retval)
|
||||||
|
retvalPtr = CefV8ValueCToCpp::Wrap(*retval);
|
||||||
|
CefV8Value* retvalOrig = retvalPtr.get();
|
||||||
|
// Translate param: exception; type: string_byref
|
||||||
|
CefString exceptionStr(exception);
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
bool _retval = CefV8InterceptorCppToC::Get(self)->Get(
|
||||||
|
CefString(name),
|
||||||
|
CefV8ValueCToCpp::Wrap(object),
|
||||||
|
retvalPtr,
|
||||||
|
exceptionStr);
|
||||||
|
|
||||||
|
// Restore param: retval; type: refptr_diff_byref
|
||||||
|
if (retval) {
|
||||||
|
if (retvalPtr.get()) {
|
||||||
|
if (retvalPtr.get() != retvalOrig) {
|
||||||
|
*retval = CefV8ValueCToCpp::Unwrap(retvalPtr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
*retval = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK v8interceptor_get_byindex(struct _cef_v8interceptor_t* self,
|
||||||
|
int index, struct _cef_v8value_t* object, struct _cef_v8value_t** retval,
|
||||||
|
cef_string_t* exception) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: index; type: simple_byval
|
||||||
|
DCHECK_GE(index, 0);
|
||||||
|
if (index < 0)
|
||||||
|
return 0;
|
||||||
|
// Verify param: object; type: refptr_diff
|
||||||
|
DCHECK(object);
|
||||||
|
if (!object)
|
||||||
|
return 0;
|
||||||
|
// Verify param: retval; type: refptr_diff_byref
|
||||||
|
DCHECK(retval);
|
||||||
|
if (!retval)
|
||||||
|
return 0;
|
||||||
|
// Verify param: exception; type: string_byref
|
||||||
|
DCHECK(exception);
|
||||||
|
if (!exception)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: retval; type: refptr_diff_byref
|
||||||
|
CefRefPtr<CefV8Value> retvalPtr;
|
||||||
|
if (retval && *retval)
|
||||||
|
retvalPtr = CefV8ValueCToCpp::Wrap(*retval);
|
||||||
|
CefV8Value* retvalOrig = retvalPtr.get();
|
||||||
|
// Translate param: exception; type: string_byref
|
||||||
|
CefString exceptionStr(exception);
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
bool _retval = CefV8InterceptorCppToC::Get(self)->Get(
|
||||||
|
index,
|
||||||
|
CefV8ValueCToCpp::Wrap(object),
|
||||||
|
retvalPtr,
|
||||||
|
exceptionStr);
|
||||||
|
|
||||||
|
// Restore param: retval; type: refptr_diff_byref
|
||||||
|
if (retval) {
|
||||||
|
if (retvalPtr.get()) {
|
||||||
|
if (retvalPtr.get() != retvalOrig) {
|
||||||
|
*retval = CefV8ValueCToCpp::Unwrap(retvalPtr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
*retval = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK v8interceptor_set_byname(struct _cef_v8interceptor_t* self,
|
||||||
|
const cef_string_t* name, struct _cef_v8value_t* object,
|
||||||
|
struct _cef_v8value_t* value, cef_string_t* exception) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: name; type: string_byref_const
|
||||||
|
DCHECK(name);
|
||||||
|
if (!name)
|
||||||
|
return 0;
|
||||||
|
// Verify param: object; type: refptr_diff
|
||||||
|
DCHECK(object);
|
||||||
|
if (!object)
|
||||||
|
return 0;
|
||||||
|
// Verify param: value; type: refptr_diff
|
||||||
|
DCHECK(value);
|
||||||
|
if (!value)
|
||||||
|
return 0;
|
||||||
|
// Verify param: exception; type: string_byref
|
||||||
|
DCHECK(exception);
|
||||||
|
if (!exception)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: exception; type: string_byref
|
||||||
|
CefString exceptionStr(exception);
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
bool _retval = CefV8InterceptorCppToC::Get(self)->Set(
|
||||||
|
CefString(name),
|
||||||
|
CefV8ValueCToCpp::Wrap(object),
|
||||||
|
CefV8ValueCToCpp::Wrap(value),
|
||||||
|
exceptionStr);
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK v8interceptor_set_byindex(struct _cef_v8interceptor_t* self,
|
||||||
|
int index, struct _cef_v8value_t* object, struct _cef_v8value_t* value,
|
||||||
|
cef_string_t* exception) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: index; type: simple_byval
|
||||||
|
DCHECK_GE(index, 0);
|
||||||
|
if (index < 0)
|
||||||
|
return 0;
|
||||||
|
// Verify param: object; type: refptr_diff
|
||||||
|
DCHECK(object);
|
||||||
|
if (!object)
|
||||||
|
return 0;
|
||||||
|
// Verify param: value; type: refptr_diff
|
||||||
|
DCHECK(value);
|
||||||
|
if (!value)
|
||||||
|
return 0;
|
||||||
|
// Verify param: exception; type: string_byref
|
||||||
|
DCHECK(exception);
|
||||||
|
if (!exception)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: exception; type: string_byref
|
||||||
|
CefString exceptionStr(exception);
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
bool _retval = CefV8InterceptorCppToC::Get(self)->Set(
|
||||||
|
index,
|
||||||
|
CefV8ValueCToCpp::Wrap(object),
|
||||||
|
CefV8ValueCToCpp::Wrap(value),
|
||||||
|
exceptionStr);
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefV8InterceptorCppToC::CefV8InterceptorCppToC() {
|
||||||
|
GetStruct()->get_byname = v8interceptor_get_byname;
|
||||||
|
GetStruct()->get_byindex = v8interceptor_get_byindex;
|
||||||
|
GetStruct()->set_byname = v8interceptor_set_byname;
|
||||||
|
GetStruct()->set_byindex = v8interceptor_set_byindex;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefV8Interceptor> CefCppToC<CefV8InterceptorCppToC,
|
||||||
|
CefV8Interceptor, cef_v8interceptor_t>::UnwrapDerived(CefWrapperType type,
|
||||||
|
cef_v8interceptor_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefV8InterceptorCppToC,
|
||||||
|
CefV8Interceptor, cef_v8interceptor_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefV8InterceptorCppToC, CefV8Interceptor,
|
||||||
|
cef_v8interceptor_t>::kWrapperType = WT_V8INTERCEPTOR;
|
35
libcef_dll/cpptoc/v8interceptor_cpptoc.h
Normal file
35
libcef_dll/cpptoc/v8interceptor_cpptoc.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8INTERCEPTOR_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_V8INTERCEPTOR_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef USING_CEF_SHARED
|
||||||
|
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||||
|
#else // USING_CEF_SHARED
|
||||||
|
|
||||||
|
#include "include/cef_v8.h"
|
||||||
|
#include "include/capi/cef_v8_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
|
class CefV8InterceptorCppToC
|
||||||
|
: public CefCppToC<CefV8InterceptorCppToC, CefV8Interceptor,
|
||||||
|
cef_v8interceptor_t> {
|
||||||
|
public:
|
||||||
|
CefV8InterceptorCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // USING_CEF_SHARED
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_V8INTERCEPTOR_CPPTOC_H_
|
@@ -16,6 +16,7 @@
|
|||||||
#include "libcef_dll/ctocpp/base_ctocpp.h"
|
#include "libcef_dll/ctocpp/base_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/v8accessor_ctocpp.h"
|
#include "libcef_dll/ctocpp/v8accessor_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/v8handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/v8handler_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/v8interceptor_ctocpp.h"
|
||||||
#include "libcef_dll/transfer_util.h"
|
#include "libcef_dll/transfer_util.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -117,15 +118,16 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value) {
|
|||||||
return CefV8ValueCppToC::Wrap(_retval);
|
return CefV8ValueCppToC::Wrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_object(
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor,
|
||||||
cef_v8accessor_t* accessor) {
|
cef_v8interceptor_t* interceptor) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
// Unverified params: accessor
|
// Unverified params: accessor, interceptor
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefRefPtr<CefV8Value> _retval = CefV8Value::CreateObject(
|
CefRefPtr<CefV8Value> _retval = CefV8Value::CreateObject(
|
||||||
CefV8AccessorCToCpp::Wrap(accessor));
|
CefV8AccessorCToCpp::Wrap(accessor),
|
||||||
|
CefV8InterceptorCToCpp::Wrap(interceptor));
|
||||||
|
|
||||||
// Return type: refptr_same
|
// Return type: refptr_same
|
||||||
return CefV8ValueCppToC::Wrap(_retval);
|
return CefV8ValueCppToC::Wrap(_retval);
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "libcef_dll/cpptoc/sslcert_principal_cpptoc.h"
|
#include "libcef_dll/cpptoc/x509cert_principal_cpptoc.h"
|
||||||
#include "libcef_dll/transfer_util.h"
|
#include "libcef_dll/transfer_util.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ namespace {
|
|||||||
|
|
||||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_display_name(
|
cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_display_name(
|
||||||
struct _cef_sslcert_principal_t* self) {
|
struct _cef_x509cert_principal_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -27,14 +27,14 @@ cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_display_name(
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefString _retval = CefSSLCertPrincipalCppToC::Get(self)->GetDisplayName();
|
CefString _retval = CefX509CertPrincipalCppToC::Get(self)->GetDisplayName();
|
||||||
|
|
||||||
// Return type: string
|
// Return type: string
|
||||||
return _retval.DetachToUserFree();
|
return _retval.DetachToUserFree();
|
||||||
}
|
}
|
||||||
|
|
||||||
cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_common_name(
|
cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_common_name(
|
||||||
struct _cef_sslcert_principal_t* self) {
|
struct _cef_x509cert_principal_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -42,14 +42,14 @@ cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_common_name(
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefString _retval = CefSSLCertPrincipalCppToC::Get(self)->GetCommonName();
|
CefString _retval = CefX509CertPrincipalCppToC::Get(self)->GetCommonName();
|
||||||
|
|
||||||
// Return type: string
|
// Return type: string
|
||||||
return _retval.DetachToUserFree();
|
return _retval.DetachToUserFree();
|
||||||
}
|
}
|
||||||
|
|
||||||
cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_locality_name(
|
cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_locality_name(
|
||||||
struct _cef_sslcert_principal_t* self) {
|
struct _cef_x509cert_principal_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -57,14 +57,14 @@ cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_locality_name(
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefString _retval = CefSSLCertPrincipalCppToC::Get(self)->GetLocalityName();
|
CefString _retval = CefX509CertPrincipalCppToC::Get(self)->GetLocalityName();
|
||||||
|
|
||||||
// Return type: string
|
// Return type: string
|
||||||
return _retval.DetachToUserFree();
|
return _retval.DetachToUserFree();
|
||||||
}
|
}
|
||||||
|
|
||||||
cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_state_or_province_name(
|
cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_state_or_province_name(
|
||||||
struct _cef_sslcert_principal_t* self) {
|
struct _cef_x509cert_principal_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -72,15 +72,15 @@ cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_state_or_province_name(
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefString _retval = CefSSLCertPrincipalCppToC::Get(
|
CefString _retval = CefX509CertPrincipalCppToC::Get(
|
||||||
self)->GetStateOrProvinceName();
|
self)->GetStateOrProvinceName();
|
||||||
|
|
||||||
// Return type: string
|
// Return type: string
|
||||||
return _retval.DetachToUserFree();
|
return _retval.DetachToUserFree();
|
||||||
}
|
}
|
||||||
|
|
||||||
cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_country_name(
|
cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_country_name(
|
||||||
struct _cef_sslcert_principal_t* self) {
|
struct _cef_x509cert_principal_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -88,14 +88,14 @@ cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_country_name(
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefString _retval = CefSSLCertPrincipalCppToC::Get(self)->GetCountryName();
|
CefString _retval = CefX509CertPrincipalCppToC::Get(self)->GetCountryName();
|
||||||
|
|
||||||
// Return type: string
|
// Return type: string
|
||||||
return _retval.DetachToUserFree();
|
return _retval.DetachToUserFree();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEF_CALLBACK sslcert_principal_get_street_addresses(
|
void CEF_CALLBACK x509cert_principal_get_street_addresses(
|
||||||
struct _cef_sslcert_principal_t* self, cef_string_list_t addresses) {
|
struct _cef_x509cert_principal_t* self, cef_string_list_t addresses) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -111,7 +111,7 @@ void CEF_CALLBACK sslcert_principal_get_street_addresses(
|
|||||||
transfer_string_list_contents(addresses, addressesList);
|
transfer_string_list_contents(addresses, addressesList);
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefSSLCertPrincipalCppToC::Get(self)->GetStreetAddresses(
|
CefX509CertPrincipalCppToC::Get(self)->GetStreetAddresses(
|
||||||
addressesList);
|
addressesList);
|
||||||
|
|
||||||
// Restore param: addresses; type: string_vec_byref
|
// Restore param: addresses; type: string_vec_byref
|
||||||
@@ -119,8 +119,8 @@ void CEF_CALLBACK sslcert_principal_get_street_addresses(
|
|||||||
transfer_string_list_contents(addressesList, addresses);
|
transfer_string_list_contents(addressesList, addresses);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEF_CALLBACK sslcert_principal_get_organization_names(
|
void CEF_CALLBACK x509cert_principal_get_organization_names(
|
||||||
struct _cef_sslcert_principal_t* self, cef_string_list_t names) {
|
struct _cef_x509cert_principal_t* self, cef_string_list_t names) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -136,7 +136,7 @@ void CEF_CALLBACK sslcert_principal_get_organization_names(
|
|||||||
transfer_string_list_contents(names, namesList);
|
transfer_string_list_contents(names, namesList);
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefSSLCertPrincipalCppToC::Get(self)->GetOrganizationNames(
|
CefX509CertPrincipalCppToC::Get(self)->GetOrganizationNames(
|
||||||
namesList);
|
namesList);
|
||||||
|
|
||||||
// Restore param: names; type: string_vec_byref
|
// Restore param: names; type: string_vec_byref
|
||||||
@@ -144,8 +144,8 @@ void CEF_CALLBACK sslcert_principal_get_organization_names(
|
|||||||
transfer_string_list_contents(namesList, names);
|
transfer_string_list_contents(namesList, names);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEF_CALLBACK sslcert_principal_get_organization_unit_names(
|
void CEF_CALLBACK x509cert_principal_get_organization_unit_names(
|
||||||
struct _cef_sslcert_principal_t* self, cef_string_list_t names) {
|
struct _cef_x509cert_principal_t* self, cef_string_list_t names) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -161,7 +161,7 @@ void CEF_CALLBACK sslcert_principal_get_organization_unit_names(
|
|||||||
transfer_string_list_contents(names, namesList);
|
transfer_string_list_contents(names, namesList);
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefSSLCertPrincipalCppToC::Get(self)->GetOrganizationUnitNames(
|
CefX509CertPrincipalCppToC::Get(self)->GetOrganizationUnitNames(
|
||||||
namesList);
|
namesList);
|
||||||
|
|
||||||
// Restore param: names; type: string_vec_byref
|
// Restore param: names; type: string_vec_byref
|
||||||
@@ -169,8 +169,8 @@ void CEF_CALLBACK sslcert_principal_get_organization_unit_names(
|
|||||||
transfer_string_list_contents(namesList, names);
|
transfer_string_list_contents(namesList, names);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEF_CALLBACK sslcert_principal_get_domain_components(
|
void CEF_CALLBACK x509cert_principal_get_domain_components(
|
||||||
struct _cef_sslcert_principal_t* self, cef_string_list_t components) {
|
struct _cef_x509cert_principal_t* self, cef_string_list_t components) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@@ -186,7 +186,7 @@ void CEF_CALLBACK sslcert_principal_get_domain_components(
|
|||||||
transfer_string_list_contents(components, componentsList);
|
transfer_string_list_contents(components, componentsList);
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefSSLCertPrincipalCppToC::Get(self)->GetDomainComponents(
|
CefX509CertPrincipalCppToC::Get(self)->GetDomainComponents(
|
||||||
componentsList);
|
componentsList);
|
||||||
|
|
||||||
// Restore param: components; type: string_vec_byref
|
// Restore param: components; type: string_vec_byref
|
||||||
@@ -199,33 +199,33 @@ void CEF_CALLBACK sslcert_principal_get_domain_components(
|
|||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
CefSSLCertPrincipalCppToC::CefSSLCertPrincipalCppToC() {
|
CefX509CertPrincipalCppToC::CefX509CertPrincipalCppToC() {
|
||||||
GetStruct()->get_display_name = sslcert_principal_get_display_name;
|
GetStruct()->get_display_name = x509cert_principal_get_display_name;
|
||||||
GetStruct()->get_common_name = sslcert_principal_get_common_name;
|
GetStruct()->get_common_name = x509cert_principal_get_common_name;
|
||||||
GetStruct()->get_locality_name = sslcert_principal_get_locality_name;
|
GetStruct()->get_locality_name = x509cert_principal_get_locality_name;
|
||||||
GetStruct()->get_state_or_province_name =
|
GetStruct()->get_state_or_province_name =
|
||||||
sslcert_principal_get_state_or_province_name;
|
x509cert_principal_get_state_or_province_name;
|
||||||
GetStruct()->get_country_name = sslcert_principal_get_country_name;
|
GetStruct()->get_country_name = x509cert_principal_get_country_name;
|
||||||
GetStruct()->get_street_addresses = sslcert_principal_get_street_addresses;
|
GetStruct()->get_street_addresses = x509cert_principal_get_street_addresses;
|
||||||
GetStruct()->get_organization_names =
|
GetStruct()->get_organization_names =
|
||||||
sslcert_principal_get_organization_names;
|
x509cert_principal_get_organization_names;
|
||||||
GetStruct()->get_organization_unit_names =
|
GetStruct()->get_organization_unit_names =
|
||||||
sslcert_principal_get_organization_unit_names;
|
x509cert_principal_get_organization_unit_names;
|
||||||
GetStruct()->get_domain_components = sslcert_principal_get_domain_components;
|
GetStruct()->get_domain_components = x509cert_principal_get_domain_components;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> CefRefPtr<CefSSLCertPrincipal> CefCppToC<CefSSLCertPrincipalCppToC,
|
template<> CefRefPtr<CefX509CertPrincipal> CefCppToC<CefX509CertPrincipalCppToC,
|
||||||
CefSSLCertPrincipal, cef_sslcert_principal_t>::UnwrapDerived(
|
CefX509CertPrincipal, cef_x509cert_principal_t>::UnwrapDerived(
|
||||||
CefWrapperType type, cef_sslcert_principal_t* s) {
|
CefWrapperType type, cef_x509cert_principal_t* s) {
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
template<> base::AtomicRefCount CefCppToC<CefSSLCertPrincipalCppToC,
|
template<> base::AtomicRefCount CefCppToC<CefX509CertPrincipalCppToC,
|
||||||
CefSSLCertPrincipal, cef_sslcert_principal_t>::DebugObjCt = 0;
|
CefX509CertPrincipal, cef_x509cert_principal_t>::DebugObjCt = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<> CefWrapperType CefCppToC<CefSSLCertPrincipalCppToC,
|
template<> CefWrapperType CefCppToC<CefX509CertPrincipalCppToC,
|
||||||
CefSSLCertPrincipal, cef_sslcert_principal_t>::kWrapperType =
|
CefX509CertPrincipal, cef_x509cert_principal_t>::kWrapperType =
|
||||||
WT_SSLCERT_PRINCIPAL;
|
WT_X509CERT_PRINCIPAL;
|
35
libcef_dll/cpptoc/x509cert_principal_cpptoc.h
Normal file
35
libcef_dll/cpptoc/x509cert_principal_cpptoc.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_X509CERT_PRINCIPAL_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_X509CERT_PRINCIPAL_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef BUILDING_CEF_SHARED
|
||||||
|
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||||
|
#else // BUILDING_CEF_SHARED
|
||||||
|
|
||||||
|
#include "include/cef_x509_certificate.h"
|
||||||
|
#include "include/capi/cef_x509_certificate_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
|
class CefX509CertPrincipalCppToC
|
||||||
|
: public CefCppToC<CefX509CertPrincipalCppToC, CefX509CertPrincipal,
|
||||||
|
cef_x509cert_principal_t> {
|
||||||
|
public:
|
||||||
|
CefX509CertPrincipalCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BUILDING_CEF_SHARED
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_X509CERT_PRINCIPAL_CPPTOC_H_
|
254
libcef_dll/cpptoc/x509certificate_cpptoc.cc
Normal file
254
libcef_dll/cpptoc/x509certificate_cpptoc.cc
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
// 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 was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/x509cert_principal_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/x509certificate_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
cef_x509cert_principal_t* CEF_CALLBACK x509certificate_get_subject(
|
||||||
|
struct _cef_x509certificate_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefX509CertPrincipal> _retval = CefX509CertificateCppToC::Get(
|
||||||
|
self)->GetSubject();
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefX509CertPrincipalCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_x509cert_principal_t* CEF_CALLBACK x509certificate_get_issuer(
|
||||||
|
struct _cef_x509certificate_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefX509CertPrincipal> _retval = CefX509CertificateCppToC::Get(
|
||||||
|
self)->GetIssuer();
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefX509CertPrincipalCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_binary_value_t* CEF_CALLBACK x509certificate_get_serial_number(
|
||||||
|
struct _cef_x509certificate_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefBinaryValue> _retval = CefX509CertificateCppToC::Get(
|
||||||
|
self)->GetSerialNumber();
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefBinaryValueCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_time_t CEF_CALLBACK x509certificate_get_valid_start(
|
||||||
|
struct _cef_x509certificate_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return CefTime();
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_time_t _retval = CefX509CertificateCppToC::Get(self)->GetValidStart();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_time_t CEF_CALLBACK x509certificate_get_valid_expiry(
|
||||||
|
struct _cef_x509certificate_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return CefTime();
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_time_t _retval = CefX509CertificateCppToC::Get(self)->GetValidExpiry();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_binary_value_t* CEF_CALLBACK x509certificate_get_derencoded(
|
||||||
|
struct _cef_x509certificate_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefBinaryValue> _retval = CefX509CertificateCppToC::Get(
|
||||||
|
self)->GetDEREncoded();
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefBinaryValueCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
cef_binary_value_t* CEF_CALLBACK x509certificate_get_pemencoded(
|
||||||
|
struct _cef_x509certificate_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefBinaryValue> _retval = CefX509CertificateCppToC::Get(
|
||||||
|
self)->GetPEMEncoded();
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefBinaryValueCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t CEF_CALLBACK x509certificate_get_issuer_chain_size(
|
||||||
|
struct _cef_x509certificate_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
size_t _retval = CefX509CertificateCppToC::Get(self)->GetIssuerChainSize();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK x509certificate_get_derencoded_issuer_chain(
|
||||||
|
struct _cef_x509certificate_t* self, size_t* chainCount,
|
||||||
|
cef_binary_value_t** chain) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
// Verify param: chain; type: refptr_vec_same_byref
|
||||||
|
DCHECK(chainCount && (*chainCount == 0 || chain));
|
||||||
|
if (!chainCount || (*chainCount > 0 && !chain))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Translate param: chain; type: refptr_vec_same_byref
|
||||||
|
std::vector<CefRefPtr<CefBinaryValue> > chainList;
|
||||||
|
if (chainCount && *chainCount > 0 && chain) {
|
||||||
|
for (size_t i = 0; i < *chainCount; ++i) {
|
||||||
|
chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefX509CertificateCppToC::Get(self)->GetDEREncodedIssuerChain(
|
||||||
|
chainList);
|
||||||
|
|
||||||
|
// Restore param: chain; type: refptr_vec_same_byref
|
||||||
|
if (chainCount && chain) {
|
||||||
|
*chainCount = std::min(chainList.size(), *chainCount);
|
||||||
|
if (*chainCount > 0) {
|
||||||
|
for (size_t i = 0; i < *chainCount; ++i) {
|
||||||
|
chain[i] = CefBinaryValueCppToC::Wrap(chainList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK x509certificate_get_pemencoded_issuer_chain(
|
||||||
|
struct _cef_x509certificate_t* self, size_t* chainCount,
|
||||||
|
cef_binary_value_t** chain) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
// Verify param: chain; type: refptr_vec_same_byref
|
||||||
|
DCHECK(chainCount && (*chainCount == 0 || chain));
|
||||||
|
if (!chainCount || (*chainCount > 0 && !chain))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Translate param: chain; type: refptr_vec_same_byref
|
||||||
|
std::vector<CefRefPtr<CefBinaryValue> > chainList;
|
||||||
|
if (chainCount && *chainCount > 0 && chain) {
|
||||||
|
for (size_t i = 0; i < *chainCount; ++i) {
|
||||||
|
chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefX509CertificateCppToC::Get(self)->GetPEMEncodedIssuerChain(
|
||||||
|
chainList);
|
||||||
|
|
||||||
|
// Restore param: chain; type: refptr_vec_same_byref
|
||||||
|
if (chainCount && chain) {
|
||||||
|
*chainCount = std::min(chainList.size(), *chainCount);
|
||||||
|
if (*chainCount > 0) {
|
||||||
|
for (size_t i = 0; i < *chainCount; ++i) {
|
||||||
|
chain[i] = CefBinaryValueCppToC::Wrap(chainList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefX509CertificateCppToC::CefX509CertificateCppToC() {
|
||||||
|
GetStruct()->get_subject = x509certificate_get_subject;
|
||||||
|
GetStruct()->get_issuer = x509certificate_get_issuer;
|
||||||
|
GetStruct()->get_serial_number = x509certificate_get_serial_number;
|
||||||
|
GetStruct()->get_valid_start = x509certificate_get_valid_start;
|
||||||
|
GetStruct()->get_valid_expiry = x509certificate_get_valid_expiry;
|
||||||
|
GetStruct()->get_derencoded = x509certificate_get_derencoded;
|
||||||
|
GetStruct()->get_pemencoded = x509certificate_get_pemencoded;
|
||||||
|
GetStruct()->get_issuer_chain_size = x509certificate_get_issuer_chain_size;
|
||||||
|
GetStruct()->get_derencoded_issuer_chain =
|
||||||
|
x509certificate_get_derencoded_issuer_chain;
|
||||||
|
GetStruct()->get_pemencoded_issuer_chain =
|
||||||
|
x509certificate_get_pemencoded_issuer_chain;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefX509Certificate> CefCppToC<CefX509CertificateCppToC,
|
||||||
|
CefX509Certificate, cef_x509certificate_t>::UnwrapDerived(
|
||||||
|
CefWrapperType type, cef_x509certificate_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefX509CertificateCppToC,
|
||||||
|
CefX509Certificate, cef_x509certificate_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefX509CertificateCppToC,
|
||||||
|
CefX509Certificate, cef_x509certificate_t>::kWrapperType =
|
||||||
|
WT_X509CERTIFICATE;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user