|
50 | 50 | #include "content/public/browser/context_menu_params.h" |
51 | 51 | #include "content/public/browser/desktop_media_id.h" |
52 | 52 | #include "content/public/browser/desktop_streams_registry.h" |
| 53 | +#include "content/public/browser/devtools_agent_host.h" |
53 | 54 | #include "content/public/browser/download_request_utils.h" |
54 | 55 | #include "content/public/browser/favicon_status.h" |
55 | 56 | #include "content/public/browser/file_select_listener.h" |
@@ -2801,6 +2802,11 @@ std::string WebContents::GetMediaSourceID( |
2801 | 2802 | return id; |
2802 | 2803 | } |
2803 | 2804 |
|
| 2805 | +std::string WebContents::GetOrCreateDevToolsTargetId() { |
| 2806 | + auto agent_host = content::DevToolsAgentHost::GetOrCreateFor(web_contents()); |
| 2807 | + return agent_host->GetId(); |
| 2808 | +} |
| 2809 | + |
2804 | 2810 | bool WebContents::IsCrashed() const { |
2805 | 2811 | return web_contents()->IsCrashed(); |
2806 | 2812 | } |
@@ -4667,6 +4673,8 @@ void WebContents::FillObjectTemplate(v8::Isolate* isolate, |
4667 | 4673 | &WebContents::SetWebRTCIPHandlingPolicy) |
4668 | 4674 | .SetMethod("setWebRTCUDPPortRange", &WebContents::SetWebRTCUDPPortRange) |
4669 | 4675 | .SetMethod("getMediaSourceId", &WebContents::GetMediaSourceID) |
| 4676 | + .SetMethod("getOrCreateDevToolsTargetId", |
| 4677 | + &WebContents::GetOrCreateDevToolsTargetId) |
4670 | 4678 | .SetMethod("getWebRTCIPHandlingPolicy", |
4671 | 4679 | &WebContents::GetWebRTCIPHandlingPolicy) |
4672 | 4680 | .SetMethod("getWebRTCUDPPortRange", &WebContents::GetWebRTCUDPPortRange) |
|
0 commit comments