From 8d4ed037a2192f4a0da2fee83c509ede01538062 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 13:02:01 -0400 Subject: [PATCH 01/43] Add referrer_schems to AddAdditionalSchemes --- atom/app/atom_content_client.cc | 1 + atom/app/atom_content_client.h | 1 + 2 files changed, 2 insertions(+) diff --git a/atom/app/atom_content_client.cc b/atom/app/atom_content_client.cc index 705573abe5d2..c0d3ff656f05 100644 --- a/atom/app/atom_content_client.cc +++ b/atom/app/atom_content_client.cc @@ -181,6 +181,7 @@ base::string16 AtomContentClient::GetLocalizedString(int message_id) const { void AtomContentClient::AddAdditionalSchemes( std::vector* standard_schemes, + std::vector* referrer_schemes, std::vector* savable_schemes) { standard_schemes->push_back({"chrome-extension", url::SCHEME_WITHOUT_PORT}); } diff --git a/atom/app/atom_content_client.h b/atom/app/atom_content_client.h index 33dbe19d990e..f31a14605723 100644 --- a/atom/app/atom_content_client.h +++ b/atom/app/atom_content_client.h @@ -25,6 +25,7 @@ class AtomContentClient : public brightray::ContentClient { base::string16 GetLocalizedString(int message_id) const override; void AddAdditionalSchemes( std::vector* standard_schemes, + std::vector* referrer_schemes, std::vector* savable_schemes) override; void AddPepperPlugins( std::vector* plugins) override; From b78fe04f8fef70b71deea76a2bbbb79187c6ee1f Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 13:10:14 -0400 Subject: [PATCH 02/43] Remove Vorbis from CDM support See https://codereview.chromium.org/1690353002 --- atom/app/atom_content_client.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/atom/app/atom_content_client.cc b/atom/app/atom_content_client.cc index c0d3ff656f05..5c4887bf89b2 100644 --- a/atom/app/atom_content_client.cc +++ b/atom/app/atom_content_client.cc @@ -89,7 +89,6 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path, // Add the supported codecs as if they came from the component manifest. std::vector codecs; - codecs.push_back(kCdmSupportedCodecVorbis); codecs.push_back(kCdmSupportedCodecVp8); codecs.push_back(kCdmSupportedCodecVp9); #if defined(USE_PROPRIETARY_CODECS) From dc7928021d25d97de1a9ac330caca44e4c58df71 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 13:14:17 -0400 Subject: [PATCH 03/43] Widevine AAC CDM no longer avail See chromium ./third_party /widevine/cdm/widevine_cdm_common.h --- atom/app/atom_content_client.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/atom/app/atom_content_client.cc b/atom/app/atom_content_client.cc index 5c4887bf89b2..40a6e1f5268d 100644 --- a/atom/app/atom_content_client.cc +++ b/atom/app/atom_content_client.cc @@ -92,7 +92,6 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path, codecs.push_back(kCdmSupportedCodecVp8); codecs.push_back(kCdmSupportedCodecVp9); #if defined(USE_PROPRIETARY_CODECS) - codecs.push_back(kCdmSupportedCodecAac); codecs.push_back(kCdmSupportedCodecAvc1); #endif // defined(USE_PROPRIETARY_CODECS) std::string codec_string = base::JoinString( From 93e9cf4ac1e9141c75305e62e365520e52a7a960 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 13:40:20 -0400 Subject: [PATCH 04/43] No more GetCookieMonster --- atom/browser/api/atom_api_cookies.cc | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/atom/browser/api/atom_api_cookies.cc b/atom/browser/api/atom_api_cookies.cc index 994fe6977f2a..91cbc08e1ad5 100644 --- a/atom/browser/api/atom_api_cookies.cc +++ b/atom/browser/api/atom_api_cookies.cc @@ -133,12 +133,11 @@ void GetCookiesOnIO(scoped_refptr getter, auto filtered_callback = base::Bind(FilterCookies, base::Passed(&filter), callback); - net::CookieMonster* monster = GetCookieStore(getter)->GetCookieMonster(); // Empty url will match all url cookies. if (url.empty()) - monster->GetAllCookiesAsync(filtered_callback); + GetCookieStore(getter)->GetAllCookiesAsync(filtered_callback); else - monster->GetAllCookiesForURLAsync(GURL(url), filtered_callback); + GetCookieStore(getter)->GetAllCookiesForURLAsync(GURL(url), filtered_callback); } // Removes cookie with |url| and |name| in IO thread. @@ -162,7 +161,9 @@ void SetCookieOnIO(scoped_refptr getter, std::string url, 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("name", &name); details->GetString("value", &value); @@ -171,6 +172,13 @@ void SetCookieOnIO(scoped_refptr getter, details->GetBoolean("secure", &secure); details->GetBoolean("httpOnly", &http_only); + base::Time creation_time; + if (details->GetDouble("creationDate", &creation_date)) { + creation_time = (creation_date == 0) ? + base::Time::UnixEpoch() : + base::Time::FromDoubleT(creation_date); + } + base::Time expiration_time; if (details->GetDouble("expirationDate", &expiration_date)) { expiration_time = (expiration_date == 0) ? @@ -178,9 +186,17 @@ void SetCookieOnIO(scoped_refptr getter, base::Time::FromDoubleT(expiration_date); } - GetCookieStore(getter)->GetCookieMonster()->SetCookieWithDetailsAsync( - GURL(url), name, value, domain, path, expiration_time, secure, http_only, - false, false, false, net::COOKIE_PRIORITY_DEFAULT, + base::Time last_access_time; + if (details->GetDouble("lastAccessDate", &last_access_date)) { + last_access_time = (last_access_date == 0) ? + base::Time::UnixEpoch() : + base::Time::FromDoubleT(last_access_date); + } + + GetCookieStore(getter)->SetCookieWithDetailsAsync( + GURL(url), name, value, domain, path, creation_time, + expiration_time, last_access_time, secure, http_only, + false, false, net::COOKIE_PRIORITY_DEFAULT, base::Bind(OnSetCookie, callback)); } From 5fda9bc6aea1e07ae42809155839ad1a0a3623d2 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 13:59:46 -0400 Subject: [PATCH 05/43] LoadAccessTokensCallbackType -> LoadAccessTokensCallback --- atom/browser/atom_access_token_store.cc | 2 +- atom/browser/atom_access_token_store.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/atom/browser/atom_access_token_store.cc b/atom/browser/atom_access_token_store.cc index adf2f5061cb0..d41d1262d043 100644 --- a/atom/browser/atom_access_token_store.cc +++ b/atom/browser/atom_access_token_store.cc @@ -32,7 +32,7 @@ AtomAccessTokenStore::~AtomAccessTokenStore() { } void AtomAccessTokenStore::LoadAccessTokens( - const LoadAccessTokensCallbackType& callback) { + const LoadAccessTokensCallback& callback) { AccessTokenSet access_token_set; // Equivelent to access_token_set[kGeolocationProviderURL]. diff --git a/atom/browser/atom_access_token_store.h b/atom/browser/atom_access_token_store.h index f2b734a20695..54bc2cee3c29 100644 --- a/atom/browser/atom_access_token_store.h +++ b/atom/browser/atom_access_token_store.h @@ -18,7 +18,7 @@ class AtomAccessTokenStore : public content::AccessTokenStore { // content::AccessTokenStore: void LoadAccessTokens( - const LoadAccessTokensCallbackType& callback) override; + const LoadAccessTokensCallback& callback) override; void SaveAccessToken(const GURL& server_url, const base::string16& access_token) override; From 2da39d31aac4a0b7c97b6282331aaf2955e4ce68 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 14:31:29 -0400 Subject: [PATCH 06/43] Update to new pref service location in components --- atom/browser/api/atom_api_session.cc | 2 +- atom/browser/atom_browser_context.cc | 2 +- atom/browser/atom_download_manager_delegate.cc | 2 +- atom/browser/common_web_contents_delegate.cc | 4 ++-- atom/browser/native_window.cc | 2 +- atom/browser/web_dialog_helper.cc | 2 +- .../chrome/browser/printing/print_view_manager_base.cc | 2 +- .../chrome/browser/printing/print_view_manager_base.h | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index 39c435b723ea..58fd358ca971 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -22,7 +22,7 @@ #include "atom/common/node_includes.h" #include "base/files/file_path.h" #include "base/guid.h" -#include "base/prefs/pref_service.h" +#include "components/prefs/pref_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/thread_task_runner_handle.h" diff --git a/atom/browser/atom_browser_context.cc b/atom/browser/atom_browser_context.cc index b06c6278f53f..04d5134a49e9 100644 --- a/atom/browser/atom_browser_context.cc +++ b/atom/browser/atom_browser_context.cc @@ -21,7 +21,7 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/path_service.h" -#include "base/prefs/pref_registry_simple.h" +#include "components/prefs/pref_registry_simple.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/threading/sequenced_worker_pool.h" diff --git a/atom/browser/atom_download_manager_delegate.cc b/atom/browser/atom_download_manager_delegate.cc index 295747a33c4e..bf09a4059504 100644 --- a/atom/browser/atom_download_manager_delegate.cc +++ b/atom/browser/atom_download_manager_delegate.cc @@ -12,7 +12,7 @@ #include "atom/browser/ui/file_dialog.h" #include "base/bind.h" #include "base/files/file_util.h" -#include "base/prefs/pref_service.h" +#include "components/prefs/pref_service.h" #include "chrome/common/pref_names.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index e17bcb9b2198..da3647bc907e 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -16,8 +16,8 @@ #include "atom/browser/web_dialog_helper.h" #include "atom/common/atom_constants.h" #include "base/files/file_util.h" -#include "base/prefs/pref_service.h" -#include "base/prefs/scoped_user_pref_update.h" +#include "components/prefs/pref_service.h" +#include "components/prefs/scoped_user_pref_update.h" #include "chrome/browser/printing/print_preview_message_handler.h" #include "chrome/browser/printing/print_view_manager_basic.h" #include "chrome/browser/ui/browser_dialogs.h" diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index f9008b898bd6..6986c680facf 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -17,7 +17,7 @@ #include "atom/common/options_switches.h" #include "base/files/file_util.h" #include "base/json/json_writer.h" -#include "base/prefs/pref_service.h" +#include "components/prefs/pref_service.h" #include "base/message_loop/message_loop.h" #include "base/strings/utf_string_conversions.h" #include "brightray/browser/inspectable_web_contents.h" diff --git a/atom/browser/web_dialog_helper.cc b/atom/browser/web_dialog_helper.cc index c3d2a1d0f23f..a082c3814c72 100644 --- a/atom/browser/web_dialog_helper.cc +++ b/atom/browser/web_dialog_helper.cc @@ -13,7 +13,7 @@ #include "base/bind.h" #include "base/files/file_enumerator.h" #include "base/files/file_path.h" -#include "base/prefs/pref_service.h" +#include "components/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/pref_names.h" #include "content/public/browser/render_view_host.h" diff --git a/chromium_src/chrome/browser/printing/print_view_manager_base.cc b/chromium_src/chrome/browser/printing/print_view_manager_base.cc index 688256e4251f..dbb57906e777 100644 --- a/chromium_src/chrome/browser/printing/print_view_manager_base.cc +++ b/chromium_src/chrome/browser/printing/print_view_manager_base.cc @@ -6,7 +6,7 @@ #include "base/bind.h" #include "base/memory/scoped_ptr.h" -#include "base/prefs/pref_service.h" +#include "components/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" #include "base/timer/timer.h" #include "chrome/browser/browser_process.h" diff --git a/chromium_src/chrome/browser/printing/print_view_manager_base.h b/chromium_src/chrome/browser/printing/print_view_manager_base.h index 0d44248bfe29..78e5729a5fb1 100644 --- a/chromium_src/chrome/browser/printing/print_view_manager_base.h +++ b/chromium_src/chrome/browser/printing/print_view_manager_base.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ #include "base/memory/ref_counted.h" -#include "base/prefs/pref_member.h" +#include "components/prefs/pref_member.h" #include "base/strings/string16.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" From 82f3bb26ce6c27766b6b79cd1bb764bb48824ec3 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 14:35:21 -0400 Subject: [PATCH 07/43] AccessTokenSet -> AccessTokenMap --- atom/browser/atom_access_token_store.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atom/browser/atom_access_token_store.cc b/atom/browser/atom_access_token_store.cc index d41d1262d043..ed87ea979920 100644 --- a/atom/browser/atom_access_token_store.cc +++ b/atom/browser/atom_access_token_store.cc @@ -33,17 +33,17 @@ AtomAccessTokenStore::~AtomAccessTokenStore() { void AtomAccessTokenStore::LoadAccessTokens( const LoadAccessTokensCallback& callback) { - AccessTokenSet access_token_set; + AccessTokenMap access_token_map; - // Equivelent to access_token_set[kGeolocationProviderURL]. + // Equivelent to access_token_map[kGeolocationProviderURL]. // Somehow base::string16 is causing compilation errors when used in a pair // of std::map on Linux, this can work around it. std::pair token_pair; token_pair.first = GURL(kGeolocationProviderURL); - access_token_set.insert(token_pair); + access_token_map.insert(token_pair); auto browser_context = AtomBrowserMainParts::Get()->browser_context(); - callback.Run(access_token_set, browser_context->url_request_context_getter()); + callback.Run(access_token_map, browser_context->url_request_context_getter()); } void AtomAccessTokenStore::SaveAccessToken(const GURL& server_url, From 8a2aebd03f287781e4f13623e4f5ef0b72a25926 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 14:40:02 -0400 Subject: [PATCH 08/43] PermissionStatus constant update --- atom/browser/atom_permission_manager.cc | 10 +++++----- atom/browser/web_contents_permission_helper.cc | 2 +- .../common/native_mate_converters/content_converter.cc | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/atom/browser/atom_permission_manager.cc b/atom/browser/atom_permission_manager.cc index f7523c07ff83..144643178504 100644 --- a/atom/browser/atom_permission_manager.cc +++ b/atom/browser/atom_permission_manager.cc @@ -40,7 +40,7 @@ void AtomPermissionManager::SetPermissionRequestHandler( if (handler.is_null() && !pending_requests_.empty()) { for (const auto& request : pending_requests_) { if (!WebContentsDestroyed(request.second.render_process_id)) - request.second.callback.Run(content::PERMISSION_STATUS_DENIED); + request.second.callback.Run(content::PermissionStatus::DENIED); } pending_requests_.clear(); } @@ -74,7 +74,7 @@ int AtomPermissionManager::RequestPermission( return request_id_; } - response_callback.Run(content::PERMISSION_STATUS_GRANTED); + response_callback.Run(content::PermissionStatus::GRANTED); return kNoPendingOperation; } @@ -92,7 +92,7 @@ int AtomPermissionManager::RequestPermissions( content::ChildProcessSecurityPolicy::GetInstance()-> GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID()); } - permissionStatuses.push_back(content::PERMISSION_STATUS_GRANTED); + permissionStatuses.push_back(content::PermissionStatus::GRANTED); } callback.Run(permissionStatuses); return kNoPendingOperation; @@ -115,7 +115,7 @@ void AtomPermissionManager::CancelPermissionRequest(int request_id) { auto request = pending_requests_.find(request_id); if (request != pending_requests_.end()) { if (!WebContentsDestroyed(request->second.render_process_id)) - request->second.callback.Run(content::PERMISSION_STATUS_DENIED); + request->second.callback.Run(content::PermissionStatus::DENIED); pending_requests_.erase(request); } } @@ -130,7 +130,7 @@ content::PermissionStatus AtomPermissionManager::GetPermissionStatus( content::PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin) { - return content::PERMISSION_STATUS_GRANTED; + return content::PermissionStatus::GRANTED; } void AtomPermissionManager::RegisterPermissionUsage( diff --git a/atom/browser/web_contents_permission_helper.cc b/atom/browser/web_contents_permission_helper.cc index 7c944832d88d..088e0b52d04b 100644 --- a/atom/browser/web_contents_permission_helper.cc +++ b/atom/browser/web_contents_permission_helper.cc @@ -35,7 +35,7 @@ void OnPointerLockResponse(content::WebContents* web_contents, bool allowed) { void OnPermissionResponse(const base::Callback& callback, content::PermissionStatus status) { - if (status == content::PERMISSION_STATUS_GRANTED) + if (status == content::PermissionStatus::GRANTED) callback.Run(true); else callback.Run(false); diff --git a/atom/common/native_mate_converters/content_converter.cc b/atom/common/native_mate_converters/content_converter.cc index 5589c5a84af2..b672f946cb6c 100644 --- a/atom/common/native_mate_converters/content_converter.cc +++ b/atom/common/native_mate_converters/content_converter.cc @@ -130,9 +130,9 @@ bool Converter::FromV8( return false; if (result) - *out = content::PERMISSION_STATUS_GRANTED; + *out = content::PermissionStatus::GRANTED; else - *out = content::PERMISSION_STATUS_DENIED; + *out = content::PermissionStatus::DENIED; return true; } From ff91aeb5d425c6503fcc59ea498480922b5b6804 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 14:43:50 -0400 Subject: [PATCH 09/43] Iterator to use size_t --- atom/browser/api/atom_api_web_contents.cc | 2 +- atom/browser/net/atom_network_delegate.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 7785808f3693..70110c3b5c82 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -144,7 +144,7 @@ struct Converter { net::HttpResponseHeaders* headers) { base::DictionaryValue response_headers; if (headers) { - void* iter = nullptr; + size_t iter = 0; std::string key; std::string value; while (headers->EnumerateHeaderLines(&iter, &key, &value)) { diff --git a/atom/browser/net/atom_network_delegate.cc b/atom/browser/net/atom_network_delegate.cc index 3143cd3b2575..39e0f732656b 100644 --- a/atom/browser/net/atom_network_delegate.cc +++ b/atom/browser/net/atom_network_delegate.cc @@ -100,7 +100,7 @@ void ToDictionary(base::DictionaryValue* details, return; scoped_ptr dict(new base::DictionaryValue); - void* iter = nullptr; + size_t iter = 0; std::string key; std::string value; while (headers->EnumerateHeaderLines(&iter, &key, &value)) { From c04353a845845a882ec6c896bc5eaa49c0228f3b Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 14:45:53 -0400 Subject: [PATCH 10/43] WebFindOptions in its own header --- atom/browser/api/atom_api_web_contents.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 70110c3b5c82..8761482bae7d 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -63,6 +63,7 @@ #include "net/url_request/static_http_user_agent_settings.h" #include "net/url_request/url_request_context.h" #include "third_party/WebKit/public/web/WebInputEvent.h" +#include "third_party/WebKit/public/web/WebFindOptions.h" #include "ui/base/l10n/l10n_util.h" #include "atom/common/node_includes.h" From d889bdef491adbe547dce75b66ef7039e4e18b44 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 14:20:43 -0400 Subject: [PATCH 11/43] Remove user_gesture parameter from PermissionManager::RequestPermission --- atom/browser/atom_permission_manager.cc | 2 -- atom/browser/atom_permission_manager.h | 2 -- atom/browser/web_contents_permission_helper.cc | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/atom/browser/atom_permission_manager.cc b/atom/browser/atom_permission_manager.cc index 144643178504..a102a1cb5c9a 100644 --- a/atom/browser/atom_permission_manager.cc +++ b/atom/browser/atom_permission_manager.cc @@ -51,7 +51,6 @@ int AtomPermissionManager::RequestPermission( content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - bool user_gesture, const ResponseCallback& response_callback) { int process_id = render_frame_host->GetProcess()->GetID(); @@ -82,7 +81,6 @@ int AtomPermissionManager::RequestPermissions( const std::vector& permissions, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - bool user_gesture, const base::Callback&)>& callback) { // FIXME(zcbenz): Just ignore multiple permissions request for now. diff --git a/atom/browser/atom_permission_manager.h b/atom/browser/atom_permission_manager.h index e16893fd8bb5..7361e6bc0541 100644 --- a/atom/browser/atom_permission_manager.h +++ b/atom/browser/atom_permission_manager.h @@ -37,13 +37,11 @@ class AtomPermissionManager : public content::PermissionManager { content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - bool user_gesture, const ResponseCallback& callback) override; int RequestPermissions( const std::vector& permissions, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - bool user_gesture, const base::Callback&)>& callback) override; diff --git a/atom/browser/web_contents_permission_helper.cc b/atom/browser/web_contents_permission_helper.cc index 088e0b52d04b..83274591e71e 100644 --- a/atom/browser/web_contents_permission_helper.cc +++ b/atom/browser/web_contents_permission_helper.cc @@ -60,7 +60,7 @@ void WebContentsPermissionHelper::RequestPermission( web_contents_->GetBrowserContext()->GetPermissionManager()); auto origin = web_contents_->GetLastCommittedURL(); permission_manager->RequestPermission( - permission, rfh, origin, user_gesture, + permission, rfh, origin, base::Bind(&OnPermissionResponse, callback)); } From f418ac5b5da8490ba447b15f6f9dc4280de49c63 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 17:09:54 -0400 Subject: [PATCH 12/43] Update to brave crashpad dep (Electron maintainer rebase this to use your ref) --- .gitmodules | 2 +- vendor/crashpad | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6164ed8b9706..13679d3dc13f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,7 +15,7 @@ url = https://github.com/zcbenz/native-mate.git [submodule "vendor/crashpad"] path = vendor/crashpad - url = https://github.com/electron/crashpad.git + url = https://github.com/brave/crashpad.git [submodule "vendor/requests"] path = vendor/requests url = https://github.com/kennethreitz/requests diff --git a/vendor/crashpad b/vendor/crashpad index db713da7554f..8b065d74c59a 160000 --- a/vendor/crashpad +++ b/vendor/crashpad @@ -1 +1 @@ -Subproject commit db713da7554f565e43c6dcf9a51b59ccc4f06066 +Subproject commit 8b065d74c59a2dfacccae664a31131be976a634b From 732936713a63e22954fd488d8fae88afb48e0915 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 13:42:10 -0400 Subject: [PATCH 13/43] GetNativeScreen -> GetScreen --- atom/browser/api/atom_api_menu_views.cc | 2 +- atom/browser/api/atom_api_screen.cc | 2 +- atom/browser/native_window.cc | 4 ++-- atom/browser/ui/win/notify_icon.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/atom/browser/api/atom_api_menu_views.cc b/atom/browser/api/atom_api_menu_views.cc index 4d1c902e1755..9340bc76732e 100644 --- a/atom/browser/api/atom_api_menu_views.cc +++ b/atom/browser/api/atom_api_menu_views.cc @@ -30,7 +30,7 @@ void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item) { // (-1, -1) means showing on mouse location. gfx::Point location; if (x == -1 || y == -1) { - location = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); + location = gfx::Screen::GetScreen()->GetCursorScreenPoint(); } else { gfx::Point origin = view->GetViewBounds().origin(); location = gfx::Point(origin.x() + x, origin.y() + y); diff --git a/atom/browser/api/atom_api_screen.cc b/atom/browser/api/atom_api_screen.cc index 9d845e390e31..425d906e286e 100644 --- a/atom/browser/api/atom_api_screen.cc +++ b/atom/browser/api/atom_api_screen.cc @@ -99,7 +99,7 @@ v8::Local Screen::Create(v8::Isolate* isolate) { return v8::Null(isolate); } - gfx::Screen* screen = gfx::Screen::GetNativeScreen(); + gfx::Screen* screen = gfx::Screen::GetScreen(); if (!screen) { isolate->ThrowException(v8::Exception::Error(mate::StringToV8( isolate, "Failed to get screen information"))); diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 6986c680facf..a5abc56f898c 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -318,9 +318,9 @@ void NativeWindow::CapturePage(const gfx::Rect& rect, // current system, increase the requested bitmap size to capture it all. gfx::Size bitmap_size = view_size; const gfx::NativeView native_view = view->GetNativeView(); - gfx::Screen* const screen = gfx::Screen::GetScreenFor(native_view); const float scale = - screen->GetDisplayNearestWindow(native_view).device_scale_factor(); + gfx::Screen::GetScreen()->GetDisplayNearestWindow(native_view) + .device_scale_factor(); if (scale > 1.0f) bitmap_size = gfx::ScaleToCeiledSize(view_size, scale); diff --git a/atom/browser/ui/win/notify_icon.cc b/atom/browser/ui/win/notify_icon.cc index 112473013808..464dc144ba3e 100644 --- a/atom/browser/ui/win/notify_icon.cc +++ b/atom/browser/ui/win/notify_icon.cc @@ -155,7 +155,7 @@ void NotifyIcon::PopUpContextMenu(const gfx::Point& pos, // Show menu at mouse's position by default. gfx::Rect rect(pos, gfx::Size()); if (pos.IsOrigin()) - rect.set_origin(gfx::Screen::GetNativeScreen()->GetCursorScreenPoint()); + rect.set_origin(gfx::Screen::GetScreen()->GetCursorScreenPoint()); views::MenuRunner menu_runner( menu_model, From 48e62ac0b558cb988b34c652318984e68b96fe0c Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 27 Apr 2016 17:33:51 -0400 Subject: [PATCH 14/43] Remove wwebaudio from web_preferences Becauseit doesn't exist there anymore --- atom/browser/web_contents_preferences.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 41db39b56c97..bfaca8d7ca77 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -180,8 +180,6 @@ void WebContentsPreferences::OverrideWebkitPrefs( prefs->text_areas_are_resizable = b; if (self->web_preferences_.GetBoolean("webgl", &b)) prefs->experimental_webgl_enabled = b; - if (self->web_preferences_.GetBoolean("webaudio", &b)) - prefs->webaudio_enabled = b; if (self->web_preferences_.GetBoolean("webSecurity", &b)) { prefs->web_security_enabled = b; prefs->allow_displaying_insecure_content = !b; From 22863b9f31db6a13a44d4ed53de71d6aafaa59e4 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Thu, 28 Apr 2016 10:02:05 -0400 Subject: [PATCH 15/43] Fix GURL coonstructor from webkit string error --- atom/browser/api/atom_api_cookies.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atom/browser/api/atom_api_cookies.cc b/atom/browser/api/atom_api_cookies.cc index 91cbc08e1ad5..22c57c97d6cf 100644 --- a/atom/browser/api/atom_api_cookies.cc +++ b/atom/browser/api/atom_api_cookies.cc @@ -137,7 +137,8 @@ void GetCookiesOnIO(scoped_refptr getter, if (url.empty()) GetCookieStore(getter)->GetAllCookiesAsync(filtered_callback); else - GetCookieStore(getter)->GetAllCookiesForURLAsync(GURL(url), filtered_callback); + GetCookieStore(getter)->GetAllCookiesForURLAsync(GURL(url), + filtered_callback); } // Removes cookie with |url| and |name| in IO thread. From 02d72c81af73bdd765beb3af9b7915209e18a747 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Thu, 28 Apr 2016 20:07:16 -0400 Subject: [PATCH 16/43] Fix linking problem with IPC::MessageT IPC::MessageT, void>::MessageT(IPC::Routing) --- atom/common/common_message_generator.h | 1 + 1 file changed, 1 insertion(+) diff --git a/atom/common/common_message_generator.h b/atom/common/common_message_generator.h index 832de1abf739..64206956863e 100644 --- a/atom/common/common_message_generator.h +++ b/atom/common/common_message_generator.h @@ -8,3 +8,4 @@ #include "chrome/common/print_messages.h" #include "chrome/common/tts_messages.h" #include "chrome/common/widevine_cdm_messages.h" +#include "chrome/common/chrome_utility_messages.h" From ce7c1023d5f80f805ed96e7f333b90c6fe07d62c Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Fri, 29 Apr 2016 09:15:04 -0400 Subject: [PATCH 17/43] Minimum fixes needed for chromium_src --- .../printing/printing_message_filter.cc | 4 ---- .../chrome/browser/process_singleton_posix.cc | 2 +- .../pepper_flash_clipboard_message_filter.cc | 10 ++++---- .../pepper/pepper_flash_drm_host.cc | 2 +- .../renderer/media/chrome_key_systems.cc | 2 +- .../printing/print_web_view_helper.cc | 24 +++++++++---------- .../renderer/printing/print_web_view_helper.h | 4 ++-- .../printing/print_web_view_helper_mac.mm | 12 +++------- .../stream_listen_socket.cc | 2 +- .../embedded_test_server/tcp_listen_socket.cc | 2 +- 10 files changed, 28 insertions(+), 36 deletions(-) diff --git a/chromium_src/chrome/browser/printing/printing_message_filter.cc b/chromium_src/chrome/browser/printing/printing_message_filter.cc index eac4405fbcf6..00efdaacd674 100644 --- a/chromium_src/chrome/browser/printing/printing_message_filter.cc +++ b/chromium_src/chrome/browser/printing/printing_message_filter.cc @@ -71,10 +71,6 @@ void RenderParamsFromPrintSettings(const PrintSettings& settings, params->margin_top = settings.page_setup_device_units().content_area().y(); params->margin_left = settings.page_setup_device_units().content_area().x(); params->dpi = settings.dpi(); - // Currently hardcoded at 1.25. See PrintSettings' constructor. - params->min_shrink = settings.min_shrink(); - // Currently hardcoded at 2.0. See PrintSettings' constructor. - params->max_shrink = settings.max_shrink(); // Currently hardcoded at 72dpi. See PrintSettings' constructor. params->desired_dpi = settings.desired_dpi(); // Always use an invalid cookie. diff --git a/chromium_src/chrome/browser/process_singleton_posix.cc b/chromium_src/chrome/browser/process_singleton_posix.cc index 5c26d7b6157a..5742b3585205 100644 --- a/chromium_src/chrome/browser/process_singleton_posix.cc +++ b/chromium_src/chrome/browser/process_singleton_posix.cc @@ -79,7 +79,7 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "content/public/browser/browser_thread.h" -#include "net/base/net_util.h" +#include "net/base/network_interfaces.h" #include "ui/base/l10n/l10n_util.h" #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) && !defined(OS_CHROMEOS) diff --git a/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc b/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc index 9ddb9fa56d77..4e66d772ec38 100644 --- a/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc +++ b/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc @@ -4,6 +4,8 @@ #include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h" +#include + #include "base/pickle.h" #include "base/strings/utf_string_conversions.h" #include "content/public/browser/browser_thread.h" @@ -48,10 +50,10 @@ ui::ClipboardType ConvertClipboardType(uint32_t type) { // clipboard interface for custom data. bool JumpToFormatInPickle(const base::string16& format, base::PickleIterator* iter) { - size_t size = 0; - if (!iter->ReadSizeT(&size)) + uint32_t size = 0; + if (!iter->ReadUInt32(&size)) return false; - for (size_t i = 0; i < size; ++i) { + for (uint32_t i = 0; i < size; ++i) { base::string16 stored_format; if (!iter->ReadString16(&stored_format)) return false; @@ -83,7 +85,7 @@ std::string ReadDataFromPickle(const base::string16& format, bool WriteDataToPickle(const std::map& data, base::Pickle* pickle) { - pickle->WriteSizeT(data.size()); + pickle->WriteUInt32(data.size()); for (std::map::const_iterator it = data.begin(); it != data.end(); ++it) { diff --git a/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc b/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc index f94216461769..34a7ff881f48 100644 --- a/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc +++ b/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc @@ -21,7 +21,7 @@ #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/render_frame_host.h" #include "content/public/common/pepper_plugin_info.h" -#include "net/base/net_util.h" +#include "net/base/network_interfaces.h" #include "ppapi/c/pp_errors.h" #include "ppapi/host/dispatch_host_message.h" #include "ppapi/host/host_message_context.h" diff --git a/chromium_src/chrome/renderer/media/chrome_key_systems.cc b/chromium_src/chrome/renderer/media/chrome_key_systems.cc index 5d97169005b4..417a61fcdab9 100644 --- a/chromium_src/chrome/renderer/media/chrome_key_systems.cc +++ b/chromium_src/chrome/renderer/media/chrome_key_systems.cc @@ -124,7 +124,7 @@ static void AddPepperBasedWidevine( } cdm::AddWidevineWithCodecs( - cdm::WIDEVINE, supported_codecs, + supported_codecs, #if defined(OS_CHROMEOS) media::EmeRobustness::HW_SECURE_ALL, // Maximum audio robustness. media::EmeRobustness::HW_SECURE_ALL, // Maximim video robustness. diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc index eb3599198d98..39d938960cbb 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc @@ -39,6 +39,7 @@ #include "third_party/WebKit/public/web/WebSettings.h" #include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebViewClient.h" +#include "third_party/skia/include/core/SkCanvas.h" #include "ui/base/resource/resource_bundle.h" using content::WebPreferences; @@ -62,9 +63,9 @@ int GetDPI(const PrintMsg_Print_Params* print_params) { bool PrintMsg_Print_Params_IsValid(const PrintMsg_Print_Params& params) { return !params.content_size.IsEmpty() && !params.page_size.IsEmpty() && !params.printable_area.IsEmpty() && params.document_cookie && - params.desired_dpi && params.max_shrink && params.min_shrink && - params.dpi && (params.margin_top >= 0) && (params.margin_left >= 0) && - params.dpi > kMinDpi && params.document_cookie != 0; + params.desired_dpi && params.dpi && params.margin_top >= 0 && + params.margin_left >= 0 && params.dpi > kMinDpi && + params.document_cookie != 0; } PrintMsg_Print_Params GetCssPrintParams( @@ -425,8 +426,9 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient, blink::WebLocalFrame* parent, blink::WebTreeScopeType scope, const blink::WebString& name, - blink::WebSandboxFlags sandboxFlags, - const blink::WebFrameOwnerProperties& frameOwnerProperties) override; + const blink::WebString& unique_name, + blink::WebSandboxFlags sandbox_flags, + const blink::WebFrameOwnerProperties& frame_owner_properties) override; void frameDetached(blink::WebFrame* frame, DetachType type) override; private: @@ -491,6 +493,7 @@ void PrepareFrameAndViewForPrint::ResizeForPrinting() { // think the page is 125% larger so the size of the page is correct for // minimum (default) scaling. // This is important for sites that try to fill the page. + // The 1.25 value is |printingMinimumShrinkFactor|. gfx::Size print_layout_size(web_print_params_.printContentArea.width, web_print_params_.printContentArea.height); print_layout_size.set_height( @@ -573,8 +576,9 @@ blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame( blink::WebLocalFrame* parent, blink::WebTreeScopeType scope, const blink::WebString& name, - blink::WebSandboxFlags sandboxFlags, - const blink::WebFrameOwnerProperties& frameOwnerProperties) { + const blink::WebString& unique_name, + blink::WebSandboxFlags sandbox_flags, + const blink::WebFrameOwnerProperties& frame_owner_properties) { blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this); parent->appendChild(frame); return frame; @@ -1263,11 +1267,7 @@ bool PrintWebViewHelper::PrintPreviewContext::CreatePreviewDocument( } metafile_.reset(new PdfMetafileSkia); - if (!metafile_->Init()) { - set_error(PREVIEW_ERROR_METAFILE_INIT_FAILED); - LOG(ERROR) << "PdfMetafileSkia Init failed"; - return false; - } + CHECK(metafile_->Init()); current_page_index_ = 0; pages_to_render_ = pages; diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper.h b/chromium_src/chrome/renderer/printing/print_web_view_helper.h index 05f145b5bb87..8407777b4a0c 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper.h +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.h @@ -83,9 +83,9 @@ class PrintWebViewHelper PREVIEW_ERROR_NONE, // Always first. PREVIEW_ERROR_BAD_SETTING, PREVIEW_ERROR_METAFILE_COPY_FAILED, - PREVIEW_ERROR_METAFILE_INIT_FAILED, + PREVIEW_ERROR_METAFILE_INIT_FAILED_DEPRECATED, PREVIEW_ERROR_ZERO_PAGES, - PREVIEW_ERROR_MAC_DRAFT_METAFILE_INIT_FAILED, + PREVIEW_ERROR_MAC_DRAFT_METAFILE_INIT_FAILED_DEPRECATED, PREVIEW_ERROR_PAGE_RENDERED_WITHOUT_METAFILE, PREVIEW_ERROR_INVALID_PRINTER_SETTINGS, PREVIEW_ERROR_LAST_ENUM // Always last. diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm b/chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm index b10ba616a1f6..903fbd68733a 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm @@ -12,9 +12,9 @@ #include "chrome/common/print_messages.h" #include "printing/metafile_skia_wrapper.h" #include "printing/page_size_margins.h" -#include "skia/ext/platform_device.h" #include "third_party/WebKit/public/platform/WebCanvas.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" +#include "third_party/skia/include/core/SkCanvas.h" namespace printing { @@ -24,8 +24,7 @@ void PrintWebViewHelper::PrintPageInternal( const PrintMsg_PrintPage_Params& params, WebFrame* frame) { PdfMetafileSkia metafile; - if (!metafile.Init()) - return; + CHECK(metafile.Init()); int page_number = params.page_number; gfx::Size page_size_in_dpi; @@ -63,12 +62,7 @@ bool PrintWebViewHelper::RenderPreviewPage( if (render_to_draft) { draft_metafile.reset(new PdfMetafileSkia()); - if (!draft_metafile->Init()) { - print_preview_context_.set_error( - PREVIEW_ERROR_MAC_DRAFT_METAFILE_INIT_FAILED); - LOG(ERROR) << "Draft PdfMetafileSkia Init failed"; - return false; - } + CHECK(draft_metafile->Init()); initial_render_metafile = draft_metafile.get(); } diff --git a/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc b/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc index 6495b23b8409..2514c636cbee 100644 --- a/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc +++ b/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc @@ -27,7 +27,7 @@ #include "build/build_config.h" #include "net/base/ip_endpoint.h" #include "net/base/net_errors.h" -#include "net/base/net_util.h" +#include "net/base/network_interfaces.h" #include "net/base/sockaddr_storage.h" #include "net/socket/socket_descriptor.h" diff --git a/chromium_src/net/test/embedded_test_server/tcp_listen_socket.cc b/chromium_src/net/test/embedded_test_server/tcp_listen_socket.cc index 1a72b2efe370..8e1f1177adaf 100644 --- a/chromium_src/net/test/embedded_test_server/tcp_listen_socket.cc +++ b/chromium_src/net/test/embedded_test_server/tcp_listen_socket.cc @@ -22,7 +22,7 @@ #include "base/sys_byteorder.h" #include "base/threading/platform_thread.h" #include "build/build_config.h" -#include "net/base/net_util.h" +#include "net/base/network_interfaces.h" #include "net/base/winsock_init.h" #include "net/socket/socket_descriptor.h" From 0253aec0cd7e732d322c8993594256e11be1067c Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Fri, 29 Apr 2016 15:50:40 -0400 Subject: [PATCH 18/43] Add SkUserConfig.h with blank SkDebugf macro This file was copied from: ./third_party/skia/include/config/SkUserConfig.h But because of this linking error we needed to define a macro for SkDebugf. ``` "SkDebugf(char const*, ...)", referenced from: SkBitmap::allocPixels(SkImageInfo const&, unsigned long) in libbrave_lib.a(brave_lib.native_desktop_media_list.o) ld: symbol(s) not found for architecture x86_64 ``` There used to be a hack to copy this file here which was removed: https://github.com/brave/libchromiumcontent/commit/8de9d9e2bcf455ba70e8005016150ab55690cb59 --- chromium_src/SkUserConfig.h | 158 ++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 chromium_src/SkUserConfig.h diff --git a/chromium_src/SkUserConfig.h b/chromium_src/SkUserConfig.h new file mode 100644 index 000000000000..755b050de6c0 --- /dev/null +++ b/chromium_src/SkUserConfig.h @@ -0,0 +1,158 @@ + +/* + * Copyright 2006 The Android Open Source Project + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +#ifndef SkUserConfig_DEFINED +#define SkUserConfig_DEFINED + +/* SkTypes.h, the root of the public header files, does the following trick: + + #include "SkPreConfig.h" + #include "SkUserConfig.h" + #include "SkPostConfig.h" + + SkPreConfig.h runs first, and it is responsible for initializing certain + skia defines. + + SkPostConfig.h runs last, and its job is to just check that the final + defines are consistent (i.e. that we don't have mutually conflicting + defines). + + SkUserConfig.h (this file) runs in the middle. It gets to change or augment + the list of flags initially set in preconfig, and then postconfig checks + that everything still makes sense. + + Below are optional defines that add, subtract, or change default behavior + in Skia. Your port can locally edit this file to enable/disable flags as + you choose, or these can be delared on your command line (i.e. -Dfoo). + + By default, this include file will always default to having all of the flags + commented out, so including it will have no effect. +*/ + +/////////////////////////////////////////////////////////////////////////////// + +/* Skia has lots of debug-only code. Often this is just null checks or other + parameter checking, but sometimes it can be quite intrusive (e.g. check that + each 32bit pixel is in premultiplied form). This code can be very useful + during development, but will slow things down in a shipping product. + + By default, these mutually exclusive flags are defined in SkPreConfig.h, + based on the presence or absence of NDEBUG, but that decision can be changed + here. + */ +//#define SK_DEBUG +//#define SK_RELEASE + +/* Skia has certain debug-only code that is extremely intensive even for debug + builds. This code is useful for diagnosing specific issues, but is not + generally applicable, therefore it must be explicitly enabled to avoid + the performance impact. By default these flags are undefined, but can be + enabled by uncommenting them below. + */ +//#define SK_DEBUG_GLYPH_CACHE +//#define SK_DEBUG_PATH + +/* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger) + it will call SK_CRASH(). If this is not defined it, it is defined in + SkPostConfig.h to write to an illegal address + */ +//#define SK_CRASH() *(int *)(uintptr_t)0 = 0 + + +/* preconfig will have attempted to determine the endianness of the system, + but you can change these mutually exclusive flags here. + */ +//#define SK_CPU_BENDIAN +//#define SK_CPU_LENDIAN + +/* Most compilers use the same bit endianness for bit flags in a byte as the + system byte endianness, and this is the default. If for some reason this + needs to be overridden, specify which of the mutually exclusive flags to + use. For example, some atom processors in certain configurations have big + endian byte order but little endian bit orders. +*/ +//#define SK_UINT8_BITFIELD_BENDIAN +//#define SK_UINT8_BITFIELD_LENDIAN + + +/* To write debug messages to a console, skia will call SkDebugf(...) following + printf conventions (e.g. const char* format, ...). If you want to redirect + this to something other than printf, define yours here + */ +// Log the file and line number for assertions. +#define SkDebugf(...) + +/* + * To specify a different default font cache limit, define this. If this is + * undefined, skia will use a built-in value. + */ +//#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024) + +/* + * To specify the default size of the image cache, undefine this and set it to + * the desired value (in bytes). SkGraphics.h as a runtime API to set this + * value as well. If this is undefined, a built-in value will be used. + */ +//#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024) + +/* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow + them, but modern PDF interpreters should handle them just fine. + */ +//#define SK_ALLOW_LARGE_PDF_SCALARS + +/* Define this to provide font subsetter in PDF generation. + */ +//#define SK_SFNTLY_SUBSETTER "sfntly/subsetter/font_subsetter.h" + +/* Define this to set the upper limit for text to support LCD. Values that + are very large increase the cost in the font cache and draw slower, without + improving readability. If this is undefined, Skia will use its default + value (e.g. 48) + */ +//#define SK_MAX_SIZE_FOR_LCDTEXT 48 + +/* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST + which will run additional self-tests at startup. These can take a long time, + so this flag is optional. + */ +#ifdef SK_DEBUG +//#define SK_SUPPORT_UNITTEST +#endif + +/* Change the ordering to work in X windows. + */ +#ifdef SK_SAMPLES_FOR_X + #define SK_R32_SHIFT 16 + #define SK_G32_SHIFT 8 + #define SK_B32_SHIFT 0 + #define SK_A32_SHIFT 24 +#endif + + +/* Determines whether to build code that supports the GPU backend. Some classes + that are not GPU-specific, such as SkShader subclasses, have optional code + that is used allows them to interact with the GPU backend. If you'd like to + omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu + directories from your include search path when you're not building the GPU + backend. Defaults to 1 (build the GPU code). + */ +//#define SK_SUPPORT_GPU 1 + + +/* The PDF generation code uses Path Ops to handle complex clipping paths, + * but at this time, Path Ops is not release ready yet. So, the code is + * hidden behind this #define guard. If you are feeling adventurous and + * want the latest and greatest PDF generation code, uncomment the #define. + * When Path Ops is release ready, the define guards and this user config + * define should be removed entirely. + */ +//#define SK_PDF_USE_PATHOPS_CLIPPING + +#endif + From f93fa53aea526e9eb8b4daa2837f0aef251ac63c Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Sat, 30 Apr 2016 19:56:28 -0400 Subject: [PATCH 19/43] Update linux menu overrides --- atom/browser/ui/views/menu_bar.cc | 12 ++++++------ atom/browser/ui/views/menu_bar.h | 6 ++++-- atom/browser/ui/views/menu_delegate.cc | 2 +- atom/browser/ui/views/submenu_button.cc | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/atom/browser/ui/views/menu_bar.cc b/atom/browser/ui/views/menu_bar.cc index ba0a542c1e8d..872375ccbbd1 100644 --- a/atom/browser/ui/views/menu_bar.cc +++ b/atom/browser/ui/views/menu_bar.cc @@ -104,7 +104,7 @@ int MenuBar::GetAcceleratorIndex(base::char16 key) { void MenuBar::ActivateAccelerator(base::char16 key) { int i = GetAcceleratorIndex(key); if (i != -1) - static_cast(child_at(i))->Activate(); + static_cast(child_at(i))->Activate(nullptr); } int MenuBar::GetItemCount() const { @@ -141,22 +141,22 @@ const char* MenuBar::GetClassName() const { void MenuBar::ButtonPressed(views::Button* sender, const ui::Event& event) { } -void MenuBar::OnMenuButtonClicked(views::View* source, - const gfx::Point& point) { +void MenuBar::OnMenuButtonClicked(views::MenuButton* source, + const gfx::Point& point, + const ui::Event* event) { // Hide the accelerator when a submenu is activated. SetAcceleratorVisibility(false); if (!menu_model_) return; - views::MenuButton* button = static_cast(source); - int id = button->tag(); + int id = source->tag(); ui::MenuModel::ItemType type = menu_model_->GetTypeAt(id); if (type != ui::MenuModel::TYPE_SUBMENU) return; MenuDelegate menu_delegate(this); - menu_delegate.RunMenu(menu_model_->GetSubmenuModelAt(id), button); + menu_delegate.RunMenu(menu_model_->GetSubmenuModelAt(id), source); } } // namespace atom diff --git a/atom/browser/ui/views/menu_bar.h b/atom/browser/ui/views/menu_bar.h index 9d77cfdf2a22..9f38a5981c7f 100644 --- a/atom/browser/ui/views/menu_bar.h +++ b/atom/browser/ui/views/menu_bar.h @@ -57,8 +57,10 @@ class MenuBar : public views::View, void ButtonPressed(views::Button* sender, const ui::Event& event) override; // views::MenuButtonListener: - void OnMenuButtonClicked(views::View* source, - const gfx::Point& point) override; + void OnMenuButtonClicked(views::MenuButton* source, + const gfx::Point& point, + const ui::Event* event) override; + private: SkColor background_color_; diff --git a/atom/browser/ui/views/menu_delegate.cc b/atom/browser/ui/views/menu_delegate.cc index f0ecf13b36b6..a107a696250b 100644 --- a/atom/browser/ui/views/menu_delegate.cc +++ b/atom/browser/ui/views/menu_delegate.cc @@ -112,7 +112,7 @@ views::MenuItemView* MenuDelegate::GetSiblingMenu( content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, base::Bind(base::IgnoreResult(&views::MenuButton::Activate), - base::Unretained(button))); + base::Unretained(button), nullptr)); } return nullptr; diff --git a/atom/browser/ui/views/submenu_button.cc b/atom/browser/ui/views/submenu_button.cc index 72cab258cbec..ca06d7d627ef 100644 --- a/atom/browser/ui/views/submenu_button.cc +++ b/atom/browser/ui/views/submenu_button.cc @@ -26,7 +26,7 @@ base::string16 FilterAccelerator(const base::string16& label) { SubmenuButton::SubmenuButton(views::ButtonListener* listener, const base::string16& title, views::MenuButtonListener* menu_button_listener) - : views::MenuButton(listener, FilterAccelerator(title), + : views::MenuButton(FilterAccelerator(title), menu_button_listener, false), accelerator_(0), show_underline_(false), From 37ccd34a88607f8aea33836cbde5c175e7dbc3a7 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Sat, 30 Apr 2016 20:31:07 -0400 Subject: [PATCH 20/43] Update x11 global shortcut listeners --- .../global_shortcut_listener_x11.cc | 12 ++++++------ .../extensions/global_shortcut_listener_x11.h | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc b/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc index 9a3cca69d538..dfd31bfb687b 100644 --- a/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc @@ -4,10 +4,13 @@ #include "chrome/browser/extensions/global_shortcut_listener_x11.h" +#include + +#include "base/macros.h" #include "content/public/browser/browser_thread.h" #include "ui/base/accelerators/accelerator.h" #include "ui/events/keycodes/keyboard_code_conversion_x.h" -#include "ui/events/platform/x11/x11_event_source.h" +#include "ui/events/platform/platform_event_source.h" #include "ui/gfx/x/x11_error_tracker.h" #include "ui/gfx/x/x11_types.h" @@ -35,7 +38,6 @@ int GetNativeModifiers(const ui::Accelerator& accelerator) { modifiers |= accelerator.IsShiftDown() ? ShiftMask : 0; modifiers |= accelerator.IsCtrlDown() ? ControlMask : 0; modifiers |= accelerator.IsAltDown() ? Mod1Mask : 0; - modifiers |= accelerator.IsCmdDown() ? Mod4Mask : 0; return modifiers; } @@ -69,7 +71,7 @@ void GlobalShortcutListenerX11::StartListening() { DCHECK(!registered_hot_keys_.empty()); // Also don't start if no hotkey is // registered. - ui::X11EventSource::GetInstance()->AddPlatformEventDispatcher(this); + ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); is_listening_ = true; } @@ -79,7 +81,7 @@ void GlobalShortcutListenerX11::StopListening() { DCHECK(registered_hot_keys_.empty()); // Make sure the set is clean before // ending. - ui::X11EventSource::GetInstance()->RemovePlatformEventDispatcher(this); + ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); is_listening_ = false; } @@ -149,8 +151,6 @@ void GlobalShortcutListenerX11::OnXKeyPressEvent(::XEvent* x_event) { modifiers |= (x_event->xkey.state & ShiftMask) ? ui::EF_SHIFT_DOWN : 0; modifiers |= (x_event->xkey.state & ControlMask) ? ui::EF_CONTROL_DOWN : 0; modifiers |= (x_event->xkey.state & Mod1Mask) ? ui::EF_ALT_DOWN : 0; - // For Windows key - modifiers |= (x_event->xkey.state & Mod4Mask) ? ui::EF_COMMAND_DOWN: 0; ui::Accelerator accelerator( ui::KeyboardCodeFromXKeyEvent(x_event), modifiers); diff --git a/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h b/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h index 8d551993841d..43230b7aa310 100644 --- a/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h @@ -5,9 +5,12 @@ #ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_X11_H_ #define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_X11_H_ +#include #include + #include +#include "base/macros.h" #include "chrome/browser/extensions/global_shortcut_listener.h" #include "ui/events/platform/platform_event_dispatcher.h" @@ -20,20 +23,18 @@ class GlobalShortcutListenerX11 : public GlobalShortcutListener, public ui::PlatformEventDispatcher { public: GlobalShortcutListenerX11(); - virtual ~GlobalShortcutListenerX11(); + ~GlobalShortcutListenerX11() override; // ui::PlatformEventDispatcher implementation. - virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override; - virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override; + bool CanDispatchEvent(const ui::PlatformEvent& event) override; + uint32_t DispatchEvent(const ui::PlatformEvent& event) override; private: // GlobalShortcutListener implementation. - virtual void StartListening() override; - virtual void StopListening() override; - virtual bool RegisterAcceleratorImpl( - const ui::Accelerator& accelerator) override; - virtual void UnregisterAcceleratorImpl( - const ui::Accelerator& accelerator) override; + void StartListening() override; + void StopListening() override; + bool RegisterAcceleratorImpl(const ui::Accelerator& accelerator) override; + void UnregisterAcceleratorImpl(const ui::Accelerator& accelerator) override; // Invoked when a global shortcut is pressed. void OnXKeyPressEvent(::XEvent* x_event); From 900001e547545c8a937da4c0950f3ebb1719dd46 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Sat, 30 Apr 2016 20:39:11 -0400 Subject: [PATCH 21/43] Update PlatformCanvas to SKCanvas --- .../chrome/renderer/printing/print_web_view_helper_linux.cc | 2 +- .../chrome/renderer/printing/print_web_view_helper_pdf_win.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc index d37aec628bab..b39133931a91 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc @@ -123,7 +123,7 @@ void PrintWebViewHelper::PrintPageInternal( &content_area); gfx::Rect canvas_area = content_area; - skia::PlatformCanvas* canvas = metafile->GetVectorCanvasForNewPage( + SkCanvas* canvas = metafile->GetVectorCanvasForNewPage( page_size, canvas_area, scale_factor); if (!canvas) return; diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc index ce1e962505f1..ea53da443f5e 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc @@ -158,7 +158,7 @@ void PrintWebViewHelper::PrintPageInternal( frame->getPrintPageShrink(params.page_number); float scale_factor = css_scale_factor * webkit_page_shrink_factor; - skia::PlatformCanvas* canvas = metafile->GetVectorCanvasForNewPage( + SkCanvas* canvas = metafile->GetVectorCanvasForNewPage( page_size, canvas_area, scale_factor); if (!canvas) return; From a52dbf0784ec6f6a8831ba6b9631f243dfe7bbca Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Sun, 1 May 2016 17:20:50 -0400 Subject: [PATCH 22/43] Update SharedMemory buf constructor --- chromium_src/chrome/browser/printing/printing_message_filter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium_src/chrome/browser/printing/printing_message_filter.cc b/chromium_src/chrome/browser/printing/printing_message_filter.cc index 00efdaacd674..d09e05a3427b 100644 --- a/chromium_src/chrome/browser/printing/printing_message_filter.cc +++ b/chromium_src/chrome/browser/printing/printing_message_filter.cc @@ -140,7 +140,7 @@ void PrintingMessageFilter::OnDuplicateSection( base::SharedMemoryHandle* browser_handle) { // Duplicate the handle in this process right now so the memory is kept alive // (even if it is not mapped) - base::SharedMemory shared_buf(renderer_handle, true, PeerHandle()); + base::SharedMemory shared_buf(renderer_handle, true); shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), browser_handle); } #endif From a9652052c4a1a4f422b4d342dfd93a09802cdc2d Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 4 May 2016 13:46:37 -0400 Subject: [PATCH 23/43] Update Brightray and libchromiumcontent v50 ref (Electron maintainer use your refs) --- .gitmodules | 2 +- atom/common/chrome_version.h | 2 +- script/lib/config.py | 2 +- vendor/brightray | 2 +- vendor/crashpad | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 13679d3dc13f..a38a8d044a2e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,7 +15,7 @@ url = https://github.com/zcbenz/native-mate.git [submodule "vendor/crashpad"] path = vendor/crashpad - url = https://github.com/brave/crashpad.git + url = https://github.com/crashpad/crashpad.git [submodule "vendor/requests"] path = vendor/requests url = https://github.com/kennethreitz/requests diff --git a/atom/common/chrome_version.h b/atom/common/chrome_version.h index 8b9b7ef0c826..18abcdecabc3 100644 --- a/atom/common/chrome_version.h +++ b/atom/common/chrome_version.h @@ -8,7 +8,7 @@ #ifndef ATOM_COMMON_CHROME_VERSION_H_ #define ATOM_COMMON_CHROME_VERSION_H_ -#define CHROME_VERSION_STRING "49.0.2623.75" +#define CHROME_VERSION_STRING "50.0.2661.94" #define CHROME_VERSION "v" CHROME_VERSION_STRING #endif // ATOM_COMMON_CHROME_VERSION_H_ diff --git a/script/lib/config.py b/script/lib/config.py index 4b3f4ba6fb34..a79fbed735cb 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -8,7 +8,7 @@ import sys BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \ 'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '1a4c5e51a670633ff3ecd4448ad01ba21b440542' +LIBCHROMIUMCONTENT_COMMIT = '5a15db93479dfaf6506d8d263d409d3f022c81b5' PLATFORM = { 'cygwin': 'win32', diff --git a/vendor/brightray b/vendor/brightray index a98267c714b2..75bda7d2118c 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit a98267c714b2c3435c1b86e50fd40523ef428a23 +Subproject commit 75bda7d2118c953b35d8a7d1962067a68dea34fb diff --git a/vendor/crashpad b/vendor/crashpad index 8b065d74c59a..db713da7554f 160000 --- a/vendor/crashpad +++ b/vendor/crashpad @@ -1 +1 @@ -Subproject commit 8b065d74c59a2dfacccae664a31131be976a634b +Subproject commit db713da7554f565e43c6dcf9a51b59ccc4f06066 From e8c4fb6903cc1fba61984b0fec62e17c62a12b42 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Wed, 4 May 2016 21:50:06 -0400 Subject: [PATCH 24/43] setBaseBackgroundColor moved to WebFrameWidget --- atom/renderer/atom_renderer_client.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/atom/renderer/atom_renderer_client.cc b/atom/renderer/atom_renderer_client.cc index d090d8a10be5..9a5aa691c2f7 100644 --- a/atom/renderer/atom_renderer_client.cc +++ b/atom/renderer/atom_renderer_client.cc @@ -29,6 +29,7 @@ #include "content/public/renderer/render_view.h" #include "ipc/ipc_message_macros.h" #include "third_party/WebKit/public/web/WebCustomElement.h" +#include "third_party/WebKit/public/web/WebFrameWidget.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebPluginParams.h" #include "third_party/WebKit/public/web/WebKit.h" @@ -141,15 +142,19 @@ void AtomRendererClient::RenderFrameCreated( void AtomRendererClient::RenderViewCreated(content::RenderView* render_view) { base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); + blink::WebFrameWidget* web_frame_widget = render_view->GetWebFrameWidget(); if (cmd->HasSwitch(switches::kGuestInstanceID)) { // webview. - // Set transparent background. - render_view->GetWebView()->setBaseBackgroundColor(SK_ColorTRANSPARENT); + if (web_frame_widget) { + web_frame_widget->setBaseBackgroundColor(SK_ColorTRANSPARENT); + } } else { // normal window. // If backgroundColor is specified then use it. std::string name = cmd->GetSwitchValueASCII(switches::kBackgroundColor); // Otherwise use white background. SkColor color = name.empty() ? SK_ColorWHITE : ParseHexColor(name); - render_view->GetWebView()->setBaseBackgroundColor(color); + if (web_frame_widget) { + web_frame_widget->setBaseBackgroundColor(color); + } } new printing::PrintWebViewHelper(render_view); From 35d9e372200e5820c1cd3a5b6bd74510fdb76f95 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 9 May 2016 19:37:38 +0900 Subject: [PATCH 25/43] Simplify the check for web_frame_widget --- atom/renderer/atom_renderer_client.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/atom/renderer/atom_renderer_client.cc b/atom/renderer/atom_renderer_client.cc index 9a5aa691c2f7..d04e028e20df 100644 --- a/atom/renderer/atom_renderer_client.cc +++ b/atom/renderer/atom_renderer_client.cc @@ -141,24 +141,23 @@ void AtomRendererClient::RenderFrameCreated( } void AtomRendererClient::RenderViewCreated(content::RenderView* render_view) { - base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); + new printing::PrintWebViewHelper(render_view); + new AtomRenderViewObserver(render_view, this); + blink::WebFrameWidget* web_frame_widget = render_view->GetWebFrameWidget(); + if (!web_frame_widget) + return; + + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); if (cmd->HasSwitch(switches::kGuestInstanceID)) { // webview. - if (web_frame_widget) { - web_frame_widget->setBaseBackgroundColor(SK_ColorTRANSPARENT); - } + web_frame_widget->setBaseBackgroundColor(SK_ColorTRANSPARENT); } else { // normal window. // If backgroundColor is specified then use it. std::string name = cmd->GetSwitchValueASCII(switches::kBackgroundColor); // Otherwise use white background. SkColor color = name.empty() ? SK_ColorWHITE : ParseHexColor(name); - if (web_frame_widget) { - web_frame_widget->setBaseBackgroundColor(color); - } + web_frame_widget->setBaseBackgroundColor(color); } - - new printing::PrintWebViewHelper(render_view); - new AtomRenderViewObserver(render_view, this); } blink::WebSpeechSynthesizer* AtomRendererClient::OverrideSpeechSynthesizer( From 9ccb495f60101d3bffc65490c7bd8d1a89bc9b1b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 9 May 2016 19:38:27 +0900 Subject: [PATCH 26/43] Do not remove the patch for Command key --- .../chrome/browser/extensions/global_shortcut_listener_x11.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc b/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc index dfd31bfb687b..00a689a7cb2f 100644 --- a/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc @@ -38,6 +38,7 @@ int GetNativeModifiers(const ui::Accelerator& accelerator) { modifiers |= accelerator.IsShiftDown() ? ShiftMask : 0; modifiers |= accelerator.IsCtrlDown() ? ControlMask : 0; modifiers |= accelerator.IsAltDown() ? Mod1Mask : 0; + modifiers |= accelerator.IsCmdDown() ? Mod4Mask : 0; return modifiers; } @@ -151,6 +152,7 @@ void GlobalShortcutListenerX11::OnXKeyPressEvent(::XEvent* x_event) { modifiers |= (x_event->xkey.state & ShiftMask) ? ui::EF_SHIFT_DOWN : 0; modifiers |= (x_event->xkey.state & ControlMask) ? ui::EF_CONTROL_DOWN : 0; modifiers |= (x_event->xkey.state & Mod1Mask) ? ui::EF_ALT_DOWN : 0; + modifiers |= (x_event->xkey.state & Mod4Mask) ? ui::EF_COMMAND_DOWN: 0; ui::Accelerator accelerator( ui::KeyboardCodeFromXKeyEvent(x_event), modifiers); From 525e3ee9c685d399c38204cf84d850cc96cc3eba Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 9 May 2016 20:31:02 +0900 Subject: [PATCH 27/43] Update crashpad with AppKit patch --- .gitmodules | 2 +- vendor/crashpad | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index a38a8d044a2e..6164ed8b9706 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,7 +15,7 @@ url = https://github.com/zcbenz/native-mate.git [submodule "vendor/crashpad"] path = vendor/crashpad - url = https://github.com/crashpad/crashpad.git + url = https://github.com/electron/crashpad.git [submodule "vendor/requests"] path = vendor/requests url = https://github.com/kennethreitz/requests diff --git a/vendor/crashpad b/vendor/crashpad index db713da7554f..e2073935d7c6 160000 --- a/vendor/crashpad +++ b/vendor/crashpad @@ -1 +1 @@ -Subproject commit db713da7554f565e43c6dcf9a51b59ccc4f06066 +Subproject commit e2073935d7c674f4a9e7fced821f611c5b13f07b From 9c0f29806417498c7a715bcac76df4d306cdd0db Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 9 May 2016 21:23:02 +0900 Subject: [PATCH 28/43] Update libchromiumcontent to fix renderer process crash --- script/lib/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/config.py b/script/lib/config.py index a79fbed735cb..610db4804c13 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -8,7 +8,7 @@ import sys BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \ 'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '5a15db93479dfaf6506d8d263d409d3f022c81b5' +LIBCHROMIUMCONTENT_COMMIT = 'f615ab6da33c860d526286a65dbb89b21074a784' PLATFORM = { 'cygwin': 'win32', From 73223fe5c35e82e1dfcf21ecf64bf77965cde900 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 11:05:42 +0900 Subject: [PATCH 29/43] Upgrade to Node v6 --- atom/common/api/atom_api_native_image.cc | 2 +- atom/common/node_includes.h | 1 + atom/renderer/node_array_buffer_bridge.cc | 2 +- vendor/node | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index e440f9c518bd..97cc674a3115 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -63,7 +63,7 @@ float GetScaleFactorFromPath(const base::FilePath& path) { // We don't try to convert string to float here because it is very very // expensive. - for (unsigned i = 0; i < arraysize(kScaleFactorPairs); ++i) { + for (unsigned i = 0; i < node::arraysize(kScaleFactorPairs); ++i) { if (base::EndsWith(filename, kScaleFactorPairs[i].name, base::CompareCase::INSENSITIVE_ASCII)) return kScaleFactorPairs[i].scale; diff --git a/atom/common/node_includes.h b/atom/common/node_includes.h index bb76afb54db9..3734a43e5f45 100644 --- a/atom/common/node_includes.h +++ b/atom/common/node_includes.h @@ -21,6 +21,7 @@ #undef CHECK_LT #undef DISALLOW_COPY_AND_ASSIGN #undef NO_RETURN +#undef arraysize #undef debug_string // This is defined in OS X 10.9 SDK in AssertMacros.h. #include "vendor/node/src/env.h" #include "vendor/node/src/env-inl.h" diff --git a/atom/renderer/node_array_buffer_bridge.cc b/atom/renderer/node_array_buffer_bridge.cc index c4b8d26adaa7..61ad25222f99 100644 --- a/atom/renderer/node_array_buffer_bridge.cc +++ b/atom/renderer/node_array_buffer_bridge.cc @@ -53,7 +53,7 @@ v8::Local BlinkUint8ArrayNew( ab, mate::ConvertToV8(isolate, offset), mate::ConvertToV8(isolate, size) }; return v8::Local::Cast(constructor->NewInstance( - context, arraysize(args), args).ToLocalChecked()); + context, node::arraysize(args), args).ToLocalChecked()); } } // namespace diff --git a/vendor/node b/vendor/node index 6bcd8af891a9..7d119e77b9fe 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit 6bcd8af891a991f8aa196e49e6bf908ebbe24cae +Subproject commit 7d119e77b9fe893d6e791c88c9e6122957e088ca From 2497c73009caa3e6b37166d2175875596eab2e65 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 12:44:56 +0900 Subject: [PATCH 30/43] Import build env from VS 2015 --- script/build.py | 6 +++- script/lib/env_util.py | 71 ++++++++++++++++++++++++++++++++++++++++++ script/lib/util.py | 13 ++++++++ script/update.py | 7 +++-- 4 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 script/lib/env_util.py diff --git a/script/build.py b/script/build.py index c428b95f329f..a134c014254f 100755 --- a/script/build.py +++ b/script/build.py @@ -5,7 +5,8 @@ import os import subprocess import sys -from lib.util import atom_gyp +from lib.config import get_target_arch +from lib.util import atom_gyp, import_vs_env CONFIGURATIONS = ['Release', 'Debug'] @@ -15,6 +16,9 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): os.chdir(SOURCE_ROOT) + # Update the VS build env. + import_vs_env(get_target_arch()) + ninja = os.path.join('vendor', 'depot_tools', 'ninja') if sys.platform == 'win32': ninja += '.exe' diff --git a/script/lib/env_util.py b/script/lib/env_util.py new file mode 100644 index 000000000000..df759241fe80 --- /dev/null +++ b/script/lib/env_util.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +from __future__ import print_function + +import itertools +import subprocess +import sys + + +def validate_pair(ob): + if not (len(ob) == 2): + print("Unexpected result:", ob, file=sys.stderr) + return False + else: + return True + + +def consume(iter): + try: + while True: next(iter) + except StopIteration: + pass + + +def get_environment_from_batch_command(env_cmd, initial=None): + """ + Take a command (either a single command or list of arguments) + and return the environment created after running that command. + Note that if the command must be a batch file or .cmd file, or the + changes to the environment will not be captured. + + If initial is supplied, it is used as the initial environment passed + to the child process. + """ + if not isinstance(env_cmd, (list, tuple)): + env_cmd = [env_cmd] + # Construct the command that will alter the environment. + env_cmd = subprocess.list2cmdline(env_cmd) + # Create a tag so we can tell in the output when the proc is done. + tag = 'END OF BATCH COMMAND' + # Construct a cmd.exe command to do accomplish this. + cmd = 'cmd.exe /s /c "{env_cmd} && echo "{tag}" && set"'.format(**vars()) + # Launch the process. + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=initial) + # Parse the output sent to stdout. + lines = proc.stdout + # Consume whatever output occurs until the tag is reached. + consume(itertools.takewhile(lambda l: tag not in l, lines)) + # Define a way to handle each KEY=VALUE line. + handle_line = lambda l: l.rstrip().split('=',1) + # Parse key/values into pairs. + pairs = map(handle_line, lines) + # Make sure the pairs are valid. + valid_pairs = filter(validate_pair, pairs) + # Construct a dictionary of the pairs. + result = dict(valid_pairs) + # Let the process finish. + proc.communicate() + return result + + +def get_vs_env(vs_version, arch): + """ + Returns the env object for VS building environment. + + The vs_version can be strings like "12.0" (e.g. VS2013), the arch has to + be one of "x86", "amd64", "arm", "x86_amd64", "x86_arm", "amd64_x86", + "amd64_arm", e.g. the args passed to vcvarsall.bat. + """ + vsvarsall = "C:\\Program Files (x86)\\Microsoft Visual Studio {0}\\VC\\vcvarsall.bat".format(vs_version) + return get_environment_from_batch_command([vsvarsall, arch]) diff --git a/script/lib/util.py b/script/lib/util.py index 4e5fb90988d7..c167d1d5c521 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -16,6 +16,7 @@ import os import zipfile from config import is_verbose_mode +from env_util import get_vs_env def get_host_arch(): @@ -223,3 +224,15 @@ def s3put(bucket, access_key, secret_key, prefix, key_prefix, files): ] + files execute(args, env) + + +def import_vs_env(target_arch): + if sys.platform == 'cygwin': + return + + if target_arch == 'ia32': + vs_arch = 'amd64_x86' + else: + vs_arch = 'x86_amd64' + env = get_vs_env('14.0', vs_arch) + os.environ.update(env) diff --git a/script/update.py b/script/update.py index f820248d0aa2..a67a49e7ab51 100755 --- a/script/update.py +++ b/script/update.py @@ -7,7 +7,7 @@ import subprocess import sys from lib.config import get_target_arch, PLATFORM -from lib.util import get_host_arch +from lib.util import get_host_arch, import_vs_env SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) @@ -49,11 +49,14 @@ def update_gyp(): def run_gyp(target_arch, component): + # Update the VS build env. + import_vs_env(target_arch) + env = os.environ.copy() if PLATFORM == 'linux' and target_arch != get_host_arch(): env['GYP_CROSSCOMPILE'] = '1' elif PLATFORM == 'win32': - env['GYP_MSVS_VERSION'] = '2013' + env['GYP_MSVS_VERSION'] = '2015' python = sys.executable if sys.platform == 'cygwin': # Force using win32 python on cygwin. From e77582baee4abf90eb982dd528f578845bb01e41 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 13:09:41 +0900 Subject: [PATCH 31/43] Fix compilation warnings introduced by VS 2015 --- atom/browser/native_window_views.cc | 4 +++- atom/browser/ui/message_box_win.cc | 6 ++++-- atom/common/crash_reporter/win/crash_service.cc | 2 +- common.gypi | 8 ++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 93e43661302e..a04a5a0eb25e 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -623,7 +623,9 @@ void NativeWindowViews::SetBackgroundColor(const std::string& color_name) { // Set the background color of native window. HBRUSH brush = CreateSolidBrush(skia::SkColorToCOLORREF(background_color)); ULONG_PTR previous_brush = SetClassLongPtr( - GetAcceleratedWidget(), GCLP_HBRBACKGROUND, (LONG)brush); + GetAcceleratedWidget(), + GCLP_HBRBACKGROUND, + reinterpret_cast(brush)); if (previous_brush) DeleteObject((HBRUSH)previous_brush); #endif diff --git a/atom/browser/ui/message_box_win.cc b/atom/browser/ui/message_box_win.cc index 5f49151c30ff..2c4ce54856d4 100644 --- a/atom/browser/ui/message_box_win.cc +++ b/atom/browser/ui/message_box_win.cc @@ -64,7 +64,8 @@ void MapToCommonID(const std::vector& buttons, (*button_flags) |= common.button; } else { // It is a custom button. - dialog_buttons->push_back({i + kIDStart, buttons[i].c_str()}); + dialog_buttons->push_back( + {static_cast(i + kIDStart), buttons[i].c_str()}); } } } @@ -135,7 +136,8 @@ int ShowMessageBoxUTF16(HWND parent, std::vector dialog_buttons; if (options & MESSAGE_BOX_NO_LINK) { for (size_t i = 0; i < buttons.size(); ++i) - dialog_buttons.push_back({i + kIDStart, buttons[i].c_str()}); + dialog_buttons.push_back( + {static_cast(i + kIDStart), buttons[i].c_str()}); } else { MapToCommonID(buttons, &id_map, &config.dwCommonButtons, &dialog_buttons); } diff --git a/atom/common/crash_reporter/win/crash_service.cc b/atom/common/crash_reporter/win/crash_service.cc index 58c7c38632ed..b3499bc09540 100644 --- a/atom/common/crash_reporter/win/crash_service.cc +++ b/atom/common/crash_reporter/win/crash_service.cc @@ -327,7 +327,7 @@ void CrashService::OnClientConnected(void* context, void CrashService::OnClientExited(void* context, const google_breakpad::ClientInfo* client_info) { - ProcessingLock lock; + ProcessingLock processing_lock; VLOG(1) << "client end. pid = " << client_info->pid(); CrashService* self = static_cast(context); ::InterlockedIncrement(&self->clients_terminated_); diff --git a/common.gypi b/common.gypi index 1088beb1b7b8..f00e4293ca42 100644 --- a/common.gypi +++ b/common.gypi @@ -62,7 +62,12 @@ 4232, # address of dllimport 'free' is not static, identity not guaranteed 4291, # no matching operator delete found 4295, # array is too small to include a terminating null character + 4311, # 'type cast': pointer truncation from 'void *const ' to 'unsigned long' 4389, # '==' : signed/unsigned mismatch + 4456, # declaration of 'm' hides previous local declaration + 4457, # declaration of 'message' hides function parameter + 4459, # declaration of 'wq' hides global declaration + 4477, # format string '%.*s' requires an argument of type 'int' 4505, # unreferenced local function has been removed 4701, # potentially uninitialized local variable 'sizew' used 4703, # potentially uninitialized local pointer variable 'req' used @@ -234,9 +239,12 @@ 4189, # local variable is initialized but not referenced 4201, # (uv.h) nameless struct/union 4267, # conversion from 'size_t' to 'int', possible loss of data + 4302, # (atldlgs.h) 'type cast': truncation from 'LPCTSTR' to 'WORD' + 4458, # (atldlgs.h) declaration of 'dwCommonButtons' hides class member 4503, # decorated name length exceeded, name was truncated 4800, # (v8.h) forcing value to bool 'true' or 'false' 4819, # The file contains a character that cannot be represented in the current code page + 4838, # (atlgdi.h) conversion from 'int' to 'UINT' requires a narrowing conversion 4996, # (atlapp.h) 'GetVersionExW': was declared deprecated ], }, From 3aaff23f78e5682383a034b297c65a6e42f4341c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 14:00:13 +0900 Subject: [PATCH 32/43] Do not call import_vs_env for non-win32 --- script/lib/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/util.py b/script/lib/util.py index c167d1d5c521..718962769dd8 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -227,7 +227,7 @@ def s3put(bucket, access_key, secret_key, prefix, key_prefix, files): def import_vs_env(target_arch): - if sys.platform == 'cygwin': + if sys.platform != 'win32': return if target_arch == 'ia32': From 0ad03d9ff782541caa7a9a28488e99e2cbeef6e7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 14:45:44 +0900 Subject: [PATCH 33/43] Suppress crashReporter test on x64 Windows for now --- spec/api-crash-reporter-spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/api-crash-reporter-spec.js b/spec/api-crash-reporter-spec.js index b4f63fe1ef27..f262f6fc834a 100644 --- a/spec/api-crash-reporter-spec.js +++ b/spec/api-crash-reporter-spec.js @@ -23,6 +23,11 @@ describe('crash-reporter module', function () { w.destroy() }) + // It is not working on 64bit Windows. + if (process.platform === 'win32' && process.arch === 'x64') { + return + } + if (process.mas) { return } From 906ae043f94ff4292f5dfd941900ef93355ad9b9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 15:18:11 +0900 Subject: [PATCH 34/43] Fix crash when creating external buffer --- vendor/node | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/node b/vendor/node index 7d119e77b9fe..454e37c47804 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit 7d119e77b9fe893d6e791c88c9e6122957e088ca +Subproject commit 454e37c47804706c5524d3639f18de02f5ad18c9 From bb5b30b8a0bff93c099cb27481df15b26067a84f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 15:43:25 +0900 Subject: [PATCH 35/43] It is not allowed to run scripts in DidCreateDocumentElement --- atom/renderer/atom_render_view_observer.cc | 4 ---- atom/renderer/atom_renderer_client.cc | 8 ++++++++ atom/renderer/atom_renderer_client.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/atom/renderer/atom_render_view_observer.cc b/atom/renderer/atom_render_view_observer.cc index 96dffbd512a6..bbaea351378b 100644 --- a/atom/renderer/atom_render_view_observer.cc +++ b/atom/renderer/atom_render_view_observer.cc @@ -27,7 +27,6 @@ #include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebKit.h" -#include "third_party/WebKit/public/web/WebScriptSource.h" #include "third_party/WebKit/public/web/WebView.h" #include "ui/base/resource/resource_bundle.h" #include "native_mate/dictionary.h" @@ -89,9 +88,6 @@ void AtomRenderViewObserver::DidCreateDocumentElement( blink::WebLocalFrame* frame) { document_created_ = true; - // Make sure every page will get a script context created. - frame->executeScript(blink::WebScriptSource("void 0")); - // Read --zoom-factor from command line. std::string zoom_factor_str = base::CommandLine::ForCurrentProcess()-> GetSwitchValueASCII(switches::kZoomFactor); diff --git a/atom/renderer/atom_renderer_client.cc b/atom/renderer/atom_renderer_client.cc index d04e028e20df..bb5b81ba4199 100644 --- a/atom/renderer/atom_renderer_client.cc +++ b/atom/renderer/atom_renderer_client.cc @@ -33,6 +33,7 @@ #include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebPluginParams.h" #include "third_party/WebKit/public/web/WebKit.h" +#include "third_party/WebKit/public/web/WebScriptSource.h" #include "third_party/WebKit/public/web/WebSecurityPolicy.h" #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" #include "third_party/WebKit/public/web/WebView.h" @@ -160,6 +161,13 @@ void AtomRendererClient::RenderViewCreated(content::RenderView* render_view) { } } +void AtomRendererClient::RunScriptsAtDocumentStart( + content::RenderFrame* render_frame) { + // Make sure every page will get a script context created. + render_frame->GetWebFrame()->executeScript( + blink::WebScriptSource("void 0")); +} + blink::WebSpeechSynthesizer* AtomRendererClient::OverrideSpeechSynthesizer( blink::WebSpeechSynthesizerClient* client) { return new TtsDispatcher(client); diff --git a/atom/renderer/atom_renderer_client.h b/atom/renderer/atom_renderer_client.h index 59b407ba1efb..6e962bc4c04e 100644 --- a/atom/renderer/atom_renderer_client.h +++ b/atom/renderer/atom_renderer_client.h @@ -40,6 +40,7 @@ class AtomRendererClient : public content::ContentRendererClient, void RenderThreadStarted() override; void RenderFrameCreated(content::RenderFrame*) override; void RenderViewCreated(content::RenderView*) override; + void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override; blink::WebSpeechSynthesizer* OverrideSpeechSynthesizer( blink::WebSpeechSynthesizerClient* client) override; bool OverrideCreatePlugin(content::RenderFrame* render_frame, From 4a409b870e7bbf4fc792b7497123d35ab8dee9ac Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 17:45:36 +0900 Subject: [PATCH 36/43] chromedriver's version is now v2.21 --- script/lib/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/config.py b/script/lib/config.py index 610db4804c13..567701a057ab 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -45,7 +45,7 @@ def get_target_arch(): def get_chromedriver_version(): - return 'v2.15' + return 'v2.21' def s3_config(): From 8dc8f8f485292d24a318f02136b265fbcaa9d94d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 20:08:47 +0900 Subject: [PATCH 37/43] Update libchromiumcontent: fix Release build on Windows --- common.gypi | 1 + script/lib/config.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index f00e4293ca42..58b33a37bd3c 100644 --- a/common.gypi +++ b/common.gypi @@ -49,6 +49,7 @@ 4054, # 4055, # 'type cast' : from data pointer 'void *' to function pointer 4057, # 'function' : 'volatile LONG *' differs in indirection to slightly different base types from 'unsigned long *' + 4065, # switch statement contains 'default' but no 'case' labels 4189, # 4131, # uses old-style declarator 4133, # incompatible types diff --git a/script/lib/config.py b/script/lib/config.py index 567701a057ab..7b70a7308820 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -8,7 +8,7 @@ import sys BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \ 'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = 'f615ab6da33c860d526286a65dbb89b21074a784' +LIBCHROMIUMCONTENT_COMMIT = 'e5ddff3e0d277703e2c1adc363d49709cf1bc56a' PLATFORM = { 'cygwin': 'win32', From 2d7b5c53b17d8945fe2aa627c36addc97ac95283 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 21:08:16 +0900 Subject: [PATCH 38/43] Change version number so native modules can build --- electron.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron.gyp b/electron.gyp index 1dcc515611a2..090008a67ffb 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '1.0.2', + 'version%': '1.1.0', }, 'includes': [ 'filenames.gypi', From 08779eb6d952d79428aab27a794f81dc89c73c89 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 May 2016 21:25:15 +0900 Subject: [PATCH 39/43] Use VS2015 on appveyor --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0fa0c0d9bddd..b093d2a2126e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,6 +2,8 @@ # http://www.appveyor.com/docs/appveyor-yml version: "{build}" +os: Visual Studio 2015 + init: - git config --global core.autocrlf input @@ -10,7 +12,7 @@ platform: - x64 install: - - cmd: SET PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH% + - cmd: SET PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH% - cmd: SET PATH=C:\python27;%PATH% - cmd: python script/cibuild From f1142cf2b59268ebf2a765f1ad33ca701b47ebed Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 11 May 2016 22:15:24 +0900 Subject: [PATCH 40/43] Adapt to changes on hash functions of Chrome 50 --- atom/common/api/atom_api_v8_util.cc | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/atom/common/api/atom_api_v8_util.cc b/atom/common/api/atom_api_v8_util.cc index 79c00d221289..7b7655c6cd2e 100644 --- a/atom/common/api/atom_api_v8_util.cc +++ b/atom/common/api/atom_api_v8_util.cc @@ -14,22 +14,6 @@ #include "native_mate/dictionary.h" #include "v8/include/v8-profiler.h" -// Following code should be removed after we upgraded to Chrome 50. -#if !defined(COMPILER_MSVC) -namespace base { - -template -inline size_t HashInts(T1 value1, T2 value2) { - // This condition is expected to be compile-time evaluated and optimised away - // in release builds. - if (sizeof(T1) > sizeof(uint32_t) || (sizeof(T2) > sizeof(uint32_t))) - return HashInts64(value1, value2); - - return HashInts32(value1, value2); -} - -} // namespace base - namespace std { // The hash function used by DoubleIDWeakMap. @@ -41,7 +25,6 @@ struct hash> { }; } // namespace std -#endif // defined(COMPILER_MSVC) namespace mate { From 525d456f7c6464321425dcfb97f01b546287f896 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 13 May 2016 11:14:43 +0900 Subject: [PATCH 41/43] Update to Chrome 50.0.2661.102 --- atom/common/chrome_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/common/chrome_version.h b/atom/common/chrome_version.h index 18abcdecabc3..d7f46761287e 100644 --- a/atom/common/chrome_version.h +++ b/atom/common/chrome_version.h @@ -8,7 +8,7 @@ #ifndef ATOM_COMMON_CHROME_VERSION_H_ #define ATOM_COMMON_CHROME_VERSION_H_ -#define CHROME_VERSION_STRING "50.0.2661.94" +#define CHROME_VERSION_STRING "50.0.2661.102" #define CHROME_VERSION "v" CHROME_VERSION_STRING #endif // ATOM_COMMON_CHROME_VERSION_H_ From 29b799de730ad0f0304b19d426113b16f765719c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 13 May 2016 11:18:16 +0900 Subject: [PATCH 42/43] Update clang revision to 261368 --- script/update-clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/update-clang.sh b/script/update-clang.sh index 801d60397145..0175bc2a0730 100755 --- a/script/update-clang.sh +++ b/script/update-clang.sh @@ -8,7 +8,7 @@ # Do NOT CHANGE this if you don't know what you're doing -- see # https://code.google.com/p/chromium/wiki/UpdatingClang # Reverting problematic clang rolls is safe, though. -CLANG_REVISION=247874 +CLANG_REVISION=261368 # This is incremented when pushing a new build of Clang at the same revision. CLANG_SUB_REVISION=1 From 10f144069db7a0f99ae31d986440e899713d12f7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 13 May 2016 13:41:40 +0900 Subject: [PATCH 43/43] Allow using __weak keyword --- electron.gyp | 4 ++++ vendor/brightray | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/electron.gyp b/electron.gyp index 090008a67ffb..e2febbaeee65 100644 --- a/electron.gyp +++ b/electron.gyp @@ -298,6 +298,10 @@ '$(SDKROOT)/System/Library/Frameworks/QTKit.framework', ], }, + 'xcode_settings': { + # ReactiveCocoa which is used by Squirrel requires using __weak. + 'CLANG_ENABLE_OBJC_WEAK': 'YES', + }, }], # OS=="mac" and mas_build==0 ['OS=="mac" and mas_build==1', { 'defines': [ diff --git a/vendor/brightray b/vendor/brightray index 75bda7d2118c..a266ffbdf446 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 75bda7d2118c953b35d8a7d1962067a68dea34fb +Subproject commit a266ffbdf446b41b9b5d09e55134ebadd774b357