mirror of
https://github.com/electron/electron.git
synced 2026-10-29 04:04:54 +08:00
* feat: identify the requesting frame and initiator on network, auth and download events * webRequest listener details gain `initiator`, the origin that issued the request (kept from the original request across redirects, as in Chrome's webRequest API) * protocol.handle() requests and ProtocolRequest gain `initiator` * DownloadItem gains getInitiatorOrigin(); session 'will-download' gets a trailing `frame` * session 'preconnect' gets a trailing `frame` * specs for each * docs: add API history PR reference
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
// Copyright (c) 2019 Slack Technologies, Inc.
|
|
// Use of this source code is governed by the MIT license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_NETWORK_HINTS_HANDLER_IMPL_H_
|
|
#define ELECTRON_SHELL_BROWSER_NETWORK_HINTS_HANDLER_IMPL_H_
|
|
|
|
#include "base/memory/raw_ptr.h"
|
|
#include "components/network_hints/browser/simple_network_hints_handler_impl.h"
|
|
#include "content/public/browser/global_routing_id.h"
|
|
|
|
namespace content {
|
|
class RenderFrameHost;
|
|
class BrowserContext;
|
|
} // namespace content
|
|
|
|
class NetworkHintsHandlerImpl
|
|
: public network_hints::SimpleNetworkHintsHandlerImpl {
|
|
public:
|
|
~NetworkHintsHandlerImpl() override;
|
|
|
|
static void Create(
|
|
content::RenderFrameHost* frame_host,
|
|
mojo::PendingReceiver<network_hints::mojom::NetworkHintsHandler>
|
|
receiver);
|
|
|
|
// network_hints::mojom::NetworkHintsHandler:
|
|
void Preconnect(const url::SchemeHostPort& url,
|
|
bool allow_credentials) override;
|
|
|
|
private:
|
|
explicit NetworkHintsHandlerImpl(content::RenderFrameHost*);
|
|
|
|
const content::GlobalRenderFrameHostId render_frame_host_id_;
|
|
raw_ptr<content::BrowserContext> browser_context_ = nullptr;
|
|
};
|
|
|
|
#endif // ELECTRON_SHELL_BROWSER_NETWORK_HINTS_HANDLER_IMPL_H_
|