build: remove enable_osr build flag (#38703)
Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
		
					parent
					
						
							
								80a3ba5c68
							
						
					
				
			
			
				commit
				
					
						e37111edcc
					
				
			
		
					 14 changed files with 21 additions and 108 deletions
				
			
		
							
								
								
									
										34
									
								
								BUILD.gn
									
										
									
									
									
								
							
							
						
						
									
										34
									
								
								BUILD.gn
									
										
									
									
									
								
							| 
						 | 
					@ -457,6 +457,7 @@ source_set("electron_lib") {
 | 
				
			||||||
    "//services/proxy_resolver:lib",
 | 
					    "//services/proxy_resolver:lib",
 | 
				
			||||||
    "//services/video_capture/public/mojom:constants",
 | 
					    "//services/video_capture/public/mojom:constants",
 | 
				
			||||||
    "//services/viz/privileged/mojom/compositing",
 | 
					    "//services/viz/privileged/mojom/compositing",
 | 
				
			||||||
 | 
					    "//services/viz/public/mojom",
 | 
				
			||||||
    "//skia",
 | 
					    "//skia",
 | 
				
			||||||
    "//third_party/blink/public:blink",
 | 
					    "//third_party/blink/public:blink",
 | 
				
			||||||
    "//third_party/blink/public:blink_devtools_inspector_resources",
 | 
					    "//third_party/blink/public:blink_devtools_inspector_resources",
 | 
				
			||||||
| 
						 | 
					@ -470,6 +471,7 @@ source_set("electron_lib") {
 | 
				
			||||||
    "//third_party/widevine/cdm:headers",
 | 
					    "//third_party/widevine/cdm:headers",
 | 
				
			||||||
    "//third_party/zlib/google:zip",
 | 
					    "//third_party/zlib/google:zip",
 | 
				
			||||||
    "//ui/base/idle",
 | 
					    "//ui/base/idle",
 | 
				
			||||||
 | 
					    "//ui/compositor",
 | 
				
			||||||
    "//ui/events:dom_keycode_converter",
 | 
					    "//ui/events:dom_keycode_converter",
 | 
				
			||||||
    "//ui/gl",
 | 
					    "//ui/gl",
 | 
				
			||||||
    "//ui/native_theme",
 | 
					    "//ui/native_theme",
 | 
				
			||||||
| 
						 | 
					@ -670,32 +672,6 @@ source_set("electron_lib") {
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (enable_osr) {
 | 
					 | 
				
			||||||
    sources += [
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_host_display_client.cc",
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_host_display_client.h",
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_render_widget_host_view.cc",
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_render_widget_host_view.h",
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_video_consumer.cc",
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_video_consumer.h",
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_view_proxy.cc",
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_view_proxy.h",
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_web_contents_view.cc",
 | 
					 | 
				
			||||||
      "shell/browser/osr/osr_web_contents_view.h",
 | 
					 | 
				
			||||||
    ]
 | 
					 | 
				
			||||||
    if (is_mac) {
 | 
					 | 
				
			||||||
      sources += [
 | 
					 | 
				
			||||||
        "shell/browser/osr/osr_host_display_client_mac.mm",
 | 
					 | 
				
			||||||
        "shell/browser/osr/osr_web_contents_view_mac.mm",
 | 
					 | 
				
			||||||
      ]
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    deps += [
 | 
					 | 
				
			||||||
      "//components/viz/service",
 | 
					 | 
				
			||||||
      "//services/viz/public/mojom",
 | 
					 | 
				
			||||||
      "//ui/compositor",
 | 
					 | 
				
			||||||
    ]
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if (enable_views_api) {
 | 
					  if (enable_views_api) {
 | 
				
			||||||
    sources += [
 | 
					    sources += [
 | 
				
			||||||
      "shell/browser/api/views/electron_api_image_view.cc",
 | 
					      "shell/browser/api/views/electron_api_image_view.cc",
 | 
				
			||||||
| 
						 | 
					@ -946,11 +922,7 @@ if (is_mac) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    include_dirs = [ "." ]
 | 
					    include_dirs = [ "." ]
 | 
				
			||||||
    sources = filenames.framework_sources
 | 
					    sources = filenames.framework_sources
 | 
				
			||||||
    frameworks = []
 | 
					    frameworks = [ "IOSurface.framework" ]
 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (enable_osr) {
 | 
					 | 
				
			||||||
      frameworks += [ "IOSurface.framework" ]
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldflags = [
 | 
					    ldflags = [
 | 
				
			||||||
      "-Wl,-install_name,@rpath/$output_name.framework/$output_name",
 | 
					      "-Wl,-install_name,@rpath/$output_name.framework/$output_name",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,6 @@ buildflag_header("buildflags") {
 | 
				
			||||||
  header = "buildflags.h"
 | 
					  header = "buildflags.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  flags = [
 | 
					  flags = [
 | 
				
			||||||
    "ENABLE_OSR=$enable_osr",
 | 
					 | 
				
			||||||
    "ENABLE_VIEWS_API=$enable_views_api",
 | 
					    "ENABLE_VIEWS_API=$enable_views_api",
 | 
				
			||||||
    "ENABLE_PDF_VIEWER=$enable_pdf_viewer",
 | 
					    "ENABLE_PDF_VIEWER=$enable_pdf_viewer",
 | 
				
			||||||
    "ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions",
 | 
					    "ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,8 +3,6 @@
 | 
				
			||||||
# found in the LICENSE file.
 | 
					# found in the LICENSE file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
declare_args() {
 | 
					declare_args() {
 | 
				
			||||||
  enable_osr = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  enable_views_api = true
 | 
					  enable_views_api = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  enable_pdf_viewer = true
 | 
					  enable_pdf_viewer = true
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -147,6 +147,8 @@ filenames = {
 | 
				
			||||||
    "shell/browser/notifications/mac/notification_center_delegate.mm",
 | 
					    "shell/browser/notifications/mac/notification_center_delegate.mm",
 | 
				
			||||||
    "shell/browser/notifications/mac/notification_presenter_mac.h",
 | 
					    "shell/browser/notifications/mac/notification_presenter_mac.h",
 | 
				
			||||||
    "shell/browser/notifications/mac/notification_presenter_mac.mm",
 | 
					    "shell/browser/notifications/mac/notification_presenter_mac.mm",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_host_display_client_mac.mm",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_web_contents_view_mac.mm",
 | 
				
			||||||
    "shell/browser/relauncher_mac.cc",
 | 
					    "shell/browser/relauncher_mac.cc",
 | 
				
			||||||
    "shell/browser/ui/certificate_trust_mac.mm",
 | 
					    "shell/browser/ui/certificate_trust_mac.mm",
 | 
				
			||||||
    "shell/browser/ui/cocoa/delayed_native_view_host.mm",
 | 
					    "shell/browser/ui/cocoa/delayed_native_view_host.mm",
 | 
				
			||||||
| 
						 | 
					@ -451,6 +453,16 @@ filenames = {
 | 
				
			||||||
    "shell/browser/notifications/notification_presenter.h",
 | 
					    "shell/browser/notifications/notification_presenter.h",
 | 
				
			||||||
    "shell/browser/notifications/platform_notification_service.cc",
 | 
					    "shell/browser/notifications/platform_notification_service.cc",
 | 
				
			||||||
    "shell/browser/notifications/platform_notification_service.h",
 | 
					    "shell/browser/notifications/platform_notification_service.h",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_host_display_client.cc",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_host_display_client.h",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_render_widget_host_view.cc",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_render_widget_host_view.h",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_video_consumer.cc",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_video_consumer.h",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_view_proxy.cc",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_view_proxy.h",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_web_contents_view.cc",
 | 
				
			||||||
 | 
					    "shell/browser/osr/osr_web_contents_view.h",
 | 
				
			||||||
    "shell/browser/plugins/plugin_utils.cc",
 | 
					    "shell/browser/plugins/plugin_utils.cc",
 | 
				
			||||||
    "shell/browser/plugins/plugin_utils.h",
 | 
					    "shell/browser/plugins/plugin_utils.h",
 | 
				
			||||||
    "shell/browser/protocol_registry.cc",
 | 
					    "shell/browser/protocol_registry.cc",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -83,7 +83,6 @@ BaseWindow::BaseWindow(v8::Isolate* isolate,
 | 
				
			||||||
  if (options.Get("parent", &parent) && !parent.IsEmpty())
 | 
					  if (options.Get("parent", &parent) && !parent.IsEmpty())
 | 
				
			||||||
    parent_window_.Reset(isolate, parent.ToV8());
 | 
					    parent_window_.Reset(isolate, parent.ToV8());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  // Offscreen windows are always created frameless.
 | 
					  // Offscreen windows are always created frameless.
 | 
				
			||||||
  gin_helper::Dictionary web_preferences;
 | 
					  gin_helper::Dictionary web_preferences;
 | 
				
			||||||
  bool offscreen;
 | 
					  bool offscreen;
 | 
				
			||||||
| 
						 | 
					@ -91,7 +90,6 @@ BaseWindow::BaseWindow(v8::Isolate* isolate,
 | 
				
			||||||
      web_preferences.Get(options::kOffscreen, &offscreen) && offscreen) {
 | 
					      web_preferences.Get(options::kOffscreen, &offscreen) && offscreen) {
 | 
				
			||||||
    const_cast<gin_helper::Dictionary&>(options).Set(options::kFrame, false);
 | 
					    const_cast<gin_helper::Dictionary&>(options).Set(options::kFrame, false);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Creates NativeWindow.
 | 
					  // Creates NativeWindow.
 | 
				
			||||||
  window_.reset(NativeWindow::Create(
 | 
					  window_.reset(NativeWindow::Create(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -91,6 +91,8 @@
 | 
				
			||||||
#include "shell/browser/electron_navigation_throttle.h"
 | 
					#include "shell/browser/electron_navigation_throttle.h"
 | 
				
			||||||
#include "shell/browser/file_select_helper.h"
 | 
					#include "shell/browser/file_select_helper.h"
 | 
				
			||||||
#include "shell/browser/native_window.h"
 | 
					#include "shell/browser/native_window.h"
 | 
				
			||||||
 | 
					#include "shell/browser/osr/osr_render_widget_host_view.h"
 | 
				
			||||||
 | 
					#include "shell/browser/osr/osr_web_contents_view.h"
 | 
				
			||||||
#include "shell/browser/session_preferences.h"
 | 
					#include "shell/browser/session_preferences.h"
 | 
				
			||||||
#include "shell/browser/ui/drag_util.h"
 | 
					#include "shell/browser/ui/drag_util.h"
 | 
				
			||||||
#include "shell/browser/ui/file_dialog.h"
 | 
					#include "shell/browser/ui/file_dialog.h"
 | 
				
			||||||
| 
						 | 
					@ -140,11 +142,6 @@
 | 
				
			||||||
#include "ui/display/screen.h"
 | 
					#include "ui/display/screen.h"
 | 
				
			||||||
#include "ui/events/base_event_utils.h"
 | 
					#include "ui/events/base_event_utils.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
#include "shell/browser/osr/osr_render_widget_host_view.h"
 | 
					 | 
				
			||||||
#include "shell/browser/osr/osr_web_contents_view.h"
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#if BUILDFLAG(IS_WIN)
 | 
					#if BUILDFLAG(IS_WIN)
 | 
				
			||||||
#include "shell/browser/native_window_views.h"
 | 
					#include "shell/browser/native_window_views.h"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					@ -350,10 +347,8 @@ struct Converter<electron::api::WebContents::Type> {
 | 
				
			||||||
      *out = Type::kBrowserView;
 | 
					      *out = Type::kBrowserView;
 | 
				
			||||||
    } else if (type == "webview") {
 | 
					    } else if (type == "webview") {
 | 
				
			||||||
      *out = Type::kWebView;
 | 
					      *out = Type::kWebView;
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
    } else if (type == "offscreen") {
 | 
					    } else if (type == "offscreen") {
 | 
				
			||||||
      *out = Type::kOffScreen;
 | 
					      *out = Type::kOffScreen;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      return false;
 | 
					      return false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -845,11 +840,9 @@ WebContents::WebContents(v8::Isolate* isolate,
 | 
				
			||||||
  // Get type
 | 
					  // Get type
 | 
				
			||||||
  options.Get("type", &type_);
 | 
					  options.Get("type", &type_);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  bool b = false;
 | 
					  bool b = false;
 | 
				
			||||||
  if (options.Get(options::kOffscreen, &b) && b)
 | 
					  if (options.Get(options::kOffscreen, &b) && b)
 | 
				
			||||||
    type_ = Type::kOffScreen;
 | 
					    type_ = Type::kOffScreen;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Init embedder earlier
 | 
					  // Init embedder earlier
 | 
				
			||||||
  options.Get("embedder", &embedder_);
 | 
					  options.Get("embedder", &embedder_);
 | 
				
			||||||
| 
						 | 
					@ -886,7 +879,6 @@ WebContents::WebContents(v8::Isolate* isolate,
 | 
				
			||||||
        std::make_unique<WebViewGuestDelegate>(embedder_->web_contents(), this);
 | 
					        std::make_unique<WebViewGuestDelegate>(embedder_->web_contents(), this);
 | 
				
			||||||
    params.guest_delegate = guest_delegate_.get();
 | 
					    params.guest_delegate = guest_delegate_.get();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
    if (embedder_ && embedder_->IsOffScreen()) {
 | 
					    if (embedder_ && embedder_->IsOffScreen()) {
 | 
				
			||||||
      auto* view = new OffScreenWebContentsView(
 | 
					      auto* view = new OffScreenWebContentsView(
 | 
				
			||||||
          false,
 | 
					          false,
 | 
				
			||||||
| 
						 | 
					@ -897,9 +889,7 @@ WebContents::WebContents(v8::Isolate* isolate,
 | 
				
			||||||
      web_contents = content::WebContents::Create(params);
 | 
					      web_contents = content::WebContents::Create(params);
 | 
				
			||||||
      view->SetWebContents(web_contents.get());
 | 
					      view->SetWebContents(web_contents.get());
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
      web_contents = content::WebContents::Create(params);
 | 
					      web_contents = content::WebContents::Create(params);
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  } else if (IsOffScreen()) {
 | 
					  } else if (IsOffScreen()) {
 | 
				
			||||||
    // webPreferences does not have a transparent option, so if the window needs
 | 
					    // webPreferences does not have a transparent option, so if the window needs
 | 
				
			||||||
| 
						 | 
					@ -918,7 +908,6 @@ WebContents::WebContents(v8::Isolate* isolate,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    web_contents = content::WebContents::Create(params);
 | 
					    web_contents = content::WebContents::Create(params);
 | 
				
			||||||
    view->SetWebContents(web_contents.get());
 | 
					    view->SetWebContents(web_contents.get());
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    content::WebContents::CreateParams params(session->browser_context());
 | 
					    content::WebContents::CreateParams params(session->browser_context());
 | 
				
			||||||
    params.initially_hidden = !initially_shown;
 | 
					    params.initially_hidden = !initially_shown;
 | 
				
			||||||
| 
						 | 
					@ -2304,11 +2293,9 @@ void WebContents::SetOwnerWindow(content::WebContents* web_contents,
 | 
				
			||||||
    owner_window_ = nullptr;
 | 
					    owner_window_ = nullptr;
 | 
				
			||||||
    web_contents->RemoveUserData(NativeWindowRelay::UserDataKey());
 | 
					    web_contents->RemoveUserData(NativeWindowRelay::UserDataKey());
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  auto* osr_wcv = GetOffScreenWebContentsView();
 | 
					  auto* osr_wcv = GetOffScreenWebContentsView();
 | 
				
			||||||
  if (osr_wcv)
 | 
					  if (osr_wcv)
 | 
				
			||||||
    osr_wcv->SetNativeWindow(owner_window);
 | 
					    osr_wcv->SetNativeWindow(owner_window);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
content::WebContents* WebContents::GetWebContents() const {
 | 
					content::WebContents* WebContents::GetWebContents() const {
 | 
				
			||||||
| 
						 | 
					@ -3330,9 +3317,7 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
 | 
				
			||||||
    blink::WebMouseEvent mouse_event;
 | 
					    blink::WebMouseEvent mouse_event;
 | 
				
			||||||
    if (gin::ConvertFromV8(isolate, input_event, &mouse_event)) {
 | 
					    if (gin::ConvertFromV8(isolate, input_event, &mouse_event)) {
 | 
				
			||||||
      if (IsOffScreen()) {
 | 
					      if (IsOffScreen()) {
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
        GetOffScreenRenderWidgetHostView()->SendMouseEvent(mouse_event);
 | 
					        GetOffScreenRenderWidgetHostView()->SendMouseEvent(mouse_event);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        rwh->ForwardMouseEvent(mouse_event);
 | 
					        rwh->ForwardMouseEvent(mouse_event);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					@ -3353,10 +3338,8 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
 | 
				
			||||||
    blink::WebMouseWheelEvent mouse_wheel_event;
 | 
					    blink::WebMouseWheelEvent mouse_wheel_event;
 | 
				
			||||||
    if (gin::ConvertFromV8(isolate, input_event, &mouse_wheel_event)) {
 | 
					    if (gin::ConvertFromV8(isolate, input_event, &mouse_wheel_event)) {
 | 
				
			||||||
      if (IsOffScreen()) {
 | 
					      if (IsOffScreen()) {
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
        GetOffScreenRenderWidgetHostView()->SendMouseWheelEvent(
 | 
					        GetOffScreenRenderWidgetHostView()->SendMouseWheelEvent(
 | 
				
			||||||
            mouse_wheel_event);
 | 
					            mouse_wheel_event);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        // Chromium expects phase info in wheel events (and applies a
 | 
					        // Chromium expects phase info in wheel events (and applies a
 | 
				
			||||||
        // DCHECK to verify it). See: https://crbug.com/756524.
 | 
					        // DCHECK to verify it). See: https://crbug.com/756524.
 | 
				
			||||||
| 
						 | 
					@ -3524,14 +3507,9 @@ void WebContents::AttachToIframe(content::WebContents* embedder_web_contents,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool WebContents::IsOffScreen() const {
 | 
					bool WebContents::IsOffScreen() const {
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  return type_ == Type::kOffScreen;
 | 
					  return type_ == Type::kOffScreen;
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
  return false;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
void WebContents::OnPaint(const gfx::Rect& dirty_rect, const SkBitmap& bitmap) {
 | 
					void WebContents::OnPaint(const gfx::Rect& dirty_rect, const SkBitmap& bitmap) {
 | 
				
			||||||
  Emit("paint", dirty_rect, gfx::Image::CreateFrom1xBitmap(bitmap));
 | 
					  Emit("paint", dirty_rect, gfx::Image::CreateFrom1xBitmap(bitmap));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -3563,15 +3541,12 @@ int WebContents::GetFrameRate() const {
 | 
				
			||||||
  auto* osr_wcv = GetOffScreenWebContentsView();
 | 
					  auto* osr_wcv = GetOffScreenWebContentsView();
 | 
				
			||||||
  return osr_wcv ? osr_wcv->GetFrameRate() : 0;
 | 
					  return osr_wcv ? osr_wcv->GetFrameRate() : 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
void WebContents::Invalidate() {
 | 
					void WebContents::Invalidate() {
 | 
				
			||||||
  if (IsOffScreen()) {
 | 
					  if (IsOffScreen()) {
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
    auto* osr_rwhv = GetOffScreenRenderWidgetHostView();
 | 
					    auto* osr_rwhv = GetOffScreenRenderWidgetHostView();
 | 
				
			||||||
    if (osr_rwhv)
 | 
					    if (osr_rwhv)
 | 
				
			||||||
      osr_rwhv->Invalidate();
 | 
					      osr_rwhv->Invalidate();
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    auto* const window = owner_window();
 | 
					    auto* const window = owner_window();
 | 
				
			||||||
    if (window)
 | 
					    if (window)
 | 
				
			||||||
| 
						 | 
					@ -4301,13 +4276,11 @@ void WebContents::FillObjectTemplate(v8::Isolate* isolate,
 | 
				
			||||||
      .SetMethod("attachToIframe", &WebContents::AttachToIframe)
 | 
					      .SetMethod("attachToIframe", &WebContents::AttachToIframe)
 | 
				
			||||||
      .SetMethod("detachFromOuterFrame", &WebContents::DetachFromOuterFrame)
 | 
					      .SetMethod("detachFromOuterFrame", &WebContents::DetachFromOuterFrame)
 | 
				
			||||||
      .SetMethod("isOffscreen", &WebContents::IsOffScreen)
 | 
					      .SetMethod("isOffscreen", &WebContents::IsOffScreen)
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
      .SetMethod("startPainting", &WebContents::StartPainting)
 | 
					      .SetMethod("startPainting", &WebContents::StartPainting)
 | 
				
			||||||
      .SetMethod("stopPainting", &WebContents::StopPainting)
 | 
					      .SetMethod("stopPainting", &WebContents::StopPainting)
 | 
				
			||||||
      .SetMethod("isPainting", &WebContents::IsPainting)
 | 
					      .SetMethod("isPainting", &WebContents::IsPainting)
 | 
				
			||||||
      .SetMethod("setFrameRate", &WebContents::SetFrameRate)
 | 
					      .SetMethod("setFrameRate", &WebContents::SetFrameRate)
 | 
				
			||||||
      .SetMethod("getFrameRate", &WebContents::GetFrameRate)
 | 
					      .SetMethod("getFrameRate", &WebContents::GetFrameRate)
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
      .SetMethod("invalidate", &WebContents::Invalidate)
 | 
					      .SetMethod("invalidate", &WebContents::Invalidate)
 | 
				
			||||||
      .SetMethod("setZoomLevel", &WebContents::SetZoomLevel)
 | 
					      .SetMethod("setZoomLevel", &WebContents::SetZoomLevel)
 | 
				
			||||||
      .SetMethod("getZoomLevel", &WebContents::GetZoomLevel)
 | 
					      .SetMethod("getZoomLevel", &WebContents::GetZoomLevel)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -91,11 +91,8 @@ class WebViewGuestDelegate;
 | 
				
			||||||
class FrameSubscriber;
 | 
					class FrameSubscriber;
 | 
				
			||||||
class WebDialogHelper;
 | 
					class WebDialogHelper;
 | 
				
			||||||
class NativeWindow;
 | 
					class NativeWindow;
 | 
				
			||||||
 | 
					 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
class OffScreenRenderWidgetHostView;
 | 
					class OffScreenRenderWidgetHostView;
 | 
				
			||||||
class OffScreenWebContentsView;
 | 
					class OffScreenWebContentsView;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace api {
 | 
					namespace api {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -285,14 +282,12 @@ class WebContents : public ExclusiveAccessContext,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Methods for offscreen rendering
 | 
					  // Methods for offscreen rendering
 | 
				
			||||||
  bool IsOffScreen() const;
 | 
					  bool IsOffScreen() const;
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  void OnPaint(const gfx::Rect& dirty_rect, const SkBitmap& bitmap);
 | 
					  void OnPaint(const gfx::Rect& dirty_rect, const SkBitmap& bitmap);
 | 
				
			||||||
  void StartPainting();
 | 
					  void StartPainting();
 | 
				
			||||||
  void StopPainting();
 | 
					  void StopPainting();
 | 
				
			||||||
  bool IsPainting() const;
 | 
					  bool IsPainting() const;
 | 
				
			||||||
  void SetFrameRate(int frame_rate);
 | 
					  void SetFrameRate(int frame_rate);
 | 
				
			||||||
  int GetFrameRate() const;
 | 
					  int GetFrameRate() const;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
  void Invalidate();
 | 
					  void Invalidate();
 | 
				
			||||||
  gfx::Size GetSizeForNewRenderView(content::WebContents*) override;
 | 
					  gfx::Size GetSizeForNewRenderView(content::WebContents*) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -653,10 +648,8 @@ class WebContents : public ExclusiveAccessContext,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  void OnElectronBrowserConnectionError();
 | 
					  void OnElectronBrowserConnectionError();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  OffScreenWebContentsView* GetOffScreenWebContentsView() const;
 | 
					  OffScreenWebContentsView* GetOffScreenWebContentsView() const;
 | 
				
			||||||
  OffScreenRenderWidgetHostView* GetOffScreenRenderWidgetHostView() const;
 | 
					  OffScreenRenderWidgetHostView* GetOffScreenRenderWidgetHostView() const;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Called when received a synchronous message from renderer to
 | 
					  // Called when received a synchronous message from renderer to
 | 
				
			||||||
  // get the zoom level.
 | 
					  // get the zoom level.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,11 +7,8 @@
 | 
				
			||||||
#include "content/browser/renderer_host/frame_tree.h"        // nogncheck
 | 
					#include "content/browser/renderer_host/frame_tree.h"        // nogncheck
 | 
				
			||||||
#include "content/browser/renderer_host/frame_tree_node.h"   // nogncheck
 | 
					#include "content/browser/renderer_host/frame_tree_node.h"   // nogncheck
 | 
				
			||||||
#include "content/browser/web_contents/web_contents_impl.h"  // nogncheck
 | 
					#include "content/browser/web_contents/web_contents_impl.h"  // nogncheck
 | 
				
			||||||
 | 
					 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
#include "shell/browser/osr/osr_render_widget_host_view.h"
 | 
					#include "shell/browser/osr/osr_render_widget_host_view.h"
 | 
				
			||||||
#include "shell/browser/osr/osr_web_contents_view.h"
 | 
					#include "shell/browser/osr/osr_web_contents_view.h"
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Including both web_contents_impl.h and node.h would introduce a error, we
 | 
					// Including both web_contents_impl.h and node.h would introduce a error, we
 | 
				
			||||||
// have to isolate the usage of WebContentsImpl into a clean file to fix it:
 | 
					// have to isolate the usage of WebContentsImpl into a clean file to fix it:
 | 
				
			||||||
| 
						 | 
					@ -31,7 +28,6 @@ void WebContents::DetachFromOuterFrame() {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
OffScreenWebContentsView* WebContents::GetOffScreenWebContentsView() const {
 | 
					OffScreenWebContentsView* WebContents::GetOffScreenWebContentsView() const {
 | 
				
			||||||
  if (IsOffScreen()) {
 | 
					  if (IsOffScreen()) {
 | 
				
			||||||
    const auto* impl =
 | 
					    const auto* impl =
 | 
				
			||||||
| 
						 | 
					@ -51,6 +47,5 @@ OffScreenRenderWidgetHostView* WebContents::GetOffScreenRenderWidgetHostView()
 | 
				
			||||||
    return nullptr;
 | 
					    return nullptr;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
}  // namespace electron::api
 | 
					}  // namespace electron::api
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,6 +12,8 @@
 | 
				
			||||||
#include "electron/buildflags/buildflags.h"
 | 
					#include "electron/buildflags/buildflags.h"
 | 
				
			||||||
#include "mojo/public/cpp/bindings/associated_remote.h"
 | 
					#include "mojo/public/cpp/bindings/associated_remote.h"
 | 
				
			||||||
#include "shell/browser/native_window_views.h"
 | 
					#include "shell/browser/native_window_views.h"
 | 
				
			||||||
 | 
					#include "shell/browser/osr/osr_render_widget_host_view.h"
 | 
				
			||||||
 | 
					#include "shell/browser/osr/osr_view_proxy.h"
 | 
				
			||||||
#include "shell/browser/ui/autofill_popup.h"
 | 
					#include "shell/browser/ui/autofill_popup.h"
 | 
				
			||||||
#include "shell/common/api/api.mojom.h"
 | 
					#include "shell/common/api/api.mojom.h"
 | 
				
			||||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
 | 
					#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
 | 
				
			||||||
| 
						 | 
					@ -25,11 +27,6 @@
 | 
				
			||||||
#include "ui/gfx/geometry/vector2d.h"
 | 
					#include "ui/gfx/geometry/vector2d.h"
 | 
				
			||||||
#include "ui/gfx/text_utils.h"
 | 
					#include "ui/gfx/text_utils.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
#include "shell/browser/osr/osr_render_widget_host_view.h"
 | 
					 | 
				
			||||||
#include "shell/browser/osr/osr_view_proxy.h"
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace electron {
 | 
					namespace electron {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace {
 | 
					namespace {
 | 
				
			||||||
| 
						 | 
					@ -194,7 +191,6 @@ void AutofillPopup::CreateView(content::RenderFrameHost* frame_host,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  view_ = new AutofillPopupView(this, parent->GetWidget());
 | 
					  view_ = new AutofillPopupView(this, parent->GetWidget());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  if (offscreen) {
 | 
					  if (offscreen) {
 | 
				
			||||||
    auto* rwhv = frame_host->GetView();
 | 
					    auto* rwhv = frame_host->GetView();
 | 
				
			||||||
    if (embedder_frame_host != nullptr) {
 | 
					    if (embedder_frame_host != nullptr) {
 | 
				
			||||||
| 
						 | 
					@ -205,7 +201,6 @@ void AutofillPopup::CreateView(content::RenderFrameHost* frame_host,
 | 
				
			||||||
    view_->view_proxy_ = std::make_unique<OffscreenViewProxy>(view_);
 | 
					    view_->view_proxy_ = std::make_unique<OffscreenViewProxy>(view_);
 | 
				
			||||||
    osr_rwhv->AddViewProxy(view_->view_proxy_.get());
 | 
					    osr_rwhv->AddViewProxy(view_->view_proxy_.get());
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Do this after OSR setup, we check for view_proxy_ when showing
 | 
					  // Do this after OSR setup, we check for view_proxy_ when showing
 | 
				
			||||||
  view_->Show();
 | 
					  view_->Show();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,11 +48,9 @@ AutofillPopupView::~AutofillPopupView() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  RemoveObserver();
 | 
					  RemoveObserver();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  if (view_proxy_.get()) {
 | 
					  if (view_proxy_.get()) {
 | 
				
			||||||
    view_proxy_->ResetView();
 | 
					    view_proxy_->ResetView();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (GetWidget()) {
 | 
					  if (GetWidget()) {
 | 
				
			||||||
    GetWidget()->Close();
 | 
					    GetWidget()->Close();
 | 
				
			||||||
| 
						 | 
					@ -61,9 +59,7 @@ AutofillPopupView::~AutofillPopupView() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AutofillPopupView::Show() {
 | 
					void AutofillPopupView::Show() {
 | 
				
			||||||
  bool visible = parent_widget_->IsVisible();
 | 
					  bool visible = parent_widget_->IsVisible();
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  visible = visible || view_proxy_;
 | 
					  visible = visible || view_proxy_;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
  if (!popup_ || !visible || parent_widget_->IsClosed())
 | 
					  if (!popup_ || !visible || parent_widget_->IsClosed())
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -228,11 +224,9 @@ void AutofillPopupView::DoUpdateBoundsAndRedrawPopup() {
 | 
				
			||||||
  popup_->popup_bounds_.Union(
 | 
					  popup_->popup_bounds_.Union(
 | 
				
			||||||
      gfx::Rect(popup_->popup_bounds_.origin(), gfx::Size(1, 1)));
 | 
					      gfx::Rect(popup_->popup_bounds_.origin(), gfx::Size(1, 1)));
 | 
				
			||||||
  GetWidget()->SetBounds(popup_->popup_bounds_);
 | 
					  GetWidget()->SetBounds(popup_->popup_bounds_);
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  if (view_proxy_.get()) {
 | 
					  if (view_proxy_.get()) {
 | 
				
			||||||
    view_proxy_->SetBounds(popup_->popup_bounds_in_view());
 | 
					    view_proxy_->SetBounds(popup_->popup_bounds_in_view());
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
  SchedulePaint();
 | 
					  SchedulePaint();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -243,7 +237,6 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
 | 
				
			||||||
  gfx::Canvas* draw_canvas = canvas;
 | 
					  gfx::Canvas* draw_canvas = canvas;
 | 
				
			||||||
  SkBitmap bitmap;
 | 
					  SkBitmap bitmap;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  std::unique_ptr<cc::SkiaPaintCanvas> paint_canvas;
 | 
					  std::unique_ptr<cc::SkiaPaintCanvas> paint_canvas;
 | 
				
			||||||
  if (view_proxy_.get()) {
 | 
					  if (view_proxy_.get()) {
 | 
				
			||||||
    bitmap.allocN32Pixels(popup_->popup_bounds_in_view().width(),
 | 
					    bitmap.allocN32Pixels(popup_->popup_bounds_in_view().width(),
 | 
				
			||||||
| 
						 | 
					@ -251,7 +244,6 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
 | 
				
			||||||
    paint_canvas = std::make_unique<cc::SkiaPaintCanvas>(bitmap);
 | 
					    paint_canvas = std::make_unique<cc::SkiaPaintCanvas>(bitmap);
 | 
				
			||||||
    draw_canvas = new gfx::Canvas(paint_canvas.get(), 1.0);
 | 
					    draw_canvas = new gfx::Canvas(paint_canvas.get(), 1.0);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  draw_canvas->DrawColor(
 | 
					  draw_canvas->DrawColor(
 | 
				
			||||||
      GetColorProvider()->GetColor(ui::kColorResultsTableNormalBackground));
 | 
					      GetColorProvider()->GetColor(ui::kColorResultsTableNormalBackground));
 | 
				
			||||||
| 
						 | 
					@ -263,12 +255,10 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
 | 
				
			||||||
    DrawAutofillEntry(draw_canvas, i, line_rect);
 | 
					    DrawAutofillEntry(draw_canvas, i, line_rect);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  if (view_proxy_.get()) {
 | 
					  if (view_proxy_.get()) {
 | 
				
			||||||
    view_proxy_->SetBounds(popup_->popup_bounds_in_view());
 | 
					    view_proxy_->SetBounds(popup_->popup_bounds_in_view());
 | 
				
			||||||
    view_proxy_->SetBitmap(bitmap);
 | 
					    view_proxy_->SetBitmap(bitmap);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AutofillPopupView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
 | 
					void AutofillPopupView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,6 +13,7 @@
 | 
				
			||||||
#include "content/public/browser/native_web_keyboard_event.h"
 | 
					#include "content/public/browser/native_web_keyboard_event.h"
 | 
				
			||||||
#include "content/public/browser/render_widget_host.h"
 | 
					#include "content/public/browser/render_widget_host.h"
 | 
				
			||||||
#include "electron/buildflags/buildflags.h"
 | 
					#include "electron/buildflags/buildflags.h"
 | 
				
			||||||
 | 
					#include "shell/browser/osr/osr_view_proxy.h"
 | 
				
			||||||
#include "third_party/abseil-cpp/absl/types/optional.h"
 | 
					#include "third_party/abseil-cpp/absl/types/optional.h"
 | 
				
			||||||
#include "ui/accessibility/ax_node_data.h"
 | 
					#include "ui/accessibility/ax_node_data.h"
 | 
				
			||||||
#include "ui/views/drag_controller.h"
 | 
					#include "ui/views/drag_controller.h"
 | 
				
			||||||
| 
						 | 
					@ -20,10 +21,6 @@
 | 
				
			||||||
#include "ui/views/widget/widget_delegate.h"
 | 
					#include "ui/views/widget/widget_delegate.h"
 | 
				
			||||||
#include "ui/views/widget/widget_observer.h"
 | 
					#include "ui/views/widget/widget_observer.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
#include "shell/browser/osr/osr_view_proxy.h"
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace electron {
 | 
					namespace electron {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const int kPopupBorderThickness = 1;
 | 
					const int kPopupBorderThickness = 1;
 | 
				
			||||||
| 
						 | 
					@ -142,9 +139,7 @@ class AutofillPopupView : public views::WidgetDelegateView,
 | 
				
			||||||
  // The index of the currently selected line
 | 
					  // The index of the currently selected line
 | 
				
			||||||
  absl::optional<int> selected_line_;
 | 
					  absl::optional<int> selected_line_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(ENABLE_OSR)
 | 
					 | 
				
			||||||
  std::unique_ptr<OffscreenViewProxy> view_proxy_;
 | 
					  std::unique_ptr<OffscreenViewProxy> view_proxy_;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // The registered keypress callback, responsible for switching lines on
 | 
					  // The registered keypress callback, responsible for switching lines on
 | 
				
			||||||
  // key presses
 | 
					  // key presses
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,10 +13,6 @@ bool IsBuiltinSpellCheckerEnabled() {
 | 
				
			||||||
  return BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER);
 | 
					  return BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool IsOffscreenRenderingEnabled() {
 | 
					 | 
				
			||||||
  return BUILDFLAG(ENABLE_OSR);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
bool IsPDFViewerEnabled() {
 | 
					bool IsPDFViewerEnabled() {
 | 
				
			||||||
  return BUILDFLAG(ENABLE_PDF_VIEWER);
 | 
					  return BUILDFLAG(ENABLE_PDF_VIEWER);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -51,7 +47,6 @@ void Initialize(v8::Local<v8::Object> exports,
 | 
				
			||||||
                void* priv) {
 | 
					                void* priv) {
 | 
				
			||||||
  gin_helper::Dictionary dict(context->GetIsolate(), exports);
 | 
					  gin_helper::Dictionary dict(context->GetIsolate(), exports);
 | 
				
			||||||
  dict.SetMethod("isBuiltinSpellCheckerEnabled", &IsBuiltinSpellCheckerEnabled);
 | 
					  dict.SetMethod("isBuiltinSpellCheckerEnabled", &IsBuiltinSpellCheckerEnabled);
 | 
				
			||||||
  dict.SetMethod("isOffscreenRenderingEnabled", &IsOffscreenRenderingEnabled);
 | 
					 | 
				
			||||||
  dict.SetMethod("isPDFViewerEnabled", &IsPDFViewerEnabled);
 | 
					  dict.SetMethod("isPDFViewerEnabled", &IsPDFViewerEnabled);
 | 
				
			||||||
  dict.SetMethod("isFakeLocationProviderEnabled",
 | 
					  dict.SetMethod("isFakeLocationProviderEnabled",
 | 
				
			||||||
                 &IsFakeLocationProviderEnabled);
 | 
					                 &IsFakeLocationProviderEnabled);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,7 +15,6 @@ import { areColorsSimilar, captureScreen, HexColors, getPixelColor } from './lib
 | 
				
			||||||
import { once } from 'events';
 | 
					import { once } from 'events';
 | 
				
			||||||
import { setTimeout } from 'timers/promises';
 | 
					import { setTimeout } from 'timers/promises';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const features = process._linkedBinding('electron_common_features');
 | 
					 | 
				
			||||||
const fixtures = path.resolve(__dirname, 'fixtures');
 | 
					const fixtures = path.resolve(__dirname, 'fixtures');
 | 
				
			||||||
const mainFixtures = path.resolve(__dirname, 'fixtures');
 | 
					const mainFixtures = path.resolve(__dirname, 'fixtures');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6071,7 +6070,7 @@ describe('BrowserWindow module', () => {
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ifdescribe(features.isOffscreenRenderingEnabled())('offscreen rendering', () => {
 | 
					  describe('offscreen rendering', () => {
 | 
				
			||||||
    let w: BrowserWindow;
 | 
					    let w: BrowserWindow;
 | 
				
			||||||
    beforeEach(function () {
 | 
					    beforeEach(function () {
 | 
				
			||||||
      w = new BrowserWindow({
 | 
					      w = new BrowserWindow({
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								typings/internal-ambient.d.ts
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								typings/internal-ambient.d.ts
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -5,7 +5,6 @@ declare const ENABLE_VIEWS_API: boolean;
 | 
				
			||||||
declare namespace NodeJS {
 | 
					declare namespace NodeJS {
 | 
				
			||||||
  interface FeaturesBinding {
 | 
					  interface FeaturesBinding {
 | 
				
			||||||
    isBuiltinSpellCheckerEnabled(): boolean;
 | 
					    isBuiltinSpellCheckerEnabled(): boolean;
 | 
				
			||||||
    isOffscreenRenderingEnabled(): boolean;
 | 
					 | 
				
			||||||
    isPDFViewerEnabled(): boolean;
 | 
					    isPDFViewerEnabled(): boolean;
 | 
				
			||||||
    isFakeLocationProviderEnabled(): boolean;
 | 
					    isFakeLocationProviderEnabled(): boolean;
 | 
				
			||||||
    isViewApiEnabled(): boolean;
 | 
					    isViewApiEnabled(): boolean;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue