diff --git a/content/browser/devtools/protocol/hidden_target_manager.cc b/content/browser/devtools/protocol/hidden_target_manager.cc index 06f3a00e19972..f6f9c949c8a09 100644 --- a/content/browser/devtools/protocol/hidden_target_manager.cc +++ b/content/browser/devtools/protocol/hidden_target_manager.cc @@ -4,6 +4,7 @@ #include "content/browser/devtools/protocol/hidden_target_manager.h" +#include "base/logging.h" #include "content/browser/devtools/web_contents_devtools_agent_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" @@ -21,6 +22,8 @@ void HiddenTargetManager::CloseContents(content::WebContents* source) { std::string HiddenTargetManager::CreateHiddenTarget( const GURL& url, BrowserContext* browser_context) { + LOG(ERROR) << "[POC] content::HiddenTargetManager::CreateHiddenTarget called " + "(SetIsUsed mitigation WOULD run on this path)"; WebContents::CreateParams create_params(browser_context); std::unique_ptr web_contents = WebContents::Create(create_params); diff --git a/headless/lib/browser/protocol/target_handler.cc b/headless/lib/browser/protocol/target_handler.cc index 548be825e526b..6ff0beff13936 100644 --- a/headless/lib/browser/protocol/target_handler.cc +++ b/headless/lib/browser/protocol/target_handler.cc @@ -7,7 +7,11 @@ #include #include +#include "base/logging.h" #include "build/build_config.h" +#include "content/public/browser/render_frame_host.h" +#include "content/public/browser/render_process_host.h" +#include "content/public/browser/web_contents.h" #include "headless/lib/browser/headless_browser_context_impl.h" #include "headless/lib/browser/headless_browser_impl.h" #include "headless/lib/browser/headless_web_contents_impl.h" @@ -113,6 +117,17 @@ Response TargetHandler::CreateTarget( *out_target_id = content::DevToolsAgentHost::GetOrCreateFor( web_contents_impl->web_contents()) ->GetId(); + { + auto* rph = web_contents_impl->web_contents() + ->GetPrimaryMainFrame() + ->GetProcess(); + LOG(ERROR) << "[POC] headless::TargetHandler::CreateTarget(hidden=true) " + "handled at EMBEDDER layer; targetId=" + << *out_target_id << " RPH-ID=" << rph->GetID() + << " IsUnused()=" << (rph->IsUnused() ? "true" : "false") + << " -- content::HiddenTargetManager::SetIsUsed() will NOT " + "run."; + } // Keep hidden target's ID in the hidden_web_contents_ to close it when the // session is closed. hidden_web_contents_.insert(*out_target_id);