mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
* chore: bump chromium in DEPS to 111.0.5563.19 * chore: bump chromium in DEPS to 111.0.5563.33 * chore: bump chromium in DEPS to 111.0.5563.41 * chore: update patches * refactor: remove GetFontLookupTableCacheDir Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4191820 (cherry picked from commit52740f127f) * chore: remove dead DecodeToken code (cherry picked from commite7ac425771) * chore: add stub impls for WCO routing Refs: https://chromium-review.googlesource.com/c/chromium/src/+/4182690 (cherry picked from commit911e353b07) * refacotr: switch mojom::NetworkHintsHandler to use SchemeHostPair instead of URL Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4185417 (cherry picked from commita8b3befdd7) * chore: bump chromium in DEPS to 111.0.5563.50 * chore: update patches * 4240360: [intl] Revert date formatting behavior change from ICU 72 https://chromium-review.googlesource.com/c/v8/v8/+/4240360 * chore: update patches --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
48 lines
1.7 KiB
C++
48 lines
1.7 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.
|
|
|
|
#include "shell/browser/network_hints_handler_impl.h"
|
|
|
|
#include <utility>
|
|
|
|
#include "content/public/browser/browser_context.h"
|
|
#include "content/public/browser/browser_thread.h"
|
|
#include "content/public/browser/render_frame_host.h"
|
|
#include "content/public/browser/render_process_host.h"
|
|
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
|
|
#include "shell/browser/api/electron_api_session.h"
|
|
#include "shell/browser/electron_browser_context.h"
|
|
#include "shell/common/gin_converters/gurl_converter.h"
|
|
#include "v8/include/v8.h"
|
|
|
|
NetworkHintsHandlerImpl::NetworkHintsHandlerImpl(
|
|
content::RenderFrameHost* frame_host)
|
|
: network_hints::SimpleNetworkHintsHandlerImpl(
|
|
frame_host->GetProcess()->GetID(),
|
|
frame_host->GetRoutingID()),
|
|
browser_context_(frame_host->GetProcess()->GetBrowserContext()) {}
|
|
|
|
NetworkHintsHandlerImpl::~NetworkHintsHandlerImpl() = default;
|
|
|
|
void NetworkHintsHandlerImpl::Preconnect(const url::SchemeHostPort& url,
|
|
bool allow_credentials) {
|
|
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
|
|
|
if (!browser_context_) {
|
|
return;
|
|
}
|
|
auto* session = electron::api::Session::FromBrowserContext(browser_context_);
|
|
if (session) {
|
|
session->Emit("preconnect", url.GetURL(), allow_credentials);
|
|
}
|
|
}
|
|
|
|
void NetworkHintsHandlerImpl::Create(
|
|
content::RenderFrameHost* frame_host,
|
|
mojo::PendingReceiver<network_hints::mojom::NetworkHintsHandler> receiver) {
|
|
mojo::MakeSelfOwnedReceiver(
|
|
base::WrapUnique(new NetworkHintsHandlerImpl(frame_host)),
|
|
std::move(receiver));
|
|
}
|