2019-11-27 01:01:13 +00:00
|
|
|
// 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.
|
|
|
|
|
2024-01-04 21:20:37 +00:00
|
|
|
#include "shell/common/api/electron_api_url_loader.h"
|
2019-11-27 01:01:13 +00:00
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
2024-01-11 01:00:37 +00:00
|
|
|
#include <string_view>
|
2019-11-27 01:01:13 +00:00
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
2023-06-14 21:00:46 +00:00
|
|
|
#include "base/containers/fixed_flat_map.h"
|
2023-05-11 20:07:39 +00:00
|
|
|
#include "base/memory/raw_ptr.h"
|
2020-07-22 05:34:34 +00:00
|
|
|
#include "base/no_destructor.h"
|
2024-06-07 21:18:35 +00:00
|
|
|
#include "base/notreached.h"
|
2024-01-04 21:20:37 +00:00
|
|
|
#include "base/sequence_checker.h"
|
2024-01-24 22:43:31 +00:00
|
|
|
#include "base/strings/string_number_conversions.h"
|
2019-11-27 01:01:13 +00:00
|
|
|
#include "gin/handle.h"
|
|
|
|
#include "gin/object_template_builder.h"
|
|
|
|
#include "gin/wrappable.h"
|
2020-03-07 02:41:56 +00:00
|
|
|
#include "mojo/public/cpp/bindings/remote.h"
|
2019-11-27 01:01:13 +00:00
|
|
|
#include "mojo/public/cpp/system/data_pipe_producer.h"
|
2024-07-29 17:42:57 +00:00
|
|
|
#include "net/base/auth.h"
|
2020-03-20 22:56:02 +00:00
|
|
|
#include "net/base/load_flags.h"
|
2022-02-25 18:17:35 +00:00
|
|
|
#include "net/http/http_util.h"
|
2023-03-02 23:47:45 +00:00
|
|
|
#include "net/url_request/redirect_util.h"
|
2019-11-27 01:01:13 +00:00
|
|
|
#include "services/network/public/cpp/resource_request.h"
|
|
|
|
#include "services/network/public/cpp/simple_url_loader.h"
|
2023-03-02 23:47:45 +00:00
|
|
|
#include "services/network/public/cpp/url_util.h"
|
|
|
|
#include "services/network/public/cpp/wrapper_shared_url_loader_factory.h"
|
2019-11-27 01:01:13 +00:00
|
|
|
#include "services/network/public/mojom/chunked_data_pipe_getter.mojom.h"
|
2021-08-24 00:52:17 +00:00
|
|
|
#include "services/network/public/mojom/http_raw_headers.mojom.h"
|
2019-11-27 01:01:13 +00:00
|
|
|
#include "services/network/public/mojom/url_loader_factory.mojom.h"
|
|
|
|
#include "shell/browser/api/electron_api_session.h"
|
|
|
|
#include "shell/browser/electron_browser_context.h"
|
2020-06-22 16:35:24 +00:00
|
|
|
#include "shell/browser/javascript_environment.h"
|
2023-03-02 23:47:45 +00:00
|
|
|
#include "shell/browser/net/asar/asar_url_loader_factory.h"
|
2023-03-27 17:00:55 +00:00
|
|
|
#include "shell/browser/net/proxying_url_loader_factory.h"
|
2023-03-02 23:47:45 +00:00
|
|
|
#include "shell/browser/protocol_registry.h"
|
2019-11-27 01:01:13 +00:00
|
|
|
#include "shell/common/gin_converters/callback_converter.h"
|
|
|
|
#include "shell/common/gin_converters/gurl_converter.h"
|
|
|
|
#include "shell/common/gin_converters/net_converter.h"
|
|
|
|
#include "shell/common/gin_helper/dictionary.h"
|
|
|
|
#include "shell/common/gin_helper/object_template_builder.h"
|
2024-01-04 21:20:37 +00:00
|
|
|
#include "shell/common/gin_helper/promise.h"
|
2019-11-27 01:01:13 +00:00
|
|
|
#include "shell/common/node_includes.h"
|
2024-01-04 21:20:37 +00:00
|
|
|
#include "shell/common/process_util.h"
|
|
|
|
#include "shell/services/node/node_service.h"
|
2023-02-20 20:57:38 +00:00
|
|
|
#include "third_party/blink/public/common/loader/referrer_utils.h"
|
|
|
|
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom.h"
|
2019-11-27 01:01:13 +00:00
|
|
|
|
2020-01-14 17:36:08 +00:00
|
|
|
namespace gin {
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct Converter<network::mojom::HttpRawHeaderPairPtr> {
|
|
|
|
static v8::Local<v8::Value> ToV8(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
const network::mojom::HttpRawHeaderPairPtr& pair) {
|
2023-08-21 01:43:41 +00:00
|
|
|
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
|
2022-01-24 16:46:15 +00:00
|
|
|
dict.Set("key", pair->key);
|
2020-01-14 17:36:08 +00:00
|
|
|
dict.Set("value", pair->value);
|
|
|
|
return dict.GetHandle();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-09-29 16:03:33 +00:00
|
|
|
template <>
|
|
|
|
struct Converter<network::mojom::CredentialsMode> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
network::mojom::CredentialsMode* out) {
|
2023-06-19 08:33:09 +00:00
|
|
|
using Val = network::mojom::CredentialsMode;
|
|
|
|
static constexpr auto Lookup =
|
2024-01-11 01:00:37 +00:00
|
|
|
base::MakeFixedFlatMap<std::string_view, Val>({
|
2023-06-19 08:33:09 +00:00
|
|
|
{"include", Val::kInclude},
|
|
|
|
{"omit", Val::kOmit},
|
|
|
|
// Note: This only makes sense if the request
|
|
|
|
// specifies the "origin" option.
|
|
|
|
{"same-origin", Val::kSameOrigin},
|
|
|
|
});
|
|
|
|
return FromV8WithLookup(isolate, val, Lookup, out);
|
2020-09-29 16:03:33 +00:00
|
|
|
}
|
2022-06-28 08:08:55 +00:00
|
|
|
};
|
2020-09-29 16:03:33 +00:00
|
|
|
|
2023-02-20 20:57:38 +00:00
|
|
|
template <>
|
|
|
|
struct Converter<blink::mojom::FetchCacheMode> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
blink::mojom::FetchCacheMode* out) {
|
2023-06-19 08:33:09 +00:00
|
|
|
using Val = blink::mojom::FetchCacheMode;
|
|
|
|
static constexpr auto Lookup =
|
2024-01-11 01:00:37 +00:00
|
|
|
base::MakeFixedFlatMap<std::string_view, Val>({
|
2023-06-19 08:33:09 +00:00
|
|
|
{"default", Val::kDefault},
|
|
|
|
{"force-cache", Val::kForceCache},
|
|
|
|
{"no-cache", Val::kValidateCache},
|
|
|
|
{"no-store", Val::kNoStore},
|
|
|
|
{"only-if-cached", Val::kOnlyIfCached},
|
|
|
|
{"reload", Val::kBypassCache},
|
|
|
|
});
|
|
|
|
return FromV8WithLookup(isolate, val, Lookup, out);
|
2023-02-20 20:57:38 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct Converter<net::ReferrerPolicy> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
net::ReferrerPolicy* out) {
|
2023-06-19 08:33:09 +00:00
|
|
|
using Val = net::ReferrerPolicy;
|
|
|
|
// clang-format off
|
|
|
|
static constexpr auto Lookup =
|
2024-01-11 01:00:37 +00:00
|
|
|
base::MakeFixedFlatMap<std::string_view, Val>({
|
2023-06-19 08:33:09 +00:00
|
|
|
{"", Val::REDUCE_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN},
|
|
|
|
{"no-referrer", Val::NO_REFERRER},
|
|
|
|
{"no-referrer-when-downgrade", Val::CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE},
|
|
|
|
{"origin", Val::ORIGIN},
|
|
|
|
{"origin-when-cross-origin", Val::ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN},
|
|
|
|
{"same-origin", Val::CLEAR_ON_TRANSITION_CROSS_ORIGIN},
|
|
|
|
{"strict-origin", Val:: ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE},
|
|
|
|
{"strict-origin-when-cross-origin", Val::REDUCE_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN},
|
|
|
|
{"unsafe-url", Val::NEVER_CLEAR},
|
|
|
|
});
|
|
|
|
// clang-format on
|
|
|
|
return FromV8WithLowerLookup(isolate, val, Lookup, out);
|
2023-02-20 20:57:38 +00:00
|
|
|
}
|
|
|
|
};
|
2020-01-14 17:36:08 +00:00
|
|
|
} // namespace gin
|
|
|
|
|
2022-06-29 19:55:47 +00:00
|
|
|
namespace electron::api {
|
2020-01-14 17:36:08 +00:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2019-11-27 01:01:13 +00:00
|
|
|
class BufferDataSource : public mojo::DataPipeProducer::DataSource {
|
|
|
|
public:
|
|
|
|
explicit BufferDataSource(base::span<char> buffer) {
|
|
|
|
buffer_.resize(buffer.size());
|
|
|
|
memcpy(buffer_.data(), buffer.data(), buffer_.size());
|
|
|
|
}
|
|
|
|
~BufferDataSource() override = default;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// mojo::DataPipeProducer::DataSource:
|
|
|
|
uint64_t GetLength() const override { return buffer_.size(); }
|
|
|
|
ReadResult Read(uint64_t offset, base::span<char> buffer) override {
|
|
|
|
ReadResult result;
|
|
|
|
if (offset <= buffer_.size()) {
|
|
|
|
size_t readable_size = buffer_.size() - offset;
|
|
|
|
size_t writable_size = buffer.size();
|
|
|
|
size_t copyable_size = std::min(readable_size, writable_size);
|
2019-12-11 00:22:35 +00:00
|
|
|
if (copyable_size > 0) {
|
|
|
|
memcpy(buffer.data(), &buffer_[offset], copyable_size);
|
|
|
|
}
|
2019-11-27 01:01:13 +00:00
|
|
|
result.bytes_read = copyable_size;
|
|
|
|
} else {
|
2024-06-07 21:18:35 +00:00
|
|
|
NOTREACHED_IN_MIGRATION();
|
2019-11-27 01:01:13 +00:00
|
|
|
result.result = MOJO_RESULT_OUT_OF_RANGE;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<char> buffer_;
|
|
|
|
};
|
|
|
|
|
2024-09-04 23:40:02 +00:00
|
|
|
class JSChunkedDataPipeGetter final
|
|
|
|
: public gin::Wrappable<JSChunkedDataPipeGetter>,
|
|
|
|
public network::mojom::ChunkedDataPipeGetter {
|
2019-11-27 01:01:13 +00:00
|
|
|
public:
|
|
|
|
static gin::Handle<JSChunkedDataPipeGetter> Create(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Function> body_func,
|
|
|
|
mojo::PendingReceiver<network::mojom::ChunkedDataPipeGetter>
|
|
|
|
chunked_data_pipe_getter) {
|
|
|
|
return gin::CreateHandle(
|
|
|
|
isolate, new JSChunkedDataPipeGetter(
|
|
|
|
isolate, body_func, std::move(chunked_data_pipe_getter)));
|
|
|
|
}
|
|
|
|
|
|
|
|
// gin::Wrappable
|
|
|
|
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
|
|
|
v8::Isolate* isolate) override {
|
|
|
|
return gin::Wrappable<JSChunkedDataPipeGetter>::GetObjectTemplateBuilder(
|
|
|
|
isolate)
|
|
|
|
.SetMethod("write", &JSChunkedDataPipeGetter::WriteChunk)
|
|
|
|
.SetMethod("done", &JSChunkedDataPipeGetter::Done);
|
|
|
|
}
|
|
|
|
|
2024-03-06 11:45:28 +00:00
|
|
|
const char* GetTypeName() override { return "JSChunkedDataPipeGetter"; }
|
|
|
|
|
2019-11-27 01:01:13 +00:00
|
|
|
static gin::WrapperInfo kWrapperInfo;
|
|
|
|
~JSChunkedDataPipeGetter() override = default;
|
|
|
|
|
|
|
|
private:
|
|
|
|
JSChunkedDataPipeGetter(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Function> body_func,
|
|
|
|
mojo::PendingReceiver<network::mojom::ChunkedDataPipeGetter>
|
|
|
|
chunked_data_pipe_getter)
|
|
|
|
: isolate_(isolate), body_func_(isolate, body_func) {
|
2024-01-04 21:20:37 +00:00
|
|
|
DETACH_FROM_SEQUENCE(sequence_checker_);
|
2019-11-27 01:01:13 +00:00
|
|
|
receiver_.Bind(std::move(chunked_data_pipe_getter));
|
|
|
|
}
|
|
|
|
|
|
|
|
// network::mojom::ChunkedDataPipeGetter:
|
|
|
|
void GetSize(GetSizeCallback callback) override {
|
|
|
|
size_callback_ = std::move(callback);
|
|
|
|
}
|
|
|
|
|
|
|
|
void StartReading(mojo::ScopedDataPipeProducerHandle pipe) override {
|
2024-01-04 21:20:37 +00:00
|
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
2019-11-27 01:01:13 +00:00
|
|
|
|
|
|
|
if (body_func_.IsEmpty()) {
|
|
|
|
LOG(ERROR) << "Tried to read twice from a JSChunkedDataPipeGetter";
|
|
|
|
// Drop the handle on the floor.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
data_producer_ = std::make_unique<mojo::DataPipeProducer>(std::move(pipe));
|
|
|
|
|
|
|
|
v8::HandleScope handle_scope(isolate_);
|
|
|
|
auto maybe_wrapper = GetWrapper(isolate_);
|
|
|
|
v8::Local<v8::Value> wrapper;
|
|
|
|
if (!maybe_wrapper.ToLocal(&wrapper)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
v8::Local<v8::Value> argv[] = {wrapper};
|
|
|
|
node::Environment* env = node::Environment::GetCurrent(isolate_);
|
|
|
|
auto global = env->context()->Global();
|
|
|
|
node::MakeCallback(isolate_, global, body_func_.Get(isolate_),
|
|
|
|
node::arraysize(argv), argv, {0, 0});
|
|
|
|
}
|
|
|
|
|
|
|
|
v8::Local<v8::Promise> WriteChunk(v8::Local<v8::Value> buffer_val) {
|
|
|
|
gin_helper::Promise<void> promise(isolate_);
|
|
|
|
v8::Local<v8::Promise> handle = promise.GetHandle();
|
|
|
|
if (!buffer_val->IsArrayBufferView()) {
|
|
|
|
promise.RejectWithErrorMessage("Expected an ArrayBufferView");
|
|
|
|
return handle;
|
|
|
|
}
|
|
|
|
if (is_writing_) {
|
|
|
|
promise.RejectWithErrorMessage("Only one write can be pending at a time");
|
|
|
|
return handle;
|
|
|
|
}
|
|
|
|
if (!size_callback_) {
|
|
|
|
promise.RejectWithErrorMessage("Can't write after calling done()");
|
|
|
|
return handle;
|
|
|
|
}
|
|
|
|
auto buffer = buffer_val.As<v8::ArrayBufferView>();
|
|
|
|
is_writing_ = true;
|
|
|
|
bytes_written_ += buffer->ByteLength();
|
|
|
|
auto backing_store = buffer->Buffer()->GetBackingStore();
|
|
|
|
auto buffer_span = base::make_span(
|
|
|
|
static_cast<char*>(backing_store->Data()) + buffer->ByteOffset(),
|
|
|
|
buffer->ByteLength());
|
|
|
|
auto buffer_source = std::make_unique<BufferDataSource>(buffer_span);
|
|
|
|
data_producer_->Write(
|
|
|
|
std::move(buffer_source),
|
|
|
|
base::BindOnce(&JSChunkedDataPipeGetter::OnWriteChunkComplete,
|
|
|
|
// We're OK to use Unretained here because we own
|
|
|
|
// |data_producer_|.
|
|
|
|
base::Unretained(this), std::move(promise)));
|
|
|
|
return handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
void OnWriteChunkComplete(gin_helper::Promise<void> promise,
|
|
|
|
MojoResult result) {
|
2024-01-04 21:20:37 +00:00
|
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
2019-11-27 01:01:13 +00:00
|
|
|
is_writing_ = false;
|
|
|
|
if (result == MOJO_RESULT_OK) {
|
|
|
|
promise.Resolve();
|
|
|
|
} else {
|
chore: bump chromium to 92.0.4475.0 (master) (#28462)
* chore: bump chromium in DEPS to 91.0.4464.0
* chore: rebuild chromium/dcheck.patch with import-patches -3
Mechanical only; no code changes
* chore: remove content_browser_main_loop.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
The function being patched (BrowserMainLoop::MainMessageLoopRun()) no
longer exists.
NB: if removing this introduces regressions the likely fix will be to
add a similar patch for ShellBrowserMainParts::WillRunMainMessageLoop()
which has similar code and was added at the same time this was removed.
* chore: rebuild chromium/put_back_deleted_colors_for_autofill.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/disable_color_correct_rendering.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/eat_allow_disabling_blink_scheduler_throttling_per_renderview.patch with patch
Mechanical only; no code changes
* chore: rebuild chromium/gpu_notify_when_dxdiag_request_fails.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/ui_gtk_public_header.patch manually
no code changes
* chore: rebuild chromium/web_contents.patch with import-patches -3
Mechanical only; no code changes
* chore: remove v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2763874
This patch has been merged upstream
* chore: export patches
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785841
SkColorFromColorId() no longer takes theme, scheme args
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2772143
Change new calls to GetDarkSchemeColor to fit our patched call signature
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_ in our mojom
* chore: update chromium/frame_host_manager.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update chromium/revert_remove_contentrendererclient_shouldfork.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2755314
Upstream has removed `history_list_length_` which we were comparing to 0
to calculate our `is_initial_navigation` bool when calling ShouldFork().
ShouldFork() is ours and none of the code paths actually use that param,
so this commit removes it altogether.
* chore: update permissions_to_register
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2789074
Replace all uses of APIPermission::ID enum with Mojo type
* refactor: update return type of PreMainMessageLoopRun()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
Used to return void; now returns an int errorcode.
Note: 2725153 also has some nice doc updates about Browser's "stages"
* refactor: sync ElectronBrowserMainParts to MainParts changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
RunMainMessageLoopParts has been replaced with WillRunMainMessageLoop
so `BrowserMainLoop::result_code_` is no longer available to us for our
exit_code_ pointer.
This variable held a dual role: (1) of course, hold the exit code, but
also (2) was a nullptr before the message loop was ready, indicating to
anyone calling SetExitCode() that we were still in startup and could
just exit() without any extra steps. exit_code_ still fulfills these two
roles but is now a base::Optional.
* chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
BrowserMainParts::BrowsePreDefaultMainMesssageLoopRun() has been
removed; move that work to the new WillRunMainMessageLoop().
* refactor: stop using CallbackList; it has been removed.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785973
* refactor: update use of threadpools.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2773408
The upstream code is still in flux (e.g. reverts and re-lands) but the
tl;dr for this commit is (1) include thread_pool.h if you're using it
and (2) don't instantiate pools directly.
* refactor: remove routing_id from CreateLoaderAndStart
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
NB: One logic branch in ProxyingURLLoaderFactory::CreateLoaderAndStart
calls std::make_unique<InProgressRequest>, which needs a routing_id.
This PR uses the member field `routing_id_` since there's no longer one
being passed into CreateLoaderAndStart.
* refactor: sync to upstream ParittionOptions churn
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
PartitionOptions' enums have changed.
* refactor: update Manifest::Location usage
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
tldr: s/Manifest::FOO/ManifestLocation::kFoo/
* chore: bump chromium in DEPS to 91.0.4465.0
* update patches
* refactor: update extensions::Manifest to upstream
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
- extensions::Manifest::COMPONENT
+ extensions::mojom::ManifestLocation::kExternalComponent
* refactor: sync with upstream UrlInfo ctor changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update invocation of convert_protocol_to_json.py
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2792623
python3 is being used in parts of the upstream build, but the copy of
convert_protocol_to_json.py invoked in v8/third_party/inspector_protocol
is not python3-friendly. Node has a py2+3-friendly version of it in its
tools directory, so call it instead.
* chore: use extensions::mojom::APIPermissionID
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791122
tldr:
- extensions::APIPermission::kFoo
+ extensions::mojom::APIPermissionID::kFoo
* chore: Remove support for TLS1.0/1.1 in SSLVersionMin policy
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2765737
Remove TLS v1.0 & 1.1 from our SSLProtocolVersionFromString() function.
This is the same change made upstream at
https://chromium-review.googlesource.com/c/chromium/src/+/2765737/8/chrome/browser/ssl/ssl_config_service_manager_pref.cc
* fixup! chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
* chore: Use IDType for permission change subscriptions.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791431
tldr: {Subscribe,Unsubscribe}PermissionStatusChange's tag type used to
be an int; now it's the new SubscriptionId type (which is an IdType64).
* chore: sync PowerMonitor code to upstream refactor
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2752635
tldr: PowerMonitor has been split into PowerStateObserver,
PowerSuspendObserver, and PowerThermalObserver to reduce number of tasks
posted to consumers who only need notifications for one of those things
instead of all of them.
* chore: use PartitionOptions's new Cookies field
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
* Revert "refactor: remove routing_id from CreateLoaderAndStart"
This reverts commit 8c9773b87a3c84f9073a47089eb2b6889d745245.
8c9773b was only a partial fix; reverting to start & try again.
* update patches
* chore: bump chromium in DEPS to 91.0.4466.0
* chore: update chromium/accelerator.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2795472
tldr: sync patch with upstream renamed variable & macro names.
* chore: update chromium/gtk_visibility.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796200
tldr: no code changes; just updating the diff to apply cleanly.
note: ooh upstream Wayland hacking!
* chore: update chromium/picture-in-picture.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710023
tldr: no code changes; just updating the diff to apply cleanly.
* chore: update chromium/worker_feat_add_hook_to_notify_script_ready.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2775573
tldr: no code changes; just updating the diff to apply cleanly.
* chore: export_all_patches
* chore: update chromium/feat_add_set_theme_source_to_allow_apps_to.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796511
tldr: NotifyObservers has been renamed to NotifyOnNativeThemeUpdated,
so update the invocation in our patch.
* chore: update ElectronBrowserClient w/upstream API
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797454
tldr: GetDevToolsManagerDelegate() was returning an owned raw pointer.
Replaced it with CreateDevToolsManagerDelegate() which uses unique_ptr<>.
* chore: handle new content::PermissionType::FILE_HANDLING in toV8()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762201
`file-handling` string confirmed in https://chromium-review.googlesource.com/c/chromium/src/+/2762201/18/chrome/browser/ui/webui/settings/site_settings_helper.cc
* refactor: remove routing_id from CreateLoaderAndStart pt 1
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
Part 1: the easiest ones
* 2796724: Support Python3
https://chromium-review.googlesource.com/c/infra/luci/python-adb/+/2796724
* chore: bump chromium in DEPS to 91.0.4468.0
* 2668974: WebShare: Implement SharingServicePicker
https://chromium-review.googlesource.com/c/chromium/src/+/2668974
* 2802766: Apply modernize-make-unique to media/
https://chromium-review.googlesource.com/c/chromium/src/+/2802766
* 2802823: Apply modernize-make-unique to gpu/
https://chromium-review.googlesource.com/c/chromium/src/+/2802823
* 2803041: Apply modernize-make-unique to remaining files
https://chromium-review.googlesource.com/c/chromium/src/+/2803041
* 2798873: Convert GtkKeyBindingsHandler build checks to runtime checks
https://chromium-review.googlesource.com/c/chromium/src/+/2798873
* 2733595: [ch-r] Parse ACCEPT_CH H2/3 frame and restart with new headers if needed
https://chromium-review.googlesource.com/c/chromium/src/+/2733595
* chore: update patch indices
* 2795107: Remove unused PermissionRequest IDs.
https://chromium-review.googlesource.com/c/chromium/src/+/2795107
* chore: bump chromium in DEPS to 91.0.4469.0
* chore: fixup patch indices
* chore: bump chromium in DEPS to 91.0.4469.5
* PiP 1.5: Add microphone, camera, and hang up buttons to the PiP window
https://chromium-review.googlesource.com/c/chromium/src/+/2710023
* fixup! refactor: remove routing_id from CreateLoaderAndStart
* refactor: use URLLoaderNetworkServiceObserver for auth requests from SimpleURLLoader
* fixup! chore: fixup patch indices
* 2724817: Expand scope of wasm-eval to all URLs
https://chromium-review.googlesource.com/c/chromium/src/+/2724817
* Fixup patch after rebase
* chore: bump chromium in DEPS to 91.0.4472.0
* 2797341: [ozone/x11] Enabled the global shortcut listener.
https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* 2805553: Reland Add GTK ColorMixers to ColorPipeline P1
https://chromium-review.googlesource.com/c/chromium/src/+/2805553
* 2804366: PiP 1.5: Label back to tab button with origin and center it
https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* 2784730: Fix crash on AX mode change in NativeViewHost without a Widget
https://chromium-review.googlesource.com/c/chromium/src/+/2784730
* chore: update patch indices
* 2810174: Add PdfAnnotationsEnabled policy.
https://chromium-review.googlesource.com/c/chromium/src/+/2810174
* 2807829: Allow capturers to indicate if they want a WakeLock or not.
https://chromium-review.googlesource.com/c/chromium/src/+/2807829
* chore: bump chromium in DEPS to 92.0.4473.0
* chore: bump chromium in DEPS to 92.0.4474.0
* chore: bump chromium in DEPS to 92.0.4475.0
* chore: update patches
* chore: updates patches
* chore: update is_media_key patch to handle new ozone impl
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* fix: ExecuteJavascript requests now need to be flagged as non-bf-aware
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2787195
* chore: icon_util_x11 is now icon_util_linux
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791362
* build: update sysroots
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2628496
* build: fix missing symbols on linux build
* use_ozone and use_x11 are not exclusive
* new button view to build for pip
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* chore: fix broken gtk_util color patch
* chore: remove patch conflict
* build: update linux manifests
* chore: build bttlb on all platforms for pip
* chore: add thread_pool include for views delegate win
* chore: fix lint
* chore: add node patches for V8 changes
* build: add missing base include on windows
* fix: update frame host manager patch for new state transitions
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2714464
* chore: update windows zip manifests
* chore: update mac zip manifests
* chore: fix patch linting
* refactor: implement missing URLLoaderNetworkServiceObserver methods
It is against The Mojo Rules to leave hanging callbacks. These always
have to be called.
Refs: https://github.com/electron/electron/commit/186528aab9f8e29d658f07d220bb7f627980edda
* spec: fix locale test on local linux
* fix: pass the exit code correctly in new PreMainMessageLoopRun
Refs: https://github.com/electron/electron/commit/2622e91c4493ceb032e2f80cb484885bb8f97475
* fix: ensure we early-exit when request_handler_ is not provided
Refs: https://github.com/electron/electron/commit/93077afbfb6db248a0c0cc447d7ad2c9ccfda1d5
* fix: strongly set result_code in the BrowserMainLoop
* fix: invalid usage of non-targetted PostTask
You must always either use a host threadpool or specify a target
thread. In this case we did neither after this refactor.
Refs: https://github.com/electron/electron/pull/28462/commits/4e33ee0ad35a710bd34641cb0376bdee6aea2d1f
* chore: fix gn check
* chore: remove stray .rej files in patch
* chore: add mojo error code to url loader failure
* build: ensure CI is truthy in arm test env
* fix: handle windowCaptureMacV2 being enabled when fetching media source id
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2709931
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-15 17:44:35 +00:00
|
|
|
promise.RejectWithErrorMessage("mojo result not ok: " +
|
2024-01-24 22:43:31 +00:00
|
|
|
base::NumberToString(result));
|
2019-11-27 01:01:13 +00:00
|
|
|
Finished();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(nornagon): accept a net error here to allow the data provider to
|
|
|
|
// cancel the request with an error.
|
|
|
|
void Done() {
|
|
|
|
if (size_callback_) {
|
|
|
|
std::move(size_callback_).Run(net::OK, bytes_written_);
|
|
|
|
Finished();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Finished() {
|
|
|
|
body_func_.Reset();
|
|
|
|
data_producer_.reset();
|
2020-06-03 18:04:30 +00:00
|
|
|
receiver_.reset();
|
|
|
|
size_callback_.Reset();
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
|
2024-01-04 21:20:37 +00:00
|
|
|
SEQUENCE_CHECKER(sequence_checker_);
|
2019-11-27 01:01:13 +00:00
|
|
|
GetSizeCallback size_callback_;
|
|
|
|
mojo::Receiver<network::mojom::ChunkedDataPipeGetter> receiver_{this};
|
|
|
|
std::unique_ptr<mojo::DataPipeProducer> data_producer_;
|
|
|
|
bool is_writing_ = false;
|
|
|
|
uint64_t bytes_written_ = 0;
|
|
|
|
|
2023-05-11 20:07:39 +00:00
|
|
|
raw_ptr<v8::Isolate> isolate_;
|
2019-11-27 01:01:13 +00:00
|
|
|
v8::Global<v8::Function> body_func_;
|
|
|
|
};
|
|
|
|
|
|
|
|
gin::WrapperInfo JSChunkedDataPipeGetter::kWrapperInfo = {
|
|
|
|
gin::kEmbedderNativeGin};
|
|
|
|
|
|
|
|
const net::NetworkTrafficAnnotationTag kTrafficAnnotation =
|
|
|
|
net::DefineNetworkTrafficAnnotation("electron_net_module", R"(
|
|
|
|
semantics {
|
|
|
|
sender: "Electron Net module"
|
|
|
|
description:
|
|
|
|
"Issue HTTP/HTTPS requests using Chromium's native networking "
|
|
|
|
"library."
|
|
|
|
trigger: "Using the Net module"
|
|
|
|
data: "Anything the user wants to send."
|
|
|
|
destination: OTHER
|
|
|
|
}
|
|
|
|
policy {
|
|
|
|
cookies_allowed: YES
|
|
|
|
cookies_store: "user"
|
|
|
|
setting: "This feature cannot be disabled."
|
|
|
|
})");
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2020-03-23 20:09:45 +00:00
|
|
|
gin::WrapperInfo SimpleURLLoaderWrapper::kWrapperInfo = {
|
|
|
|
gin::kEmbedderNativeGin};
|
|
|
|
|
2019-11-27 01:01:13 +00:00
|
|
|
SimpleURLLoaderWrapper::SimpleURLLoaderWrapper(
|
2023-03-02 23:47:45 +00:00
|
|
|
ElectronBrowserContext* browser_context,
|
2019-11-27 01:01:13 +00:00
|
|
|
std::unique_ptr<network::ResourceRequest> request,
|
2023-03-02 23:47:45 +00:00
|
|
|
int options)
|
|
|
|
: browser_context_(browser_context),
|
|
|
|
request_options_(options),
|
|
|
|
request_(std::move(request)) {
|
2024-01-04 21:20:37 +00:00
|
|
|
DETACH_FROM_SEQUENCE(sequence_checker_);
|
2023-03-02 23:47:45 +00:00
|
|
|
if (!request_->trusted_params)
|
|
|
|
request_->trusted_params = network::ResourceRequest::TrustedParams();
|
2024-08-14 02:36:47 +00:00
|
|
|
bool create_network_observer = true;
|
|
|
|
if (electron::IsUtilityProcess()) {
|
|
|
|
create_network_observer =
|
|
|
|
!URLLoaderBundle::GetInstance()
|
|
|
|
->ShouldUseNetworkObserverfromURLLoaderFactory();
|
|
|
|
}
|
|
|
|
if (create_network_observer) {
|
|
|
|
mojo::PendingRemote<network::mojom::URLLoaderNetworkServiceObserver>
|
|
|
|
url_loader_network_observer_remote;
|
|
|
|
url_loader_network_observer_receivers_.Add(
|
|
|
|
this,
|
|
|
|
url_loader_network_observer_remote.InitWithNewPipeAndPassReceiver());
|
|
|
|
request_->trusted_params->url_loader_network_observer =
|
|
|
|
std::move(url_loader_network_observer_remote);
|
|
|
|
}
|
2021-08-24 00:52:17 +00:00
|
|
|
// Chromium filters headers using browser rules, while for net module we have
|
2021-09-06 07:33:10 +00:00
|
|
|
// every header passed. The following setting will allow us to capture the
|
2021-08-24 00:52:17 +00:00
|
|
|
// raw headers in the URLLoader.
|
2023-03-02 23:47:45 +00:00
|
|
|
request_->trusted_params->report_raw_headers = true;
|
|
|
|
Start();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SimpleURLLoaderWrapper::Start() {
|
|
|
|
// Make a copy of the request; we'll need to re-send it if we get redirected.
|
|
|
|
auto request = std::make_unique<network::ResourceRequest>();
|
|
|
|
*request = *request_;
|
|
|
|
|
|
|
|
// SimpleURLLoader has no way to set a data pipe as the request body, which
|
|
|
|
// we need to do for streaming upload, so instead we "cheat" and pretend to
|
|
|
|
// SimpleURLLoader like there is no request_body when we construct it. Later,
|
|
|
|
// we will sneakily put the request_body back while it isn't looking.
|
|
|
|
scoped_refptr<network::ResourceRequestBody> request_body =
|
|
|
|
std::move(request->request_body);
|
|
|
|
|
|
|
|
network::ResourceRequest* request_ref = request.get();
|
2019-11-27 01:01:13 +00:00
|
|
|
loader_ =
|
|
|
|
network::SimpleURLLoader::Create(std::move(request), kTrafficAnnotation);
|
2023-03-02 23:47:45 +00:00
|
|
|
|
|
|
|
if (request_body)
|
2019-11-27 01:01:13 +00:00
|
|
|
request_ref->request_body = std::move(request_body);
|
|
|
|
|
|
|
|
loader_->SetAllowHttpErrorResults(true);
|
2023-03-02 23:47:45 +00:00
|
|
|
loader_->SetURLLoaderFactoryOptions(request_options_);
|
2019-11-27 01:01:13 +00:00
|
|
|
loader_->SetOnResponseStartedCallback(base::BindOnce(
|
|
|
|
&SimpleURLLoaderWrapper::OnResponseStarted, base::Unretained(this)));
|
|
|
|
loader_->SetOnRedirectCallback(base::BindRepeating(
|
|
|
|
&SimpleURLLoaderWrapper::OnRedirect, base::Unretained(this)));
|
|
|
|
loader_->SetOnUploadProgressCallback(base::BindRepeating(
|
|
|
|
&SimpleURLLoaderWrapper::OnUploadProgress, base::Unretained(this)));
|
|
|
|
loader_->SetOnDownloadProgressCallback(base::BindRepeating(
|
|
|
|
&SimpleURLLoaderWrapper::OnDownloadProgress, base::Unretained(this)));
|
|
|
|
|
2023-03-02 23:47:45 +00:00
|
|
|
url_loader_factory_ = GetURLLoaderFactoryForURL(request_ref->url);
|
|
|
|
loader_->DownloadAsStream(url_loader_factory_.get(), this);
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SimpleURLLoaderWrapper::Pin() {
|
2020-03-23 20:09:45 +00:00
|
|
|
// Prevent ourselves from being GC'd until the request is complete. Must be
|
|
|
|
// called after gin::CreateHandle, otherwise the wrapper isn't initialized.
|
2020-06-22 16:35:24 +00:00
|
|
|
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
2020-03-23 20:09:45 +00:00
|
|
|
pinned_wrapper_.Reset(isolate, GetWrapper(isolate).ToLocalChecked());
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SimpleURLLoaderWrapper::PinBodyGetter(v8::Local<v8::Value> body_getter) {
|
2021-03-29 10:45:08 +00:00
|
|
|
pinned_chunk_pipe_getter_.Reset(JavascriptEnvironment::GetIsolate(),
|
|
|
|
body_getter);
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
|
chore: bump chromium to 92.0.4475.0 (master) (#28462)
* chore: bump chromium in DEPS to 91.0.4464.0
* chore: rebuild chromium/dcheck.patch with import-patches -3
Mechanical only; no code changes
* chore: remove content_browser_main_loop.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
The function being patched (BrowserMainLoop::MainMessageLoopRun()) no
longer exists.
NB: if removing this introduces regressions the likely fix will be to
add a similar patch for ShellBrowserMainParts::WillRunMainMessageLoop()
which has similar code and was added at the same time this was removed.
* chore: rebuild chromium/put_back_deleted_colors_for_autofill.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/disable_color_correct_rendering.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/eat_allow_disabling_blink_scheduler_throttling_per_renderview.patch with patch
Mechanical only; no code changes
* chore: rebuild chromium/gpu_notify_when_dxdiag_request_fails.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/ui_gtk_public_header.patch manually
no code changes
* chore: rebuild chromium/web_contents.patch with import-patches -3
Mechanical only; no code changes
* chore: remove v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2763874
This patch has been merged upstream
* chore: export patches
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785841
SkColorFromColorId() no longer takes theme, scheme args
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2772143
Change new calls to GetDarkSchemeColor to fit our patched call signature
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_ in our mojom
* chore: update chromium/frame_host_manager.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update chromium/revert_remove_contentrendererclient_shouldfork.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2755314
Upstream has removed `history_list_length_` which we were comparing to 0
to calculate our `is_initial_navigation` bool when calling ShouldFork().
ShouldFork() is ours and none of the code paths actually use that param,
so this commit removes it altogether.
* chore: update permissions_to_register
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2789074
Replace all uses of APIPermission::ID enum with Mojo type
* refactor: update return type of PreMainMessageLoopRun()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
Used to return void; now returns an int errorcode.
Note: 2725153 also has some nice doc updates about Browser's "stages"
* refactor: sync ElectronBrowserMainParts to MainParts changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
RunMainMessageLoopParts has been replaced with WillRunMainMessageLoop
so `BrowserMainLoop::result_code_` is no longer available to us for our
exit_code_ pointer.
This variable held a dual role: (1) of course, hold the exit code, but
also (2) was a nullptr before the message loop was ready, indicating to
anyone calling SetExitCode() that we were still in startup and could
just exit() without any extra steps. exit_code_ still fulfills these two
roles but is now a base::Optional.
* chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
BrowserMainParts::BrowsePreDefaultMainMesssageLoopRun() has been
removed; move that work to the new WillRunMainMessageLoop().
* refactor: stop using CallbackList; it has been removed.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785973
* refactor: update use of threadpools.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2773408
The upstream code is still in flux (e.g. reverts and re-lands) but the
tl;dr for this commit is (1) include thread_pool.h if you're using it
and (2) don't instantiate pools directly.
* refactor: remove routing_id from CreateLoaderAndStart
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
NB: One logic branch in ProxyingURLLoaderFactory::CreateLoaderAndStart
calls std::make_unique<InProgressRequest>, which needs a routing_id.
This PR uses the member field `routing_id_` since there's no longer one
being passed into CreateLoaderAndStart.
* refactor: sync to upstream ParittionOptions churn
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
PartitionOptions' enums have changed.
* refactor: update Manifest::Location usage
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
tldr: s/Manifest::FOO/ManifestLocation::kFoo/
* chore: bump chromium in DEPS to 91.0.4465.0
* update patches
* refactor: update extensions::Manifest to upstream
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
- extensions::Manifest::COMPONENT
+ extensions::mojom::ManifestLocation::kExternalComponent
* refactor: sync with upstream UrlInfo ctor changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update invocation of convert_protocol_to_json.py
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2792623
python3 is being used in parts of the upstream build, but the copy of
convert_protocol_to_json.py invoked in v8/third_party/inspector_protocol
is not python3-friendly. Node has a py2+3-friendly version of it in its
tools directory, so call it instead.
* chore: use extensions::mojom::APIPermissionID
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791122
tldr:
- extensions::APIPermission::kFoo
+ extensions::mojom::APIPermissionID::kFoo
* chore: Remove support for TLS1.0/1.1 in SSLVersionMin policy
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2765737
Remove TLS v1.0 & 1.1 from our SSLProtocolVersionFromString() function.
This is the same change made upstream at
https://chromium-review.googlesource.com/c/chromium/src/+/2765737/8/chrome/browser/ssl/ssl_config_service_manager_pref.cc
* fixup! chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
* chore: Use IDType for permission change subscriptions.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791431
tldr: {Subscribe,Unsubscribe}PermissionStatusChange's tag type used to
be an int; now it's the new SubscriptionId type (which is an IdType64).
* chore: sync PowerMonitor code to upstream refactor
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2752635
tldr: PowerMonitor has been split into PowerStateObserver,
PowerSuspendObserver, and PowerThermalObserver to reduce number of tasks
posted to consumers who only need notifications for one of those things
instead of all of them.
* chore: use PartitionOptions's new Cookies field
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
* Revert "refactor: remove routing_id from CreateLoaderAndStart"
This reverts commit 8c9773b87a3c84f9073a47089eb2b6889d745245.
8c9773b was only a partial fix; reverting to start & try again.
* update patches
* chore: bump chromium in DEPS to 91.0.4466.0
* chore: update chromium/accelerator.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2795472
tldr: sync patch with upstream renamed variable & macro names.
* chore: update chromium/gtk_visibility.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796200
tldr: no code changes; just updating the diff to apply cleanly.
note: ooh upstream Wayland hacking!
* chore: update chromium/picture-in-picture.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710023
tldr: no code changes; just updating the diff to apply cleanly.
* chore: update chromium/worker_feat_add_hook_to_notify_script_ready.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2775573
tldr: no code changes; just updating the diff to apply cleanly.
* chore: export_all_patches
* chore: update chromium/feat_add_set_theme_source_to_allow_apps_to.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796511
tldr: NotifyObservers has been renamed to NotifyOnNativeThemeUpdated,
so update the invocation in our patch.
* chore: update ElectronBrowserClient w/upstream API
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797454
tldr: GetDevToolsManagerDelegate() was returning an owned raw pointer.
Replaced it with CreateDevToolsManagerDelegate() which uses unique_ptr<>.
* chore: handle new content::PermissionType::FILE_HANDLING in toV8()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762201
`file-handling` string confirmed in https://chromium-review.googlesource.com/c/chromium/src/+/2762201/18/chrome/browser/ui/webui/settings/site_settings_helper.cc
* refactor: remove routing_id from CreateLoaderAndStart pt 1
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
Part 1: the easiest ones
* 2796724: Support Python3
https://chromium-review.googlesource.com/c/infra/luci/python-adb/+/2796724
* chore: bump chromium in DEPS to 91.0.4468.0
* 2668974: WebShare: Implement SharingServicePicker
https://chromium-review.googlesource.com/c/chromium/src/+/2668974
* 2802766: Apply modernize-make-unique to media/
https://chromium-review.googlesource.com/c/chromium/src/+/2802766
* 2802823: Apply modernize-make-unique to gpu/
https://chromium-review.googlesource.com/c/chromium/src/+/2802823
* 2803041: Apply modernize-make-unique to remaining files
https://chromium-review.googlesource.com/c/chromium/src/+/2803041
* 2798873: Convert GtkKeyBindingsHandler build checks to runtime checks
https://chromium-review.googlesource.com/c/chromium/src/+/2798873
* 2733595: [ch-r] Parse ACCEPT_CH H2/3 frame and restart with new headers if needed
https://chromium-review.googlesource.com/c/chromium/src/+/2733595
* chore: update patch indices
* 2795107: Remove unused PermissionRequest IDs.
https://chromium-review.googlesource.com/c/chromium/src/+/2795107
* chore: bump chromium in DEPS to 91.0.4469.0
* chore: fixup patch indices
* chore: bump chromium in DEPS to 91.0.4469.5
* PiP 1.5: Add microphone, camera, and hang up buttons to the PiP window
https://chromium-review.googlesource.com/c/chromium/src/+/2710023
* fixup! refactor: remove routing_id from CreateLoaderAndStart
* refactor: use URLLoaderNetworkServiceObserver for auth requests from SimpleURLLoader
* fixup! chore: fixup patch indices
* 2724817: Expand scope of wasm-eval to all URLs
https://chromium-review.googlesource.com/c/chromium/src/+/2724817
* Fixup patch after rebase
* chore: bump chromium in DEPS to 91.0.4472.0
* 2797341: [ozone/x11] Enabled the global shortcut listener.
https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* 2805553: Reland Add GTK ColorMixers to ColorPipeline P1
https://chromium-review.googlesource.com/c/chromium/src/+/2805553
* 2804366: PiP 1.5: Label back to tab button with origin and center it
https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* 2784730: Fix crash on AX mode change in NativeViewHost without a Widget
https://chromium-review.googlesource.com/c/chromium/src/+/2784730
* chore: update patch indices
* 2810174: Add PdfAnnotationsEnabled policy.
https://chromium-review.googlesource.com/c/chromium/src/+/2810174
* 2807829: Allow capturers to indicate if they want a WakeLock or not.
https://chromium-review.googlesource.com/c/chromium/src/+/2807829
* chore: bump chromium in DEPS to 92.0.4473.0
* chore: bump chromium in DEPS to 92.0.4474.0
* chore: bump chromium in DEPS to 92.0.4475.0
* chore: update patches
* chore: updates patches
* chore: update is_media_key patch to handle new ozone impl
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* fix: ExecuteJavascript requests now need to be flagged as non-bf-aware
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2787195
* chore: icon_util_x11 is now icon_util_linux
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791362
* build: update sysroots
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2628496
* build: fix missing symbols on linux build
* use_ozone and use_x11 are not exclusive
* new button view to build for pip
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* chore: fix broken gtk_util color patch
* chore: remove patch conflict
* build: update linux manifests
* chore: build bttlb on all platforms for pip
* chore: add thread_pool include for views delegate win
* chore: fix lint
* chore: add node patches for V8 changes
* build: add missing base include on windows
* fix: update frame host manager patch for new state transitions
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2714464
* chore: update windows zip manifests
* chore: update mac zip manifests
* chore: fix patch linting
* refactor: implement missing URLLoaderNetworkServiceObserver methods
It is against The Mojo Rules to leave hanging callbacks. These always
have to be called.
Refs: https://github.com/electron/electron/commit/186528aab9f8e29d658f07d220bb7f627980edda
* spec: fix locale test on local linux
* fix: pass the exit code correctly in new PreMainMessageLoopRun
Refs: https://github.com/electron/electron/commit/2622e91c4493ceb032e2f80cb484885bb8f97475
* fix: ensure we early-exit when request_handler_ is not provided
Refs: https://github.com/electron/electron/commit/93077afbfb6db248a0c0cc447d7ad2c9ccfda1d5
* fix: strongly set result_code in the BrowserMainLoop
* fix: invalid usage of non-targetted PostTask
You must always either use a host threadpool or specify a target
thread. In this case we did neither after this refactor.
Refs: https://github.com/electron/electron/pull/28462/commits/4e33ee0ad35a710bd34641cb0376bdee6aea2d1f
* chore: fix gn check
* chore: remove stray .rej files in patch
* chore: add mojo error code to url loader failure
* build: ensure CI is truthy in arm test env
* fix: handle windowCaptureMacV2 being enabled when fetching media source id
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2709931
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-15 17:44:35 +00:00
|
|
|
SimpleURLLoaderWrapper::~SimpleURLLoaderWrapper() = default;
|
2019-11-27 01:01:13 +00:00
|
|
|
|
|
|
|
void SimpleURLLoaderWrapper::OnAuthRequired(
|
2024-01-10 22:23:35 +00:00
|
|
|
const std::optional<base::UnguessableToken>& window_id,
|
chore: bump chromium to 128.0.6611.0 (main) (#42779)
* chore: bump chromium in DEPS to 128.0.6577.0
* chore: bump chromium in DEPS to 128.0.6579.0
* 5675706: Reland "Reland "Reland "Reland "Add toolchains without PartitionAlloc-Everywhere for dump_syms et al""""
https://chromium-review.googlesource.com/c/chromium/src/+/5675706
* 5668597: [PDF Ink Signatures] Prompt download menu on save when there are edits
https://chromium-review.googlesource.com/c/chromium/src/+/5668597
* 5677014: Reland "Pull data_sharing_sdk from CIPD"
https://chromium-review.googlesource.com/c/chromium/src/+/5677014
* chore: fixup patch indices
* chore: bump chromium in DEPS to 128.0.6581.0
* chore: bump chromium in DEPS to 128.0.6583.0
* update patches
* 5455480: [Extensions] Allow service worker requests to continue without a cert
https://chromium-review.googlesource.com/c/chromium/src/+/5455480
* try to get some debugging output from script/push-patch.js
* chore: bump chromium in DEPS to 128.0.6585.0
* chore: bump chromium in DEPS to 128.0.6587.0
* update patches
* chore: bump chromium in DEPS to 128.0.6589.0
* more patch work
* maybe over here?
* chore: update patches
* 5673207: [HTTPS Upgrades] Disable in captive portal login webview
https://chromium-review.googlesource.com/c/chromium/src/+/5673207
* 5636785: Extensions: WAR: manifest.json's use_dynamic_url requires a dynamic url
https://chromium-review.googlesource.com/c/chromium/src/+/5636785
* chore: bump chromium in DEPS to 128.0.6591.0
* 5665458: Trigger WN2 page when feature is enabled
https://chromium-review.googlesource.com/c/chromium/src/+/5665458
* update patches
* chore: bump chromium in DEPS to 128.0.6593.0
* chore: bump chromium in DEPS to 128.0.6595.0
* chore: bump chromium in DEPS to 128.0.6597.0
* (patch update) 5694586: [compile hints] Remove the usage of v8::Isolate::SetJavaScriptCompileHintsMagicEnabledCallback API
https://chromium-review.googlesource.com/c/chromium/src/+/5694586
* update patches
* 5691287: Reland "Change blink::WebKeyboardEvent to use std::array in is members"
https://chromium-review.googlesource.com/c/chromium/src/+/5691287
The code changed here is modeled after code in `content/renderer/pepper/event_conversion.cc` that was also modified in this CL, so I took the same approach.
* 5529018: Cleanup EnableWebHidOnExtensionServiceWorker flag
https://chromium-review.googlesource.com/c/chromium/src/+/5529018
* 5526324: [Code Health] Add deprecation comment for base::SupportsWeakPtr.
https://chromium-review.googlesource.com/c/chromium/src/+/5526324
Note that this CL actually does make `SupportsWeakPtr` strictly restricted to existing implementations, no new ones. We could add a patch to add ourselves to this list, but it looks like we'll have to refactor this anyways in the near future. Since the refactor seems straightforward, let's try that first.
* chore: bump chromium in DEPS to 128.0.6598.0
* chore: update patches
* 5704737: Rename ExclusiveAccessContext::GetActiveWebContents to avoid conflict
https://chromium-review.googlesource.com/c/chromium/src/+/5704737
* chore: bump chromium in DEPS to 128.0.6601.0
* chore: update patches
* Add `base::StringPiece` header includes
Chromium is working on replacing `base::StringPiece` with `std::string_view`. (See the Chromium Bug below.) They're currently running mass codemods (across many multiple changes) to replace uses of `StringPiece` with `string_view`, including removing the header include for `StringPiece` in those files. This cascades down to our files that were implicitly depending on those includes through some other include.
They're on track to eventually deprecate and remove `StringPiece` so our code should be converted, but that can be done as an upgrade follow-up task. For now, adding the header back to files that need it should suffice for minimal upgrade changes.
Chromium Bug: https://issues.chromium.org/issues/40506050
* 5702737: GlobalRequestID: Avoid unwanted inlining and narrowing int conversions
https://chromium-review.googlesource.com/c/chromium/src/+/5702737
contender for smallest commit 2024
* 5706534: Rename GlobalFeatures to GlobalDesktopFeatures.
https://chromium-review.googlesource.com/c/chromium/src/+/5706534
* 5691321: ui: remove params variants of SelectFile listener functions
https://chromium-review.googlesource.com/c/chromium/src/+/5691321
* 5714949: [Extensions] Display re-enable dialog for MV2 disabled stage
https://chromium-review.googlesource.com/c/chromium/src/+/5714949
* chore: update libc++ filenames
* patch: disable scope reuse & associated dchecks in v8 (hopefully temp, upgrade follow-up)
* fixup! Add `base::StringPiece` header includes
* update MAS patch
5710330: Add crash keys to debug NativeWidgetMacNSWindowBorderlessFrame exception
https://chromium-review.googlesource.com/c/chromium/src/+/5710330
* chore: bump chromium in DEPS to 128.0.6603.0
* chore: update patches
* 5713258: Reland "Preparation for decoupling creation/initialization of context"
https://chromium-review.googlesource.com/c/chromium/src/+/5713258
When destroying a context, it must already be shutdown, and this change enforces it with a new CHECK.
We were overriding `BrowserContextKeyedServiceFactory::BrowserContextShutdown` with an empty implementation, which differed from the default implementation that notifies the `KeyedServiceFactory` that the context has shutdown. Since we were missing this notification, the CHECK would later trip when the service was being destoryed because it was not registered as shutdown when it was shutdown.
* chore: bump chromium in DEPS to 128.0.6605.2
* chore: update patches
* refactor: linux open/save dialog patch
Our existing implementation was relying on an opaque `void* params` parameter that was passed through `ui::SelectFileDialog`.
Recently, that parameter has been getting removed:
- 5691321: ui: remove params variants of SelectFile listener functions | https://chromium-review.googlesource.com/c/chromium/src/+/5691321
- 5709097: ui: remove SelectFileDialog impl params | https://chromium-review.googlesource.com/c/chromium/src/+/5709097
- https://issues.chromium.org/issues/340178601 "reconsider SelectFileDialog"
This restructures the patch to work with mostly the same mechanics, but directly on the `ui::SelectFileDialog` object. This nets us some wins in terms of a smaller patch.
* 5713262: DevTools UI binding AIDA client event returns response
https://chromium-review.googlesource.com/c/chromium/src/+/5713262
* fixup! refactor: linux open/save dialog patch
* chore: bump chromium in DEPS to 128.0.6606.0
* chore: update patches
* fixup! refactor: linux open/save dialog patch
* chore: bump chromium in DEPS to 128.0.6607.0
* chore: update printing.patch
Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5722937
* fix: pwd error in electron-test, nan-test
fix: unshallow depot_tools before 3-way apply
* chore: e patches all
* fixup! fix: pwd error in electron-test, nan-test
* chore: bump chromium in DEPS to 128.0.6609.0
* chore: bump chromium in DEPS to 128.0.6611.0
* chore: update patches
* chore: update libcxx filenames
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Alice Zhao <alice@makenotion.com>
2024-07-23 15:59:44 +00:00
|
|
|
int32_t request_id,
|
2019-11-27 01:01:13 +00:00
|
|
|
const GURL& url,
|
|
|
|
bool first_auth_attempt,
|
chore: bump chromium to 92.0.4475.0 (master) (#28462)
* chore: bump chromium in DEPS to 91.0.4464.0
* chore: rebuild chromium/dcheck.patch with import-patches -3
Mechanical only; no code changes
* chore: remove content_browser_main_loop.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
The function being patched (BrowserMainLoop::MainMessageLoopRun()) no
longer exists.
NB: if removing this introduces regressions the likely fix will be to
add a similar patch for ShellBrowserMainParts::WillRunMainMessageLoop()
which has similar code and was added at the same time this was removed.
* chore: rebuild chromium/put_back_deleted_colors_for_autofill.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/disable_color_correct_rendering.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/eat_allow_disabling_blink_scheduler_throttling_per_renderview.patch with patch
Mechanical only; no code changes
* chore: rebuild chromium/gpu_notify_when_dxdiag_request_fails.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/ui_gtk_public_header.patch manually
no code changes
* chore: rebuild chromium/web_contents.patch with import-patches -3
Mechanical only; no code changes
* chore: remove v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2763874
This patch has been merged upstream
* chore: export patches
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785841
SkColorFromColorId() no longer takes theme, scheme args
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2772143
Change new calls to GetDarkSchemeColor to fit our patched call signature
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_ in our mojom
* chore: update chromium/frame_host_manager.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update chromium/revert_remove_contentrendererclient_shouldfork.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2755314
Upstream has removed `history_list_length_` which we were comparing to 0
to calculate our `is_initial_navigation` bool when calling ShouldFork().
ShouldFork() is ours and none of the code paths actually use that param,
so this commit removes it altogether.
* chore: update permissions_to_register
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2789074
Replace all uses of APIPermission::ID enum with Mojo type
* refactor: update return type of PreMainMessageLoopRun()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
Used to return void; now returns an int errorcode.
Note: 2725153 also has some nice doc updates about Browser's "stages"
* refactor: sync ElectronBrowserMainParts to MainParts changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
RunMainMessageLoopParts has been replaced with WillRunMainMessageLoop
so `BrowserMainLoop::result_code_` is no longer available to us for our
exit_code_ pointer.
This variable held a dual role: (1) of course, hold the exit code, but
also (2) was a nullptr before the message loop was ready, indicating to
anyone calling SetExitCode() that we were still in startup and could
just exit() without any extra steps. exit_code_ still fulfills these two
roles but is now a base::Optional.
* chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
BrowserMainParts::BrowsePreDefaultMainMesssageLoopRun() has been
removed; move that work to the new WillRunMainMessageLoop().
* refactor: stop using CallbackList; it has been removed.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785973
* refactor: update use of threadpools.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2773408
The upstream code is still in flux (e.g. reverts and re-lands) but the
tl;dr for this commit is (1) include thread_pool.h if you're using it
and (2) don't instantiate pools directly.
* refactor: remove routing_id from CreateLoaderAndStart
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
NB: One logic branch in ProxyingURLLoaderFactory::CreateLoaderAndStart
calls std::make_unique<InProgressRequest>, which needs a routing_id.
This PR uses the member field `routing_id_` since there's no longer one
being passed into CreateLoaderAndStart.
* refactor: sync to upstream ParittionOptions churn
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
PartitionOptions' enums have changed.
* refactor: update Manifest::Location usage
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
tldr: s/Manifest::FOO/ManifestLocation::kFoo/
* chore: bump chromium in DEPS to 91.0.4465.0
* update patches
* refactor: update extensions::Manifest to upstream
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
- extensions::Manifest::COMPONENT
+ extensions::mojom::ManifestLocation::kExternalComponent
* refactor: sync with upstream UrlInfo ctor changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update invocation of convert_protocol_to_json.py
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2792623
python3 is being used in parts of the upstream build, but the copy of
convert_protocol_to_json.py invoked in v8/third_party/inspector_protocol
is not python3-friendly. Node has a py2+3-friendly version of it in its
tools directory, so call it instead.
* chore: use extensions::mojom::APIPermissionID
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791122
tldr:
- extensions::APIPermission::kFoo
+ extensions::mojom::APIPermissionID::kFoo
* chore: Remove support for TLS1.0/1.1 in SSLVersionMin policy
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2765737
Remove TLS v1.0 & 1.1 from our SSLProtocolVersionFromString() function.
This is the same change made upstream at
https://chromium-review.googlesource.com/c/chromium/src/+/2765737/8/chrome/browser/ssl/ssl_config_service_manager_pref.cc
* fixup! chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
* chore: Use IDType for permission change subscriptions.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791431
tldr: {Subscribe,Unsubscribe}PermissionStatusChange's tag type used to
be an int; now it's the new SubscriptionId type (which is an IdType64).
* chore: sync PowerMonitor code to upstream refactor
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2752635
tldr: PowerMonitor has been split into PowerStateObserver,
PowerSuspendObserver, and PowerThermalObserver to reduce number of tasks
posted to consumers who only need notifications for one of those things
instead of all of them.
* chore: use PartitionOptions's new Cookies field
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
* Revert "refactor: remove routing_id from CreateLoaderAndStart"
This reverts commit 8c9773b87a3c84f9073a47089eb2b6889d745245.
8c9773b was only a partial fix; reverting to start & try again.
* update patches
* chore: bump chromium in DEPS to 91.0.4466.0
* chore: update chromium/accelerator.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2795472
tldr: sync patch with upstream renamed variable & macro names.
* chore: update chromium/gtk_visibility.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796200
tldr: no code changes; just updating the diff to apply cleanly.
note: ooh upstream Wayland hacking!
* chore: update chromium/picture-in-picture.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710023
tldr: no code changes; just updating the diff to apply cleanly.
* chore: update chromium/worker_feat_add_hook_to_notify_script_ready.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2775573
tldr: no code changes; just updating the diff to apply cleanly.
* chore: export_all_patches
* chore: update chromium/feat_add_set_theme_source_to_allow_apps_to.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796511
tldr: NotifyObservers has been renamed to NotifyOnNativeThemeUpdated,
so update the invocation in our patch.
* chore: update ElectronBrowserClient w/upstream API
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797454
tldr: GetDevToolsManagerDelegate() was returning an owned raw pointer.
Replaced it with CreateDevToolsManagerDelegate() which uses unique_ptr<>.
* chore: handle new content::PermissionType::FILE_HANDLING in toV8()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762201
`file-handling` string confirmed in https://chromium-review.googlesource.com/c/chromium/src/+/2762201/18/chrome/browser/ui/webui/settings/site_settings_helper.cc
* refactor: remove routing_id from CreateLoaderAndStart pt 1
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
Part 1: the easiest ones
* 2796724: Support Python3
https://chromium-review.googlesource.com/c/infra/luci/python-adb/+/2796724
* chore: bump chromium in DEPS to 91.0.4468.0
* 2668974: WebShare: Implement SharingServicePicker
https://chromium-review.googlesource.com/c/chromium/src/+/2668974
* 2802766: Apply modernize-make-unique to media/
https://chromium-review.googlesource.com/c/chromium/src/+/2802766
* 2802823: Apply modernize-make-unique to gpu/
https://chromium-review.googlesource.com/c/chromium/src/+/2802823
* 2803041: Apply modernize-make-unique to remaining files
https://chromium-review.googlesource.com/c/chromium/src/+/2803041
* 2798873: Convert GtkKeyBindingsHandler build checks to runtime checks
https://chromium-review.googlesource.com/c/chromium/src/+/2798873
* 2733595: [ch-r] Parse ACCEPT_CH H2/3 frame and restart with new headers if needed
https://chromium-review.googlesource.com/c/chromium/src/+/2733595
* chore: update patch indices
* 2795107: Remove unused PermissionRequest IDs.
https://chromium-review.googlesource.com/c/chromium/src/+/2795107
* chore: bump chromium in DEPS to 91.0.4469.0
* chore: fixup patch indices
* chore: bump chromium in DEPS to 91.0.4469.5
* PiP 1.5: Add microphone, camera, and hang up buttons to the PiP window
https://chromium-review.googlesource.com/c/chromium/src/+/2710023
* fixup! refactor: remove routing_id from CreateLoaderAndStart
* refactor: use URLLoaderNetworkServiceObserver for auth requests from SimpleURLLoader
* fixup! chore: fixup patch indices
* 2724817: Expand scope of wasm-eval to all URLs
https://chromium-review.googlesource.com/c/chromium/src/+/2724817
* Fixup patch after rebase
* chore: bump chromium in DEPS to 91.0.4472.0
* 2797341: [ozone/x11] Enabled the global shortcut listener.
https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* 2805553: Reland Add GTK ColorMixers to ColorPipeline P1
https://chromium-review.googlesource.com/c/chromium/src/+/2805553
* 2804366: PiP 1.5: Label back to tab button with origin and center it
https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* 2784730: Fix crash on AX mode change in NativeViewHost without a Widget
https://chromium-review.googlesource.com/c/chromium/src/+/2784730
* chore: update patch indices
* 2810174: Add PdfAnnotationsEnabled policy.
https://chromium-review.googlesource.com/c/chromium/src/+/2810174
* 2807829: Allow capturers to indicate if they want a WakeLock or not.
https://chromium-review.googlesource.com/c/chromium/src/+/2807829
* chore: bump chromium in DEPS to 92.0.4473.0
* chore: bump chromium in DEPS to 92.0.4474.0
* chore: bump chromium in DEPS to 92.0.4475.0
* chore: update patches
* chore: updates patches
* chore: update is_media_key patch to handle new ozone impl
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* fix: ExecuteJavascript requests now need to be flagged as non-bf-aware
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2787195
* chore: icon_util_x11 is now icon_util_linux
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791362
* build: update sysroots
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2628496
* build: fix missing symbols on linux build
* use_ozone and use_x11 are not exclusive
* new button view to build for pip
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* chore: fix broken gtk_util color patch
* chore: remove patch conflict
* build: update linux manifests
* chore: build bttlb on all platforms for pip
* chore: add thread_pool include for views delegate win
* chore: fix lint
* chore: add node patches for V8 changes
* build: add missing base include on windows
* fix: update frame host manager patch for new state transitions
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2714464
* chore: update windows zip manifests
* chore: update mac zip manifests
* chore: fix patch linting
* refactor: implement missing URLLoaderNetworkServiceObserver methods
It is against The Mojo Rules to leave hanging callbacks. These always
have to be called.
Refs: https://github.com/electron/electron/commit/186528aab9f8e29d658f07d220bb7f627980edda
* spec: fix locale test on local linux
* fix: pass the exit code correctly in new PreMainMessageLoopRun
Refs: https://github.com/electron/electron/commit/2622e91c4493ceb032e2f80cb484885bb8f97475
* fix: ensure we early-exit when request_handler_ is not provided
Refs: https://github.com/electron/electron/commit/93077afbfb6db248a0c0cc447d7ad2c9ccfda1d5
* fix: strongly set result_code in the BrowserMainLoop
* fix: invalid usage of non-targetted PostTask
You must always either use a host threadpool or specify a target
thread. In this case we did neither after this refactor.
Refs: https://github.com/electron/electron/pull/28462/commits/4e33ee0ad35a710bd34641cb0376bdee6aea2d1f
* chore: fix gn check
* chore: remove stray .rej files in patch
* chore: add mojo error code to url loader failure
* build: ensure CI is truthy in arm test env
* fix: handle windowCaptureMacV2 being enabled when fetching media source id
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2709931
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-15 17:44:35 +00:00
|
|
|
const net::AuthChallengeInfo& auth_info,
|
|
|
|
const scoped_refptr<net::HttpResponseHeaders>& head_headers,
|
2019-11-27 01:01:13 +00:00
|
|
|
mojo::PendingRemote<network::mojom::AuthChallengeResponder>
|
|
|
|
auth_challenge_responder) {
|
2024-01-04 21:20:37 +00:00
|
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
2019-11-27 01:01:13 +00:00
|
|
|
mojo::Remote<network::mojom::AuthChallengeResponder> auth_responder(
|
|
|
|
std::move(auth_challenge_responder));
|
|
|
|
// WeakPtr because if we're Cancel()ed while waiting for auth, and the
|
|
|
|
// network service also decides to cancel at the same time and kill this
|
|
|
|
// pipe, we might end up trying to call Cancel again on dead memory.
|
|
|
|
auth_responder.set_disconnect_handler(base::BindOnce(
|
|
|
|
&SimpleURLLoaderWrapper::Cancel, weak_factory_.GetWeakPtr()));
|
|
|
|
auto cb = base::BindOnce(
|
|
|
|
[](mojo::Remote<network::mojom::AuthChallengeResponder> auth_responder,
|
|
|
|
gin::Arguments* args) {
|
2021-03-16 16:18:45 +00:00
|
|
|
std::u16string username_str, password_str;
|
2019-11-27 01:01:13 +00:00
|
|
|
if (!args->GetNext(&username_str) || !args->GetNext(&password_str)) {
|
2024-01-10 22:23:35 +00:00
|
|
|
auth_responder->OnAuthCredentials(std::nullopt);
|
2019-11-27 01:01:13 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
auth_responder->OnAuthCredentials(
|
|
|
|
net::AuthCredentials(username_str, password_str));
|
|
|
|
},
|
|
|
|
std::move(auth_responder));
|
|
|
|
Emit("login", auth_info, base::AdaptCallbackForRepeating(std::move(cb)));
|
|
|
|
}
|
|
|
|
|
chore: bump chromium to 92.0.4475.0 (master) (#28462)
* chore: bump chromium in DEPS to 91.0.4464.0
* chore: rebuild chromium/dcheck.patch with import-patches -3
Mechanical only; no code changes
* chore: remove content_browser_main_loop.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
The function being patched (BrowserMainLoop::MainMessageLoopRun()) no
longer exists.
NB: if removing this introduces regressions the likely fix will be to
add a similar patch for ShellBrowserMainParts::WillRunMainMessageLoop()
which has similar code and was added at the same time this was removed.
* chore: rebuild chromium/put_back_deleted_colors_for_autofill.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/disable_color_correct_rendering.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/eat_allow_disabling_blink_scheduler_throttling_per_renderview.patch with patch
Mechanical only; no code changes
* chore: rebuild chromium/gpu_notify_when_dxdiag_request_fails.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/ui_gtk_public_header.patch manually
no code changes
* chore: rebuild chromium/web_contents.patch with import-patches -3
Mechanical only; no code changes
* chore: remove v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2763874
This patch has been merged upstream
* chore: export patches
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785841
SkColorFromColorId() no longer takes theme, scheme args
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2772143
Change new calls to GetDarkSchemeColor to fit our patched call signature
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_ in our mojom
* chore: update chromium/frame_host_manager.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update chromium/revert_remove_contentrendererclient_shouldfork.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2755314
Upstream has removed `history_list_length_` which we were comparing to 0
to calculate our `is_initial_navigation` bool when calling ShouldFork().
ShouldFork() is ours and none of the code paths actually use that param,
so this commit removes it altogether.
* chore: update permissions_to_register
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2789074
Replace all uses of APIPermission::ID enum with Mojo type
* refactor: update return type of PreMainMessageLoopRun()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
Used to return void; now returns an int errorcode.
Note: 2725153 also has some nice doc updates about Browser's "stages"
* refactor: sync ElectronBrowserMainParts to MainParts changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
RunMainMessageLoopParts has been replaced with WillRunMainMessageLoop
so `BrowserMainLoop::result_code_` is no longer available to us for our
exit_code_ pointer.
This variable held a dual role: (1) of course, hold the exit code, but
also (2) was a nullptr before the message loop was ready, indicating to
anyone calling SetExitCode() that we were still in startup and could
just exit() without any extra steps. exit_code_ still fulfills these two
roles but is now a base::Optional.
* chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
BrowserMainParts::BrowsePreDefaultMainMesssageLoopRun() has been
removed; move that work to the new WillRunMainMessageLoop().
* refactor: stop using CallbackList; it has been removed.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785973
* refactor: update use of threadpools.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2773408
The upstream code is still in flux (e.g. reverts and re-lands) but the
tl;dr for this commit is (1) include thread_pool.h if you're using it
and (2) don't instantiate pools directly.
* refactor: remove routing_id from CreateLoaderAndStart
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
NB: One logic branch in ProxyingURLLoaderFactory::CreateLoaderAndStart
calls std::make_unique<InProgressRequest>, which needs a routing_id.
This PR uses the member field `routing_id_` since there's no longer one
being passed into CreateLoaderAndStart.
* refactor: sync to upstream ParittionOptions churn
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
PartitionOptions' enums have changed.
* refactor: update Manifest::Location usage
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
tldr: s/Manifest::FOO/ManifestLocation::kFoo/
* chore: bump chromium in DEPS to 91.0.4465.0
* update patches
* refactor: update extensions::Manifest to upstream
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
- extensions::Manifest::COMPONENT
+ extensions::mojom::ManifestLocation::kExternalComponent
* refactor: sync with upstream UrlInfo ctor changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update invocation of convert_protocol_to_json.py
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2792623
python3 is being used in parts of the upstream build, but the copy of
convert_protocol_to_json.py invoked in v8/third_party/inspector_protocol
is not python3-friendly. Node has a py2+3-friendly version of it in its
tools directory, so call it instead.
* chore: use extensions::mojom::APIPermissionID
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791122
tldr:
- extensions::APIPermission::kFoo
+ extensions::mojom::APIPermissionID::kFoo
* chore: Remove support for TLS1.0/1.1 in SSLVersionMin policy
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2765737
Remove TLS v1.0 & 1.1 from our SSLProtocolVersionFromString() function.
This is the same change made upstream at
https://chromium-review.googlesource.com/c/chromium/src/+/2765737/8/chrome/browser/ssl/ssl_config_service_manager_pref.cc
* fixup! chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
* chore: Use IDType for permission change subscriptions.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791431
tldr: {Subscribe,Unsubscribe}PermissionStatusChange's tag type used to
be an int; now it's the new SubscriptionId type (which is an IdType64).
* chore: sync PowerMonitor code to upstream refactor
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2752635
tldr: PowerMonitor has been split into PowerStateObserver,
PowerSuspendObserver, and PowerThermalObserver to reduce number of tasks
posted to consumers who only need notifications for one of those things
instead of all of them.
* chore: use PartitionOptions's new Cookies field
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
* Revert "refactor: remove routing_id from CreateLoaderAndStart"
This reverts commit 8c9773b87a3c84f9073a47089eb2b6889d745245.
8c9773b was only a partial fix; reverting to start & try again.
* update patches
* chore: bump chromium in DEPS to 91.0.4466.0
* chore: update chromium/accelerator.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2795472
tldr: sync patch with upstream renamed variable & macro names.
* chore: update chromium/gtk_visibility.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796200
tldr: no code changes; just updating the diff to apply cleanly.
note: ooh upstream Wayland hacking!
* chore: update chromium/picture-in-picture.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710023
tldr: no code changes; just updating the diff to apply cleanly.
* chore: update chromium/worker_feat_add_hook_to_notify_script_ready.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2775573
tldr: no code changes; just updating the diff to apply cleanly.
* chore: export_all_patches
* chore: update chromium/feat_add_set_theme_source_to_allow_apps_to.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796511
tldr: NotifyObservers has been renamed to NotifyOnNativeThemeUpdated,
so update the invocation in our patch.
* chore: update ElectronBrowserClient w/upstream API
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797454
tldr: GetDevToolsManagerDelegate() was returning an owned raw pointer.
Replaced it with CreateDevToolsManagerDelegate() which uses unique_ptr<>.
* chore: handle new content::PermissionType::FILE_HANDLING in toV8()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762201
`file-handling` string confirmed in https://chromium-review.googlesource.com/c/chromium/src/+/2762201/18/chrome/browser/ui/webui/settings/site_settings_helper.cc
* refactor: remove routing_id from CreateLoaderAndStart pt 1
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
Part 1: the easiest ones
* 2796724: Support Python3
https://chromium-review.googlesource.com/c/infra/luci/python-adb/+/2796724
* chore: bump chromium in DEPS to 91.0.4468.0
* 2668974: WebShare: Implement SharingServicePicker
https://chromium-review.googlesource.com/c/chromium/src/+/2668974
* 2802766: Apply modernize-make-unique to media/
https://chromium-review.googlesource.com/c/chromium/src/+/2802766
* 2802823: Apply modernize-make-unique to gpu/
https://chromium-review.googlesource.com/c/chromium/src/+/2802823
* 2803041: Apply modernize-make-unique to remaining files
https://chromium-review.googlesource.com/c/chromium/src/+/2803041
* 2798873: Convert GtkKeyBindingsHandler build checks to runtime checks
https://chromium-review.googlesource.com/c/chromium/src/+/2798873
* 2733595: [ch-r] Parse ACCEPT_CH H2/3 frame and restart with new headers if needed
https://chromium-review.googlesource.com/c/chromium/src/+/2733595
* chore: update patch indices
* 2795107: Remove unused PermissionRequest IDs.
https://chromium-review.googlesource.com/c/chromium/src/+/2795107
* chore: bump chromium in DEPS to 91.0.4469.0
* chore: fixup patch indices
* chore: bump chromium in DEPS to 91.0.4469.5
* PiP 1.5: Add microphone, camera, and hang up buttons to the PiP window
https://chromium-review.googlesource.com/c/chromium/src/+/2710023
* fixup! refactor: remove routing_id from CreateLoaderAndStart
* refactor: use URLLoaderNetworkServiceObserver for auth requests from SimpleURLLoader
* fixup! chore: fixup patch indices
* 2724817: Expand scope of wasm-eval to all URLs
https://chromium-review.googlesource.com/c/chromium/src/+/2724817
* Fixup patch after rebase
* chore: bump chromium in DEPS to 91.0.4472.0
* 2797341: [ozone/x11] Enabled the global shortcut listener.
https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* 2805553: Reland Add GTK ColorMixers to ColorPipeline P1
https://chromium-review.googlesource.com/c/chromium/src/+/2805553
* 2804366: PiP 1.5: Label back to tab button with origin and center it
https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* 2784730: Fix crash on AX mode change in NativeViewHost without a Widget
https://chromium-review.googlesource.com/c/chromium/src/+/2784730
* chore: update patch indices
* 2810174: Add PdfAnnotationsEnabled policy.
https://chromium-review.googlesource.com/c/chromium/src/+/2810174
* 2807829: Allow capturers to indicate if they want a WakeLock or not.
https://chromium-review.googlesource.com/c/chromium/src/+/2807829
* chore: bump chromium in DEPS to 92.0.4473.0
* chore: bump chromium in DEPS to 92.0.4474.0
* chore: bump chromium in DEPS to 92.0.4475.0
* chore: update patches
* chore: updates patches
* chore: update is_media_key patch to handle new ozone impl
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* fix: ExecuteJavascript requests now need to be flagged as non-bf-aware
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2787195
* chore: icon_util_x11 is now icon_util_linux
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791362
* build: update sysroots
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2628496
* build: fix missing symbols on linux build
* use_ozone and use_x11 are not exclusive
* new button view to build for pip
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* chore: fix broken gtk_util color patch
* chore: remove patch conflict
* build: update linux manifests
* chore: build bttlb on all platforms for pip
* chore: add thread_pool include for views delegate win
* chore: fix lint
* chore: add node patches for V8 changes
* build: add missing base include on windows
* fix: update frame host manager patch for new state transitions
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2714464
* chore: update windows zip manifests
* chore: update mac zip manifests
* chore: fix patch linting
* refactor: implement missing URLLoaderNetworkServiceObserver methods
It is against The Mojo Rules to leave hanging callbacks. These always
have to be called.
Refs: https://github.com/electron/electron/commit/186528aab9f8e29d658f07d220bb7f627980edda
* spec: fix locale test on local linux
* fix: pass the exit code correctly in new PreMainMessageLoopRun
Refs: https://github.com/electron/electron/commit/2622e91c4493ceb032e2f80cb484885bb8f97475
* fix: ensure we early-exit when request_handler_ is not provided
Refs: https://github.com/electron/electron/commit/93077afbfb6db248a0c0cc447d7ad2c9ccfda1d5
* fix: strongly set result_code in the BrowserMainLoop
* fix: invalid usage of non-targetted PostTask
You must always either use a host threadpool or specify a target
thread. In this case we did neither after this refactor.
Refs: https://github.com/electron/electron/pull/28462/commits/4e33ee0ad35a710bd34641cb0376bdee6aea2d1f
* chore: fix gn check
* chore: remove stray .rej files in patch
* chore: add mojo error code to url loader failure
* build: ensure CI is truthy in arm test env
* fix: handle windowCaptureMacV2 being enabled when fetching media source id
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2709931
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-15 17:44:35 +00:00
|
|
|
void SimpleURLLoaderWrapper::OnSSLCertificateError(
|
|
|
|
const GURL& url,
|
|
|
|
int net_error,
|
|
|
|
const net::SSLInfo& ssl_info,
|
|
|
|
bool fatal,
|
|
|
|
OnSSLCertificateErrorCallback response) {
|
|
|
|
std::move(response).Run(net_error);
|
|
|
|
}
|
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
void SimpleURLLoaderWrapper::OnClearSiteData(
|
|
|
|
const GURL& url,
|
|
|
|
const std::string& header_value,
|
|
|
|
int32_t load_flags,
|
2024-01-10 22:23:35 +00:00
|
|
|
const std::optional<net::CookiePartitionKey>& cookie_partition_key,
|
2023-03-22 01:19:23 +00:00
|
|
|
bool partitioned_state_allowed_only,
|
2022-02-10 02:58:52 +00:00
|
|
|
OnClearSiteDataCallback callback) {
|
chore: bump chromium to 92.0.4475.0 (master) (#28462)
* chore: bump chromium in DEPS to 91.0.4464.0
* chore: rebuild chromium/dcheck.patch with import-patches -3
Mechanical only; no code changes
* chore: remove content_browser_main_loop.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
The function being patched (BrowserMainLoop::MainMessageLoopRun()) no
longer exists.
NB: if removing this introduces regressions the likely fix will be to
add a similar patch for ShellBrowserMainParts::WillRunMainMessageLoop()
which has similar code and was added at the same time this was removed.
* chore: rebuild chromium/put_back_deleted_colors_for_autofill.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/disable_color_correct_rendering.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/eat_allow_disabling_blink_scheduler_throttling_per_renderview.patch with patch
Mechanical only; no code changes
* chore: rebuild chromium/gpu_notify_when_dxdiag_request_fails.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/ui_gtk_public_header.patch manually
no code changes
* chore: rebuild chromium/web_contents.patch with import-patches -3
Mechanical only; no code changes
* chore: remove v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2763874
This patch has been merged upstream
* chore: export patches
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785841
SkColorFromColorId() no longer takes theme, scheme args
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2772143
Change new calls to GetDarkSchemeColor to fit our patched call signature
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_ in our mojom
* chore: update chromium/frame_host_manager.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update chromium/revert_remove_contentrendererclient_shouldfork.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2755314
Upstream has removed `history_list_length_` which we were comparing to 0
to calculate our `is_initial_navigation` bool when calling ShouldFork().
ShouldFork() is ours and none of the code paths actually use that param,
so this commit removes it altogether.
* chore: update permissions_to_register
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2789074
Replace all uses of APIPermission::ID enum with Mojo type
* refactor: update return type of PreMainMessageLoopRun()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
Used to return void; now returns an int errorcode.
Note: 2725153 also has some nice doc updates about Browser's "stages"
* refactor: sync ElectronBrowserMainParts to MainParts changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
RunMainMessageLoopParts has been replaced with WillRunMainMessageLoop
so `BrowserMainLoop::result_code_` is no longer available to us for our
exit_code_ pointer.
This variable held a dual role: (1) of course, hold the exit code, but
also (2) was a nullptr before the message loop was ready, indicating to
anyone calling SetExitCode() that we were still in startup and could
just exit() without any extra steps. exit_code_ still fulfills these two
roles but is now a base::Optional.
* chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
BrowserMainParts::BrowsePreDefaultMainMesssageLoopRun() has been
removed; move that work to the new WillRunMainMessageLoop().
* refactor: stop using CallbackList; it has been removed.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785973
* refactor: update use of threadpools.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2773408
The upstream code is still in flux (e.g. reverts and re-lands) but the
tl;dr for this commit is (1) include thread_pool.h if you're using it
and (2) don't instantiate pools directly.
* refactor: remove routing_id from CreateLoaderAndStart
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
NB: One logic branch in ProxyingURLLoaderFactory::CreateLoaderAndStart
calls std::make_unique<InProgressRequest>, which needs a routing_id.
This PR uses the member field `routing_id_` since there's no longer one
being passed into CreateLoaderAndStart.
* refactor: sync to upstream ParittionOptions churn
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
PartitionOptions' enums have changed.
* refactor: update Manifest::Location usage
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
tldr: s/Manifest::FOO/ManifestLocation::kFoo/
* chore: bump chromium in DEPS to 91.0.4465.0
* update patches
* refactor: update extensions::Manifest to upstream
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
- extensions::Manifest::COMPONENT
+ extensions::mojom::ManifestLocation::kExternalComponent
* refactor: sync with upstream UrlInfo ctor changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update invocation of convert_protocol_to_json.py
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2792623
python3 is being used in parts of the upstream build, but the copy of
convert_protocol_to_json.py invoked in v8/third_party/inspector_protocol
is not python3-friendly. Node has a py2+3-friendly version of it in its
tools directory, so call it instead.
* chore: use extensions::mojom::APIPermissionID
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791122
tldr:
- extensions::APIPermission::kFoo
+ extensions::mojom::APIPermissionID::kFoo
* chore: Remove support for TLS1.0/1.1 in SSLVersionMin policy
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2765737
Remove TLS v1.0 & 1.1 from our SSLProtocolVersionFromString() function.
This is the same change made upstream at
https://chromium-review.googlesource.com/c/chromium/src/+/2765737/8/chrome/browser/ssl/ssl_config_service_manager_pref.cc
* fixup! chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
* chore: Use IDType for permission change subscriptions.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791431
tldr: {Subscribe,Unsubscribe}PermissionStatusChange's tag type used to
be an int; now it's the new SubscriptionId type (which is an IdType64).
* chore: sync PowerMonitor code to upstream refactor
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2752635
tldr: PowerMonitor has been split into PowerStateObserver,
PowerSuspendObserver, and PowerThermalObserver to reduce number of tasks
posted to consumers who only need notifications for one of those things
instead of all of them.
* chore: use PartitionOptions's new Cookies field
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
* Revert "refactor: remove routing_id from CreateLoaderAndStart"
This reverts commit 8c9773b87a3c84f9073a47089eb2b6889d745245.
8c9773b was only a partial fix; reverting to start & try again.
* update patches
* chore: bump chromium in DEPS to 91.0.4466.0
* chore: update chromium/accelerator.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2795472
tldr: sync patch with upstream renamed variable & macro names.
* chore: update chromium/gtk_visibility.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796200
tldr: no code changes; just updating the diff to apply cleanly.
note: ooh upstream Wayland hacking!
* chore: update chromium/picture-in-picture.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710023
tldr: no code changes; just updating the diff to apply cleanly.
* chore: update chromium/worker_feat_add_hook_to_notify_script_ready.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2775573
tldr: no code changes; just updating the diff to apply cleanly.
* chore: export_all_patches
* chore: update chromium/feat_add_set_theme_source_to_allow_apps_to.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796511
tldr: NotifyObservers has been renamed to NotifyOnNativeThemeUpdated,
so update the invocation in our patch.
* chore: update ElectronBrowserClient w/upstream API
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797454
tldr: GetDevToolsManagerDelegate() was returning an owned raw pointer.
Replaced it with CreateDevToolsManagerDelegate() which uses unique_ptr<>.
* chore: handle new content::PermissionType::FILE_HANDLING in toV8()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762201
`file-handling` string confirmed in https://chromium-review.googlesource.com/c/chromium/src/+/2762201/18/chrome/browser/ui/webui/settings/site_settings_helper.cc
* refactor: remove routing_id from CreateLoaderAndStart pt 1
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
Part 1: the easiest ones
* 2796724: Support Python3
https://chromium-review.googlesource.com/c/infra/luci/python-adb/+/2796724
* chore: bump chromium in DEPS to 91.0.4468.0
* 2668974: WebShare: Implement SharingServicePicker
https://chromium-review.googlesource.com/c/chromium/src/+/2668974
* 2802766: Apply modernize-make-unique to media/
https://chromium-review.googlesource.com/c/chromium/src/+/2802766
* 2802823: Apply modernize-make-unique to gpu/
https://chromium-review.googlesource.com/c/chromium/src/+/2802823
* 2803041: Apply modernize-make-unique to remaining files
https://chromium-review.googlesource.com/c/chromium/src/+/2803041
* 2798873: Convert GtkKeyBindingsHandler build checks to runtime checks
https://chromium-review.googlesource.com/c/chromium/src/+/2798873
* 2733595: [ch-r] Parse ACCEPT_CH H2/3 frame and restart with new headers if needed
https://chromium-review.googlesource.com/c/chromium/src/+/2733595
* chore: update patch indices
* 2795107: Remove unused PermissionRequest IDs.
https://chromium-review.googlesource.com/c/chromium/src/+/2795107
* chore: bump chromium in DEPS to 91.0.4469.0
* chore: fixup patch indices
* chore: bump chromium in DEPS to 91.0.4469.5
* PiP 1.5: Add microphone, camera, and hang up buttons to the PiP window
https://chromium-review.googlesource.com/c/chromium/src/+/2710023
* fixup! refactor: remove routing_id from CreateLoaderAndStart
* refactor: use URLLoaderNetworkServiceObserver for auth requests from SimpleURLLoader
* fixup! chore: fixup patch indices
* 2724817: Expand scope of wasm-eval to all URLs
https://chromium-review.googlesource.com/c/chromium/src/+/2724817
* Fixup patch after rebase
* chore: bump chromium in DEPS to 91.0.4472.0
* 2797341: [ozone/x11] Enabled the global shortcut listener.
https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* 2805553: Reland Add GTK ColorMixers to ColorPipeline P1
https://chromium-review.googlesource.com/c/chromium/src/+/2805553
* 2804366: PiP 1.5: Label back to tab button with origin and center it
https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* 2784730: Fix crash on AX mode change in NativeViewHost without a Widget
https://chromium-review.googlesource.com/c/chromium/src/+/2784730
* chore: update patch indices
* 2810174: Add PdfAnnotationsEnabled policy.
https://chromium-review.googlesource.com/c/chromium/src/+/2810174
* 2807829: Allow capturers to indicate if they want a WakeLock or not.
https://chromium-review.googlesource.com/c/chromium/src/+/2807829
* chore: bump chromium in DEPS to 92.0.4473.0
* chore: bump chromium in DEPS to 92.0.4474.0
* chore: bump chromium in DEPS to 92.0.4475.0
* chore: update patches
* chore: updates patches
* chore: update is_media_key patch to handle new ozone impl
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* fix: ExecuteJavascript requests now need to be flagged as non-bf-aware
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2787195
* chore: icon_util_x11 is now icon_util_linux
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791362
* build: update sysroots
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2628496
* build: fix missing symbols on linux build
* use_ozone and use_x11 are not exclusive
* new button view to build for pip
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* chore: fix broken gtk_util color patch
* chore: remove patch conflict
* build: update linux manifests
* chore: build bttlb on all platforms for pip
* chore: add thread_pool include for views delegate win
* chore: fix lint
* chore: add node patches for V8 changes
* build: add missing base include on windows
* fix: update frame host manager patch for new state transitions
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2714464
* chore: update windows zip manifests
* chore: update mac zip manifests
* chore: fix patch linting
* refactor: implement missing URLLoaderNetworkServiceObserver methods
It is against The Mojo Rules to leave hanging callbacks. These always
have to be called.
Refs: https://github.com/electron/electron/commit/186528aab9f8e29d658f07d220bb7f627980edda
* spec: fix locale test on local linux
* fix: pass the exit code correctly in new PreMainMessageLoopRun
Refs: https://github.com/electron/electron/commit/2622e91c4493ceb032e2f80cb484885bb8f97475
* fix: ensure we early-exit when request_handler_ is not provided
Refs: https://github.com/electron/electron/commit/93077afbfb6db248a0c0cc447d7ad2c9ccfda1d5
* fix: strongly set result_code in the BrowserMainLoop
* fix: invalid usage of non-targetted PostTask
You must always either use a host threadpool or specify a target
thread. In this case we did neither after this refactor.
Refs: https://github.com/electron/electron/pull/28462/commits/4e33ee0ad35a710bd34641cb0376bdee6aea2d1f
* chore: fix gn check
* chore: remove stray .rej files in patch
* chore: add mojo error code to url loader failure
* build: ensure CI is truthy in arm test env
* fix: handle windowCaptureMacV2 being enabled when fetching media source id
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2709931
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-15 17:44:35 +00:00
|
|
|
std::move(callback).Run();
|
|
|
|
}
|
|
|
|
void SimpleURLLoaderWrapper::OnLoadingStateUpdate(
|
|
|
|
network::mojom::LoadInfoPtr info,
|
|
|
|
OnLoadingStateUpdateCallback callback) {
|
|
|
|
std::move(callback).Run();
|
|
|
|
}
|
|
|
|
|
2023-06-09 23:08:36 +00:00
|
|
|
void SimpleURLLoaderWrapper::OnSharedStorageHeaderReceived(
|
|
|
|
const url::Origin& request_origin,
|
|
|
|
std::vector<network::mojom::SharedStorageOperationPtr> operations,
|
|
|
|
OnSharedStorageHeaderReceivedCallback callback) {
|
|
|
|
std::move(callback).Run();
|
|
|
|
}
|
|
|
|
|
chore: bump chromium to 92.0.4475.0 (master) (#28462)
* chore: bump chromium in DEPS to 91.0.4464.0
* chore: rebuild chromium/dcheck.patch with import-patches -3
Mechanical only; no code changes
* chore: remove content_browser_main_loop.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
The function being patched (BrowserMainLoop::MainMessageLoopRun()) no
longer exists.
NB: if removing this introduces regressions the likely fix will be to
add a similar patch for ShellBrowserMainParts::WillRunMainMessageLoop()
which has similar code and was added at the same time this was removed.
* chore: rebuild chromium/put_back_deleted_colors_for_autofill.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/disable_color_correct_rendering.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/eat_allow_disabling_blink_scheduler_throttling_per_renderview.patch with patch
Mechanical only; no code changes
* chore: rebuild chromium/gpu_notify_when_dxdiag_request_fails.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/ui_gtk_public_header.patch manually
no code changes
* chore: rebuild chromium/web_contents.patch with import-patches -3
Mechanical only; no code changes
* chore: remove v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2763874
This patch has been merged upstream
* chore: export patches
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785841
SkColorFromColorId() no longer takes theme, scheme args
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2772143
Change new calls to GetDarkSchemeColor to fit our patched call signature
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_ in our mojom
* chore: update chromium/frame_host_manager.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update chromium/revert_remove_contentrendererclient_shouldfork.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2755314
Upstream has removed `history_list_length_` which we were comparing to 0
to calculate our `is_initial_navigation` bool when calling ShouldFork().
ShouldFork() is ours and none of the code paths actually use that param,
so this commit removes it altogether.
* chore: update permissions_to_register
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2789074
Replace all uses of APIPermission::ID enum with Mojo type
* refactor: update return type of PreMainMessageLoopRun()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
Used to return void; now returns an int errorcode.
Note: 2725153 also has some nice doc updates about Browser's "stages"
* refactor: sync ElectronBrowserMainParts to MainParts changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
RunMainMessageLoopParts has been replaced with WillRunMainMessageLoop
so `BrowserMainLoop::result_code_` is no longer available to us for our
exit_code_ pointer.
This variable held a dual role: (1) of course, hold the exit code, but
also (2) was a nullptr before the message loop was ready, indicating to
anyone calling SetExitCode() that we were still in startup and could
just exit() without any extra steps. exit_code_ still fulfills these two
roles but is now a base::Optional.
* chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
BrowserMainParts::BrowsePreDefaultMainMesssageLoopRun() has been
removed; move that work to the new WillRunMainMessageLoop().
* refactor: stop using CallbackList; it has been removed.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785973
* refactor: update use of threadpools.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2773408
The upstream code is still in flux (e.g. reverts and re-lands) but the
tl;dr for this commit is (1) include thread_pool.h if you're using it
and (2) don't instantiate pools directly.
* refactor: remove routing_id from CreateLoaderAndStart
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
NB: One logic branch in ProxyingURLLoaderFactory::CreateLoaderAndStart
calls std::make_unique<InProgressRequest>, which needs a routing_id.
This PR uses the member field `routing_id_` since there's no longer one
being passed into CreateLoaderAndStart.
* refactor: sync to upstream ParittionOptions churn
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
PartitionOptions' enums have changed.
* refactor: update Manifest::Location usage
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
tldr: s/Manifest::FOO/ManifestLocation::kFoo/
* chore: bump chromium in DEPS to 91.0.4465.0
* update patches
* refactor: update extensions::Manifest to upstream
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
- extensions::Manifest::COMPONENT
+ extensions::mojom::ManifestLocation::kExternalComponent
* refactor: sync with upstream UrlInfo ctor changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update invocation of convert_protocol_to_json.py
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2792623
python3 is being used in parts of the upstream build, but the copy of
convert_protocol_to_json.py invoked in v8/third_party/inspector_protocol
is not python3-friendly. Node has a py2+3-friendly version of it in its
tools directory, so call it instead.
* chore: use extensions::mojom::APIPermissionID
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791122
tldr:
- extensions::APIPermission::kFoo
+ extensions::mojom::APIPermissionID::kFoo
* chore: Remove support for TLS1.0/1.1 in SSLVersionMin policy
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2765737
Remove TLS v1.0 & 1.1 from our SSLProtocolVersionFromString() function.
This is the same change made upstream at
https://chromium-review.googlesource.com/c/chromium/src/+/2765737/8/chrome/browser/ssl/ssl_config_service_manager_pref.cc
* fixup! chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
* chore: Use IDType for permission change subscriptions.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791431
tldr: {Subscribe,Unsubscribe}PermissionStatusChange's tag type used to
be an int; now it's the new SubscriptionId type (which is an IdType64).
* chore: sync PowerMonitor code to upstream refactor
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2752635
tldr: PowerMonitor has been split into PowerStateObserver,
PowerSuspendObserver, and PowerThermalObserver to reduce number of tasks
posted to consumers who only need notifications for one of those things
instead of all of them.
* chore: use PartitionOptions's new Cookies field
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
* Revert "refactor: remove routing_id from CreateLoaderAndStart"
This reverts commit 8c9773b87a3c84f9073a47089eb2b6889d745245.
8c9773b was only a partial fix; reverting to start & try again.
* update patches
* chore: bump chromium in DEPS to 91.0.4466.0
* chore: update chromium/accelerator.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2795472
tldr: sync patch with upstream renamed variable & macro names.
* chore: update chromium/gtk_visibility.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796200
tldr: no code changes; just updating the diff to apply cleanly.
note: ooh upstream Wayland hacking!
* chore: update chromium/picture-in-picture.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710023
tldr: no code changes; just updating the diff to apply cleanly.
* chore: update chromium/worker_feat_add_hook_to_notify_script_ready.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2775573
tldr: no code changes; just updating the diff to apply cleanly.
* chore: export_all_patches
* chore: update chromium/feat_add_set_theme_source_to_allow_apps_to.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796511
tldr: NotifyObservers has been renamed to NotifyOnNativeThemeUpdated,
so update the invocation in our patch.
* chore: update ElectronBrowserClient w/upstream API
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797454
tldr: GetDevToolsManagerDelegate() was returning an owned raw pointer.
Replaced it with CreateDevToolsManagerDelegate() which uses unique_ptr<>.
* chore: handle new content::PermissionType::FILE_HANDLING in toV8()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762201
`file-handling` string confirmed in https://chromium-review.googlesource.com/c/chromium/src/+/2762201/18/chrome/browser/ui/webui/settings/site_settings_helper.cc
* refactor: remove routing_id from CreateLoaderAndStart pt 1
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
Part 1: the easiest ones
* 2796724: Support Python3
https://chromium-review.googlesource.com/c/infra/luci/python-adb/+/2796724
* chore: bump chromium in DEPS to 91.0.4468.0
* 2668974: WebShare: Implement SharingServicePicker
https://chromium-review.googlesource.com/c/chromium/src/+/2668974
* 2802766: Apply modernize-make-unique to media/
https://chromium-review.googlesource.com/c/chromium/src/+/2802766
* 2802823: Apply modernize-make-unique to gpu/
https://chromium-review.googlesource.com/c/chromium/src/+/2802823
* 2803041: Apply modernize-make-unique to remaining files
https://chromium-review.googlesource.com/c/chromium/src/+/2803041
* 2798873: Convert GtkKeyBindingsHandler build checks to runtime checks
https://chromium-review.googlesource.com/c/chromium/src/+/2798873
* 2733595: [ch-r] Parse ACCEPT_CH H2/3 frame and restart with new headers if needed
https://chromium-review.googlesource.com/c/chromium/src/+/2733595
* chore: update patch indices
* 2795107: Remove unused PermissionRequest IDs.
https://chromium-review.googlesource.com/c/chromium/src/+/2795107
* chore: bump chromium in DEPS to 91.0.4469.0
* chore: fixup patch indices
* chore: bump chromium in DEPS to 91.0.4469.5
* PiP 1.5: Add microphone, camera, and hang up buttons to the PiP window
https://chromium-review.googlesource.com/c/chromium/src/+/2710023
* fixup! refactor: remove routing_id from CreateLoaderAndStart
* refactor: use URLLoaderNetworkServiceObserver for auth requests from SimpleURLLoader
* fixup! chore: fixup patch indices
* 2724817: Expand scope of wasm-eval to all URLs
https://chromium-review.googlesource.com/c/chromium/src/+/2724817
* Fixup patch after rebase
* chore: bump chromium in DEPS to 91.0.4472.0
* 2797341: [ozone/x11] Enabled the global shortcut listener.
https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* 2805553: Reland Add GTK ColorMixers to ColorPipeline P1
https://chromium-review.googlesource.com/c/chromium/src/+/2805553
* 2804366: PiP 1.5: Label back to tab button with origin and center it
https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* 2784730: Fix crash on AX mode change in NativeViewHost without a Widget
https://chromium-review.googlesource.com/c/chromium/src/+/2784730
* chore: update patch indices
* 2810174: Add PdfAnnotationsEnabled policy.
https://chromium-review.googlesource.com/c/chromium/src/+/2810174
* 2807829: Allow capturers to indicate if they want a WakeLock or not.
https://chromium-review.googlesource.com/c/chromium/src/+/2807829
* chore: bump chromium in DEPS to 92.0.4473.0
* chore: bump chromium in DEPS to 92.0.4474.0
* chore: bump chromium in DEPS to 92.0.4475.0
* chore: update patches
* chore: updates patches
* chore: update is_media_key patch to handle new ozone impl
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* fix: ExecuteJavascript requests now need to be flagged as non-bf-aware
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2787195
* chore: icon_util_x11 is now icon_util_linux
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791362
* build: update sysroots
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2628496
* build: fix missing symbols on linux build
* use_ozone and use_x11 are not exclusive
* new button view to build for pip
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* chore: fix broken gtk_util color patch
* chore: remove patch conflict
* build: update linux manifests
* chore: build bttlb on all platforms for pip
* chore: add thread_pool include for views delegate win
* chore: fix lint
* chore: add node patches for V8 changes
* build: add missing base include on windows
* fix: update frame host manager patch for new state transitions
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2714464
* chore: update windows zip manifests
* chore: update mac zip manifests
* chore: fix patch linting
* refactor: implement missing URLLoaderNetworkServiceObserver methods
It is against The Mojo Rules to leave hanging callbacks. These always
have to be called.
Refs: https://github.com/electron/electron/commit/186528aab9f8e29d658f07d220bb7f627980edda
* spec: fix locale test on local linux
* fix: pass the exit code correctly in new PreMainMessageLoopRun
Refs: https://github.com/electron/electron/commit/2622e91c4493ceb032e2f80cb484885bb8f97475
* fix: ensure we early-exit when request_handler_ is not provided
Refs: https://github.com/electron/electron/commit/93077afbfb6db248a0c0cc447d7ad2c9ccfda1d5
* fix: strongly set result_code in the BrowserMainLoop
* fix: invalid usage of non-targetted PostTask
You must always either use a host threadpool or specify a target
thread. In this case we did neither after this refactor.
Refs: https://github.com/electron/electron/pull/28462/commits/4e33ee0ad35a710bd34641cb0376bdee6aea2d1f
* chore: fix gn check
* chore: remove stray .rej files in patch
* chore: add mojo error code to url loader failure
* build: ensure CI is truthy in arm test env
* fix: handle windowCaptureMacV2 being enabled when fetching media source id
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2709931
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-15 17:44:35 +00:00
|
|
|
void SimpleURLLoaderWrapper::Clone(
|
|
|
|
mojo::PendingReceiver<network::mojom::URLLoaderNetworkServiceObserver>
|
|
|
|
observer) {
|
|
|
|
url_loader_network_observer_receivers_.Add(this, std::move(observer));
|
|
|
|
}
|
|
|
|
|
2019-11-27 01:01:13 +00:00
|
|
|
void SimpleURLLoaderWrapper::Cancel() {
|
|
|
|
loader_.reset();
|
|
|
|
pinned_wrapper_.Reset();
|
|
|
|
pinned_chunk_pipe_getter_.Reset();
|
|
|
|
// This ensures that no further callbacks will be called, so there's no need
|
|
|
|
// for additional guards.
|
|
|
|
}
|
2023-03-02 23:47:45 +00:00
|
|
|
scoped_refptr<network::SharedURLLoaderFactory>
|
|
|
|
SimpleURLLoaderWrapper::GetURLLoaderFactoryForURL(const GURL& url) {
|
2024-05-09 13:53:09 +00:00
|
|
|
if (electron::IsUtilityProcess())
|
2024-01-04 21:20:37 +00:00
|
|
|
return URLLoaderBundle::GetInstance()->GetSharedURLLoaderFactory();
|
2024-05-09 13:53:09 +00:00
|
|
|
|
2024-01-04 21:20:37 +00:00
|
|
|
CHECK(browser_context_);
|
2023-03-02 23:47:45 +00:00
|
|
|
// Explicitly handle intercepted protocols here, even though
|
|
|
|
// ProxyingURLLoaderFactory would handle them later on, so that we can
|
|
|
|
// correctly intercept file:// scheme URLs.
|
2024-05-09 13:53:09 +00:00
|
|
|
if (const bool bypass = request_options_ & kBypassCustomProtocolHandlers;
|
|
|
|
!bypass) {
|
2024-08-23 22:15:45 +00:00
|
|
|
const std::string_view scheme = url.scheme_piece();
|
2024-05-09 13:53:09 +00:00
|
|
|
const auto* const protocol_registry =
|
|
|
|
ProtocolRegistry::FromBrowserContext(browser_context_);
|
|
|
|
|
|
|
|
if (const auto* const protocol_handler =
|
|
|
|
protocol_registry->FindIntercepted(scheme)) {
|
|
|
|
return network::SharedURLLoaderFactory::Create(
|
|
|
|
std::make_unique<network::WrapperPendingSharedURLLoaderFactory>(
|
|
|
|
ElectronURLLoaderFactory::Create(protocol_handler->first,
|
|
|
|
protocol_handler->second)));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (const auto* const protocol_handler =
|
|
|
|
protocol_registry->FindRegistered(scheme)) {
|
|
|
|
return network::SharedURLLoaderFactory::Create(
|
|
|
|
std::make_unique<network::WrapperPendingSharedURLLoaderFactory>(
|
|
|
|
ElectronURLLoaderFactory::Create(protocol_handler->first,
|
|
|
|
protocol_handler->second)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (url.SchemeIsFile()) {
|
|
|
|
return network::SharedURLLoaderFactory::Create(
|
2023-03-02 23:47:45 +00:00
|
|
|
std::make_unique<network::WrapperPendingSharedURLLoaderFactory>(
|
2024-05-09 13:53:09 +00:00
|
|
|
AsarURLLoaderFactory::Create()));
|
2023-03-02 23:47:45 +00:00
|
|
|
}
|
2024-05-09 13:53:09 +00:00
|
|
|
|
|
|
|
return browser_context_->GetURLLoaderFactory();
|
2023-03-02 23:47:45 +00:00
|
|
|
}
|
2019-11-27 01:01:13 +00:00
|
|
|
|
|
|
|
// static
|
2020-03-23 20:09:45 +00:00
|
|
|
gin::Handle<SimpleURLLoaderWrapper> SimpleURLLoaderWrapper::Create(
|
|
|
|
gin::Arguments* args) {
|
2019-11-27 01:01:13 +00:00
|
|
|
gin_helper::Dictionary opts;
|
|
|
|
if (!args->GetNext(&opts)) {
|
|
|
|
args->ThrowTypeError("Expected a dictionary");
|
2020-03-23 20:09:45 +00:00
|
|
|
return gin::Handle<SimpleURLLoaderWrapper>();
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
auto request = std::make_unique<network::ResourceRequest>();
|
|
|
|
opts.Get("method", &request->method);
|
|
|
|
opts.Get("url", &request->url);
|
2023-03-27 17:00:55 +00:00
|
|
|
if (!request->url.is_valid()) {
|
|
|
|
args->ThrowTypeError("Invalid URL");
|
|
|
|
return gin::Handle<SimpleURLLoaderWrapper>();
|
|
|
|
}
|
2020-12-14 18:57:36 +00:00
|
|
|
request->site_for_cookies = net::SiteForCookies::FromUrl(request->url);
|
2020-05-20 17:28:38 +00:00
|
|
|
opts.Get("referrer", &request->referrer);
|
2023-02-20 20:57:38 +00:00
|
|
|
request->referrer_policy =
|
|
|
|
blink::ReferrerUtils::GetDefaultNetReferrerPolicy();
|
|
|
|
opts.Get("referrerPolicy", &request->referrer_policy);
|
2020-11-17 22:25:41 +00:00
|
|
|
std::string origin;
|
|
|
|
opts.Get("origin", &origin);
|
|
|
|
if (!origin.empty()) {
|
|
|
|
request->request_initiator = url::Origin::Create(GURL(origin));
|
|
|
|
}
|
|
|
|
bool has_user_activation;
|
|
|
|
if (opts.Get("hasUserActivation", &has_user_activation)) {
|
|
|
|
request->trusted_params = network::ResourceRequest::TrustedParams();
|
|
|
|
request->trusted_params->has_user_activation = has_user_activation;
|
|
|
|
}
|
|
|
|
|
2023-06-14 21:00:46 +00:00
|
|
|
if (std::string mode; opts.Get("mode", &mode)) {
|
|
|
|
using Val = network::mojom::RequestMode;
|
|
|
|
static constexpr auto Lookup =
|
2024-01-11 01:00:37 +00:00
|
|
|
base::MakeFixedFlatMap<std::string_view, Val>({
|
2023-06-14 21:00:46 +00:00
|
|
|
{"cors", Val::kCors},
|
|
|
|
{"navigate", Val::kNavigate},
|
|
|
|
{"no-cors", Val::kNoCors},
|
|
|
|
{"same-origin", Val::kSameOrigin},
|
|
|
|
});
|
|
|
|
if (auto* iter = Lookup.find(mode); iter != Lookup.end())
|
|
|
|
request->mode = iter->second;
|
2020-11-17 22:25:41 +00:00
|
|
|
}
|
|
|
|
|
2023-06-14 21:00:46 +00:00
|
|
|
if (std::string destination; opts.Get("destination", &destination)) {
|
|
|
|
using Val = network::mojom::RequestDestination;
|
|
|
|
static constexpr auto Lookup =
|
2024-01-11 01:00:37 +00:00
|
|
|
base::MakeFixedFlatMap<std::string_view, Val>({
|
2023-06-14 21:00:46 +00:00
|
|
|
{"audio", Val::kAudio},
|
|
|
|
{"audioworklet", Val::kAudioWorklet},
|
|
|
|
{"document", Val::kDocument},
|
|
|
|
{"embed", Val::kEmbed},
|
|
|
|
{"empty", Val::kEmpty},
|
|
|
|
{"font", Val::kFont},
|
|
|
|
{"frame", Val::kFrame},
|
|
|
|
{"iframe", Val::kIframe},
|
|
|
|
{"image", Val::kImage},
|
|
|
|
{"manifest", Val::kManifest},
|
|
|
|
{"object", Val::kObject},
|
|
|
|
{"paintworklet", Val::kPaintWorklet},
|
|
|
|
{"report", Val::kReport},
|
|
|
|
{"script", Val::kScript},
|
|
|
|
{"serviceworker", Val::kServiceWorker},
|
|
|
|
{"style", Val::kStyle},
|
|
|
|
{"track", Val::kTrack},
|
|
|
|
{"video", Val::kVideo},
|
|
|
|
{"worker", Val::kWorker},
|
|
|
|
{"xslt", Val::kXslt},
|
|
|
|
});
|
|
|
|
if (auto* iter = Lookup.find(destination); iter != Lookup.end())
|
|
|
|
request->destination = iter->second;
|
2020-11-17 22:25:41 +00:00
|
|
|
}
|
|
|
|
|
2020-09-29 16:03:33 +00:00
|
|
|
bool credentials_specified =
|
|
|
|
opts.Get("credentials", &request->credentials_mode);
|
2020-10-26 18:33:36 +00:00
|
|
|
std::vector<std::pair<std::string, std::string>> extra_headers;
|
2019-11-27 01:01:13 +00:00
|
|
|
if (opts.Get("extraHeaders", &extra_headers)) {
|
|
|
|
for (const auto& it : extra_headers) {
|
|
|
|
if (!net::HttpUtil::IsValidHeaderName(it.first) ||
|
|
|
|
!net::HttpUtil::IsValidHeaderValue(it.second)) {
|
|
|
|
args->ThrowTypeError("Invalid header name or value");
|
2020-03-23 20:09:45 +00:00
|
|
|
return gin::Handle<SimpleURLLoaderWrapper>();
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
request->headers.SetHeader(it.first, it.second);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-20 20:57:38 +00:00
|
|
|
blink::mojom::FetchCacheMode cache_mode =
|
|
|
|
blink::mojom::FetchCacheMode::kDefault;
|
|
|
|
opts.Get("cache", &cache_mode);
|
|
|
|
switch (cache_mode) {
|
|
|
|
case blink::mojom::FetchCacheMode::kNoStore:
|
|
|
|
request->load_flags |= net::LOAD_DISABLE_CACHE;
|
|
|
|
break;
|
|
|
|
case blink::mojom::FetchCacheMode::kValidateCache:
|
|
|
|
request->load_flags |= net::LOAD_VALIDATE_CACHE;
|
|
|
|
break;
|
|
|
|
case blink::mojom::FetchCacheMode::kBypassCache:
|
|
|
|
request->load_flags |= net::LOAD_BYPASS_CACHE;
|
|
|
|
break;
|
|
|
|
case blink::mojom::FetchCacheMode::kForceCache:
|
|
|
|
request->load_flags |= net::LOAD_SKIP_CACHE_VALIDATION;
|
|
|
|
break;
|
|
|
|
case blink::mojom::FetchCacheMode::kOnlyIfCached:
|
|
|
|
request->load_flags |=
|
|
|
|
net::LOAD_ONLY_FROM_CACHE | net::LOAD_SKIP_CACHE_VALIDATION;
|
|
|
|
break;
|
|
|
|
case blink::mojom::FetchCacheMode::kUnspecifiedOnlyIfCachedStrict:
|
|
|
|
request->load_flags |= net::LOAD_ONLY_FROM_CACHE;
|
|
|
|
break;
|
|
|
|
case blink::mojom::FetchCacheMode::kDefault:
|
|
|
|
break;
|
|
|
|
case blink::mojom::FetchCacheMode::kUnspecifiedForceCacheMiss:
|
|
|
|
request->load_flags |= net::LOAD_ONLY_FROM_CACHE | net::LOAD_BYPASS_CACHE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-03-20 22:56:02 +00:00
|
|
|
bool use_session_cookies = false;
|
|
|
|
opts.Get("useSessionCookies", &use_session_cookies);
|
2023-03-27 17:00:55 +00:00
|
|
|
int options = network::mojom::kURLLoadOptionSniffMimeType;
|
2020-09-29 16:03:33 +00:00
|
|
|
if (!credentials_specified && !use_session_cookies) {
|
|
|
|
// This is the default case, as well as the case when credentials is not
|
2022-02-21 09:27:45 +00:00
|
|
|
// specified and useSessionCookies is false. credentials_mode will be
|
2020-09-29 16:03:33 +00:00
|
|
|
// kInclude, but cookies will be blocked.
|
2020-09-21 08:00:36 +00:00
|
|
|
request->credentials_mode = network::mojom::CredentialsMode::kInclude;
|
|
|
|
options |= network::mojom::kURLLoadOptionBlockAllCookies;
|
2020-03-20 22:56:02 +00:00
|
|
|
}
|
|
|
|
|
2023-03-27 17:00:55 +00:00
|
|
|
bool bypass_custom_protocol_handlers = false;
|
|
|
|
opts.Get("bypassCustomProtocolHandlers", &bypass_custom_protocol_handlers);
|
|
|
|
if (bypass_custom_protocol_handlers)
|
|
|
|
options |= kBypassCustomProtocolHandlers;
|
|
|
|
|
2019-11-27 01:01:13 +00:00
|
|
|
v8::Local<v8::Value> body;
|
|
|
|
v8::Local<v8::Value> chunk_pipe_getter;
|
|
|
|
if (opts.Get("body", &body)) {
|
|
|
|
if (body->IsArrayBufferView()) {
|
|
|
|
auto buffer_body = body.As<v8::ArrayBufferView>();
|
|
|
|
auto backing_store = buffer_body->Buffer()->GetBackingStore();
|
|
|
|
request->request_body = network::ResourceRequestBody::CreateFromBytes(
|
|
|
|
static_cast<char*>(backing_store->Data()) + buffer_body->ByteOffset(),
|
|
|
|
buffer_body->ByteLength());
|
|
|
|
} else if (body->IsFunction()) {
|
|
|
|
auto body_func = body.As<v8::Function>();
|
|
|
|
|
|
|
|
mojo::PendingRemote<network::mojom::ChunkedDataPipeGetter>
|
|
|
|
data_pipe_getter;
|
|
|
|
chunk_pipe_getter = JSChunkedDataPipeGetter::Create(
|
|
|
|
args->isolate(), body_func,
|
|
|
|
data_pipe_getter.InitWithNewPipeAndPassReceiver())
|
|
|
|
.ToV8();
|
2021-01-25 16:46:00 +00:00
|
|
|
request->request_body =
|
|
|
|
base::MakeRefCounted<network::ResourceRequestBody>();
|
|
|
|
request->request_body->SetToChunkedDataPipe(
|
|
|
|
std::move(data_pipe_getter),
|
|
|
|
network::ResourceRequestBody::ReadOnlyOnce(false));
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-04 21:20:37 +00:00
|
|
|
ElectronBrowserContext* browser_context = nullptr;
|
|
|
|
if (electron::IsBrowserProcess()) {
|
|
|
|
std::string partition;
|
|
|
|
gin::Handle<Session> session;
|
|
|
|
if (!opts.Get("session", &session)) {
|
|
|
|
if (opts.Get("partition", &partition))
|
|
|
|
session = Session::FromPartition(args->isolate(), partition);
|
|
|
|
else // default session
|
|
|
|
session = Session::FromPartition(args->isolate(), "");
|
|
|
|
}
|
|
|
|
browser_context = session->browser_context();
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
|
2020-03-23 20:09:45 +00:00
|
|
|
auto ret = gin::CreateHandle(
|
2024-01-04 21:20:37 +00:00
|
|
|
args->isolate(),
|
|
|
|
new SimpleURLLoaderWrapper(browser_context, std::move(request), options));
|
2019-11-27 01:01:13 +00:00
|
|
|
ret->Pin();
|
|
|
|
if (!chunk_pipe_getter.IsEmpty()) {
|
|
|
|
ret->PinBodyGetter(chunk_pipe_getter);
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2024-07-29 13:37:35 +00:00
|
|
|
void SimpleURLLoaderWrapper::OnDataReceived(std::string_view string_view,
|
2019-11-27 01:01:13 +00:00
|
|
|
base::OnceClosure resume) {
|
2024-01-04 21:20:37 +00:00
|
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
2020-06-22 16:35:24 +00:00
|
|
|
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
2020-03-23 20:09:45 +00:00
|
|
|
v8::HandleScope handle_scope(isolate);
|
2024-07-29 13:37:35 +00:00
|
|
|
auto array_buffer = v8::ArrayBuffer::New(isolate, string_view.size());
|
2019-11-27 01:01:13 +00:00
|
|
|
auto backing_store = array_buffer->GetBackingStore();
|
2024-07-29 13:37:35 +00:00
|
|
|
memcpy(backing_store->Data(), string_view.data(), string_view.size());
|
2020-10-06 00:47:41 +00:00
|
|
|
Emit("data", array_buffer,
|
|
|
|
base::AdaptCallbackForRepeating(std::move(resume)));
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SimpleURLLoaderWrapper::OnComplete(bool success) {
|
|
|
|
if (success) {
|
|
|
|
Emit("complete");
|
|
|
|
} else {
|
|
|
|
Emit("error", net::ErrorToString(loader_->NetError()));
|
|
|
|
}
|
|
|
|
loader_.reset();
|
|
|
|
pinned_wrapper_.Reset();
|
|
|
|
pinned_chunk_pipe_getter_.Reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SimpleURLLoaderWrapper::OnResponseStarted(
|
|
|
|
const GURL& final_url,
|
|
|
|
const network::mojom::URLResponseHead& response_head) {
|
2020-06-22 16:35:24 +00:00
|
|
|
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
2020-03-23 20:09:45 +00:00
|
|
|
v8::HandleScope scope(isolate);
|
2023-08-21 01:43:41 +00:00
|
|
|
auto dict = gin::Dictionary::CreateEmpty(isolate);
|
2019-11-27 01:01:13 +00:00
|
|
|
dict.Set("statusCode", response_head.headers->response_code());
|
|
|
|
dict.Set("statusMessage", response_head.headers->GetStatusText());
|
|
|
|
dict.Set("httpVersion", response_head.headers->GetHttpVersion());
|
2022-12-21 22:53:29 +00:00
|
|
|
dict.Set("headers", response_head.headers.get());
|
2021-08-24 00:52:17 +00:00
|
|
|
dict.Set("rawHeaders", response_head.raw_response_headers);
|
2023-03-27 17:00:55 +00:00
|
|
|
dict.Set("mimeType", response_head.mime_type);
|
2019-11-27 01:01:13 +00:00
|
|
|
Emit("response-started", final_url, dict);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SimpleURLLoaderWrapper::OnRedirect(
|
2023-03-10 16:07:42 +00:00
|
|
|
const GURL& url_before_redirect,
|
2019-11-27 01:01:13 +00:00
|
|
|
const net::RedirectInfo& redirect_info,
|
|
|
|
const network::mojom::URLResponseHead& response_head,
|
|
|
|
std::vector<std::string>* removed_headers) {
|
|
|
|
Emit("redirect", redirect_info, response_head.headers.get());
|
2023-03-02 23:47:45 +00:00
|
|
|
|
|
|
|
if (!loader_)
|
|
|
|
// The redirect was aborted by JS.
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Optimization: if both the old and new URLs are handled by the network
|
|
|
|
// service, just FollowRedirect.
|
|
|
|
if (network::IsURLHandledByNetworkService(redirect_info.new_url) &&
|
|
|
|
network::IsURLHandledByNetworkService(request_->url))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Otherwise, restart the request (potentially picking a new
|
|
|
|
// URLLoaderFactory). See
|
|
|
|
// https://source.chromium.org/chromium/chromium/src/+/main:content/browser/loader/navigation_url_loader_impl.cc;l=534-550;drc=fbaec92ad5982f83aa4544d5c88d66d08034a9f4
|
|
|
|
|
|
|
|
bool should_clear_upload = false;
|
|
|
|
net::RedirectUtil::UpdateHttpRequest(
|
|
|
|
request_->url, request_->method, redirect_info, *removed_headers,
|
2024-01-10 22:23:35 +00:00
|
|
|
/* modified_headers = */ std::nullopt, &request_->headers,
|
2023-03-02 23:47:45 +00:00
|
|
|
&should_clear_upload);
|
|
|
|
if (should_clear_upload) {
|
|
|
|
// The request body is no longer applicable.
|
|
|
|
request_->request_body.reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
request_->url = redirect_info.new_url;
|
|
|
|
request_->method = redirect_info.new_method;
|
|
|
|
request_->site_for_cookies = redirect_info.new_site_for_cookies;
|
|
|
|
|
|
|
|
// See if navigation network isolation key needs to be updated.
|
|
|
|
request_->trusted_params->isolation_info =
|
|
|
|
request_->trusted_params->isolation_info.CreateForRedirect(
|
|
|
|
url::Origin::Create(request_->url));
|
|
|
|
|
|
|
|
request_->referrer = GURL(redirect_info.new_referrer);
|
|
|
|
request_->referrer_policy = redirect_info.new_referrer_policy;
|
|
|
|
request_->navigation_redirect_chain.push_back(redirect_info.new_url);
|
|
|
|
|
|
|
|
Start();
|
2019-11-27 01:01:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SimpleURLLoaderWrapper::OnUploadProgress(uint64_t position,
|
|
|
|
uint64_t total) {
|
|
|
|
Emit("upload-progress", position, total);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SimpleURLLoaderWrapper::OnDownloadProgress(uint64_t current) {
|
|
|
|
Emit("download-progress", current);
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
2020-03-23 20:09:45 +00:00
|
|
|
gin::ObjectTemplateBuilder SimpleURLLoaderWrapper::GetObjectTemplateBuilder(
|
|
|
|
v8::Isolate* isolate) {
|
|
|
|
return gin_helper::EventEmitterMixin<
|
|
|
|
SimpleURLLoaderWrapper>::GetObjectTemplateBuilder(isolate)
|
2019-11-27 01:01:13 +00:00
|
|
|
.SetMethod("cancel", &SimpleURLLoaderWrapper::Cancel);
|
|
|
|
}
|
|
|
|
|
2020-03-23 20:09:45 +00:00
|
|
|
const char* SimpleURLLoaderWrapper::GetTypeName() {
|
|
|
|
return "SimpleURLLoaderWrapper";
|
|
|
|
}
|
|
|
|
|
2022-06-29 19:55:47 +00:00
|
|
|
} // namespace electron::api
|