chore: bump chromium to 6b9fa6b352d824d052222e1abe541 (master) (#25558)

* chore: bump chromium in DEPS to d5c9bf9e2a18fa508201a88e5803bec1d107b1ae

* chore: bump chromium in DEPS to 45f1316afae33e52c92480b34bf4f7fe4a7db898

* update patches

* WillCreateURLLoaderFactory now gets a ukm_source_id

Refs: 2346803

* ink_drop_visible_opacity -> GetInkDropVisibleOpacity

Refs: 2415368

* chore: bump chromium in DEPS to ddb5b6db5e35ab1a7b5adbd9f15373af6c35ea2a

* 2418471: PDF Viewer update: Add missing aria-labels to various buttons.

2418471

* update printing.patch given print settings mojoification

Refs: 2409467

* update patches

* content::BluetoothChooser::Event -> content::BluetoothChooserEvent

Refs: 2387901

* set_ink_drop_base_color -> SetInkDropBaseColor

Refs: 2419388

* chore: bump chromium in DEPS to ecf7c9ee830d4d85f300b461a2fa13aa40c79a4c

* update patches

* gfx::ConvertPointToPixel -> gfx::ConvertPointToPixels

Refs: 2418568

* remove ContentSettingsObserver::AllowStorage()

Refs: 2401847

* service_manager::kCrashDumpSignal -> kCrashDumpSignal

Refs: 2417073

* chore: bump chromium in DEPS to abdb7ebe5f8c8328b8f435283df90d0a3ecff7bd

* chore: bump chromium in DEPS to 2a7e138ab1066534ceb2622e8a9d2c8ebf574215

* chore: bump chromium in DEPS to ab1884e75ced904e4276851eb4e1ad89919ca93b

* chore: bump chromium in DEPS to a12413902380dcc2a73ac74d582328280a8af686

* Fixup printing patch

2428623

* Fixup OSR patch

2415128

* Make ExtensionURLLoaderFactory always owned by its |receivers_|.

2357523

* Add deprecated_default_sources_assignment_filter variable

2416496

* Fixup patch indices

* Remove several references to BrowserPlugin from content

2401031

* Remove SurfaceEmbeddingTime and LocalSurfaceIdAllocation

2415128

* Add DragOperation and AllowedDragOperations Mojo types

2196167

* chore: bump chromium in DEPS to 378450342cf6aa160663d0ce3a178a11b570c25a

* Fixup patch indices

* Remove SurfaceEmbeddingTime and LocalSurfaceIdAllocation

2415128

* Add DragOperation and AllowedDragOperations Mojo types

2196167

* 2426564: Remove global sources assignment filter value

2426564

* Fixup blink_local_frame.patch

* [XProto] Remove a subset of ui/gfx/x/x11.h

2430328

* Fixup patch indices

* Remove several references to BrowserPlugin from content

2401031

* Remove lossy ConvertSizeToPixel() methods

2419534

* serial: Use USB driver name to disambiguate ports

2413176

* Remove set_sources_filter import

* Fix ModMask usage

* [XProto] Remove usage of all Xlib headers

2392140

* [XProto] Remove usage of Xlib Visuals

2429933

* Skip Angle manifest file

2425197

* Add whole src\third_party\angle\.git directory

This directory is needed in order to properly generate gen/angle/angle_commit.h

* [libvpx] Fix HighBD config on Windows ARM64

2437745

* update patches

* fix: correct calling convention for Windows on Arm

2440717

* Add third_party/angle/.git to the archive before adding the rest of the source

* fixup source caching on Windows

* Fixup erroneous close paren

* fixup for goma issues

* This should work

* chore: bump chromium roll manually

2435142

This landed the day after we paused roller-bot and may resolve the
visibility test flakes that we're seeing. h/t to @jkleinsc for
finding this with me.

* chore: remove obsoleted cherry-pick fix for libvpx

2437745

* chore: remove obsoleted cherry-pick libvpx patch

2437745

* chore: re-export patches

* chore: add tracer comment to visibility-stat-spec.

The line numbers between the source and the CI runs don't seem to match
up, so this temp tracer is to help track the source of that difference.

* chore: bump chromium in DEPS to 7c2b8cc3b8638aee8abeb013042a6c1d15b2da6b

* update patches

* impl SortingLSH service

Refs: 2425327

* 2446525: [Flash] Remove some Flash APIs

2446525

* 2440974: Reland "Delete service_manager/embedder/switches.h"

2440974

* 2359402: Remove ContentBrowserClient::NonNetworkURLLoaderFactoryDeprecatedMap.

2359402

* 2250506: Implement tabs.removeCSS

2250506

* 2429143: Remove implicit-conversion-to-integer ConvertRectToPixel() methods.

2429143

* 2444430: Remove DataElementType::kBlob

2444430

* 2441964: Clean up WebView public API

2441964

* 2357523: Make ExtensionURLLoaderFactory always owned by its |receivers_|.

2357523

* 2461606: Use blink::mojom::PreferredColorScheme instead of blink::PreferredColorScheme

2461606

* 2461235: a11y inspect reorg: move PropertyFilter struct to a new location

2461235

* remove flash support

* fix frame_host_manager patch

* fix lint

* remove flash info from docs

* fix build

* fix osr

* chore: bump chromium in DEPS to 9269f9eb1d98d29564c2b2ab97f30c6e148c4e11

* fix visibilityState tests

* 2463049: Replace all uses of web_pref::AutoplayPolicy with mojom::AutoplayPolicy

2463049

* update patches

* fix tests harder

* 2414921: Add Group and Ungroup functions to Tabs extension API

2414921

* more test fix

* Remove all keyboard related usage of Xlib

Refs: 2436787

* fix linux build

* 2453807: [XProto] Remove usage of Xlib error handling

2453807

* lint

* fixup! 2453807: [XProto] Remove usage of Xlib error handling

* disable CalculateNativeWinOcclusion on win ci

* remove UploadBlob from docs

* Update appveyor.yml

Co-authored-by: Andy Locascio <andy@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
Electron Bot 2020-10-15 18:30:41 -07:00 committed by GitHub
parent 20c6677a9c
commit 46f3491c7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
135 changed files with 1087 additions and 1609 deletions

View file

@ -96,59 +96,6 @@ bool IsWidevineAvailable(
}
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#if BUILDFLAG(ENABLE_PEPPER_FLASH)
content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
const std::string& version) {
content::PepperPluginInfo plugin;
plugin.is_out_of_process = true;
plugin.name = content::kFlashPluginName;
plugin.path = path;
plugin.permissions = ppapi::PERMISSION_ALL_BITS;
std::vector<std::string> flash_version_numbers = base::SplitString(
version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
if (flash_version_numbers.empty())
flash_version_numbers.emplace_back("11");
// |SplitString()| puts in an empty string given an empty string. :(
else if (flash_version_numbers[0].empty())
flash_version_numbers[0] = "11";
if (flash_version_numbers.size() < 2)
flash_version_numbers.emplace_back("2");
if (flash_version_numbers.size() < 3)
flash_version_numbers.emplace_back("999");
if (flash_version_numbers.size() < 4)
flash_version_numbers.emplace_back("999");
// E.g., "Shockwave Flash 10.2 r154":
plugin.description = plugin.name + " " + flash_version_numbers[0] + "." +
flash_version_numbers[1] + " r" +
flash_version_numbers[2];
plugin.version = base::JoinString(flash_version_numbers, ".");
plugin.mime_types.emplace_back(content::kFlashPluginSwfMimeType,
content::kFlashPluginSwfExtension,
content::kFlashPluginSwfDescription);
plugin.mime_types.emplace_back(content::kFlashPluginSplMimeType,
content::kFlashPluginSplExtension,
content::kFlashPluginSplDescription);
return plugin;
}
void AddPepperFlashFromCommandLine(
base::CommandLine* command_line,
std::vector<content::PepperPluginInfo>* plugins) {
base::FilePath flash_path =
command_line->GetSwitchValuePath(switches::kPpapiFlashPath);
if (flash_path.empty())
return;
auto flash_version =
command_line->GetSwitchValueASCII(switches::kPpapiFlashVersion);
plugins->push_back(CreatePepperFlashInfo(flash_path, flash_version));
}
#endif // BUILDFLAG(ENABLE_PEPPER_FLASH)
#if BUILDFLAG(ENABLE_PLUGINS)
void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
#if BUILDFLAG(ENABLE_PDF_VIEWER)
@ -260,10 +207,6 @@ void ElectronContentClient::AddAdditionalSchemes(Schemes* schemes) {
void ElectronContentClient::AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) {
#if BUILDFLAG(ENABLE_PEPPER_FLASH)
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
AddPepperFlashFromCommandLine(command_line, plugins);
#endif // BUILDFLAG(ENABLE_PEPPER_FLASH)
#if BUILDFLAG(ENABLE_PLUGINS)
ComputeBuiltInPlugins(plugins);
#endif // BUILDFLAG(ENABLE_PLUGINS)

View file

@ -23,7 +23,6 @@
#include "components/upload_list/crash_upload_list.h"
#include "content/public/common/content_switches.h"
#include "electron/electron_version.h"
#include "services/service_manager/embedder/switches.h"
#include "shell/common/electron_paths.h"
#if defined(OS_POSIX) && !defined(OS_MAC)
@ -210,7 +209,7 @@ bool ElectronCrashReporterClient::EnableBreakpadForProcess(
const std::string& process_type) {
return process_type == switches::kRendererProcess ||
process_type == switches::kPpapiPluginProcess ||
process_type == service_manager::switches::kZygoteProcess ||
process_type == switches::kZygoteProcess ||
process_type == switches::kGpuProcess ||
process_type == switches::kUtilityProcess || process_type == "node";
}

View file

@ -27,7 +27,6 @@
#include "extensions/common/constants.h"
#include "ipc/ipc_buildflags.h"
#include "sandbox/policy/switches.h"
#include "services/service_manager/embedder/switches.h"
#include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h"
#include "shell/app/electron_content_client.h"
#include "shell/browser/electron_browser_client.h"
@ -89,7 +88,7 @@ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
return
#if defined(OS_LINUX)
// The zygote process opens the resources for the renderers.
process_type == service_manager::switches::kZygoteProcess ||
process_type == ::switches::kZygoteProcess ||
#endif
#if defined(OS_MAC)
// Mac needs them too for scrollbar related images and for sandbox
@ -346,8 +345,7 @@ void ElectronMainDelegate::PreSandboxStartup() {
#endif
#if defined(OS_LINUX)
if (process_type != service_manager::switches::kZygoteProcess &&
!process_type.empty()) {
if (process_type != ::switches::kZygoteProcess && !process_type.empty()) {
ElectronCrashReporterClient::Create();
breakpad::InitCrashReporter(process_type);
}

View file

@ -22,7 +22,6 @@
#include "content/public/common/content_switches.h"
#include "gin/arguments.h"
#include "gin/data_object_builder.h"
#include "services/service_manager/embedder/switches.h"
#include "shell/common/electron_paths.h"
#include "shell/common/gin_converters/callback_converter.h"
#include "shell/common/gin_converters/file_path_converter.h"

View file

@ -244,6 +244,11 @@ BrowserProcessImpl::floc_blocklist_service() {
return nullptr;
}
federated_learning::FlocSortingLshClustersService*
BrowserProcessImpl::floc_sorting_lsh_clusters_service() {
return nullptr;
}
optimization_guide::OptimizationGuideService*
BrowserProcessImpl::optimization_guide_service() {
return nullptr;

View file

@ -80,6 +80,8 @@ class BrowserProcessImpl : public BrowserProcess {
subresource_filter::RulesetService* subresource_filter_ruleset_service()
override;
federated_learning::FlocBlocklistService* floc_blocklist_service() override;
federated_learning::FlocSortingLshClustersService*
floc_sorting_lsh_clusters_service() override;
optimization_guide::OptimizationGuideService* optimization_guide_service()
override;
component_updater::ComponentUpdateService* component_updater() override;

View file

@ -123,10 +123,6 @@
#include "components/spellcheck/common/spellcheck.mojom.h" // nogncheck
#endif
#if BUILDFLAG(ENABLE_PEPPER_FLASH)
#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h" // nogncheck
#endif // BUILDFLAG(ENABLE_PEPPER_FLASH)
#if BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
#include "shell/browser/fake_location_provider.h"
#endif // BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
@ -609,9 +605,10 @@ void ElectronBrowserClient::OverrideWebkitPrefs(
#endif
ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
prefs->preferred_color_scheme = native_theme->ShouldUseDarkColors()
? blink::PreferredColorScheme::kDark
: blink::PreferredColorScheme::kLight;
prefs->preferred_color_scheme =
native_theme->ShouldUseDarkColors()
? blink::mojom::PreferredColorScheme::kDark
: blink::mojom::PreferredColorScheme::kLight;
SetFontDefaults(prefs);
@ -821,12 +818,7 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches(
}
void ElectronBrowserClient::DidCreatePpapiPlugin(
content::BrowserPpapiHost* host) {
#if BUILDFLAG(ENABLE_PEPPER_FLASH)
host->GetPpapiHost()->AddHostFactoryFilter(
base::WrapUnique(new ChromeBrowserPepperHostFactory(host)));
#endif
}
content::BrowserPpapiHost* host) {}
// attempt to get api key from env
std::string ElectronBrowserClient::GetGeolocationApiKey() {
@ -1294,13 +1286,12 @@ void ElectronBrowserClient::SetUserAgent(const std::string& user_agent) {
void ElectronBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
int frame_tree_node_id,
base::UkmSourceId ukm_source_id,
NonNetworkURLLoaderFactoryDeprecatedMap* uniquely_owned_factories,
NonNetworkURLLoaderFactoryMap* factories) {
content::WebContents* web_contents =
content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
content::BrowserContext* context = web_contents->GetBrowserContext();
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
uniquely_owned_factories->emplace(
factories->emplace(
extensions::kExtensionScheme,
extensions::CreateExtensionNavigationURLLoaderFactory(
context, ukm_source_id,
@ -1382,7 +1373,6 @@ class FileURLLoaderFactory : public content::NonNetworkURLLoaderFactoryBase {
void ElectronBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,
int render_frame_id,
NonNetworkURLLoaderFactoryDeprecatedMap* uniquely_owned_factories,
NonNetworkURLLoaderFactoryMap* factories) {
content::RenderFrameHost* frame_host =
content::RenderFrameHost::FromID(render_process_id, render_frame_id);
@ -1398,8 +1388,7 @@ void ElectronBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
auto factory = extensions::CreateExtensionURLLoaderFactory(render_process_id,
render_frame_id);
if (factory)
uniquely_owned_factories->emplace(extensions::kExtensionScheme,
std::move(factory));
factories->emplace(extensions::kExtensionScheme, std::move(factory));
if (!web_contents)
return;
@ -1499,6 +1488,7 @@ bool ElectronBrowserClient::WillCreateURLLoaderFactory(
URLLoaderFactoryType type,
const url::Origin& request_initiator,
base::Optional<int64_t> navigation_id,
base::UkmSourceId ukm_source_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
header_client,
@ -1697,7 +1687,7 @@ void ElectronBrowserClient::GetAdditionalMappedFilesForChildProcess(
content::PosixFileDescriptorInfo* mappings) {
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
mappings->Share(service_manager::kCrashDumpSignal, crash_signal_fd);
mappings->Share(kCrashDumpSignal, crash_signal_fd);
}
}
#endif

View file

@ -180,7 +180,6 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
void RegisterNonNetworkNavigationURLLoaderFactories(
int frame_tree_node_id,
base::UkmSourceId ukm_source_id,
NonNetworkURLLoaderFactoryDeprecatedMap* uniquely_owned_factories,
NonNetworkURLLoaderFactoryMap* factories) override;
void RegisterNonNetworkWorkerMainResourceURLLoaderFactories(
content::BrowserContext* browser_context,
@ -188,7 +187,6 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
void RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,
int render_frame_id,
NonNetworkURLLoaderFactoryDeprecatedMap* uniquely_owned_factories,
NonNetworkURLLoaderFactoryMap* factories) override;
void CreateWebSocket(
content::RenderFrameHost* frame,
@ -206,6 +204,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
base::Optional<int64_t> navigation_id,
base::UkmSourceId ukm_source_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
header_client,

View file

@ -337,8 +337,8 @@ ElectronBrowserContext::GetURLLoaderFactory() {
->WillCreateURLLoaderFactory(
this, nullptr, -1,
content::ContentBrowserClient::URLLoaderFactoryType::kNavigation,
url::Origin(), base::nullopt, &factory_receiver, &header_client,
nullptr, nullptr, nullptr);
url::Origin(), base::nullopt, base::kInvalidUkmSourceId,
&factory_receiver, &header_client, nullptr, nullptr, nullptr);
network::mojom::URLLoaderFactoryParamsPtr params =
network::mojom::URLLoaderFactoryParams::New();

View file

@ -63,7 +63,6 @@
#include "base/environment.h"
#include "base/nix/xdg_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "ui/base/x/x11_error_handler.h"
#include "ui/base/x/x11_util.h"
#include "ui/events/devices/x11/touch_factory_x11.h"
#include "ui/gfx/color_utils.h"
@ -237,18 +236,11 @@ int ElectronBrowserMainParts::PreEarlyInitialization() {
OverrideLinuxAppDataPath();
#endif
#if defined(USE_X11)
// Installs the X11 error handlers for the browser process used during
// startup. They simply print error messages and exit because
// we can't shutdown properly while creating and initializing services.
ui::SetNullErrorHandlers();
#endif
#if defined(OS_POSIX)
HandleSIGCHLD();
#endif
return service_manager::RESULT_CODE_NORMAL_EXIT;
return content::RESULT_CODE_NORMAL_EXIT;
}
void ElectronBrowserMainParts::PostEarlyInitialization() {
@ -452,13 +444,6 @@ void ElectronBrowserMainParts::PreDefaultMainMessageLoopRun(
}
void ElectronBrowserMainParts::PostMainMessageLoopStart() {
#if defined(USE_X11)
// Installs the X11 error handlers for the browser process after the
// main message loop has started. This will allow us to exit cleanly
// if X exits before us.
ui::SetErrorHandlers(
base::BindOnce(base::RunLoop::QuitCurrentWhenIdleClosureDeprecated()));
#endif
#if defined(OS_LINUX)
bluez::DBusBluezManagerWrapperLinux::Initialize();
#endif
@ -468,13 +453,6 @@ void ElectronBrowserMainParts::PostMainMessageLoopStart() {
}
void ElectronBrowserMainParts::PostMainMessageLoopRun() {
#if defined(USE_X11)
// Unset the X11 error handlers. The X11 error handlers log the errors using a
// |PostTask()| on the message-loop. But since the message-loop is in the
// process of terminating, this can cause errors.
ui::SetEmptyErrorHandlers();
#endif
#if defined(OS_MAC)
FreeAppDelegate();
#endif

View file

@ -163,6 +163,10 @@ bool TabsExecuteScriptFunction::ShouldInsertCSS() const {
return false;
}
bool TabsExecuteScriptFunction::ShouldRemoveCSS() const {
return false;
}
ExtensionFunction::ResponseAction TabsGetFunction::Run() {
std::unique_ptr<tabs::Get::Params> params(tabs::Get::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());

View file

@ -37,6 +37,7 @@ class ExecuteCodeInTabFunction : public ExecuteCodeFunction {
class TabsExecuteScriptFunction : public ExecuteCodeInTabFunction {
protected:
bool ShouldInsertCSS() const override;
bool ShouldRemoveCSS() const override;
private:
~TabsExecuteScriptFunction() override {}

View file

@ -32,9 +32,9 @@ const int kMaxScanRetries = 5;
void OnDeviceChosen(const content::BluetoothChooser::EventHandler& handler,
const std::string& device_id) {
if (device_id.empty()) {
handler.Run(content::BluetoothChooser::Event::CANCELLED, device_id);
handler.Run(content::BluetoothChooserEvent::CANCELLED, device_id);
} else {
handler.Run(content::BluetoothChooser::Event::SELECTED, device_id);
handler.Run(content::BluetoothChooserEvent::SELECTED, device_id);
}
}
@ -50,7 +50,7 @@ void BluetoothChooser::SetAdapterPresence(AdapterPresence presence) {
switch (presence) {
case AdapterPresence::ABSENT:
case AdapterPresence::POWERED_OFF:
event_handler_.Run(Event::CANCELLED, "");
event_handler_.Run(content::BluetoothChooserEvent::CANCELLED, "");
break;
case AdapterPresence::POWERED_ON:
break;
@ -60,12 +60,13 @@ void BluetoothChooser::SetAdapterPresence(AdapterPresence presence) {
void BluetoothChooser::ShowDiscoveryState(DiscoveryState state) {
switch (state) {
case DiscoveryState::FAILED_TO_START:
event_handler_.Run(Event::CANCELLED, "");
event_handler_.Run(content::BluetoothChooserEvent::CANCELLED, "");
break;
case DiscoveryState::IDLE:
if (device_map_.empty()) {
auto event =
++num_retries_ > kMaxScanRetries ? Event::CANCELLED : Event::RESCAN;
auto event = ++num_retries_ > kMaxScanRetries
? content::BluetoothChooserEvent::CANCELLED
: content::BluetoothChooserEvent::RESCAN;
event_handler_.Run(event, "");
} else {
bool prevent_default = api_web_contents_->Emit(
@ -74,7 +75,8 @@ void BluetoothChooser::ShowDiscoveryState(DiscoveryState state) {
if (!prevent_default) {
auto it = device_map_.begin();
auto device_id = it->first;
event_handler_.Run(Event::SELECTED, device_id);
event_handler_.Run(content::BluetoothChooserEvent::SELECTED,
device_id);
}
}
break;
@ -109,7 +111,7 @@ void BluetoothChooser::AddOrUpdateDevice(const std::string& device_id,
// If emit not implimented select first device that matches the filters
// provided.
if (!prevent_default) {
event_handler_.Run(Event::SELECTED, device_id);
event_handler_.Run(content::BluetoothChooserEvent::SELECTED, device_id);
}
}
}

View file

@ -109,7 +109,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::UpdateRequestInfo() {
: nullptr,
routing_id_, request_for_info, false,
!(options_ & network::mojom::kURLLoadOptionSynchronous),
factory_->IsForServiceWorkerScript(), factory_->navigation_id_));
factory_->IsForServiceWorkerScript(), factory_->navigation_id_,
base::kInvalidUkmSourceId));
current_request_uses_header_client_ =
factory_->url_loader_header_client_receiver_.is_bound() &&

View file

@ -45,7 +45,8 @@ ProxyingWebSocket::ProxyingWebSocket(
/*is_download=*/false,
/*is_async=*/true,
/*is_service_worker_script=*/false,
/*navigation_id=*/base::nullopt)) {}
/*navigation_id=*/base::nullopt,
/*ukm_source_id=*/base::kInvalidUkmSourceId)) {}
ProxyingWebSocket::~ProxyingWebSocket() {
if (on_before_send_headers_callback_) {

View file

@ -43,6 +43,7 @@
#include "ui/events/event_constants.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/skbitmap_operations.h"
@ -193,11 +194,10 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
current_device_scale_factor_ = kDefaultScaleFactor;
delegated_frame_host_allocator_.GenerateId();
delegated_frame_host_allocation_ =
delegated_frame_host_allocator_.GetCurrentLocalSurfaceIdAllocation();
delegated_frame_host_surface_id_ =
delegated_frame_host_allocator_.GetCurrentLocalSurfaceId();
compositor_allocator_.GenerateId();
compositor_allocation_ =
compositor_allocator_.GetCurrentLocalSurfaceIdAllocation();
compositor_surface_id_ = compositor_allocator_.GetCurrentLocalSurfaceId();
delegated_frame_host_client_ =
std::make_unique<ElectronDelegatedFrameHostClient>(this);
@ -305,9 +305,8 @@ void OffScreenRenderWidgetHostView::Show() {
is_showing_ = true;
delegated_frame_host_->AttachToCompositor(compositor_.get());
delegated_frame_host_->WasShown(
GetLocalSurfaceIdAllocation().local_surface_id(),
GetRootLayer()->bounds().size(), {});
delegated_frame_host_->WasShown(GetLocalSurfaceId(),
GetRootLayer()->bounds().size(), {});
if (render_widget_host_)
render_widget_host_->WasShown({});
@ -359,9 +358,7 @@ base::Optional<SkColor> OffScreenRenderWidgetHostView::GetBackgroundColor() {
return background_color_;
}
void OffScreenRenderWidgetHostView::UpdateBackgroundColor() {
NOTREACHED();
}
void OffScreenRenderWidgetHostView::UpdateBackgroundColor() {}
gfx::Size OffScreenRenderWidgetHostView::GetVisibleViewportSize() {
return size_;
@ -669,11 +666,11 @@ void OffScreenRenderWidgetHostView::OnPaint(const gfx::Rect& damage_rect,
gfx::Size OffScreenRenderWidgetHostView::SizeInPixels() {
if (IsPopupWidget()) {
return gfx::ConvertSizeToPixel(current_device_scale_factor_,
popup_position_.size());
return gfx::ToFlooredSize(gfx::ConvertSizeToPixels(
popup_position_.size(), current_device_scale_factor_));
} else {
return gfx::ConvertSizeToPixel(current_device_scale_factor_,
GetViewBounds().size());
return gfx::ToFlooredSize(gfx::ConvertSizeToPixels(
GetViewBounds().size(), current_device_scale_factor_));
}
}
@ -697,16 +694,18 @@ void OffScreenRenderWidgetHostView::CompositeFrame(
if (popup_host_view_ && !popup_host_view_->GetBacking().drawsNothing()) {
gfx::Rect rect = popup_host_view_->popup_position_;
gfx::Point origin_in_pixels = gfx::ConvertPointToPixel(
current_device_scale_factor_, rect.origin());
gfx::Point origin_in_pixels =
gfx::ToFlooredPoint(gfx::ConvertPointToPixels(
rect.origin(), current_device_scale_factor_));
canvas.writePixels(popup_host_view_->GetBacking(), origin_in_pixels.x(),
origin_in_pixels.y());
}
for (auto* proxy_view : proxy_views_) {
gfx::Rect rect = proxy_view->GetBounds();
gfx::Point origin_in_pixels = gfx::ConvertPointToPixel(
current_device_scale_factor_, rect.origin());
gfx::Point origin_in_pixels =
gfx::ToFlooredPoint(gfx::ConvertPointToPixels(
rect.origin(), current_device_scale_factor_));
canvas.writePixels(*proxy_view->GetBitmap(), origin_in_pixels.x(),
origin_in_pixels.y());
}
@ -722,14 +721,14 @@ void OffScreenRenderWidgetHostView::CompositeFrame(
}
void OffScreenRenderWidgetHostView::OnPopupPaint(const gfx::Rect& damage_rect) {
InvalidateBounds(
gfx::ConvertRectToPixel(current_device_scale_factor_, damage_rect));
InvalidateBounds(gfx::ToEnclosingRect(
gfx::ConvertRectToPixels(damage_rect, current_device_scale_factor_)));
}
void OffScreenRenderWidgetHostView::OnProxyViewPaint(
const gfx::Rect& damage_rect) {
InvalidateBounds(
gfx::ConvertRectToPixel(current_device_scale_factor_, damage_rect));
InvalidateBounds(gfx::ToEnclosingRect(
gfx::ConvertRectToPixels(damage_rect, current_device_scale_factor_)));
}
void OffScreenRenderWidgetHostView::HoldResize() {
@ -941,9 +940,9 @@ ui::Layer* OffScreenRenderWidgetHostView::GetRootLayer() const {
return root_layer_.get();
}
const viz::LocalSurfaceIdAllocation&
OffScreenRenderWidgetHostView::GetLocalSurfaceIdAllocation() const {
return delegated_frame_host_allocation_;
const viz::LocalSurfaceId& OffScreenRenderWidgetHostView::GetLocalSurfaceId()
const {
return delegated_frame_host_surface_id_;
}
content::DelegatedFrameHost*
@ -995,23 +994,22 @@ void OffScreenRenderWidgetHostView::ResizeRootLayer(bool force) {
GetRootLayer()->SetBounds(gfx::Rect(size));
const gfx::Size& size_in_pixels =
gfx::ConvertSizeToPixel(current_device_scale_factor_, size);
const gfx::Size& size_in_pixels = gfx::ToFlooredSize(
gfx::ConvertSizeToPixels(size, current_device_scale_factor_));
if (compositor_) {
compositor_allocator_.GenerateId();
compositor_allocation_ =
compositor_allocator_.GetCurrentLocalSurfaceIdAllocation();
compositor_surface_id_ = compositor_allocator_.GetCurrentLocalSurfaceId();
compositor_->SetScaleAndSize(current_device_scale_factor_, size_in_pixels,
compositor_allocation_);
compositor_surface_id_);
}
delegated_frame_host_allocator_.GenerateId();
delegated_frame_host_allocation_ =
delegated_frame_host_allocator_.GetCurrentLocalSurfaceIdAllocation();
delegated_frame_host_surface_id_ =
delegated_frame_host_allocator_.GetCurrentLocalSurfaceId();
GetDelegatedFrameHost()->EmbedSurface(
delegated_frame_host_allocation_.local_surface_id(), size,
delegated_frame_host_surface_id_, size,
cc::DeadlinePolicy::UseDefaultDeadline());
// Note that |render_widget_host_| will retrieve resize parameters from the

View file

@ -140,8 +140,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
content::RenderWidgetHost*,
content::WebContentsView*) override;
const viz::LocalSurfaceIdAllocation& GetLocalSurfaceIdAllocation()
const override;
const viz::LocalSurfaceId& GetLocalSurfaceId() const override;
const viz::FrameSinkId& GetFrameSinkId() const override;
void DidNavigate() override;
@ -254,10 +253,10 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
bool paint_callback_running_ = false;
viz::LocalSurfaceIdAllocation delegated_frame_host_allocation_;
viz::LocalSurfaceId delegated_frame_host_surface_id_;
viz::ParentLocalSurfaceIdAllocator delegated_frame_host_allocator_;
viz::LocalSurfaceIdAllocation compositor_allocation_;
viz::LocalSurfaceId compositor_surface_id_;
viz::ParentLocalSurfaceIdAllocator compositor_allocator_;
std::unique_ptr<ui::Layer> root_layer_;

View file

@ -162,7 +162,7 @@ bool OffScreenWebContentsView::CloseTabAfterEventTrackingIfNeeded() {
void OffScreenWebContentsView::StartDragging(
const content::DropData& drop_data,
blink::WebDragOperationsMask allowed_ops,
blink::DragOperationsMask allowed_ops,
const gfx::ImageSkia& image,
const gfx::Vector2d& image_offset,
const blink::mojom::DragEventSourceInfo& event_info,
@ -173,7 +173,7 @@ void OffScreenWebContentsView::StartDragging(
}
void OffScreenWebContentsView::UpdateDragCursor(
blink::WebDragOperation operation) {}
blink::DragOperation operation) {}
void OffScreenWebContentsView::SetPainting(bool painting) {
auto* view = GetView();

View file

@ -12,6 +12,7 @@
#include "content/browser/web_contents/web_contents_view.h" // nogncheck
#include "content/public/browser/web_contents.h"
#include "shell/browser/osr/osr_render_widget_host_view.h"
#include "third_party/blink/public/common/page/drag_mojom_traits.h"
#if defined(OS_MAC)
#ifdef __OBJC__
@ -68,13 +69,12 @@ class OffScreenWebContentsView : public content::WebContentsView,
// content::RenderViewHostDelegateView
void StartDragging(const content::DropData& drop_data,
blink::WebDragOperationsMask allowed_ops,
blink::DragOperationsMask allowed_ops,
const gfx::ImageSkia& image,
const gfx::Vector2d& image_offset,
const blink::mojom::DragEventSourceInfo& event_info,
content::RenderWidgetHostImpl* source_rwh) override;
void UpdateDragCursor(blink::WebDragOperation operation) override;
void UpdateDragCursor(blink::DragOperation operation) override;
void SetPainting(bool painting);
bool IsPainting() const;
void SetFrameRate(int frame_rate);

View file

@ -15,8 +15,17 @@
namespace electron {
constexpr char kPortNameKey[] = "name";
constexpr char kPersistentIdKey[] = "persistent_id";
constexpr char kTokenKey[] = "token";
#if defined(OS_WIN)
constexpr char kDeviceInstanceIdKey[] = "device_instance_id";
#else
constexpr char kVendorIdKey[] = "vendor_id";
constexpr char kProductIdKey[] = "product_id";
constexpr char kSerialNumberKey[] = "serial_number";
#if defined(OS_MAC)
constexpr char kUsbDriverKey[] = "usb_driver";
#endif // defined(OS_MAC)
#endif // defined(OS_WIN)
std::string EncodeToken(const base::UnguessableToken& token) {
const uint64_t data[2] = {token.GetHighForSerialization(),
@ -45,10 +54,29 @@ base::Value PortInfoToValue(const device::mojom::SerialPortInfo& port) {
value.SetStringKey(kPortNameKey, *port.display_name);
else
value.SetStringKey(kPortNameKey, port.path.LossyDisplayName());
if (SerialChooserContext::CanStorePersistentEntry(port))
value.SetStringKey(kPersistentIdKey, port.persistent_id.value());
else
if (!SerialChooserContext::CanStorePersistentEntry(port)) {
value.SetStringKey(kTokenKey, EncodeToken(port.token));
return value;
}
#if defined(OS_WIN)
// Windows provides a handy device identifier which we can rely on to be
// sufficiently stable for identifying devices across restarts.
value.SetStringKey(kDeviceInstanceIdKey, port.device_instance_id);
#else
DCHECK(port.has_vendor_id);
value.SetIntKey(kVendorIdKey, port.vendor_id);
DCHECK(port.has_product_id);
value.SetIntKey(kProductIdKey, port.product_id);
DCHECK(port.serial_number);
value.SetStringKey(kSerialNumberKey, *port.serial_number);
#if defined(OS_MAC)
DCHECK(port.usb_driver_name && !port.usb_driver_name->empty());
value.SetStringKey(kUsbDriverKey, *port.usb_driver_name);
#endif // defined(OS_MAC)
#endif // defined(OS_WIN)
return value;
}
@ -89,7 +117,28 @@ bool SerialChooserContext::CanStorePersistentEntry(
if (!port.display_name || port.display_name->empty())
return false;
return port.persistent_id && !port.persistent_id->empty();
#if defined(OS_WIN)
return !port.device_instance_id.empty();
#else
if (!port.has_vendor_id || !port.has_product_id || !port.serial_number ||
port.serial_number->empty()) {
return false;
}
#if defined(OS_MAC)
// The combination of the standard USB vendor ID, product ID and serial
// number properties should be enough to uniquely identify a device
// however recent versions of macOS include built-in drivers for common
// types of USB-to-serial adapters while their manufacturers still
// recommend installing their custom drivers. When both are loaded two
// IOSerialBSDClient instances are found for each device. Including the
// USB driver name allows us to distinguish between the two.
if (!port.usb_driver_name || port.usb_driver_name->empty())
return false;
#endif // defined(OS_MAC)
return true;
#endif // defined(OS_WIN)
}
device::mojom::SerialPortManager* SerialChooserContext::GetPortManager() {

View file

@ -32,16 +32,24 @@ struct Converter<device::mojom::SerialPortInfoPtr> {
if (port->display_name && !port->display_name->empty()) {
dict.Set("displayName", *port->display_name);
}
if (port->persistent_id && !port->persistent_id->empty()) {
dict.Set("persistentId", *port->persistent_id);
}
if (port->has_vendor_id) {
dict.Set("vendorId", base::StringPrintf("%u", port->vendor_id));
}
if (port->has_product_id) {
dict.Set("productId", base::StringPrintf("%u", port->product_id));
}
if (port->serial_number && !port->serial_number->empty()) {
dict.Set("serialNumber", *port->serial_number);
}
#if defined(OS_MAC)
if (port->usb_driver_name && !port->usb_driver_name->empty()) {
dict.Set("usbDriverName", *port->usb_driver_name);
}
#elif defined(OS_WIN)
if (!port->device_instance_id.empty()) {
dict.Set("deviceInstanceId", port->device_instance_id);
}
#endif
return gin::ConvertToV8(isolate, dict);
}
};

View file

@ -8,6 +8,7 @@
#include <glib-object.h>
#include "base/logging.h"
#include "base/strings/string16.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h"
@ -17,7 +18,11 @@
#include "ui/aura/window_tree_host.h"
#include "ui/base/accelerators/menu_label_accelerator_util_linux.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#include "ui/events/keycodes/keysym_to_unicode.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/keysyms/keysyms.h"
#include "ui/gfx/x/x11.h"
#include "ui/gfx/x/xproto.h"
// libdbusmenu-glib types
typedef struct _DbusmenuMenuitem DbusmenuMenuitem;
@ -286,13 +291,14 @@ void GlobalMenuBarX11::RegisterAccelerator(DbusmenuMenuitem* item,
if (accelerator.IsShiftDown())
g_variant_builder_add(&builder, "s", "Shift");
char* name =
XKeysymToString(XKeysymForWindowsKeyCode(accelerator.key_code(), false));
if (!name) {
uint16_t keysym = ui::GetUnicodeCharacterFromXKeySym(
XKeysymForWindowsKeyCode(accelerator.key_code(), false));
if (!keysym) {
NOTIMPLEMENTED();
return;
}
g_variant_builder_add(&builder, "s", name);
std::string name = base::UTF16ToUTF8(base::string16(1, keysym));
g_variant_builder_add(&builder, "s", name.c_str());
GVariant* inside_array = g_variant_builder_end(&builder);
g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY);

View file

@ -38,7 +38,7 @@ SubmenuButton::SubmenuButton(views::ButtonListener* button_listener,
&text_height_, 0, 0);
SetInkDropMode(InkDropMode::ON);
set_ink_drop_base_color(
SetInkDropBaseColor(
color_utils::BlendTowardMaxContrast(background_color_, 0x81));
}
@ -49,7 +49,7 @@ std::unique_ptr<views::InkDropRipple> SubmenuButton::CreateInkDropRipple()
std::unique_ptr<views::InkDropRipple> ripple(
new views::FloodFillInkDropRipple(
size(), GetInkDropCenterBasedOnLastEvent(), GetInkDropBaseColor(),
ink_drop_visible_opacity()));
GetInkDropVisibleOpacity()));
return ripple;
}

View file

@ -147,33 +147,29 @@ bool ShouldHandleAccessibilityRequestCallback(const std::string& path) {
// Add property filters to the property_filters vector for the given property
// filter type. The attributes are passed in as a string with each attribute
// separated by a space.
void AddPropertyFilters(
std::vector<content::AccessibilityTreeFormatter::PropertyFilter>&
property_filters,
const std::string& attributes,
content::AccessibilityTreeFormatter::PropertyFilter::Type type) {
void AddPropertyFilters(std::vector<ui::AXPropertyFilter>* property_filters,
const std::string& attributes,
ui::AXPropertyFilter::Type type) {
for (const std::string& attribute : base::SplitString(
attributes, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
property_filters.push_back(
content::AccessibilityTreeFormatter::PropertyFilter(attribute, type));
property_filters->push_back(ui::AXPropertyFilter(attribute, type));
}
}
bool MatchesPropertyFilters(
const std::vector<content::AccessibilityTreeFormatter::PropertyFilter>&
property_filters,
const std::vector<ui::AXPropertyFilter>& property_filters,
const std::string& text) {
bool allow = false;
for (const auto& filter : property_filters) {
if (base::MatchPattern(text, filter.match_str)) {
switch (filter.type) {
case content::AccessibilityTreeFormatter::PropertyFilter::ALLOW_EMPTY:
case ui::AXPropertyFilter::ALLOW_EMPTY:
allow = true;
break;
case content::AccessibilityTreeFormatter::PropertyFilter::ALLOW:
case ui::AXPropertyFilter::ALLOW:
allow = (!base::MatchPattern(text, "*=''"));
break;
case content::AccessibilityTreeFormatter::PropertyFilter::DENY:
case ui::AXPropertyFilter::DENY:
allow = false;
break;
}
@ -185,8 +181,7 @@ bool MatchesPropertyFilters(
std::string RecursiveDumpAXPlatformNodeAsString(
const ui::AXPlatformNode* node,
int indent,
const std::vector<content::AccessibilityTreeFormatter::PropertyFilter>&
property_filters) {
const std::vector<ui::AXPropertyFilter>& property_filters) {
if (!node)
return "";
std::string str(2 * indent, '+');
@ -362,16 +357,11 @@ void ElectronAccessibilityUIMessageHandler::RequestNativeUITree(
AllowJavascript();
std::vector<content::AccessibilityTreeFormatter::PropertyFilter>
property_filters;
AddPropertyFilters(
property_filters, allow,
content::AccessibilityTreeFormatter::PropertyFilter::ALLOW);
AddPropertyFilters(
property_filters, allow_empty,
content::AccessibilityTreeFormatter::PropertyFilter::ALLOW_EMPTY);
AddPropertyFilters(property_filters, deny,
content::AccessibilityTreeFormatter::PropertyFilter::DENY);
std::vector<ui::AXPropertyFilter> property_filters;
AddPropertyFilters(&property_filters, allow, ui::AXPropertyFilter::ALLOW);
AddPropertyFilters(&property_filters, allow_empty,
ui::AXPropertyFilter::ALLOW_EMPTY);
AddPropertyFilters(&property_filters, deny, ui::AXPropertyFilter::DENY);
for (auto* window : electron::WindowList::GetWindows()) {
if (window->window_id() == window_id) {

View file

@ -83,9 +83,8 @@ void MoveWindowAbove(x11::Window window, x11::Window other_window) {
}
bool IsWindowValid(x11::Window window) {
XWindowAttributes attrs;
return XGetWindowAttributes(gfx::GetXDisplay(), static_cast<uint32_t>(window),
&attrs);
auto* conn = x11::Connection::Get();
return conn->GetWindowAttributes({window}).Sync();
}
} // namespace electron

View file

@ -76,17 +76,17 @@ bool GetAsInteger(const base::Value* val, base::StringPiece path, int* out) {
bool GetAsAutoplayPolicy(const base::Value* val,
base::StringPiece path,
blink::web_pref::AutoplayPolicy* out) {
blink::mojom::AutoplayPolicy* out) {
std::string policy_str;
if (GetAsString(val, path, &policy_str)) {
if (policy_str == "no-user-gesture-required") {
*out = blink::web_pref::AutoplayPolicy::kNoUserGestureRequired;
*out = blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
return true;
} else if (policy_str == "user-gesture-required") {
*out = blink::web_pref::AutoplayPolicy::kUserGestureRequired;
*out = blink::mojom::AutoplayPolicy::kUserGestureRequired;
return true;
} else if (policy_str == "document-user-activation-required") {
*out = blink::web_pref::AutoplayPolicy::kDocumentUserActivationRequired;
*out = blink::mojom::AutoplayPolicy::kDocumentUserActivationRequired;
return true;
}
return false;
@ -461,7 +461,7 @@ void WebContentsPreferences::OverrideWebkitPrefs(
if (!GetAsAutoplayPolicy(&preference_, "autoplayPolicy",
&prefs->autoplay_policy)) {
prefs->autoplay_policy =
blink::web_pref::AutoplayPolicy::kNoUserGestureRequired;
blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
}
// Check if webgl should be enabled.

View file

@ -62,10 +62,6 @@ void WebViewGuestDelegate::WillDestroy() {
ResetZoomController();
}
void WebViewGuestDelegate::DidDetach() {
ResetZoomController();
}
content::WebContents* WebViewGuestDelegate::GetOwnerWebContents() {
return embedder_web_contents_;
}
@ -97,14 +93,6 @@ void WebViewGuestDelegate::ResetZoomController() {
}
}
content::RenderWidgetHost* WebViewGuestDelegate::GetOwnerRenderWidgetHost() {
return embedder_web_contents_->GetRenderViewHost()->GetWidget();
}
content::SiteInstance* WebViewGuestDelegate::GetOwnerSiteInstance() {
return embedder_web_contents_->GetSiteInstance();
}
content::WebContents* WebViewGuestDelegate::CreateNewGuestWindow(
const content::WebContents::CreateParams& create_params) {
// Code below mirrors what content::WebContentsImpl::CreateNewWindow

View file

@ -28,10 +28,7 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
protected:
// content::BrowserPluginGuestDelegate:
void DidDetach() final;
content::WebContents* GetOwnerWebContents() final;
content::RenderWidgetHost* GetOwnerRenderWidgetHost() final;
content::SiteInstance* GetOwnerSiteInstance() final;
content::WebContents* CreateNewGuestWindow(
const content::WebContents::CreateParams& create_params) final;

View file

@ -45,21 +45,6 @@ content::WebContents* WebViewManager::GetEmbedder(int guest_instance_id) {
: iter->second.embedder;
}
content::WebContents* WebViewManager::GetGuestByInstanceID(
int owner_process_id,
int element_instance_id) {
const ElementInstanceKey key(owner_process_id, element_instance_id);
const auto guest_iter = element_instance_id_to_guest_map_.find(key);
if (guest_iter == std::end(element_instance_id_to_guest_map_))
return nullptr;
const int guest_instance_id = guest_iter->second;
const auto iter = web_contents_embedder_map_.find(guest_instance_id);
return iter == std::end(web_contents_embedder_map_)
? nullptr
: iter->second.web_contents;
}
bool WebViewManager::ForEachGuest(content::WebContents* embedder_web_contents,
const GuestCallback& callback) {
for (auto& item : web_contents_embedder_map_) {

View file

@ -27,8 +27,6 @@ class WebViewManager : public content::BrowserPluginGuestManager {
protected:
// content::BrowserPluginGuestManager:
content::WebContents* GetGuestByInstanceID(int owner_process_id,
int element_instance_id) override;
bool ForEachGuest(content::WebContents* embedder,
const GuestCallback& callback) override;

View file

@ -40,6 +40,7 @@
"id": {"type": "integer", "minimum": -1, "optional": true, "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a tab may not be assigned an ID; for example, when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present. Tab ID can also be set to <code>chrome.tabs.TAB_ID_NONE</code> for apps and devtools windows."},
// TODO(kalman): Investigate how this is ending up as -1 (based on window type? a bug?) and whether it should be optional instead.
"index": {"type": "integer", "minimum": -1, "description": "The zero-based index of the tab within its window."},
"groupId": {"type": "integer", "minimum": -1, "description": "The ID of the group that the tab belongs to."},
"windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window that contains the tab."},
"openerTabId": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."},
"selected": {"type": "boolean", "description": "Whether the tab is selected.", "deprecated": "Please use $(ref:tabs.Tab.highlighted)."},

View file

@ -334,10 +334,6 @@ bool Converter<scoped_refptr<network::ResourceRequestBody>>::FromV8(
static_cast<uint64_t>(offset),
static_cast<uint64_t>(length),
base::Time::FromDoubleT(modification_time));
} else if (type == "blob") {
std::string uuid;
dict->GetString("blobUUID", &uuid);
(*out)->AppendBlob(uuid);
}
}
return true;

View file

@ -388,7 +388,6 @@ void SetVisualZoomLevelLimits(gin_helper::ErrorThrower thrower,
blink::WebFrame* web_frame = render_frame->GetWebFrame();
web_frame->View()->SetDefaultPageScaleLimits(min_level, max_level);
web_frame->View()->SetIgnoreViewportTagScaleLimits(true);
}
void AllowGuestViewElementDefinition(gin_helper::ErrorThrower thrower,

View file

@ -21,17 +21,6 @@ ContentSettingsObserver::ContentSettingsObserver(
ContentSettingsObserver::~ContentSettingsObserver() = default;
bool ContentSettingsObserver::AllowStorage(bool local) {
blink::WebFrame* frame = render_frame()->GetWebFrame();
if (frame->GetSecurityOrigin().IsOpaque() ||
frame->Top()->GetSecurityOrigin().IsOpaque())
return false;
auto origin = blink::WebStringToGURL(frame->GetSecurityOrigin().ToString());
if (!origin.IsStandard())
return false;
return true;
}
bool ContentSettingsObserver::AllowStorageAccessSync(StorageType storage_type) {
if (storage_type == StorageType::kDatabase &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(

View file

@ -19,7 +19,6 @@ class ContentSettingsObserver : public content::RenderFrameObserver,
// blink::WebContentSettingsClient implementation.
bool AllowStorageAccessSync(StorageType storage_type) override;
bool AllowStorage(bool local) override;
private:
// content::RenderFrameObserver implementation.

View file

@ -57,8 +57,4 @@ void GuestViewContainer::DidResizeElement(const gfx::Size& new_size) {
FROM_HERE, base::BindOnce(element_resize_callback_, new_size));
}
base::WeakPtr<content::BrowserPluginDelegate> GuestViewContainer::GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
} // namespace electron

View file

@ -6,7 +6,6 @@
#define SHELL_RENDERER_GUEST_VIEW_CONTAINER_H_
#include "base/callback.h"
#include "content/public/renderer/browser_plugin_delegate.h"
#include "content/public/renderer/render_frame.h"
namespace gfx {
@ -15,21 +14,18 @@ class Size;
namespace electron {
class GuestViewContainer : public content::BrowserPluginDelegate {
class GuestViewContainer {
public:
typedef base::Callback<void(const gfx::Size&)> ResizeCallback;
explicit GuestViewContainer(content::RenderFrame* render_frame);
~GuestViewContainer() override;
virtual ~GuestViewContainer();
static GuestViewContainer* FromID(int element_instance_id);
void RegisterElementResizeCallback(const ResizeCallback& callback);
// content::BrowserPluginDelegate:
void SetElementInstanceID(int element_instance_id) final;
void DidResizeElement(const gfx::Size& new_size) final;
base::WeakPtr<BrowserPluginDelegate> GetWeakPtr() final;
void SetElementInstanceID(int element_instance_id);
void DidResizeElement(const gfx::Size& new_size);
private:
int element_instance_id_;

View file

@ -363,7 +363,7 @@ void RendererClientBase::DidSetUserAgent(const std::string& user_agent) {
#endif
}
content::BrowserPluginDelegate* RendererClientBase::CreateBrowserPluginDelegate(
guest_view::GuestViewContainer* RendererClientBase::CreateBrowserPluginDelegate(
content::RenderFrame* render_frame,
const content::WebPluginInfo& info,
const std::string& mime_type,

View file

@ -30,8 +30,15 @@ class SpellCheck;
namespace extensions {
class ExtensionsClient;
}
namespace content {
struct WebPluginInfo;
}
#endif
namespace guest_view {
class GuestViewContainer;
}
namespace electron {
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
@ -100,11 +107,11 @@ class RendererClientBase : public content::ContentRendererClient
override;
bool IsKeySystemsUpdateNeeded() override;
void DidSetUserAgent(const std::string& user_agent) override;
content::BrowserPluginDelegate* CreateBrowserPluginDelegate(
guest_view::GuestViewContainer* CreateBrowserPluginDelegate(
content::RenderFrame* render_frame,
const content::WebPluginInfo& info,
const std::string& mime_type,
const GURL& original_url) override;
const GURL& original_url);
bool IsPluginHandledExternally(content::RenderFrame* render_frame,
const blink::WebElement& plugin_element,
const GURL& original_url,