Compare commits

..

39 Commits

Author SHA1 Message Date
Electron Bot
ae5d556845 Bump v5.0.5 2019-06-18 15:09:37 -07:00
trop[bot]
ebc937cfd5 chore: fix current branch fetch on master (#18861) 2019-06-18 08:34:23 -07:00
trop[bot]
f09f926cba fix: use effectiveAppearance to check dark mode on mojave and above (#18666) (#18852)
* fix: use effectiveAppearance to check dark mode on mojave and above

* chore: add forward declarations for dark appearance
2019-06-17 18:12:31 -07:00
Shelley Vohr
4964a09677 chore: update codeowners in 5 (#18835) 2019-06-17 14:06:43 -07:00
Milan Burda
a7c4d21427 fix: Uncaught TypeError: Cannot set property 'innerText' of null in default-app (#18819) 2019-06-17 10:24:43 -07:00
trop[bot]
07cd1e6b4d build: get current release branch from commit (#18834)
* chore: get current release branch from commit

* love too lint
2019-06-17 07:54:13 -07:00
Shelley Vohr
7a135c736b docs: better explain supported release line levels (#18800) (#18839) 2019-06-17 07:53:30 -07:00
Milan Burda
183c687f49 fix: [Liftoff] Correctly unuse Labels (#18545) 2019-06-15 19:42:31 +09:00
Milan Burda
b04eaabf4e fix: crash in BrowserWindow destructor after win.webContents.destroy() (#18686) (#18794) 2019-06-15 16:22:13 +09:00
trop[bot]
aae58ffcae build: use yarn to install arm modules (#18801) 2019-06-15 16:16:31 +09:00
Shelley Vohr
226dd755f8 fix: callback values for printing cancellation and success (#18804) 2019-06-15 16:13:49 +09:00
trop[bot]
2e6814c4b0 docs: add specific options for MenuItem.role (#18806) 2019-06-14 23:29:28 -07:00
Electron Bot
d4319badce Bump v5.0.4 2019-06-14 14:14:47 -07:00
Erick Zhao
b034bf9ae6 fix: throw error on invalid URLs when setting cookie (#18756)
With this PR, invalid inputs to the url parameter will throw an error when using cookie.set(). This is done by checking if the URL is parseable using GURL rather than checking if the URL string being passed in is empty.

Previously, invalid URLs would be able to be added as a cookie, but you would not be able to filter for them or remove them.
2019-06-14 10:54:32 -07:00
trop[bot]
c0e688ff35 docs: fully document MenuItem instance properties (#18785)
* document menuItem instance properties

* correct some types

* add correct click documentation
2019-06-13 18:45:13 -07:00
Shelley Vohr
bf9b001989 fix: HTML fullscreen request for sub frames (#18736) (#18781)
Don't re-enter fullscreen if there is a pending operation,
for subframe fullscreen request `EnterFullScreenModeForTab`
will be called for both the frame in question as well as
the outer webContents hosting it.
2019-06-13 17:59:51 -07:00
Shelley Vohr
0e0c3da49a fix: correct isDownloadable docs to match impl (#18748) 2019-06-13 16:17:23 -07:00
Shelley Vohr
63d994808c docs: fix editMenu menu role etc types (#18759) 2019-06-13 08:30:55 -07:00
Jeremy Spiegel
e0d566a7e7 fix: properly pass openExternal activate option (#18721)
A reference to an OpenExternalOptions structure was being captured by an Objective-C block that
outlived the object that was being referenced.
2019-06-12 20:56:39 -07:00
trop[bot]
eaa22b4aa8 fix: remove lingering data when notifications autodismiss on Windows 7 (#18741) 2019-06-12 21:43:48 +09:00
Alexandre Lacheze
99c3ff60bb fix: lost window.opener after cross-origin navigation (#18614)
* SiteInstance::CreateRelatedSiteInstance and use it

* Some relies on preloads in opened window

The fact that, now, we always have an opener for opened windows diables note integration in opened windows, except if `nodeIntegrationInSubFrames` is enabled.

* Add a test on window.opener after cross-orgin navigation

* Make sure to unregisterProtocol in tests

* Introduc and use a NetworkSandbox for tests

* Modify tests about zoom persistence to properly simulate cross-origin navigation

* Revert "Modify tests about zoom persistence to properly simulate cross-origin navigation"

This reverts commit 0a7537f2eb7f183ddec16637e8a2e92a0d600321.
2019-06-11 17:37:52 -07:00
Alexey Kuzmin
38cca77346 chore: reformat code C++ to make the linter happy (#18687) 2019-06-10 09:49:16 +09:00
Maya Wolf
a0872b2314 fix: contractions handling in spellchecker (#18548) 2019-06-07 19:12:17 -07:00
trop[bot]
8517c499e9 fix: use isEqual instead of pointer equality to convert NSAppearance (#18689) 2019-06-07 11:31:39 -07:00
trop[bot]
3f23f8b2a3 ci: fix issues downloading from CircleCI (#18655)
Make sure we pass along token to download from CircleCI
Also, add back off period for retries on downloads.
2019-06-05 10:54:22 -07:00
Electron Bot
45ab468ce1 Bump v5.0.3 2019-06-04 12:13:27 -07:00
Milan Burda
be458b547a build: remove Vulkan mock ICD (#18595) 2019-06-04 10:08:40 -05:00
trop[bot]
050bbfb211 build: move Windows release builds to AppVeyor cloud (#18604)
* build: move Windows release builds to AppVeyor cloud

* Use new env variable for AppVeyor cloud server
2019-06-04 10:29:37 -04:00
Milan Burda
0a4d90d41f fix: don't export private V8 symbols that can cause native node modules to crash (#18281) (#18620) 2019-06-04 10:13:29 -04:00
trop[bot]
0e56578e11 build: install python-dbusmock via pip for a Docker container (#18599)
* build: use python-dbusmock v0.18.1 on Linux

To prevent timeout errors with some other python-dbusmock versions.

* Don't use a fixed version of python-dbusmock

Co-Authored-By: John Kleinschmidt <jkleinsc@github.com>
2019-06-04 09:41:55 -04:00
trop[bot]
7a2777cc00 doc: change pyobjc link in macos build instruction (#18617) 2019-06-03 22:02:50 -07:00
trop[bot]
fc6b98766c build: strip swiftshader binaries (#18601) 2019-06-03 14:32:39 -07:00
trop[bot]
7d06861a6d ci: add retries to downloads for arm testing (#18533) 2019-05-30 21:08:57 -07:00
trop[bot]
851a84d301 docs: specify use case for the 'services' role (#18527)
* docs: specify use case for the 'services' role

* update based on @caesar's recommendation

Co-Authored-By: Caesar Schinas <caesar@caesarschinas.com>
2019-05-30 15:15:02 -07:00
trop[bot]
91bc35fbfc fix: populate phase of WebMouseWheelEvents generated in webContents.sendInputEvent. (#18495) 2019-05-30 15:11:37 -07:00
trop[bot]
76414e58d4 fix: respect minimizable/closable for customButtonsOnHover (#18485) 2019-05-29 13:00:36 -07:00
trop[bot]
d6ad3e6a17 docs: clarify that 'second-instance' is only emitted when the second instance calls app.requestSingleInstanceLock() (#18384) 2019-05-28 14:21:17 -07:00
Milan Burda
49d6f5cc14 chore: remove leftovers from memory property removal from app.getAppMetrics() (#18423) 2019-05-28 14:20:24 -07:00
Charles Kerr
610f61603d Rename 'API Contract' as 'Breaking Changes' in 5-0-x (#18400)
Backport of https://github.com/electron/electron/pull/18326 to the stable branch for visibility on electronjs.org
2019-05-23 15:03:24 -04:00
77 changed files with 938 additions and 675 deletions

View File

@@ -1,7 +1,7 @@
# These env vars are only necessary for creating Electron releases.
# See docs/development/releasing.md
APPVEYOR_TOKEN=
APPVEYOR_CLOUD_TOKEN=
CIRCLE_TOKEN=
ELECTRON_GITHUB_TOKEN=
VSTS_TOKEN=

33
.github/CODEOWNERS vendored
View File

@@ -3,19 +3,24 @@
# https://help.github.com/articles/about-codeowners
# https://git-scm.com/docs/gitignore
# Everything that falls through the cracks:
* @electron/reviewers
# Most stuff in here is owned by the Community & Safety WG...
/.github/* @electron/wg-community
# filename patterns
*browser_view* @electron/browserview
*notification* @electron/notifications
*pdf* @electron/printing
*printing* @electron/printing
*updater* @electron/updater
# ...except the Admin WG maintains this file.
/.github/CODEOWNERS @electron/wg-admin
# directories
/.github/ @electron/electrocats
/default_app/ @electron/docs
/docs/ @electron/docs
/docs-translations/ @electron/i18n
/npm/ @electron/electrocats
# Upgrades WG
/patches/ @electron/wg-upgrades
# Releases WG
/npm/ @electron/wg-releases
/script/release-notes @electron/wg-releases
/script/prepare-release.js @electron/wg-releases
/script/bump-version.js @electron/wg-releases
/script/ci-release-build.js @electron/wg-releases
/script/release.js @electron/wg-releases
/script/upload-to-github.js @electron/wg-releases
/script/release-artifact-cleanup.js @electron/wg-releases
/script/get-last-major-for-master.js @electron/wg-releases
/script/find-release.js @electron/wg-releases
/script/download-circleci-artifacts.js @electron/wg-releases

View File

@@ -16,7 +16,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
locales \
lsb-release \
nano \
python-dbusmock \
python-dbus \
python-pip \
python-setuptools \
sudo \
@@ -33,6 +33,9 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
# crcmod is required by gsutil, which is used for filling the gclient git cache
RUN pip install -U crcmod
# dbusmock is needed for Electron tests
RUN pip install python-dbusmock
RUN mkdir /tmp/workspace
RUN chown builduser:builduser /tmp/workspace

View File

@@ -1 +1 @@
5.0.2
5.0.5

View File

@@ -68,7 +68,7 @@ BrowserWindow::BrowserWindow(v8::Isolate* isolate,
}
web_contents_.Reset(isolate, web_contents.ToV8());
api_web_contents_ = web_contents.get();
api_web_contents_ = web_contents->GetWeakPtr();
api_web_contents_->AddObserver(this);
Observe(api_web_contents_->web_contents());
@@ -95,7 +95,9 @@ BrowserWindow::BrowserWindow(v8::Isolate* isolate,
}
BrowserWindow::~BrowserWindow() {
api_web_contents_->RemoveObserver(this);
// FIXME This is a hack rather than a proper fix preventing shutdown crashes.
if (api_web_contents_)
api_web_contents_->RemoveObserver(this);
// Note that the OnWindowClosed will not be called after the destructor runs,
// since the window object is managed by the TopLevelWindow class.
if (web_contents())

View File

@@ -116,7 +116,7 @@ class BrowserWindow : public TopLevelWindow,
#endif
v8::Global<v8::Value> web_contents_;
api::WebContents* api_web_contents_;
base::WeakPtr<api::WebContents> api_web_contents_;
base::WeakPtrFactory<BrowserWindow> weak_factory_;

View File

@@ -226,13 +226,13 @@ void FlushCookieStoreOnIOThread(
void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
std::unique_ptr<base::DictionaryValue> details,
util::Promise promise) {
std::string url, name, value, domain, path;
std::string url_string, name, value, domain, path;
bool secure = false;
bool http_only = false;
double creation_date;
double expiration_date;
double last_access_date;
details->GetString("url", &url);
details->GetString("url", &url_string);
details->GetString("name", &name);
details->GetString("value", &value);
details->GetString("domain", &domain);
@@ -261,24 +261,27 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
: base::Time::FromDoubleT(last_access_date);
}
auto completion_callback = base::BindOnce(OnSetCookie, std::move(promise));
GURL url(url_string);
if (!url.is_valid()) {
std::move(completion_callback).Run(false);
return;
}
if (name.empty()) {
std::move(completion_callback).Run(false);
return;
}
std::unique_ptr<net::CanonicalCookie> canonical_cookie(
net::CanonicalCookie::CreateSanitizedCookie(
GURL(url), name, value, domain, path, creation_time, expiration_time,
url, name, value, domain, path, creation_time, expiration_time,
last_access_time, secure, http_only,
net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT));
auto completion_callback = base::BindOnce(OnSetCookie, std::move(promise));
if (!canonical_cookie || !canonical_cookie->IsCanonical()) {
std::move(completion_callback).Run(false);
return;
}
if (url.empty()) {
std::move(completion_callback).Run(false);
return;
}
if (name.empty()) {
std::move(completion_callback).Run(false);
return;
}
GetCookieStore(getter)->SetCanonicalCookieAsync(
std::move(canonical_cookie), secure, http_only,
std::move(completion_callback));

View File

@@ -62,7 +62,7 @@ struct Converter<in_app_purchase::Product> {
dict.Set("formattedPrice", val.formattedPrice);
// Downloadable Content Information
dict.Set("isDownloadable", val.downloadable);
dict.Set("isDownloadable", val.isDownloadable);
return dict.GetHandle();
}

View File

@@ -57,11 +57,11 @@ struct Converter<NSAppearance*> {
return v8::Null(isolate);
}
if (val.name == NSAppearanceNameAqua) {
if ([val.name isEqualToString:NSAppearanceNameAqua]) {
return mate::ConvertToV8(isolate, "light");
}
if (@available(macOS 10.14, *)) {
if (val.name == NSAppearanceNameDarkAqua) {
if ([val.name isEqualToString:NSAppearanceNameDarkAqua]) {
return mate::ConvertToV8(isolate, "dark");
}
}

View File

@@ -287,7 +287,9 @@ struct WebContents::FrameDispatchHelper {
WebContents::WebContents(v8::Isolate* isolate,
content::WebContents* web_contents)
: content::WebContentsObserver(web_contents), type_(REMOTE) {
: content::WebContentsObserver(web_contents),
type_(REMOTE),
weak_factory_(this) {
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent(),
false);
Init(isolate);
@@ -298,7 +300,9 @@ WebContents::WebContents(v8::Isolate* isolate,
WebContents::WebContents(v8::Isolate* isolate,
std::unique_ptr<content::WebContents> web_contents,
Type type)
: content::WebContentsObserver(web_contents.get()), type_(type) {
: content::WebContentsObserver(web_contents.get()),
type_(type),
weak_factory_(this) {
DCHECK(type != REMOTE) << "Can't take ownership of a remote WebContents";
auto session = Session::CreateFrom(isolate, GetBrowserContext());
session_.Reset(isolate, session.ToV8());
@@ -306,8 +310,8 @@ WebContents::WebContents(v8::Isolate* isolate,
mate::Dictionary::CreateEmpty(isolate));
}
WebContents::WebContents(v8::Isolate* isolate,
const mate::Dictionary& options) {
WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
: weak_factory_(this) {
// Read options.
options.Get("backgroundThrottling", &background_throttling_);
@@ -837,6 +841,10 @@ void WebContents::DidChangeThemeColor(SkColor theme_color) {
}
}
void WebContents::DidAcquireFullscreen(content::RenderFrameHost* rfh) {
set_fullscreen_frame(rfh);
}
void WebContents::DocumentLoadedInFrame(
content::RenderFrameHost* render_frame_host) {
if (!render_frame_host->GetParent())
@@ -1748,6 +1756,19 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
mouse_wheel_event);
#endif
} else {
// Chromium expects phase info in wheel events (and applies a
// DCHECK to verify it). See: https://crbug.com/756524.
mouse_wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
mouse_wheel_event.dispatch_type = blink::WebInputEvent::kBlocking;
rwh->ForwardWheelEvent(mouse_wheel_event);
// Send a synthetic wheel event with phaseEnded to finish scrolling.
mouse_wheel_event.has_synthetic_phase = true;
mouse_wheel_event.delta_x = 0;
mouse_wheel_event.delta_y = 0;
mouse_wheel_event.phase = blink::WebMouseWheelEvent::kPhaseEnded;
mouse_wheel_event.dispatch_type =
blink::WebInputEvent::kEventNonBlocking;
rwh->ForwardWheelEvent(mouse_wheel_event);
}
return;

View File

@@ -111,6 +111,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
base::WeakPtr<WebContents> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
// Destroy the managed content::WebContents instance.
//
// Note: The |async| should only be |true| when users are expecting to use the
@@ -448,6 +450,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
const MediaPlayerId& id,
content::WebContentsObserver::MediaStoppedReason reason) override;
void DidChangeThemeColor(SkColor theme_color) override;
void DidAcquireFullscreen(content::RenderFrameHost* rfh) override;
// InspectableWebContentsDelegate:
void DevToolsReloadPage() override;
@@ -544,6 +547,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
// -1 means no speculative RVH has been committed yet.
int currently_committed_process_id_ = -1;
base::WeakPtrFactory<WebContents> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(WebContents);
};

View File

@@ -322,9 +322,12 @@ void CommonWebContentsDelegate::EnterFullscreenModeForTab(
const blink::WebFullscreenOptions& options) {
if (!owner_window_)
return;
if (IsFullscreenForTabOrPending(source)) {
DCHECK_EQ(fullscreen_frame_, source->GetFocusedFrame());
return;
}
SetHtmlApiFullscreen(true);
owner_window_->NotifyWindowEnterHtmlFullScreen();
source->GetRenderViewHost()->GetWidget()->SynchronizeVisualProperties();
}
void CommonWebContentsDelegate::ExitFullscreenModeForTab(
@@ -333,7 +336,6 @@ void CommonWebContentsDelegate::ExitFullscreenModeForTab(
return;
SetHtmlApiFullscreen(false);
owner_window_->NotifyWindowLeaveHtmlFullScreen();
source->GetRenderViewHost()->GetWidget()->SynchronizeVisualProperties();
}
bool CommonWebContentsDelegate::IsFullscreenForTabOrPending(

View File

@@ -68,6 +68,10 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate,
bool is_html_fullscreen() const { return html_fullscreen_; }
void set_fullscreen_frame(content::RenderFrameHost* rfh) {
fullscreen_frame_ = rfh;
}
protected:
#if BUILDFLAG(ENABLE_OSR)
virtual OffScreenWebContentsView* GetOffScreenWebContentsView() const;
@@ -203,6 +207,9 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate,
scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
// Stores the frame thats currently in fullscreen, nullptr if there is none.
content::RenderFrameHost* fullscreen_frame_ = nullptr;
base::WeakPtrFactory<CommonWebContentsDelegate> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CommonWebContentsDelegate);

View File

@@ -29,7 +29,7 @@ struct Product {
std::string formattedPrice;
// Downloadable Content Information
bool downloadable = false;
bool isDownloadable = false;
Product(const Product&);
Product();

View File

@@ -141,15 +141,13 @@
if (product.priceLocale != nil) {
productStruct.formattedPrice =
[[self formatPrice:product.price withLocal:product.priceLocale]
UTF8String];
[[self formatPrice:product.price
withLocal:product.priceLocale] UTF8String];
}
}
// Downloadable Content Information
if (product.downloadable == true) {
productStruct.downloadable = true;
}
productStruct.isDownloadable = [product downloadable];
return productStruct;
}

View File

@@ -165,7 +165,7 @@ class NativeWindowMac : public NativeWindow {
private:
// Add custom layers to the content view.
void AddContentViewLayers();
void AddContentViewLayers(bool minimizable, bool closable);
void InternalSetParentWindow(NativeWindow* parent, bool attach);
void SetForwardMouseMessages(bool forward);

View File

@@ -73,9 +73,11 @@
NSButton* close_button =
[NSWindow standardWindowButton:NSWindowCloseButton
forStyleMask:NSWindowStyleMaskTitled];
[close_button setTag:1];
NSButton* miniaturize_button =
[NSWindow standardWindowButton:NSWindowMiniaturizeButton
forStyleMask:NSWindowStyleMaskTitled];
[miniaturize_button setTag:2];
CGFloat x = 0;
const CGFloat space_between = 20;
@@ -459,7 +461,7 @@ NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
// Default content view.
SetContentView(new views::View());
AddContentViewLayers();
AddContentViewLayers(minimizable, closable);
original_frame_ = [window_ frame];
original_level_ = [window_ level];
@@ -851,9 +853,9 @@ void NativeWindowMac::SetAlwaysOnTop(bool top,
if (newLevel >= minWindowLevel && newLevel <= maxWindowLevel) {
[window_ setLevel:newLevel];
} else {
*error = std::string([
[NSString stringWithFormat:@"relativeLevel must be between %d and %d",
minWindowLevel, maxWindowLevel] UTF8String]);
*error = std::string([[NSString
stringWithFormat:@"relativeLevel must be between %d and %d",
minWindowLevel, maxWindowLevel] UTF8String]);
}
}
@@ -1092,7 +1094,7 @@ void NativeWindowMac::RemoveBrowserView(NativeBrowserView* view) {
}
[view->GetInspectableWebContentsView()->GetNativeView().GetNativeNSView()
removeFromSuperview];
removeFromSuperview];
remove_browser_view(view);
[CATransaction commit];
@@ -1374,7 +1376,7 @@ views::View* NativeWindowMac::GetContentsView() {
return root_view_.get();
}
void NativeWindowMac::AddContentViewLayers() {
void NativeWindowMac::AddContentViewLayers(bool minimizable, bool closable) {
// Make sure the bottom corner is rounded for non-modal windows:
// http://crbug.com/396264.
if (!is_modal()) {
@@ -1414,6 +1416,12 @@ void NativeWindowMac::AddContentViewLayers() {
[[CustomWindowButtonView alloc] initWithFrame:NSZeroRect]);
// NSWindowStyleMaskFullSizeContentView does not work with zoom button
SetFullScreenable(false);
if (!minimizable)
[[buttons_view_ viewWithTag:2] removeFromSuperview];
if (!closable)
[[buttons_view_ viewWithTag:1] removeFromSuperview];
[[window_ contentView] addSubview:buttons_view_];
} else {
if (title_bar_style_ != NORMAL)
@@ -1470,7 +1478,7 @@ void NativeWindowMac::OverrideNSWindowContentView() {
setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[container_view_ setFrame:[[[window_ contentView] superview] bounds]];
[window_ setContentView:container_view_];
AddContentViewLayers();
AddContentViewLayers(IsMinimizable(), IsClosable());
}
void NativeWindowMac::SetStyleMask(bool on, NSUInteger flag) {

View File

@@ -269,10 +269,16 @@ LRESULT DesktopNotificationController::Toast::WndProc(HWND hwnd,
case WM_MOUSEACTIVATE:
return MA_NOACTIVATE;
case WM_TIMER:
case WM_TIMER: {
if (wparam == TimerID_AutoDismiss) {
Get(hwnd)->AutoDismiss();
auto* inst = Get(hwnd);
Notification notification(inst->data_);
inst->data_->controller->OnNotificationDismissed(notification);
inst->AutoDismiss();
}
}
return 0;
case WM_LBUTTONDOWN: {

View File

@@ -47,8 +47,12 @@ void Win32Notification::Show(const NotificationOptions& options) {
if (existing) {
existing->tag_.clear();
this->notification_ref_ = std::move(existing->notification_ref_);
this->notification_ref_.Set(options.title, options.msg, image);
// Need to remove the entry in the notifications set that
// NotificationPresenter is holding
existing->Destroy();
} else {
this->notification_ref_ =
presenter->AddNotification(options.title, options.msg, image);

View File

@@ -17,9 +17,9 @@
<key>CFBundleIconFile</key>
<string>electron.icns</string>
<key>CFBundleVersion</key>
<string>5.0.2</string>
<string>5.0.5</string>
<key>CFBundleShortVersionString</key>
<string>5.0.2</string>
<string>5.0.5</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>

View File

@@ -50,8 +50,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,0,2,0
PRODUCTVERSION 5,0,2,0
FILEVERSION 5,0,5,0
PRODUCTVERSION 5,0,5,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -68,12 +68,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Electron"
VALUE "FileVersion", "5.0.2"
VALUE "FileVersion", "5.0.5"
VALUE "InternalName", "electron.exe"
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "electron.exe"
VALUE "ProductName", "Electron"
VALUE "ProductVersion", "5.0.2"
VALUE "ProductVersion", "5.0.5"
VALUE "SquirrelAwareVersion", "1"
END
END

View File

@@ -4,8 +4,10 @@
#include "atom/browser/ui/tray_icon_cocoa.h"
#include "atom/browser/mac/atom_application.h"
#include "atom/browser/ui/cocoa/NSString+ANSI.h"
#include "atom/browser/ui/cocoa/atom_menu_controller.h"
#include "base/mac/sdk_forward_declarations.h"
#include "base/strings/sys_string_conversions.h"
#include "ui/display/screen.h"
#include "ui/events/cocoa/cocoa_event_utils.h"
@@ -143,6 +145,10 @@ const CGFloat kVerticalTitleMargin = 2;
}
- (BOOL)isDarkMode {
if (@available(macOS 10.14, *)) {
return [[NSApplication sharedApplication].effectiveAppearance.name
isEqualToString:NSAppearanceNameDarkAqua];
}
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
NSString* mode = [defaults stringForKey:@"AppleInterfaceStyle"];
return mode && [mode isEqualToString:@"Dark"];
@@ -322,9 +328,9 @@ const CGFloat kVerticalTitleMargin = 2;
- (void)popUpContextMenu:(atom::AtomMenuModel*)menu_model {
// Show a custom menu.
if (menu_model) {
base::scoped_nsobject<AtomMenuController> menuController([
[AtomMenuController alloc] initWithModel:menu_model
useDefaultAccelerator:NO]);
base::scoped_nsobject<AtomMenuController> menuController(
[[AtomMenuController alloc] initWithModel:menu_model
useDefaultAccelerator:NO]);
forceHighlight_ = YES; // Should highlight when showing menu.
[self setNeedsDisplay:YES];
[statusItem_ popUpStatusItemMenu:[menuController menu]];

View File

@@ -7,7 +7,7 @@
#define ATOM_MAJOR_VERSION 5
#define ATOM_MINOR_VERSION 0
#define ATOM_PATCH_VERSION 2
#define ATOM_PATCH_VERSION 5
// clang-format off
// #define ATOM_PRE_RELEASE_VERSION
// clang-format on

View File

@@ -100,13 +100,14 @@ namespace {
void stop_and_close_uv_loop(uv_loop_t* loop) {
// Close any active handles
uv_stop(loop);
uv_walk(loop,
[](uv_handle_t* handle, void*) {
if (!uv_is_closing(handle)) {
uv_close(handle, nullptr);
}
},
nullptr);
uv_walk(
loop,
[](uv_handle_t* handle, void*) {
if (!uv_is_closing(handle)) {
uv_close(handle, nullptr);
}
},
nullptr);
// Run the loop to let it finish all the closing handles
// NB: after uv_stop(), uv_run(UV_RUN_DEFAULT) returns 0 when that's done
@@ -131,7 +132,7 @@ namespace {
// is not modified.
std::unique_ptr<const char* []> StringVectorToArgArray(
const std::vector<std::string>& vector) {
std::unique_ptr<const char* []> array(new const char*[vector.size()]);
std::unique_ptr<const char*[]> array(new const char*[vector.size()]);
for (size_t i = 0; i < vector.size(); ++i) {
array[i] = vector[i].c_str();
}
@@ -325,7 +326,7 @@ node::Environment* NodeBindings::CreateEnvironment(
.Append(FILE_PATH_LITERAL("init.js"));
args.insert(args.begin() + 1, script_path.AsUTF8Unsafe());
std::unique_ptr<const char* []> c_argv = StringVectorToArgArray(args);
std::unique_ptr<const char*[]> c_argv = StringVectorToArgArray(args);
node::Environment* env = node::CreateEnvironment(
node::CreateIsolateData(context->GetIsolate(), uv_loop_, platform),
context, args.size(), c_argv.get(), 0, nullptr);

View File

@@ -110,14 +110,15 @@ void OpenExternal(const GURL& url,
return;
}
bool activate = options.activate;
__block OpenExternalCallback c = std::move(callback);
dispatch_async(
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
__block std::string error = OpenURL(ns_url, options.activate);
dispatch_async(dispatch_get_main_queue(), ^{
std::move(c).Run(error);
});
});
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^{
__block std::string error = OpenURL(ns_url, activate);
dispatch_async(dispatch_get_main_queue(), ^{
std::move(c).Run(error);
});
});
}
bool MoveItemToTrash(const base::FilePath& full_path) {

View File

@@ -5,6 +5,8 @@
#include "atom/renderer/api/atom_api_spell_check_client.h"
#include <map>
#include <set>
#include <unordered_set>
#include <vector>
#include "atom/common/native_mate_converters/string16_converter.h"
@@ -37,14 +39,16 @@ bool HasWordCharacters(const base::string16& text, int index) {
return false;
}
struct Word {
blink::WebTextCheckingResult result;
base::string16 text;
std::vector<base::string16> contraction_words;
};
} // namespace
class SpellCheckClient::SpellcheckRequest {
public:
// Map of individual words to list of occurrences in text
using WordMap =
std::map<base::string16, std::vector<blink::WebTextCheckingResult>>;
SpellcheckRequest(const base::string16& text,
blink::WebTextCheckingCompletion* completion)
: text_(text), completion_(completion) {
@@ -54,11 +58,11 @@ class SpellCheckClient::SpellcheckRequest {
const base::string16& text() const { return text_; }
blink::WebTextCheckingCompletion* completion() { return completion_; }
WordMap& wordmap() { return word_map_; }
std::vector<Word>& wordlist() { return word_list_; }
private:
base::string16 text_; // Text to be checked in this task.
WordMap word_map_; // WordMap to hold distinct words in text
base::string16 text_; // Text to be checked in this task.
std::vector<Word> word_list_; // List of Words found in text
// The interface to send the misspelled ranges to WebKit.
blink::WebTextCheckingCompletion* completion_;
@@ -146,31 +150,27 @@ void SpellCheckClient::SpellCheckText() {
SpellCheckScope scope(*this);
base::string16 word;
std::vector<base::string16> words;
auto& word_map = pending_request_param_->wordmap();
blink::WebTextCheckingResult result;
std::set<base::string16> words;
auto& word_list = pending_request_param_->wordlist();
Word word_entry;
for (;;) { // Run until end of text
const auto status =
text_iterator_.GetNextWord(&word, &result.location, &result.length);
const auto status = text_iterator_.GetNextWord(
&word, &word_entry.result.location, &word_entry.result.length);
if (status == SpellcheckWordIterator::IS_END_OF_TEXT)
break;
if (status == SpellcheckWordIterator::IS_SKIPPABLE)
continue;
word_entry.text = word;
word_entry.contraction_words.clear();
word_list.push_back(word_entry);
words.insert(word);
// If the given word is a concatenated word of two or more valid words
// (e.g. "hello:hello"), we should treat it as a valid word.
std::vector<base::string16> contraction_words;
if (!IsContraction(scope, word, &contraction_words)) {
words.push_back(word);
word_map[word].push_back(result);
} else {
// For a contraction, we want check the spellings of each individual
// part, but mark the entire word incorrect if any part is misspelled
// Hence, we use the same word_start and word_length values for every
// part of the contraction.
for (const auto& w : contraction_words) {
words.push_back(w);
word_map[w].push_back(result);
if (IsContraction(scope, word, &word_entry.contraction_words)) {
for (const auto& w : word_entry.contraction_words) {
words.insert(w);
}
}
}
@@ -183,29 +183,34 @@ void SpellCheckClient::OnSpellCheckDone(
const std::vector<base::string16>& misspelled_words) {
std::vector<blink::WebTextCheckingResult> results;
auto* const completion_handler = pending_request_param_->completion();
std::unordered_set<base::string16> misspelled(misspelled_words.begin(),
misspelled_words.end());
auto& word_list = pending_request_param_->wordlist();
auto& word_map = pending_request_param_->wordmap();
// Take each word from the list of misspelled words received, find their
// corresponding WebTextCheckingResult that's stored in the map and pass
// all the results to blink through the completion callback.
for (const auto& word : misspelled_words) {
auto iter = word_map.find(word);
if (iter != word_map.end()) {
// Word found in map, now gather all the occurrences of the word
// from the map value
auto& words = iter->second;
results.insert(results.end(), words.begin(), words.end());
words.clear();
for (const auto& word : word_list) {
if (misspelled.find(word.text) != misspelled.end()) {
// If this is a contraction, iterate through parts and accept the word
// if none of them are misspelled
if (!word.contraction_words.empty()) {
auto all_correct = true;
for (const auto& contraction_word : word.contraction_words) {
if (misspelled.find(contraction_word) != misspelled.end()) {
all_correct = false;
break;
}
}
if (all_correct)
continue;
}
results.push_back(word.result);
}
}
completion_handler->DidFinishCheckingText(results);
pending_request_param_ = nullptr;
}
void SpellCheckClient::SpellCheckWords(
const SpellCheckScope& scope,
const std::vector<base::string16>& words) {
void SpellCheckClient::SpellCheckWords(const SpellCheckScope& scope,
const std::set<base::string16>& words) {
DCHECK(!scope.spell_check_.IsEmpty());
v8::Local<v8::FunctionTemplate> templ = mate::CreateFunctionTemplate(

View File

@@ -6,6 +6,7 @@
#define ATOM_RENDERER_API_ATOM_API_SPELL_CHECK_CLIENT_H_
#include <memory>
#include <set>
#include <string>
#include <vector>
@@ -68,7 +69,7 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient,
// The javascript function will callback OnSpellCheckDone
// with the results of all the misspelled words.
void SpellCheckWords(const SpellCheckScope& scope,
const std::vector<base::string16>& words);
const std::set<base::string16>& words);
// Returns whether or not the given word is a contraction of valid words
// (e.g. "word:word").

View File

@@ -10,8 +10,8 @@ EXTENSIONS_TO_SKIP = [
PATHS_TO_SKIP = [
'angledata', #Skipping because it is an output of //ui/gl that we don't need
'./libVkLayer_', #Skipping because these are outputs that we don't need
'./VkLayerLayer_', #Skipping because these are outputs that we don't need
'./libVkICD_mock_', #Skipping because these are outputs that we don't need
'./VkICD_mock_', #Skipping because these are outputs that we don't need
# //chrome/browser:resources depends on this via
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to

View File

@@ -28,11 +28,18 @@ function initialize () {
link.addEventListener('auxclick', openLinkExternally)
}
document.querySelector('.electron-version').innerText = `Electron v${process.versions.electron}`
document.querySelector('.chrome-version').innerText = `Chromium v${process.versions.chrome}`
document.querySelector('.node-version').innerText = `Node v${process.versions.node}`
document.querySelector('.v8-version').innerText = `v8 v${process.versions.v8}`
document.querySelector('.command-example').innerText = `${electronPath} path-to-app`
function replaceText (selector, text) {
const element = document.querySelector(selector)
if (element) {
element.innerText = text
}
}
replaceText('.electron-version', `Electron v${process.versions.electron}`)
replaceText('.chrome-version', `Chromium v${process.versions.chrome}`)
replaceText('.node-version', `Node v${process.versions.node}`)
replaceText('.v8-version', `v8 v${process.versions.v8}`)
replaceText('.command-example', `${electronPath} path-to-app`)
function getOcticonSvg (name) {
const octiconPath = path.resolve(__dirname, 'node_modules', 'octicons', 'build', 'svg', `${name}.svg`)

View File

@@ -390,8 +390,10 @@ Returns:
* `workingDirectory` String - The second instance's working directory
This event will be emitted inside the primary instance of your application
when a second instance has been executed. `argv` is an Array of the second instance's
command line arguments, and `workingDirectory` is its current working directory. Usually
when a second instance has been executed and calls `app.requestSingleInstanceLock()`.
`argv` is an Array of the second instance's command line arguments,
and `workingDirectory` is its current working directory. Usually
applications respond to this by making their primary window focused and
non-minimized.

View File

@@ -1,4 +1,4 @@
# API Contract
# Breaking Chnages
Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least [one major version](../tutorial/electron-versioning.md#semver) before the change is made.

View File

@@ -104,7 +104,7 @@ with `callback(error, cookies)` on complete.
#### `cookies.set(details)`
* `details` Object
* `url` String - The url to associate the cookie with.
* `url` String - The url to associate the cookie with. The promise will be rejected if the url is invalid.
* `name` String (optional) - The name of the cookie. Empty by default if omitted.
* `value` String (optional) - The value of the cookie. Empty by default if omitted.
* `domain` String (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains. Empty by default if omitted.

View File

@@ -14,7 +14,7 @@ See [`Menu`](menu.md) for examples.
* `menuItem` MenuItem
* `browserWindow` [BrowserWindow](browser-window.md)
* `event` Event
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteandmatchstyle`, `delete`, `selectall`, `reload`, `forcereload`, `toggledevtools`, `resetzoom`, `zoomin`, `zoomout`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideothers`, `unhide`, `quit`, `startspeaking`, `stopspeaking`, `close`, `minimize`, `zoom` or `front` - Define the action of the menu item, when specified the
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteandmatchstyle`, `delete`, `selectall`, `reload`, `forcereload`, `toggledevtools`, `resetzoom`, `zoomin`, `zoomout`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideothers`, `unhide`, `quit`, `startspeaking`, `stopspeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu` or `windowMenu` - Define the action of the menu item, when specified the
`click` property will be ignored. See [roles](#roles).
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
`radio`.
@@ -105,7 +105,7 @@ The following additional roles are available on _macOS_:
* `moveTabToNewWindow` - Map to the `moveTabToNewWindow` action.
* `window` - The submenu is a "Window" menu.
* `help` - The submenu is a "Help" menu.
* `services` - The submenu is a "Services" menu.
* `services` - The submenu is a ["Services"](https://developer.apple.com/documentation/appkit/nsapplication/1428608-servicesmenu?language=objc) menu. This is only intended for use in the Application Menu and is *not* the same as the "Services" submenu used in context menus in macOS apps, which is not implemented in Electron.
* `recentDocuments` - The submenu is an "Open Recent" menu.
* `clearRecentDocuments` - Map to the `clearRecentDocuments` action.
@@ -119,6 +119,50 @@ Lowercase `role`, e.g. `toggledevtools`, is still supported.
The following properties are available on instances of `MenuItem`:
#### `menuItem.id`
A `String` indicating the item's unique id, this property can be
dynamically changed.
#### `menuItem.label`
A `String` indicating the item's visible label, this property can be
dynamically changed.
#### `menuItem.click`
A `Function` that is fired when the MenuItem receives a click event.
It can be called with `menuItem.click(event, focusedWindow, focusedWebContents)`.
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `focusedWindow` [BrowserWindow](browser-window.md)
* `focusedWebContents` [WebContents](web-contents.md)
#### `menuItem.submenu`
A `Menu` (optional) containing the menu
item's submenu, if present.
#### `menuItem.type`
A `String` indicating the type of the item.
#### `menuItem.role`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteandmatchstyle`, `delete`, `selectall`, `reload`, `forcereload`, `toggledevtools`, `resetzoom`, `zoomin`, `zoomout`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideothers`, `unhide`, `quit`, `startspeaking`, `stopspeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu` or `windowMenu`
#### `menuItem.accelerator`
A `String` (optional) indicating the item's accelerator, if set.
#### `menuItem.icon`
A `NativeImage | String` (optional) indicating the
item's icon, if set.
#### `menuItem.sublabel`
A `String` indicating the item's sublabel, this property can be dynamically changed.
#### `menuItem.enabled`
A `Boolean` indicating whether the item is enabled, this property can be
@@ -142,10 +186,15 @@ will turn off that property for all adjacent items in the same menu.
You can add a `click` function for additional behavior.
#### `menuItem.label`
#### `menuItem.registerAccelerator`
A `String` representing the menu items visible label.
A `Boolean` indicating if the accelerator should be registered with the
system or just displayed, this property can be dynamically changed.
#### `menuItem.click`
#### `menuItem.commandId`
A `Function` that is fired when the MenuItem receives a click event.
A `Number` indicating an item's sequential unique id.
#### `menuItem.menu`
A `Menu` that the item is a part of.

View File

@@ -279,7 +279,6 @@ window.addEventListener('contextmenu', (e) => {
</script>
```
## Notes on macOS Application Menu
macOS has a completely different style of application menu from Windows and
@@ -287,7 +286,7 @@ Linux. Here are some notes on making your app's menu more native-like.
### Standard Menus
On macOS there are many system-defined standard menus, like the `Services` and
On macOS there are many system-defined standard menus, like the [`Services`](https://developer.apple.com/documentation/appkit/nsapplication/1428608-servicesmenu?language=objc) and
`Windows` menus. To make your menu a standard menu, you should set your menu's
`role` to one of the following and Electron will recognize them and make them
become standard menus:

View File

@@ -1,12 +0,0 @@
# MemoryInfo Object
* `pid` Integer - Process id of the process.
* `workingSetSize` Integer - The amount of memory currently pinned to actual physical RAM.
* `peakWorkingSetSize` Integer - The maximum amount of memory that has ever been pinned
to actual physical RAM. On macOS its value will always be 0.
* `privateBytes` Integer - The amount of memory not shared by other processes, such as
JS heap or HTML content.
* `sharedBytes` Integer - The amount of memory shared between processes, typically
memory consumed by the Electron code itself
Note that all statistics are reported in Kilobytes.

View File

@@ -7,4 +7,4 @@
* `contentLengths` Number[] - The total size of the content, in bytes.
* `price` Number - The cost of the product in the local currency.
* `formattedPrice` String - The locale formatted price of the product.
* `downloadable` Boolean - A Boolean value that indicates whether the App Store has downloadable content for this product.
* `isDownloadable` Boolean - A Boolean value that indicates whether the App Store has downloadable content for this product. `true` if at least one file has been associated with the product.

View File

@@ -29,7 +29,13 @@ $ brew install python@2 && brew link python@2 --force
If you are using Python as provided by Homebrew, you also need to install
the following Python modules:
* [pyobjc](https://pythonhosted.org/pyobjc/install.html)
* [pyobjc](https://pypi.org/project/pyobjc/#description)
You can use `pip` to install it:
```sh
$ pip install pyobjc
```
## macOS SDK

View File

@@ -33,9 +33,26 @@ tools and resources.
## Supported Versions
The latest three release branches are supported by the Electron team.
For example, if the latest release is 2.0.x, then the 2-0-x series
is supported, as are the two previous release series 1-7-x and 1-8-x.
The latest three major versions are supported by the Electron team.
For example, if the latest release is 5.0.x, then the 4.x.y series
is supported, as are the two previous release series 3.x.y and 2.x.y.
The latest stable release unilaterally receives all fixes from `master`,
and the version prior to that receives the vast majority of those fixes
as time and bandwidth warrants. The oldest supported release line will receive
only security fixes directly.
All supported release lines will accept external pull requests to backport
fixes previously merged to `master`, though this may be on a case-by-case
basis for some older supported lines. All contested decisions around release
line backports will be resolved by the [Releases Working Group](https://github.com/electron/governance/tree/master/wg-releases) as an agenda item at their weekly meeting the week the backport PR is raised.
### Currently supported versions
- 5.x
- 4.x
- 3.x
### End-of-life
When a release branch reaches the end of its support cycle, the series
will be deprecated in NPM and a final end-of-support release will be

View File

@@ -38,18 +38,6 @@ Object.assign(app, {
app.getFileIcon = deprecate.promisify(app.getFileIcon)
const nativeAppMetrics = app.getAppMetrics
app.getAppMetrics = () => {
const metrics = nativeAppMetrics.call(app)
for (const metric of metrics) {
if ('memory' in metric) {
deprecate.removeProperty(metric, 'memory')
}
}
return metrics
}
app.isPackaged = (() => {
const execFile = path.basename(process.execPath).toLowerCase()
if (process.platform === 'win32') {

9
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "5.0.2",
"version": "5.0.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -328,6 +328,7 @@
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
"dev": true,
"optional": true,
"requires": {
"kind-of": "^3.0.2",
"longest": "^1.0.1",
@@ -2330,7 +2331,8 @@
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz",
"integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==",
"dev": true
"dev": true,
"optional": true
},
"cssstyle": {
"version": "0.2.37",
@@ -7549,7 +7551,8 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
"dev": true
"dev": true,
"optional": true
},
"longest-streak": {
"version": "2.0.2",

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "5.0.2",
"version": "5.0.5",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {

View File

@@ -10,10 +10,10 @@ to fix electron/electron#13787. The backport landed in Chromium 67 but the
DidCreateScriptContext re-ordering needs to be upstreamed or kept indefinitely
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index 9c3e848f01aef165c21a6d6043b6f9038d31cb66..7c16e8da1052b50f36da8102fdd8b9206dd7883d 100644
index 176acc60950a6e4c9747bd1bb8e2583c2336fd0f..78742471a5571fb1d5e01ba073c03e2d75f7cba5 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -190,11 +190,10 @@ void LocalWindowProxy::Initialize() {
@@ -188,11 +188,10 @@ void LocalWindowProxy::Initialize() {
GetFrame()->IsMainFrame());
MainThreadDebugger::Instance()->ContextCreated(script_state_, GetFrame(),
origin);

View File

@@ -29,7 +29,7 @@ diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/cont
index 0817b4eca4f4e6f7f5d250589c1e4dbcc068237c..dcc2340e59771e8d73de7e97fa2371d8bec7b149 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -79,6 +79,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
@@ -79,6 +79,12 @@
DCHECK_EQ(1u, num_erased);
}

View File

@@ -5,10 +5,10 @@ Subject: can_create_window.patch
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index fcda9392b8a0cb24f80d64280432405f0b7d29e5..b804a7d118c2de6aa775d1b94b70f8208442261f 100644
index 66341ecfdc837c7d2d1ef45e14bcd4893c0a6b8a..bc596601da818b6000a1ccefb5fee0d4d098a995 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -3746,6 +3746,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -3754,6 +3754,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@@ -32,7 +32,7 @@ index e566a15b798e2586fa4fae3c4db97ce5f4f2f09f..08f52fd73bc9b6231a75f7804bb9b9f3
// Operation result when the renderer asks the browser to create a new window.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 07d71b3a06f9b3b7ab4ea4f16a27fc82e51c2a6c..9d00218ae972b34073c84f2de78dee934962c3d8 100644
index 10de4bf0974d95e661983949b334b212ff7d1835..64c4d9eb2dfb8f53f7a6c8f00140b0cf22f18a49 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -494,6 +494,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -45,7 +45,7 @@ index 07d71b3a06f9b3b7ab4ea4f16a27fc82e51c2a6c..9d00218ae972b34073c84f2de78dee93
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index eaa7d8b25141f8f2d461f0b37054c772c8df6297..09aca495389e48a8dbc1ea45b8bb636aa13d2486 100644
index b40ca1e3be824f4e2f782d36a89fef1a33148779..fdb9d7b8859270b36453e25349f7d84c44a6ce92 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -171,6 +171,7 @@ class RenderFrameHost;

View File

@@ -63,7 +63,7 @@ diff --git a/chrome/browser/ui/cocoa/color_chooser_mac.mm b/chrome/browser/ui/co
index bf47154f0a880f1c6143065e5c6d060f1df73765..e7cdab7a23d96345cc6e8ec578a8616d132b7d51 100644
--- a/chrome/browser/ui/cocoa/color_chooser_mac.mm
+++ b/chrome/browser/ui/cocoa/color_chooser_mac.mm
@@ -39,16 +39,18 @@ void ColorChooserMac::DidChooseColorInColorPanel(SkColor color) {
@@ -39,16 +39,18 @@
web_contents_->DidChooseColorInColorChooser(color);
}
@@ -87,7 +87,7 @@ index bf47154f0a880f1c6143065e5c6d060f1df73765..e7cdab7a23d96345cc6e8ec578a8616d
}
void ColorChooserMac::SetSelectedColor(SkColor color) {
@@ -67,9 +69,14 @@ void ColorChooserMac::SetSelectedColor(SkColor color) {
@@ -67,9 +69,14 @@ - (id)initWithChooser:(ColorChooserMac*)chooser {
chooser_ = chooser;
NSColorPanel* panel = [NSColorPanel sharedColorPanel];
[panel setShowsAlpha:NO];
@@ -103,7 +103,7 @@ index bf47154f0a880f1c6143065e5c6d060f1df73765..e7cdab7a23d96345cc6e8ec578a8616d
}
return self;
}
@@ -82,19 +89,21 @@ void ColorChooserMac::SetSelectedColor(SkColor color) {
@@ -82,19 +89,21 @@ - (void)dealloc {
// the ColorPanelCocoa is still the target.
BOOL respondsToPrivateTargetMethod =
[panel respondsToSelector:@selector(__target)];
@@ -134,7 +134,7 @@ diff --git a/chrome/browser/ui/cocoa/color_panel_cocoa_unittest.mm b/chrome/brow
index 83185ceb9bbd29bf38fce7f72c23f3a5b15ba6c8..823365fdfc0bceceeed6f5edc00b3462715a4751 100644
--- a/chrome/browser/ui/cocoa/color_panel_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/color_panel_cocoa_unittest.mm
@@ -28,28 +28,6 @@ class ColorPanelCocoaTest : public CocoaTest {
@@ -28,28 +28,6 @@ void SetUp() override {
}
};
@@ -163,7 +163,7 @@ index 83185ceb9bbd29bf38fce7f72c23f3a5b15ba6c8..823365fdfc0bceceeed6f5edc00b3462
TEST_F(ColorPanelCocoaTest, ClearTargetOnEnd) {
NSColorPanel* nscolor_panel = [NSColorPanel sharedColorPanel];
@autoreleasepool {
@@ -61,19 +39,12 @@ TEST_F(ColorPanelCocoaTest, ClearTargetOnEnd) {
@@ -61,19 +39,12 @@ void SetUp() override {
// Confirm the NSColorPanel's configuration by the ColorChooserMac's
// ColorPanelCocoa.

View File

@@ -18,7 +18,7 @@ diff --git a/chrome/browser/extensions/global_shortcut_listener_mac.mm b/chrome/
index befe726af9c10b1563a7fc0bb77cc55f65943d5c..46c6fe08bab8471007f78d3ef227e5195bfdf0e1 100644
--- a/chrome/browser/extensions/global_shortcut_listener_mac.mm
+++ b/chrome/browser/extensions/global_shortcut_listener_mac.mm
@@ -21,6 +21,26 @@ using extensions::GlobalShortcutListenerMac;
@@ -21,6 +21,26 @@
namespace extensions {
@@ -104,7 +104,7 @@ index b48fa8e63867021bdd77bf585a0e02c366980d91..bae9e24e7bcf7615be243bcb5629cc59
}
return VKEY_UNKNOWN;
}
@@ -190,7 +196,10 @@ CGEventRef MediaKeysListenerImpl::EventTapCallback(CGEventTapProxy proxy,
@@ -190,7 +196,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy,
int key_code = (data1 & 0xFFFF0000) >> 16;
if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT &&
key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST &&

View File

@@ -22,7 +22,7 @@ index bd62ed07876ad4a2a7c6e8309843281719dbefb6..13e67994997caf175ba1b30ba8070718
}
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index e474d899fbcebfbaf4cb2ec0b63cc963292ee39a..8446076e169efb64569fb2e463cb5ebf5e1e6ee9 100644
index 0aff71c4339d0eacecf6b6d86ab750738696c31e..d3b2cdece52c4ca47776b6c79a97f2239fb253b6 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -58,6 +58,10 @@ ContentBrowserClient::SiteInstanceForNavigationType ContentBrowserClient::Should
@@ -37,7 +37,7 @@ index e474d899fbcebfbaf4cb2ec0b63cc963292ee39a..8446076e169efb64569fb2e463cb5ebf
const MainFunctionParams& parameters) {
return nullptr;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 2cc843982a697dbd693ca1d5fda3a8ab68c96f73..3ebe17d34cdcfb02acacd3c32f5dbb87594c010f 100644
index 9f0a966d8abf72b606906b14f00748b4466f8b0a..d01b1eaa680a6cfd999a67ecbdfd3cd29c311dc9 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -237,6 +237,9 @@ class CONTENT_EXPORT ContentBrowserClient {

View File

@@ -268,7 +268,7 @@ index 1c93dfbc345d07769d7c91c8ecffc33bcd7505c1..ab87b6e5be09117e3dc1485a411ce72d
service_manager::switches::kGpuSandboxAllowSysVShm,
service_manager::switches::kGpuSandboxFailuresFatal,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 77f9ff3979592f711a2f8b8cea5df31376d7f31d..933b4b4cadae9f9d997ed517d35d30e1ab18f630 100644
index 553ba03f0e8b995d3a5b1c26242bf85565c0037b..47d2047662bec651c94bb0667bf51791abe2ca49 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -221,6 +221,7 @@
@@ -279,7 +279,7 @@ index 77f9ff3979592f711a2f8b8cea5df31376d7f31d..933b4b4cadae9f9d997ed517d35d30e1
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
@@ -3064,6 +3065,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3068,6 +3069,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
// Propagate the following switches to the renderer command line (along
// with any associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {

View File

@@ -5,7 +5,7 @@ Subject: disable_hidden.patch
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 316e7cf9819c0ffe3a15a55e6bcada781d6d7832..d90f50ed29740b14e6259c4d6d14434222ddbfb4 100644
index f54486215cee46be524f8d607c511903891409e2..11bfaeb762ee215ba6fc0e6a5c24093ceaefd104 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -760,6 +760,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -19,10 +19,10 @@ index 316e7cf9819c0ffe3a15a55e6bcada781d6d7832..d90f50ed29740b14e6259c4d6d144342
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasHidden");
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 4fd95dc7bdcd99342bd110d46b5829eb784e0f40..47af7e316c36c2f1733721170a6eff7fae39fa77 100644
index 33497ea7cd429df7db431ff1971ca84528c6d2d3..817ccdf2ed45f5afb3874cbbd6d2d9e8a1f1c458 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -153,6 +153,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -154,6 +154,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// RenderWidgetHostImpl.
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);

View File

@@ -6,7 +6,7 @@ Subject: disable_time_ticks_dcheck.patch
The DCHECK is failing for some reason.
diff --git a/content/common/inter_process_time_ticks_converter.cc b/content/common/inter_process_time_ticks_converter.cc
index 128abab37eb8..4d8e5e9c05b1 100644
index 128abab37eb8a96535ef92ebf11a463e863cc485..4d8e5e9c05b11083a69537d5badc85924b6fbae2 100644
--- a/content/common/inter_process_time_ticks_converter.cc
+++ b/content/common/inter_process_time_ticks_converter.cc
@@ -55,13 +55,13 @@ LocalTimeTicks InterProcessTimeTicksConverter::ToLocalTimeTicks(

View File

@@ -4,7 +4,6 @@ Date: Mon, 4 Mar 2019 14:46:48 -0800
Subject: fix: disable usage of pthread_fchdir_np and pthread_chdir_np in MAS
builds
diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc
index 6c0e14fc3332c27309c83137cff9f060ed306aea..2f77af0cafbc0122603bc2735f6327e2e42a07b6 100644
--- a/base/process/launch_mac.cc

View File

@@ -4,9 +4,8 @@ Date: Mon, 4 Mar 2019 14:51:45 -0800
Subject: fix: disable usage of SetApplicationIsDaemon and
_LSSetApplicationLaunchServicesServerConnectionStatus in MAS builds
diff --git a/content/utility/utility_service_factory.cc b/content/utility/utility_service_factory.cc
index 4450cc711772c600f138acb5458eb8ab0801ecf5..58e81aac8f8c97e5a3b3cd32b4d95789e14d2d31 100644
index 24a2644f008eb4878c87b62aebac962d074a0fe3..c1d07917c2ea576971b23c0f309d58ce559ca0ba 100644
--- a/content/utility/utility_service_factory.cc
+++ b/content/utility/utility_service_factory.cc
@@ -195,7 +195,7 @@ void UtilityServiceFactory::RunNetworkServiceOnIOThread(

View File

@@ -1,364 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xianzhu Wang <wangxianzhu@chromium.org>
Date: Thu Dec 6 02:00:06 2018 +0000
Backport dedab04b5256f88ec4dbbbae9492941e8cf1221a which fixes
compilation error for the test files.
This patch can be removed after updating to Chrome 73.
diff --git a/third_party/blink/renderer/platform/graphics/paint/display_item_raster_invalidator_test.cc b/third_party/blink/renderer/platform/graphics/paint/display_item_raster_invalidator_test.cc
index 97ffe553cd1e..771392a0137b 100644
--- a/third_party/blink/renderer/platform/graphics/paint/display_item_raster_invalidator_test.cc
+++ b/third_party/blink/renderer/platform/graphics/paint/display_item_raster_invalidator_test.cc
@@ -8,13 +8,15 @@
#include "third_party/blink/renderer/platform/graphics/paint/paint_artifact.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_controller_test.h"
#include "third_party/blink/renderer/platform/testing/paint_property_test_helpers.h"
+#include "third_party/blink/renderer/platform/testing/paint_test_configurations.h"
#include "third_party/blink/renderer/platform/testing/test_paint_artifact.h"
namespace blink {
using ::testing::UnorderedElementsAre;
-class DisplayItemRasterInvalidatorTest : public PaintControllerTestBase {
+class DisplayItemRasterInvalidatorTest : public PaintControllerTestBase,
+ public PaintTestConfigurations {
protected:
DisplayItemRasterInvalidatorTest() : invalidator_([](const IntRect&) {}) {}
@@ -26,6 +28,10 @@ class DisplayItemRasterInvalidatorTest : public PaintControllerTestBase {
// invalidation rects.
IntRect(0, 0, 20000, 20000), PropertyTreeState::Root());
GetPaintController().FinishCycle();
+ if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) {
+ GetPaintController().ClearPropertyTreeChangedStateTo(
+ PropertyTreeState::Root());
+ }
if (invalidator_.GetTracking())
return invalidator_.GetTracking()->Invalidations();
@@ -37,7 +43,9 @@ class DisplayItemRasterInvalidatorTest : public PaintControllerTestBase {
RasterInvalidator invalidator_;
};
-TEST_F(DisplayItemRasterInvalidatorTest, RemoveItemInMiddle) {
+INSTANTIATE_PAINT_TEST_CASE_P(DisplayItemRasterInvalidatorTest);
+
+TEST_P(DisplayItemRasterInvalidatorTest, RemoveItemInMiddle) {
FakeDisplayItemClient first("first", LayoutRect(100, 100, 300, 300));
FakeDisplayItemClient second("second", LayoutRect(100, 100, 200, 200));
GraphicsContext context(GetPaintController());
@@ -60,7 +68,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, RemoveItemInMiddle) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, SwapOrder) {
+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrder) {
FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100));
FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200));
FakeDisplayItemClient unaffected("unaffected", LayoutRect(300, 300, 10, 10));
@@ -91,7 +99,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrder) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateFirst) {
+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateFirst) {
FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100));
FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200));
FakeDisplayItemClient unaffected("unaffected", LayoutRect(300, 300, 10, 10));
@@ -117,7 +125,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateFirst) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateSecond) {
+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateSecond) {
FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100));
FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200));
FakeDisplayItemClient unaffected("unaffected", LayoutRect(300, 300, 10, 10));
@@ -143,7 +151,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateSecond) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithIncrementalInvalidation) {
+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderWithIncrementalInvalidation) {
FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100));
FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200));
FakeDisplayItemClient unaffected("unaffected", LayoutRect(300, 300, 10, 10));
@@ -171,7 +179,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithIncrementalInvalidation) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, NewItemInMiddle) {
+TEST_P(DisplayItemRasterInvalidatorTest, NewItemInMiddle) {
FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100));
FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200));
FakeDisplayItemClient third("third", LayoutRect(125, 100, 200, 50));
@@ -195,7 +203,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, NewItemInMiddle) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, Incremental) {
+TEST_P(DisplayItemRasterInvalidatorTest, Incremental) {
LayoutRect initial_rect(100, 100, 100, 100);
std::unique_ptr<FakeDisplayItemClient> clients[6];
for (size_t i = 0; i < base::size(clients); i++) {
@@ -259,7 +267,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, Incremental) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, AddRemoveFirstAndInvalidateSecond) {
+TEST_P(DisplayItemRasterInvalidatorTest, AddRemoveFirstAndInvalidateSecond) {
FakeDisplayItemClient chunk("chunk");
FakeDisplayItemClient first("first", LayoutRect(100, 100, 150, 150));
FakeDisplayItemClient second("second", LayoutRect(200, 200, 50, 50));
@@ -304,7 +312,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, AddRemoveFirstAndInvalidateSecond) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, InvalidateFirstAndAddRemoveSecond) {
+TEST_P(DisplayItemRasterInvalidatorTest, InvalidateFirstAndAddRemoveSecond) {
FakeDisplayItemClient first("first", LayoutRect(100, 100, 150, 150));
FakeDisplayItemClient second("second", LayoutRect(200, 200, 50, 50));
GraphicsContext context(GetPaintController());
@@ -351,7 +359,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, InvalidateFirstAndAddRemoveSecond) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithChildren) {
+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderWithChildren) {
FakeDisplayItemClient container1("container1",
LayoutRect(100, 100, 100, 100));
FakeDisplayItemClient content1("content1", LayoutRect(100, 100, 50, 200));
@@ -395,7 +403,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithChildren) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithChildrenAndInvalidation) {
+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderWithChildrenAndInvalidation) {
FakeDisplayItemClient container1("container1",
LayoutRect(100, 100, 100, 100));
FakeDisplayItemClient content1("content1", LayoutRect(100, 100, 50, 200));
@@ -443,7 +451,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithChildrenAndInvalidation) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderCrossingChunks) {
+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderCrossingChunks) {
FakeDisplayItemClient container1("container1",
LayoutRect(100, 100, 100, 100));
FakeDisplayItemClient content1("content1", LayoutRect(100, 100, 50, 200));
@@ -492,7 +500,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderCrossingChunks) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, SkipCache) {
+TEST_P(DisplayItemRasterInvalidatorTest, SkipCache) {
FakeDisplayItemClient multicol("multicol", LayoutRect(100, 100, 200, 200));
FakeDisplayItemClient content("content", LayoutRect(100, 100, 100, 100));
GraphicsContext context(GetPaintController());
@@ -549,7 +557,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SkipCache) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, PartialSkipCache) {
+TEST_P(DisplayItemRasterInvalidatorTest, PartialSkipCache) {
FakeDisplayItemClient content("content", LayoutRect(100, 100, 250, 250));
GraphicsContext context(GetPaintController());
@@ -581,7 +589,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, PartialSkipCache) {
invalidator_.SetTracksRasterInvalidations(false);
}
-TEST_F(DisplayItemRasterInvalidatorTest, Partial) {
+TEST_P(DisplayItemRasterInvalidatorTest, Partial) {
FakeDisplayItemClient client("client", LayoutRect(100, 100, 300, 300));
GraphicsContext context(GetPaintController());
diff --git a/third_party/blink/renderer/platform/graphics/paint/raster_invalidator_test.cc b/third_party/blink/renderer/platform/graphics/paint/raster_invalidator_test.cc
index 7f8306e2703e..4cecc2c3c41f 100644
--- a/third_party/blink/renderer/platform/graphics/paint/raster_invalidator_test.cc
+++ b/third_party/blink/renderer/platform/graphics/paint/raster_invalidator_test.cc
@@ -8,13 +8,15 @@
#include "third_party/blink/renderer/platform/graphics/paint/geometry_mapper.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_artifact.h"
#include "third_party/blink/renderer/platform/testing/paint_property_test_helpers.h"
+#include "third_party/blink/renderer/platform/testing/paint_test_configurations.h"
#include "third_party/blink/renderer/platform/testing/test_paint_artifact.h"
namespace blink {
static const IntRect kDefaultLayerBounds(-9999, -7777, 18888, 16666);
-class RasterInvalidatorTest : public testing::Test {
+class RasterInvalidatorTest : public testing::Test,
+ public PaintTestConfigurations {
public:
static PropertyTreeState DefaultPropertyTreeState() {
return PropertyTreeState::Root();
@@ -31,6 +33,11 @@ class RasterInvalidatorTest : public testing::Test {
void FinishCycle(PaintArtifact& artifact) {
artifact.FinishCycle();
ClearGeometryMapperCache();
+ if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) {
+ // See PaintArtifact::FinishCycle() for the reason of doing this.
+ for (auto& chunk : artifact.PaintChunks())
+ chunk.properties.ClearChangedToRoot();
+ }
}
static const Vector<RasterInvalidationInfo> TrackedRasterInvalidations(
@@ -54,6 +61,8 @@ class RasterInvalidatorTest : public testing::Test {
[](const IntRect& rect) {};
};
+INSTANTIATE_PAINT_TEST_CASE_P(RasterInvalidatorTest);
+
#define EXPECT_CHUNK_INVALIDATION_CUSTOM( \
invalidations, index, chunk, expected_reason, layer_offset, mapper) \
do { \
@@ -78,7 +87,7 @@ class RasterInvalidatorTest : public testing::Test {
EXPECT_EQ(PaintInvalidationReason::kIncremental, info.reason); \
} while (false)
-TEST_F(RasterInvalidatorTest, ImplicitFullLayerInvalidation) {
+TEST_P(RasterInvalidatorTest, ImplicitFullLayerInvalidation) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto artifact = TestPaintArtifact().Chunk(0).Build();
@@ -94,7 +103,7 @@ TEST_F(RasterInvalidatorTest, ImplicitFullLayerInvalidation) {
invalidator.SetTracksRasterInvalidations(false);
}
-TEST_F(RasterInvalidatorTest, LayerBounds) {
+TEST_P(RasterInvalidatorTest, LayerBounds) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto artifact = TestPaintArtifact().Chunk(0).Build();
@@ -122,7 +131,7 @@ TEST_F(RasterInvalidatorTest, LayerBounds) {
FinishCycle(*artifact);
}
-TEST_F(RasterInvalidatorTest, ReorderChunks) {
+TEST_P(RasterInvalidatorTest, ReorderChunks) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto artifact = TestPaintArtifact().Chunk(0).Chunk(1).Chunk(2).Build();
invalidator.Generate(artifact, kDefaultLayerBounds,
@@ -150,7 +159,7 @@ TEST_F(RasterInvalidatorTest, ReorderChunks) {
FinishCycle(*new_artifact);
}
-TEST_F(RasterInvalidatorTest, ReorderChunkSubsequences) {
+TEST_P(RasterInvalidatorTest, ReorderChunkSubsequences) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto artifact =
TestPaintArtifact().Chunk(0).Chunk(1).Chunk(2).Chunk(3).Chunk(4).Build();
@@ -185,7 +194,7 @@ TEST_F(RasterInvalidatorTest, ReorderChunkSubsequences) {
FinishCycle(*new_artifact);
}
-TEST_F(RasterInvalidatorTest, ChunkAppearAndDisappear) {
+TEST_P(RasterInvalidatorTest, ChunkAppearAndDisappear) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto artifact = TestPaintArtifact().Chunk(0).Chunk(1).Chunk(2).Build();
invalidator.Generate(artifact, kDefaultLayerBounds,
@@ -210,7 +219,7 @@ TEST_F(RasterInvalidatorTest, ChunkAppearAndDisappear) {
FinishCycle(*new_artifact);
}
-TEST_F(RasterInvalidatorTest, ChunkAppearAtEnd) {
+TEST_P(RasterInvalidatorTest, ChunkAppearAtEnd) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto artifact = TestPaintArtifact().Chunk(0).Build();
invalidator.Generate(artifact, kDefaultLayerBounds,
@@ -230,7 +239,7 @@ TEST_F(RasterInvalidatorTest, ChunkAppearAtEnd) {
FinishCycle(*new_artifact);
}
-TEST_F(RasterInvalidatorTest, UncacheableChunks) {
+TEST_P(RasterInvalidatorTest, UncacheableChunks) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto artifact =
TestPaintArtifact().Chunk(0).Chunk(1).Uncacheable().Chunk(2).Build();
@@ -254,7 +263,7 @@ TEST_F(RasterInvalidatorTest, UncacheableChunks) {
}
// Tests the path based on ClipPaintPropertyNode::Changed().
-TEST_F(RasterInvalidatorTest, ClipPropertyChangeRounded) {
+TEST_P(RasterInvalidatorTest, ClipPropertyChangeRounded) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
FloatRoundedRect::Radii radii(FloatSize(1, 2), FloatSize(2, 3),
FloatSize(3, 4), FloatSize(4, 5));
@@ -316,7 +325,7 @@ TEST_F(RasterInvalidatorTest, ClipPropertyChangeRounded) {
}
// Tests the path detecting change of PaintChunkInfo::chunk_to_layer_clip.
-TEST_F(RasterInvalidatorTest, ClipPropertyChangeSimple) {
+TEST_P(RasterInvalidatorTest, ClipPropertyChangeSimple) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
FloatRoundedRect clip_rect(-1000, -1000, 2000, 2000);
auto clip0 = CreateClip(c0(), &t0(), clip_rect);
@@ -385,7 +394,7 @@ TEST_F(RasterInvalidatorTest, ClipPropertyChangeSimple) {
FinishCycle(*artifact);
}
-TEST_F(RasterInvalidatorTest, ClipLocalTransformSpaceChange) {
+TEST_P(RasterInvalidatorTest, ClipLocalTransformSpaceChange) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto t1 = CreateTransform(t0(), TransformationMatrix());
@@ -422,7 +431,7 @@ TEST_F(RasterInvalidatorTest, ClipLocalTransformSpaceChange) {
// This is based on ClipLocalTransformSpaceChange, but tests the no-invalidation
// path by letting the clip's LocalTransformSpace be the same as the chunk's
// transform.
-TEST_F(RasterInvalidatorTest, ClipLocalTransformSpaceChangeNoInvalidation) {
+TEST_P(RasterInvalidatorTest, ClipLocalTransformSpaceChangeNoInvalidation) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto t1 = CreateTransform(t0(), TransformationMatrix());
@@ -453,7 +462,7 @@ TEST_F(RasterInvalidatorTest, ClipLocalTransformSpaceChangeNoInvalidation) {
FinishCycle(*artifact);
}
-TEST_F(RasterInvalidatorTest, TransformPropertyChange) {
+TEST_P(RasterInvalidatorTest, TransformPropertyChange) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto layer_transform = CreateTransform(t0(), TransformationMatrix().Scale(5));
@@ -534,7 +543,7 @@ TEST_F(RasterInvalidatorTest, TransformPropertyChange) {
FinishCycle(*artifact);
}
-TEST_F(RasterInvalidatorTest, TransformPropertyTinyChange) {
+TEST_P(RasterInvalidatorTest, TransformPropertyTinyChange) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto layer_transform = CreateTransform(t0(), TransformationMatrix().Scale(5));
@@ -580,7 +589,7 @@ TEST_F(RasterInvalidatorTest, TransformPropertyTinyChange) {
EXPECT_TRUE(invalidated);
}
-TEST_F(RasterInvalidatorTest, TransformPropertyTinyChangeScale) {
+TEST_P(RasterInvalidatorTest, TransformPropertyTinyChangeScale) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto layer_transform = CreateTransform(t0(), TransformationMatrix().Scale(5));
@@ -621,7 +630,7 @@ TEST_F(RasterInvalidatorTest, TransformPropertyTinyChangeScale) {
FinishCycle(*artifact);
}
-TEST_F(RasterInvalidatorTest, EffectLocalTransformSpaceChange) {
+TEST_P(RasterInvalidatorTest, EffectLocalTransformSpaceChange) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto t1 = CreateTransform(t0(), TransformationMatrix());
@@ -659,7 +668,7 @@ TEST_F(RasterInvalidatorTest, EffectLocalTransformSpaceChange) {
// This is based on EffectLocalTransformSpaceChange, but tests the no-
// invalidation path by letting the effect's LocalTransformSpace be the same as
// the chunk's transform.
-TEST_F(RasterInvalidatorTest, EffectLocalTransformSpaceChangeNoInvalidation) {
+TEST_P(RasterInvalidatorTest, EffectLocalTransformSpaceChangeNoInvalidation) {
RasterInvalidator invalidator(kNoopRasterInvalidation);
auto t1 = CreateTransform(t0(), TransformationMatrix());

View File

@@ -6,8 +6,42 @@ Subject: frame_host_manager.patch
Allows embedder to intercept site instances chosen by chromium
and respond with custom instance.
diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc
index 8aca9384edb69012628fc9afb98f647aeec7d593..10fe96e6c9bfc7f33a81ad9b75c75d4dda776d7c 100644
--- a/content/browser/browsing_instance.cc
+++ b/content/browser/browsing_instance.cc
@@ -53,6 +53,13 @@ scoped_refptr<SiteInstanceImpl> BrowsingInstance::GetSiteInstanceForURL(
return instance;
}
+scoped_refptr<SiteInstanceImpl> BrowsingInstance::CreateSiteInstanceForURL(
+ const GURL& url) {
+ scoped_refptr<SiteInstanceImpl> instance = new SiteInstanceImpl(this);
+ instance->SetSite(url);
+ return instance;
+}
+
void BrowsingInstance::RegisterSiteInstance(SiteInstanceImpl* site_instance) {
DCHECK(site_instance->browsing_instance_.get() == this);
DCHECK(site_instance->HasSite());
diff --git a/content/browser/browsing_instance.h b/content/browser/browsing_instance.h
index d439dfbb603876f942ff40fe1a505f9498f57c23..fd576eb894e06fe6c5cb21351b2b95b0a8444dce 100644
--- a/content/browser/browsing_instance.h
+++ b/content/browser/browsing_instance.h
@@ -100,6 +100,11 @@ class CONTENT_EXPORT BrowsingInstance final
// SiteInstance per site.
scoped_refptr<SiteInstanceImpl> GetSiteInstanceForURL(const GURL& url);
+ // Create a new SiteInstance for the given URL bound the current
+ // BrowsingInstance.
+ scoped_refptr<SiteInstanceImpl> CreateSiteInstanceForURL(
+ const GURL& url);
+
// Adds the given SiteInstance to our map, to ensure that we do not create
// another SiteInstance for the same site.
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index f9f8e5204d1d92e87370f859c294919d2a1991c3..ff42619d67b916bacb63f99b2391c905cccde218 100644
index f9f8e5204d1d92e87370f859c294919d2a1991c3..760965f134e3326676428b9fc6906f9ff740aac2 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1978,6 +1978,16 @@ bool RenderFrameHostManager::InitRenderView(
@@ -50,7 +84,7 @@ index f9f8e5204d1d92e87370f859c294919d2a1991c3..ff42619d67b916bacb63f99b2391c905
+ overriden_site_instance =
+ candidate_site_instance
+ ? candidate_site_instance
+ : SiteInstance::CreateForURL(browser_context,
+ : current_site_instance->CreateRelatedSiteInstance(
+ request.common_params().url);
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_CURRENT:
@@ -107,8 +141,35 @@ index f9f8e5204d1d92e87370f859c294919d2a1991c3..ff42619d67b916bacb63f99b2391c905
return dest_site_instance;
}
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index e1a7560631bd07f812315cb9932475cf890d8a6b..34b947c34a3eb676286f43fcb23100134f751dfb 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -236,6 +236,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
return browsing_instance_->HasSiteInstance(url);
}
+scoped_refptr<SiteInstance> SiteInstanceImpl::CreateRelatedSiteInstance(const GURL& url) {
+ return browsing_instance_->CreateSiteInstanceForURL(url);
+}
+
scoped_refptr<SiteInstance> SiteInstanceImpl::GetRelatedSiteInstance(
const GURL& url) {
return browsing_instance_->GetSiteInstanceForURL(url);
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
index da2696d679953096356e0c73891ff97854f76b54..c4c8e29a7723c4a22e6e52bd2f9ff792241b963a 100644
--- a/content/browser/site_instance_impl.h
+++ b/content/browser/site_instance_impl.h
@@ -70,6 +70,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
BrowserContext* GetBrowserContext() const override;
const GURL& GetSiteURL() const override;
scoped_refptr<SiteInstance> GetRelatedSiteInstance(const GURL& url) override;
+ scoped_refptr<SiteInstance> CreateRelatedSiteInstance(const GURL& url) override;
bool IsRelatedSiteInstance(const SiteInstance* instance) override;
size_t GetRelatedActiveContentsCount() override;
bool RequiresDedicatedProcess() override;
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 9d00218ae972b34073c84f2de78dee934962c3d8..e474d899fbcebfbaf4cb2ec0b63cc963292ee39a 100644
index 64c4d9eb2dfb8f53f7a6c8f00140b0cf22f18a49..0aff71c4339d0eacecf6b6d86ab750738696c31e 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -48,6 +48,16 @@ void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info,
@@ -129,7 +190,7 @@ index 9d00218ae972b34073c84f2de78dee934962c3d8..e474d899fbcebfbaf4cb2ec0b63cc963
const MainFunctionParams& parameters) {
return nullptr;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 09aca495389e48a8dbc1ea45b8bb636aa13d2486..2cc843982a697dbd693ca1d5fda3a8ab68c96f73 100644
index fdb9d7b8859270b36453e25349f7d84c44a6ce92..9f0a966d8abf72b606906b14f00748b4466f8b0a 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -206,8 +206,37 @@ CONTENT_EXPORT void OverrideOnBindInterface(
@@ -170,3 +231,19 @@ index 09aca495389e48a8dbc1ea45b8bb636aa13d2486..2cc843982a697dbd693ca1d5fda3a8ab
// Allows the embedder to set any number of custom BrowserMainParts
// implementations for the browser startup code. See comments in
// browser_main_parts.h.
diff --git a/content/public/browser/site_instance.h b/content/public/browser/site_instance.h
index 3b4c1cfacdad7ecc99b61cc0c2e4e71b72a855b6..d587f1e9211aa0e7636aa255a724ec9bb7399024 100644
--- a/content/public/browser/site_instance.h
+++ b/content/public/browser/site_instance.h
@@ -116,6 +116,11 @@ class CONTENT_EXPORT SiteInstance : public base::RefCounted<SiteInstance> {
// corresponds to a site URL with the host "example.com".
virtual const GURL& GetSiteURL() const = 0;
+ // Create a SiteInstance for the given URL that shares the current
+ // BrowsingInstance.
+ virtual scoped_refptr<SiteInstance> CreateRelatedSiteInstance(
+ const GURL& url) = 0;
+
// Gets a SiteInstance for the given URL that shares the current
// BrowsingInstance, creating a new SiteInstance if necessary. This ensures
// that a BrowsingInstance only has one SiteInstance per site, so that pages

View File

@@ -9,7 +9,7 @@ diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
index 2d619e791c03a17d29ed47abe765a0a644b364bc..c36989c429344d85a0f5efe11754de13b12ec5df 100644
--- a/base/mac/foundation_util.mm
+++ b/base/mac/foundation_util.mm
@@ -26,7 +26,6 @@ CFTypeID SecKeyGetTypeID();
@@ -26,7 +26,6 @@
#if !defined(OS_IOS)
CFTypeID SecACLGetTypeID();
CFTypeID SecTrustedApplicationGetTypeID();
@@ -17,7 +17,7 @@ index 2d619e791c03a17d29ed47abe765a0a644b364bc..c36989c429344d85a0f5efe11754de13
#endif
} // extern "C"
@@ -326,8 +325,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) {
@@ -326,8 +325,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) {
const_cast<NSFont*>(reinterpret_cast<const NSFont*>(cf_val));
DCHECK(!cf_val ||
CTFontGetTypeID() == CFGetTypeID(cf_val) ||
@@ -27,7 +27,7 @@ index 2d619e791c03a17d29ed47abe765a0a644b364bc..c36989c429344d85a0f5efe11754de13
return ns_val;
}
@@ -395,9 +393,6 @@ CFCast<CTFontRef>(const CFTypeRef& cf_val) {
@@ -395,9 +393,6 @@ CTFontRef NSToCFCast(NSFont* ns_val) {
return (CTFontRef)(cf_val);
}

View File

@@ -18,7 +18,7 @@ index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..2ec7f04c71824b47de1ddbf1f0e8625d
extern "C" {
// Kill ring calls. Would be better to use NSKillRing.h, but that's not
@@ -39,38 +40,53 @@ NSString* _NSYankFromKillRing();
@@ -39,38 +40,53 @@
void _NSNewKillRingSequence();
void _NSSetKillRingToYankedState();
}
@@ -92,7 +92,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185
namespace blink {
@@ -73,10 +75,12 @@ bool ThemePainterMac::PaintTextField(const Node* node,
@@ -73,10 +75,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame,
// behavior change while remaining a fragile solution.
// https://bugs.chromium.org/p/chromium/issues/detail?id=658085#c3
if (!use_ns_text_field_cell) {
@@ -105,7 +105,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185
return false;
}
@@ -162,10 +166,12 @@ bool ThemePainterMac::PaintTextArea(const Node* node,
@@ -162,10 +166,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame,
const PaintInfo& paint_info,
const IntRect& r) {
LocalCurrentGraphicsContext local_context(paint_info.context, r);

View File

@@ -41,7 +41,7 @@ diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/cont
index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad6e989746 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -135,6 +135,7 @@ NSDictionary* attributeToMethodNameMap = nil;
@@ -135,6 +135,7 @@
// VoiceOver uses -1 to mean "no limit" for AXResultsLimit.
const int kAXResultsLimitNoLimit = -1;
@@ -49,7 +49,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
extern "C" {
// The following are private accessibility APIs required for cursor navigation
@@ -341,6 +342,7 @@ NSAttributedString* GetAttributedTextForTextMarkerRange(
@@ -341,6 +342,7 @@ void AddMisspelledTextAttributes(
AddMisspelledTextAttributes(text_only_objects, attributed_text);
return [attributed_text attributedSubstringFromRange:range];
}
@@ -57,7 +57,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
// Returns an autoreleased copy of the AXNodeData's attribute.
NSString* NSStringForStringAttribute(
@@ -595,7 +597,9 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -595,7 +597,9 @@ + (void)initialize {
{NSAccessibilityDOMIdentifierAttribute, @"domIdentifier"},
{NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
{NSAccessibilityEnabledAttribute, @"enabled"},
@@ -67,7 +67,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
{NSAccessibilityExpandedAttribute, @"expanded"},
{NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
{NSAccessibilityFocusedAttribute, @"focused"},
@@ -630,13 +634,17 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -630,13 +634,17 @@ + (void)initialize {
{NSAccessibilityRowsAttribute, @"rows"},
// TODO(aboxhall): expose
// NSAccessibilityServesAsTitleForUIElementsAttribute
@@ -85,7 +85,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
{NSAccessibilitySizeAttribute, @"size"},
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
{NSAccessibilitySubroleAttribute, @"subrole"},
@@ -1052,6 +1060,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1052,6 +1060,7 @@ - (NSNumber*)enabled {
ax::mojom::Restriction::kDisabled];
}
@@ -93,7 +93,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
// Returns a text marker that points to the last character in the document that
// can be selected with VoiceOver.
- (id)endTextMarker {
@@ -1062,6 +1071,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1062,6 +1071,7 @@ - (id)endTextMarker {
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
}
@@ -101,7 +101,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
- (NSNumber*)expanded {
if (![self instanceActive])
@@ -1922,6 +1932,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1922,6 +1932,7 @@ - (NSValue*)selectedTextRange {
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
}
@@ -109,7 +109,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
- (id)selectedTextMarkerRange {
if (![self instanceActive])
return nil;
@@ -1954,6 +1965,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1954,6 +1965,7 @@ - (id)selectedTextMarkerRange {
anchorAffinity, *focusObject,
focusOffset, focusAffinity));
}
@@ -117,7 +117,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
- (NSValue*)size {
if (![self instanceActive])
@@ -1986,6 +1998,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1986,6 +1998,7 @@ - (NSString*)sortDirection {
return nil;
}
@@ -125,7 +125,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
// Returns a text marker that points to the first character in the document that
// can be selected with VoiceOver.
- (id)startTextMarker {
@@ -1996,6 +2009,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1996,6 +2009,7 @@ - (id)startTextMarker {
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
}
@@ -133,7 +133,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
// Returns a subrole based upon the role.
- (NSString*) subrole {
@@ -2301,12 +2315,14 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2301,12 +2315,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
NSMutableAttributedString* attributedValue =
[[[NSMutableAttributedString alloc] initWithString:value] autorelease];
@@ -148,7 +148,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
return [attributedValue attributedSubstringFromRange:range];
}
@@ -2392,6 +2408,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2392,6 +2408,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
return ToBrowserAccessibilityCocoa(cell);
}
@@ -156,7 +156,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) {
BrowserAccessibilityPositionInstance position =
CreatePositionFromTextMarker(parameter);
@@ -2569,6 +2586,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2569,6 +2586,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
NSString* text = GetTextForTextMarkerRange(parameter);
return [NSNumber numberWithInt:[text length]];
}
@@ -164,7 +164,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
if ([attribute isEqualToString:
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
@@ -2602,6 +2620,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2602,6 +2620,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
return nil;
}
@@ -172,7 +172,7 @@ index d1e716429cd96588c2df06d7c55ed6053d190f64..e1f41179b1cb3f9c68900ad0f0b0dbad
if ([attribute isEqualToString:
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
BrowserAccessibilityPositionInstance position =
@@ -2677,6 +2696,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2677,6 +2696,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
return @(child->GetIndexInParent());
}
@@ -184,7 +184,7 @@ diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm
index 242a86ddd00517adc5e09310a25739ee34b3d23c..aa95e8ba159e5e185f0814d13d8743f3e5be9b67 100644
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
@@ -463,6 +463,7 @@ NSDictionary* BrowserAccessibilityManagerMac::
@@ -463,6 +463,7 @@ void PostAnnouncementNotification(NSString* announcement) {
[user_info setObject:native_focus_object
forKey:NSAccessibilityTextChangeElement];
@@ -192,7 +192,7 @@ index 242a86ddd00517adc5e09310a25739ee34b3d23c..aa95e8ba159e5e185f0814d13d8743f3
id selected_text = [native_focus_object selectedTextMarkerRange];
if (selected_text) {
NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute =
@@ -470,6 +471,7 @@ NSDictionary* BrowserAccessibilityManagerMac::
@@ -470,6 +471,7 @@ void PostAnnouncementNotification(NSString* announcement) {
[user_info setObject:selected_text
forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
}
@@ -216,7 +216,7 @@ index b7142c2871faf4a0ba8be79266e9515d81585bdd..3d80c332e9af280a166612f6be54b6f7
namespace content {
@@ -35,6 +37,7 @@ namespace {
@@ -35,6 +37,7 @@
// verifies there are no existing open connections), and then indicates that
// Chrome should continue execution without access to launchservicesd.
void DisableSystemServices() {
@@ -244,7 +244,7 @@ index 6299846975301964c4066dff1a7eec40778e8d7f..c9c64e9ea8af9c02099695db38c27871
extern "C" {
// Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and
// `Karabiner` [3] to programmatically control the Bluetooth state. Calling the
@@ -49,6 +50,7 @@ extern "C" {
@@ -49,6 +50,7 @@
// [4] https://support.apple.com/kb/PH25091
void IOBluetoothPreferenceSetControllerPowerState(int state);
}
@@ -252,7 +252,7 @@ index 6299846975301964c4066dff1a7eec40778e8d7f..c9c64e9ea8af9c02099695db38c27871
namespace {
@@ -128,8 +130,10 @@ BluetoothAdapterMac::BluetoothAdapterMac()
@@ -128,8 +130,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
controller_state_function_(
base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState,
base::Unretained(this))),
@@ -263,7 +263,7 @@ index 6299846975301964c4066dff1a7eec40778e8d7f..c9c64e9ea8af9c02099695db38c27871
should_update_name_(true),
classic_discovery_manager_(
BluetoothDiscoveryManagerMac::CreateClassic(this)),
@@ -327,8 +331,12 @@ bool BluetoothAdapterMac::IsLowEnergyAvailable() {
@@ -327,8 +331,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
}
bool BluetoothAdapterMac::SetPoweredImpl(bool powered) {

View File

@@ -64,7 +64,7 @@ index 9985cfee820e4bb536813e39ebdca9b45574d6cf..e0636fde3c97bb4fce19b6042344cb43
mojo::MakeRequest(&notification_service_ptr_));
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
index 9b31e66db71ad167d593dd037bcecf4151b1452e..d01fe86c8f1ad8c9610b4b66f7b2b14bd819e359 100644
index d2b2c16756fad4e346a08881f6db1a975ef2e0fc..651da435d331ce87a559ff074a1b289fafe8a1b5 100644
--- a/content/browser/notifications/platform_notification_context_impl.cc
+++ b/content/browser/notifications/platform_notification_context_impl.cc
@@ -127,12 +127,13 @@ void PlatformNotificationContextImpl::ShutdownOnIO() {

View File

@@ -9,7 +9,7 @@ majority of changes originally come from these PRs:
* https://github.com/electron/electron/pull/8596
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 961e1560aa914942c01372c354059d6d6b72c50f..aa51b2b2b0e1950f7a660d48bda5e61ecea8951c 100644
index 961e1560aa914942c01372c354059d6d6b72c50f..5e364fa6637e8453b0be701637c7d5b96aa77b7b 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -21,12 +21,12 @@
@@ -26,8 +26,28 @@ index 961e1560aa914942c01372c354059d6d6b72c50f..aa51b2b2b0e1950f7a660d48bda5e61e
#include "printing/print_job_constants.h"
#include "printing/printed_document.h"
#include "printing/printing_utils.h"
@@ -265,10 +265,18 @@ void PrintJobWorker::GetSettingsDone(PrintingContext::Result result) {
// We can't use OnFailure() here since query_ does not support notifications.
DCHECK(query_);
- query_->PostTask(FROM_HERE,
+ if (result == PrintingContext::CANCEL) {
+ print_job_->PostTask(
+ FROM_HERE,
+ base::BindOnce(&NotificationCallback, base::RetainedRef(print_job_),
+ JobEventDetails::USER_INIT_CANCELED, 0,
+ base::RetainedRef(document_)));
+ } else {
+ query_->PostTask(FROM_HERE,
base::BindOnce(&PrinterQuery::GetSettingsDone,
base::WrapRefCounted(query_),
printing_context_->settings(), result));
+ }
}
void PrintJobWorker::GetSettingsWithUI(
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index 007b003dd58d44acd6e1351c237fca6463d90602..4ddbf18e335609623aba42cc39a7c977fe8c5229 100644
index 007b003dd58d44acd6e1351c237fca6463d90602..da7c14d03a740e5d2ca2099a15c6105b74c101b4 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -27,10 +27,7 @@
@@ -121,6 +141,31 @@ index 007b003dd58d44acd6e1351c237fca6463d90602..4ddbf18e335609623aba42cc39a7c977
#endif
ReleasePrinterQuery();
@@ -436,9 +441,12 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
content::NotificationService::NoDetails());
break;
}
- case JobEventDetails::USER_INIT_DONE:
- case JobEventDetails::DEFAULT_INIT_DONE:
case JobEventDetails::USER_INIT_CANCELED: {
+ ReleasePrintJob();
+ break;
+ }
+ case JobEventDetails::USER_INIT_DONE:
+ case JobEventDetails::DEFAULT_INIT_DONE: {
NOTREACHED();
break;
}
@@ -532,9 +540,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(PrinterQuery* query) {
DCHECK(!quit_inner_loop_);
DCHECK(query);
- // Disconnect the current |print_job_|.
- DisconnectFromCurrentPrintJob();
-
// We can't print if there is no renderer.
if (!web_contents()->GetRenderViewHost() ||
!web_contents()->GetRenderViewHost()->IsRenderViewLive()) {
@@ -594,6 +599,9 @@ void PrintViewManagerBase::ReleasePrintJob() {
content::RenderFrameHost* rfh = printing_rfh_;
printing_rfh_ = nullptr;
@@ -131,6 +176,26 @@ index 007b003dd58d44acd6e1351c237fca6463d90602..4ddbf18e335609623aba42cc39a7c977
if (!print_job_)
return;
@@ -604,7 +612,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
}
registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
- content::Source<PrintJob>(print_job_.get()));
+ content::NotificationService::AllSources());
// Don't close the worker thread.
print_job_ = nullptr;
}
@@ -678,6 +686,10 @@ bool PrintViewManagerBase::PrintNowInternal(
// Don't print / print preview interstitials or crashed tabs.
if (web_contents()->ShowingInterstitialPage() || web_contents()->IsCrashed())
return false;
+
+ registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
+ content::NotificationService::AllSources());
+
return rfh->Send(message.release());
}
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index a2569836d04ff968e690215f56f6de3b6d884874..6ddec22641b74d5484c2e0d4f62e5d71d8d783e9 100644
--- a/chrome/browser/printing/print_view_manager_base.h

View File

@@ -20,7 +20,7 @@ index 89939596b253bbd55b117328fd822b087607d8e3..aba0a33ec9a7f87a1f7f57ffed4c697d
// These are not documented, so use only after checking -respondsToSelector:.
@interface NSApplication (UndocumentedSpeechMethods)
- (void)speakString:(NSString*)string;
@@ -403,6 +408,9 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -403,6 +408,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
}
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
@@ -30,7 +30,7 @@ index 89939596b253bbd55b117328fd822b087607d8e3..aba0a33ec9a7f87a1f7f57ffed4c697d
return [self acceptsMouseEventsWhenInactive];
}
@@ -765,6 +773,10 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -765,6 +773,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
eventType == NSKeyDown &&
!(modifierFlags & NSCommandKeyMask);
@@ -41,7 +41,7 @@ index 89939596b253bbd55b117328fd822b087607d8e3..aba0a33ec9a7f87a1f7f57ffed4c697d
// We only handle key down events and just simply forward other events.
if (eventType != NSKeyDown) {
clientHelper_->ForwardKeyboardEvent(event, latency_info);
@@ -1513,9 +1525,11 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -1513,9 +1525,11 @@ - (id)accessibilityFocusedUIElement {
// Since this implementation doesn't have to wait any IPC calls, this doesn't
// make any key-typing jank. --hbono 7/23/09
//
@@ -53,7 +53,7 @@ index 89939596b253bbd55b117328fd822b087607d8e3..aba0a33ec9a7f87a1f7f57ffed4c697d
- (NSArray*)validAttributesForMarkedText {
// This code is just copied from WebKit except renaming variables.
@@ -1524,7 +1538,10 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
@@ -1524,7 +1538,10 @@ - (NSArray*)validAttributesForMarkedText {
initWithObjects:NSUnderlineStyleAttributeName,
NSUnderlineColorAttributeName,
NSMarkedClauseSegmentAttributeName,

View File

@@ -22,7 +22,7 @@ However, the patch would need to be reviewed by the security team, as it
does touch a security-sensitive class.
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 04f816a43b87609d31b89e147d6357dd66480200..77f9ff3979592f711a2f8b8cea5df31376d7f31d 100644
index 94d88268d6f5c5772ae3f80637c15cf4aa5a80a2..553ba03f0e8b995d3a5b1c26242bf85565c0037b 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -470,6 +470,10 @@ class RendererSandboxedProcessLauncherDelegate

View File

@@ -5,10 +5,10 @@ Subject: unsandboxed ppapi processes skip zygote
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 2d57937dfffb4ea85739f27780e53c04ef087f58..39a21171b4584cc6f45e2407a02dee2609603249 100644
index d7d70e9ad63257e77b109121334311a9930725bf..d3d7f18bb2d3a51ed8b3ae2d83b1e0e33838b444 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -106,6 +106,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate
@@ -105,6 +105,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate
service_manager::ZygoteHandle GetZygote() override {
const base::CommandLine& browser_command_line =
*base::CommandLine::ForCurrentProcess();

View File

@@ -20,7 +20,7 @@ diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser
index 9423f9c8a225f9d18f6dcd0b9f7de033cbe495df..e7fe311327f698a760c09db2c7677a10c59f5224 100644
--- a/content/browser/web_contents/web_drag_dest_mac.mm
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
@@ -336,6 +336,7 @@ content::GlobalRoutingID GetRenderViewHostID(content::RenderViewHost* rvh) {
@@ -336,6 +336,7 @@ - (void)setDragStartTrackersForProcess:(int)processID {
}
- (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH {

View File

@@ -8,3 +8,5 @@ do_not_run_arm_arm64_mksnapshot_binaries.patch
deps_provide_more_v8_backwards_compatibility.patch
dcheck.patch
expose_protected_v8_platform_systemclocktimemillis.patch
do_not_export_private_v8_symbols_on_windows.patch
liftoff_correctly_unuse_labels.patch

View File

@@ -0,0 +1,63 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tomas Rycl <torycl@microsoft.com>
Date: Mon, 13 May 2019 15:48:48 +0200
Subject: Do not export private V8 symbols on Windows
This change stops private V8 symbols and internal crt methods being exported.
It fixes an issue where native node modules can import
incorrect CRT methods and crash on Windows.
It also reduces size of node.lib by 75%.
This patch can be safely removed if, when it is removed, `node.lib` does not
contain any standard C++ library exports (e.g. `std::ostringstream`).
diff --git a/BUILD.gn b/BUILD.gn
index 465247a682cc1012d77c28c731fe1553565f128f..d208b9a2fbb6409bd436169b29786349a4df3b19 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -229,6 +229,7 @@ v8_toolset_for_shell = "host"
# Configurations
#
config("internal_config") {
+ defines = []
visibility = [ ":*" ] # Only targets in this file can depend on this.
include_dirs = [
@@ -238,8 +239,12 @@ config("internal_config") {
configs = [ "//build/config/compiler:wexit_time_destructors" ]
+ if (!is_component_build && is_electron_build) {
+ defines += [ "HIDE_PRIVATE_SYMBOLS" ]
+ }
+
if (is_component_build || is_electron_build) {
- defines = [ "BUILDING_V8_SHARED" ]
+ defines += [ "BUILDING_V8_SHARED" ]
}
}
diff --git a/src/base/macros.h b/src/base/macros.h
index 8a088ffc40eacb15b2833d6a85612e2075315fb9..76791d31b4a695ba9f8bb80121a791f512d99879 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -415,13 +415,17 @@ bool is_inbounds(float_t v) {
#ifdef V8_OS_WIN
// Setup for Windows shared library export.
+#if defined(HIDE_PRIVATE_SYMBOLS)
+#define V8_EXPORT_PRIVATE
+#else //if !defined(HIDE_PRIVATE_SYMBOLS)
#ifdef BUILDING_V8_SHARED
#define V8_EXPORT_PRIVATE __declspec(dllexport)
#elif USING_V8_SHARED
#define V8_EXPORT_PRIVATE __declspec(dllimport)
-#else
+#else //!(BUILDING_V8_SHARED || USING_V8_SHARED)
#define V8_EXPORT_PRIVATE
-#endif // BUILDING_V8_SHARED
+#endif
+#endif
#else // V8_OS_WIN

View File

@@ -0,0 +1,104 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Clemens Hammacher <clemensh@chromium.org>
Date: Tue, 29 Jan 2019 15:04:04 +0100
Subject: [Liftoff] Correctly unuse Labels
On Liftoff bailout, instead of binding all unbound labels (to avoid
triggering DCHECKS in their destructor), just Unuse them.
R=mstarzinger@chromium.org
Bug: chromium:924843
Change-Id: Icf581bca06eaa7369ab2bbd5d805112289d6a801
Reviewed-on: https://chromium-review.googlesource.com/c/1442645
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59172}
diff --git a/src/wasm/baseline/liftoff-compiler.cc b/src/wasm/baseline/liftoff-compiler.cc
index 8c5203479ef54cc66776ef6a27b0d739169b02dc..5e89fcd07143cc4e6d6a44af4c194a9400fd8850 100644
--- a/src/wasm/baseline/liftoff-compiler.cc
+++ b/src/wasm/baseline/liftoff-compiler.cc
@@ -174,7 +174,7 @@ class LiftoffCompiler {
compilation_zone_(compilation_zone),
safepoint_table_builder_(compilation_zone_) {}
- ~LiftoffCompiler() { BindUnboundLabels(nullptr); }
+ ~LiftoffCompiler() { UnuseLabels(nullptr); }
bool ok() const { return ok_; }
@@ -199,7 +199,7 @@ class LiftoffCompiler {
TRACE("unsupported: %s\n", reason);
decoder->errorf(decoder->pc_offset(), "unsupported liftoff operation: %s",
reason);
- BindUnboundLabels(decoder);
+ UnuseLabels(decoder);
}
bool DidAssemblerBailout(FullDecoder* decoder) {
@@ -225,23 +225,21 @@ class LiftoffCompiler {
return safepoint_table_builder_.GetCodeOffset();
}
- void BindUnboundLabels(FullDecoder* decoder) {
+ void UnuseLabels(FullDecoder* decoder) {
#ifdef DEBUG
- // Bind all labels now, otherwise their destructor will fire a DCHECK error
+ auto Unuse = [](Label* label) {
+ label->Unuse();
+ label->UnuseNear();
+ };
+ // Unuse all labels now, otherwise their destructor will fire a DCHECK error
// if they where referenced before.
uint32_t control_depth = decoder ? decoder->control_depth() : 0;
for (uint32_t i = 0; i < control_depth; ++i) {
Control* c = decoder->control_at(i);
- Label* label = c->label.get();
- if (!label->is_bound()) __ bind(label);
- if (c->else_state) {
- Label* else_label = c->else_state->label.get();
- if (!else_label->is_bound()) __ bind(else_label);
- }
- }
- for (auto& ool : out_of_line_code_) {
- if (!ool.label.get()->is_bound()) __ bind(ool.label.get());
+ Unuse(c->label.get());
+ if (c->else_state) Unuse(c->else_state->label.get());
}
+ for (auto& ool : out_of_line_code_) Unuse(ool.label.get());
#endif
}
@@ -451,7 +449,7 @@ class LiftoffCompiler {
void OnFirstError(FullDecoder* decoder) {
ok_ = false;
- BindUnboundLabels(decoder);
+ UnuseLabels(decoder);
asm_.AbortCompilation();
}
diff --git a/test/mjsunit/regress/wasm/regress-924843.js b/test/mjsunit/regress/wasm/regress-924843.js
new file mode 100644
index 0000000000000000000000000000000000000000..b59548540ccbd514eb65da4619698f87d2b48c70
--- /dev/null
+++ b/test/mjsunit/regress/wasm/regress-924843.js
@@ -0,0 +1,17 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+load('test/mjsunit/wasm/wasm-constants.js');
+load('test/mjsunit/wasm/wasm-module-builder.js');
+
+const builder = new WasmModuleBuilder();
+const sig = builder.addType(makeSig([kWasmI32, kWasmI32, kWasmI32], [kWasmI32]));
+builder.addFunction(undefined, sig)
+ .addBody([
+ kExprGetLocal, 2,
+ kExprIf, kWasmStmt,
+ kExprBlock, kWasmStmt
+ ]);
+builder.addExport('main', 0);
+assertThrows(() => builder.instantiate(), WebAssembly.CompileError);

View File

@@ -2,12 +2,12 @@ if (!process.env.CI) require('dotenv-safe').load()
const assert = require('assert')
const request = require('request')
const buildAppVeyorURL = 'https://windows-ci.electronjs.org/api/builds'
const buildAppVeyorURL = 'https://ci.appveyor.com/api/builds'
const vstsURL = 'https://github.visualstudio.com/electron/_apis/build'
const appVeyorJobs = {
'electron-x64': 'electron',
'electron-ia32': 'electron-39ng6'
'electron-x64': 'electron-x64-release',
'electron-ia32': 'electron-ia32-release'
}
const circleCIJobs = [
@@ -100,13 +100,13 @@ async function callAppVeyor (targetBranch, job, options) {
const requestOpts = {
url: buildAppVeyorURL,
auth: {
bearer: process.env.APPVEYOR_TOKEN
bearer: process.env.APPVEYOR_CLOUD_TOKEN
},
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountName: 'AppVeyor',
accountName: 'electron-bot',
projectSlug: appVeyorJobs[job],
branch: targetBranch,
environmentVariables
@@ -116,7 +116,7 @@ async function callAppVeyor (targetBranch, job, options) {
const appVeyorResponse = await makeRequest(requestOpts, true).catch(err => {
console.log('Error calling AppVeyor:', err)
})
const buildUrl = `https://windows-ci.electronjs.org/project/AppVeyor/${appVeyorJobs[job]}/build/${appVeyorResponse.version}`
const buildUrl = `https://ci.appveyor.com/project/electron-bot/${appVeyorJobs[job]}/build/${appVeyorResponse.version}`
console.log(`AppVeyor release build request for ${job} successful. Check build status at ${buildUrl}`)
}

View File

@@ -13,15 +13,17 @@ async function makeRequest (requestOptions, parseResponse) {
resolve(body)
}
} else {
console.error('Error occurred while requesting:', requestOptions.url)
if (parseResponse) {
try {
console.log('Error: ', `(status ${res.statusCode})`, err || JSON.parse(res.body), requestOptions)
} catch (err) {
if (args.verbose) {
console.error('Error occurred while requesting:', requestOptions.url)
if (parseResponse) {
try {
console.log('Error: ', `(status ${res.statusCode})`, err || JSON.parse(res.body), requestOptions)
} catch (err) {
console.log('Error: ', `(status ${res.statusCode})`, err || res.body, requestOptions)
}
} else {
console.log('Error: ', `(status ${res.statusCode})`, err || res.body, requestOptions)
}
} else {
console.log('Error: ', `(status ${res.statusCode})`, err || res.body, requestOptions)
}
reject(err)
}
@@ -39,7 +41,11 @@ async function downloadArtifact (name, buildNum, dest) {
'Accept': 'application/json'
}
}, true).catch(err => {
console.log('Error calling CircleCI:', err)
if (args.verbose) {
console.log('Error calling CircleCI:', err)
} else {
console.error('Error calling CircleCI to get artifact details')
}
})
const artifactToDownload = artifacts.find(artifact => {
return (artifact.path === name)
@@ -49,15 +55,41 @@ async function downloadArtifact (name, buildNum, dest) {
process.exit(1)
} else {
console.log(`Downloading ${artifactToDownload.url}.`)
await downloadFile(artifactToDownload.url, dest)
console.log(`Successfully downloaded ${name}.`)
let downloadError = false
await downloadWithRetry(artifactToDownload.url, dest).catch(err => {
if (args.verbose) {
console.log(`${artifactToDownload.url} could not be successfully downloaded. Error was:`, err)
} else {
console.log(`${artifactToDownload.url} could not be successfully downloaded.`)
}
downloadError = true
})
if (!downloadError) {
console.log(`Successfully downloaded ${name}.`)
}
}
}
async function downloadWithRetry (url, directory) {
let lastError
const downloadURL = `${url}?circle-token=${process.env.CIRCLE_TOKEN}`
for (let i = 0; i < 5; i++) {
console.log(`Attempting to download ${url} - attempt #${(i + 1)}`)
try {
return await downloadFile(downloadURL, directory)
} catch (err) {
lastError = err
await new Promise((resolve, reject) => setTimeout(resolve, 30000))
}
}
throw lastError
}
function downloadFile (url, directory) {
return new Promise((resolve, reject) => {
const nuggetOpts = {
dir: directory
dir: directory,
quiet: args.verbose
}
nugget(url, nuggetOpts, (err) => {
if (err) {
@@ -71,7 +103,7 @@ function downloadFile (url, directory) {
if (!args.name || !args.buildNum || !args.dest) {
console.log(`Download CircleCI artifacts.
Usage: download-circleci-artifacts.js [--buildNum=CIRCLE_BUILD_NUMBER] [--name=artifactName] [--dest]`)
Usage: download-circleci-artifacts.js [--buildNum=CIRCLE_BUILD_NUMBER] [--name=artifactName] [--dest] [--verbose]`)
process.exit(0)
} else {
downloadArtifact(args.name, args.buildNum, args.dest)

View File

@@ -24,20 +24,32 @@ function getAbsoluteElectronExec () {
return path.resolve(__dirname, '../../..', getElectronExec())
}
async function getCurrentBranch (gitDir) {
const gitArgs = ['rev-parse', '--abbrev-ref', 'HEAD']
const branchDetails = await GitProcess.exec(gitArgs, gitDir)
if (branchDetails.exitCode === 0) {
const currentBranch = branchDetails.stdout.trim()
console.log(`${pass} current git branch is: ${currentBranch}`)
return currentBranch
async function handleGitCall (args, gitDir) {
const details = await GitProcess.exec(args, gitDir)
if (details.exitCode === 0) {
const output = details.stdout.replace(/^\*|\s+|\s+$/, '')
return output.trim()
} else {
const error = GitProcess.parseError(branchDetails.stderr)
console.log(`${fail} couldn't get details current branch: `, error)
const error = GitProcess.parseError(details.stderr)
console.log(`${fail} couldn't parse git process call: `, error)
process.exit(1)
}
}
async function getCurrentBranch (gitDir) {
let branch = await handleGitCall(['rev-parse', '--abbrev-ref', 'HEAD'], gitDir)
if (branch !== 'master' && !branch.match(/[0-9]+-[0-9]+-x/)) {
const lastCommit = await handleGitCall(['rev-parse', 'HEAD'], gitDir)
const branches = (await handleGitCall(['branch', '--contains', lastCommit], gitDir)).split('\n')
branch = branches.filter(b => b === 'master' || b.match(/[0-9]+-[0-9]+-x/))[0]
if (!branch) {
console.log(`${fail} no release branch exists for this ref`)
process.exit(1)
}
}
return branch
}
module.exports = {
getCurrentBranch,
getElectronExec,

View File

@@ -9,7 +9,9 @@ LINUX_BINARIES_TO_STRIP = [
'electron',
'libffmpeg.so',
'libGLESv2.so',
'libEGL.so'
'libEGL.so',
'swiftshader/libGLESv2.so',
'swiftshader/libEGL.so'
]
def strip_binaries(directory, target_cpu):

View File

@@ -11,6 +11,7 @@ const http = require('http')
const { closeWindow } = require('./window-helpers')
const { emittedOnce } = require('./events-helpers')
const { resolveGetters } = require('./assert-helpers')
const { createNetworkSandbox } = require('./network-helper')
const { ipcRenderer, remote } = require('electron')
const { app, ipcMain, BrowserWindow, BrowserView, protocol, session, screen, webContents } = remote
@@ -306,7 +307,6 @@ describe('BrowserWindow module', () => {
})
it('should return a promise that resolves even if pushState occurs during navigation', async () => {
const data = Buffer.alloc(2 * 1024 * 1024).toString('base64')
const p = w.loadURL('data:text/html,<script>window.history.pushState({}, "/foo")</script>')
await expect(p).to.eventually.be.fulfilled()
})
@@ -1972,17 +1972,29 @@ describe('BrowserWindow module', () => {
})
describe('nativeWindowOpen option', () => {
beforeEach(() => {
const networkSandbox = createNetworkSandbox(protocol)
beforeEach(async () => {
// used to create cross-origin navigation situations
await networkSandbox.serveFileFromProtocol('foo', path.join(fixtures, 'api', 'window-open-location-change.html'))
await networkSandbox.serveFileFromProtocol('bar', path.join(fixtures, 'api', 'window-open-location-final.html'))
w.destroy()
w = new BrowserWindow({
show: false,
webPreferences: {
nodeIntegration: true,
nativeWindowOpen: true
nativeWindowOpen: true,
// tests relies on preloads in opened windows
nodeIntegrationInSubFrames: true
}
})
})
afterEach(async () => {
await networkSandbox.reset()
})
it('opens window of about:blank with cross-scripting enabled', (done) => {
ipcMain.once('answer', (event, content) => {
assert.strictEqual(content, 'Hello')
@@ -2027,7 +2039,9 @@ describe('BrowserWindow module', () => {
w = new BrowserWindow({
show: false,
webPreferences: {
nativeWindowOpen: true
nativeWindowOpen: true,
// test relies on preloads in opened window
nodeIntegrationInSubFrames: true
}
})
@@ -2044,7 +2058,9 @@ describe('BrowserWindow module', () => {
w = new BrowserWindow({
show: false,
webPreferences: {
nativeWindowOpen: true
nativeWindowOpen: true,
// test relies on preloads in opened window
nodeIntegrationInSubFrames: true
}
})
@@ -2058,14 +2074,13 @@ describe('BrowserWindow module', () => {
w.loadFile(path.join(fixtures, 'api', 'new-window.html'))
})
it('retains the original web preferences when window.location is changed to a new origin', async () => {
await serveFileFromProtocol('foo', path.join(fixtures, 'api', 'window-open-location-change.html'))
await serveFileFromProtocol('bar', path.join(fixtures, 'api', 'window-open-location-final.html'))
w.destroy()
w = new BrowserWindow({
show: true,
webPreferences: {
nativeWindowOpen: true
nativeWindowOpen: true,
// test relies on preloads in opened window
nodeIntegrationInSubFrames: true
}
})
@@ -2078,7 +2093,33 @@ describe('BrowserWindow module', () => {
expect(typeofProcess).to.eql('undefined')
})
it('window.opener is not null when window.location is changed to a new origin', async () => {
w.destroy()
w = new BrowserWindow({
show: true,
webPreferences: {
nativeWindowOpen: true,
// test relies on preloads in opened window
nodeIntegrationInSubFrames: true
}
})
ipcRenderer.send('set-web-preferences-on-next-new-window', w.webContents.id, 'preload', path.join(fixtures, 'api', 'window-open-preload.js'))
const p = emittedOnce(ipcMain, 'answer')
w.loadFile(path.join(fixtures, 'api', 'window-open-location-open.html'))
const [, , , windowOpenerIsNull] = await p
expect(windowOpenerIsNull).to.be.false('window.opener is null')
})
it('should have nodeIntegration disabled in child windows', async () => {
w.destroy()
w = new BrowserWindow({
show: false,
webPreferences: {
nodeIntegration: true,
nativeWindowOpen: true
}
})
const p = emittedOnce(ipcMain, 'answer')
w.loadFile(path.join(fixtures, 'api', 'native-window-open-argv.html'))
const [, typeofProcess] = await p
@@ -3762,22 +3803,3 @@ const isScaleFactorRounding = () => {
// Return true if scale factor is odd number above 2
return scaleFactor > 2 && scaleFactor % 2 === 1
}
function serveFileFromProtocol (protocolName, filePath) {
return new Promise((resolve, reject) => {
protocol.registerBufferProtocol(protocolName, (request, callback) => {
// Disabled due to false positive in StandardJS
// eslint-disable-next-line standard/no-callback-literal
callback({
mimeType: 'text/html',
data: fs.readFileSync(filePath)
})
}, (error) => {
if (error != null) {
reject(error)
} else {
resolve()
}
})
})
}

View File

@@ -145,6 +145,20 @@ describe('session module', () => {
expect(error).to.have.property('message').which.equals('Setting cookie failed')
})
it('yields an error when setting a cookie with an invalid URL', async () => {
let error
try {
const { cookies } = session.defaultSession
const name = '1'
const value = '1'
await cookies.set({ url: 'asdf', name, value })
} catch (e) {
error = e
}
expect(error).is.an('Error')
expect(error).to.have.property('message').which.equals('Setting cookie failed')
})
it('should overwrite previous cookies', async () => {
let error
try {

View File

@@ -2,7 +2,10 @@ const assert = require('assert')
const fs = require('fs')
const path = require('path')
const os = require('os')
const { shell } = require('electron')
const { shell, remote } = require('electron')
const { BrowserWindow } = remote
const { closeWindow } = require('./window-helpers')
describe('shell module', () => {
const fixtures = path.resolve(__dirname, 'fixtures')
@@ -18,6 +21,7 @@ describe('shell module', () => {
describe('shell.openExternal()', () => {
let envVars = {}
let w
beforeEach(function () {
envVars = {
@@ -27,7 +31,9 @@ describe('shell module', () => {
}
})
afterEach(() => {
afterEach(async () => {
await closeWindow(w)
w = null
// reset env vars to prevent side effects
if (process.platform === 'linux') {
process.env.DE = envVars.de
@@ -44,7 +50,24 @@ describe('shell module', () => {
process.env.DISPLAY = ''
}
shell.openExternal(url).then(() => done())
// Ensure an external window is activated via a new window's blur event
w = new BrowserWindow()
let promiseResolved = false
let blurEventEmitted = false
w.on('blur', () => {
blurEventEmitted = true
if (promiseResolved) {
done()
}
})
shell.openExternal(url).then(() => {
promiseResolved = true
if (blurEventEmitted || process.platform === 'linux') {
done()
}
})
})
it('opens an external link synchronously', () => {

View File

@@ -41,19 +41,19 @@ describe('webFrame module', function () {
const spellCheckerFeedback =
new Promise(resolve => {
ipcMain.on('spec-spell-check', (e, words, callback) => {
if (words.length === 2) {
// The promise is resolved only after this event is received twice
// Array contains only 1 word first time and 2 the next time
if (words.length === 5) {
// The API calls the provider after every completed word.
// The promise is resolved only after this event is received with all words.
resolve([words, callback])
}
})
})
const inputText = 'spleling test '
const inputText = `spleling test you're `
for (const keyCode of inputText) {
w.webContents.sendInputEvent({ type: 'char', keyCode })
}
const [words, callback] = await spellCheckerFeedback
expect(words).to.deep.equal(['spleling', 'test'])
expect(words.sort()).to.deep.equal(['spleling', 'test', `you're`, 'you', 're'].sort())
expect(callback).to.be.true()
})

View File

@@ -2,7 +2,8 @@ const { ipcRenderer } = require('electron')
setImmediate(function () {
if (window.location.toString() === 'bar://page') {
ipcRenderer.send('answer', process.argv, typeof global.process)
const windowOpenerIsNull = window.opener == null
ipcRenderer.send('answer', process.argv, typeof global.process, windowOpenerIsNull)
window.close()
}
})

75
spec/network-helper.js Normal file
View File

@@ -0,0 +1,75 @@
const fs = require('fs')
/**
* Test sandbox environment used to fake network responses.
*/
class NetworkSandbox {
constructor (protocol) {
this.protocol = protocol
this._resetFns = []
}
/**
* Reset the sandbox.
*/
async reset () {
for (const resetFn of this._resetFns) {
await resetFn()
}
this._resetFns = []
}
/**
* Will serve the content of file at `filePath` to network requests towards
* `protocolName` scheme.
*
* Example: `sandbox.serveFileFromProtocol('foo', 'index.html')` will serve the content
* of 'index.html' to `foo://page` requests.
*
* @param {string} protocolName
* @param {string} filePath
*/
serveFileFromProtocol (protocolName, filePath) {
return new Promise((resolve, reject) => {
this.protocol.registerBufferProtocol(protocolName, (request, callback) => {
// Disabled due to false positive in StandardJS
// eslint-disable-next-line standard/no-callback-literal
callback({
mimeType: 'text/html',
data: fs.readFileSync(filePath)
})
}, (error) => {
if (error != null) {
reject(error)
} else {
this._resetFns.push(() => this.unregisterProtocol(protocolName))
resolve()
}
})
})
}
unregisterProtocol (protocolName) {
return new Promise((resolve, reject) => {
this.protocol.unregisterProtocol(protocolName, (error) => {
if (error != null) {
reject(error)
} else {
resolve()
}
})
})
}
}
/**
* Will create a NetworkSandbox that uses
* `protocol` as `Electron.Protocol`.
*
* @param {Electron.Protocol} protocol
*/
function createNetworkSandbox (protocol) {
return new NetworkSandbox(protocol)
}
exports.createNetworkSandbox = createNetworkSandbox

View File

@@ -6,8 +6,8 @@ steps:
- bash: |
cd src/electron
npm install --verbose
displayName: 'NPM install'
node script/yarn.js install --frozen-lockfile
displayName: 'Yarn install'
- bash: |
export ZIP_DEST=$PWD/src/out/Default
@@ -56,7 +56,7 @@ steps:
cd src
export npm_config_nodedir=$PWD/out/Default/gen/node_headers
cd electron/spec
npm install --verbose
node ../script/yarn.js install --frozen-lockfile
displayName: Install test modules
- bash: |