2019-04-24 04:50:25 +02:00
|
|
|
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
|
2024-07-29 19:09:20 +02:00
|
|
|
index 11c9cd82d0392..9c700bc625cd5 100644
|
2019-04-24 04:50:25 +02:00
|
|
|
--- content/browser/devtools/devtools_http_handler.cc
|
|
|
|
+++ content/browser/devtools/devtools_http_handler.cc
|
2024-07-29 19:09:20 +02:00
|
|
|
@@ -598,7 +598,7 @@ void DevToolsHttpHandler::OnJsonRequest(
|
2023-01-03 00:34:43 +01:00
|
|
|
base::Value::Dict version;
|
|
|
|
version.Set("Protocol-Version", DevToolsAgentHost::GetProtocolVersion());
|
|
|
|
version.Set("WebKit-Version", GetWebKitVersion());
|
|
|
|
- version.Set("Browser", GetContentClient()->browser()->GetProduct());
|
|
|
|
+ version.Set("Browser", GetContentClient()->browser()->GetChromeProduct());
|
|
|
|
version.Set("User-Agent", GetContentClient()->browser()->GetUserAgent());
|
|
|
|
version.Set("V8-Version", V8_VERSION_STRING);
|
|
|
|
std::string host = info.GetHeaderValue("host");
|
2019-03-24 01:39:54 +01:00
|
|
|
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
|
2024-10-24 17:53:43 +02:00
|
|
|
index ebfa887660e23..6a8958000fb64 100644
|
2019-03-24 01:39:54 +01:00
|
|
|
--- content/browser/loader/navigation_url_loader_impl.cc
|
|
|
|
+++ content/browser/loader/navigation_url_loader_impl.cc
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -863,7 +863,7 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory(
|
2024-03-19 22:11:42 +01:00
|
|
|
mojo::PendingRemote<network::mojom::URLLoaderFactory>
|
|
|
|
terminal_external_protocol;
|
|
|
|
bool handled = GetContentClient()->browser()->HandleExternalProtocol(
|
|
|
|
- resource_request.url, std::move(web_contents_getter),
|
|
|
|
+ resource_request.url, web_contents_getter,
|
|
|
|
frame_tree_node->frame_tree_node_id(), navigation_ui_data,
|
|
|
|
request_info.is_primary_main_frame,
|
|
|
|
frame_tree_node->IsInFencedFrameTree(), request_info.sandbox_flags,
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -875,6 +875,21 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory(
|
2024-03-19 22:11:42 +01:00
|
|
|
*request_info.initiator_document_token)
|
|
|
|
: nullptr,
|
2024-10-24 17:05:31 +02:00
|
|
|
request_info.isolation_info, &terminal_external_protocol);
|
2019-09-04 17:13:32 +02:00
|
|
|
+
|
2024-03-19 22:11:42 +01:00
|
|
|
+ if (!handled) {
|
|
|
|
+ handled = GetContentClient()->browser()->HandleExternalProtocol(
|
|
|
|
+ web_contents_getter, frame_tree_node->frame_tree_node_id(),
|
|
|
|
+ navigation_ui_data, request_info.is_primary_main_frame,
|
|
|
|
+ frame_tree_node->IsInFencedFrameTree(), request_info.sandbox_flags,
|
|
|
|
+ resource_request, initiating_origin,
|
|
|
|
+ request_info.initiator_document_token
|
|
|
|
+ ? RenderFrameHostImpl::FromDocumentToken(
|
|
|
|
+ request_info.initiator_process_id,
|
|
|
|
+ *request_info.initiator_document_token)
|
|
|
|
+ : nullptr,
|
2024-10-24 17:05:31 +02:00
|
|
|
+ request_info.isolation_info, &terminal_external_protocol);
|
2024-03-19 22:11:42 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (terminal_external_protocol) {
|
|
|
|
return std::make_pair(
|
|
|
|
/*is_cacheable=*/false,
|
2020-03-30 22:13:42 +02:00
|
|
|
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
|
2024-10-24 17:53:43 +02:00
|
|
|
index 21967547790ca..7bdf48b830a21 100644
|
2020-03-30 22:13:42 +02:00
|
|
|
--- content/public/browser/content_browser_client.cc
|
|
|
|
+++ content/public/browser/content_browser_client.cc
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -1138,7 +1138,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
|
2021-10-19 00:17:16 +02:00
|
|
|
void ContentBrowserClient::OnNetworkServiceCreated(
|
|
|
|
network::mojom::NetworkService* network_service) {}
|
|
|
|
|
|
|
|
-void ContentBrowserClient::ConfigureNetworkContextParams(
|
|
|
|
+bool ContentBrowserClient::ConfigureNetworkContextParams(
|
|
|
|
BrowserContext* context,
|
|
|
|
bool in_memory,
|
|
|
|
const base::FilePath& relative_partition_path,
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -1147,6 +1147,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams(
|
2021-10-19 00:17:16 +02:00
|
|
|
cert_verifier_creation_params) {
|
2021-12-16 23:35:54 +01:00
|
|
|
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
|
2021-10-19 00:17:16 +02:00
|
|
|
network_context_params->accept_language = "en-us,en";
|
|
|
|
+ return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<base::FilePath>
|
2019-04-24 04:50:25 +02:00
|
|
|
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
|
2024-11-09 01:05:04 +01:00
|
|
|
index 0f6781dc459e1..3f3095cce2ba6 100644
|
2019-04-24 04:50:25 +02:00
|
|
|
--- content/public/browser/content_browser_client.h
|
|
|
|
+++ content/public/browser/content_browser_client.h
|
2024-11-09 01:05:04 +01:00
|
|
|
@@ -1329,6 +1329,12 @@ class CONTENT_EXPORT ContentBrowserClient {
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access);
|
|
|
|
|
|
|
|
+ // Called to report the result of new window creation after CanCreateWindow()
|
|
|
|
+ // returns true. There are cases where the new window may still be canceled.
|
|
|
|
+ virtual void CreateWindowResult(
|
|
|
|
+ RenderFrameHost* opener,
|
|
|
|
+ bool success) {}
|
|
|
|
+
|
|
|
|
// Allows the embedder to return a delegate for the SpeechRecognitionManager.
|
|
|
|
// The delegate will be owned by the manager. It's valid to return nullptr.
|
|
|
|
virtual SpeechRecognitionManagerDelegate*
|
|
|
|
@@ -2188,7 +2194,7 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2021-10-19 00:17:16 +02:00
|
|
|
//
|
|
|
|
// If |relative_partition_path| is the empty string, it means this needs to
|
|
|
|
// create the default NetworkContext for the BrowserContext.
|
|
|
|
- virtual void ConfigureNetworkContextParams(
|
|
|
|
+ virtual bool ConfigureNetworkContextParams(
|
|
|
|
BrowserContext* context,
|
|
|
|
bool in_memory,
|
|
|
|
const base::FilePath& relative_partition_path,
|
2024-11-09 01:05:04 +01:00
|
|
|
@@ -2412,6 +2418,22 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2024-10-24 17:05:31 +02:00
|
|
|
const net::IsolationInfo& isolation_info,
|
2020-02-10 18:10:17 +01:00
|
|
|
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
+ // Same as above, but exposing the whole ResourceRequest object.
|
|
|
|
+ virtual bool HandleExternalProtocol(
|
2024-03-19 22:11:42 +01:00
|
|
|
+ base::RepeatingCallback<WebContents*()> web_contents_getter,
|
2024-09-27 16:15:44 +02:00
|
|
|
+ FrameTreeNodeId frame_tree_node_id,
|
2019-04-24 04:50:25 +02:00
|
|
|
+ NavigationUIData* navigation_data,
|
2022-03-26 02:12:30 +01:00
|
|
|
+ bool is_primary_main_frame,
|
|
|
|
+ bool is_in_fenced_frame_tree,
|
2021-10-19 00:17:16 +02:00
|
|
|
+ network::mojom::WebSandboxFlags sandbox_flags,
|
2019-04-24 04:50:25 +02:00
|
|
|
+ const network::ResourceRequest& request,
|
2024-03-19 22:11:42 +01:00
|
|
|
+ const std::optional<url::Origin>& initiating_origin,
|
2022-01-25 21:26:51 +01:00
|
|
|
+ RenderFrameHost* initiator_document,
|
2024-10-24 17:05:31 +02:00
|
|
|
+ const net::IsolationInfo& isolation_info,
|
2024-03-19 22:11:42 +01:00
|
|
|
+ mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
2019-04-24 04:50:25 +02:00
|
|
|
+
|
2022-11-15 18:50:53 +01:00
|
|
|
// Creates an OverlayWindow to be used for video or Picture-in-Picture.
|
|
|
|
// This window will house the content shown when in Picture-in-Picture mode.
|
|
|
|
// This will return a new OverlayWindow.
|
2024-11-09 01:05:04 +01:00
|
|
|
@@ -2472,6 +2494,10 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2019-04-24 04:50:25 +02:00
|
|
|
// Used as part of the user agent string.
|
2019-09-04 17:13:32 +02:00
|
|
|
virtual std::string GetProduct();
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
+ // Returns the Chrome-specific product string. This is used for compatibility
|
|
|
|
+ // purposes with external tools like Selenium.
|
2019-09-04 17:13:32 +02:00
|
|
|
+ virtual std::string GetChromeProduct() { return GetProduct(); }
|
2019-04-24 04:50:25 +02:00
|
|
|
+
|
2021-12-16 23:35:54 +01:00
|
|
|
// Returns the user agent. This can also return the reduced user agent, based
|
|
|
|
// on blink::features::kUserAgentReduction. Content may cache this value.
|
2019-09-04 17:13:32 +02:00
|
|
|
virtual std::string GetUserAgent();
|
2017-04-20 21:28:17 +02:00
|
|
|
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
|
2024-08-26 14:44:25 +02:00
|
|
|
index 784e0a5166d6b..1fd1e9ee107f3 100644
|
2017-04-20 21:28:17 +02:00
|
|
|
--- content/public/renderer/content_renderer_client.h
|
|
|
|
+++ content/public/renderer/content_renderer_client.h
|
2024-08-26 14:44:25 +02:00
|
|
|
@@ -109,6 +109,9 @@ class CONTENT_EXPORT ContentRendererClient {
|
2024-04-23 22:06:00 +02:00
|
|
|
// a crash handler (such as crashpad) is already in use.
|
|
|
|
virtual void SetUpWebAssemblyTrapHandler();
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
+ // Notifies that the RenderThread can now send sync IPC messages.
|
|
|
|
+ virtual void RenderThreadConnected() {}
|
|
|
|
+
|
|
|
|
// Notifies that a new RenderFrame has been created.
|
|
|
|
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
|
|
|
|
|
2024-08-26 14:44:25 +02:00
|
|
|
@@ -355,6 +358,10 @@ class CONTENT_EXPORT ContentRendererClient {
|
2017-12-07 22:44:24 +01:00
|
|
|
// This method may invalidate the frame.
|
|
|
|
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
|
|
|
|
|
|
|
|
+ // Notifies that a DevTools agent has attached or detached.
|
2018-02-15 01:12:09 +01:00
|
|
|
+ virtual void DevToolsAgentAttached() {}
|
|
|
|
+ virtual void DevToolsAgentDetached() {}
|
2017-12-07 22:44:24 +01:00
|
|
|
+
|
|
|
|
// Allows subclasses to enable some runtime features before Blink has
|
|
|
|
// started.
|
|
|
|
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
|
2017-05-31 17:33:30 +02:00
|
|
|
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
|
2024-10-24 17:53:43 +02:00
|
|
|
index 15e28effa2cbf..eb25a1adb7f6c 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/renderer/render_thread_impl.cc
|
|
|
|
+++ content/renderer/render_thread_impl.cc
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -568,6 +568,8 @@ void RenderThreadImpl::Init() {
|
2020-02-10 18:10:17 +01:00
|
|
|
GetContentClient()->renderer()->CreateURLLoaderThrottleProvider(
|
2021-04-21 00:52:34 +02:00
|
|
|
blink::URLLoaderThrottleProviderType::kFrame);
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
+ GetContentClient()->renderer()->RenderThreadConnected();
|
|
|
|
+
|
2022-08-23 03:37:40 +02:00
|
|
|
GetAssociatedInterfaceRegistry()->AddInterface<mojom::Renderer>(
|
|
|
|
base::BindRepeating(&RenderThreadImpl::OnRendererInterfaceReceiver,
|
|
|
|
base::Unretained(this)));
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
|
2024-09-27 16:15:44 +02:00
|
|
|
index da2515e0067a9..e792751f278b4 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/renderer_blink_platform_impl.cc
|
|
|
|
+++ content/renderer/renderer_blink_platform_impl.cc
|
2024-09-27 16:15:44 +02:00
|
|
|
@@ -1037,6 +1037,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
|
2019-03-13 22:27:37 +01:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2018-02-15 01:12:09 +01:00
|
|
|
|
|
|
|
+void RendererBlinkPlatformImpl::DevToolsAgentAttached() {
|
|
|
|
+ GetContentClient()->renderer()->DevToolsAgentAttached();
|
|
|
|
+}
|
|
|
|
+void RendererBlinkPlatformImpl::DevToolsAgentDetached() {
|
|
|
|
+ GetContentClient()->renderer()->DevToolsAgentDetached();
|
|
|
|
+}
|
|
|
|
+
|
2019-09-04 17:13:32 +02:00
|
|
|
+//------------------------------------------------------------------------------
|
|
|
|
+
|
2022-06-17 15:28:55 +02:00
|
|
|
std::unique_ptr<blink::WebV8ValueConverter>
|
|
|
|
RendererBlinkPlatformImpl::CreateWebV8ValueConverter() {
|
|
|
|
return std::make_unique<V8ValueConverterImpl>();
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
|
2024-09-27 16:15:44 +02:00
|
|
|
index 69c52cb8333fc..ac2bbc7459864 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/renderer_blink_platform_impl.h
|
|
|
|
+++ content/renderer/renderer_blink_platform_impl.h
|
2024-09-27 16:15:44 +02:00
|
|
|
@@ -245,6 +245,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
2023-05-30 10:55:32 +02:00
|
|
|
InertAndMinimumIntervalOfUserLevelMemoryPressureSignal() override;
|
|
|
|
#endif // BUILDFLAG(IS_ANDROID)
|
2018-02-15 01:12:09 +01:00
|
|
|
|
|
|
|
+ void DevToolsAgentAttached() override;
|
|
|
|
+ void DevToolsAgentDetached() override;
|
|
|
|
+
|
2020-08-29 00:39:23 +02:00
|
|
|
// Tells this platform that the renderer is locked to a site (i.e., a scheme
|
|
|
|
// plus eTLD+1, such as https://google.com), or to a more specific origin.
|
|
|
|
void SetIsLockedToSite();
|
2023-07-25 18:57:30 +02:00
|
|
|
diff --git content/shell/browser/shell_content_browser_client.cc content/shell/browser/shell_content_browser_client.cc
|
2024-10-24 17:53:43 +02:00
|
|
|
index 6c08727a74408..2efb3de40164d 100644
|
2023-07-25 18:57:30 +02:00
|
|
|
--- content/shell/browser/shell_content_browser_client.cc
|
|
|
|
+++ content/shell/browser/shell_content_browser_client.cc
|
2024-10-24 17:53:43 +02:00
|
|
|
@@ -757,7 +757,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated(
|
2024-02-22 19:36:15 +01:00
|
|
|
#endif
|
|
|
|
}
|
2023-07-25 18:57:30 +02:00
|
|
|
|
|
|
|
-void ShellContentBrowserClient::ConfigureNetworkContextParams(
|
|
|
|
+bool ShellContentBrowserClient::ConfigureNetworkContextParams(
|
|
|
|
BrowserContext* context,
|
|
|
|
bool in_memory,
|
|
|
|
const base::FilePath& relative_partition_path,
|
2024-10-24 17:53:43 +02:00
|
|
|
@@ -766,6 +766,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams(
|
2023-07-25 18:57:30 +02:00
|
|
|
cert_verifier_creation_params) {
|
|
|
|
ConfigureNetworkContextParamsForShell(context, network_context_params,
|
|
|
|
cert_verifier_creation_params);
|
|
|
|
+ return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<base::FilePath>
|
|
|
|
diff --git content/shell/browser/shell_content_browser_client.h content/shell/browser/shell_content_browser_client.h
|
2024-10-24 17:53:43 +02:00
|
|
|
index a2514c8a9f8a8..3266b8a0bd781 100644
|
2023-07-25 18:57:30 +02:00
|
|
|
--- content/shell/browser/shell_content_browser_client.h
|
|
|
|
+++ content/shell/browser/shell_content_browser_client.h
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -150,7 +150,7 @@ class ShellContentBrowserClient : public ContentBrowserClient {
|
2024-03-19 22:11:42 +01:00
|
|
|
GetGeolocationSystemPermissionManager() override;
|
2024-02-22 19:36:15 +01:00
|
|
|
void OnNetworkServiceCreated(
|
|
|
|
network::mojom::NetworkService* network_service) override;
|
2023-07-25 18:57:30 +02:00
|
|
|
- void ConfigureNetworkContextParams(
|
|
|
|
+ bool ConfigureNetworkContextParams(
|
|
|
|
BrowserContext* context,
|
|
|
|
bool in_memory,
|
|
|
|
const base::FilePath& relative_partition_path,
|
2023-01-23 18:58:40 +01:00
|
|
|
diff --git headless/lib/browser/headless_content_browser_client.cc headless/lib/browser/headless_content_browser_client.cc
|
2024-10-24 17:05:31 +02:00
|
|
|
index d871e4d79774d..1faf20d69df19 100644
|
2023-01-23 18:58:40 +01:00
|
|
|
--- headless/lib/browser/headless_content_browser_client.cc
|
|
|
|
+++ headless/lib/browser/headless_content_browser_client.cc
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -362,7 +362,7 @@ bool HeadlessContentBrowserClient::IsSharedStorageSelectURLAllowed(
|
2023-02-27 19:52:38 +01:00
|
|
|
return true;
|
2023-01-23 18:58:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
-void HeadlessContentBrowserClient::ConfigureNetworkContextParams(
|
|
|
|
+bool HeadlessContentBrowserClient::ConfigureNetworkContextParams(
|
|
|
|
content::BrowserContext* context,
|
|
|
|
bool in_memory,
|
|
|
|
const base::FilePath& relative_partition_path,
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -372,6 +372,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams(
|
2023-01-23 18:58:40 +01:00
|
|
|
HeadlessBrowserContextImpl::From(context)->ConfigureNetworkContextParams(
|
|
|
|
in_memory, relative_partition_path, network_context_params,
|
|
|
|
cert_verifier_creation_params);
|
|
|
|
+ return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string HeadlessContentBrowserClient::GetProduct() {
|
|
|
|
diff --git headless/lib/browser/headless_content_browser_client.h headless/lib/browser/headless_content_browser_client.h
|
2024-10-24 17:05:31 +02:00
|
|
|
index 8313eb0e4d6a9..7189e626cf5ed 100644
|
2023-01-23 18:58:40 +01:00
|
|
|
--- headless/lib/browser/headless_content_browser_client.h
|
|
|
|
+++ headless/lib/browser/headless_content_browser_client.h
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -101,7 +101,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient {
|
2024-05-23 03:52:35 +02:00
|
|
|
std::string* out_debug_message,
|
|
|
|
bool* out_block_is_site_setting_specific) override;
|
2023-01-23 18:58:40 +01:00
|
|
|
|
|
|
|
- void ConfigureNetworkContextParams(
|
|
|
|
+ bool ConfigureNetworkContextParams(
|
|
|
|
content::BrowserContext* context,
|
|
|
|
bool in_memory,
|
|
|
|
const base::FilePath& relative_partition_path,
|