mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
23 Commits
5bafd32ee1
...
3809
Author | SHA1 | Date | |
---|---|---|---|
|
f19c584555 | ||
|
c6d4d854fc | ||
|
dc028ce5ef | ||
|
20d771a9b8 | ||
|
2cf916e6d5 | ||
|
e067612e55 | ||
|
8600e3902d | ||
|
c345089a8a | ||
|
d8a577c0f1 | ||
|
e7c2287181 | ||
|
d98abbb792 | ||
|
a5c0af3554 | ||
|
f84547cd34 | ||
|
6b04492610 | ||
|
52501f158c | ||
|
ffb9266853 | ||
|
cd8efe748c | ||
|
2c7943b121 | ||
|
6223f1bcb4 | ||
|
f8e6d11f35 | ||
|
c8ee94c593 | ||
|
7c91b9ffd0 | ||
|
763dfe6116 |
82
BUILD.gn
82
BUILD.gn
@@ -100,6 +100,7 @@ import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("//build/config/ui.gni")
|
||||
import("//cef/cef_repack_locales.gni")
|
||||
import("//chrome/common/features.gni")
|
||||
import("//content/public/app/mac_helpers.gni")
|
||||
import("//extensions/buildflags/buildflags.gni")
|
||||
import("//media/media_options.gni")
|
||||
import("//mojo/public/tools/bindings/mojom.gni")
|
||||
@@ -600,6 +601,8 @@ static_library("libcef_static") {
|
||||
"libcef/renderer/render_urlrequest_impl.cc",
|
||||
"libcef/renderer/render_urlrequest_impl.h",
|
||||
"libcef/renderer/thread_util.h",
|
||||
"libcef/renderer/url_loader_throttle_provider_impl.cc",
|
||||
"libcef/renderer/url_loader_throttle_provider_impl.h",
|
||||
"libcef/renderer/v8_impl.cc",
|
||||
"libcef/renderer/v8_impl.h",
|
||||
"libcef/utility/content_utility_client.cc",
|
||||
@@ -1701,32 +1704,60 @@ if (is_mac) {
|
||||
]
|
||||
}
|
||||
|
||||
mac_app_bundle("${app_name}_helper_app") {
|
||||
testonly = app_testonly
|
||||
output_name = app_helper_name
|
||||
template("cef_helper_app") {
|
||||
mac_app_bundle(target_name) {
|
||||
assert(defined(invoker.helper_sources))
|
||||
assert(defined(invoker.helper_name_suffix))
|
||||
assert(defined(invoker.helper_bundle_id_suffix))
|
||||
|
||||
sources = invoker.helper_sources
|
||||
testonly = app_testonly
|
||||
output_name = app_helper_name + invoker.helper_name_suffix
|
||||
|
||||
deps = [
|
||||
":cef_make_headers",
|
||||
":cef_sandbox",
|
||||
":libcef_dll_wrapper",
|
||||
]
|
||||
if (defined(invoker.helper_deps)) {
|
||||
deps += invoker.helper_deps
|
||||
sources = invoker.helper_sources
|
||||
|
||||
extra_substitutions = [
|
||||
"BUNDLE_ID_SUFFIX=${invoker.helper_bundle_id_suffix}",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":cef_make_headers",
|
||||
":cef_sandbox",
|
||||
":libcef_dll_wrapper",
|
||||
]
|
||||
if (defined(invoker.helper_deps)) {
|
||||
deps += invoker.helper_deps
|
||||
}
|
||||
|
||||
ldflags = [
|
||||
# The helper is in $app_name.app/Contents/Frameworks/$app_name Helper.app/Contents/MacOS/
|
||||
# so set rpath up to the base.
|
||||
"-rpath",
|
||||
"@executable_path/../../../../../..",
|
||||
]
|
||||
|
||||
info_plist_target = ":${app_name}_helper_plist"
|
||||
|
||||
if (defined(invoker.helper_defines)) {
|
||||
defines = invoker.helper_defines
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ldflags = [
|
||||
# The helper is in $app_name.app/Contents/Frameworks/$app_name Helper.app/Contents/MacOS/
|
||||
# so set rpath up to the base.
|
||||
"-rpath",
|
||||
"@executable_path/../../../../../..",
|
||||
]
|
||||
foreach(helper_params, content_mac_helpers) {
|
||||
_helper_target = helper_params[0]
|
||||
_helper_bundle_id = helper_params[1]
|
||||
_helper_suffix = helper_params[2]
|
||||
cef_helper_app("${app_name}_helper_app_${_helper_target}") {
|
||||
helper_sources = invoker.helper_sources
|
||||
if (defined(invoker.helper_deps)) {
|
||||
helper_deps = invoker.helper_deps
|
||||
}
|
||||
if (defined(invoker.helper_defines)) {
|
||||
helper_defines = invoker.helper_defines
|
||||
}
|
||||
|
||||
info_plist_target = ":${app_name}_helper_plist"
|
||||
|
||||
if (defined(invoker.helper_defines)) {
|
||||
defines = invoker.helper_defines
|
||||
helper_name_suffix = _helper_suffix
|
||||
helper_bundle_id_suffix = _helper_bundle_id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1734,14 +1765,19 @@ if (is_mac) {
|
||||
testonly = app_testonly
|
||||
sources = [
|
||||
"$root_out_dir/$cef_framework_name.framework",
|
||||
"$root_out_dir/$app_helper_name.app",
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
":cef_framework",
|
||||
":${app_name}_helper_app",
|
||||
]
|
||||
|
||||
foreach(helper_params, content_mac_helpers) {
|
||||
sources += [
|
||||
"$root_out_dir/${app_helper_name}${helper_params[2]}.app",
|
||||
]
|
||||
public_deps += [ ":${app_name}_helper_app_${helper_params[0]}" ]
|
||||
}
|
||||
|
||||
outputs = [
|
||||
"{{bundle_contents_dir}}/Frameworks/{{source_file_part}}",
|
||||
]
|
||||
|
@@ -7,5 +7,5 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/76.0.3809.0'
|
||||
'chromium_checkout': 'refs/tags/76.0.3809.132'
|
||||
}
|
||||
|
@@ -346,6 +346,15 @@ if(OS_MACOSX)
|
||||
set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a")
|
||||
set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a")
|
||||
endif()
|
||||
|
||||
# CEF Helper app suffixes.
|
||||
# Format is "<name suffix>:<target suffix>:<plist suffix>".
|
||||
set(CEF_HELPER_APP_SUFFIXES
|
||||
"::"
|
||||
" (GPU):_gpu:.gpu"
|
||||
" (Plugin):_plugin:.plugin"
|
||||
" (Renderer):_renderer:.renderer"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -492,7 +501,10 @@ if(OS_WINDOWS)
|
||||
# Libraries required by cef_sandbox.lib.
|
||||
set(CEF_SANDBOX_STANDARD_LIBS
|
||||
dbghelp.lib
|
||||
PowrProf.lib
|
||||
Propsys.lib
|
||||
psapi.lib
|
||||
SetupAPI.lib
|
||||
version.lib
|
||||
wbemuuid.lib
|
||||
winmm.lib
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f94ec1ef3928002394720160d526ed157282cc7a$
|
||||
// $hash=8c6ffeab9c9183cc5f77929839643767ce5c5c2f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
||||
@@ -151,9 +151,9 @@ typedef struct _cef_resource_handler_t {
|
||||
///
|
||||
// Skip response data when requested by a Range header. Skip over and discard
|
||||
// |bytes_to_skip| bytes of response data. If data is available immediately
|
||||
// set |bytes_skipped| to the number of of bytes skipped and return true (1).
|
||||
// To read the data at a later time set |bytes_skipped| to 0, return true (1)
|
||||
// and execute |callback| when the data is available. To indicate failure set
|
||||
// set |bytes_skipped| to the number of bytes skipped and return true (1). To
|
||||
// read the data at a later time set |bytes_skipped| to 0, return true (1) and
|
||||
// execute |callback| when the data is available. To indicate failure set
|
||||
// |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
|
||||
// function will be called in sequence but not from a dedicated thread.
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=af8ddd4d2d19e5b64d0a40778cb3c62fd5f1d8c9$
|
||||
// $hash=adb3ca1e315a28efed7b2305c8aceb9c5eafdc66$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_
|
||||
@@ -48,7 +48,6 @@
|
||||
#include "include/capi/cef_resource_handler_capi.h"
|
||||
#include "include/capi/cef_response_capi.h"
|
||||
#include "include/capi/cef_response_filter_capi.h"
|
||||
#include "include/internal/cef_types_wrappers.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@@ -34,7 +34,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=467550bc7fb025b069edb9dc65988d8cb9c56fd2$
|
||||
// $hash=23774ff0da7e40bab8244ff4b661b1d9fed24107$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_API_HASH_H_
|
||||
@@ -47,13 +47,13 @@
|
||||
// way that may cause binary incompatibility with other builds. The universal
|
||||
// hash value will change if any platform is affected whereas the platform hash
|
||||
// values will change only if that particular platform is affected.
|
||||
#define CEF_API_HASH_UNIVERSAL "3f2fd465a9dc95ef7d645c0b3c8bdf4e26d9b26e"
|
||||
#define CEF_API_HASH_UNIVERSAL "d04fc15ff27c5a8ee71fee4a88383e5c4bbb7b10"
|
||||
#if defined(OS_WIN)
|
||||
#define CEF_API_HASH_PLATFORM "37fc3765fe0ef3ef7542e6568e5689b3575968a8"
|
||||
#define CEF_API_HASH_PLATFORM "031426ad8eb80ee32fcf3605837cff8d3bbae3a4"
|
||||
#elif defined(OS_MACOSX)
|
||||
#define CEF_API_HASH_PLATFORM "dc61db096a4b62365b16d450fe4f898a9552da6a"
|
||||
#define CEF_API_HASH_PLATFORM "47422c9703f7c32013642707b976d299c72f42cb"
|
||||
#elif defined(OS_LINUX)
|
||||
#define CEF_API_HASH_PLATFORM "059d7243ae34aa5503c96a21ce24a673dddf4e64"
|
||||
#define CEF_API_HASH_PLATFORM "d333fdd7eee13c06f58e586513061ce121121e0b"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -142,7 +142,7 @@ class CefResourceHandler : public virtual CefBaseRefCounted {
|
||||
///
|
||||
// Skip response data when requested by a Range header. Skip over and discard
|
||||
// |bytes_to_skip| bytes of response data. If data is available immediately
|
||||
// set |bytes_skipped| to the number of of bytes skipped and return true. To
|
||||
// set |bytes_skipped| to the number of bytes skipped and return true. To
|
||||
// read the data at a later time set |bytes_skipped| to 0, return true and
|
||||
// execute |callback| when the data is available. To indicate failure set
|
||||
// |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false. This
|
||||
|
@@ -46,7 +46,6 @@
|
||||
#include "include/cef_resource_handler.h"
|
||||
#include "include/cef_response.h"
|
||||
#include "include/cef_response_filter.h"
|
||||
#include "include/internal/cef_types_wrappers.h"
|
||||
|
||||
class CefCookieAccessFilter;
|
||||
|
||||
|
@@ -183,6 +183,13 @@ typedef struct _cef_settings_t {
|
||||
///
|
||||
cef_string_t framework_dir_path;
|
||||
|
||||
///
|
||||
// The path to the main bundle on macOS. If this value is empty then it
|
||||
// defaults to the top-level app bundle. Also configurable using
|
||||
// the "main-bundle-path" command-line switch.
|
||||
///
|
||||
cef_string_t main_bundle_path;
|
||||
|
||||
///
|
||||
// Set to true (1) to have the browser process message loop run in a separate
|
||||
// thread. If false (0) than the CefDoMessageLoopWork() function must be
|
||||
@@ -220,7 +227,7 @@ typedef struct _cef_settings_t {
|
||||
|
||||
///
|
||||
// The location where data for the global browser cache will be stored on
|
||||
// disk. In non-empty this must be either equal to or a child directory of
|
||||
// disk. If non-empty this must be either equal to or a child directory of
|
||||
// CefSettings.root_cache_path. If empty then browsers will be created in
|
||||
// "incognito mode" where in-memory caches are used for storage and no data is
|
||||
// persisted to disk. HTML5 databases such as localStorage will only persist
|
||||
|
@@ -543,7 +543,9 @@ struct CefSettingsTraits {
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->browser_subprocess_path);
|
||||
cef_string_clear(&s->framework_dir_path);
|
||||
cef_string_clear(&s->main_bundle_path);
|
||||
cef_string_clear(&s->cache_path);
|
||||
cef_string_clear(&s->root_cache_path);
|
||||
cef_string_clear(&s->user_data_path);
|
||||
cef_string_clear(&s->user_agent);
|
||||
cef_string_clear(&s->product_version);
|
||||
@@ -565,6 +567,8 @@ struct CefSettingsTraits {
|
||||
&target->browser_subprocess_path, copy);
|
||||
cef_string_set(src->framework_dir_path.str, src->framework_dir_path.length,
|
||||
&target->framework_dir_path, copy);
|
||||
cef_string_set(src->main_bundle_path.str, src->main_bundle_path.length,
|
||||
&target->main_bundle_path, copy);
|
||||
target->multi_threaded_message_loop = src->multi_threaded_message_loop;
|
||||
target->external_message_pump = src->external_message_pump;
|
||||
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
|
||||
@@ -572,6 +576,8 @@ struct CefSettingsTraits {
|
||||
|
||||
cef_string_set(src->cache_path.str, src->cache_path.length,
|
||||
&target->cache_path, copy);
|
||||
cef_string_set(src->root_cache_path.str, src->root_cache_path.length,
|
||||
&target->root_cache_path, copy);
|
||||
cef_string_set(src->user_data_path.str, src->user_data_path.length,
|
||||
&target->user_data_path, copy);
|
||||
target->persist_session_cookies = src->persist_session_cookies;
|
||||
|
@@ -287,6 +287,10 @@ void CefBrowserContext::Initialize() {
|
||||
CefString(&context->settings().accept_language_list);
|
||||
}
|
||||
|
||||
if (!!settings_.persist_session_cookies) {
|
||||
set_should_persist_session_cookies(true);
|
||||
}
|
||||
|
||||
key_ = std::make_unique<ProfileKey>(GetPath());
|
||||
SimpleKeyMap::GetInstance()->Associate(this, key_.get());
|
||||
|
||||
|
@@ -188,6 +188,9 @@ class CefBrowserContext : public ChromeProfileStub,
|
||||
|
||||
// Values checked in ProfileNetworkContextService::CreateNetworkContextParams
|
||||
// when creating the NetworkContext.
|
||||
bool ShouldRestoreOldSessionCookies() override {
|
||||
return should_persist_session_cookies_;
|
||||
}
|
||||
bool ShouldPersistSessionCookies() override {
|
||||
return should_persist_session_cookies_;
|
||||
}
|
||||
|
@@ -62,6 +62,7 @@
|
||||
#include "chrome/browser/net/system_network_context_manager.h"
|
||||
#include "chrome/browser/plugins/plugin_info_host_impl.h"
|
||||
#include "chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h"
|
||||
#include "chrome/browser/plugins/plugin_utils.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
@@ -782,6 +783,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
|
||||
switches::kDisablePackLoading,
|
||||
#if defined(OS_MACOSX)
|
||||
switches::kFrameworkDirPath,
|
||||
switches::kMainBundlePath,
|
||||
#endif
|
||||
switches::kLocalesDirPath,
|
||||
switches::kLogFile,
|
||||
@@ -1442,6 +1444,16 @@ blink::UserAgentMetadata CefContentBrowserClient::GetUserAgentMetadata() const {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
base::flat_set<std::string>
|
||||
CefContentBrowserClient::GetPluginMimeTypesWithExternalHandlers(
|
||||
content::ResourceContext* resource_context) {
|
||||
base::flat_set<std::string> mime_types;
|
||||
auto map = PluginUtils::GetMimeTypeToExtensionIdMap(resource_context);
|
||||
for (const auto& pair : map)
|
||||
mime_types.insert(pair.first);
|
||||
return mime_types;
|
||||
}
|
||||
|
||||
void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) {
|
||||
// Register as a Web-safe scheme so that requests for the scheme from a
|
||||
// render process will be allowed in resource_dispatcher_host_impl.cc
|
||||
|
@@ -211,6 +211,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
std::string GetChromeProduct() const override;
|
||||
std::string GetUserAgent() const override;
|
||||
blink::UserAgentMetadata GetUserAgentMetadata() const override;
|
||||
base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(
|
||||
content::ResourceContext* resource_context) override;
|
||||
|
||||
// Perform browser process registration for the custom scheme.
|
||||
void RegisterCustomScheme(const std::string& scheme);
|
||||
|
@@ -199,7 +199,7 @@ void CefExtensionSystem::Init() {
|
||||
// mime_handler_private.idl), and returns the unique View ID via the
|
||||
// |payload| argument.
|
||||
// 5. The unique View ID arrives in the renderer process via
|
||||
// ResourceLoader::didReceiveData and triggers creation of a new Document.
|
||||
// ResourceLoader::DidReceiveData and triggers creation of a new Document.
|
||||
// DOMImplementation::createDocument indirectly calls
|
||||
// RendererBlinkPlatformImpl::getPluginList to retrieve the list of
|
||||
// supported plugins from the browser process. If a plugin supports the
|
||||
|
@@ -364,14 +364,14 @@ void CefFileDialogManager::OnRunFileChooserDelegateCallback(
|
||||
|
||||
if (!file_paths.empty()) {
|
||||
if (mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) {
|
||||
base_dir = file_paths[0];
|
||||
} else {
|
||||
// Convert FilePath list to SelectedFileInfo list.
|
||||
for (size_t i = 0; i < file_paths.size(); ++i) {
|
||||
auto info = blink::mojom::FileChooserFileInfo::NewNativeFile(
|
||||
blink::mojom::NativeFileInfo::New(file_paths[i], base::string16()));
|
||||
selected_files.push_back(std::move(info));
|
||||
}
|
||||
base_dir = file_paths[0].DirName();
|
||||
}
|
||||
|
||||
// Convert FilePath list to SelectedFileInfo list.
|
||||
for (size_t i = 0; i < file_paths.size(); ++i) {
|
||||
auto info = blink::mojom::FileChooserFileInfo::NewNativeFile(
|
||||
blink::mojom::NativeFileInfo::New(file_paths[i], base::string16()));
|
||||
selected_files.push_back(std::move(info));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -26,8 +26,9 @@
|
||||
(CefJavaScriptDialogRunner::DialogClosedCallback)callback;
|
||||
- (NSAlert*)alert;
|
||||
- (NSTextField*)textField;
|
||||
- (void)alertDidEndWithResult:(NSModalResponse)returnCode
|
||||
dialog:(CefJavaScriptDialogRunnerMac*)dialog;
|
||||
- (void)alertDidEnd:(NSAlert*)alert
|
||||
returnCode:(int)returnCode
|
||||
contextInfo:(void*)contextInfo;
|
||||
- (void)cancel;
|
||||
|
||||
@end
|
||||
@@ -57,8 +58,9 @@
|
||||
return textField_;
|
||||
}
|
||||
|
||||
- (void)alertDidEndWithResult:(NSModalResponse)returnCode
|
||||
dialog:(CefJavaScriptDialogRunnerMac*)dialog {
|
||||
- (void)alertDidEnd:(NSAlert*)alert
|
||||
returnCode:(int)returnCode
|
||||
contextInfo:(void*)contextInfo {
|
||||
if (returnCode == NSModalResponseStop)
|
||||
return;
|
||||
|
||||
@@ -139,11 +141,16 @@ void CefJavaScriptDialogRunnerMac::Run(
|
||||
// around the "callee requires a non-null argument" error that occurs when
|
||||
// building with the 10.11 SDK. See http://crbug.com/383820 for related
|
||||
// discussion.
|
||||
// We can't use the newer beginSheetModalForWindow:completionHandler: variant
|
||||
// because it fails silently when passed a nil argument (see issue #2726).
|
||||
id nilArg = nil;
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[alert beginSheetModalForWindow:nilArg // nil here makes it app-modal
|
||||
completionHandler:^void(NSModalResponse returnCode) {
|
||||
[helper_ alertDidEndWithResult:returnCode dialog:this];
|
||||
}];
|
||||
modalDelegate:helper_
|
||||
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
|
||||
contextInfo:this];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
if ([alert accessoryView])
|
||||
[[alert window] makeFirstResponder:[alert accessoryView]];
|
||||
|
@@ -166,7 +166,32 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
class DestructionObserver : public CefBrowserHostImpl::Observer,
|
||||
public CefContext::Observer {
|
||||
public:
|
||||
DestructionObserver() = default;
|
||||
explicit DestructionObserver(CefBrowserHostImpl* browser) {
|
||||
if (browser) {
|
||||
browser_info_ = browser->browser_info();
|
||||
browser->AddObserver(this);
|
||||
} else {
|
||||
CefContext::Get()->AddObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~DestructionObserver() {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (!registered_)
|
||||
return;
|
||||
|
||||
// Verify that the browser or context still exists before attempting to
|
||||
// remove the observer.
|
||||
if (browser_info_) {
|
||||
auto browser = browser_info_->browser();
|
||||
if (browser)
|
||||
browser->RemoveObserver(this);
|
||||
} else if (CefContext::Get()) {
|
||||
// Network requests may be torn down during shutdown, so we can't check
|
||||
// CONTEXT_STATE_VALID() here.
|
||||
CefContext::Get()->RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
void SetWrapper(base::WeakPtr<InterceptedRequestHandlerWrapper> wrapper) {
|
||||
CEF_REQUIRE_IOT();
|
||||
@@ -176,24 +201,32 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
void OnBrowserDestroyed(CefBrowserHostImpl* browser) override {
|
||||
CEF_REQUIRE_UIT();
|
||||
browser->RemoveObserver(this);
|
||||
registered_ = false;
|
||||
browser_info_ = nullptr;
|
||||
NotifyOnDestroyed();
|
||||
}
|
||||
|
||||
void OnContextDestroyed() override {
|
||||
CEF_REQUIRE_UIT();
|
||||
CefContext::Get()->RemoveObserver(this);
|
||||
registered_ = false;
|
||||
NotifyOnDestroyed();
|
||||
}
|
||||
|
||||
private:
|
||||
void NotifyOnDestroyed() {
|
||||
// It's not safe to test the WeakPtr on the UI thread, so we'll just post
|
||||
// a task which will be ignored if the WeakPtr is invalid.
|
||||
CEF_POST_TASK(CEF_IOT, base::BindOnce(
|
||||
&InterceptedRequestHandlerWrapper::OnDestroyed,
|
||||
wrapper_));
|
||||
if (wrapper_.MaybeValid()) {
|
||||
// This will be a no-op if the WeakPtr is invalid.
|
||||
CEF_POST_TASK(
|
||||
CEF_IOT,
|
||||
base::BindOnce(&InterceptedRequestHandlerWrapper::OnDestroyed,
|
||||
wrapper_));
|
||||
}
|
||||
}
|
||||
|
||||
scoped_refptr<CefBrowserInfo> browser_info_;
|
||||
bool registered_ = true;
|
||||
|
||||
base::WeakPtr<InterceptedRequestHandlerWrapper> wrapper_;
|
||||
DISALLOW_COPY_AND_ASSIGN(DestructionObserver);
|
||||
};
|
||||
@@ -211,25 +244,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
// InterceptedRequestHandlerWrapper::SetInitialized().
|
||||
destruction_observer_->SetWrapper(nullptr);
|
||||
}
|
||||
CEF_POST_TASK(
|
||||
CEF_UIT,
|
||||
base::BindOnce(&InitState::RemoveDestructionObserverOnUIThread,
|
||||
browser_ ? browser_->browser_info() : nullptr,
|
||||
std::move(destruction_observer_)));
|
||||
}
|
||||
}
|
||||
|
||||
static void RemoveDestructionObserverOnUIThread(
|
||||
scoped_refptr<CefBrowserInfo> browser_info,
|
||||
std::unique_ptr<DestructionObserver> observer) {
|
||||
// Verify that the browser or context is still valid before attempting to
|
||||
// remove the observer.
|
||||
if (browser_info) {
|
||||
auto browser = browser_info->browser();
|
||||
if (browser)
|
||||
browser->RemoveObserver(observer.get());
|
||||
} else if (CONTEXT_STATE_VALID()) {
|
||||
CefContext::Get()->RemoveObserver(observer.get());
|
||||
DeleteDestructionObserver();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,15 +268,12 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
// that we can stop accepting new requests and cancel pending/in-progress
|
||||
// requests in a timely manner (e.g. before we start asserting about
|
||||
// leaked objects during CEF shutdown).
|
||||
destruction_observer_.reset(new DestructionObserver());
|
||||
destruction_observer_.reset(new DestructionObserver(browser.get()));
|
||||
|
||||
if (browser) {
|
||||
// These references will be released in OnDestroyed().
|
||||
browser_ = browser;
|
||||
frame_ = frame;
|
||||
browser->AddObserver(destruction_observer_.get());
|
||||
} else {
|
||||
CefContext::Get()->AddObserver(destruction_observer_.get());
|
||||
}
|
||||
|
||||
render_process_id_ = render_process_id;
|
||||
@@ -279,6 +291,17 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
DCHECK(!user_agent_.empty());
|
||||
}
|
||||
|
||||
void DeleteDestructionObserver() {
|
||||
DCHECK(destruction_observer_);
|
||||
CEF_POST_TASK(
|
||||
CEF_UIT,
|
||||
base::BindOnce(&InitState::DeleteDestructionObserverOnUIThread,
|
||||
std::move(destruction_observer_)));
|
||||
}
|
||||
|
||||
static void DeleteDestructionObserverOnUIThread(
|
||||
std::unique_ptr<DestructionObserver> observer) {}
|
||||
|
||||
// Only accessed on the UI thread.
|
||||
content::BrowserContext* browser_context_ = nullptr;
|
||||
|
||||
@@ -697,6 +720,11 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if (state->cookie_filter_) {
|
||||
// Remove the flags that were added in ContinueWithLoadedCookies.
|
||||
request->load_flags &= ~kLoadNoCookiesFlags;
|
||||
}
|
||||
|
||||
if (!state->handler_) {
|
||||
// Cookies may come from a scheme handler.
|
||||
MaybeSaveCookies(
|
||||
@@ -795,11 +823,6 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
base::BindOnce(std::move(callback), response_mode, nullptr, new_url);
|
||||
|
||||
if (response_mode == ResponseMode::RESTART) {
|
||||
if (state->cookie_filter_) {
|
||||
// Remove the flags that were added in ContinueWithLoadedCookies.
|
||||
request->load_flags &= ~kLoadNoCookiesFlags;
|
||||
}
|
||||
|
||||
// Get any cookies after the restart.
|
||||
std::move(exec_callback).Run();
|
||||
return;
|
||||
@@ -1071,8 +1094,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
CEF_REQUIRE_IOT();
|
||||
DCHECK(init_state_);
|
||||
|
||||
DCHECK(init_state_->destruction_observer_);
|
||||
init_state_->destruction_observer_.reset();
|
||||
init_state_->DeleteDestructionObserver();
|
||||
|
||||
// Stop accepting new requests.
|
||||
shutting_down_ = true;
|
||||
@@ -1207,6 +1229,7 @@ void InitOnUIThread(
|
||||
}
|
||||
#endif
|
||||
|
||||
// May return nullptr for requests originating from guest views.
|
||||
browserPtr = CefBrowserHostImpl::GetBrowserForHost(frame);
|
||||
if (browserPtr) {
|
||||
framePtr = browserPtr->GetFrameForHost(frame);
|
||||
@@ -1253,6 +1276,8 @@ std::unique_ptr<InterceptedRequestHandler> CreateInterceptedRequestHandler(
|
||||
if (frame) {
|
||||
render_frame_id = frame->GetRoutingID();
|
||||
frame_tree_node_id = frame->GetFrameTreeNodeId();
|
||||
|
||||
// May return nullptr for requests originating from guest views.
|
||||
browserPtr = CefBrowserHostImpl::GetBrowserForHost(frame);
|
||||
if (browserPtr) {
|
||||
framePtr = browserPtr->GetFrameForHost(frame);
|
||||
|
@@ -953,8 +953,8 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
|
||||
if (render_widget_host_)
|
||||
render_widget_host_->ProgressFlingIfNeeded(frame_time);
|
||||
|
||||
GetCompositor()->context_factory_private()->IssueExternalBeginFrame(
|
||||
GetCompositor(), begin_frame_args);
|
||||
compositor_->context_factory_private()->IssueExternalBeginFrame(
|
||||
compositor_.get(), begin_frame_args);
|
||||
|
||||
if (!IsPopupWidget() && popup_host_view_) {
|
||||
popup_host_view_->SendExternalBeginFrame();
|
||||
@@ -1322,10 +1322,6 @@ void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
|
||||
ReleaseResize();
|
||||
}
|
||||
|
||||
ui::Compositor* CefRenderWidgetHostViewOSR::GetCompositor() const {
|
||||
return compositor_.get();
|
||||
}
|
||||
|
||||
ui::Layer* CefRenderWidgetHostViewOSR::GetRootLayer() const {
|
||||
return root_layer_.get();
|
||||
}
|
||||
@@ -1349,26 +1345,16 @@ void CefRenderWidgetHostViewOSR::SetFrameRate() {
|
||||
if (frame_rate_threshold_us_ != 0)
|
||||
return;
|
||||
|
||||
ui::Compositor* compositor = GetCompositor();
|
||||
|
||||
int frame_rate =
|
||||
osr_util::ClampFrameRate(browser->settings().windowless_frame_rate);
|
||||
|
||||
frame_rate_threshold_us_ = 1000000 / frame_rate;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
if (browser_compositor_) {
|
||||
browser_compositor_->UpdateVSyncParameters(
|
||||
if (compositor_) {
|
||||
compositor_->SetDisplayVSyncParameters(
|
||||
base::TimeTicks::Now(),
|
||||
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us_));
|
||||
}
|
||||
#else
|
||||
if (compositor) {
|
||||
compositor->SetDisplayVSyncParameters(
|
||||
base::TimeTicks::Now(),
|
||||
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us_));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (video_consumer_) {
|
||||
video_consumer_->SetFrameRate(
|
||||
@@ -1430,12 +1416,11 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer(bool force) {
|
||||
local_surface_id_allocation_ =
|
||||
local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation();
|
||||
|
||||
if (GetCompositor()) {
|
||||
if (compositor_) {
|
||||
compositor_local_surface_id_allocator_.GenerateId();
|
||||
GetCompositor()->SetScaleAndSize(current_device_scale_factor_,
|
||||
size_in_pixels,
|
||||
compositor_local_surface_id_allocator_
|
||||
.GetCurrentLocalSurfaceIdAllocation());
|
||||
compositor_->SetScaleAndSize(current_device_scale_factor_, size_in_pixels,
|
||||
compositor_local_surface_id_allocator_
|
||||
.GetCurrentLocalSurfaceIdAllocation());
|
||||
}
|
||||
|
||||
GetDelegatedFrameHost()->EmbedSurface(
|
||||
|
@@ -262,7 +262,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
child_host_view_ = popup_view;
|
||||
}
|
||||
|
||||
ui::Compositor* GetCompositor() const;
|
||||
content::RenderWidgetHostImpl* render_widget_host() const {
|
||||
return render_widget_host_;
|
||||
}
|
||||
|
@@ -437,7 +437,7 @@ void CefWindowImpl::ShowMenu(views::MenuButton* menu_button,
|
||||
base::Bind(&CefWindowImpl::MenuClosed, this)));
|
||||
|
||||
menu_runner_->RunMenuAt(
|
||||
widget_, menu_button->button_controller(),
|
||||
widget_, menu_button ? menu_button->button_controller() : nullptr,
|
||||
gfx::Rect(gfx::Point(screen_point.x, screen_point.y), gfx::Size()),
|
||||
static_cast<views::MenuAnchorPosition>(anchor_position),
|
||||
ui::MENU_SOURCE_NONE);
|
||||
|
@@ -119,6 +119,7 @@ const char kEnableNetSecurityExpiration[] = "enable-net-security-expiration";
|
||||
#if defined(OS_MACOSX)
|
||||
// Path to the framework directory.
|
||||
const char kFrameworkDirPath[] = "framework-dir-path";
|
||||
const char kMainBundlePath[] = "main-bundle-path";
|
||||
#endif
|
||||
|
||||
} // namespace switches
|
||||
|
@@ -55,6 +55,7 @@ extern const char kEnableNetSecurityExpiration[];
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
extern const char kFrameworkDirPath[];
|
||||
extern const char kMainBundlePath[];
|
||||
#endif
|
||||
|
||||
} // namespace switches
|
||||
|
@@ -455,6 +455,13 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
|
||||
if (!file_path.empty())
|
||||
command_line->AppendSwitchPath(switches::kFrameworkDirPath, file_path);
|
||||
}
|
||||
|
||||
if (settings.main_bundle_path.length > 0) {
|
||||
base::FilePath file_path =
|
||||
base::FilePath(CefString(&settings.main_bundle_path));
|
||||
if (!file_path.empty())
|
||||
command_line->AppendSwitchPath(switches::kMainBundlePath, file_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (no_sandbox)
|
||||
@@ -564,6 +571,13 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
|
||||
disable_features.push_back(network::features::kOutOfBlinkCors.name);
|
||||
}
|
||||
|
||||
if (features::kMimeHandlerViewInCrossProcessFrame.default_state ==
|
||||
base::FEATURE_ENABLED_BY_DEFAULT) {
|
||||
// TODO: Add support for cross-process mime handler view (see issue #2727)
|
||||
disable_features.push_back(
|
||||
features::kMimeHandlerViewInCrossProcessFrame.name);
|
||||
}
|
||||
|
||||
if (!disable_features.empty()) {
|
||||
DCHECK(!base::FeatureList::GetInstance());
|
||||
std::string disable_features_str =
|
||||
|
@@ -65,6 +65,12 @@ base::FilePath GetMainProcessPath() {
|
||||
}
|
||||
|
||||
base::FilePath GetMainBundlePath() {
|
||||
base::FilePath main_bundle_path =
|
||||
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
|
||||
switches::kMainBundlePath);
|
||||
if (!main_bundle_path.empty())
|
||||
return main_bundle_path;
|
||||
|
||||
return base::mac::GetAppBundlePath(GetMainProcessPath());
|
||||
}
|
||||
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "libcef/renderer/render_message_filter.h"
|
||||
#include "libcef/renderer/render_thread_observer.h"
|
||||
#include "libcef/renderer/thread_util.h"
|
||||
#include "libcef/renderer/url_loader_throttle_provider_impl.h"
|
||||
#include "libcef/renderer/v8_impl.h"
|
||||
|
||||
#include "base/command_line.h"
|
||||
@@ -53,6 +54,7 @@
|
||||
#include "chrome/common/constants.mojom.h"
|
||||
#include "chrome/common/url_constants.h"
|
||||
#include "chrome/renderer/chrome_content_renderer_client.h"
|
||||
#include "chrome/renderer/extensions/chrome_extensions_renderer_client.h"
|
||||
#include "chrome/renderer/loadtimes_extension_bindings.h"
|
||||
#include "chrome/renderer/media/chrome_key_systems.h"
|
||||
#include "chrome/renderer/pepper/chrome_pdf_print_client.h"
|
||||
@@ -74,6 +76,7 @@
|
||||
#include "content/public/common/content_constants.h"
|
||||
#include "content/public/common/content_paths.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/common/mime_handler_view_mode.h"
|
||||
#include "content/public/renderer/plugin_instance_throttler.h"
|
||||
#include "content/public/renderer/render_view.h"
|
||||
#include "content/public/renderer/render_view_visitor.h"
|
||||
@@ -497,6 +500,46 @@ void CefContentRendererClient::RenderViewCreated(
|
||||
MaybeCreateBrowser(render_view, render_view->GetMainRenderFrame());
|
||||
}
|
||||
|
||||
bool CefContentRendererClient::IsPluginHandledExternally(
|
||||
content::RenderFrame* render_frame,
|
||||
const blink::WebElement& plugin_element,
|
||||
const GURL& original_url,
|
||||
const std::string& mime_type) {
|
||||
if (!extensions::ExtensionsEnabled())
|
||||
return false;
|
||||
|
||||
DCHECK(plugin_element.HasHTMLTagName("object") ||
|
||||
plugin_element.HasHTMLTagName("embed"));
|
||||
if (!content::MimeHandlerViewMode::UsesCrossProcessFrame())
|
||||
return false;
|
||||
// Blink will next try to load a WebPlugin which would end up in
|
||||
// OverrideCreatePlugin, sending another IPC only to find out the plugin is
|
||||
// not supported. Here it suffices to return false but there should perhaps be
|
||||
// a more unified approach to avoid sending the IPC twice.
|
||||
chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New();
|
||||
ChromeContentRendererClient::GetPluginInfoHost()->GetPluginInfo(
|
||||
render_frame->GetRoutingID(), original_url,
|
||||
render_frame->GetWebFrame()->Top()->GetSecurityOrigin(), mime_type,
|
||||
&plugin_info);
|
||||
// TODO(ekaramad): Not continuing here due to a disallowed status should take
|
||||
// us to CreatePlugin. See if more in depths investigation of |status| is
|
||||
// necessary here (see https://crbug.com/965747). For now, returning false
|
||||
// should take us to CreatePlugin after HTMLPlugInElement which is called
|
||||
// through HTMLPlugInElement::LoadPlugin code path.
|
||||
if (plugin_info->status != chrome::mojom::PluginStatus::kAllowed &&
|
||||
plugin_info->status !=
|
||||
chrome::mojom::PluginStatus::kPlayImportantContent) {
|
||||
// We could get here when a MimeHandlerView is loaded inside a <webview>
|
||||
// which is using permissions API (see WebViewPluginTests).
|
||||
ChromeExtensionsRendererClient::DidBlockMimeHandlerViewForDisallowedPlugin(
|
||||
plugin_element);
|
||||
return false;
|
||||
}
|
||||
return ChromeExtensionsRendererClient::MaybeCreateMimeHandlerView(
|
||||
plugin_element, original_url, plugin_info->actual_mime_type,
|
||||
plugin_info->plugin);
|
||||
}
|
||||
|
||||
bool CefContentRendererClient::OverrideCreatePlugin(
|
||||
content::RenderFrame* render_frame,
|
||||
const blink::WebPluginParams& params,
|
||||
@@ -608,12 +651,28 @@ void CefContentRendererClient::RunScriptsAtDocumentIdle(
|
||||
}
|
||||
|
||||
void CefContentRendererClient::DevToolsAgentAttached() {
|
||||
CEF_REQUIRE_RT();
|
||||
// WebWorkers may be creating agents on a different thread.
|
||||
if (!render_task_runner_->BelongsToCurrentThread()) {
|
||||
render_task_runner_->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&CefContentRendererClient::DevToolsAgentAttached,
|
||||
base::Unretained(this)));
|
||||
return;
|
||||
}
|
||||
|
||||
++devtools_agent_count_;
|
||||
}
|
||||
|
||||
void CefContentRendererClient::DevToolsAgentDetached() {
|
||||
CEF_REQUIRE_RT();
|
||||
// WebWorkers may be creating agents on a different thread.
|
||||
if (!render_task_runner_->BelongsToCurrentThread()) {
|
||||
render_task_runner_->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&CefContentRendererClient::DevToolsAgentDetached,
|
||||
base::Unretained(this)));
|
||||
return;
|
||||
}
|
||||
|
||||
--devtools_agent_count_;
|
||||
if (devtools_agent_count_ == 0 && uncaught_exception_stack_size_ > 0) {
|
||||
// When the last DevToolsAgent is detached the stack size is set to 0.
|
||||
@@ -628,6 +687,12 @@ void CefContentRendererClient::CreateRendererService(
|
||||
service_binding_.Bind(std::move(service_request));
|
||||
}
|
||||
|
||||
std::unique_ptr<content::URLLoaderThrottleProvider>
|
||||
CefContentRendererClient::CreateURLLoaderThrottleProvider(
|
||||
content::URLLoaderThrottleProviderType provider_type) {
|
||||
return std::make_unique<CefURLLoaderThrottleProviderImpl>(provider_type);
|
||||
}
|
||||
|
||||
void CefContentRendererClient::OnBindInterface(
|
||||
const service_manager::BindSourceInfo& remote_info,
|
||||
const std::string& name,
|
||||
|
@@ -106,6 +106,10 @@ class CefContentRendererClient
|
||||
void RenderThreadConnected() override;
|
||||
void RenderFrameCreated(content::RenderFrame* render_frame) override;
|
||||
void RenderViewCreated(content::RenderView* render_view) override;
|
||||
bool IsPluginHandledExternally(content::RenderFrame* render_frame,
|
||||
const blink::WebElement& plugin_element,
|
||||
const GURL& original_url,
|
||||
const std::string& mime_type) override;
|
||||
bool OverrideCreatePlugin(content::RenderFrame* render_frame,
|
||||
const blink::WebPluginParams& params,
|
||||
blink::WebPlugin** plugin) override;
|
||||
@@ -138,6 +142,9 @@ class CefContentRendererClient
|
||||
void DevToolsAgentDetached() override;
|
||||
void CreateRendererService(
|
||||
service_manager::mojom::ServiceRequest service_request) override;
|
||||
std::unique_ptr<content::URLLoaderThrottleProvider>
|
||||
CreateURLLoaderThrottleProvider(
|
||||
content::URLLoaderThrottleProviderType provider_type) override;
|
||||
|
||||
// service_manager::Service implementation.
|
||||
void OnBindInterface(const service_manager::BindSourceInfo& remote_info,
|
||||
|
78
libcef/renderer/url_loader_throttle_provider_impl.cc
Normal file
78
libcef/renderer/url_loader_throttle_provider_impl.cc
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright 2018 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/renderer/url_loader_throttle_provider_impl.h"
|
||||
|
||||
#include "libcef/common/extensions/extensions_util.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/feature_list.h"
|
||||
#include "content/public/common/content_features.h"
|
||||
#include "content/public/renderer/render_frame.h"
|
||||
#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "third_party/blink/public/platform/web_url.h"
|
||||
|
||||
CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl(
|
||||
content::URLLoaderThrottleProviderType type)
|
||||
: type_(type) {
|
||||
DETACH_FROM_THREAD(thread_checker_);
|
||||
}
|
||||
|
||||
CefURLLoaderThrottleProviderImpl::~CefURLLoaderThrottleProviderImpl() {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
}
|
||||
|
||||
CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl(
|
||||
const CefURLLoaderThrottleProviderImpl& other)
|
||||
: type_(other.type_) {
|
||||
DETACH_FROM_THREAD(thread_checker_);
|
||||
}
|
||||
|
||||
std::unique_ptr<content::URLLoaderThrottleProvider>
|
||||
CefURLLoaderThrottleProviderImpl::Clone() {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
return base::WrapUnique(new CefURLLoaderThrottleProviderImpl(*this));
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<content::URLLoaderThrottle>>
|
||||
CefURLLoaderThrottleProviderImpl::CreateThrottles(
|
||||
int render_frame_id,
|
||||
const blink::WebURLRequest& request,
|
||||
content::ResourceType resource_type) {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
|
||||
std::vector<std::unique_ptr<content::URLLoaderThrottle>> throttles;
|
||||
|
||||
bool network_service_enabled =
|
||||
base::FeatureList::IsEnabled(network::features::kNetworkService);
|
||||
// Some throttles have already been added in the browser for frame resources.
|
||||
// Don't add them for frame requests.
|
||||
bool is_frame_resource = content::IsResourceTypeFrame(resource_type);
|
||||
|
||||
DCHECK(!is_frame_resource ||
|
||||
type_ == content::URLLoaderThrottleProviderType::kFrame);
|
||||
|
||||
if (extensions::ExtensionsEnabled() && network_service_enabled &&
|
||||
type_ == content::URLLoaderThrottleProviderType::kFrame &&
|
||||
resource_type == content::ResourceType::kObject) {
|
||||
content::RenderFrame* render_frame =
|
||||
content::RenderFrame::FromRoutingID(render_frame_id);
|
||||
auto mime_handlers =
|
||||
extensions::MimeHandlerViewContainer::FromRenderFrame(render_frame);
|
||||
GURL gurl(request.Url());
|
||||
for (auto* handler : mime_handlers) {
|
||||
auto throttle = handler->MaybeCreatePluginThrottle(gurl);
|
||||
if (throttle) {
|
||||
throttles.push_back(std::move(throttle));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return throttles;
|
||||
}
|
||||
|
||||
void CefURLLoaderThrottleProviderImpl::SetOnline(bool is_online) {}
|
45
libcef/renderer/url_loader_throttle_provider_impl.h
Normal file
45
libcef/renderer/url_loader_throttle_provider_impl.h
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2018 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 CEF_LIBCEF_RENDERER_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_
|
||||
#define CEF_LIBCEF_RENDERER_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "content/public/renderer/url_loader_throttle_provider.h"
|
||||
|
||||
// Instances must be constructed on the render thread, and then used and
|
||||
// destructed on a single thread, which can be different from the render thread.
|
||||
class CefURLLoaderThrottleProviderImpl
|
||||
: public content::URLLoaderThrottleProvider {
|
||||
public:
|
||||
explicit CefURLLoaderThrottleProviderImpl(
|
||||
content::URLLoaderThrottleProviderType type);
|
||||
|
||||
~CefURLLoaderThrottleProviderImpl() override;
|
||||
|
||||
// content::URLLoaderThrottleProvider implementation.
|
||||
std::unique_ptr<content::URLLoaderThrottleProvider> Clone() override;
|
||||
std::vector<std::unique_ptr<content::URLLoaderThrottle>> CreateThrottles(
|
||||
int render_frame_id,
|
||||
const blink::WebURLRequest& request,
|
||||
content::ResourceType resource_type) override;
|
||||
void SetOnline(bool is_online) override;
|
||||
|
||||
private:
|
||||
// This copy constructor works in conjunction with Clone(), not intended for
|
||||
// general use.
|
||||
CefURLLoaderThrottleProviderImpl(
|
||||
const CefURLLoaderThrottleProviderImpl& other);
|
||||
|
||||
content::URLLoaderThrottleProviderType type_;
|
||||
|
||||
THREAD_CHECKER(thread_checker_);
|
||||
|
||||
DISALLOW_ASSIGN(CefURLLoaderThrottleProviderImpl);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_RENDERER_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
|
||||
index 04aff03b621d..7e887b89a6d8 100644
|
||||
index 4f9844f6f854..24550416990d 100644
|
||||
--- chrome/browser/BUILD.gn
|
||||
+++ chrome/browser/BUILD.gn
|
||||
@@ -9,6 +9,7 @@ import("//build/config/jumbo.gni")
|
||||
|
@@ -24,10 +24,10 @@ index 761d300aa06b..f86558dd6efc 100644
|
||||
// network quality change events.
|
||||
virtual network::NetworkQualityTracker* network_quality_tracker() = 0;
|
||||
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
|
||||
index c2e0b9172eb2..57c22ff16f4b 100644
|
||||
index 39900e408887..44be9dbabb58 100644
|
||||
--- chrome/browser/browser_process_impl.cc
|
||||
+++ chrome/browser/browser_process_impl.cc
|
||||
@@ -683,6 +683,10 @@ BrowserProcessImpl::system_network_context_manager() {
|
||||
@@ -674,6 +674,10 @@ BrowserProcessImpl::system_network_context_manager() {
|
||||
return SystemNetworkContextManager::GetInstance();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ index 95a7bd8e8b58..af7685f86848 100644
|
||||
override;
|
||||
network::NetworkQualityTracker* network_quality_tracker() override;
|
||||
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
|
||||
index 6bd5bea7ddb0..076306275b5b 100644
|
||||
index ff5b402eb7af..028f4bdce1d1 100644
|
||||
--- chrome/browser/ui/BUILD.gn
|
||||
+++ chrome/browser/ui/BUILD.gn
|
||||
@@ -10,6 +10,7 @@ import("//build/config/jumbo.gni")
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
|
||||
index b5c53b099bb2..56aa2e75b114 100644
|
||||
index 9ec73c5bb8fc..6526a6c96a09 100644
|
||||
--- chrome/browser/chrome_content_browser_client.cc
|
||||
+++ chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -1079,10 +1079,6 @@ void LaunchURL(
|
||||
@@ -1089,10 +1089,6 @@ void LaunchURL(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ index b5c53b099bb2..56aa2e75b114 100644
|
||||
void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) {
|
||||
// |allowlist| combines pref/policy + cmdline switch in the browser process.
|
||||
// For renderer and utility (e.g. NetworkService) processes the switch is the
|
||||
@@ -1100,6 +1096,14 @@ void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) {
|
||||
@@ -1110,6 +1106,14 @@ void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) {
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@@ -125,7 +125,7 @@ index daf826ece047..615200c4b41c 100644
|
||||
// If we broke out of the loop, we have found an enabled plugin.
|
||||
bool enabled = i < matching_plugins.size();
|
||||
diff --git chrome/browser/plugins/plugin_utils.cc chrome/browser/plugins/plugin_utils.cc
|
||||
index 01ea0ba7f0cb..2828896bbcad 100644
|
||||
index 01ea0ba7f0cb..f573503df5c4 100644
|
||||
--- chrome/browser/plugins/plugin_utils.cc
|
||||
+++ chrome/browser/plugins/plugin_utils.cc
|
||||
@@ -5,6 +5,7 @@
|
||||
@@ -148,12 +148,15 @@ index 01ea0ba7f0cb..2828896bbcad 100644
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#include "extensions/browser/info_map.h"
|
||||
#include "extensions/common/constants.h"
|
||||
@@ -180,10 +186,23 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
|
||||
@@ -180,10 +186,26 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
|
||||
content::ResourceContext* resource_context) {
|
||||
base::flat_map<std::string, std::string> mime_type_to_extension_id_map;
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
+
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ if (!extensions::ExtensionsEnabled())
|
||||
+ return mime_type_to_extension_id_map;
|
||||
+
|
||||
+ CefResourceContext* context =
|
||||
+ static_cast<CefResourceContext*>(resource_context);
|
||||
+ bool profile_is_off_the_record = context->IsOffTheRecord();
|
||||
@@ -172,7 +175,7 @@ index 01ea0ba7f0cb..2828896bbcad 100644
|
||||
std::vector<std::string> whitelist = MimeTypesHandler::GetMIMETypeWhitelist();
|
||||
// Go through the white-listed extensions and try to use them to intercept
|
||||
// the URL request.
|
||||
@@ -198,7 +217,7 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
|
||||
@@ -198,7 +220,7 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
|
||||
}
|
||||
|
||||
if (extension_id == extension_misc::kPdfExtensionId &&
|
||||
|
@@ -13,4 +13,4 @@ index b5ccdc521a36..716117c141cc 100644
|
||||
+ private:
|
||||
void UpdateRendererPreferences();
|
||||
void OnWebPrefChanged(const std::string& pref_name);
|
||||
|
||||
|
||||
|
@@ -79,10 +79,10 @@ index 30b2a43959da..7dbe5aad8bd2 100644
|
||||
GetContentClient()->browser()->GetUserAgent());
|
||||
version.SetString("V8-Version", V8_VERSION_STRING);
|
||||
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
|
||||
index 3bdd59c38012..9df67bd208b9 100644
|
||||
index cf137f07cb69..1e071844137d 100644
|
||||
--- content/browser/frame_host/render_frame_message_filter.cc
|
||||
+++ content/browser/frame_host/render_frame_message_filter.cc
|
||||
@@ -809,6 +809,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
|
||||
@@ -810,6 +810,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
|
||||
void RenderFrameMessageFilter::OnGetPluginInfo(
|
||||
int render_frame_id,
|
||||
const GURL& url,
|
||||
@@ -90,7 +90,7 @@ index 3bdd59c38012..9df67bd208b9 100644
|
||||
const url::Origin& main_frame_origin,
|
||||
const std::string& mime_type,
|
||||
bool* found,
|
||||
@@ -820,8 +821,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
|
||||
@@ -821,8 +822,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
|
||||
bool allow_wildcard = true;
|
||||
*found = plugin_service_->GetPluginInfo(
|
||||
render_process_id_, render_frame_id, resource_context_, url,
|
||||
@@ -262,10 +262,10 @@ index 3009401dac6b..b4c5a9e2db50 100644
|
||||
};
|
||||
|
||||
diff --git content/common/frame_messages.h content/common/frame_messages.h
|
||||
index c81c9fb4251c..3f266302f4e0 100644
|
||||
index e5bcd550ade9..78657a4f5a64 100644
|
||||
--- content/common/frame_messages.h
|
||||
+++ content/common/frame_messages.h
|
||||
@@ -1266,9 +1266,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
||||
@@ -1267,9 +1267,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
||||
// type. If there is no matching plugin, |found| is false.
|
||||
// |actual_mime_type| is the actual mime type supported by the
|
||||
// found plugin.
|
||||
@@ -278,10 +278,10 @@ index c81c9fb4251c..3f266302f4e0 100644
|
||||
std::string /* mime_type */,
|
||||
bool /* found */,
|
||||
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
|
||||
index 1a16897afa44..12439a93b151 100644
|
||||
index a2ef727d3a61..b3e7964beeca 100644
|
||||
--- content/public/browser/content_browser_client.h
|
||||
+++ content/public/browser/content_browser_client.h
|
||||
@@ -1437,6 +1437,15 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -1450,6 +1450,15 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
network::mojom::URLLoaderFactoryRequest* factory_request,
|
||||
network::mojom::URLLoaderFactory*& out_factory);
|
||||
|
||||
@@ -297,7 +297,7 @@ index 1a16897afa44..12439a93b151 100644
|
||||
// Creates an OverlayWindow to be used for Picture-in-Picture. This window
|
||||
// will house the content shown when in Picture-in-Picture mode. This will
|
||||
// return a new OverlayWindow.
|
||||
@@ -1504,6 +1513,10 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -1517,6 +1526,10 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
// Used as part of the user agent string.
|
||||
virtual std::string GetProduct() const;
|
||||
|
||||
@@ -358,10 +358,10 @@ index 31fcd7d89bf8..9421e8a5db77 100644
|
||||
// started.
|
||||
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
|
||||
diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h
|
||||
index 14f7e7a34e2b..573bd466effe 100644
|
||||
index 015386282c62..65bd48757105 100644
|
||||
--- content/public/renderer/render_frame_observer.h
|
||||
+++ content/public/renderer/render_frame_observer.h
|
||||
@@ -201,6 +201,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
@@ -204,6 +204,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
virtual void DidReceiveTransferSizeUpdate(int resource_id,
|
||||
int received_data_length) {}
|
||||
|
||||
@@ -372,10 +372,10 @@ index 14f7e7a34e2b..573bd466effe 100644
|
||||
virtual void FocusedElementChanged(const blink::WebElement& element) {}
|
||||
|
||||
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
|
||||
index 2ab1163b56da..329e435a479d 100644
|
||||
index e18fd3c17ddc..de5111867cfc 100644
|
||||
--- content/renderer/render_frame_impl.cc
|
||||
+++ content/renderer/render_frame_impl.cc
|
||||
@@ -4031,7 +4031,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
||||
@@ -4043,7 +4043,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
||||
std::string mime_type;
|
||||
bool found = false;
|
||||
Send(new FrameHostMsg_GetPluginInfo(
|
||||
@@ -385,7 +385,7 @@ index 2ab1163b56da..329e435a479d 100644
|
||||
params.mime_type.Utf8(), &found, &info, &mime_type));
|
||||
if (!found)
|
||||
return nullptr;
|
||||
@@ -4464,6 +4465,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
|
||||
@@ -4476,6 +4477,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
|
||||
|
||||
void RenderFrameImpl::FrameFocused() {
|
||||
Send(new FrameHostMsg_FrameFocused(routing_id_));
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git .gn .gn
|
||||
index 01085ea84619..b79158a1a962 100644
|
||||
index 262f1b071b98..48452ac13306 100644
|
||||
--- .gn
|
||||
+++ .gn
|
||||
@@ -666,6 +666,8 @@ exec_script_whitelist =
|
||||
@@ -665,6 +665,8 @@ exec_script_whitelist =
|
||||
# in the Chromium repo outside of //build.
|
||||
"//build_overrides/build.gni",
|
||||
|
||||
|
@@ -39,10 +39,10 @@ index 07f06ac694f5..831fd9f82dbe 100644
|
||||
|
||||
void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() {
|
||||
diff --git chrome/test/BUILD.gn chrome/test/BUILD.gn
|
||||
index 1fb3cf77f01c..dbb03ffe3333 100644
|
||||
index 3010ca862ab0..10f7c341be43 100644
|
||||
--- chrome/test/BUILD.gn
|
||||
+++ chrome/test/BUILD.gn
|
||||
@@ -4286,7 +4286,7 @@ test("unit_tests") {
|
||||
@@ -4285,7 +4285,7 @@ test("unit_tests") {
|
||||
if (use_gio) {
|
||||
configs += [ "//build/linux:gio_config" ]
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git services/service_manager/embedder/main.cc services/service_manager/embedder/main.cc
|
||||
index 0d1fa74a3f43..11c7b62ac2ad 100644
|
||||
index 0d1fa74a3f43..c06c98acffb2 100644
|
||||
--- services/service_manager/embedder/main.cc
|
||||
+++ services/service_manager/embedder/main.cc
|
||||
@@ -240,22 +240,36 @@ int RunService(MainDelegate* delegate) {
|
||||
@@ -115,7 +115,7 @@ index 0d1fa74a3f43..11c7b62ac2ad 100644
|
||||
if (process_type == ProcessType::kEmbedder)
|
||||
delegate->ShutDownEmbedderProcess();
|
||||
+}
|
||||
|
||||
+
|
||||
+int Main(MainParams& params) {
|
||||
+#if defined(OS_MACOSX)
|
||||
+ // We need this pool for all the objects created before we get to the event
|
||||
@@ -125,7 +125,7 @@ index 0d1fa74a3f43..11c7b62ac2ad 100644
|
||||
+ params.autorelease_pool =
|
||||
+ std::make_unique<base::mac::ScopedNSAutoreleasePool>();
|
||||
+#endif
|
||||
+
|
||||
|
||||
+ int exit_code = MainInitialize(params);
|
||||
+ if (exit_code >= 0)
|
||||
+ return exit_code;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/network_service_client.cc content/browser/network_service_client.cc
|
||||
index 2c2795aeaf51..7cded67a3fe3 100644
|
||||
index 90ffdf4a0ab0..b9950eb3c54e 100644
|
||||
--- content/browser/network_service_client.cc
|
||||
+++ content/browser/network_service_client.cc
|
||||
@@ -205,10 +205,6 @@ class LoginHandlerDelegate {
|
||||
@@ -207,10 +207,6 @@ class LoginHandlerDelegate {
|
||||
}
|
||||
|
||||
WebContents* web_contents = web_contents_getter_.Run();
|
||||
@@ -13,7 +13,7 @@ index 2c2795aeaf51..7cded67a3fe3 100644
|
||||
|
||||
// WeakPtr is not strictly necessary here due to OnRequestCancelled.
|
||||
creating_login_delegate_ = true;
|
||||
@@ -500,11 +496,6 @@ void NetworkServiceClient::OnAuthRequired(
|
||||
@@ -493,11 +489,6 @@ void NetworkServiceClient::OnAuthRequired(
|
||||
base::RepeatingCallback<WebContents*(void)> web_contents_getter =
|
||||
base::BindRepeating(GetWebContents, process_id, routing_id);
|
||||
|
||||
|
@@ -43,10 +43,10 @@ index 0d95af0ef882..463709a9152f 100644
|
||||
std::make_unique<media::InMemoryVideoDecodeStatsDBImpl>(nullptr);
|
||||
} else {
|
||||
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 1aa874a2cf34..ff3279cbc323 100644
|
||||
index 67ec1115d928..02cf9cb0e482 100644
|
||||
--- content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2178,6 +2178,9 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
|
||||
@@ -2202,6 +2202,9 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
|
||||
plugin_registry_.reset(
|
||||
new PluginRegistryImpl(GetBrowserContext()->GetResourceContext()));
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ index cce16a111356..9f0a8b73adb5 100644
|
||||
virtual void MenuWillShow() {}
|
||||
|
||||
diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc
|
||||
index 87fd6313f5d8..42f58e7c13c9 100644
|
||||
index bad91f31f867..eb282f9ebdec 100644
|
||||
--- ui/gfx/render_text.cc
|
||||
+++ ui/gfx/render_text.cc
|
||||
@@ -532,6 +532,14 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) {
|
||||
@@ -57,7 +57,7 @@ index 87fd6313f5d8..42f58e7c13c9 100644
|
||||
void RenderText::SetDisplayRect(const Rect& r) {
|
||||
if (r != display_rect_) {
|
||||
display_rect_ = r;
|
||||
@@ -1638,6 +1646,19 @@ void RenderText::OnTextAttributeChanged() {
|
||||
@@ -1654,6 +1662,19 @@ void RenderText::OnTextAttributeChanged() {
|
||||
if (!multiline_ && replace_newline_chars_with_symbols_)
|
||||
base::ReplaceChars(layout_text_, kNewline, kNewlineSymbol, &layout_text_);
|
||||
|
||||
@@ -78,7 +78,7 @@ index 87fd6313f5d8..42f58e7c13c9 100644
|
||||
}
|
||||
|
||||
diff --git ui/gfx/render_text.h ui/gfx/render_text.h
|
||||
index 5c3985176054..ceab2a4fd9ba 100644
|
||||
index 5a422c0874bc..d53c1ac218c2 100644
|
||||
--- ui/gfx/render_text.h
|
||||
+++ ui/gfx/render_text.h
|
||||
@@ -310,6 +310,10 @@ class GFX_EXPORT RenderText {
|
||||
@@ -92,7 +92,7 @@ index 5c3985176054..ceab2a4fd9ba 100644
|
||||
const Rect& display_rect() const { return display_rect_; }
|
||||
void SetDisplayRect(const Rect& r);
|
||||
|
||||
@@ -956,6 +960,8 @@ class GFX_EXPORT RenderText {
|
||||
@@ -966,6 +970,8 @@ class GFX_EXPORT RenderText {
|
||||
// The cursor position in view space, used to traverse lines of varied widths.
|
||||
base::Optional<int> cached_cursor_x_;
|
||||
|
||||
|
@@ -18,7 +18,7 @@ index a2902adc59b6..2289ef03efc0 100644
|
||||
return renderer_frame_number_;
|
||||
}
|
||||
diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h
|
||||
index 903131f45d4f..49b0a67cb39e 100644
|
||||
index 81bdc91eb351..d7de8c756168 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_base.h
|
||||
+++ content/browser/renderer_host/render_widget_host_view_base.h
|
||||
@@ -75,6 +75,7 @@ class CursorManager;
|
||||
@@ -29,7 +29,7 @@ index 903131f45d4f..49b0a67cb39e 100644
|
||||
class SyntheticGestureTarget;
|
||||
class TextInputManager;
|
||||
class TouchSelectionControllerClientManager;
|
||||
@@ -96,6 +97,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
@@ -95,6 +96,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
float current_device_scale_factor() const {
|
||||
return current_device_scale_factor_;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ index 903131f45d4f..49b0a67cb39e 100644
|
||||
|
||||
// Returns the focused RenderWidgetHost inside this |view|'s RWH.
|
||||
RenderWidgetHostImpl* GetFocusedWidget() const;
|
||||
@@ -130,6 +134,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
@@ -129,6 +133,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
void DisableAutoResize(const gfx::Size& new_size) override;
|
||||
bool IsScrollOffsetAtTop() override;
|
||||
float GetDeviceScaleFactor() final;
|
||||
@@ -48,7 +48,7 @@ index 903131f45d4f..49b0a67cb39e 100644
|
||||
TouchSelectionControllerClientManager*
|
||||
GetTouchSelectionControllerClientManager() override;
|
||||
void SetRecordTabSwitchTimeRequest(base::TimeTicks start_time,
|
||||
@@ -491,6 +497,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
@@ -490,6 +496,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
// helps to position the full screen widget on the correct monitor.
|
||||
virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) = 0;
|
||||
|
||||
@@ -61,7 +61,7 @@ index 903131f45d4f..49b0a67cb39e 100644
|
||||
// Sets the cursor for this view to the one associated with the specified
|
||||
// cursor_type.
|
||||
virtual void UpdateCursor(const WebCursor& cursor) = 0;
|
||||
@@ -664,6 +676,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
@@ -657,6 +669,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
|
||||
bool is_currently_scrolling_viewport_ = false;
|
||||
|
||||
@@ -194,7 +194,7 @@ index 8ac960b083c8..66b6ff2a3259 100644
|
||||
// a reference.
|
||||
corewm::TooltipWin* tooltip_;
|
||||
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
||||
index 81ef38287b65..f0e43abdc143 100644
|
||||
index 2c502b3a5334..e4e9312aee63 100644
|
||||
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
||||
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
||||
@@ -211,6 +211,8 @@ std::vector<aura::Window*> DesktopWindowTreeHostX11::GetAllOpenWindows() {
|
||||
@@ -411,7 +411,7 @@ index 5bcb8d8b9bae..020fa85573aa 100644
|
||||
if (native_widget_delegate->IsDialogBox()) {
|
||||
*style |= DS_MODALFRAME;
|
||||
diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc
|
||||
index de88c769b5be..1b642132eb2f 100644
|
||||
index abde4d03cb3b..dbe770d119c9 100644
|
||||
--- ui/views/win/hwnd_message_handler.cc
|
||||
+++ ui/views/win/hwnd_message_handler.cc
|
||||
@@ -2903,10 +2903,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
|
@@ -93,7 +93,7 @@ index f17983a5cc70..4a8f2fd8d415 100644
|
||||
"display/bsp_tree.h",
|
||||
"display/bsp_walk_action.cc",
|
||||
diff --git components/viz/service/display_embedder/output_surface_provider_impl.cc components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
index 8fe397588eb4..1218985f7310 100644
|
||||
index 1f8132354d25..264ab0f85ba7 100644
|
||||
--- components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
+++ components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
@@ -104,7 +104,7 @@ index 8fe397588eb4..1218985f7310 100644
|
||||
#include "components/viz/common/display/renderer_settings.h"
|
||||
#include "components/viz/common/frame_sinks/begin_frame_source.h"
|
||||
#include "components/viz/service/display_embedder/gl_output_surface.h"
|
||||
@@ -243,6 +244,20 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
@@ -244,6 +245,20 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
if (headless_)
|
||||
return std::make_unique<SoftwareOutputDevice>();
|
||||
|
||||
@@ -163,7 +163,7 @@ index 906be544c90f..a110f254d7ec 100644
|
||||
|
||||
#if ENABLE_SYNC_CALL_RESTRICTIONS
|
||||
diff --git services/viz/privileged/interfaces/compositing/display_private.mojom services/viz/privileged/interfaces/compositing/display_private.mojom
|
||||
index deb327b77054..d9926ec35165 100644
|
||||
index cd8dd80230d1..3b90812293ab 100644
|
||||
--- services/viz/privileged/interfaces/compositing/display_private.mojom
|
||||
+++ services/viz/privileged/interfaces/compositing/display_private.mojom
|
||||
@@ -77,12 +77,14 @@ interface DisplayPrivate {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
|
||||
index f88cff5ab6d1..981a83fdded2 100644
|
||||
index 5d4b92af30e3..59f667ef18d5 100644
|
||||
--- content/browser/web_contents/web_contents_impl.cc
|
||||
+++ content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2070,21 +2070,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
@@ -2071,21 +2071,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
std::string unique_name;
|
||||
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
|
||||
|
||||
@@ -45,7 +45,7 @@ index f88cff5ab6d1..981a83fdded2 100644
|
||||
CHECK(render_view_host_delegate_view_);
|
||||
CHECK(view_.get());
|
||||
|
||||
@@ -2783,6 +2792,15 @@ void WebContentsImpl::CreateNewWindow(
|
||||
@@ -2784,6 +2793,15 @@ void WebContentsImpl::CreateNewWindow(
|
||||
create_params.renderer_initiated_creation =
|
||||
main_frame_route_id != MSG_ROUTING_NONE;
|
||||
|
||||
@@ -61,7 +61,7 @@ index f88cff5ab6d1..981a83fdded2 100644
|
||||
std::unique_ptr<WebContents> new_contents;
|
||||
if (!is_guest) {
|
||||
create_params.context = view_->GetNativeView();
|
||||
@@ -2815,7 +2833,7 @@ void WebContentsImpl::CreateNewWindow(
|
||||
@@ -2816,7 +2834,7 @@ void WebContentsImpl::CreateNewWindow(
|
||||
// TODO(brettw): It seems bogus that we have to call this function on the
|
||||
// newly created object and give it one of its own member variables.
|
||||
new_view->CreateViewForWidget(
|
||||
@@ -70,7 +70,7 @@ index f88cff5ab6d1..981a83fdded2 100644
|
||||
}
|
||||
// Save the created window associated with the route so we can show it
|
||||
// later.
|
||||
@@ -6387,7 +6405,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() {
|
||||
@@ -6415,7 +6433,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() {
|
||||
void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager(
|
||||
RenderViewHost* render_view_host) {
|
||||
RenderWidgetHostViewBase* rwh_view =
|
||||
|
@@ -26,7 +26,7 @@ index cd2e8603c391..a0eb460fcae1 100644
|
||||
static void InitializeCommon(Platform* platform,
|
||||
std::unique_ptr<Thread> main_thread);
|
||||
diff --git third_party/blink/renderer/core/dom/dom_implementation.cc third_party/blink/renderer/core/dom/dom_implementation.cc
|
||||
index 3de30fbbe096..a7cab9da38f2 100644
|
||||
index 5e2b2fc592bd..e49fff54b36d 100644
|
||||
--- third_party/blink/renderer/core/dom/dom_implementation.cc
|
||||
+++ third_party/blink/renderer/core/dom/dom_implementation.cc
|
||||
@@ -244,10 +244,11 @@ Document* DOMImplementation::createDocument(const String& type,
|
||||
@@ -44,7 +44,7 @@ index 3de30fbbe096..a7cab9da38f2 100644
|
||||
.Top()
|
||||
.GetSecurityContext()
|
||||
diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index 4851cb4a227b..cc88dce2db46 100644
|
||||
index 06f9c9f62dc9..8115d99ac6a5 100644
|
||||
--- third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -1234,7 +1234,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() {
|
||||
@@ -85,7 +85,7 @@ index e839efcfbd0b..1927d8dd2ed0 100644
|
||||
|
||||
void DevToolsSession::FlushProtocolNotifications() {
|
||||
diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc
|
||||
index bcab9669d29b..9e90c96b29e7 100644
|
||||
index 0f8ae2090eb6..c14c6f4c114f 100644
|
||||
--- third_party/blink/renderer/core/page/page.cc
|
||||
+++ third_party/blink/renderer/core/page/page.cc
|
||||
@@ -185,7 +185,8 @@ Page::Page(PageClients& page_clients)
|
||||
@@ -98,7 +98,7 @@ index bcab9669d29b..9e90c96b29e7 100644
|
||||
// TODO(pdr): Initialize |validation_message_client_| lazily.
|
||||
validation_message_client_(
|
||||
MakeGarbageCollected<ValidationMessageClientImpl>(*this)),
|
||||
@@ -346,21 +347,40 @@ void Page::InitialStyleChanged() {
|
||||
@@ -344,21 +345,40 @@ void Page::InitialStyleChanged() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ index bcab9669d29b..9e90c96b29e7 100644
|
||||
page->NotifyPluginsChanged();
|
||||
}
|
||||
}
|
||||
@@ -832,7 +852,8 @@ void Page::Trace(blink::Visitor* visitor) {
|
||||
@@ -830,7 +850,8 @@ void Page::Trace(blink::Visitor* visitor) {
|
||||
visitor->Trace(link_highlights_);
|
||||
visitor->Trace(spatial_navigation_controller_);
|
||||
visitor->Trace(main_frame_);
|
||||
|
@@ -11,7 +11,7 @@ index 3b6b9a0bfc70..5ab43573416b 100644
|
||||
// Cancels and hides the current popup (datetime, select...) if any.
|
||||
virtual void CancelPagePopup() = 0;
|
||||
diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index ec827ff90d5d..cd1f822785ae 100644
|
||||
index 4a9056441d24..ade8e45bfcd0 100644
|
||||
--- third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -234,8 +234,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) {
|
||||
@@ -39,7 +39,7 @@ index ec827ff90d5d..cd1f822785ae 100644
|
||||
fullscreen_controller_(std::make_unique<FullscreenController>(this)) {
|
||||
if (!AsView().client) {
|
||||
diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
index 218915791efb..a57420b95773 100644
|
||||
index 2e7c76cac3b3..ca1f60f68107 100644
|
||||
--- third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
+++ third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
@@ -107,7 +107,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd
|
||||
index af7b8fa63af0..118aea76fe39 100644
|
||||
index 7386ba4464c6..949a33f45297 100644
|
||||
--- chrome/app/generated_resources.grd
|
||||
+++ chrome/app/generated_resources.grd
|
||||
@@ -4654,7 +4654,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
|
||||
@@ -4657,7 +4657,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
|
||||
</message>
|
||||
</if>
|
||||
<message name="IDS_PLUGIN_BLOCKED_BY_POLICY" desc="The placeholder text for a plugin blocked by enterprise policy.">
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git services/service_manager/sandbox/win/sandbox_win.cc services/service_manager/sandbox/win/sandbox_win.cc
|
||||
index b5e74f458898..c0f00b9745df 100644
|
||||
index e57439cdb4d8..97afc5be9928 100644
|
||||
--- services/service_manager/sandbox/win/sandbox_win.cc
|
||||
+++ services/service_manager/sandbox/win/sandbox_win.cc
|
||||
@@ -931,8 +931,11 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess(
|
||||
@@ -933,8 +933,11 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess(
|
||||
}
|
||||
// TODO(wfh): Relax strict handle checks for network process until root cause
|
||||
// for this crash can be resolved. See https://crbug.com/939590.
|
||||
|
@@ -179,53 +179,88 @@ if(OS_MACOSX)
|
||||
${CEFCLIENT_MACOSX_HELPER_SRCS}
|
||||
)
|
||||
|
||||
# Output paths for the app bundles.
|
||||
# Output path for the main app bundle.
|
||||
set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app")
|
||||
set(CEF_HELPER_APP "${CEF_TARGET_OUT_DIR}/${CEF_HELPER_OUTPUT_NAME}.app")
|
||||
|
||||
# Variable referenced from Info.plist files.
|
||||
# Variables referenced from the main Info.plist file.
|
||||
set(EXECUTABLE_NAME "${CEF_TARGET}")
|
||||
set(PRODUCT_NAME "${CEF_TARGET}")
|
||||
|
||||
# Helper executable target.
|
||||
add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${CEFCLIENT_HELPER_SRCS})
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_HELPER_TARGET})
|
||||
add_dependencies(${CEF_HELPER_TARGET} libcef_dll_wrapper)
|
||||
target_link_libraries(${CEF_HELPER_TARGET} libcef_dll_wrapper ${CEF_STANDARD_LIBS})
|
||||
set_target_properties(${CEF_HELPER_TARGET} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/helper-Info.plist
|
||||
OUTPUT_NAME ${CEF_HELPER_OUTPUT_NAME}
|
||||
)
|
||||
|
||||
if(USE_SANDBOX)
|
||||
# Logical target used to link the cef_sandbox library.
|
||||
ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}")
|
||||
target_link_libraries(${CEF_HELPER_TARGET} cef_sandbox_lib)
|
||||
endif()
|
||||
|
||||
# Main executable target.
|
||||
# Main app bundle target.
|
||||
add_executable(${CEF_TARGET} MACOSX_BUNDLE ${CEFCLIENT_RESOURCES_SRCS} ${CEFCLIENT_SRCS})
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_TARGET})
|
||||
add_dependencies(${CEF_TARGET} libcef_dll_wrapper "${CEF_HELPER_TARGET}")
|
||||
add_dependencies(${CEF_TARGET} libcef_dll_wrapper)
|
||||
target_link_libraries(${CEF_TARGET} libcef_dll_wrapper ${CEF_STANDARD_LIBS} "-framework OpenGL")
|
||||
set_target_properties(${CEF_TARGET} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/Info.plist
|
||||
)
|
||||
|
||||
# Copy files into the main app bundle.
|
||||
# Copy the CEF framework into the Frameworks directory.
|
||||
add_custom_command(
|
||||
TARGET ${CEF_TARGET}
|
||||
POST_BUILD
|
||||
# Copy the helper app bundle into the Frameworks directory.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_HELPER_APP}"
|
||||
"${CEF_APP}/Contents/Frameworks/${CEF_HELPER_OUTPUT_NAME}.app"
|
||||
# Copy the CEF framework into the Frameworks directory.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_BINARY_DIR}/Chromium Embedded Framework.framework"
|
||||
"${CEF_APP}/Contents/Frameworks/Chromium Embedded Framework.framework"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Create the multiple Helper app bundle targets.
|
||||
foreach(_suffix_list ${CEF_HELPER_APP_SUFFIXES})
|
||||
# Convert to a list and extract the suffix values.
|
||||
string(REPLACE ":" ";" _suffix_list ${_suffix_list})
|
||||
list(GET _suffix_list 0 _name_suffix)
|
||||
list(GET _suffix_list 1 _target_suffix)
|
||||
list(GET _suffix_list 2 _plist_suffix)
|
||||
|
||||
# Define Helper target and output names.
|
||||
set(_helper_target "${CEF_HELPER_TARGET}${_target_suffix}")
|
||||
set(_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix}")
|
||||
|
||||
# Create Helper-specific variants of the helper-Info.plist file. Do this
|
||||
# manually because the configure_file command (which is executed as part of
|
||||
# MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the
|
||||
# wrong values with multiple targets.
|
||||
set(_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR}/helper-Info${_target_suffix}.plist")
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/helper-Info.plist" _plist_contents)
|
||||
string(REPLACE "\${EXECUTABLE_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
|
||||
string(REPLACE "\${PRODUCT_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
|
||||
string(REPLACE "\${BUNDLE_ID_SUFFIX}" "${_plist_suffix}" _plist_contents ${_plist_contents})
|
||||
file(WRITE ${_helper_info_plist} ${_plist_contents})
|
||||
|
||||
# Create Helper executable target.
|
||||
add_executable(${_helper_target} MACOSX_BUNDLE ${CEFCLIENT_HELPER_SRCS})
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(${_helper_target})
|
||||
add_dependencies(${_helper_target} libcef_dll_wrapper)
|
||||
target_link_libraries(${_helper_target} libcef_dll_wrapper ${CEF_STANDARD_LIBS})
|
||||
set_target_properties(${_helper_target} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist}
|
||||
OUTPUT_NAME ${_helper_output_name}
|
||||
)
|
||||
|
||||
if(USE_SANDBOX)
|
||||
target_link_libraries(${_helper_target} cef_sandbox_lib)
|
||||
endif()
|
||||
|
||||
# Add the Helper as a dependency of the main executable target.
|
||||
add_dependencies(${CEF_TARGET} "${_helper_target}")
|
||||
|
||||
# Copy the Helper app bundle into the Frameworks directory.
|
||||
add_custom_command(
|
||||
TARGET ${CEF_TARGET}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_TARGET_OUT_DIR}/${_helper_output_name}.app"
|
||||
"${CEF_APP}/Contents/Frameworks/${_helper_output_name}.app"
|
||||
VERBATIM
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Manually process and copy over resource files.
|
||||
# The Xcode generator can support this via the set_target_properties RESOURCE
|
||||
# directive but that doesn't properly handle nested resource directories.
|
||||
|
@@ -66,6 +66,7 @@ Click a button to show the associated dialog type.
|
||||
<br/><input type="button" onclick="show_confirm();" value="Show Confirm"> <span id="cm"></span>
|
||||
<br/><input type="button" onclick="show_prompt();" value="Show Prompt"> <span id="pm"></span>
|
||||
<br/>input type="file": <input type="file" name="pic" accept="text/*,.js,.css,image/*">
|
||||
<br/>input type="file" (directory): <input type="file" webkitdirectory accept="text/*,.js,.css,image/*">
|
||||
<br/><input type="button" onclick="show_file_dialog('fo', 'FileOpen');" value="Show File Open" disabled="true"> <span id="fo"></span>
|
||||
<br/><input type="button" onclick="show_file_dialog('fom', 'FileOpenMultiple');" value="Show File Open Multiple" disabled="true"> <span id="fom"></span>
|
||||
<br/><input type="button" onclick="show_file_dialog('fof', 'FileOpenFolder');" value="Show File Open Folder" disabled="true"> <span id="fof"></span>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.cef.cefclient.helper</string>
|
||||
<string>org.cef.cefclient.helper${BUNDLE_ID_SUFFIX}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
@@ -97,53 +97,88 @@ if(OS_MACOSX)
|
||||
)
|
||||
endif()
|
||||
|
||||
# Output paths for the app bundles.
|
||||
# Output path for the main app bundle.
|
||||
set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app")
|
||||
set(CEF_HELPER_APP "${CEF_TARGET_OUT_DIR}/${CEF_HELPER_OUTPUT_NAME}.app")
|
||||
|
||||
# Variable referenced from Info.plist files.
|
||||
# Variables referenced from the main Info.plist file.
|
||||
set(EXECUTABLE_NAME "${CEF_TARGET}")
|
||||
set(PRODUCT_NAME "${CEF_TARGET}")
|
||||
|
||||
# Helper executable target.
|
||||
add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${CEFSIMPLE_HELPER_SRCS})
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_HELPER_TARGET})
|
||||
add_dependencies(${CEF_HELPER_TARGET} libcef_dll_wrapper)
|
||||
target_link_libraries(${CEF_HELPER_TARGET} libcef_dll_wrapper ${CEF_STANDARD_LIBS})
|
||||
set_target_properties(${CEF_HELPER_TARGET} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist
|
||||
OUTPUT_NAME ${CEF_HELPER_OUTPUT_NAME}
|
||||
)
|
||||
|
||||
if(USE_SANDBOX)
|
||||
# Logical target used to link the cef_sandbox library.
|
||||
ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}")
|
||||
target_link_libraries(${CEF_HELPER_TARGET} cef_sandbox_lib)
|
||||
endif()
|
||||
|
||||
# Main executable target.
|
||||
# Main app bundle target.
|
||||
add_executable(${CEF_TARGET} MACOSX_BUNDLE ${CEFSIMPLE_RESOURCES_SRCS} ${CEFSIMPLE_SRCS})
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_TARGET})
|
||||
add_dependencies(${CEF_TARGET} libcef_dll_wrapper "${CEF_HELPER_TARGET}")
|
||||
add_dependencies(${CEF_TARGET} libcef_dll_wrapper)
|
||||
target_link_libraries(${CEF_TARGET} libcef_dll_wrapper ${CEF_STANDARD_LIBS})
|
||||
set_target_properties(${CEF_TARGET} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/Info.plist
|
||||
)
|
||||
|
||||
# Copy files into the main app bundle.
|
||||
# Copy the CEF framework into the Frameworks directory.
|
||||
add_custom_command(
|
||||
TARGET ${CEF_TARGET}
|
||||
POST_BUILD
|
||||
# Copy the helper app bundle into the Frameworks directory.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_HELPER_APP}"
|
||||
"${CEF_APP}/Contents/Frameworks/${CEF_HELPER_OUTPUT_NAME}.app"
|
||||
# Copy the CEF framework into the Frameworks directory.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_BINARY_DIR}/Chromium Embedded Framework.framework"
|
||||
"${CEF_APP}/Contents/Frameworks/Chromium Embedded Framework.framework"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Create the multiple Helper app bundle targets.
|
||||
foreach(_suffix_list ${CEF_HELPER_APP_SUFFIXES})
|
||||
# Convert to a list and extract the suffix values.
|
||||
string(REPLACE ":" ";" _suffix_list ${_suffix_list})
|
||||
list(GET _suffix_list 0 _name_suffix)
|
||||
list(GET _suffix_list 1 _target_suffix)
|
||||
list(GET _suffix_list 2 _plist_suffix)
|
||||
|
||||
# Define Helper target and output names.
|
||||
set(_helper_target "${CEF_HELPER_TARGET}${_target_suffix}")
|
||||
set(_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix}")
|
||||
|
||||
# Create Helper-specific variants of the helper-Info.plist file. Do this
|
||||
# manually because the configure_file command (which is executed as part of
|
||||
# MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the
|
||||
# wrong values with multiple targets.
|
||||
set(_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR}/helper-Info${_target_suffix}.plist")
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist" _plist_contents)
|
||||
string(REPLACE "\${EXECUTABLE_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
|
||||
string(REPLACE "\${PRODUCT_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
|
||||
string(REPLACE "\${BUNDLE_ID_SUFFIX}" "${_plist_suffix}" _plist_contents ${_plist_contents})
|
||||
file(WRITE ${_helper_info_plist} ${_plist_contents})
|
||||
|
||||
# Create Helper executable target.
|
||||
add_executable(${_helper_target} MACOSX_BUNDLE ${CEFSIMPLE_HELPER_SRCS})
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(${_helper_target})
|
||||
add_dependencies(${_helper_target} libcef_dll_wrapper)
|
||||
target_link_libraries(${_helper_target} libcef_dll_wrapper ${CEF_STANDARD_LIBS})
|
||||
set_target_properties(${_helper_target} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist}
|
||||
OUTPUT_NAME ${_helper_output_name}
|
||||
)
|
||||
|
||||
if(USE_SANDBOX)
|
||||
target_link_libraries(${_helper_target} cef_sandbox_lib)
|
||||
endif()
|
||||
|
||||
# Add the Helper as a dependency of the main executable target.
|
||||
add_dependencies(${CEF_TARGET} "${_helper_target}")
|
||||
|
||||
# Copy the Helper app bundle into the Frameworks directory.
|
||||
add_custom_command(
|
||||
TARGET ${CEF_TARGET}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_TARGET_OUT_DIR}/${_helper_output_name}.app"
|
||||
"${CEF_APP}/Contents/Frameworks/${_helper_output_name}.app"
|
||||
VERBATIM
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Manually process and copy over resource files.
|
||||
# The Xcode generator can support this via the set_target_properties RESOURCE
|
||||
# directive but that doesn't properly handle nested resource directories.
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.cef.cefsimple.helper</string>
|
||||
<string>org.cef.cefsimple.helper${BUNDLE_ID_SUFFIX}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
@@ -104,53 +104,88 @@ endif()
|
||||
#
|
||||
|
||||
if(OS_MACOSX)
|
||||
# Output paths for the app bundles.
|
||||
# Output path for the main app bundle.
|
||||
set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app")
|
||||
set(CEF_HELPER_APP "${CEF_TARGET_OUT_DIR}/${CEF_HELPER_OUTPUT_NAME}.app")
|
||||
|
||||
# Variable referenced from Info.plist files.
|
||||
# Variables referenced from the main Info.plist file.
|
||||
set(EXECUTABLE_NAME "${CEF_TARGET}")
|
||||
set(PRODUCT_NAME "${CEF_TARGET}")
|
||||
|
||||
# Helper executable target.
|
||||
add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${UNITTESTS_HELPER_SRCS})
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_HELPER_TARGET})
|
||||
add_dependencies(${CEF_HELPER_TARGET} libcef_dll_wrapper cef_gtest)
|
||||
target_link_libraries(${CEF_HELPER_TARGET} libcef_dll_wrapper cef_gtest ${CEF_STANDARD_LIBS})
|
||||
set_target_properties(${CEF_HELPER_TARGET} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/helper-Info.plist
|
||||
OUTPUT_NAME ${CEF_HELPER_OUTPUT_NAME}
|
||||
)
|
||||
|
||||
if(USE_SANDBOX)
|
||||
# Logical target used to link the cef_sandbox library.
|
||||
ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}")
|
||||
target_link_libraries(${CEF_HELPER_TARGET} cef_sandbox_lib)
|
||||
endif()
|
||||
|
||||
# Main executable target.
|
||||
# Main app bundle target.
|
||||
add_executable(${CEF_TARGET} MACOSX_BUNDLE ${UNITTESTS_RESOURCES_SRCS} ${UNITTESTS_SRCS})
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_TARGET})
|
||||
add_dependencies(${CEF_TARGET} libcef_dll_wrapper cef_gtest "${CEF_HELPER_TARGET}")
|
||||
add_dependencies(${CEF_TARGET} libcef_dll_wrapper cef_gtest)
|
||||
target_link_libraries(${CEF_TARGET} libcef_dll_wrapper cef_gtest ${CEF_STANDARD_LIBS})
|
||||
set_target_properties(${CEF_TARGET} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/Info.plist
|
||||
)
|
||||
|
||||
# Copy files into the main app bundle.
|
||||
# Copy the CEF framework into the Frameworks directory.
|
||||
add_custom_command(
|
||||
TARGET ${CEF_TARGET}
|
||||
POST_BUILD
|
||||
# Copy the helper app bundle into the Frameworks directory.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_HELPER_APP}"
|
||||
"${CEF_APP}/Contents/Frameworks/${CEF_HELPER_OUTPUT_NAME}.app"
|
||||
# Copy the CEF framework into the Frameworks directory.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_BINARY_DIR}/Chromium Embedded Framework.framework"
|
||||
"${CEF_APP}/Contents/Frameworks/Chromium Embedded Framework.framework"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Create the multiple Helper app bundle targets.
|
||||
foreach(_suffix_list ${CEF_HELPER_APP_SUFFIXES})
|
||||
# Convert to a list and extract the suffix values.
|
||||
string(REPLACE ":" ";" _suffix_list ${_suffix_list})
|
||||
list(GET _suffix_list 0 _name_suffix)
|
||||
list(GET _suffix_list 1 _target_suffix)
|
||||
list(GET _suffix_list 2 _plist_suffix)
|
||||
|
||||
# Define Helper target and output names.
|
||||
set(_helper_target "${CEF_HELPER_TARGET}${_target_suffix}")
|
||||
set(_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix}")
|
||||
|
||||
# Create Helper-specific variants of the helper-Info.plist file. Do this
|
||||
# manually because the configure_file command (which is executed as part of
|
||||
# MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the
|
||||
# wrong values with multiple targets.
|
||||
set(_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR}/helper-Info${_target_suffix}.plist")
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/helper-Info.plist" _plist_contents)
|
||||
string(REPLACE "\${EXECUTABLE_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
|
||||
string(REPLACE "\${PRODUCT_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
|
||||
string(REPLACE "\${BUNDLE_ID_SUFFIX}" "${_plist_suffix}" _plist_contents ${_plist_contents})
|
||||
file(WRITE ${_helper_info_plist} ${_plist_contents})
|
||||
|
||||
# Create Helper executable target.
|
||||
add_executable(${_helper_target} MACOSX_BUNDLE ${UNITTESTS_HELPER_SRCS})
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(${_helper_target})
|
||||
add_dependencies(${_helper_target} libcef_dll_wrapper cef_gtest)
|
||||
target_link_libraries(${_helper_target} libcef_dll_wrapper cef_gtest ${CEF_STANDARD_LIBS})
|
||||
set_target_properties(${_helper_target} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist}
|
||||
OUTPUT_NAME ${_helper_output_name}
|
||||
)
|
||||
|
||||
if(USE_SANDBOX)
|
||||
target_link_libraries(${_helper_target} cef_sandbox_lib)
|
||||
endif()
|
||||
|
||||
# Add the Helper as a dependency of the main executable target.
|
||||
add_dependencies(${CEF_TARGET} "${_helper_target}")
|
||||
|
||||
# Copy the Helper app bundle into the Frameworks directory.
|
||||
add_custom_command(
|
||||
TARGET ${CEF_TARGET}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_TARGET_OUT_DIR}/${_helper_output_name}.app"
|
||||
"${CEF_APP}/Contents/Frameworks/${_helper_output_name}.app"
|
||||
VERBATIM
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Manually process and copy over resource files.
|
||||
# The Xcode generator can support this via the set_target_properties RESOURCE
|
||||
# directive but that doesn't properly handle nested resource directories.
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.cef.ceftests.helper</string>
|
||||
<string>org.cef.ceftests.helper${BUNDLE_ID_SUFFIX}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
@@ -36,7 +36,8 @@ def RunAction(dir, command):
|
||||
command[0] = sys.executable
|
||||
|
||||
try:
|
||||
gclient_utils.CheckCallAndFilterAndHeader(command, cwd=dir, always=True)
|
||||
gclient_utils.CheckCallAndFilter(
|
||||
command, cwd=dir, always_show_header=True, print_stdout=True)
|
||||
except gclient_utils.Error, e:
|
||||
# Use a discrete exit status code of 2 to indicate that a hook action
|
||||
# failed. Users of this script may wish to treat hook action failures
|
||||
|
Reference in New Issue
Block a user