![trop[bot]](/assets/img/avatar_default.png)
* chore: bump chromium in DEPS to 140.0.7296.0
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
* chore: update patches
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6702959: Remove OwnedByWidgetPassKey usage from content analysis dialog tests | https://chromium-review.googlesource.com/c/chromium/src/+/6702959
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6722750: Remove un-used `stream_id` argument for `AidaCodeComplete` | https://chromium-review.googlesource.com/c/chromium/src/+/6722750
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6696478: Reland Reland [video pip] Add fade in/out animation to controls visibility changes | https://chromium-review.googlesource.com/c/chromium/src/+/6696478
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
* chore: update libc++-filenames
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
* build: explicitly include cstdlib in Boyer-Moore patch
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
* chore: bump chromium in DEPS to 140.0.7297.0
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
* chore: update patches
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6729537: [FPF] Pipe flag state from the browser to the renderer | https://chromium-review.googlesource.com/c/chromium/src/+/6729537
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6727996: [Win] Detect pre-IPC crashes in sandboxed utility processes | https://chromium-review.googlesource.com/c/chromium/src/+/6727996
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6707182: Move wtf/cross_thread_copier*.* to "blink" namespace | https://chromium-review.googlesource.com/c/chromium/src/+/6707182
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6730796: extensions: Extract safe browsing/telemetry methods to new client class | https://chromium-review.googlesource.com/c/chromium/src/+/6730796
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* chore: bump chromium in DEPS to 140.0.7299.0
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
* chore: update patches
Co-authored-by: patchup[bot] <73610968+patchup[bot]@users.noreply.github.com>
* chore: update main patches
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* build: reset the minimum macOS SDK to 15 to match upstream
This reverts commit 499e987c77
.
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6730215: Remove IPC_MESSAGE_LOG_ENABLED ifdef blocks. | https://chromium-review.googlesource.com/c/chromium/src/+/6730215
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6690442: Delete ppapi/buildflags/buildflags.h | https://chromium-review.googlesource.com/c/chromium/src/+/6690442
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6667681: Use more binaries from clang toolchain in mac build | https://chromium-review.googlesource.com/c/chromium/src/+/6667681
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* chore: bump chromium in DEPS to 140.0.7301.0
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
* chore: update patches
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6656309: extensions: Port proxy API to desktop Android | https://chromium-review.googlesource.com/c/chromium/src/+/6656309
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6758510: Reland 'Move GN enable_plugins variable out of //ppapi' | https://chromium-review.googlesource.com/c/chromium/src/+/6758510
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6701466: [Extensions] Remove NaCl arch info from Update Client URLs | https://chromium-review.googlesource.com/c/chromium/src/+/6701466
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6735979: [FSA] Replace `request_writable` with a new enum `FileSystemAccessPermissionMode`. | https://chromium-review.googlesource.com/c/chromium/src/+/6735979
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6712080: Reland "Turn on gender translation PAK generation everywhere" | https://chromium-review.googlesource.com/c/chromium/src/+/6712080
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6730796: extensions: Extract safe browsing/telemetry methods to new client class | https://chromium-review.googlesource.com/c/chromium/src/+/6730796
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* build: restore minimum macOS SDK to 10, restore patch
This reverts commit a04c579b994d5f4a782b793a69f34ff7a260e74f.
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* fixup! 6701466: [Extensions] Remove NaCl arch info from Update Client URLs | https://chromium-review.googlesource.com/c/chromium/src/+/6701466
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* chore: correct node patches
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
* fixup! 6667681: Use more binaries from clang toolchain in mac build | https://chromium-review.googlesource.com/c/chromium/src/+/6667681
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: patchup[bot] <73610968+patchup[bot]@users.noreply.github.com>
90 lines
4.5 KiB
Diff
90 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 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d41b0dbd3b 100644
|
|
--- a/net/url_request/static_http_user_agent_settings.h
|
|
+++ b/net/url_request/static_http_user_agent_settings.h
|
|
@@ -30,13 +30,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_;
|
|
};
|
|
|
|
} // namespace net
|
|
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
|
index 7bfd9b892a0e9f9fa9cbda53e98d137c7e7e8bba..d7f9c92d62983a7a9f0fcd679d56913078df83a6 100644
|
|
--- a/services/network/network_context.cc
|
|
+++ b/services/network/network_context.cc
|
|
@@ -1871,6 +1871,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 644123efb5f227b988b75938413ad769776d1592..d8fae5b75f3780f28dde5787465e449e7310539a 100644
|
|
--- a/services/network/network_context.h
|
|
+++ b/services/network/network_context.h
|
|
@@ -326,6 +326,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_CT_SUPPORTED)
|
|
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
|
index 507a33fb865ba7413711093298201ccf050d98de..01d94e27a27e112fe6846d9c1e127d63168fe236 100644
|
|
--- a/services/network/public/mojom/network_context.mojom
|
|
+++ b/services/network/public/mojom/network_context.mojom
|
|
@@ -1282,6 +1282,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 28dfc37ace19ff2fdfa18c3db89723b423e9b1db..ceaed0f3f58f744e207f51d8f1aaee42ec0e3ffe 100644
|
|
--- a/services/network/test/test_network_context.h
|
|
+++ b/services/network/test/test_network_context.h
|
|
@@ -158,6 +158,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_CT_SUPPORTED)
|