Skip to content
Permalink
Browse files

chore: bump chromium to 2a7aff41ce73adc0eeee67d364989 (master) (#18505)

* chore: bump chromium in DEPS to 07463d3cd628b037c11f36022cb4c788db4628e3

* chore: update patches

* fix: Don't leak system network context when nw service is disabled

https://chromium-review.googlesource.com/c/chromium/src/+/1632494
NetworkService is now deleted by using SequnceLocalStorageSlot
on the IO thread when the service is disabled, which expects
all associated NetworkContexts on that sequence to be destroyed.

* chore: bump chromium in DEPS to 7c16850e7e40990e141f47101b737ec1092175a1

* fix: Destroy all network contexts before primary network context

* Simplify out-of-process service registration

https://chromium-review.googlesource.com/c/chromium/src/+/1615882

* [ThreadPool] Rename base::ThreadPool to base::ThreadPoolInstance

https://chromium-review.googlesource.com/c/chromium/src/+/1634851

* chore: update patches

* fix: -Winconsistent-missing-override warnings

* chore: bump chromium in DEPS to 93ebfaccc12715df1d5426797998eed0932f7ae1

* Change CreateBrowserMainParts to return unique_ptrs

https://chromium-review.googlesource.com/c/chromium/src/+/1632532

* chore: update patches

* chore: bump chromium in DEPS to e656555ffb87bdd05e248d0a3ef9dd9d3433e17b

* chore: bump chromium in DEPS to 111e7a8d2e3ae9d70e535009d6afb066ac906063

* chore: bump chromium in DEPS to 9b6b84670d32a7aff41ce73adc0eeee67d364989

* chore: update patches

* chore: remove ShouldInterceptResourceAsStream as it is removed upstream

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1639597

* chore: remove ResourceDispatcherHostCreated as it is removed upstream

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1610892

* chore: CreateWithStrongBinding --> CreateWithSelfOwnedReceiver

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1636722

* chore: rename all blink media enums

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1639237

* chore: add accidentally removed patch content back
  • Loading branch information...
electron-bot authored and MarshallOfSound committed Jun 4, 2019
1 parent 641e1d6 commit d008d217f9219c5f867a67139e1aa6779fc152e4
Showing with 268 additions and 397 deletions.
  1. +1 −1 DEPS
  2. +2 −2 atom/app/node_main.cc
  3. +3 −22 atom/browser/atom_browser_client.cc
  4. +1 −2 atom/browser/atom_browser_client.h
  5. +5 −4 atom/browser/atom_browser_context.cc
  6. +0 −74 atom/browser/atom_resource_dispatcher_host_delegate.cc
  7. +0 −6 atom/browser/atom_resource_dispatcher_host_delegate.h
  8. +0 −1 atom/browser/browser_process_impl.h
  9. +31 −8 atom/browser/io_thread.cc
  10. +17 −7 atom/browser/io_thread.h
  11. +12 −10 atom/browser/media/media_stream_devices_controller.cc
  12. +1 −1 atom/browser/media/media_stream_devices_controller.h
  13. +1 −1 atom/browser/net/system_network_context_manager.cc
  14. +16 −10 atom/browser/net/url_request_context_getter.cc
  15. +1 −1 atom/browser/net/url_request_context_getter.h
  16. +3 −3 atom/browser/notifications/win/windows_toast_notification.h
  17. +1 −1 atom/browser/web_contents_permission_helper.cc
  18. +3 −1 electron_paks.gni
  19. +0 −10 electron_strings.grdp
  20. +2 −3 patches/common/chromium/.patches
  21. +2 −2 patches/common/chromium/add_contentgpuclient_precreatemessageloop_callback.patch
  22. +2 −2 patches/common/chromium/allow_webview_file_url.patch
  23. +13 −5 patches/common/chromium/autofill_size_calculation.patch
  24. +3 −3 patches/common/chromium/blink_local_frame.patch
  25. +2 −2 patches/common/chromium/blink_world_context.patch
  26. +12 −12 patches/common/chromium/can_create_window.patch
  27. +2 −2 patches/common/chromium/content_allow_embedder_to_prevent_locking_scheme_registry.patch
  28. +1 −1 patches/common/chromium/content_browser_main_loop.patch
  29. +7 −7 patches/common/chromium/cross_site_document_resource_handler.patch
  30. +1 −1 patches/common/chromium/dcheck.patch
  31. +4 −4 patches/common/chromium/disable-redraw-lock.patch
  32. +5 −5 patches/common/chromium/disable_color_correct_rendering.patch
  33. +2 −2 patches/common/chromium/disable_detach_webview_frame.patch
  34. +1 −1 patches/common/chromium/disable_hidden.patch
  35. +10 −10 patches/common/chromium/disable_network_services_by_default.patch
  36. +2 −2 patches/common/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch
  37. +0 −36 patches/common/chromium/dom_storage_limits.patch
  38. +2 −2 patches/common/chromium/exclude-a-few-test-files-from-build.patch
  39. +1 −1 patches/common/chromium/feat_offscreen_rendering_with_viz_compositor.patch
  40. +23 −22 patches/common/chromium/frame_host_manager.patch
  41. +2 −2 patches/common/chromium/gritsettings_resource_ids.patch
  42. +6 −6 patches/common/chromium/mas-lssetapplicationlaunchservicesserverconnectionstatus.patch
  43. +1 −1 patches/common/chromium/no_cache_storage_check.patch
  44. +4 −4 patches/common/chromium/notification_provenance.patch
  45. +4 −4 patches/common/chromium/printing.patch
  46. +3 −3 patches/common/chromium/render_widget_host_view_mac.patch
  47. +3 −3 patches/common/chromium/resource_file_conflict.patch
  48. +2 −2 patches/common/chromium/scroll_bounce_flag.patch
  49. +0 −27 patches/common/chromium/stream_resource_handler.patch
  50. +5 −5 patches/common/chromium/support_mixed_sandbox_with_zygote.patch
  51. +2 −2 patches/common/chromium/unsandboxed_ppapi_processes_skip_zygote.patch
  52. +3 −3 patches/common/chromium/web_contents.patch
  53. +1 −1 patches/common/chromium/webview_cross_drag.patch
  54. +5 −12 patches/common/chromium/woa_compiler_workaround.patch
  55. +12 −12 patches/common/chromium/worker_context_will_destroy.patch
  56. +1 −1 patches/common/v8/add_realloc.patch
  57. +3 −3 patches/common/v8/build_gn.patch
  58. +2 −2 patches/common/v8/dcheck.patch
  59. +1 −1 patches/common/v8/deps_provide_more_v8_backwards_compatibility.patch
  60. +2 −2 patches/common/v8/expose_mksnapshot.patch
  61. +11 −11 patches/common/v8/workaround_an_undefined_symbol_error.patch
2 DEPS
@@ -10,7 +10,7 @@ gclient_gn_args = [

vars = {
'chromium_version':
'ab588d36191964c4bca8de5c320534d95606c861',
'9b6b84670d32a7aff41ce73adc0eeee67d364989',
'node_version':
'b823596192bb790f9ea2a61022b55bf50e6daa83',
'nan_version':
@@ -48,7 +48,7 @@ int NodeMain(int argc, char* argv[]) {
gin::V8Initializer::LoadV8Natives();

// V8 requires a task scheduler apparently
base::ThreadPool::CreateAndStartWithDefaultParams("Electron");
base::ThreadPoolInstance::CreateAndStartWithDefaultParams("Electron");

// Initialize gin::IsolateHolder.
JavascriptEnvironment gin_env(loop);
@@ -116,7 +116,7 @@ int NodeMain(int argc, char* argv[]) {
// gin::IsolateHolder waits for tasks running in ThreadPool in its
// destructor and thus must be destroyed before ThreadPool starts skipping
// CONTINUE_ON_SHUTDOWN tasks.
base::ThreadPool::GetInstance()->Shutdown();
base::ThreadPoolInstance::Get()->Shutdown();

v8::V8::Dispose();

@@ -79,7 +79,6 @@
#include "services/device/public/cpp/geolocation/location_provider.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/resource_request_body.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "v8/include/v8.h"
@@ -111,8 +110,6 @@

#if BUILDFLAG(ENABLE_PRINTING)
#include "chrome/browser/printing/printing_message_filter.h"
#include "chrome/services/printing/public/mojom/constants.mojom.h"
#include "components/services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h"
#endif // BUILDFLAG(ENABLE_PRINTING)

using content::BrowserThread;
@@ -715,23 +712,6 @@ network::mojom::NetworkContext* AtomBrowserClient::GetSystemNetworkContext() {
return g_browser_process->system_network_context_manager()->GetContext();
}

void AtomBrowserClient::RegisterOutOfProcessServices(
OutOfProcessServiceMap* services) {
(*services)[proxy_resolver::mojom::kProxyResolverServiceName] =
base::BindRepeating(&l10n_util::GetStringUTF16,
IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME);

#if BUILDFLAG(ENABLE_PRINTING)
(*services)[printing::mojom::kServiceName] =
base::BindRepeating(&l10n_util::GetStringUTF16,
IDS_UTILITY_PROCESS_PDF_COMPOSITOR_SERVICE_NAME);

(*services)[printing::mojom::kChromePrintingServiceName] =
base::BindRepeating(&l10n_util::GetStringUTF16,
IDS_UTILITY_PROCESS_PRINTING_SERVICE_NAME);
#endif
}

base::Optional<service_manager::Manifest>
AtomBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
if (name == content::mojom::kBrowserServiceName)
@@ -748,9 +728,10 @@ net::NetLog* AtomBrowserClient::GetNetLog() {
return g_browser_process->net_log();
}

content::BrowserMainParts* AtomBrowserClient::CreateBrowserMainParts(
std::unique_ptr<content::BrowserMainParts>
AtomBrowserClient::CreateBrowserMainParts(
const content::MainFunctionParams& params) {
return new AtomBrowserMainParts(params);
return std::make_unique<AtomBrowserMainParts>(params);
}

void AtomBrowserClient::WebNotificationAllowed(
@@ -145,7 +145,6 @@ class AtomBrowserClient : public content::ContentBrowserClient,
bool in_memory,
const base::FilePath& relative_partition_path) override;
network::mojom::NetworkContext* GetSystemNetworkContext() override;
void RegisterOutOfProcessServices(OutOfProcessServiceMap* services) override;
base::Optional<service_manager::Manifest> GetServiceManifestOverlay(
base::StringPiece name) override;
std::vector<service_manager::Manifest> GetExtraServiceManifests() override;
@@ -154,7 +153,7 @@ class AtomBrowserClient : public content::ContentBrowserClient,
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
content::PlatformNotificationService* GetPlatformNotificationService(
content::BrowserContext* browser_context) override;
content::BrowserMainParts* CreateBrowserMainParts(
std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(
const content::MainFunctionParams&) override;
base::FilePath GetDefaultDownloadDirectory() override;
scoped_refptr<network::SharedURLLoaderFactory>
@@ -110,11 +110,12 @@ AtomBrowserContext::~AtomBrowserContext() {
NotifyWillBeDestroyed(this);
ShutdownStoragePartitions();

BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE,
std::move(resource_context_));

if (!base::FeatureList::IsEnabled(network::features::kNetworkService))
if (!base::FeatureList::IsEnabled(network::features::kNetworkService)) {
io_handle_->ShutdownOnUIThread();
} else {
BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE,
std::move(resource_context_));
}

// Notify any keyed services of browser context destruction.
BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
@@ -27,80 +27,6 @@ using content::BrowserThread;

namespace atom {

namespace {

#if BUILDFLAG(ENABLE_PDF_VIEWER)
void OnPdfResourceIntercepted(
const GURL& original_url,
int render_process_host_id,
int render_frame_id,
const content::ResourceRequestInfo::WebContentsGetter&
web_contents_getter) {
content::WebContents* web_contents = web_contents_getter.Run();
if (!web_contents)
return;

auto* web_preferences = WebContentsPreferences::From(web_contents);
if (!web_preferences || !web_preferences->IsEnabled(options::kPlugins)) {
auto* browser_context = web_contents->GetBrowserContext();
auto* download_manager =
content::BrowserContext::GetDownloadManager(browser_context);

download_manager->DownloadUrl(
content::DownloadUrlParameters::CreateForWebContentsMainFrame(
web_contents, original_url, NO_TRAFFIC_ANNOTATION_YET));
return;
}

// The URL passes the original pdf resource url, that will be requested
// by the webui page.
// chrome://pdf-viewer/index.html?src=https://somepage/123.pdf
content::NavigationController::LoadURLParams params(GURL(base::StringPrintf(
"%sindex.html?%s=%s", kPdfViewerUIOrigin, kPdfPluginSrc,
net::EscapeUrlEncodedData(original_url.spec(), false).c_str())));

content::RenderFrameHost* frame_host =
content::RenderFrameHost::FromID(render_process_host_id, render_frame_id);
if (!frame_host) {
return;
}

params.frame_tree_node_id = frame_host->GetFrameTreeNodeId();
web_contents->GetController().LoadURLWithParams(params);
}
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)

} // namespace

AtomResourceDispatcherHostDelegate::AtomResourceDispatcherHostDelegate() {}

bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
net::URLRequest* request,
const std::string& mime_type,
GURL* origin,
std::string* payload) {
#if BUILDFLAG(ENABLE_PDF_VIEWER)
content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);

int render_process_host_id;
int render_frame_id;
if (!info->GetAssociatedRenderFrame(&render_process_host_id,
&render_frame_id)) {
return false;
}

if (mime_type == "application/pdf") {
*origin = GURL(kPdfViewerUIOrigin);
base::PostTaskWithTraits(
FROM_HERE, {BrowserThread::UI},
base::BindOnce(&OnPdfResourceIntercepted, request->url(),
render_process_host_id, render_frame_id,
info->GetWebContentsGetterForRequest()));
return true;
}
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
return false;
}

} // namespace atom
@@ -16,12 +16,6 @@ class AtomResourceDispatcherHostDelegate
public:
AtomResourceDispatcherHostDelegate();

// content::ResourceDispatcherHostDelegate:
bool ShouldInterceptResourceAsStream(net::URLRequest* request,
const std::string& mime_type,
GURL* origin,
std::string* payload) override;

private:
DISALLOW_COPY_AND_ASSIGN(AtomResourceDispatcherHostDelegate);
};
@@ -48,7 +48,6 @@ class BrowserProcessImpl : public BrowserProcess {
void PostDestroyThreads();
void PostMainMessageLoopRun();

void ResourceDispatcherHostCreated() override {}
void EndSession() override {}
void FlushLocalStateAndReply(base::OnceClosure reply) override {}
bool IsShuttingDown() override;
@@ -6,6 +6,7 @@

#include <utility>

#include "atom/browser/net/url_request_context_getter.h"
#include "components/net_log/chrome_net_log.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/network_service_instance.h"
@@ -35,6 +36,24 @@ IOThread::~IOThread() {
BrowserThread::SetIOThreadDelegate(nullptr);
}

void IOThread::RegisterURLRequestContextGetter(
atom::URLRequestContextGetter* getter) {
base::AutoLock lock(lock_);

DCHECK(!base::FeatureList::IsEnabled(network::features::kNetworkService));
DCHECK_EQ(0u, request_context_getters_.count(getter));
request_context_getters_.insert(getter);
}

void IOThread::DeregisterURLRequestContextGetter(
atom::URLRequestContextGetter* getter) {
base::AutoLock lock(lock_);

DCHECK(!base::FeatureList::IsEnabled(network::features::kNetworkService));
DCHECK_EQ(1u, request_context_getters_.count(getter));
request_context_getters_.erase(getter);
}

void IOThread::Init() {
if (!base::FeatureList::IsEnabled(network::features::kNetworkService)) {
std::unique_ptr<network::URLRequestContextBuilderMojo> builder =
@@ -55,20 +74,24 @@ void IOThread::Init() {
network_service->ConfigureHttpAuthPrefs(
std::move(http_auth_dynamic_params_));

system_network_context_ =
network_service
->CreateNetworkContextWithBuilder(
std::move(network_context_request_),
std::move(network_context_params_), std::move(builder),
&system_request_context_)
.release();
system_network_context_ = network_service->CreateNetworkContextWithBuilder(
std::move(network_context_request_), std::move(network_context_params_),
std::move(builder), &system_request_context_);
}
}

void IOThread::CleanUp() {
if (!base::FeatureList::IsEnabled(network::features::kNetworkService))
if (!base::FeatureList::IsEnabled(network::features::kNetworkService)) {
system_request_context_->proxy_resolution_service()->OnShutdown();

base::AutoLock lock(lock_);
for (auto* getter : request_context_getters_) {
getter->NotifyContextShuttingDown();
}

system_network_context_.reset();
}

if (net_log_)
net_log_->ShutDownBeforeThreadPool();
}
@@ -6,12 +6,18 @@
#define ATOM_BROWSER_IO_THREAD_H_

#include <memory>
#include <set>

#include "atom/browser/net/system_network_context_manager.h"
#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "content/public/browser/browser_thread_delegate.h"
#include "services/network/public/mojom/network_service.mojom.h"

namespace atom {
class URLRequestContextGetter;
}

namespace net {
class URLRequestContext;
}
@@ -27,6 +33,9 @@ class IOThread : public content::BrowserThreadDelegate {
SystemNetworkContextManager* system_network_context_manager);
~IOThread() override;

void RegisterURLRequestContextGetter(atom::URLRequestContextGetter* getter);
void DeregisterURLRequestContextGetter(atom::URLRequestContextGetter* getter);

protected:
// BrowserThreadDelegate Implementation, runs on the IO thread.
void Init() override;
@@ -39,13 +48,7 @@ class IOThread : public content::BrowserThreadDelegate {

// When the network service is disabled, this holds on to a
// content::NetworkContext class that owns |system_request_context_|.
// TODO(deepak1556): primary network context has to be destroyed after
// other active contexts, but since the ownership of latter is not released
// before IO thread is destroyed, it results in a DCHECK failure.
// We leak the reference to primary context to workaround this issue,
// since there is only one instance for the entire lifetime of app, it is
// safe.
network::mojom::NetworkContext* system_network_context_;
std::unique_ptr<network::mojom::NetworkContext> system_network_context_;
net::URLRequestContext* system_request_context_;

// These are set on the UI thread, and then consumed during initialization on
@@ -59,6 +62,13 @@ class IOThread : public content::BrowserThreadDelegate {
network::mojom::HttpAuthStaticParamsPtr http_auth_static_params_;
network::mojom::HttpAuthDynamicParamsPtr http_auth_dynamic_params_;

// |lock_| protects access to |request_context_getters_|.
base::Lock lock_;

// List of all request contexts that needs to be notified when
// IO thread is shutting down.
std::set<atom::URLRequestContextGetter*> request_context_getters_;

DISALLOW_COPY_AND_ASSIGN(IOThread);
};

@@ -42,9 +42,10 @@ MediaStreamDevicesController::MediaStreamDevicesController(

MediaStreamDevicesController::~MediaStreamDevicesController() {
if (!callback_.is_null()) {
std::move(callback_).Run(blink::MediaStreamDevices(),
blink::MEDIA_DEVICE_FAILED_DUE_TO_SHUTDOWN,
std::unique_ptr<content::MediaStreamUI>());
std::move(callback_).Run(
blink::MediaStreamDevices(),
blink::mojom::MediaStreamRequestResult::FAILED_DUE_TO_SHUTDOWN,
std::unique_ptr<content::MediaStreamUI>());
}
}

@@ -60,7 +61,7 @@ bool MediaStreamDevicesController::TakeAction() {

// Deny the request if there is no device attached to the OS.
if (!HasAnyAvailableDevice()) {
Deny(blink::MEDIA_DEVICE_NO_HARDWARE);
Deny(blink::mojom::MediaStreamRequestResult::NO_HARDWARE);
return true;
}

@@ -146,12 +147,12 @@ void MediaStreamDevicesController::Accept() {
}
}

std::move(callback_).Run(devices, blink::MEDIA_DEVICE_OK,
std::move(callback_).Run(devices, blink::mojom::MediaStreamRequestResult::OK,
std::unique_ptr<content::MediaStreamUI>());
}

void MediaStreamDevicesController::Deny(
blink::MediaStreamRequestResult result) {
blink::mojom::MediaStreamRequestResult result) {
std::move(callback_).Run(blink::MediaStreamDevices(), result,
std::unique_ptr<content::MediaStreamUI>());
}
@@ -188,10 +189,11 @@ void MediaStreamDevicesController::HandleUserMediaRequest() {
screen_id.ToString(), "Screen"));
}

std::move(callback_).Run(devices,
devices.empty() ? blink::MEDIA_DEVICE_NO_HARDWARE
: blink::MEDIA_DEVICE_OK,
std::unique_ptr<content::MediaStreamUI>());
std::move(callback_).Run(
devices,
devices.empty() ? blink::mojom::MediaStreamRequestResult::NO_HARDWARE
: blink::mojom::MediaStreamRequestResult::OK,
std::unique_ptr<content::MediaStreamUI>());
}

} // namespace atom

0 comments on commit d008d21

Please sign in to comment.
You can’t perform that action at this time.