mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: bump chromium in DEPS to 93.0.4567.0 * chore: update patches * chore: bump chromium in DEPS to 93.0.4568.0 * chore: bump chromium in DEPS to 93.0.4569.0 * chore: update patches (cherry picked from commit e710b8ea15f0ec08966e89d37e6ff73414180e6b) * 3000931: Code health: remove base::ListValue from DevToolsEmbedderMessageDispatcher https://chromium-review.googlesource.com/c/chromium/src/+/3000931 (cherry picked from commit 44c00b98f27621f6345bcf5d78f3e2649147135b) * chore: bump chromium in DEPS to 93.0.4570.0 * chore: update patches * chore: bump chromium in DEPS to 93.0.4571.0 * chore: update patches * chore: bump chromium in DEPS to 93.0.4573.0 * chore: bump chromium in DEPS to 93.0.4574.0 * chore: bump chromium in DEPS to 93.0.4575.0 * chore: bump chromium in DEPS to 93.0.4576.0 * chore: bump chromium in DEPS to 93.0.4577.0 * chore: bump chromium in DEPS to 93.0.4577.3 * chore: bump chromium in DEPS to 93.0.4577.4 * 3011898: Reland "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)" https://chromium-review.googlesource.com/c/chromium/src/+/3011898 (cherry picked from commitc46148eed8) * 2974072: Swap base/stl_util.h to base/cxx17_backports.h in many files. https://chromium-review.googlesource.com/c/chromium/src/+/2974072 (cherry picked from commit4d725e44ca) * chore: add missing header (cherry picked from commitf3993e71ce) * Reland "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)" https://chromium-review.googlesource.com/c/chromium/src/+/2988699 (cherry picked from commit797723ec83) (cherry picked from commit4a325c9b24) * 2925476: Migrate t/b/{public,renderer}/platform/media to blink ns [4/6] https://chromium-review.googlesource.com/c/chromium/src/+/2925476 (cherry picked from commit0930c0ee41) * 2974074: Remove base/cxx17_backports.h from stl_util.h. https://chromium-review.googlesource.com/c/chromium/src/+/2974074 (cherry picked from commita7b53b61f4) * fixup: 2974074: Remove base/cxx17_backports.h from stl_util.h. (cherry picked from commitaf5da4dcb1) * chore: update patches * fix: invalid operands compilation error (cherry picked from commit6fa6f8acb9) * 3001416: Fix -Wimplicit-int-float-conversion. https://chromium-review.googlesource.com/c/chromium/src/+/3001416 (cherry picked from commitb2e9f2212e) * 3022548: Removing windows.h includes from some base headers https://chromium-review.googlesource.com/c/chromium/src/+/3022548 (cherry picked from commit8b48103907) * 3029258: Remove unused JobEventDetails::Type enum values https://chromium-review.googlesource.com/c/chromium/src/+/3029258 Cherry picked fromc15df3a109Co-Authored-By: Shelley Vohr <shelley.vohr@gmail.com> * 3029185: printing: Use mojom::PrinterType instead of PrinterType https://chromium-review.googlesource.com/c/chromium/src/+/3029185 (cherry picked from commitd16fab76fb) * Update application_info_win.cc (cherry picked from commit6e187f8617) * include windows.h in process_singleton_win.cc (cherry picked from commitaf58ad2d9d) * chore: bump chromium in DEPS to 93.0.4577.8 * chore: update patches * do not create a new UserScriptManager every time the accessor is called (cherry picked from commit24a71035ab) * chore: Revert "Roll clang llvmorg-13-init-14732-g8a7b5ebf-2 : llvmorg-13-init-15040-gc10947b5-1" * chore: remove no longer needed patch * Update the "py" wheel to a version that is compatible with pytest-6.2.2. https://chromium-review.googlesource.com/c/chromium/src/+/3044950 * chore: bump chromium in DEPS to 93.0.4577.15 * chore: update patches * chore: fixup parallel/test-errors-systemerror node test Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
91 lines
4.5 KiB
Diff
91 lines
4.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jeremy Apthorp <nornagon@nornagon.net>
|
|
Date: Wed, 28 Aug 2019 12:21:25 -0700
|
|
Subject: expose SetUserAgent on NetworkContext
|
|
|
|
Applying
|
|
https://chromium-review.googlesource.com/c/chromium/src/+/1585083 before
|
|
it's merged. There may end up being a better way of doing this, or the
|
|
patch may be merged upstream, at which point this patch should be
|
|
removed.
|
|
|
|
diff --git a/net/url_request/static_http_user_agent_settings.h b/net/url_request/static_http_user_agent_settings.h
|
|
index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a289703d8b0577 100644
|
|
--- a/net/url_request/static_http_user_agent_settings.h
|
|
+++ b/net/url_request/static_http_user_agent_settings.h
|
|
@@ -26,13 +26,17 @@ class NET_EXPORT StaticHttpUserAgentSettings : public HttpUserAgentSettings {
|
|
accept_language_ = new_accept_language;
|
|
}
|
|
|
|
+ void set_user_agent(const std::string& new_user_agent) {
|
|
+ user_agent_ = new_user_agent;
|
|
+ }
|
|
+
|
|
// HttpUserAgentSettings implementation
|
|
std::string GetAcceptLanguage() const override;
|
|
std::string GetUserAgent() const override;
|
|
|
|
private:
|
|
std::string accept_language_;
|
|
- const std::string user_agent_;
|
|
+ std::string user_agent_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings);
|
|
};
|
|
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
|
index 83fde65c34f12fee6b2ef867f94fdd31252b60cf..c5012949a034f12ca466f5e5e791a1f4569d813f 100644
|
|
--- a/services/network/network_context.cc
|
|
+++ b/services/network/network_context.cc
|
|
@@ -1195,6 +1195,13 @@ void NetworkContext::SetNetworkConditions(
|
|
std::move(network_conditions));
|
|
}
|
|
|
|
+void NetworkContext::SetUserAgent(const std::string& new_user_agent) {
|
|
+ // This may only be called on NetworkContexts created with a constructor that
|
|
+ // calls ApplyContextParamsToBuilder.
|
|
+ DCHECK(user_agent_settings_);
|
|
+ user_agent_settings_->set_user_agent(new_user_agent);
|
|
+}
|
|
+
|
|
void NetworkContext::SetAcceptLanguage(const std::string& new_accept_language) {
|
|
// This may only be called on NetworkContexts created with the constructor
|
|
// that calls MakeURLRequestContext().
|
|
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
|
index 1f09e757f9ac7f9f101066beddbd2f540cfd5b7d..43b461c1fa12ed38975a90a08987620088236dad 100644
|
|
--- a/services/network/network_context.h
|
|
+++ b/services/network/network_context.h
|
|
@@ -255,6 +255,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
|
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
|
|
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
|
|
mojom::NetworkConditionsPtr conditions) override;
|
|
+ void SetUserAgent(const std::string& new_user_agent) override;
|
|
void SetAcceptLanguage(const std::string& new_accept_language) override;
|
|
void SetEnableReferrers(bool enable_referrers) override;
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
|
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
|
index 5dfc30d2feb37f78dd6eac088366a0dc3e1cf8e4..1da7a1d0103057df3b95f472f3b98c22d081fd8c 100644
|
|
--- a/services/network/public/mojom/network_context.mojom
|
|
+++ b/services/network/public/mojom/network_context.mojom
|
|
@@ -957,6 +957,9 @@ interface NetworkContext {
|
|
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
|
|
NetworkConditions? conditions);
|
|
|
|
+ // Updates the user agent to be used for requests.
|
|
+ SetUserAgent(string new_user_agent);
|
|
+
|
|
// Updates the Accept-Language header to be used for requests.
|
|
SetAcceptLanguage(string new_accept_language);
|
|
|
|
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
|
|
index 0d928e7db97bcc2ac99eea0e46a2f0b8405ddfb9..b325c08a447abb2424f08fb11abe2b1375e4b920 100644
|
|
--- a/services/network/test/test_network_context.h
|
|
+++ b/services/network/test/test_network_context.h
|
|
@@ -123,6 +123,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
|
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {}
|
|
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
|
|
mojom::NetworkConditionsPtr conditions) override {}
|
|
+ void SetUserAgent(const std::string& new_user_agent) override {}
|
|
void SetAcceptLanguage(const std::string& new_accept_language) override {}
|
|
void SetEnableReferrers(bool enable_referrers) override {}
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|