1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
content / browser / devtools / devtools_agent_host_impl.cc [blame]
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/devtools/devtools_agent_host_impl.h"
#include <map>
#include <vector>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/memory/ref_counted_memory.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/observer_list.h"
#include "base/strings/string_split.h"
#include "content/browser/devtools/auction_worklet_devtools_agent_host.h"
#include "content/browser/devtools/devtools_http_handler.h"
#include "content/browser/devtools/devtools_manager.h"
#include "content/browser/devtools/devtools_pipe_handler.h"
#include "content/browser/devtools/devtools_stream_file.h"
#include "content/browser/devtools/forwarding_agent_host.h"
#include "content/browser/devtools/mojom_devtools_agent_host.h"
#include "content/browser/devtools/render_frame_devtools_agent_host.h"
#include "content/browser/devtools/service_worker_devtools_agent_host.h"
#include "content/browser/devtools/service_worker_devtools_manager.h"
#include "content/browser/devtools/shared_storage_worklet_devtools_manager.h"
#include "content/browser/devtools/shared_worker_devtools_agent_host.h"
#include "content/browser/devtools/shared_worker_devtools_manager.h"
#include "content/browser/devtools/web_contents_devtools_agent_host.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/devtools_external_agent_proxy_delegate.h"
#include "content/public/browser/devtools_socket_factory.h"
#include "content/public/browser/mojom_devtools_agent_host_delegate.h"
#include "content/public/common/content_switches.h"
#include "services/network/public/mojom/network_context.mojom.h"
#if BUILDFLAG(IS_WIN)
#include <windows.h>
#include <fcntl.h>
#include <io.h>
#endif
namespace content {
namespace {
typedef std::map<std::string, DevToolsAgentHostImpl*> DevToolsMap;
DevToolsMap& GetDevtoolsInstances() {
static base::NoDestructor<DevToolsMap> instance;
return *instance;
}
base::ObserverList<DevToolsAgentHostObserver>::Unchecked&
GetDevtoolsObservers() {
static base::NoDestructor<
base::ObserverList<DevToolsAgentHostObserver>::Unchecked>
instance;
return *instance;
}
void SetDevToolsHttpHandler(std::unique_ptr<DevToolsHttpHandler> handler) {
static base::NoDestructor<std::unique_ptr<DevToolsHttpHandler>> instance;
*instance = std::move(handler);
}
void SetDevToolsPipeHandler(std::unique_ptr<DevToolsPipeHandler> handler) {
static base::NoDestructor<std::unique_ptr<DevToolsPipeHandler>> instance;
*instance = std::move(handler);
}
#if BUILDFLAG(IS_WIN)
// Map handle to file descriptor
int AdoptHandle(const std::string& serialized_pipe, int flags) {
// Deserialize the handle.
// We use the fact that inherited handles in the child process have the same
// value and access rights as in the parent process.
// See:
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa
uint32_t handle_as_uint32;
if (!base::StringToUint(serialized_pipe, &handle_as_uint32)) {
return -1;
}
HANDLE handle = base::win::Uint32ToHandle(handle_as_uint32);
if (GetFileType(handle) != FILE_TYPE_PIPE) {
return -1;
}
// Map the handle to the file descriptor
return _open_osfhandle(reinterpret_cast<intptr_t>(handle), flags);
}
// Transform the --remote-debugging-io-pipes switch value to file descriptors.
bool AdoptPipes(const std::string& io_pipes, int& read_fd, int& write_fd) {
// The parent process is expected to serialize the input and the output pipe
// handles as unsigned integers, concatenate them with comma and pass this
// string to the browser via the --remote-debugging-io-pipes argument.
std::vector<std::string> pipe_names = base::SplitString(
io_pipes, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (pipe_names.size() != 2) {
return false;
}
const std::string& in_pipe = pipe_names[0];
const std::string& out_pipe = pipe_names[1];
// If adoption of the read_fd fails the already adopted write_fd signalizing
// the remote end that the session is over.
int tmp_write_fd = AdoptHandle(out_pipe, 0);
if (tmp_write_fd < 0) {
return false;
}
int tmp_read_fd = AdoptHandle(in_pipe, _O_RDONLY);
if (tmp_read_fd < 0) {
_close(tmp_write_fd);
return false;
}
read_fd = tmp_read_fd;
write_fd = tmp_write_fd;
return true;
}
#endif
} // namespace
const char DevToolsAgentHost::kTypeTab[] = "tab";
const char DevToolsAgentHost::kTypePage[] = "page";
const char DevToolsAgentHost::kTypeFrame[] = "iframe";
const char DevToolsAgentHost::kTypeDedicatedWorker[] = "worker";
const char DevToolsAgentHost::kTypeSharedWorker[] = "shared_worker";
const char DevToolsAgentHost::kTypeServiceWorker[] = "service_worker";
const char DevToolsAgentHost::kTypeWorklet[] = "worklet";
const char DevToolsAgentHost::kTypeSharedStorageWorklet[] =
"shared_storage_worklet";
const char DevToolsAgentHost::kTypeBrowser[] = "browser";
const char DevToolsAgentHost::kTypeGuest[] = "webview";
const char DevToolsAgentHost::kTypeOther[] = "other";
const char DevToolsAgentHost::kTypeAuctionWorklet[] = "auction_worklet";
const char DevToolsAgentHost::kTypeAssistiveTechnology[] =
"assistive_technology";
int DevToolsAgentHostImpl::s_force_creation_count_ = 0;
// static
std::string DevToolsAgentHost::GetProtocolVersion() {
// TODO(dgozman): generate this.
return "1.3";
}
// static
bool DevToolsAgentHost::IsSupportedProtocolVersion(const std::string& version) {
// TODO(dgozman): generate this.
return version == "1.0" || version == "1.1" || version == "1.2" ||
version == "1.3";
}
// static
DevToolsAgentHost::List DevToolsAgentHost::GetAll() {
DevToolsAgentHost::List result;
for (auto& instance : GetDevtoolsInstances()) {
result.push_back(instance.second);
}
return result;
}
// static
DevToolsAgentHost::List DevToolsAgentHost::GetOrCreateAll() {
List result;
SharedWorkerDevToolsAgentHost::List shared_list;
SharedWorkerDevToolsManager::GetInstance()->AddAllAgentHosts(&shared_list);
for (const auto& host : shared_list)
result.push_back(host);
ServiceWorkerDevToolsAgentHost::List service_list;
ServiceWorkerDevToolsManager::GetInstance()->AddAllAgentHosts(&service_list);
for (const auto& host : service_list)
result.push_back(host);
SharedStorageWorkletDevToolsManager::GetInstance()->AddAllAgentHosts(&result);
// TODO(dgozman): we should add dedicated workers here, but clients are not
// ready.
RenderFrameDevToolsAgentHost::AddAllAgentHosts(&result);
WebContentsDevToolsAgentHost::AddAllAgentHosts(&result);
AuctionWorkletDevToolsAgentHostManager::GetInstance().GetAll(&result);
MojomDevToolsAgentHost::GetAll(&result);
#if DCHECK_IS_ON()
for (auto it : result) {
DevToolsAgentHostImpl* host = static_cast<DevToolsAgentHostImpl*>(it.get());
DCHECK(base::Contains(GetDevtoolsInstances(), host->id_));
}
#endif
return result;
}
// static
void DevToolsAgentHost::StartRemoteDebuggingServer(
std::unique_ptr<DevToolsSocketFactory> server_socket_factory,
const base::FilePath& active_port_output_directory,
const base::FilePath& debug_frontend_dir) {
DevToolsManagerDelegate* delegate =
DevToolsManager::GetInstance()->delegate();
CHECK(delegate);
SetDevToolsHttpHandler(std::make_unique<DevToolsHttpHandler>(
delegate, std::move(server_socket_factory), active_port_output_directory,
debug_frontend_dir));
}
// static
void DevToolsAgentHost::StartRemoteDebuggingPipeHandler(
base::OnceClosure on_disconnect) {
int read_fd = kReadFD;
int write_fd = kWriteFD;
#if BUILDFLAG(IS_WIN)
std::string io_pipes =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kRemoteDebuggingIoPipes);
if (!io_pipes.empty() && !AdoptPipes(io_pipes, read_fd, write_fd)) {
std::move(on_disconnect).Run();
return;
}
#endif
SetDevToolsPipeHandler(std::make_unique<DevToolsPipeHandler>(
read_fd, write_fd, std::move(on_disconnect)));
}
// static
void DevToolsAgentHost::StopRemoteDebuggingServer() {
SetDevToolsHttpHandler(nullptr);
}
// static
void DevToolsAgentHost::StopRemoteDebuggingPipeHandler() {
SetDevToolsPipeHandler(nullptr);
}
DevToolsAgentHostImpl::DevToolsAgentHostImpl(const std::string& id)
: id_(id), renderer_channel_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
DevToolsAgentHostImpl::~DevToolsAgentHostImpl() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
NotifyDestroyed();
}
// static
scoped_refptr<DevToolsAgentHostImpl> DevToolsAgentHostImpl::GetForId(
const std::string& id) {
auto it = GetDevtoolsInstances().find(id);
if (it == GetDevtoolsInstances().end())
return nullptr;
return it->second;
}
// static
scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::GetForId(
const std::string& id) {
return DevToolsAgentHostImpl::GetForId(id);
}
// static
scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::Forward(
const std::string& id,
std::unique_ptr<DevToolsExternalAgentProxyDelegate> delegate) {
scoped_refptr<DevToolsAgentHost> result = DevToolsAgentHost::GetForId(id);
if (result)
return result;
return new ForwardingAgentHost(id, std::move(delegate));
}
// static
scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::CreateForMojomDelegate(
const std::string& id,
std::unique_ptr<MojomDevToolsAgentHostDelegate> delegate) {
scoped_refptr<DevToolsAgentHost> result = DevToolsAgentHost::GetForId(id);
if (result) {
return result;
}
return new MojomDevToolsAgentHost(id, std::move(delegate));
}
DevToolsSession* DevToolsAgentHostImpl::SessionByClient(
DevToolsAgentHostClient* client) {
auto it = session_by_client_.find(client);
return it == session_by_client_.end() ? nullptr : it->second.get();
}
bool DevToolsAgentHostImpl::AttachInternal(
std::unique_ptr<DevToolsSession> session_owned) {
return AttachInternal(std::move(session_owned), true);
}
bool DevToolsAgentHostImpl::AttachInternal(
std::unique_ptr<DevToolsSession> session_owned,
bool acquire_wake_lock) {
scoped_refptr<DevToolsAgentHostImpl> protect(this);
DevToolsSession* session = session_owned.get();
session->SetAgentHost(this);
if (!AttachSession(session, acquire_wake_lock))
return false;
renderer_channel_.AttachSession(session);
sessions_.push_back(session);
DCHECK(!base::Contains(session_by_client_, session->GetClient()));
session_by_client_.emplace(session->GetClient(), std::move(session_owned));
if (sessions_.size() == 1)
NotifyAttached();
DevToolsManager* manager = DevToolsManager::GetInstance();
if (manager->delegate())
manager->delegate()->ClientAttached(session);
return true;
}
bool DevToolsAgentHostImpl::AttachClient(DevToolsAgentHostClient* client) {
if (SessionByClient(client))
return false;
return AttachInternal(
std::make_unique<DevToolsSession>(client, GetSessionMode()),
/*acquire_wake_lock=*/true);
}
bool DevToolsAgentHostImpl::AttachClientWithoutWakeLock(
content::DevToolsAgentHostClient* client) {
if (SessionByClient(client))
return false;
return AttachInternal(
std::make_unique<DevToolsSession>(client, GetSessionMode()),
/*acquire_wake_lock=*/false);
}
bool DevToolsAgentHostImpl::DetachClient(DevToolsAgentHostClient* client) {
DevToolsSession* session = SessionByClient(client);
if (!session)
return false;
scoped_refptr<DevToolsAgentHostImpl> protect(this);
DetachInternal(session);
return true;
}
void DevToolsAgentHostImpl::DispatchProtocolMessage(
DevToolsAgentHostClient* client,
base::span<const uint8_t> message) {
DevToolsSession* session = SessionByClient(client);
if (session)
session->DispatchProtocolMessage(message);
}
void DevToolsAgentHostImpl::DetachInternal(DevToolsSession* session) {
std::unique_ptr<DevToolsSession> session_owned =
std::move(session_by_client_[session->GetClient()]);
DCHECK_EQ(session, session_owned.get());
// Make sure we dispose session prior to reporting it to the host.
session->Dispose();
std::erase(sessions_, session);
session_by_client_.erase(session->GetClient());
DetachSession(session);
DevToolsManager* manager = DevToolsManager::GetInstance();
if (manager->delegate())
manager->delegate()->ClientDetached(session);
if (sessions_.empty()) {
io_context_.DiscardAllStreams();
NotifyDetached();
}
}
bool DevToolsAgentHostImpl::IsAttached() {
return !sessions_.empty();
}
void DevToolsAgentHostImpl::InspectElement(RenderFrameHost* frame_host,
int x,
int y) {}
std::string DevToolsAgentHostImpl::GetId() {
return id_;
}
std::string DevToolsAgentHostImpl::CreateIOStreamFromData(
scoped_refptr<base::RefCountedMemory> data) {
scoped_refptr<DevToolsStreamFile> stream =
DevToolsStreamFile::Create(GetIOContext(), true /* binary */);
stream->Append(std::make_unique<std::string>(base::as_string_view(*data)));
return stream->handle();
}
std::string DevToolsAgentHostImpl::GetParentId() {
return std::string();
}
std::string DevToolsAgentHostImpl::GetOpenerId() {
return std::string();
}
std::string DevToolsAgentHostImpl::GetOpenerFrameId() {
return std::string();
}
bool DevToolsAgentHostImpl::CanAccessOpener() {
return false;
}
std::string DevToolsAgentHostImpl::GetDescription() {
return std::string();
}
GURL DevToolsAgentHostImpl::GetFaviconURL() {
return GURL();
}
std::string DevToolsAgentHostImpl::GetFrontendURL() {
return std::string();
}
base::TimeTicks DevToolsAgentHostImpl::GetLastActivityTime() {
return base::TimeTicks();
}
BrowserContext* DevToolsAgentHostImpl::GetBrowserContext() {
return nullptr;
}
WebContents* DevToolsAgentHostImpl::GetWebContents() {
return nullptr;
}
void DevToolsAgentHostImpl::DisconnectWebContents() {
}
void DevToolsAgentHostImpl::ConnectWebContents(WebContents* wc) {
}
DevToolsSession::Mode DevToolsAgentHostImpl::GetSessionMode() {
return DevToolsSession::Mode::kDoesNotSupportTabTarget;
}
bool DevToolsAgentHostImpl::Inspect() {
DevToolsManager* manager = DevToolsManager::GetInstance();
if (manager->delegate()) {
manager->delegate()->Inspect(this);
return true;
}
return false;
}
void DevToolsAgentHostImpl::ForceDetachAllSessions() {
std::ignore = ForceDetachAllSessionsImpl();
}
scoped_refptr<DevToolsAgentHost>
DevToolsAgentHostImpl::ForceDetachAllSessionsImpl() {
scoped_refptr<DevToolsAgentHost> retain_this(this);
while (!sessions_.empty()) {
DevToolsAgentHostClient* client = (*sessions_.begin())->GetClient();
DetachClient(client);
client->AgentHostClosed(this);
}
return retain_this;
}
void DevToolsAgentHostImpl::MainThreadDebuggerPaused() {}
void DevToolsAgentHostImpl::MainThreadDebuggerResumed() {}
void DevToolsAgentHostImpl::ForceDetachRestrictedSessions(
const std::vector<DevToolsSession*>& restricted_sessions) {
scoped_refptr<DevToolsAgentHostImpl> protect(this);
for (DevToolsSession* session : restricted_sessions) {
DevToolsAgentHostClient* client = session->GetClient();
DetachClient(client);
client->AgentHostClosed(this);
}
}
bool DevToolsAgentHostImpl::AttachSession(DevToolsSession* session,
bool acquire_wake_lock) {
return false;
}
void DevToolsAgentHostImpl::DetachSession(DevToolsSession* session) {}
void DevToolsAgentHostImpl::UpdateRendererChannel(bool force) {}
// static
void DevToolsAgentHost::DetachAllClients() {
// Make a copy, since detaching may lead to agent destruction, which
// removes it from the instances.
std::vector<scoped_refptr<DevToolsAgentHostImpl>> copy;
for (auto& instance : GetDevtoolsInstances()) {
copy.push_back(instance.second);
}
for (auto& instance : copy) {
instance->ForceDetachAllSessions();
}
}
// static
void DevToolsAgentHost::AddObserver(DevToolsAgentHostObserver* observer) {
if (observer->ShouldForceDevToolsAgentHostCreation()) {
if (!DevToolsAgentHostImpl::s_force_creation_count_) {
// Force all agent hosts when first observer is added.
DevToolsAgentHost::GetOrCreateAll();
}
DevToolsAgentHostImpl::s_force_creation_count_++;
}
GetDevtoolsObservers().AddObserver(observer);
for (const auto& id_host : GetDevtoolsInstances())
observer->DevToolsAgentHostCreated(id_host.second);
}
// static
void DevToolsAgentHost::RemoveObserver(DevToolsAgentHostObserver* observer) {
if (observer->ShouldForceDevToolsAgentHostCreation())
DevToolsAgentHostImpl::s_force_creation_count_--;
GetDevtoolsObservers().RemoveObserver(observer);
}
// static
bool DevToolsAgentHostImpl::ShouldForceCreation() {
return !!s_force_creation_count_;
}
std::string DevToolsAgentHostImpl::GetSubtype() {
return "";
}
void DevToolsAgentHostImpl::NotifyCreated() {
DCHECK(!base::Contains(GetDevtoolsInstances(), id_));
GetDevtoolsInstances()[id_] = this;
for (auto& observer : GetDevtoolsObservers())
observer.DevToolsAgentHostCreated(this);
}
void DevToolsAgentHostImpl::NotifyNavigated() {
for (auto& observer : GetDevtoolsObservers())
observer.DevToolsAgentHostNavigated(this);
}
void DevToolsAgentHostImpl::NotifyAttached() {
for (auto& observer : GetDevtoolsObservers())
observer.DevToolsAgentHostAttached(this);
}
void DevToolsAgentHostImpl::NotifyDetached() {
for (auto& observer : GetDevtoolsObservers())
observer.DevToolsAgentHostDetached(this);
}
void DevToolsAgentHostImpl::NotifyCrashed(base::TerminationStatus status) {
for (auto& observer : GetDevtoolsObservers())
observer.DevToolsAgentHostCrashed(this, status);
}
void DevToolsAgentHostImpl::NotifyDestroyed() {
DCHECK(base::Contains(GetDevtoolsInstances(), id_));
for (auto& observer : GetDevtoolsObservers())
observer.DevToolsAgentHostDestroyed(this);
GetDevtoolsInstances().erase(id_);
}
void DevToolsAgentHostImpl::ProcessHostChanged() {
RenderProcessHost* host = GetProcessHost();
if (!host) {
return;
}
if (host->IsReady()) {
SetProcessId(host->GetProcess().Pid());
} else {
host->PostTaskWhenProcessIsReady(base::BindOnce(
&RenderFrameDevToolsAgentHost::ProcessHostChanged, this));
}
}
void DevToolsAgentHostImpl::SetProcessId(base::ProcessId process_id) {
CHECK_NE(process_id, base::kNullProcessId);
if (process_id_ == process_id) {
return;
}
process_id_ = process_id;
for (auto& observer : GetDevtoolsObservers()) {
observer.DevToolsAgentHostProcessChanged(this);
}
}
DevToolsAgentHostImpl::NetworkLoaderFactoryParamsAndInfo::
NetworkLoaderFactoryParamsAndInfo() = default;
DevToolsAgentHostImpl::NetworkLoaderFactoryParamsAndInfo::
NetworkLoaderFactoryParamsAndInfo(
url::Origin origin,
net::SiteForCookies site_for_cookies,
network::mojom::URLLoaderFactoryParamsPtr factory_params)
: origin(std::move(origin)),
site_for_cookies(std::move(site_for_cookies)),
factory_params(std::move(factory_params)) {}
DevToolsAgentHostImpl::NetworkLoaderFactoryParamsAndInfo::
NetworkLoaderFactoryParamsAndInfo(
DevToolsAgentHostImpl::NetworkLoaderFactoryParamsAndInfo&&) = default;
DevToolsAgentHostImpl::NetworkLoaderFactoryParamsAndInfo::
~NetworkLoaderFactoryParamsAndInfo() = default;
DevToolsAgentHostImpl::NetworkLoaderFactoryParamsAndInfo
DevToolsAgentHostImpl::CreateNetworkFactoryParamsForDevTools() {
return {};
}
RenderProcessHost* DevToolsAgentHostImpl::GetProcessHost() {
return nullptr;
}
std::optional<network::CrossOriginEmbedderPolicy>
DevToolsAgentHostImpl::cross_origin_embedder_policy(const std::string& id) {
return std::nullopt;
}
std::optional<network::CrossOriginOpenerPolicy>
DevToolsAgentHostImpl::cross_origin_opener_policy(const std::string& id) {
return std::nullopt;
}
std::optional<std::vector<network::mojom::ContentSecurityPolicyHeader>>
DevToolsAgentHostImpl::content_security_policy(const std::string& id) {
return std::nullopt;
}
protocol::TargetAutoAttacher* DevToolsAgentHostImpl::auto_attacher() {
return nullptr;
}
} // namespace content