2018-10-24 11:24:11 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-13 16:39:26 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								From: deepak1556 <hop2deep@gmail.com>
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-27 14:27:34 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Date: Sat, 24 Apr 2021 18:07:09 -0700
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-20 17:30:26 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Subject: web_contents.patch
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-13 09:18:45 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								This allows overriding the RenderViewHostDelegateView of a WebContents, which
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								is needed for OSR.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-20 17:30:26 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-22 15:36:22 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								index c1b1bfc8333e93456178842db392eabff96bf4c9..1eee3bf88b5566b07cdb4f33fc03bf3d904ec6b9 100644
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								--- a/content/browser/web_contents/web_contents_impl.cc
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+++ b/content/browser/web_contents/web_contents_impl.cc
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-12 13:19:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								@@ -3057,6 +3057,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
							 | 
						
					
						
							
								
									
										
										
										
											2022-02-09 18:58:52 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								       site_instance.get(), params.renderer_initiated_creation,
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-12 13:19:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								       params.main_frame_name, GetOpener(), primary_main_frame_policy);
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+  if (params.view && params.delegate_view) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+    view_.reset(params.view);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+    render_view_host_delegate_view_ = params.delegate_view;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+  }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+  if (!view_) {
							 | 
						
					
						
							
								
									
										
										
										
											2022-01-10 17:31:39 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								+
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   WebContentsViewDelegate* delegate =
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								       GetContentClient()->browser()->GetWebContentsViewDelegate(this);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-12 13:19:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								@@ -3067,6 +3074,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-10 16:22:35 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     view_.reset(CreateWebContentsView(this, delegate,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                       &render_view_host_delegate_view_));
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   }
							 | 
						
					
						
							
								
									
										
										
										
											2021-02-09 12:16:21 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								+  }  // !view_
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   CHECK(render_view_host_delegate_view_);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   CHECK(view_.get());
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-12 13:19:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								index c062c66f596f513e46da04fc9ea5f5969e7ee632..2f14f906b51ce73a69cd780d70ad6264285138ac 100644
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								--- a/content/public/browser/web_contents.h
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+++ b/content/public/browser/web_contents.h
							 | 
						
					
						
							
								
									
										
										
										
											2022-01-10 17:31:39 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								@@ -93,10 +93,13 @@ class BrowserContext;
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-26 13:06:26 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 class BrowserPluginGuestDelegate;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 class RenderFrameHost;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 class RenderViewHost;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+class RenderViewHostDelegateView;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 class RenderWidgetHostView;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+class RenderWidgetHostViewBase;
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-19 16:15:47 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 class ScreenOrientationDelegate;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 class SiteInstance;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 class WebContentsDelegate;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+class WebContentsView;
							 | 
						
					
						
							
								
									
										
										
										
											2020-03-03 13:35:05 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 class WebUI;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 struct DropData;
							 | 
						
					
						
							
								
									
										
										
										
											2021-02-09 12:16:21 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 struct MHTMLGenerationParams;
							 | 
						
					
						
							
								
									
										
										
										
											2022-01-10 17:31:39 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								@@ -234,6 +237,10 @@ class WebContents : public PageNavigator,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     network::mojom::WebSandboxFlags starting_sandbox_flags =
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								         network::mojom::WebSandboxFlags::kNone;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-13 22:02:16 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+    // Optionally specify the view and delegate view.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+    content::WebContentsView* view = nullptr;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+    content::RenderViewHostDelegateView* delegate_view = nullptr;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								+
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-13 16:39:26 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     // Value used to set the last time the WebContents was made active, this is
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     // the value that'll be returned by GetLastActiveTime(). If this is left
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     // default initialized then the value is not passed on to the WebContents
							 |