chore: bump chromium to f1d9522c04ca8fa0a906f88ababe9 (master) (#18648)
* chore: bump chromium in DEPS to 675d7dc9f3334b15c3ec28c27db3dc19b26bd12e * chore: update patches * chore: bump chromium in DEPS to dce3562696f165a324273fcb6893f0e1fef42ab1 * chore: const interfaces are being removed from //content Refs:1631749
Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=908139 * chore: update patches * chore: blink::MediaStreamType is now consistent and deduplicated * chore: update patches and printing code for ref -> uniq * chore: bridge_impl() --> GetInProcessNSWindowBridge Refs:1642988
* fixme: TotalMarkedObjectSize has been removed * chore: fix linting * chore: bump chromium in DEPS to 9503e1a2fcbf17db08094d8caae3e1407e918af3 * chore: fix slightly broken printing patch * chore: update patches for SiteInstanceImpl changes Refs:1612025
* chore: update patches for SiteInstanceImpl changes * chore: bump chromium in DEPS to 6801e6c1ddd1b7b73e594e97157ddd539ca335d7 * chore: update patches * chore: bump chromium in DEPS to 27e198912d7c1767052ec785c22e2e88b2cb4d8b * chore: remove system_request_context Refs:1647172
* chore: creation of FtpProtocolHandler needs an auth cache Refs:1639683
* fixme: disable marked spec * chore: bump chromium in DEPS to 3dcd7fe453ad13a22b114b95f05590eba74c5471 * chore: bump chromium in DEPS to bdc24128b75008743d819e298557a53205706e7c * chore: bump chromium in DEPS to 7da330b58fbe0ba94b9b94abbb8085bead220228 * update patches * remove TotalMarkedObjectSize1631708
* add libvulkan.so to dist zip manifest on linux * chore: bump chromium in DEPS to 1e85d0f45b52649efd0010cc9dab6d2804f24443 * update patches * add angle features to gpuinfo1638658
* mark 'marked' property as deprecated * disable webview resize test * FIXME: disable vulkan on 32-bit arm * chore: bump chromium in DEPS to cd0297c6a83fdd2b1f6bc312e7d5acca736a3c56 * Revert "FIXME: disable vulkan on 32-bit arm" This reverts commit 5c1e0ef302a6db1e72231d4e823f91bb08e281af. * backport from upstream: fix swiftshader build on arm https://swiftshader-review.googlesource.com/c/SwiftShader/+/32768/ * update patches * viz: update OutputDeviceWin to new shared memory api1649574
* base::Contains{Key,Value} => base::Contains1649478
* fixup! viz: update OutputDeviceWin to new shared memory api * stub out StatusIconLinuxDbus-related delegate methods1638180
* chore: bump chromium in DEPS to 964ea3fd4bdc006d62533f5755043076220181f1 * Remove the BrowserContext methods to create URLRequestContexts for main/media partitions when a partition_domain is specified1655087
* fixup! stub out StatusIconLinuxDbus-related delegate methods * add remote_cocoa to chromium_src deps1657068
* fixup! stub out StatusIconLinuxDbus-related delegate methods * attempt at fix linux-debug build * add swiftshader/libvulkan.so to arm manifest * chore: bump chromium in DEPS to 28688f76afef27c36631aa274691e333ddecdc22 * update patches * chore: bump chromium in DEPS to fe7450e1578a9584189f87d59d0d1a8548bf6b90 * chore: bump chromium in DEPS to f304dfd682dc86a755a6c49a16ee6876e0db45fb * chore: bump chromium in DEPS to f0fd4d6c365aad9edd83bdfff9954c47d271b75c * Update patches * Remove no longer needed WOA patch * Put back IOThread in BrowserProcess We need this until we enable the network service. * move atom.ico to inputs * Update to latest LKGR to fix no template named 'bitset' in namespace 'std' * fixup! Put back IOThread in BrowserProcess * chore: bump chromium in DEPS to dcf9662dc9a896a175d791001350324167b1cad3 * Update patches content_allow_embedder_to_prevent_locking_scheme_registry.patch is no longer necessary as it was upstreamed via1637040
* Fix renamed enum * Use newer docker container Contains updated dependencies * Try to track down arm test failures * Fix arm tests * chore: bump chromium in DEPS to 8cbceef57b37ee14b9c4c3405a3f7663922c5b5d * Update patches * Add needed dependencies for testing 32-bit linux * Remove arm debugging. * Remove additional debugging * Fix compiler errors * Handle new macOS helper * Fix compile error on Linux * chore: bump chromium in DEPS to 66a93991ddaff6a9f1b13d110959947cb03a1860 * Add new helper files to manifests * fix BUILD.gn for macOS * Fix compile errors * Add patch to put back colors needed for autofill/datalist * chore: bump chromium in DEPS to e89617079f11e33f33cdb3924f719a579c73704b * Updated patches * Remove no longer needed patch * Remove no longer needed patch * Fix compile error with patch * Really fix the patch * chore: bump chromium in DEPS to c70f12476a45840408f1d5ff5968e7f7ceaad9d4 * chore: bump chromium in DEPS to 06d2dd7a8933b41545a7c26349c802f570563fd5 * chore: bump chromium in DEPS to b0b9ff8f727deb519ccbec7cf1c8d9ed543d88ab * Update patches * Fix compiler errors * Fix removed ChromeNetLog * Revert "Fix removed ChromeNetLog" This reverts commit 426dfd90b5ab0a9c1df415d71c88e8aed2bd5bbe. * Remove ChromeNetLog.1663846
* chore: bump chromium in DEPS to fefcc4926d58dccd59ac95be65eab3a4ebfe2f29 * Update patches * Update v8 patches * Fix lint error * Fix compile errors * chore: bump chromium in DEPS to 4de815ef92ef2eef515506fe09bdc466526a8fd9 * Use custom protocol to test baseURLForDataURL * Use newer SDK (10.0.18362) for Windows * Update patches * Update arm manifest since swiftshader reenabled. * Don't delete dir that isn't ever there. * Fix compile errors. * Need src dir created * Update for removed InspectorFrontendAPI.addExtensions * Revert "Use newer SDK (10.0.18362) for Windows" This reverts commit 68763a0c88cdc44b971462e49662aecc167d3d99. * Revert "Need src dir created" This reverts commit 7daedc29d0844316d4097648dde7f40f1a3848fb. * Revert "Don't delete dir that isn't ever there." This reverts commit bf424bc30ffcb23b1d9a634d4df410342536640e. * chore: bump chromium in DEPS to 97dab6b0124ea53244caf123921b5d14893bcca7 * chore: bump chromium in DEPS to c87d16d49a85dc7122781f6c979d354c20f7f78b * chore: bump chromium in DEPS to 004bcee2ea336687cedfda8f8a151806ac757d15 * chore: bump chromium in DEPS to 24428b26a9d15a013b2a253e1084ec3cb54b660b * chore: bump chromium in DEPS to fd25914e875237df88035a6abf89a70bf1360b57 * Update patches * Update node to fix build error * Fix compile errors * chore: bump chromium in DEPS to 3062b7cf090f1d9522c04ca8fa0a906f88ababe9 * chore: update node ref for pushed tags * chore: update patches for new chromium * chore: fix printing patches * Use new (10.0.18362) Windows SDK * roll node to fix v8 build issues in debug build * Add support for plugin helper * fix: add patch to fix gpu info enumeration Can be removed once CL lands upstream. Refs:1685993
* spec: navigator.requestMIDIAccess now requires a secure origin This test requires a secure origin so we fake one. Refs:1657952
* FIXME: temporarily disable SharedWorker tests * use released version of node-abstractsocket * fix abstract-socket
This commit is contained in:
parent
9bef48216f
commit
50b9c7051e
143 changed files with 1040 additions and 926 deletions
|
@ -737,7 +737,7 @@ void App::AllowCertificateError(
|
|||
callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY);
|
||||
}
|
||||
|
||||
void App::SelectClientCertificate(
|
||||
base::OnceClosure App::SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
net::ClientCertIdentityList identities,
|
||||
|
@ -769,6 +769,7 @@ void App::SelectClientCertificate(
|
|||
std::move((*shared_identities)[0]),
|
||||
base::BindRepeating(&GotPrivateKey, shared_delegate, std::move(cert)));
|
||||
}
|
||||
return base::OnceClosure();
|
||||
}
|
||||
|
||||
void App::OnGpuInfoUpdate() {
|
||||
|
|
|
@ -123,7 +123,7 @@ class App : public AtomBrowserClient::Delegate,
|
|||
bool expired_previous_decision,
|
||||
const base::RepeatingCallback<
|
||||
void(content::CertificateRequestResultType)>& callback) override;
|
||||
void SelectClientCertificate(
|
||||
base::OnceClosure SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
net::ClientCertIdentityList client_certs,
|
||||
|
|
|
@ -107,7 +107,7 @@ bool GlobalShortcut::Register(const ui::Accelerator& accelerator,
|
|||
}
|
||||
|
||||
void GlobalShortcut::Unregister(const ui::Accelerator& accelerator) {
|
||||
if (!ContainsKey(accelerator_callback_map_, accelerator))
|
||||
if (!base::Contains(accelerator_callback_map_, accelerator))
|
||||
return;
|
||||
|
||||
accelerator_callback_map_.erase(accelerator);
|
||||
|
@ -123,7 +123,7 @@ void GlobalShortcut::UnregisterSome(
|
|||
}
|
||||
|
||||
bool GlobalShortcut::IsRegistered(const ui::Accelerator& accelerator) {
|
||||
return ContainsKey(accelerator_callback_map_, accelerator);
|
||||
return base::Contains(accelerator_callback_map_, accelerator);
|
||||
}
|
||||
|
||||
void GlobalShortcut::UnregisterAll() {
|
||||
|
|
|
@ -78,9 +78,9 @@ v8::Local<v8::Promise> NetLog::StartLogging(mate::Arguments* args) {
|
|||
auto command_line_string =
|
||||
base::CommandLine::ForCurrentProcess()->GetCommandLineString();
|
||||
auto channel_string = std::string("Electron " ELECTRON_VERSION);
|
||||
base::Value custom_constants = base::Value::FromUniquePtrValue(
|
||||
net_log::ChromeNetLog::GetPlatformConstants(command_line_string,
|
||||
channel_string));
|
||||
base::Value custom_constants =
|
||||
base::Value::FromUniquePtrValue(net_log::GetPlatformConstantsForNetLog(
|
||||
command_line_string, channel_string));
|
||||
|
||||
auto* network_context =
|
||||
content::BrowserContext::GetDefaultStoragePartition(browser_context_)
|
||||
|
|
|
@ -43,7 +43,7 @@ PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
|
|||
Browser::Get()->SetShutdownHandler(base::BindRepeating(
|
||||
&PowerMonitor::ShouldShutdown, base::Unretained(this)));
|
||||
#endif
|
||||
base::PowerMonitor::Get()->AddObserver(this);
|
||||
base::PowerMonitor::AddObserver(this);
|
||||
Init(isolate);
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
InitPlatformSpecificMonitors();
|
||||
|
@ -51,7 +51,7 @@ PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
|
|||
}
|
||||
|
||||
PowerMonitor::~PowerMonitor() {
|
||||
base::PowerMonitor::Get()->RemoveObserver(this);
|
||||
base::PowerMonitor::RemoveObserver(this);
|
||||
}
|
||||
|
||||
bool PowerMonitor::ShouldShutdown() {
|
||||
|
|
|
@ -61,7 +61,7 @@ ProtocolError ProtocolNS::RegisterProtocol(ProtocolType type,
|
|||
const std::string& scheme,
|
||||
const ProtocolHandler& handler) {
|
||||
ProtocolError error = ProtocolError::OK;
|
||||
if (!base::ContainsKey(handlers_, scheme))
|
||||
if (!base::Contains(handlers_, scheme))
|
||||
handlers_[scheme] = std::make_pair(type, handler);
|
||||
else
|
||||
error = ProtocolError::REGISTERED;
|
||||
|
@ -71,7 +71,7 @@ ProtocolError ProtocolNS::RegisterProtocol(ProtocolType type,
|
|||
void ProtocolNS::UnregisterProtocol(const std::string& scheme,
|
||||
mate::Arguments* args) {
|
||||
ProtocolError error = ProtocolError::OK;
|
||||
if (base::ContainsKey(handlers_, scheme))
|
||||
if (base::Contains(handlers_, scheme))
|
||||
handlers_.erase(scheme);
|
||||
else
|
||||
error = ProtocolError::NOT_REGISTERED;
|
||||
|
@ -79,14 +79,14 @@ void ProtocolNS::UnregisterProtocol(const std::string& scheme,
|
|||
}
|
||||
|
||||
bool ProtocolNS::IsProtocolRegistered(const std::string& scheme) {
|
||||
return base::ContainsKey(handlers_, scheme);
|
||||
return base::Contains(handlers_, scheme);
|
||||
}
|
||||
|
||||
ProtocolError ProtocolNS::InterceptProtocol(ProtocolType type,
|
||||
const std::string& scheme,
|
||||
const ProtocolHandler& handler) {
|
||||
ProtocolError error = ProtocolError::OK;
|
||||
if (!base::ContainsKey(intercept_handlers_, scheme))
|
||||
if (!base::Contains(intercept_handlers_, scheme))
|
||||
intercept_handlers_[scheme] = std::make_pair(type, handler);
|
||||
else
|
||||
error = ProtocolError::INTERCEPTED;
|
||||
|
@ -96,7 +96,7 @@ ProtocolError ProtocolNS::InterceptProtocol(ProtocolType type,
|
|||
void ProtocolNS::UninterceptProtocol(const std::string& scheme,
|
||||
mate::Arguments* args) {
|
||||
ProtocolError error = ProtocolError::OK;
|
||||
if (base::ContainsKey(intercept_handlers_, scheme))
|
||||
if (base::Contains(intercept_handlers_, scheme))
|
||||
intercept_handlers_.erase(scheme);
|
||||
else
|
||||
error = ProtocolError::NOT_INTERCEPTED;
|
||||
|
@ -104,7 +104,7 @@ void ProtocolNS::UninterceptProtocol(const std::string& scheme,
|
|||
}
|
||||
|
||||
bool ProtocolNS::IsProtocolIntercepted(const std::string& scheme) {
|
||||
return base::ContainsKey(intercept_handlers_, scheme);
|
||||
return base::Contains(intercept_handlers_, scheme);
|
||||
}
|
||||
|
||||
v8::Local<v8::Promise> ProtocolNS::IsProtocolHandled(const std::string& scheme,
|
||||
|
@ -126,7 +126,7 @@ v8::Local<v8::Promise> ProtocolNS::IsProtocolHandled(const std::string& scheme,
|
|||
// So we have to test against a hard-coded builtin schemes
|
||||
// list make it work with old code. We should deprecate this
|
||||
// API with the new |isProtocolRegistered| API.
|
||||
base::ContainsValue(kBuiltinSchemes, scheme));
|
||||
base::Contains(kBuiltinSchemes, scheme));
|
||||
return promise.GetHandle();
|
||||
}
|
||||
|
||||
|
|
|
@ -943,14 +943,14 @@ bool TopLevelWindow::HookWindowMessage(UINT message,
|
|||
}
|
||||
|
||||
void TopLevelWindow::UnhookWindowMessage(UINT message) {
|
||||
if (!ContainsKey(messages_callback_map_, message))
|
||||
if (!base::Contains(messages_callback_map_, message))
|
||||
return;
|
||||
|
||||
messages_callback_map_.erase(message);
|
||||
}
|
||||
|
||||
bool TopLevelWindow::IsWindowMessageHooked(UINT message) {
|
||||
return ContainsKey(messages_callback_map_, message);
|
||||
return base::Contains(messages_callback_map_, message);
|
||||
}
|
||||
|
||||
void TopLevelWindow::UnhookAllWindowMessages() {
|
||||
|
|
|
@ -757,7 +757,7 @@ void WebContents::FindReply(content::WebContents* web_contents,
|
|||
bool WebContents::CheckMediaAccessPermission(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
blink::MediaStreamType type) {
|
||||
blink::mojom::MediaStreamType type) {
|
||||
auto* web_contents =
|
||||
content::WebContents::FromRenderFrameHost(render_frame_host);
|
||||
auto* permission_helper =
|
||||
|
@ -2080,7 +2080,7 @@ v8::Local<v8::Promise> WebContents::CapturePage(mate::Arguments* args) {
|
|||
void WebContents::OnCursorChange(const content::WebCursor& cursor) {
|
||||
const content::CursorInfo& info = cursor.info();
|
||||
|
||||
if (info.type == blink::WebCursorInfo::kTypeCustom) {
|
||||
if (info.type == ui::CursorType::kCustom) {
|
||||
Emit("cursor-changed", CursorTypeToString(info),
|
||||
gfx::Image::CreateFrom1xBitmap(info.custom_image),
|
||||
info.image_scale_factor,
|
||||
|
@ -2157,7 +2157,7 @@ void WebContents::Invalidate() {
|
|||
}
|
||||
}
|
||||
|
||||
gfx::Size WebContents::GetSizeForNewRenderView(content::WebContents* wc) const {
|
||||
gfx::Size WebContents::GetSizeForNewRenderView(content::WebContents* wc) {
|
||||
if (IsOffScreen() && wc == web_contents()) {
|
||||
auto* relay = NativeWindowRelay::FromWebContents(web_contents());
|
||||
if (relay) {
|
||||
|
|
|
@ -262,7 +262,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
int GetFrameRate() const;
|
||||
#endif
|
||||
void Invalidate();
|
||||
gfx::Size GetSizeForNewRenderView(content::WebContents*) const override;
|
||||
gfx::Size GetSizeForNewRenderView(content::WebContents*) override;
|
||||
|
||||
// Methods for zoom handling.
|
||||
void SetZoomLevel(double level);
|
||||
|
@ -399,7 +399,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
bool final_update) override;
|
||||
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
|
||||
const GURL& security_origin,
|
||||
blink::MediaStreamType type) override;
|
||||
blink::mojom::MediaStreamType type) override;
|
||||
void RequestMediaAccessPermission(
|
||||
content::WebContents* web_contents,
|
||||
const content::MediaStreamRequest& request,
|
||||
|
|
|
@ -22,9 +22,9 @@ struct Converter<views::BoxLayout::Orientation> {
|
|||
if (!ConvertFromV8(isolate, val, &orientation))
|
||||
return false;
|
||||
if (orientation == "horizontal")
|
||||
*out = views::BoxLayout::kHorizontal;
|
||||
*out = views::BoxLayout::Orientation::kHorizontal;
|
||||
else if (orientation == "vertical")
|
||||
*out = views::BoxLayout::kVertical;
|
||||
*out = views::BoxLayout::Orientation::kVertical;
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
|
|
|
@ -114,6 +114,11 @@
|
|||
#include "chrome/browser/printing/printing_message_filter.h"
|
||||
#endif // BUILDFLAG(ENABLE_PRINTING)
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include "content/common/mac_helpers.h"
|
||||
#include "content/public/common/child_process_host.h"
|
||||
#endif
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace electron {
|
||||
|
@ -182,7 +187,7 @@ content::WebContents* AtomBrowserClient::GetWebContentsFromProcessID(
|
|||
int process_id) {
|
||||
// If the process is a pending process, we should use the web contents
|
||||
// for the frame host passed into RegisterPendingProcess.
|
||||
if (base::ContainsKey(pending_processes_, process_id))
|
||||
if (base::Contains(pending_processes_, process_id))
|
||||
return pending_processes_[process_id];
|
||||
|
||||
// Certain render process will be created with no associated render view,
|
||||
|
@ -328,7 +333,7 @@ void AtomBrowserClient::ConsiderSiteInstanceForAffinity(
|
|||
}
|
||||
|
||||
bool AtomBrowserClient::IsRendererSubFrame(int process_id) const {
|
||||
return base::ContainsKey(renderer_is_subframe_, process_id);
|
||||
return base::Contains(renderer_is_subframe_, process_id);
|
||||
}
|
||||
|
||||
void AtomBrowserClient::RenderProcessWillLaunch(
|
||||
|
@ -480,7 +485,17 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
|
|||
// Make sure we're about to launch a known executable
|
||||
{
|
||||
base::FilePath child_path;
|
||||
#if defined(OS_MACOSX)
|
||||
int flags = content::ChildProcessHost::CHILD_NORMAL;
|
||||
if (base::EndsWith(command_line->GetProgram().value(),
|
||||
content::kMacHelperSuffix_renderer,
|
||||
base::CompareCase::SENSITIVE)) {
|
||||
flags = content::ChildProcessHost::CHILD_RENDERER;
|
||||
}
|
||||
child_path = content::ChildProcessHost::GetChildPath(flags);
|
||||
#else
|
||||
base::PathService::Get(content::CHILD_PROCESS_EXE, &child_path);
|
||||
#endif
|
||||
|
||||
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||
CHECK(base::MakeAbsoluteFilePath(command_line->GetProgram()) == child_path);
|
||||
|
@ -591,7 +606,7 @@ void AtomBrowserClient::AllowCertificateError(
|
|||
}
|
||||
}
|
||||
|
||||
void AtomBrowserClient::SelectClientCertificate(
|
||||
base::OnceClosure AtomBrowserClient::SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
net::ClientCertIdentityList client_certs,
|
||||
|
@ -601,6 +616,7 @@ void AtomBrowserClient::SelectClientCertificate(
|
|||
std::move(client_certs),
|
||||
std::move(delegate));
|
||||
}
|
||||
return base::OnceClosure();
|
||||
}
|
||||
|
||||
bool AtomBrowserClient::CanCreateWindow(
|
||||
|
@ -729,10 +745,6 @@ AtomBrowserClient::GetExtraServiceManifests() {
|
|||
return GetElectronBuiltinServiceManifests();
|
||||
}
|
||||
|
||||
net::NetLog* AtomBrowserClient::GetNetLog() {
|
||||
return g_browser_process->net_log();
|
||||
}
|
||||
|
||||
std::unique_ptr<content::BrowserMainParts>
|
||||
AtomBrowserClient::CreateBrowserMainParts(
|
||||
const content::MainFunctionParams& params) {
|
||||
|
@ -907,11 +919,11 @@ bool AtomBrowserClient::ShouldBypassCORB(int render_process_id) const {
|
|||
return it != process_preferences_.end() && !it->second.web_security;
|
||||
}
|
||||
|
||||
std::string AtomBrowserClient::GetProduct() const {
|
||||
std::string AtomBrowserClient::GetProduct() {
|
||||
return "Chrome/" CHROME_VERSION_STRING;
|
||||
}
|
||||
|
||||
std::string AtomBrowserClient::GetUserAgent() const {
|
||||
std::string AtomBrowserClient::GetUserAgent() {
|
||||
if (user_agent_override_.empty())
|
||||
return GetApplicationUserAgent();
|
||||
return user_agent_override_;
|
||||
|
|
|
@ -63,7 +63,7 @@ class AtomBrowserClient : public content::ContentBrowserClient,
|
|||
// content::ContentBrowserClient:
|
||||
bool ShouldEnableStrictSiteIsolation() override;
|
||||
|
||||
std::string GetUserAgent() const override;
|
||||
std::string GetUserAgent() override;
|
||||
void SetUserAgent(const std::string& user_agent);
|
||||
|
||||
void SetCanUseCustomSiteInstance(bool should_disable);
|
||||
|
@ -109,7 +109,7 @@ class AtomBrowserClient : public content::ContentBrowserClient,
|
|||
bool expired_previous_decision,
|
||||
const base::Callback<void(content::CertificateRequestResultType)>&
|
||||
callback) override;
|
||||
void SelectClientCertificate(
|
||||
base::OnceClosure SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
net::ClientCertIdentityList client_certs,
|
||||
|
@ -146,7 +146,6 @@ class AtomBrowserClient : public content::ContentBrowserClient,
|
|||
base::Optional<service_manager::Manifest> GetServiceManifestOverlay(
|
||||
base::StringPiece name) override;
|
||||
std::vector<service_manager::Manifest> GetExtraServiceManifests() override;
|
||||
net::NetLog* GetNetLog() override;
|
||||
content::MediaObserver* GetMediaObserver() override;
|
||||
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
|
||||
content::PlatformNotificationService* GetPlatformNotificationService(
|
||||
|
@ -160,7 +159,7 @@ class AtomBrowserClient : public content::ContentBrowserClient,
|
|||
network::mojom::NetworkService* network_service) override;
|
||||
std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
|
||||
bool ShouldBypassCORB(int render_process_id) const override;
|
||||
std::string GetProduct() const override;
|
||||
std::string GetProduct() override;
|
||||
void RegisterNonNetworkNavigationURLLoaderFactories(
|
||||
int frame_tree_node_id,
|
||||
NonNetworkURLLoaderFactoryMap* factories) override;
|
||||
|
|
|
@ -196,11 +196,11 @@ network::mojom::NetworkContextPtr AtomBrowserContext::GetNetworkContext() {
|
|||
}
|
||||
}
|
||||
|
||||
base::FilePath AtomBrowserContext::GetPath() const {
|
||||
base::FilePath AtomBrowserContext::GetPath() {
|
||||
return path_;
|
||||
}
|
||||
|
||||
bool AtomBrowserContext::IsOffTheRecord() const {
|
||||
bool AtomBrowserContext::IsOffTheRecord() {
|
||||
return in_memory_;
|
||||
}
|
||||
|
||||
|
@ -305,24 +305,6 @@ AtomBrowserContext::GetClientHintsControllerDelegate() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter*
|
||||
AtomBrowserContext::CreateRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path,
|
||||
bool in_memory,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::URLRequestInterceptorScopedVector request_interceptors) {
|
||||
NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter*
|
||||
AtomBrowserContext::CreateMediaRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path,
|
||||
bool in_memory) {
|
||||
NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ResolveProxyHelper* AtomBrowserContext::GetResolveProxyHelper() {
|
||||
if (!resolve_proxy_helper_) {
|
||||
resolve_proxy_helper_ = base::MakeRefCounted<ResolveProxyHelper>(this);
|
||||
|
|
|
@ -60,8 +60,8 @@ class AtomBrowserContext
|
|||
ResolveProxyHelper* GetResolveProxyHelper();
|
||||
|
||||
// content::BrowserContext:
|
||||
base::FilePath GetPath() const override;
|
||||
bool IsOffTheRecord() const override;
|
||||
base::FilePath GetPath() override;
|
||||
bool IsOffTheRecord() override;
|
||||
content::ResourceContext* GetResourceContext() override;
|
||||
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
|
||||
const base::FilePath& partition_path) override;
|
||||
|
@ -71,14 +71,6 @@ class AtomBrowserContext
|
|||
content::BackgroundSyncController* GetBackgroundSyncController() override;
|
||||
content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate()
|
||||
override;
|
||||
net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path,
|
||||
bool in_memory,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::URLRequestInterceptorScopedVector request_interceptors) override;
|
||||
net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path,
|
||||
bool in_memory) override;
|
||||
std::string GetMediaDeviceIDSalt() override;
|
||||
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
|
||||
content::BrowserPluginGuestManager* GetGuestManager() override;
|
||||
|
|
|
@ -207,8 +207,7 @@ AtomBrowserMainParts::AtomBrowserMainParts(
|
|||
browser_(new Browser),
|
||||
node_bindings_(
|
||||
NodeBindings::Create(NodeBindings::BrowserEnvironment::BROWSER)),
|
||||
electron_bindings_(new ElectronBindings(uv_default_loop())),
|
||||
main_function_params_(params) {
|
||||
electron_bindings_(new ElectronBindings(uv_default_loop())) {
|
||||
DCHECK(!self_) << "Cannot have two AtomBrowserMainParts";
|
||||
self_ = this;
|
||||
// Register extension scheme as web safe scheme.
|
||||
|
@ -339,7 +338,7 @@ int AtomBrowserMainParts::PreCreateThreads() {
|
|||
ui::InitIdleMonitor();
|
||||
#endif
|
||||
|
||||
fake_browser_process_->PreCreateThreads(main_function_params_.command_line);
|
||||
fake_browser_process_->PreCreateThreads();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ class AtomBrowserMainParts : public content::BrowserMainParts {
|
|||
IconManager* GetIconManager();
|
||||
|
||||
Browser* browser() { return browser_.get(); }
|
||||
BrowserProcessImpl* browser_process() { return fake_browser_process_.get(); }
|
||||
|
||||
protected:
|
||||
// content::BrowserMainParts:
|
||||
|
@ -134,8 +135,6 @@ class AtomBrowserMainParts : public content::BrowserMainParts {
|
|||
|
||||
device::mojom::GeolocationControlPtr geolocation_control_;
|
||||
|
||||
const content::MainFunctionParams main_function_params_;
|
||||
|
||||
static AtomBrowserMainParts* self_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts);
|
||||
|
|
|
@ -38,7 +38,7 @@ AtomWebUIControllerFactory::~AtomWebUIControllerFactory() {}
|
|||
|
||||
content::WebUI::TypeID AtomWebUIControllerFactory::GetWebUIType(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& url) const {
|
||||
const GURL& url) {
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
if (url.host() == kPdfViewerUIHost) {
|
||||
return const_cast<AtomWebUIControllerFactory*>(this);
|
||||
|
@ -53,19 +53,19 @@ content::WebUI::TypeID AtomWebUIControllerFactory::GetWebUIType(
|
|||
|
||||
bool AtomWebUIControllerFactory::UseWebUIForURL(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& url) const {
|
||||
const GURL& url) {
|
||||
return GetWebUIType(browser_context, url) != content::WebUI::kNoWebUI;
|
||||
}
|
||||
|
||||
bool AtomWebUIControllerFactory::UseWebUIBindingsForURL(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& url) const {
|
||||
const GURL& url) {
|
||||
return UseWebUIForURL(browser_context, url);
|
||||
}
|
||||
|
||||
std::unique_ptr<content::WebUIController>
|
||||
AtomWebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui,
|
||||
const GURL& url) const {
|
||||
const GURL& url) {
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
if (url.host() == kPdfViewerUIHost) {
|
||||
base::StringPairs toplevel_params;
|
||||
|
|
|
@ -23,14 +23,14 @@ class AtomWebUIControllerFactory : public content::WebUIControllerFactory {
|
|||
|
||||
// content::WebUIControllerFactory:
|
||||
content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
|
||||
const GURL& url) const override;
|
||||
const GURL& url) override;
|
||||
bool UseWebUIForURL(content::BrowserContext* browser_context,
|
||||
const GURL& url) const override;
|
||||
const GURL& url) override;
|
||||
bool UseWebUIBindingsForURL(content::BrowserContext* browser_context,
|
||||
const GURL& url) const override;
|
||||
const GURL& url) override;
|
||||
std::unique_ptr<content::WebUIController> CreateWebUIControllerForURL(
|
||||
content::WebUI* web_ui,
|
||||
const GURL& url) const override;
|
||||
const GURL& url) override;
|
||||
|
||||
private:
|
||||
friend struct base::DefaultSingletonTraits<AtomWebUIControllerFactory>;
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include <utility>
|
||||
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "components/net_log/chrome_net_log.h"
|
||||
#include "components/net_log/net_export_file_writer.h"
|
||||
#include "components/prefs/in_memory_pref_store.h"
|
||||
#include "components/prefs/overlay_user_pref_store.h"
|
||||
#include "components/prefs/pref_registry.h"
|
||||
|
@ -18,7 +16,6 @@
|
|||
#include "components/proxy_config/proxy_config_dictionary.h"
|
||||
#include "components/proxy_config/proxy_config_pref_names.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "net/log/net_log_capture_mode.h"
|
||||
#include "net/proxy_resolution/proxy_config.h"
|
||||
#include "net/proxy_resolution/proxy_config_service.h"
|
||||
#include "net/proxy_resolution/proxy_config_with_annotation.h"
|
||||
|
@ -90,33 +87,16 @@ void BrowserProcessImpl::PostEarlyInitialization() {
|
|||
local_state_ = prefs_factory.Create(std::move(pref_registry));
|
||||
}
|
||||
|
||||
void BrowserProcessImpl::PreCreateThreads(
|
||||
const base::CommandLine& command_line) {
|
||||
void BrowserProcessImpl::PreCreateThreads() {
|
||||
// Must be created before the IOThread.
|
||||
// Once IOThread class is no longer needed,
|
||||
// this can be created on first use.
|
||||
if (!SystemNetworkContextManager::GetInstance())
|
||||
SystemNetworkContextManager::CreateInstance(local_state_.get());
|
||||
|
||||
net_log_ = std::make_unique<net_log::ChromeNetLog>();
|
||||
// start net log trace if --log-net-log is passed in the command line.
|
||||
if (command_line.HasSwitch(network::switches::kLogNetLog)) {
|
||||
base::FilePath log_file =
|
||||
command_line.GetSwitchValuePath(network::switches::kLogNetLog);
|
||||
if (!log_file.empty()) {
|
||||
net_log_->StartWritingToFile(
|
||||
log_file,
|
||||
net::GetNetCaptureModeFromCommandLine(
|
||||
command_line, network::switches::kNetLogCaptureMode),
|
||||
command_line.GetCommandLineString(), std::string());
|
||||
}
|
||||
}
|
||||
// Initialize net log file exporter.
|
||||
system_network_context_manager()->GetNetExportFileWriter()->Initialize();
|
||||
|
||||
// Manage global state of net and other IO thread related.
|
||||
io_thread_ = std::make_unique<IOThread>(
|
||||
net_log_.get(), SystemNetworkContextManager::GetInstance());
|
||||
io_thread_ =
|
||||
std::make_unique<IOThread>(SystemNetworkContextManager::GetInstance());
|
||||
}
|
||||
|
||||
void BrowserProcessImpl::PostDestroyThreads() {
|
||||
|
@ -157,10 +137,6 @@ PrefService* BrowserProcessImpl::local_state() {
|
|||
return local_state_.get();
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
scoped_refptr<network::SharedURLLoaderFactory>
|
||||
BrowserProcessImpl::shared_url_loader_factory() {
|
||||
return system_network_context_manager()->GetSharedURLLoaderFactory();
|
||||
|
@ -187,11 +163,6 @@ NotificationPlatformBridge* BrowserProcessImpl::notification_platform_bridge() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
IOThread* BrowserProcessImpl::io_thread() {
|
||||
DCHECK(io_thread_.get());
|
||||
return io_thread_.get();
|
||||
}
|
||||
|
||||
SystemNetworkContextManager*
|
||||
BrowserProcessImpl::system_network_context_manager() {
|
||||
DCHECK(SystemNetworkContextManager::GetInstance());
|
||||
|
@ -273,11 +244,6 @@ BrowserProcessImpl::optimization_guide_service() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
net_log::ChromeNetLog* BrowserProcessImpl::net_log() {
|
||||
DCHECK(net_log_.get());
|
||||
return net_log_.get();
|
||||
}
|
||||
|
||||
component_updater::ComponentUpdateService*
|
||||
BrowserProcessImpl::component_updater() {
|
||||
return nullptr;
|
||||
|
|
|
@ -23,10 +23,6 @@
|
|||
#include "shell/browser/io_thread.h"
|
||||
#include "shell/browser/net/system_network_context_manager.h"
|
||||
|
||||
namespace net_log {
|
||||
class ChromeNetLog;
|
||||
}
|
||||
|
||||
namespace printing {
|
||||
class PrintJobManager;
|
||||
}
|
||||
|
@ -44,7 +40,7 @@ class BrowserProcessImpl : public BrowserProcess {
|
|||
static void ApplyProxyModeFromCommandLine(ValueMapPrefStore* pref_store);
|
||||
|
||||
void PostEarlyInitialization();
|
||||
void PreCreateThreads(const base::CommandLine& command_line);
|
||||
void PreCreateThreads();
|
||||
void PostDestroyThreads();
|
||||
void PostMainMessageLoopRun();
|
||||
|
||||
|
@ -58,7 +54,6 @@ class BrowserProcessImpl : public BrowserProcess {
|
|||
rappor::RapporServiceImpl* rappor_service() override;
|
||||
ProfileManager* profile_manager() override;
|
||||
PrefService* local_state() override;
|
||||
net::URLRequestContextGetter* system_request_context() override;
|
||||
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory()
|
||||
override;
|
||||
variations::VariationsService* variations_service() override;
|
||||
|
@ -66,7 +61,6 @@ class BrowserProcessImpl : public BrowserProcess {
|
|||
extensions::EventRouterForwarder* extension_event_router_forwarder() override;
|
||||
NotificationUIManager* notification_ui_manager() override;
|
||||
NotificationPlatformBridge* notification_platform_bridge() override;
|
||||
IOThread* io_thread() override;
|
||||
SystemNetworkContextManager* system_network_context_manager() override;
|
||||
network::NetworkQualityTracker* network_quality_tracker() override;
|
||||
WatchDogThread* watchdog_thread() override;
|
||||
|
@ -89,7 +83,6 @@ class BrowserProcessImpl : public BrowserProcess {
|
|||
override;
|
||||
optimization_guide::OptimizationGuideService* optimization_guide_service()
|
||||
override;
|
||||
net_log::ChromeNetLog* net_log() override;
|
||||
component_updater::ComponentUpdateService* component_updater() override;
|
||||
component_updater::SupervisedUserWhitelistInstaller*
|
||||
supervised_user_whitelist_installer() override;
|
||||
|
@ -115,13 +108,14 @@ class BrowserProcessImpl : public BrowserProcess {
|
|||
printing::PrintJobManager* print_job_manager() override;
|
||||
StartupData* startup_data() override;
|
||||
|
||||
IOThread* io_thread() const { return io_thread_.get(); }
|
||||
|
||||
private:
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
|
||||
#endif
|
||||
std::unique_ptr<PrefService> local_state_;
|
||||
std::unique_ptr<IOThread> io_thread_;
|
||||
std::unique_ptr<net_log::ChromeNetLog> net_log_;
|
||||
std::string locale_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl);
|
||||
|
|
|
@ -286,7 +286,7 @@ content::WebContents* CommonWebContentsDelegate::OpenURLFromTab(
|
|||
return source;
|
||||
}
|
||||
|
||||
bool CommonWebContentsDelegate::CanOverscrollContent() const {
|
||||
bool CommonWebContentsDelegate::CanOverscrollContent() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -343,7 +343,7 @@ void CommonWebContentsDelegate::ExitFullscreenModeForTab(
|
|||
}
|
||||
|
||||
bool CommonWebContentsDelegate::IsFullscreenForTabOrPending(
|
||||
const content::WebContents* source) const {
|
||||
const content::WebContents* source) {
|
||||
return html_fullscreen_;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate,
|
|||
content::WebContents* OpenURLFromTab(
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params) override;
|
||||
bool CanOverscrollContent() const override;
|
||||
bool CanOverscrollContent() override;
|
||||
content::ColorChooser* OpenColorChooser(
|
||||
content::WebContents* web_contents,
|
||||
SkColor color,
|
||||
|
@ -98,8 +98,7 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate,
|
|||
const GURL& origin,
|
||||
const blink::WebFullscreenOptions& options) override;
|
||||
void ExitFullscreenModeForTab(content::WebContents* source) override;
|
||||
bool IsFullscreenForTabOrPending(
|
||||
const content::WebContents* source) const override;
|
||||
bool IsFullscreenForTabOrPending(const content::WebContents* source) override;
|
||||
blink::WebSecurityStyle GetSecurityStyle(
|
||||
content::WebContents* web_contents,
|
||||
content::SecurityStyleExplanations* explanations) override;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "shell/browser/io_thread.h"
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "components/net_log/chrome_net_log.h"
|
||||
|
@ -13,18 +14,46 @@
|
|||
#include "net/cert/cert_verifier.h"
|
||||
#include "net/cert/cert_verify_proc.h"
|
||||
#include "net/cert/multi_threaded_cert_verifier.h"
|
||||
#include "net/log/net_log_util.h"
|
||||
#include "net/proxy_resolution/proxy_resolution_service.h"
|
||||
#include "net/url_request/url_request_context.h"
|
||||
#include "services/network/network_service.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
#include "services/network/public/mojom/net_log.mojom.h"
|
||||
#include "services/network/url_request_context_builder_mojo.h"
|
||||
#include "shell/browser/net/url_request_context_getter.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
IOThread::IOThread(net_log::ChromeNetLog* net_log,
|
||||
SystemNetworkContextManager* system_network_context_manager)
|
||||
: net_log_(net_log) {
|
||||
namespace {
|
||||
|
||||
// Parses the desired granularity of NetLog capturing specified by the command
|
||||
// line.
|
||||
net::NetLogCaptureMode GetNetCaptureModeFromCommandLine(
|
||||
const base::CommandLine& command_line) {
|
||||
base::StringPiece switch_name = network::switches::kNetLogCaptureMode;
|
||||
|
||||
if (command_line.HasSwitch(switch_name)) {
|
||||
std::string value = command_line.GetSwitchValueASCII(switch_name);
|
||||
|
||||
if (value == "Default")
|
||||
return net::NetLogCaptureMode::Default();
|
||||
if (value == "IncludeCookiesAndCredentials")
|
||||
return net::NetLogCaptureMode::IncludeCookiesAndCredentials();
|
||||
if (value == "IncludeSocketBytes")
|
||||
return net::NetLogCaptureMode::IncludeSocketBytes();
|
||||
|
||||
LOG(ERROR) << "Unrecognized value for --" << switch_name;
|
||||
}
|
||||
|
||||
return net::NetLogCaptureMode::Default();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
IOThread::IOThread(
|
||||
SystemNetworkContextManager* system_network_context_manager) {
|
||||
BrowserThread::SetIOThreadDelegate(this);
|
||||
|
||||
system_network_context_manager->SetUp(
|
||||
|
@ -74,6 +103,27 @@ void IOThread::Init() {
|
|||
network_service->ConfigureHttpAuthPrefs(
|
||||
std::move(http_auth_dynamic_params_));
|
||||
|
||||
const base::CommandLine* command_line =
|
||||
base::CommandLine::ForCurrentProcess();
|
||||
// start net log trace if --log-net-log is passed in the command line.
|
||||
if (command_line->HasSwitch(network::switches::kLogNetLog)) {
|
||||
base::FilePath log_file =
|
||||
command_line->GetSwitchValuePath(network::switches::kLogNetLog);
|
||||
base::File file(log_file,
|
||||
base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
|
||||
if (log_file.empty() || !file.IsValid()) {
|
||||
LOG(ERROR) << "Failed opening NetLog: " << log_file.value();
|
||||
} else {
|
||||
auto platform_dict = net_log::GetPlatformConstantsForNetLog(
|
||||
base::CommandLine::ForCurrentProcess()->GetCommandLineString(),
|
||||
std::string(ELECTRON_PRODUCT_NAME));
|
||||
network_service->StartNetLog(
|
||||
std::move(file), GetNetCaptureModeFromCommandLine(*command_line),
|
||||
platform_dict ? std::move(*platform_dict)
|
||||
: base::DictionaryValue());
|
||||
}
|
||||
}
|
||||
|
||||
system_network_context_ = network_service->CreateNetworkContextWithBuilder(
|
||||
std::move(network_context_request_), std::move(network_context_params_),
|
||||
std::move(builder), &system_request_context_);
|
||||
|
@ -91,7 +141,4 @@ void IOThread::CleanUp() {
|
|||
|
||||
system_network_context_.reset();
|
||||
}
|
||||
|
||||
if (net_log_)
|
||||
net_log_->ShutDownBeforeThreadPool();
|
||||
}
|
||||
|
|
|
@ -22,14 +22,9 @@ namespace net {
|
|||
class URLRequestContext;
|
||||
}
|
||||
|
||||
namespace net_log {
|
||||
class ChromeNetLog;
|
||||
}
|
||||
|
||||
class IOThread : public content::BrowserThreadDelegate {
|
||||
public:
|
||||
explicit IOThread(
|
||||
net_log::ChromeNetLog* net_log,
|
||||
SystemNetworkContextManager* system_network_context_manager);
|
||||
~IOThread() override;
|
||||
|
||||
|
@ -44,10 +39,6 @@ class IOThread : public content::BrowserThreadDelegate {
|
|||
void CleanUp() override;
|
||||
|
||||
private:
|
||||
// The NetLog is owned by the browser process, to allow logging from other
|
||||
// threads during shutdown, but is used most frequently on the IOThread.
|
||||
net_log::ChromeNetLog* net_log_;
|
||||
|
||||
// When the network service is disabled, this holds on to a
|
||||
// content::NetworkContext class that owns |system_request_context_|.
|
||||
std::unique_ptr<network::mojom::NetworkContext> system_network_context_;
|
||||
|
|
|
@ -129,7 +129,7 @@ void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(
|
|||
int render_view_id,
|
||||
int page_request_id,
|
||||
const GURL& security_origin,
|
||||
blink::MediaStreamType stream_type,
|
||||
blink::mojom::MediaStreamType stream_type,
|
||||
content::MediaRequestState state) {}
|
||||
|
||||
void MediaCaptureDevicesDispatcher::OnCreatingAudioStream(int render_process_id,
|
||||
|
@ -139,7 +139,7 @@ void MediaCaptureDevicesDispatcher::OnSetCapturingLinkSecured(
|
|||
int render_process_id,
|
||||
int render_frame_id,
|
||||
int page_request_id,
|
||||
blink::MediaStreamType stream_type,
|
||||
blink::mojom::MediaStreamType stream_type,
|
||||
bool is_secure) {}
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -57,14 +57,14 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver {
|
|||
int render_view_id,
|
||||
int page_request_id,
|
||||
const GURL& security_origin,
|
||||
blink::MediaStreamType stream_type,
|
||||
blink::mojom::MediaStreamType stream_type,
|
||||
content::MediaRequestState state) override;
|
||||
void OnCreatingAudioStream(int render_process_id,
|
||||
int render_view_id) override;
|
||||
void OnSetCapturingLinkSecured(int render_process_id,
|
||||
int render_frame_id,
|
||||
int page_request_id,
|
||||
blink::MediaStreamType stream_type,
|
||||
blink::mojom::MediaStreamType stream_type,
|
||||
bool is_secure) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -34,10 +34,12 @@ MediaStreamDevicesController::MediaStreamDevicesController(
|
|||
// For MEDIA_OPEN_DEVICE requests (Pepper) we always request both webcam
|
||||
// and microphone to avoid popping two infobars.
|
||||
microphone_requested_(
|
||||
request.audio_type == blink::MEDIA_DEVICE_AUDIO_CAPTURE ||
|
||||
request.audio_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE ||
|
||||
request.request_type == blink::MEDIA_OPEN_DEVICE_PEPPER_ONLY),
|
||||
webcam_requested_(
|
||||
request.video_type == blink::MEDIA_DEVICE_VIDEO_CAPTURE ||
|
||||
request.video_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE ||
|
||||
request.request_type == blink::MEDIA_OPEN_DEVICE_PEPPER_ONLY) {}
|
||||
|
||||
MediaStreamDevicesController::~MediaStreamDevicesController() {
|
||||
|
@ -51,10 +53,14 @@ MediaStreamDevicesController::~MediaStreamDevicesController() {
|
|||
|
||||
bool MediaStreamDevicesController::TakeAction() {
|
||||
// Do special handling of desktop screen cast.
|
||||
if (request_.audio_type == blink::MEDIA_GUM_TAB_AUDIO_CAPTURE ||
|
||||
request_.video_type == blink::MEDIA_GUM_TAB_VIDEO_CAPTURE ||
|
||||
request_.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE ||
|
||||
request_.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE) {
|
||||
if (request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::GUM_TAB_AUDIO_CAPTURE ||
|
||||
request_.video_type ==
|
||||
blink::mojom::MediaStreamType::GUM_TAB_VIDEO_CAPTURE ||
|
||||
request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE ||
|
||||
request_.video_type ==
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE) {
|
||||
HandleUserMediaRequest();
|
||||
return true;
|
||||
}
|
||||
|
@ -78,7 +84,8 @@ void MediaStreamDevicesController::Accept() {
|
|||
const blink::MediaStreamDevice* device = nullptr;
|
||||
// For open device request pick the desired device or fall back to the
|
||||
// first available of the given type.
|
||||
if (request_.audio_type == blink::MEDIA_DEVICE_AUDIO_CAPTURE) {
|
||||
if (request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE) {
|
||||
device =
|
||||
MediaCaptureDevicesDispatcher::GetInstance()
|
||||
->GetRequestedAudioDevice(request_.requested_audio_device_id);
|
||||
|
@ -87,7 +94,8 @@ void MediaStreamDevicesController::Accept() {
|
|||
device = MediaCaptureDevicesDispatcher::GetInstance()
|
||||
->GetFirstAvailableAudioDevice();
|
||||
}
|
||||
} else if (request_.video_type == blink::MEDIA_DEVICE_VIDEO_CAPTURE) {
|
||||
} else if (request_.video_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE) {
|
||||
// Pepper API opens only one device at a time.
|
||||
device =
|
||||
MediaCaptureDevicesDispatcher::GetInstance()
|
||||
|
@ -160,19 +168,24 @@ void MediaStreamDevicesController::Deny(
|
|||
void MediaStreamDevicesController::HandleUserMediaRequest() {
|
||||
blink::MediaStreamDevices devices;
|
||||
|
||||
if (request_.audio_type == blink::MEDIA_GUM_TAB_AUDIO_CAPTURE) {
|
||||
devices.push_back(
|
||||
blink::MediaStreamDevice(blink::MEDIA_GUM_TAB_AUDIO_CAPTURE, "", ""));
|
||||
}
|
||||
if (request_.video_type == blink::MEDIA_GUM_TAB_VIDEO_CAPTURE) {
|
||||
devices.push_back(
|
||||
blink::MediaStreamDevice(blink::MEDIA_GUM_TAB_VIDEO_CAPTURE, "", ""));
|
||||
}
|
||||
if (request_.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE) {
|
||||
if (request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::GUM_TAB_AUDIO_CAPTURE) {
|
||||
devices.push_back(blink::MediaStreamDevice(
|
||||
blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE, "loopback", "System Audio"));
|
||||
blink::mojom::MediaStreamType::GUM_TAB_AUDIO_CAPTURE, "", ""));
|
||||
}
|
||||
if (request_.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE) {
|
||||
if (request_.video_type ==
|
||||
blink::mojom::MediaStreamType::GUM_TAB_VIDEO_CAPTURE) {
|
||||
devices.push_back(blink::MediaStreamDevice(
|
||||
blink::mojom::MediaStreamType::GUM_TAB_VIDEO_CAPTURE, "", ""));
|
||||
}
|
||||
if (request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE) {
|
||||
devices.push_back(blink::MediaStreamDevice(
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE, "loopback",
|
||||
"System Audio"));
|
||||
}
|
||||
if (request_.video_type ==
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE) {
|
||||
content::DesktopMediaID screen_id;
|
||||
// If the device id wasn't specified then this is a screen capture request
|
||||
// (i.e. chooseDesktopMedia() API wasn't used to generate device id).
|
||||
|
@ -184,9 +197,9 @@ void MediaStreamDevicesController::HandleUserMediaRequest() {
|
|||
content::DesktopMediaID::Parse(request_.requested_video_device_id);
|
||||
}
|
||||
|
||||
devices.push_back(
|
||||
blink::MediaStreamDevice(blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE,
|
||||
screen_id.ToString(), "Screen"));
|
||||
devices.push_back(blink::MediaStreamDevice(
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE,
|
||||
screen_id.ToString(), "Screen"));
|
||||
}
|
||||
|
||||
std::move(callback_).Run(
|
||||
|
|
|
@ -271,7 +271,7 @@ int AtomNetworkDelegate::OnBeforeURLRequest(
|
|||
net::URLRequest* request,
|
||||
net::CompletionOnceCallback callback,
|
||||
GURL* new_url) {
|
||||
if (!base::ContainsKey(response_listeners_, kOnBeforeRequest)) {
|
||||
if (!base::Contains(response_listeners_, kOnBeforeRequest)) {
|
||||
for (const auto& domain : ignore_connections_limit_domains_) {
|
||||
if (request->url().DomainIs(domain)) {
|
||||
// Allow unlimited concurrent connections.
|
||||
|
@ -291,7 +291,7 @@ int AtomNetworkDelegate::OnBeforeStartTransaction(
|
|||
net::URLRequest* request,
|
||||
net::CompletionOnceCallback callback,
|
||||
net::HttpRequestHeaders* headers) {
|
||||
if (!base::ContainsKey(response_listeners_, kOnBeforeSendHeaders))
|
||||
if (!base::Contains(response_listeners_, kOnBeforeSendHeaders))
|
||||
return net::OK;
|
||||
|
||||
return HandleResponseEvent(kOnBeforeSendHeaders, request, std::move(callback),
|
||||
|
@ -301,7 +301,7 @@ int AtomNetworkDelegate::OnBeforeStartTransaction(
|
|||
void AtomNetworkDelegate::OnStartTransaction(
|
||||
net::URLRequest* request,
|
||||
const net::HttpRequestHeaders& headers) {
|
||||
if (!base::ContainsKey(simple_listeners_, kOnSendHeaders))
|
||||
if (!base::Contains(simple_listeners_, kOnSendHeaders))
|
||||
return;
|
||||
|
||||
HandleSimpleEvent(kOnSendHeaders, request, headers);
|
||||
|
@ -313,7 +313,7 @@ int AtomNetworkDelegate::OnHeadersReceived(
|
|||
const net::HttpResponseHeaders* original,
|
||||
scoped_refptr<net::HttpResponseHeaders>* override,
|
||||
GURL* allowed) {
|
||||
if (!base::ContainsKey(response_listeners_, kOnHeadersReceived))
|
||||
if (!base::Contains(response_listeners_, kOnHeadersReceived))
|
||||
return net::OK;
|
||||
|
||||
return HandleResponseEvent(
|
||||
|
@ -323,7 +323,7 @@ int AtomNetworkDelegate::OnHeadersReceived(
|
|||
|
||||
void AtomNetworkDelegate::OnBeforeRedirect(net::URLRequest* request,
|
||||
const GURL& new_location) {
|
||||
if (!base::ContainsKey(simple_listeners_, kOnBeforeRedirect))
|
||||
if (!base::Contains(simple_listeners_, kOnBeforeRedirect))
|
||||
return;
|
||||
|
||||
HandleSimpleEvent(
|
||||
|
@ -333,7 +333,7 @@ void AtomNetworkDelegate::OnBeforeRedirect(net::URLRequest* request,
|
|||
|
||||
void AtomNetworkDelegate::OnResponseStarted(net::URLRequest* request,
|
||||
int net_error) {
|
||||
if (!base::ContainsKey(simple_listeners_, kOnResponseStarted))
|
||||
if (!base::Contains(simple_listeners_, kOnResponseStarted))
|
||||
return;
|
||||
|
||||
if (request->status().status() != net::URLRequestStatus::SUCCESS)
|
||||
|
@ -363,7 +363,7 @@ void AtomNetworkDelegate::OnCompleted(net::URLRequest* request,
|
|||
return;
|
||||
}
|
||||
|
||||
if (!base::ContainsKey(simple_listeners_, kOnCompleted))
|
||||
if (!base::Contains(simple_listeners_, kOnCompleted))
|
||||
return;
|
||||
|
||||
HandleSimpleEvent(kOnCompleted, request, request->response_headers(),
|
||||
|
@ -454,7 +454,7 @@ bool AtomNetworkDelegate::OnCanUseReportingClient(const url::Origin& origin,
|
|||
void AtomNetworkDelegate::OnErrorOccurred(net::URLRequest* request,
|
||||
bool started,
|
||||
int net_error) {
|
||||
if (!base::ContainsKey(simple_listeners_, kOnErrorOccurred))
|
||||
if (!base::Contains(simple_listeners_, kOnErrorOccurred))
|
||||
return;
|
||||
|
||||
HandleSimpleEvent(kOnErrorOccurred, request, request->was_cached(),
|
||||
|
@ -519,7 +519,7 @@ void AtomNetworkDelegate::OnListenerResultInIO(
|
|||
T out,
|
||||
std::unique_ptr<base::DictionaryValue> response) {
|
||||
// The request has been destroyed.
|
||||
if (!base::ContainsKey(callbacks_, id))
|
||||
if (!base::Contains(callbacks_, id))
|
||||
return;
|
||||
|
||||
ReadFromResponseObject(*response, out);
|
||||
|
|
|
@ -53,7 +53,7 @@ bool AtomURLRequestJobFactory::SetProtocolHandler(
|
|||
return true;
|
||||
}
|
||||
|
||||
if (base::ContainsKey(protocol_handler_map_, scheme))
|
||||
if (base::Contains(protocol_handler_map_, scheme))
|
||||
return false;
|
||||
protocol_handler_map_[scheme] = protocol_handler.release();
|
||||
return true;
|
||||
|
@ -62,8 +62,8 @@ bool AtomURLRequestJobFactory::SetProtocolHandler(
|
|||
bool AtomURLRequestJobFactory::InterceptProtocol(
|
||||
const std::string& scheme,
|
||||
std::unique_ptr<ProtocolHandler> protocol_handler) {
|
||||
if (!base::ContainsKey(protocol_handler_map_, scheme) ||
|
||||
base::ContainsKey(original_protocols_, scheme))
|
||||
if (!base::Contains(protocol_handler_map_, scheme) ||
|
||||
base::Contains(original_protocols_, scheme))
|
||||
return false;
|
||||
ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme];
|
||||
protocol_handler_map_[scheme] = protocol_handler.release();
|
||||
|
@ -82,7 +82,7 @@ bool AtomURLRequestJobFactory::UninterceptProtocol(const std::string& scheme) {
|
|||
|
||||
bool AtomURLRequestJobFactory::HasProtocolHandler(
|
||||
const std::string& scheme) const {
|
||||
return base::ContainsKey(protocol_handler_map_, scheme);
|
||||
return base::Contains(protocol_handler_map_, scheme);
|
||||
}
|
||||
|
||||
void AtomURLRequestJobFactory::Clear() {
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "base/command_line.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
|
||||
#include "components/net_log/net_export_file_writer.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/network_service_instance.h"
|
||||
#include "content/public/common/content_features.h"
|
||||
|
@ -158,14 +157,6 @@ SystemNetworkContextManager::GetSharedURLLoaderFactory() {
|
|||
return shared_url_loader_factory_;
|
||||
}
|
||||
|
||||
net_log::NetExportFileWriter*
|
||||
SystemNetworkContextManager::GetNetExportFileWriter() {
|
||||
if (!net_export_file_writer_) {
|
||||
net_export_file_writer_ = std::make_unique<net_log::NetExportFileWriter>();
|
||||
}
|
||||
return net_export_file_writer_.get();
|
||||
}
|
||||
|
||||
network::mojom::NetworkContextParamsPtr
|
||||
SystemNetworkContextManager::CreateDefaultNetworkContextParams() {
|
||||
network::mojom::NetworkContextParamsPtr network_context_params =
|
||||
|
@ -178,6 +169,10 @@ SystemNetworkContextManager::CreateDefaultNetworkContextParams() {
|
|||
network_context_params->proxy_resolver_factory =
|
||||
ChromeMojoProxyResolverFactory::CreateWithSelfOwnedReceiver();
|
||||
|
||||
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
|
||||
network_context_params->enable_ftp_url_support = true;
|
||||
#endif
|
||||
|
||||
return network_context_params;
|
||||
}
|
||||
|
||||
|
@ -257,10 +252,6 @@ SystemNetworkContextManager::CreateNetworkContextParams() {
|
|||
|
||||
network_context_params->http_cache_enabled = false;
|
||||
|
||||
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
|
||||
network_context_params->enable_ftp_url_support = true;
|
||||
#endif
|
||||
|
||||
network_context_params->primary_network_context = true;
|
||||
|
||||
proxy_config_monitor_.AddToNetworkContextParams(network_context_params.get());
|
||||
|
|
|
@ -87,9 +87,6 @@ class SystemNetworkContextManager {
|
|||
// that is backed by the SystemNetworkContext.
|
||||
scoped_refptr<network::SharedURLLoaderFactory> GetSharedURLLoaderFactory();
|
||||
|
||||
// Returns a shared global NetExportFileWriter instance.
|
||||
net_log::NetExportFileWriter* GetNetExportFileWriter();
|
||||
|
||||
// Called when content creates a NetworkService. Creates the
|
||||
// SystemNetworkContext, if the network service is enabled.
|
||||
void OnNetworkServiceCreated(network::mojom::NetworkService* network_service);
|
||||
|
@ -119,9 +116,6 @@ class SystemNetworkContextManager {
|
|||
scoped_refptr<URLLoaderFactoryForSystem> shared_url_loader_factory_;
|
||||
network::mojom::URLLoaderFactoryPtr url_loader_factory_;
|
||||
|
||||
// Initialized on first access.
|
||||
std::unique_ptr<net_log::NetExportFileWriter> net_export_file_writer_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(SystemNetworkContextManager);
|
||||
};
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "shell/browser/api/atom_api_protocol.h"
|
||||
#include "shell/browser/atom_browser_client.h"
|
||||
#include "shell/browser/atom_browser_context.h"
|
||||
#include "shell/browser/atom_browser_main_parts.h"
|
||||
#include "shell/browser/browser_process_impl.h"
|
||||
#include "shell/browser/net/about_protocol_handler.h"
|
||||
#include "shell/browser/net/asar/asar_protocol_handler.h"
|
||||
|
@ -100,8 +101,10 @@ void SetupAtomURLRequestJobFactory(
|
|||
|
||||
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
|
||||
auto* host_resolver = url_request_context->host_resolver();
|
||||
auto* ftp_auth_cache = url_request_context->ftp_auth_cache();
|
||||
job_factory->SetProtocolHandler(
|
||||
url::kFtpScheme, net::FtpProtocolHandler::Create(host_resolver));
|
||||
url::kFtpScheme,
|
||||
net::FtpProtocolHandler::Create(host_resolver, ftp_auth_cache));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -128,13 +131,15 @@ URLRequestContextGetter::Handle::CreateMainRequestContextGetter(
|
|||
content::URLRequestInterceptorScopedVector protocol_interceptors) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
DCHECK(!main_request_context_getter_.get());
|
||||
DCHECK(g_browser_process->io_thread());
|
||||
DCHECK(AtomBrowserMainParts::Get()->browser_process()->io_thread());
|
||||
|
||||
LazyInitialize();
|
||||
main_request_context_getter_ = new URLRequestContextGetter(
|
||||
this, protocol_handlers, std::move(protocol_interceptors));
|
||||
g_browser_process->io_thread()->RegisterURLRequestContextGetter(
|
||||
main_request_context_getter_.get());
|
||||
AtomBrowserMainParts::Get()
|
||||
->browser_process()
|
||||
->io_thread()
|
||||
->RegisterURLRequestContextGetter(main_request_context_getter_.get());
|
||||
return main_request_context_getter_;
|
||||
}
|
||||
|
||||
|
@ -250,13 +255,16 @@ URLRequestContextGetter::~URLRequestContextGetter() {
|
|||
|
||||
void URLRequestContextGetter::NotifyContextShuttingDown() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
DCHECK(g_browser_process->io_thread());
|
||||
DCHECK(AtomBrowserMainParts::Get()->browser_process()->io_thread());
|
||||
DCHECK(context_handle_);
|
||||
|
||||
if (context_shutting_down_)
|
||||
return;
|
||||
|
||||
g_browser_process->io_thread()->DeregisterURLRequestContextGetter(this);
|
||||
AtomBrowserMainParts::Get()
|
||||
->browser_process()
|
||||
->io_thread()
|
||||
->DeregisterURLRequestContextGetter(this);
|
||||
|
||||
context_shutting_down_ = true;
|
||||
context_handle_->resource_context_.reset();
|
||||
|
@ -302,6 +310,11 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
|
|||
|
||||
builder->set_ct_verifier(std::make_unique<net::MultiLogCTVerifier>());
|
||||
|
||||
// Enable FTP, we override it later in SetupAtomURLRequestJobFactory
|
||||
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
|
||||
builder->set_ftp_enabled(true);
|
||||
#endif
|
||||
|
||||
auto* network_service = content::GetNetworkServiceImpl();
|
||||
network_context_ = network_service->CreateNetworkContextWithBuilder(
|
||||
std::move(context_handle_->main_network_context_request_),
|
||||
|
|
|
@ -35,9 +35,12 @@ void LayeredWindowUpdater::SetActive(bool active) {
|
|||
|
||||
void LayeredWindowUpdater::OnAllocatedSharedMemory(
|
||||
const gfx::Size& pixel_size,
|
||||
mojo::ScopedSharedBufferHandle scoped_buffer_handle) {
|
||||
base::UnsafeSharedMemoryRegion region) {
|
||||
canvas_.reset();
|
||||
|
||||
if (!region.IsValid())
|
||||
return;
|
||||
|
||||
// Make sure |pixel_size| is sane.
|
||||
size_t expected_bytes;
|
||||
bool size_result = viz::ResourceSizes::MaybeSizeInBytes(
|
||||
|
@ -46,31 +49,11 @@ void LayeredWindowUpdater::OnAllocatedSharedMemory(
|
|||
return;
|
||||
|
||||
#if defined(WIN32)
|
||||
base::SharedMemoryHandle shm_handle;
|
||||
size_t required_bytes;
|
||||
MojoResult unwrap_result = mojo::UnwrapSharedMemoryHandle(
|
||||
std::move(scoped_buffer_handle), &shm_handle, &required_bytes, nullptr);
|
||||
if (unwrap_result != MOJO_RESULT_OK)
|
||||
return;
|
||||
|
||||
base::SharedMemory shm(shm_handle, false);
|
||||
if (!shm.Map(required_bytes)) {
|
||||
DLOG(ERROR) << "Failed to map " << required_bytes << " bytes";
|
||||
return;
|
||||
}
|
||||
|
||||
canvas_ = skia::CreatePlatformCanvasWithSharedSection(
|
||||
pixel_size.width(), pixel_size.height(), false, shm.handle().GetHandle(),
|
||||
skia::CRASH_ON_FAILURE);
|
||||
pixel_size.width(), pixel_size.height(), false,
|
||||
region.GetPlatformHandle(), skia::CRASH_ON_FAILURE);
|
||||
#else
|
||||
auto shm =
|
||||
mojo::UnwrapWritableSharedMemoryRegion(std::move(scoped_buffer_handle));
|
||||
if (!shm.IsValid()) {
|
||||
DLOG(ERROR) << "Failed to unwrap shared memory region";
|
||||
return;
|
||||
}
|
||||
|
||||
shm_mapping_ = shm.Map();
|
||||
shm_mapping_ = region.Map();
|
||||
if (!shm_mapping_.IsValid()) {
|
||||
DLOG(ERROR) << "Failed to map shared memory region";
|
||||
return;
|
||||
|
|
|
@ -28,9 +28,8 @@ class LayeredWindowUpdater : public viz::mojom::LayeredWindowUpdater {
|
|||
void SetActive(bool active);
|
||||
|
||||
// viz::mojom::LayeredWindowUpdater implementation.
|
||||
void OnAllocatedSharedMemory(
|
||||
const gfx::Size& pixel_size,
|
||||
mojo::ScopedSharedBufferHandle scoped_buffer_handle) override;
|
||||
void OnAllocatedSharedMemory(const gfx::Size& pixel_size,
|
||||
base::UnsafeSharedMemoryRegion region) override;
|
||||
void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -36,12 +36,12 @@ void StopWorker(int document_cookie) {
|
|||
return;
|
||||
scoped_refptr<printing::PrintQueriesQueue> queue =
|
||||
g_browser_process->print_job_manager()->queue();
|
||||
scoped_refptr<printing::PrinterQuery> printer_query =
|
||||
std::unique_ptr<printing::PrinterQuery> printer_query =
|
||||
queue->PopPrinterQuery(document_cookie);
|
||||
if (printer_query.get()) {
|
||||
base::PostTaskWithTraits(
|
||||
FROM_HERE, {BrowserThread::IO},
|
||||
base::BindOnce(&printing::PrinterQuery::StopWorker, printer_query));
|
||||
base::PostTaskWithTraits(FROM_HERE, {BrowserThread::IO},
|
||||
base::BindOnce(&printing::PrinterQuery::StopWorker,
|
||||
std::move(printer_query)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ void PrintPreviewMessageHandler::OnCompositePdfDocumentDone(
|
|||
base::ReadOnlySharedMemoryRegion region) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
||||
if (status != printing::mojom::PdfCompositor::Status::SUCCESS) {
|
||||
if (status != printing::mojom::PdfCompositor::Status::kSuccess) {
|
||||
DLOG(ERROR) << "Compositing pdf failed with error " << status;
|
||||
RejectPromise(ids.request_id);
|
||||
return;
|
||||
|
|
|
@ -89,7 +89,7 @@ void GenerateAcceleratorTable(AcceleratorTable* table,
|
|||
|
||||
bool TriggerAcceleratorTableCommand(AcceleratorTable* table,
|
||||
const ui::Accelerator& accelerator) {
|
||||
if (base::ContainsKey(*table, accelerator)) {
|
||||
if (base::Contains(*table, accelerator)) {
|
||||
const accelerator_util::MenuItem& item = (*table)[accelerator];
|
||||
if (item.model->IsEnabledAt(item.position)) {
|
||||
const auto event_flags =
|
||||
|
|
|
@ -26,7 +26,7 @@ void AtomMenuModel::SetRole(int index, const base::string16& role) {
|
|||
|
||||
base::string16 AtomMenuModel::GetRoleAt(int index) {
|
||||
int command_id = GetCommandIdAt(index);
|
||||
if (base::ContainsKey(roles_, command_id))
|
||||
if (base::Contains(roles_, command_id))
|
||||
return roles_[command_id];
|
||||
else
|
||||
return base::string16();
|
||||
|
|
|
@ -28,7 +28,7 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
|
|||
// window delegate.
|
||||
auto* bridge_host = views::NativeWidgetMacNSWindowHost::GetFromNativeWindow(
|
||||
shell->GetNativeWindow());
|
||||
auto* bridged_view = bridge_host->bridge_impl();
|
||||
auto* bridged_view = bridge_host->GetInProcessNSWindowBridge();
|
||||
if ((self = [super initWithBridgedNativeWidget:bridged_view])) {
|
||||
shell_ = shell;
|
||||
is_zooming_ = false;
|
||||
|
@ -249,7 +249,7 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
|
|||
// has been closed.
|
||||
auto* bridge_host = views::NativeWidgetMacNSWindowHost::GetFromNativeWindow(
|
||||
shell_->GetNativeWindow());
|
||||
auto* bridged_view = bridge_host->bridge_impl();
|
||||
auto* bridged_view = bridge_host->GetInProcessNSWindowBridge();
|
||||
bridged_view->OnWindowWillClose();
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class BundledDataSource : public content::URLDataSource {
|
|||
~BundledDataSource() override {}
|
||||
|
||||
// content::URLDataSource implementation.
|
||||
std::string GetSource() const override { return kChromeUIDevToolsHost; }
|
||||
std::string GetSource() override { return kChromeUIDevToolsHost; }
|
||||
|
||||
void StartDataRequest(
|
||||
const std::string& path,
|
||||
|
@ -78,15 +78,15 @@ class BundledDataSource : public content::URLDataSource {
|
|||
callback.Run(nullptr);
|
||||
}
|
||||
|
||||
std::string GetMimeType(const std::string& path) const override {
|
||||
std::string GetMimeType(const std::string& path) override {
|
||||
return GetMimeTypeForPath(path);
|
||||
}
|
||||
|
||||
bool ShouldAddContentSecurityPolicy() const override { return false; }
|
||||
bool ShouldAddContentSecurityPolicy() override { return false; }
|
||||
|
||||
bool ShouldDenyXFrameOptions() const override { return false; }
|
||||
bool ShouldDenyXFrameOptions() override { return false; }
|
||||
|
||||
bool ShouldServeMimeTypeAsContentTypeHeader() const override { return true; }
|
||||
bool ShouldServeMimeTypeAsContentTypeHeader() override { return true; }
|
||||
|
||||
void StartBundledDataRequest(const std::string& path,
|
||||
const GotDataCallback& callback) {
|
||||
|
|
|
@ -19,14 +19,14 @@ TrayIconGtk::~TrayIconGtk() {}
|
|||
|
||||
void TrayIconGtk::SetImage(const gfx::Image& image) {
|
||||
if (icon_) {
|
||||
icon_->SetImage(image.AsImageSkia());
|
||||
icon_->SetIcon(image.AsImageSkia());
|
||||
return;
|
||||
}
|
||||
|
||||
const auto toolTip = base::UTF8ToUTF16(GetApplicationName());
|
||||
icon_ = views::LinuxUI::instance()->CreateLinuxStatusIcon(
|
||||
image.AsImageSkia(), toolTip, Browser::Get()->GetName().c_str());
|
||||
icon_->set_delegate(this);
|
||||
icon_->SetDelegate(this);
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetToolTip(const std::string& tool_tip) {
|
||||
|
@ -37,6 +37,23 @@ void TrayIconGtk::SetContextMenu(AtomMenuModel* menu_model) {
|
|||
icon_->UpdatePlatformContextMenu(menu_model);
|
||||
}
|
||||
|
||||
const gfx::ImageSkia& TrayIconGtk::GetImage() const {
|
||||
NOTREACHED();
|
||||
return dummy_image_;
|
||||
}
|
||||
|
||||
const base::string16& TrayIconGtk::GetToolTip() const {
|
||||
NOTREACHED();
|
||||
return dummy_string_;
|
||||
}
|
||||
|
||||
ui::MenuModel* TrayIconGtk::GetMenuModel() const {
|
||||
NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void TrayIconGtk::OnImplInitializationFailed() {}
|
||||
|
||||
void TrayIconGtk::OnClick() {
|
||||
NotifyClicked();
|
||||
}
|
||||
|
|
|
@ -27,13 +27,22 @@ class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate {
|
|||
void SetToolTip(const std::string& tool_tip) override;
|
||||
void SetContextMenu(AtomMenuModel* menu_model) override;
|
||||
|
||||
private:
|
||||
// views::StatusIconLinux::Delegate:
|
||||
// views::StatusIconLinux::Delegate
|
||||
void OnClick() override;
|
||||
bool HasClickAction() override;
|
||||
// The following four methods are only used by StatusIconLinuxDbus, which we
|
||||
// aren't yet using, so they are given stub implementations.
|
||||
const gfx::ImageSkia& GetImage() const override;
|
||||
const base::string16& GetToolTip() const override;
|
||||
ui::MenuModel* GetMenuModel() const override;
|
||||
void OnImplInitializationFailed() override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<views::StatusIconLinux> icon_;
|
||||
|
||||
gfx::ImageSkia dummy_image_;
|
||||
base::string16 dummy_string_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TrayIconGtk);
|
||||
};
|
||||
|
||||
|
|
|
@ -58,8 +58,8 @@ MenuBar::MenuBar(RootView* window)
|
|||
RefreshColorCache();
|
||||
UpdateViewColors();
|
||||
SetFocusBehavior(FocusBehavior::ALWAYS);
|
||||
SetLayoutManager(
|
||||
std::make_unique<views::BoxLayout>(views::BoxLayout::kHorizontal));
|
||||
SetLayoutManager(std::make_unique<views::BoxLayout>(
|
||||
views::BoxLayout::Orientation::kHorizontal));
|
||||
window_->GetFocusManager()->AddFocusChangeListener(color_updater_.get());
|
||||
}
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ bool TaskbarHost::SetThumbnailToolTip(HWND window, const std::string& tooltip) {
|
|||
}
|
||||
|
||||
bool TaskbarHost::HandleThumbarButtonEvent(int button_id) {
|
||||
if (ContainsKey(callback_map_, button_id)) {
|
||||
if (base::Contains(callback_map_, button_id)) {
|
||||
auto callback = callback_map_[button_id];
|
||||
if (!callback.is_null())
|
||||
callback.Run();
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
|
||||
namespace {
|
||||
|
||||
std::string MediaStreamTypeToString(blink::MediaStreamType type) {
|
||||
std::string MediaStreamTypeToString(blink::mojom::MediaStreamType type) {
|
||||
switch (type) {
|
||||
case blink::MediaStreamType::MEDIA_DEVICE_AUDIO_CAPTURE:
|
||||
case blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE:
|
||||
return "audio";
|
||||
case blink::MediaStreamType::MEDIA_DEVICE_VIDEO_CAPTURE:
|
||||
case blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE:
|
||||
return "video";
|
||||
default:
|
||||
return "unknown";
|
||||
|
@ -105,11 +105,11 @@ void WebContentsPermissionHelper::RequestMediaAccessPermission(
|
|||
base::DictionaryValue details;
|
||||
std::unique_ptr<base::ListValue> media_types(new base::ListValue);
|
||||
if (request.audio_type ==
|
||||
blink::MediaStreamType::MEDIA_DEVICE_AUDIO_CAPTURE) {
|
||||
blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE) {
|
||||
media_types->AppendString("audio");
|
||||
}
|
||||
if (request.video_type ==
|
||||
blink::MediaStreamType::MEDIA_DEVICE_VIDEO_CAPTURE) {
|
||||
blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE) {
|
||||
media_types->AppendString("video");
|
||||
}
|
||||
details.SetList("mediaTypes", std::move(media_types));
|
||||
|
@ -146,7 +146,7 @@ void WebContentsPermissionHelper::RequestOpenExternalPermission(
|
|||
|
||||
bool WebContentsPermissionHelper::CheckMediaAccessPermission(
|
||||
const GURL& security_origin,
|
||||
blink::MediaStreamType type) const {
|
||||
blink::mojom::MediaStreamType type) const {
|
||||
base::DictionaryValue details;
|
||||
details.SetString("securityOrigin", security_origin.spec());
|
||||
details.SetString("mediaType", MediaStreamTypeToString(type));
|
||||
|
|
|
@ -37,7 +37,7 @@ class WebContentsPermissionHelper
|
|||
|
||||
// Synchronous Checks
|
||||
bool CheckMediaAccessPermission(const GURL& security_origin,
|
||||
blink::MediaStreamType type) const;
|
||||
blink::mojom::MediaStreamType type) const;
|
||||
|
||||
private:
|
||||
explicit WebContentsPermissionHelper(content::WebContents* web_contents);
|
||||
|
|
|
@ -61,7 +61,7 @@ void WebViewGuestDelegate::DidDetach() {
|
|||
ResetZoomController();
|
||||
}
|
||||
|
||||
content::WebContents* WebViewGuestDelegate::GetOwnerWebContents() const {
|
||||
content::WebContents* WebViewGuestDelegate::GetOwnerWebContents() {
|
||||
return embedder_web_contents_;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
|
|||
protected:
|
||||
// content::BrowserPluginGuestDelegate:
|
||||
void DidDetach() final;
|
||||
content::WebContents* GetOwnerWebContents() const final;
|
||||
content::WebContents* GetOwnerWebContents() final;
|
||||
content::RenderWidgetHost* GetOwnerRenderWidgetHost() final;
|
||||
content::SiteInstance* GetOwnerSiteInstance() final;
|
||||
content::WebContents* CreateNewGuestWindow(
|
||||
|
|
|
@ -28,7 +28,7 @@ void WebViewManager::AddGuest(int guest_instance_id,
|
|||
}
|
||||
|
||||
void WebViewManager::RemoveGuest(int guest_instance_id) {
|
||||
if (!base::ContainsKey(web_contents_embedder_map_, guest_instance_id))
|
||||
if (!base::Contains(web_contents_embedder_map_, guest_instance_id))
|
||||
return;
|
||||
|
||||
web_contents_embedder_map_.erase(guest_instance_id);
|
||||
|
@ -42,7 +42,7 @@ void WebViewManager::RemoveGuest(int guest_instance_id) {
|
|||
}
|
||||
|
||||
content::WebContents* WebViewManager::GetEmbedder(int guest_instance_id) {
|
||||
if (base::ContainsKey(web_contents_embedder_map_, guest_instance_id))
|
||||
if (base::Contains(web_contents_embedder_map_, guest_instance_id))
|
||||
return web_contents_embedder_map_[guest_instance_id].embedder;
|
||||
else
|
||||
return nullptr;
|
||||
|
@ -52,11 +52,11 @@ content::WebContents* WebViewManager::GetGuestByInstanceID(
|
|||
int owner_process_id,
|
||||
int element_instance_id) {
|
||||
ElementInstanceKey key(owner_process_id, element_instance_id);
|
||||
if (!base::ContainsKey(element_instance_id_to_guest_map_, key))
|
||||
if (!base::Contains(element_instance_id_to_guest_map_, key))
|
||||
return nullptr;
|
||||
|
||||
int guest_instance_id = element_instance_id_to_guest_map_[key];
|
||||
if (base::ContainsKey(web_contents_embedder_map_, guest_instance_id))
|
||||
if (base::Contains(web_contents_embedder_map_, guest_instance_id))
|
||||
return web_contents_embedder_map_[guest_instance_id].web_contents;
|
||||
else
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue