diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 229b03beb..669dcfc77 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': '92d77538a86529ca35f9220bd3cd512cbea1f086', + 'chromium_checkout': '088f14a08fb102ca523424290965c04052eca325', } diff --git a/cef.gyp b/cef.gyp index e49e59945..e67557731 100644 --- a/cef.gyp +++ b/cef.gyp @@ -862,7 +862,6 @@ ], 'dependencies': [ '<(DEPTH)/base/base.gyp:base', - '<(DEPTH)/base/base.gyp:base_prefs', '<(DEPTH)/base/base.gyp:base_static', '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '<(DEPTH)/cc/blink/cc_blink.gyp:cc_blink', @@ -904,6 +903,7 @@ '<(DEPTH)/components/components.gyp:visitedlink_common', '<(DEPTH)/components/components.gyp:visitedlink_renderer', '<(DEPTH)/components/components.gyp:web_cache_renderer', + '<(DEPTH)/components/prefs/prefs.gyp:prefs', '<(DEPTH)/components/url_formatter/url_formatter.gyp:url_formatter', '<(DEPTH)/content/content.gyp:content_app_both', '<(DEPTH)/content/content.gyp:content_browser', @@ -1389,8 +1389,6 @@ '<(DEPTH)/components/nacl/common/nacl_constants.cc', '<(DEPTH)/components/nacl/common/nacl_constants.h', # Include sources for preferences support. - '<(DEPTH)/base/prefs/testing_pref_store.cc', - '<(DEPTH)/base/prefs/testing_pref_store.h', '<(DEPTH)/chrome/browser/accessibility/animation_policy_prefs.cc', '<(DEPTH)/chrome/browser/accessibility/animation_policy_prefs.h', '<(DEPTH)/chrome/browser/character_encoding.cc', @@ -1414,6 +1412,8 @@ '<(DEPTH)/chrome/common/pref_names.h', '<(DEPTH)/chrome/common/pref_names_util.cc', '<(DEPTH)/chrome/common/pref_names_util.h', + '<(DEPTH)/components/prefs/testing_pref_store.cc', + '<(DEPTH)/components/prefs/testing_pref_store.h', # Include sources for permissions support. '<(DEPTH)/chrome/browser/permissions/permission_request_id.h', '<(DEPTH)/chrome/browser/permissions/permission_request_id.cc', @@ -1892,11 +1892,6 @@ '<@(libcef_sources_common)', ], 'conditions': [ - ['OS=="win" and win_use_allocator_shim==1', { - 'dependencies': [ - '<(DEPTH)/base/allocator/allocator.gyp:allocator', - ], - }], ['OS=="win"', { 'configurations': { 'Debug_Base': { @@ -1931,11 +1926,6 @@ }, }, }], - [ '(OS=="linux" or OS=="freebsd" or OS=="openbsd") and use_allocator!="none"', { - 'dependencies':[ - '<(DEPTH)/base/allocator/allocator.gyp:allocator', - ], - }], ], }], }], # OS!="mac" diff --git a/include/capi/cef_parser_capi.h b/include/capi/cef_parser_capi.h index 2eb98b706..a5e6141e3 100644 --- a/include/capi/cef_parser_capi.h +++ b/include/capi/cef_parser_capi.h @@ -127,15 +127,6 @@ CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text, CEF_EXPORT cef_string_userfree_t cef_uridecode(const cef_string_t* text, int convert_to_utf8, cef_uri_unescape_rule_t unescape_rule); -/// -// Parses |string| which represents a CSS color value. If |strict| is true (1) -// strict parsing rules will be applied. Returns true (1) on success or false -// (0) on error. If parsing succeeds |color| will be set to the color value -// otherwise |color| will remain unchanged. -/// -CEF_EXPORT int cef_parse_csscolor(const cef_string_t* string, int strict, - cef_color_t* color); - // Parses the specified |json_string| and returns a dictionary or list // representation. If JSON parsing fails this function returns NULL. CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string, diff --git a/include/cef_parser.h b/include/cef_parser.h index 7533326ab..cea41d361 100644 --- a/include/cef_parser.h +++ b/include/cef_parser.h @@ -126,17 +126,6 @@ CefString CefURIDecode(const CefString& text, bool convert_to_utf8, cef_uri_unescape_rule_t unescape_rule); -/// -// Parses |string| which represents a CSS color value. If |strict| is true -// strict parsing rules will be applied. Returns true on success or false on -// error. If parsing succeeds |color| will be set to the color value otherwise -// |color| will remain unchanged. -/// -/*--cef()--*/ -bool CefParseCSSColor(const CefString& string, - bool strict, - cef_color_t& color); - // Parses the specified |json_string| and returns a dictionary or list // representation. If JSON parsing fails this method returns NULL. /*--cef()--*/ diff --git a/libcef/browser/browser_context_impl.cc b/libcef/browser/browser_context_impl.cc index 8528edb02..084dba944 100644 --- a/libcef/browser/browser_context_impl.cc +++ b/libcef/browser/browser_context_impl.cc @@ -21,7 +21,6 @@ #include "base/files/file_util.h" #include "base/lazy_instance.h" #include "base/logging.h" -#include "base/prefs/pref_service.h" #include "base/strings/string_util.h" #include "base/threading/thread_restrictions.h" #include "chrome/browser/font_family_cache.h" @@ -29,6 +28,7 @@ #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/guest_view/browser/guest_view_manager.h" +#include "components/prefs/pref_service.h" #include "components/ui/zoom/zoom_event_manager.h" #include "components/visitedlink/browser/visitedlink_event_listener.h" #include "components/visitedlink/browser/visitedlink_master.h" @@ -470,10 +470,12 @@ net::URLRequestContextGetter* HostContentSettingsMap* CefBrowserContextImpl::GetHostContentSettingsMap() { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!host_content_settings_map_.get()) { - // The |incognito| argument is intentionally set to false as it otherwise - // limits the types of values that can be stored in the settings map (for - // example, default values set via DefaultProvider::SetWebsiteSetting). - host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false); + // The |is_incognito_profile| and |is_guest_profile| arguments are + // intentionally set to false as they otherwise limit the types of values + // that can be stored in the settings map (for example, default values set + // via DefaultProvider::SetWebsiteSetting). + host_content_settings_map_ = + new HostContentSettingsMap(GetPrefs(), false, false); // Change the default plugin policy. const base::CommandLine* command_line = diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index 0420ddbfc..0fd118a79 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -120,8 +120,7 @@ int CefBrowserMainParts::PreCreateThreads() { content::GpuDataManager::GetInstance(); #if defined(USE_AURA) - gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, - views::CreateDesktopScreen()); + gfx::Screen::SetScreenInstance(views::CreateDesktopScreen()); #endif return 0; diff --git a/libcef/browser/browser_main.h b/libcef/browser/browser_main.h index 789da068a..524534d04 100644 --- a/libcef/browser/browser_main.h +++ b/libcef/browser/browser_main.h @@ -12,9 +12,9 @@ #include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" -#include "base/prefs/pref_service.h" #include "base/strings/string_piece.h" #include "build/build_config.h" +#include "components/prefs/pref_service.h" #include "content/public/browser/browser_main_parts.h" #include "net/url_request/url_request_context_getter.h" diff --git a/libcef/browser/component_updater/cef_component_updater_configurator.cc b/libcef/browser/component_updater/cef_component_updater_configurator.cc index 0d3ea5087..e50e616ee 100644 --- a/libcef/browser/component_updater/cef_component_updater_configurator.cc +++ b/libcef/browser/component_updater/cef_component_updater_configurator.cc @@ -68,19 +68,6 @@ bool HasSwitchValue(const std::vector& vec, const char* test) { return (std::find(vec.begin(), vec.end(), test) != vec.end()); } -// Returns true if falling back on an alternate, unsafe, service URL is -// allowed. In the fallback case, the security of the component update relies -// only on the integrity of the CRX payloads, which is self-validating. -// This is allowed only for some of the pre-Windows Vista versions not including -// Windows XP SP3. As a side note, pings could be sent to the alternate URL too. -bool CanUseAltUrlSource() { -#if defined(OS_WIN) - return !base::win::MaybeHasSHA256Support(); -#else - return false; -#endif // OS_WIN -} - // If there is an element of |vec| of the form |test|=.*, returns the right- // hand side of that assignment. Otherwise, returns an empty string. // The right-hand side may contain additional '=' characters, allowing for @@ -119,6 +106,7 @@ class CefConfigurator : public Configurator { std::string GetLang() const override; std::string GetOSLongName() const override; std::string ExtraRequestParams() const override; + std::string GetDownloadPreference() const override; net::URLRequestContextGetter* RequestContext() const override; scoped_refptr CreateOutOfProcessPatcher() const override; @@ -139,7 +127,6 @@ class CefConfigurator : public Configurator { bool pings_enabled_; bool deltas_enabled_; bool background_downloads_enabled_; - bool fallback_to_alt_source_url_enabled_; }; CefConfigurator::CefConfigurator( @@ -149,8 +136,7 @@ CefConfigurator::CefConfigurator( fast_update_(false), pings_enabled_(false), deltas_enabled_(false), - background_downloads_enabled_(false), - fallback_to_alt_source_url_enabled_(false) { + background_downloads_enabled_(false) { // Parse comma-delimited debug flags. std::vector switch_values = base::SplitString( cmdline->GetSwitchValueASCII(switches::kComponentUpdater), @@ -179,8 +165,6 @@ CefConfigurator::CefConfigurator( if (HasSwitchValue(switch_values, kSwitchRequestParam)) extra_info_ += "testrequest=\"1\""; - - fallback_to_alt_source_url_enabled_ = CanUseAltUrlSource(); } int CefConfigurator::InitialDelay() const { @@ -209,9 +193,6 @@ std::vector CefConfigurator::UpdateUrl() const { urls.push_back(GURL(url_source_override_)); } else { urls.push_back(GURL(kUpdaterDefaultUrl)); - if (fallback_to_alt_source_url_enabled_) { - urls.push_back(GURL(kUpdaterAltUrl)); - } } return urls; } @@ -262,6 +243,10 @@ std::string CefConfigurator::ExtraRequestParams() const { return extra_info_; } +std::string CefConfigurator::GetDownloadPreference() const { + return std::string(); +} + net::URLRequestContextGetter* CefConfigurator::RequestContext() const { return url_request_getter_; } @@ -283,7 +268,7 @@ scoped_refptr CefConfigurator::GetSequencedTaskRunner() const { return content::BrowserThread::GetBlockingPool() ->GetSequencedTaskRunnerWithShutdownBehavior( - content::BrowserThread::GetBlockingPool()->GetSequenceToken(), + base::SequencedWorkerPool::GetSequenceToken(), base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); } diff --git a/libcef/browser/cookie_manager_impl.cc b/libcef/browser/cookie_manager_impl.cc index b13cefbb8..da718a9ac 100644 --- a/libcef/browser/cookie_manager_impl.cc +++ b/libcef/browser/cookie_manager_impl.cc @@ -194,10 +194,10 @@ void CefCookieManagerImpl::SetSupportedSchemes( return; } - std::set scheme_set; + std::vector scheme_set; std::vector::const_iterator it = schemes.begin(); for (; it != schemes.end(); ++it) - scheme_set.insert(*it); + scheme_set.push_back(*it); SetSupportedSchemesInternal(scheme_set, callback); } @@ -379,25 +379,18 @@ bool CefCookieManagerImpl::GetCefCookie(const GURL& url, // static void CefCookieManagerImpl::SetCookieMonsterSchemes( net::CookieMonster* cookie_monster, - const std::set& schemes) { + const std::vector& schemes) { CEF_REQUIRE_IOT(); - std::set all_schemes = schemes; + std::vector all_schemes = schemes; // Add default schemes that should always support cookies. - all_schemes.insert("http"); - all_schemes.insert("https"); - all_schemes.insert("ws"); - all_schemes.insert("wss"); + all_schemes.push_back("http"); + all_schemes.push_back("https"); + all_schemes.push_back("ws"); + all_schemes.push_back("wss"); - const char** arr = new const char*[all_schemes.size()]; - std::set::const_iterator it2 = all_schemes.begin(); - for (int i = 0; it2 != all_schemes.end(); ++it2, ++i) - arr[i] = it2->c_str(); - - cookie_monster->SetCookieableSchemes(arr, all_schemes.size()); - - delete [] arr; + cookie_monster->SetCookieableSchemes(all_schemes); } bool CefCookieManagerImpl::HasContext() { @@ -454,7 +447,7 @@ void CefCookieManagerImpl::SetStoragePathWithContext( } void CefCookieManagerImpl::SetSupportedSchemesWithContext( - const std::set& schemes, + const std::vector& schemes, CefRefPtr callback, scoped_refptr request_context) { CEF_REQUIRE_IOT(); @@ -483,7 +476,7 @@ void CefCookieManagerImpl::GetCookieMonsterWithContext( } void CefCookieManagerImpl::SetSupportedSchemesInternal( - const std::set& schemes, + const std::vector& schemes, CefRefPtr callback){ CEF_REQUIRE_IOT(); @@ -553,11 +546,11 @@ void CefCookieManagerImpl::SetCookieInternal( cookie_monster->SetCookieWithDetailsAsync( url, name, value, domain, path, + base::Time(), // Creation time. expiration_time, cookie.secure ? true : false, cookie.httponly ? true : false, false, // First-party only. - CefNetworkDelegate::AreExperimentalCookieFeaturesEnabled(), CefNetworkDelegate::AreStrictSecureCookiesEnabled(), net::COOKIE_PRIORITY_DEFAULT, base::Bind(SetCookieCallbackImpl, callback)); @@ -576,7 +569,8 @@ void CefCookieManagerImpl::DeleteCookiesInternal( base::Bind(DeleteCookiesCallbackImpl, callback)); } else if (cookie_name.empty()) { // Delete all matching host cookies. - cookie_monster->DeleteAllForHostAsync(url, + cookie_monster->DeleteAllCreatedBetweenForHostAsync( + base::Time(), base::Time::Max(), url, base::Bind(DeleteCookiesCallbackImpl, callback)); } else { // Delete all matching host and domain cookies. diff --git a/libcef/browser/cookie_manager_impl.h b/libcef/browser/cookie_manager_impl.h index e5ecce4bf..28290b5f4 100644 --- a/libcef/browser/cookie_manager_impl.h +++ b/libcef/browser/cookie_manager_impl.h @@ -63,7 +63,7 @@ class CefCookieManagerImpl : public CefCookieManager { // Set the schemes supported by |cookie_monster|. Default schemes will always // be supported. static void SetCookieMonsterSchemes(net::CookieMonster* cookie_monster, - const std::set& schemes); + const std::vector& schemes); private: // Returns true if a context is or will be available. @@ -82,7 +82,7 @@ class CefCookieManagerImpl : public CefCookieManager { CefRefPtr callback, scoped_refptr request_context); void SetSupportedSchemesWithContext( - const std::set& schemes, + const std::vector& schemes, CefRefPtr callback, scoped_refptr request_context); void GetCookieMonsterWithContext( @@ -91,7 +91,7 @@ class CefCookieManagerImpl : public CefCookieManager { scoped_refptr request_context); void SetSupportedSchemesInternal( - const std::set& schemes, + const std::vector& schemes, CefRefPtr callback); void VisitAllCookiesInternal( CefRefPtr visitor, @@ -121,7 +121,7 @@ class CefCookieManagerImpl : public CefCookieManager { // Used for cookie monsters owned by this object. base::FilePath storage_path_; - std::set supported_schemes_; + std::vector supported_schemes_; scoped_refptr cookie_monster_; IMPLEMENT_REFCOUNTING(CefCookieManagerImpl); diff --git a/libcef/browser/devtools_frontend.cc b/libcef/browser/devtools_frontend.cc index d11fbcbab..523a91f56 100644 --- a/libcef/browser/devtools_frontend.cc +++ b/libcef/browser/devtools_frontend.cc @@ -321,7 +321,7 @@ void CefDevToolsFrontend::OnURLFetchComplete(const net::URLFetcher* source) { response.SetInteger("statusCode", rh ? rh->response_code() : 200); response.Set("headers", headers); - void* iterator = NULL; + size_t iterator = 0; std::string name; std::string value; while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value)) diff --git a/libcef/browser/extensions/api/streams_private/streams_private_api.cc b/libcef/browser/extensions/api/streams_private/streams_private_api.cc index 39d0659fb..7336d4c1c 100644 --- a/libcef/browser/extensions/api/streams_private/streams_private_api.cc +++ b/libcef/browser/extensions/api/streams_private/streams_private_api.cc @@ -28,7 +28,7 @@ void CreateResponseHeadersDictionary(const net::HttpResponseHeaders* headers, if (!headers) return; - void* iter = NULL; + size_t iter = 0; std::string header_name; std::string header_value; while (headers->EnumerateHeaderLines(&iter, &header_name, &header_value)) { diff --git a/libcef/browser/media_capture_devices_dispatcher.cc b/libcef/browser/media_capture_devices_dispatcher.cc index 5170fb150..eac5cfeaa 100644 --- a/libcef/browser/media_capture_devices_dispatcher.cc +++ b/libcef/browser/media_capture_devices_dispatcher.cc @@ -4,9 +4,9 @@ #include "libcef/browser/media_capture_devices_dispatcher.h" -#include "base/prefs/pref_registry_simple.h" -#include "base/prefs/pref_service.h" #include "chrome/common/pref_names.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/media_capture_devices.h" diff --git a/libcef/browser/native/browser_platform_delegate_native_win.cc b/libcef/browser/native/browser_platform_delegate_native_win.cc index 785262808..ca69e0be9 100644 --- a/libcef/browser/native/browser_platform_delegate_native_win.cc +++ b/libcef/browser/native/browser_platform_delegate_native_win.cc @@ -166,7 +166,7 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() { // Adjust for potential display scaling. gfx::Point point = gfx::Point(cr.right, cr.bottom); - float scale = gfx::Screen::GetNativeScreen()-> + float scale = gfx::Screen::GetScreen()-> GetDisplayNearestPoint(point).device_scale_factor(); point = gfx::ToFlooredPoint( gfx::ScalePoint(gfx::PointF(point), 1.0f / scale)); @@ -296,8 +296,8 @@ gfx::Point CefBrowserPlatformDelegateNativeWin::GetScreenPoint( bounds_in_screen.y() + view.y()); // Adjust for potential display scaling. - float scale = gfx::Screen::GetScreenFor(window)-> - GetDisplayNearestWindow(window).device_scale_factor(); + float scale = gfx::Screen::GetScreen()-> + GetDisplayNearestPoint(screen_point).device_scale_factor(); return gfx::ToFlooredPoint( gfx::ScalePoint(gfx::PointF(screen_point), scale)); } diff --git a/libcef/browser/net/cookie_store_proxy.cc b/libcef/browser/net/cookie_store_proxy.cc index f48552da0..e8d9a9fa5 100644 --- a/libcef/browser/net/cookie_store_proxy.cc +++ b/libcef/browser/net/cookie_store_proxy.cc @@ -42,6 +42,30 @@ void CefCookieStoreProxy::SetCookieWithOptionsAsync( } } +void CefCookieStoreProxy::SetCookieWithDetailsAsync( + const GURL& url, + const std::string& name, + const std::string& value, + const std::string& domain, + const std::string& path, + const base::Time creation_time, + const base::Time expiration_time, + bool secure, + bool http_only, + bool same_site, + bool enforce_strict_secure, + net::CookiePriority priority, + const SetCookiesCallback& callback) { + scoped_refptr cookie_store = GetCookieStore(); + if (cookie_store.get()) { + cookie_store->SetCookieWithDetailsAsync(url, name, value, domain, path, + creation_time, expiration_time, + secure, http_only, same_site, + enforce_strict_secure, priority, + callback); + } +} + void CefCookieStoreProxy::GetCookiesWithOptionsAsync( const GURL& url, const net::CookieOptions& options, const GetCookiesCallback& callback) { @@ -50,6 +74,13 @@ void CefCookieStoreProxy::GetCookiesWithOptionsAsync( cookie_store->GetCookiesWithOptionsAsync(url, options, callback); } +void CefCookieStoreProxy::GetAllCookiesAsync( + const GetCookieListCallback& callback) { + scoped_refptr cookie_store = GetCookieStore(); + if (cookie_store.get()) + cookie_store->GetAllCookiesAsync(callback); +} + void CefCookieStoreProxy::DeleteCookieAsync( const GURL& url, const std::string& cookie_name, @@ -97,6 +128,12 @@ void CefCookieStoreProxy::DeleteSessionCookiesAsync( cookie_store->DeleteSessionCookiesAsync(callback); } +void CefCookieStoreProxy::FlushStore(const base::Closure& callback) { + scoped_refptr cookie_store = GetCookieStore(); + if (cookie_store.get()) + cookie_store->FlushStore(callback); +} + net::CookieMonster* CefCookieStoreProxy::GetCookieMonster() { scoped_refptr cookie_store = GetCookieStore(); if (cookie_store.get()) diff --git a/libcef/browser/net/cookie_store_proxy.h b/libcef/browser/net/cookie_store_proxy.h index bb80339ca..247ed55cb 100644 --- a/libcef/browser/net/cookie_store_proxy.h +++ b/libcef/browser/net/cookie_store_proxy.h @@ -30,9 +30,24 @@ class CefCookieStoreProxy : public net::CookieStore { const std::string& cookie_line, const net::CookieOptions& options, const SetCookiesCallback& callback) override; + void SetCookieWithDetailsAsync( + const GURL& url, + const std::string& name, + const std::string& value, + const std::string& domain, + const std::string& path, + const base::Time creation_time, + const base::Time expiration_time, + bool secure, + bool http_only, + bool same_site, + bool enforce_strict_secure, + net::CookiePriority priority, + const SetCookiesCallback& callback) override; void GetCookiesWithOptionsAsync( const GURL& url, const net::CookieOptions& options, const GetCookiesCallback& callback) override; + void GetAllCookiesAsync(const GetCookieListCallback& callback) override; void DeleteCookieAsync(const GURL& url, const std::string& cookie_name, const base::Closure& callback) override; @@ -48,6 +63,7 @@ class CefCookieStoreProxy : public net::CookieStore { const GURL& url, const DeleteCallback& callback) override; void DeleteSessionCookiesAsync(const DeleteCallback& callback) override; + void FlushStore(const base::Closure& callback) override; net::CookieMonster* GetCookieMonster() override; scoped_ptr AddCallbackForCookie( const GURL& url, diff --git a/libcef/browser/net/resource_request_job.cc b/libcef/browser/net/resource_request_job.cc index cbef464c7..8ef9d6a72 100644 --- a/libcef/browser/net/resource_request_job.cc +++ b/libcef/browser/net/resource_request_job.cc @@ -379,10 +379,6 @@ void CefResourceRequestJob::SendHeaders() { } void CefResourceRequestJob::AddCookieHeaderAndStart() { - // No matter what, we want to report our status as IO pending since we will - // be notifying our consumer asynchronously via OnStartCompleted. - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); - // If the request was destroyed, then there is no more work to do. if (!request_) return; @@ -484,7 +480,6 @@ net::HttpResponseHeaders* CefResourceRequestJob::GetResponseHeaders() { void CefResourceRequestJob::SaveCookiesAndNotifyHeadersComplete() { if (request_->load_flags() & net::LOAD_DO_NOT_SAVE_COOKIES) { - SetStatus(URLRequestStatus()); // Clear the IO_PENDING status NotifyHeadersComplete(); return; } @@ -502,15 +497,10 @@ void CefResourceRequestJob::SaveNextCookie() { if (response_cookies_save_index_ == response_cookies_.size()) { response_cookies_.clear(); response_cookies_save_index_ = 0; - SetStatus(URLRequestStatus()); // Clear the IO_PENDING status NotifyHeadersComplete(); return; } - // No matter what, we want to report our status as IO pending since we will - // be notifying our consumer asynchronously via OnStartCompleted. - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); - net::CookieOptions options; options.set_include_httponly(); bool can_set_cookie = CanSetCookie( @@ -555,7 +545,7 @@ void CefResourceRequestJob::FetchResponseCookies( const std::string name = "Set-Cookie"; std::string value; - void* iter = NULL; + size_t iter = 0; net::HttpResponseHeaders* headers = GetResponseHeaders(); while (headers->EnumerateHeader(&iter, name, &value)) { if (!value.empty()) diff --git a/libcef/browser/net/url_request_context_getter_impl.cc b/libcef/browser/net/url_request_context_getter_impl.cc index c9306c169..9b15526df 100644 --- a/libcef/browser/net/url_request_context_getter_impl.cc +++ b/libcef/browser/net/url_request_context_getter_impl.cc @@ -19,7 +19,6 @@ #include "base/command_line.h" #include "base/files/file_util.h" #include "base/logging.h" -#include "base/prefs/pref_service.h" #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/threading/thread_restrictions.h" @@ -27,6 +26,7 @@ #include "build/build_config.h" #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/common/pref_names.h" +#include "components/prefs/pref_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" @@ -347,7 +347,7 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath( } void CefURLRequestContextGetterImpl::SetCookieSupportedSchemes( - const std::set& schemes) { + const std::vector& schemes) { CEF_REQUIRE_IOT(); cookie_supported_schemes_ = schemes; diff --git a/libcef/browser/net/url_request_context_getter_impl.h b/libcef/browser/net/url_request_context_getter_impl.h index 8fe7892bd..87c062afb 100644 --- a/libcef/browser/net/url_request_context_getter_impl.h +++ b/libcef/browser/net/url_request_context_getter_impl.h @@ -63,7 +63,7 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter { void SetCookieStoragePath(const base::FilePath& path, bool persist_session_cookies); - void SetCookieSupportedSchemes(const std::set& schemes); + void SetCookieSupportedSchemes(const std::vector& schemes); // Keep a reference to all handlers sharing this context so that they'll be // kept alive until the context is destroyed. @@ -97,7 +97,7 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter { content::URLRequestInterceptorScopedVector request_interceptors_; base::FilePath cookie_store_path_; - std::set cookie_supported_schemes_; + std::vector cookie_supported_schemes_; std::vector > handler_list_; diff --git a/libcef/browser/osr/text_input_client_osr_mac.h b/libcef/browser/osr/text_input_client_osr_mac.h index 8eab23183..48ca9e77e 100644 --- a/libcef/browser/osr/text_input_client_osr_mac.h +++ b/libcef/browser/osr/text_input_client_osr_mac.h @@ -51,6 +51,9 @@ // Underline information of the |markedText_|. std::vector underlines_; + // Replacement range information received from |setMarkedText:|. + gfx::Range setMarkedTextReplacementRange_; + // Indicates if doCommandBySelector method receives any edit command when // handling a key down event. BOOL hasEditCommands_; diff --git a/libcef/browser/osr/text_input_client_osr_mac.mm b/libcef/browser/osr/text_input_client_osr_mac.mm index f1f309bb9..74155ead7 100644 --- a/libcef/browser/osr/text_input_client_osr_mac.mm +++ b/libcef/browser/osr/text_input_client_osr_mac.mm @@ -165,10 +165,12 @@ extern "C" { // is empty to update the input method state. (Our input method backend can // automatically cancels an ongoing composition when we send an empty text. // So, it is OK to send an empty text to the renderer.) - if (!handlingKeyDown_) { + if (handlingKeyDown_) { + setMarkedTextReplacementRange_ = gfx::Range(replacementRange); + } else if (!handlingKeyDown_) { renderWidgetHostView_->render_widget_host()->ImeSetComposition( - markedText_, underlines_, newSelRange.location, - NSMaxRange(newSelRange)); + markedText_, underlines_, gfx::Range(replacementRange), + newSelRange.location, NSMaxRange(newSelRange)); } } @@ -315,6 +317,7 @@ extern "C" { textToBeInserted_.clear(); markedText_.clear(); underlines_.clear(); + setMarkedTextReplacementRange_ = gfx::Range::InvalidRange(); unmarkTextCalled_ = NO; hasEditCommands_ = NO; editCommands_.clear(); @@ -362,8 +365,8 @@ extern "C" { // When marked text is available, |selectedRange_| will be the range being // selected inside the marked text. renderWidgetHostView_->render_widget_host()->ImeSetComposition( - markedText_, underlines_, selectedRange_.location, - NSMaxRange(selectedRange_)); + markedText_, underlines_, setMarkedTextReplacementRange_, + selectedRange_.location, NSMaxRange(selectedRange_)); } else if (oldHasMarkedText_ && !hasMarkedText_ && !textInserted) { if (unmarkTextCalled_) { renderWidgetHostView_->render_widget_host()->ImeConfirmComposition( @@ -372,6 +375,8 @@ extern "C" { renderWidgetHostView_->render_widget_host()->ImeCancelComposition(); } } + + setMarkedTextReplacementRange_ = gfx::Range::InvalidRange(); } - (void)cancelComposition { diff --git a/libcef/browser/pepper/device_id_fetcher.cc b/libcef/browser/pepper/device_id_fetcher.cc index bd3f52278..ad1a672d3 100644 --- a/libcef/browser/pepper/device_id_fetcher.cc +++ b/libcef/browser/pepper/device_id_fetcher.cc @@ -6,13 +6,13 @@ #include "base/files/file_util.h" #include "base/macros.h" -#include "base/prefs/pref_service.h" #include "base/strings/string_number_conversions.h" #include "build/build_config.h" #include "chrome/common/pref_names.h" #if defined(OS_CHROMEOS) #include "chromeos/cryptohome/system_salt_getter.h" #endif +#include "components/prefs/pref_service.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/user_prefs/user_prefs.h" #include "content/public/browser/browser_context.h" diff --git a/libcef/browser/permissions/permission_manager.cc b/libcef/browser/permissions/permission_manager.cc index 3f531af87..868cdfff7 100644 --- a/libcef/browser/permissions/permission_manager.cc +++ b/libcef/browser/permissions/permission_manager.cc @@ -24,11 +24,11 @@ PermissionStatus ContentSettingToPermissionStatus(ContentSetting setting) { switch (setting) { case CONTENT_SETTING_ALLOW: case CONTENT_SETTING_SESSION_ONLY: - return content::PERMISSION_STATUS_GRANTED; + return content::PermissionStatus::GRANTED; case CONTENT_SETTING_BLOCK: - return content::PERMISSION_STATUS_DENIED; + return content::PermissionStatus::DENIED; case CONTENT_SETTING_ASK: - return content::PERMISSION_STATUS_ASK; + return content::PermissionStatus::ASK; case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT: case CONTENT_SETTING_DEFAULT: case CONTENT_SETTING_NUM_SETTINGS: @@ -36,17 +36,17 @@ PermissionStatus ContentSettingToPermissionStatus(ContentSetting setting) { } NOTREACHED(); - return content::PERMISSION_STATUS_DENIED; + return content::PermissionStatus::DENIED; } // Helper method to convert PermissionStatus to ContentSetting. ContentSetting PermissionStatusToContentSetting(PermissionStatus status) { switch (status) { - case content::PERMISSION_STATUS_GRANTED: + case content::PermissionStatus::GRANTED: return CONTENT_SETTING_ALLOW; - case content::PERMISSION_STATUS_DENIED: + case content::PermissionStatus::DENIED: return CONTENT_SETTING_BLOCK; - case content::PERMISSION_STATUS_ASK: + case content::PermissionStatus::ASK: return CONTENT_SETTING_ASK; } @@ -112,7 +112,7 @@ class CefPermissionManager::PendingRequest { render_frame_id_(render_frame_host->GetRoutingID()), callback_(callback), permissions_(permissions), - results_(permissions.size(), content::PERMISSION_STATUS_DENIED), + results_(permissions.size(), content::PermissionStatus::DENIED), remaining_results_(permissions.size()) { } @@ -286,7 +286,7 @@ PermissionStatus CefPermissionManager::GetPermissionStatus( return GetPermissionStatusForConstantPermission(permission); if (!context_.SupportsPermission(permission)) - return content::PERMISSION_STATUS_DENIED; + return content::PermissionStatus::DENIED; return ContentSettingToPermissionStatus( context_.GetPermissionStatus(permission, requesting_origin, diff --git a/libcef/browser/plugins/plugin_info_message_filter.h b/libcef/browser/plugins/plugin_info_message_filter.h index f5f5c2554..a1a2af379 100644 --- a/libcef/browser/plugins/plugin_info_message_filter.h +++ b/libcef/browser/plugins/plugin_info_message_filter.h @@ -12,11 +12,11 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" -#include "base/prefs/pref_member.h" #include "base/sequenced_task_runner_helpers.h" #include "chrome/browser/plugins/plugin_metadata.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" +#include "components/prefs/pref_member.h" #include "content/public/browser/browser_message_filter.h" class CefBrowserContext; diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 35a560391..e2e58de84 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -10,18 +10,18 @@ #include "base/command_line.h" #include "base/files/file_path.h" -#include "base/prefs/json_pref_store.h" -#include "base/prefs/pref_filter.h" -#include "base/prefs/pref_registry_simple.h" -#include "base/prefs/pref_service.h" -#include "base/prefs/pref_service_factory.h" -#include "base/prefs/testing_pref_store.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" #include "chrome/browser/prefs/command_line_pref_store.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/prefs/json_pref_store.h" +#include "components/prefs/pref_filter.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" +#include "components/prefs/pref_service_factory.h" +#include "components/prefs/testing_pref_store.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "components/proxy_config/proxy_config_dictionary.h" @@ -87,7 +87,7 @@ scoped_ptr CreatePrefService(const base::FilePath& pref_path) { const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - base::PrefServiceFactory factory; + PrefServiceFactory factory; // Used to store command-line preferences, most of which will be evaluated in // the CommandLinePrefStore constructor. Preferences set in this manner cannot diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index b16295689..2634c64b8 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -13,8 +13,6 @@ #include "libcef/common/extensions/extensions_util.h" #include "base/command_line.h" -#include "base/prefs/pref_service.h" -#include "base/prefs/pref_store.h" #include "base/values.h" #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/character_encoding.h" @@ -25,6 +23,8 @@ #include "chrome/browser/ui/prefs/prefs_tab_helper.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "components/prefs/pref_service.h" +#include "components/prefs/pref_store.h" #include "components/pref_registry/pref_registry_syncable.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" diff --git a/libcef/browser/printing/print_view_manager_base.cc b/libcef/browser/printing/print_view_manager_base.cc index 7a2239082..57cdae9c1 100644 --- a/libcef/browser/printing/print_view_manager_base.cc +++ b/libcef/browser/printing/print_view_manager_base.cc @@ -12,7 +12,6 @@ #include "base/bind.h" #include "base/location.h" #include "base/memory/scoped_ptr.h" -#include "base/prefs/pref_service.h" #include "base/single_thread_task_runner.h" #include "base/strings/utf_string_conversions.h" #include "base/thread_task_runner_handle.h" @@ -24,6 +23,7 @@ #include "chrome/browser/printing/printer_query.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" +#include "components/prefs/pref_service.h" #include "components/printing/common/print_messages.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" diff --git a/libcef/browser/printing/print_view_manager_base.h b/libcef/browser/printing/print_view_manager_base.h index e28761828..d83f0bb35 100644 --- a/libcef/browser/printing/print_view_manager_base.h +++ b/libcef/browser/printing/print_view_manager_base.h @@ -7,9 +7,9 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/prefs/pref_member.h" #include "base/strings/string16.h" #include "build/build_config.h" +#include "components/prefs/pref_member.h" #include "components/printing/browser/print_manager.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/libcef/browser/printing/printing_message_filter.cc b/libcef/browser/printing/printing_message_filter.cc index 610553dff..71e5277f6 100644 --- a/libcef/browser/printing/printing_message_filter.cc +++ b/libcef/browser/printing/printing_message_filter.cc @@ -43,9 +43,6 @@ void PrintingMessageFilter::OverrideThreadForMessage( bool PrintingMessageFilter::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(PrintingMessageFilter, message) -#if defined(OS_WIN) - IPC_MESSAGE_HANDLER(PrintHostMsg_DuplicateSection, OnDuplicateSection) -#endif IPC_MESSAGE_HANDLER(PrintHostMsg_IsPrintingEnabled, OnIsPrintingEnabled) IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_GetDefaultPrintSettings, OnGetDefaultPrintSettings) @@ -58,18 +55,6 @@ bool PrintingMessageFilter::OnMessageReceived(const IPC::Message& message) { return handled; } -#if defined(OS_WIN) -void PrintingMessageFilter::OnDuplicateSection( - base::SharedMemoryHandle renderer_handle, - 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()); - shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), browser_handle); -} -#endif - - void PrintingMessageFilter::OnIsPrintingEnabled(bool* is_enabled) { DCHECK_CURRENTLY_ON(BrowserThread::IO); *is_enabled = true; diff --git a/libcef/browser/printing/printing_message_filter.h b/libcef/browser/printing/printing_message_filter.h index 4a179c06e..05ba381a9 100644 --- a/libcef/browser/printing/printing_message_filter.h +++ b/libcef/browser/printing/printing_message_filter.h @@ -49,12 +49,6 @@ class PrintingMessageFilter : public content::BrowserMessageFilter { private: ~PrintingMessageFilter() override; -#if defined(OS_WIN) - // Used to pass resulting EMF from renderer to browser in printing. - void OnDuplicateSection(base::SharedMemoryHandle renderer_handle, - base::SharedMemoryHandle* browser_handle); -#endif - // GetPrintSettingsForRenderView must be called via PostTask and // base::Bind. Collapse the settings-specific params into a // struct to avoid running into issues with too many params diff --git a/libcef/browser/request_context_impl.cc b/libcef/browser/request_context_impl.cc index 8eb63c6b6..b659d723b 100644 --- a/libcef/browser/request_context_impl.cc +++ b/libcef/browser/request_context_impl.cc @@ -13,8 +13,8 @@ #include "base/atomic_sequence_num.h" #include "base/logging.h" -#include "base/prefs/pref_service.h" #include "base/strings/stringprintf.h" +#include "components/prefs/pref_service.h" #include "content/public/browser/plugin_service.h" using content::BrowserThread; diff --git a/libcef/common/cef_messages.cc b/libcef/common/cef_messages.cc index 698c02e1f..1e1ccf627 100644 --- a/libcef/common/cef_messages.cc +++ b/libcef/common/cef_messages.cc @@ -14,7 +14,7 @@ namespace IPC { template <> struct ParamTraits { typedef net::UploadElement param_type; - static void Write(Message* m, const param_type& p) { + static void Write(base::Pickle* m, const param_type& p) { WriteParam(m, static_cast(p.type())); switch (p.type()) { case net::UploadElement::TYPE_BYTES: { @@ -31,7 +31,7 @@ struct ParamTraits { } } } - static bool Read(const Message* m, + static bool Read(const base::Pickle* m, base::PickleIterator* iter, param_type* r) { int type; @@ -71,7 +71,7 @@ struct ParamTraits { } }; -void ParamTraits >::Write(Message* m, +void ParamTraits >::Write(base::Pickle* m, const param_type& p) { WriteParam(m, p.get() != NULL); if (p.get()) { @@ -83,7 +83,7 @@ void ParamTraits >::Write(Message* m, } bool ParamTraits >::Read( - const Message* m, + const base::Pickle* m, base::PickleIterator* iter, param_type* r) { bool has_object; diff --git a/libcef/common/cef_messages.h b/libcef/common/cef_messages.h index ffc0a7108..c4cdc2c5d 100644 --- a/libcef/common/cef_messages.h +++ b/libcef/common/cef_messages.h @@ -41,8 +41,9 @@ namespace IPC { template <> struct ParamTraits > { typedef scoped_refptr param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static void Write(base::Pickle* m, const param_type& p); + static bool Read(const base::Pickle* m, base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; diff --git a/libcef/common/content_client.cc b/libcef/common/content_client.cc index da59831ef..cd69fdd9a 100644 --- a/libcef/common/content_client.cc +++ b/libcef/common/content_client.cc @@ -415,9 +415,7 @@ gfx::Image CefContentClient::GetImageNamed(int resource_id) { return gfx::Image(); } -gfx::Image CefContentClient::GetNativeImageNamed( - int resource_id, - ui::ResourceBundle::ImageRTL rtl) { +gfx::Image CefContentClient::GetNativeImageNamed(int resource_id) { return gfx::Image(); } diff --git a/libcef/common/content_client.h b/libcef/common/content_client.h index fab3f9184..e0c1af53c 100644 --- a/libcef/common/content_client.h +++ b/libcef/common/content_client.h @@ -92,9 +92,7 @@ class CefContentClient : public content::ContentClient, const base::FilePath& pack_path, const std::string& locale) override; gfx::Image GetImageNamed(int resource_id) override; - gfx::Image GetNativeImageNamed( - int resource_id, - ui::ResourceBundle::ImageRTL rtl) override; + gfx::Image GetNativeImageNamed(int resource_id) override; base::RefCountedStaticMemory* LoadDataResourceBytes( int resource_id, ui::ScaleFactor scale_factor) override; diff --git a/libcef/common/parser_impl.cc b/libcef/common/parser_impl.cc index 14108919a..42ff15a42 100644 --- a/libcef/common/parser_impl.cc +++ b/libcef/common/parser_impl.cc @@ -5,14 +5,12 @@ #include #include "include/cef_parser.h" -#include "libcef/renderer/webkit_glue.h" #include "base/base64.h" #include "base/threading/thread_restrictions.h" #include "components/url_formatter/elide_url.h" #include "net/base/escape.h" #include "net/base/mime_util.h" -#include "third_party/WebKit/public/platform/WebString.h" #include "url/gurl.h" bool CefParseURL(const CefString& url, @@ -139,13 +137,3 @@ CefString CefURIDecode(const CefString& text, else return net::UnescapeURLComponent(text.ToString(), type); } - -bool CefParseCSSColor(const CefString& string, - bool strict, - cef_color_t& color) { - // Blink types depend on PartitionAlloc. Safe to call multiple times. - webkit_glue::InitializePartitionAlloc(); - - return webkit_glue::ParseCSSColor( - blink::WebString::fromUTF8(string.ToString().data()), strict, color); -} diff --git a/libcef/common/response_impl.cc b/libcef/common/response_impl.cc index e506f66e6..74f6f34cd 100644 --- a/libcef/common/response_impl.cc +++ b/libcef/common/response_impl.cc @@ -157,7 +157,7 @@ void CefResponseImpl::SetResponseHeaders( header_map_.empty(); - void* iter = NULL; + size_t iter = 0; std::string name, value; while (headers.EnumerateHeaderLines(&iter, &name, &value)) header_map_.insert(std::make_pair(name, value)); diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index 80908417f..4ac7b664e 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -69,6 +69,7 @@ #include "ipc/ipc_sync_channel.h" #include "media/base/media.h" #include "printing/print_settings.h" +#include "third_party/WebKit/public/platform/URLConversion.h" #include "third_party/WebKit/public/platform/WebPrerenderingSupport.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURL.h" @@ -498,8 +499,8 @@ bool CefContentRendererClient::OverrideCreatePlugin( CefViewHostMsg_GetPluginInfo_Output output; blink::WebString top_origin = frame->top()->securityOrigin().toString(); render_frame->Send(new CefViewHostMsg_GetPluginInfo( - render_frame->GetRoutingID(), url, GURL(top_origin), orig_mime_type, - &output)); + render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin), + orig_mime_type, &output)); *plugin = CreatePlugin(render_frame, frame, params, output); return true; diff --git a/libcef/renderer/media/cef_key_systems.cc b/libcef/renderer/media/cef_key_systems.cc index 908bdce8f..26f8511f4 100644 --- a/libcef/renderer/media/cef_key_systems.cc +++ b/libcef/renderer/media/cef_key_systems.cc @@ -78,7 +78,7 @@ static void AddPepperBasedWidevine( #if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) Version glibc_version(gnu_get_libc_version()); DCHECK(glibc_version.IsValid()); - if (glibc_version.IsOlderThan(WIDEVINE_CDM_MIN_GLIBC_VERSION)) + if (glibc_version < base::Version(WIDEVINE_CDM_MIN_GLIBC_VERSION)) return; #endif // defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) diff --git a/libcef/renderer/plugins/cef_plugin_placeholder.cc b/libcef/renderer/plugins/cef_plugin_placeholder.cc index 64331aeea..a82aeee9b 100644 --- a/libcef/renderer/plugins/cef_plugin_placeholder.cc +++ b/libcef/renderer/plugins/cef_plugin_placeholder.cc @@ -22,6 +22,7 @@ #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_thread.h" #include "gin/object_template_builder.h" +#include "third_party/WebKit/public/platform/URLConversion.h" #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" @@ -181,7 +182,7 @@ void CefPluginPlaceholder::PluginListChanged() { render_frame()->Send( new CefViewHostMsg_GetPluginInfo(routing_id(), GURL(GetPluginParams().url), - GURL(top_origin), + blink::WebStringToGURL(top_origin), mime_type, &output)); if (output.status == status_) diff --git a/libcef/renderer/render_frame_observer.cc b/libcef/renderer/render_frame_observer.cc index a61c56c37..d2bbecb43 100644 --- a/libcef/renderer/render_frame_observer.cc +++ b/libcef/renderer/render_frame_observer.cc @@ -77,8 +77,11 @@ void CefRenderFrameObserver::WillReleaseScriptContext( v8::Isolate* isolate = blink::mainThreadIsolate(); v8::HandleScope handle_scope(isolate); - v8::Context::Scope scope(context); - blink::V8RecursionScope recursion_scope(isolate); + + // The released context should not be used for script execution. + // Depending on how the context is released this may or may not already + // be set. + blink::ScriptForbiddenScope forbidScript; CefRefPtr contextPtr( new CefV8ContextImpl(isolate, context)); diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index bb4379abc..0538fe930 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -394,9 +394,82 @@ class V8TrackString : public CefTrackNode { }; +// Object wrapped in a v8::External and passed as the Data argument to +// v8::FunctionTemplate::New. +class V8FunctionData { + public: + static v8::Local Create(v8::Isolate* isolate, + const CefString& function_name, + CefV8Handler* handler) { + // |data| will be deleted if/when the returned v8::External is GC'd. + V8FunctionData* data = new V8FunctionData(isolate, function_name, handler); + return data->CreateExternal(); + } + + static V8FunctionData* Unwrap(v8::Local data) { + DCHECK(data->IsExternal()); + return static_cast(v8::External::Cast(*data)->Value()); + } + + CefString function_name() const { + return function_name_; + } + + CefV8Handler* handler() const { + return handler_; + } + + private: + V8FunctionData(v8::Isolate* isolate, + const CefString& function_name, + CefV8Handler* handler) + : isolate_(isolate), + function_name_(function_name), + handler_(handler) { + DCHECK(isolate_); + DCHECK(handler_); + } + + ~V8FunctionData() { + isolate_->AdjustAmountOfExternalAllocatedMemory( + -static_cast(sizeof(V8FunctionData))); + } + + v8::Local CreateExternal() { + v8::Local external = v8::External::New(isolate_, this); + + isolate_->AdjustAmountOfExternalAllocatedMemory( + static_cast(sizeof(V8FunctionData))); + + handle_.Reset(isolate_, external); + handle_.SetWeak(this, FirstWeakCallback, v8::WeakCallbackType::kParameter); + + return external; + } + + static void FirstWeakCallback( + const v8::WeakCallbackInfo& data) { + V8FunctionData* wrapper = data.GetParameter(); + wrapper->handle_.Reset(); + data.SetSecondPassCallback(SecondWeakCallback); + } + + static void SecondWeakCallback( + const v8::WeakCallbackInfo& data) { + V8FunctionData* wrapper = data.GetParameter(); + delete wrapper; + } + + v8::Isolate* isolate_; + CefString function_name_; + CefV8Handler* handler_; + v8::Persistent handle_; +}; + + // Convert a CefString to a V8::String. v8::Local GetV8String(v8::Isolate* isolate, - const CefString& str) { + const CefString& str) { #if defined(CEF_STRING_TYPE_UTF16) // Already a UTF16 string. return v8::String::NewFromTwoByte( @@ -479,22 +552,19 @@ void FunctionCallbackImpl(const v8::FunctionCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); v8::Local context = isolate->GetCurrentContext(); - CefV8Handler* handler = - static_cast(v8::External::Cast(*info.Data())->Value()); + V8FunctionData* data = V8FunctionData::Unwrap(info.Data()); CefV8ValueList params; for (int i = 0; i < info.Length(); i++) params.push_back(new CefV8ValueImpl(isolate, context, info[i])); - CefString func_name; - GetCefString(v8::Handle::Cast(info.Callee()->GetName()), - func_name); CefRefPtr object = new CefV8ValueImpl(isolate, context, info.This()); CefRefPtr retval; CefString exception; - if (handler->Execute(func_name, object, params, retval, exception)) { + if (data->handler()->Execute(data->function_name(), object, params, retval, + exception)) { if (!exception.empty()) { info.GetReturnValue().Set( isolate->ThrowException( @@ -592,7 +662,7 @@ v8::MaybeLocal CallV8Function(v8::Local context, // Execute the function call using the ScriptController so that inspector // instrumentation works. if (CEF_CURRENTLY_ON_RT()) { - RefPtr frame = + blink::LocalFrame* frame = toLocalFrame(blink::toFrameIfNotDetached(context)); DCHECK(frame); if (frame && @@ -625,9 +695,15 @@ class ExtensionWrapper : public v8::Extension { if (!handler_) return v8::Local(); + CefString func_name; + GetCefString(name, func_name); + + v8::Local function_data = + V8FunctionData::Create(isolate, func_name, handler_); + return v8::FunctionTemplate::New(isolate, FunctionCallbackImpl, - v8::External::New(isolate, handler_)); + function_data); } private: @@ -918,6 +994,9 @@ CefRefPtr CefV8ContextImpl::GetFrame() { CefRefPtr CefV8ContextImpl::GetGlobal() { CEF_V8_REQUIRE_VALID_HANDLE_RETURN(NULL); + if (blink::ScriptForbiddenScope::isScriptForbidden()) + return nullptr; + v8::Isolate* isolate = handle_->isolate(); v8::HandleScope handle_scope(isolate); v8::Local context = GetV8Context(); @@ -928,6 +1007,9 @@ CefRefPtr CefV8ContextImpl::GetGlobal() { bool CefV8ContextImpl::Enter() { CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false); + if (blink::ScriptForbiddenScope::isScriptForbidden()) + return false; + v8::Isolate* isolate = handle_->isolate(); v8::HandleScope handle_scope(isolate); @@ -942,6 +1024,9 @@ bool CefV8ContextImpl::Enter() { bool CefV8ContextImpl::Exit() { CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false); + if (blink::ScriptForbiddenScope::isScriptForbidden()) + return false; + v8::Isolate* isolate = handle_->isolate(); v8::HandleScope handle_scope(handle_->isolate()); @@ -970,6 +1055,9 @@ bool CefV8ContextImpl::Eval(const CefString& code, CefRefPtr& exception) { CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false); + if (blink::ScriptForbiddenScope::isScriptForbidden()) + return false; + if (code.empty()) { NOTREACHED() << "invalid input parameter"; return false; @@ -1013,9 +1101,14 @@ v8::Local CefV8ContextImpl::GetV8Context() { blink::WebFrame* CefV8ContextImpl::GetWebFrame() { CEF_REQUIRE_RT(); + + if (blink::ScriptForbiddenScope::isScriptForbidden()) + return nullptr; + v8::HandleScope handle_scope(handle_->isolate()); - v8::Context::Scope context_scope(GetV8Context()); - return blink::WebLocalFrame::frameForCurrentContext(); + v8::Local context = GetV8Context(); + v8::Context::Scope context_scope(context); + return blink::WebLocalFrame::frameForContext(context); } @@ -1045,17 +1138,18 @@ CefV8ValueImpl::Handle::~Handle() { } else { GetIsolateManager()->DeleteGlobalTrackObject(tracker_); } - - isolate_->AdjustAmountOfExternalAllocatedMemory( - -static_cast(sizeof(Handle))); } else { delete tracker_; } } - // Always call Reset() on a persistent handle to avoid the - // CHECK(state() != NEAR_DEATH) in V8's PostGarbageCollectionProcessing. - handle_.Reset(); + if (is_set_weak_) { + isolate_->AdjustAmountOfExternalAllocatedMemory( + -static_cast(sizeof(Handle))); + } else { + // SetWeak was not called so reset now. + handle_.Reset(); + } } CefV8ValueImpl::Handle::handleType @@ -1089,13 +1183,13 @@ void CefV8ValueImpl::Handle::SetWeakIfNecessary() { if (context_state_.get()) { // |tracker_| will be deleted when: // A. The associated context is released, or - // B. Destructor is called for the weak handle. + // B. SecondWeakCallback is called for the weak handle. DCHECK(context_state_->IsValid()); context_state_->AddTrackObject(tracker_); } else { // |tracker_| will be deleted when: // A. The process shuts down, or - // B. Destructor is called for the weak handle. + // B. SecondWeakCallback is called for the weak handle. GetIsolateManager()->AddGlobalTrackObject(tracker_); } } @@ -1103,16 +1197,25 @@ void CefV8ValueImpl::Handle::SetWeakIfNecessary() { isolate_->AdjustAmountOfExternalAllocatedMemory( static_cast(sizeof(Handle))); - // The added reference will be released in Destructor. + // The added reference will be released in SecondWeakCallback. AddRef(); - handle_.SetWeak(this, Destructor, v8::WeakCallbackType::kParameter); + handle_.SetWeak(this, FirstWeakCallback, v8::WeakCallbackType::kParameter); } } // static -void CefV8ValueImpl::Handle::Destructor( +void CefV8ValueImpl::Handle::FirstWeakCallback( const v8::WeakCallbackInfo& data) { - data.GetParameter()->Release(); + Handle* wrapper = data.GetParameter(); + wrapper->handle_.Reset(); + data.SetSecondPassCallback(SecondWeakCallback); +} + +// static +void CefV8ValueImpl::Handle::SecondWeakCallback( + const v8::WeakCallbackInfo& data) { + Handle* wrapper = data.GetParameter(); + wrapper->Release(); } @@ -1269,13 +1372,14 @@ CefRefPtr CefV8Value::CreateFunction( return NULL; } + v8::Local function_data = + V8FunctionData::Create(isolate, name, handler.get()); + // Create a new V8 function template. - v8::Local tmpl = v8::FunctionTemplate::New(isolate); - - v8::Local data = v8::External::New(isolate, handler.get()); - - // Set the function handler callback. - tmpl->SetCallHandler(FunctionCallbackImpl, data); + v8::Local tmpl = + v8::FunctionTemplate::New(isolate, + FunctionCallbackImpl, + function_data); // Retrieve the function object and set the name. v8::Local func = tmpl->GetFunction(); diff --git a/libcef/renderer/v8_impl.h b/libcef/renderer/v8_impl.h index 9956b4f77..457e83054 100644 --- a/libcef/renderer/v8_impl.h +++ b/libcef/renderer/v8_impl.h @@ -303,8 +303,9 @@ class CefV8ValueImpl : public CefV8Value { ~Handle() override; private: - // Callback for weak persistent reference destruction. - static void Destructor(const v8::WeakCallbackInfo& data); + // Callbacks for weak persistent reference destruction. + static void FirstWeakCallback(const v8::WeakCallbackInfo& data); + static void SecondWeakCallback(const v8::WeakCallbackInfo& data); persistentType handle_; diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/webkit_glue.cc index 55f7c4057..e9cbf081c 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/webkit_glue.cc @@ -25,7 +25,6 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "third_party/WebKit/public/web/WebNode.h" #include "third_party/WebKit/public/web/WebViewClient.h" -#include "third_party/WebKit/Source/core/css/parser/CSSParser.h" #include "third_party/WebKit/Source/core/dom/Element.h" #include "third_party/WebKit/Source/core/dom/Node.h" #include "third_party/WebKit/Source/core/editing/serializers/Serialization.h" @@ -160,23 +159,4 @@ blink::WebFrame* FindFrameByUniqueName(const blink::WebString& unique_name, return NULL; } -void InitializePartitionAlloc() { - WTF::Partitions::initialize(nullptr); -} - -bool ParseCSSColor(const blink::WebString& string, - bool strict, SkColor& color) { - blink::Color rgba_color = - blink::makeRGBA(SkColorGetR(color), SkColorGetG(color), - SkColorGetB(color), SkColorGetA(color)); - if (!blink::CSSParser::parseColor(rgba_color, string, strict)) - return false; - - color = SkColorSetARGB(rgba_color.alpha(), - rgba_color.red(), - rgba_color.green(), - rgba_color.blue()); - return true; -} - } // webkit_glue diff --git a/libcef/renderer/webkit_glue.h b/libcef/renderer/webkit_glue.h index 959093ae1..4aaba0bae 100644 --- a/libcef/renderer/webkit_glue.h +++ b/libcef/renderer/webkit_glue.h @@ -10,8 +10,6 @@ #include -#include "third_party/skia/include/core/SkColor.h" - #include "include/internal/cef_types.h" namespace blink { @@ -46,12 +44,6 @@ int64_t GetIdentifier(blink::WebFrame* frame); blink::WebFrame* FindFrameByUniqueName(const blink::WebString& unique_name, blink::WebFrame* relative_to_frame); -// Initialize PartitionAlloc before calling Blink functions from the browser -// process. Safe to call multiple times. -void InitializePartitionAlloc(); - -bool ParseCSSColor(const blink::WebString& string, bool strict, SkColor& color); - } // webkit_glue #endif // CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_ diff --git a/libcef_dll/base/cef_logging.cc b/libcef_dll/base/cef_logging.cc index a828b8fad..7dc37d1a4 100644 --- a/libcef_dll/base/cef_logging.cc +++ b/libcef_dll/base/cef_logging.cc @@ -23,9 +23,13 @@ namespace logging { namespace { #if defined(OS_POSIX) -// From base/safe_strerror_posix.cc. +// From base/posix/safe_strerror.cc -#define USE_HISTORICAL_STRERRO_R (defined(__GLIBC__) || defined(OS_NACL)) +#if defined(__GLIBC__) || defined(OS_NACL) +#define USE_HISTORICAL_STRERRO_R 1 +#else +#define USE_HISTORICAL_STRERRO_R 0 +#endif #if USE_HISTORICAL_STRERRO_R && defined(__GNUC__) // GCC will complain about the unused second wrap function unless we tell it diff --git a/libcef_dll/libcef_dll.cc b/libcef_dll/libcef_dll.cc index c41e099e8..cc3a97ea9 100644 --- a/libcef_dll/libcef_dll.cc +++ b/libcef_dll/libcef_dll.cc @@ -597,36 +597,6 @@ CEF_EXPORT cef_string_userfree_t cef_uridecode(const cef_string_t* text, return _retval.DetachToUserFree(); } -CEF_EXPORT int cef_parse_csscolor(const cef_string_t* string, int strict, - cef_color_t* color) { - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: string; type: string_byref_const - DCHECK(string); - if (!string) - return 0; - // Verify param: color; type: simple_byref - DCHECK(color); - if (!color) - return 0; - - // Translate param: color; type: simple_byref - cef_color_t colorVal = color?*color:0; - - // Execute - bool _retval = CefParseCSSColor( - CefString(string), - strict?true:false, - colorVal); - - // Restore param: color; type: simple_byref - if (color) - *color = colorVal; - - // Return type: bool - return _retval; -} - CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string, cef_json_parser_options_t options) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING diff --git a/libcef_dll/wrapper/libcef_dll_wrapper.cc b/libcef_dll/wrapper/libcef_dll_wrapper.cc index 61f58b00f..72513bbd1 100644 --- a/libcef_dll/wrapper/libcef_dll_wrapper.cc +++ b/libcef_dll/wrapper/libcef_dll_wrapper.cc @@ -565,25 +565,6 @@ CEF_GLOBAL CefString CefURIDecode(const CefString& text, bool convert_to_utf8, return _retvalStr; } -CEF_GLOBAL bool CefParseCSSColor(const CefString& string, bool strict, - cef_color_t& color) { - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Verify param: string; type: string_byref_const - DCHECK(!string.empty()); - if (string.empty()) - return false; - - // Execute - int _retval = cef_parse_csscolor( - string.GetStruct(), - strict, - &color); - - // Return type: bool - return _retval?true:false; -} - CEF_GLOBAL CefRefPtr CefParseJSON(const CefString& json_string, cef_json_parser_options_t options) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING diff --git a/patch/patches/browser_frame_host_guest_1687.patch b/patch/patches/browser_frame_host_guest_1687.patch index 93880b6aa..6cbaba6fd 100644 --- a/patch/patches/browser_frame_host_guest_1687.patch +++ b/patch/patches/browser_frame_host_guest_1687.patch @@ -1,8 +1,8 @@ diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc -index 6d4a181..952a058 100644 +index a080567..8da4190 100644 --- render_widget_host_view_guest.cc +++ render_widget_host_view_guest.cc -@@ -218,6 +218,9 @@ void RenderWidgetHostViewGuest::Destroy() { +@@ -220,6 +220,9 @@ void RenderWidgetHostViewGuest::Destroy() { } gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { diff --git a/patch/patches/browser_plugin_guest_1565.patch b/patch/patches/browser_plugin_guest_1565.patch index 3712fd5e9..26204734b 100644 --- a/patch/patches/browser_plugin_guest_1565.patch +++ b/patch/patches/browser_plugin_guest_1565.patch @@ -1,5 +1,5 @@ diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc -index 33262a8..5da1220 100644 +index 1855e5d..4e0cd1d 100644 --- browser/browser_plugin/browser_plugin_guest.cc +++ browser/browser_plugin/browser_plugin_guest.cc @@ -27,7 +27,7 @@ @@ -36,10 +36,10 @@ index 33262a8..5da1220 100644 } RendererPreferences* renderer_prefs = -@@ -791,11 +790,10 @@ void BrowserPluginGuest::OnWillAttachComplete( - static_cast(GetWebContents()->GetRenderViewHost()) +@@ -792,11 +791,10 @@ void BrowserPluginGuest::OnWillAttachComplete( ->GetWidget() ->Init(); + GetWebContents()->GetMainFrame()->Init(); - WebContentsViewGuest* web_contents_view = - static_cast(GetWebContents()->GetView()); if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { diff --git a/patch/patches/browser_web_contents_1257.patch b/patch/patches/browser_web_contents_1257.patch index 7fdf3aa6a..b869a3112 100644 --- a/patch/patches/browser_web_contents_1257.patch +++ b/patch/patches/browser_web_contents_1257.patch @@ -1,8 +1,8 @@ diff --git web_contents_impl.cc web_contents_impl.cc -index ccadfb2..b70b8e4 100644 +index 2af90ae..7580a73 100644 --- web_contents_impl.cc +++ web_contents_impl.cc -@@ -1388,32 +1388,40 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -1382,32 +1382,40 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { main_frame_widget_routing_id); frame_tree_.root()->SetFrameName(params.main_frame_name); @@ -62,7 +62,7 @@ index ccadfb2..b70b8e4 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -1835,11 +1843,14 @@ void WebContentsImpl::CreateNewWindow( +@@ -1839,11 +1847,14 @@ void WebContentsImpl::CreateNewWindow( static_cast(session_storage_namespace); CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); @@ -78,7 +78,7 @@ index ccadfb2..b70b8e4 100644 if (route_id != MSG_ROUTING_NONE && !RenderViewHost::FromID(render_process_id, route_id)) { // If the embedder didn't create a WebContents for this route, we need to -@@ -1860,6 +1871,8 @@ void WebContentsImpl::CreateNewWindow( +@@ -1867,6 +1878,8 @@ void WebContentsImpl::CreateNewWindow( create_params.opener_render_process_id = render_process_id; create_params.opener_render_frame_id = params.opener_render_frame_id; create_params.opener_suppressed = params.opener_suppressed; diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 29b838fd6..15127311e 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,5 +1,5 @@ diff --git common.gypi common.gypi -index 514b129..036fe51 100644 +index 846dc3a..700284e 100644 --- common.gypi +++ common.gypi @@ -9,6 +9,9 @@ diff --git a/patch/patches/chrome_browser_1257.patch b/patch/patches/chrome_browser_1257.patch index 67abd5132..c5eef03b1 100644 --- a/patch/patches/chrome_browser_1257.patch +++ b/patch/patches/chrome_browser_1257.patch @@ -1,8 +1,8 @@ diff --git ui/browser.cc ui/browser.cc -index 717381d..35f791b 100644 +index 8ceee96..da77140 100644 --- ui/browser.cc +++ ui/browser.cc -@@ -1707,7 +1707,9 @@ bool Browser::ShouldCreateWebContents( +@@ -1726,7 +1726,9 @@ bool Browser::ShouldCreateWebContents( const std::string& frame_name, const GURL& target_url, const std::string& partition_id, @@ -14,10 +14,10 @@ index 717381d..35f791b 100644 // If a BackgroundContents is created, suppress the normal WebContents. return !MaybeCreateBackgroundContents( diff --git ui/browser.h ui/browser.h -index 13ec6b4..6e8fffa 100644 +index 37d23b3..37c9ea9 100644 --- ui/browser.h +++ ui/browser.h -@@ -599,7 +599,9 @@ class Browser : public TabStripModelObserver, +@@ -600,7 +600,9 @@ class Browser : public TabStripModelObserver, const std::string& frame_name, const GURL& target_url, const std::string& partition_id, diff --git a/patch/patches/compositor_1368.patch b/patch/patches/compositor_1368.patch index 7a99859df..0e49e7b49 100644 --- a/patch/patches/compositor_1368.patch +++ b/patch/patches/compositor_1368.patch @@ -1,8 +1,8 @@ diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc -index 874debf..ba26bdf 100644 +index eccd9dc..d0908c6 100644 --- content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc -@@ -137,6 +137,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { +@@ -132,6 +132,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { scoped_ptr GpuProcessTransportFactory::CreateSoftwareOutputDevice( ui::Compositor* compositor) { diff --git a/patch/patches/content_nav_1129.patch b/patch/patches/content_nav_1129.patch index 6dd51fe86..09e3ea196 100644 --- a/patch/patches/content_nav_1129.patch +++ b/patch/patches/content_nav_1129.patch @@ -39,10 +39,10 @@ index 45686b5..18548a0 100644 // Returns true if we should fork a new process for the given navigation. // If |send_referrer| is set to false (which is the default), no referrer diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc -index 9b199d3..1a8b6fa 100644 +index 0fc35cb..caed853 100644 --- renderer/render_frame_impl.cc +++ renderer/render_frame_impl.cc -@@ -4684,7 +4684,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( +@@ -4750,7 +4750,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( (pending_navigation_params_ && !pending_navigation_params_->request_params.redirects.empty()); @@ -50,7 +50,7 @@ index 9b199d3..1a8b6fa 100644 // The handlenavigation API is deprecated and will be removed once // crbug.com/325351 is resolved. if (info.urlRequest.url() != GURL(kSwappedOutURL) && -@@ -4694,7 +4693,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( +@@ -4760,7 +4759,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( is_redirect)) { return blink::WebNavigationPolicyIgnore; } diff --git a/patch/patches/extensions_1257.patch b/patch/patches/extensions_1257.patch index a8931f644..44838f11c 100644 --- a/patch/patches/extensions_1257.patch +++ b/patch/patches/extensions_1257.patch @@ -1,5 +1,5 @@ diff --git browser/guest_view/extension_options/extension_options_guest.cc browser/guest_view/extension_options/extension_options_guest.cc -index f594ade..f71e7ed 100644 +index a3d8c7c..1ad97bc 100644 --- browser/guest_view/extension_options/extension_options_guest.cc +++ browser/guest_view/extension_options/extension_options_guest.cc @@ -202,7 +202,9 @@ bool ExtensionOptionsGuest::ShouldCreateWebContents( diff --git a/patch/patches/font_family_cache_1501.patch b/patch/patches/font_family_cache_1501.patch index fadd480ec..479c3340f 100644 --- a/patch/patches/font_family_cache_1501.patch +++ b/patch/patches/font_family_cache_1501.patch @@ -1,5 +1,5 @@ diff --git font_family_cache.h font_family_cache.h -index 306cbf0..6ca443c 100644 +index 743448d..0a9f350 100644 --- font_family_cache.h +++ font_family_cache.h @@ -20,6 +20,8 @@ class Profile; diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 3411b2ae8..9cc6012af 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,5 +1,5 @@ diff --git resource_ids resource_ids -index c1f41e0..5ef46f2 100644 +index 2943776..6d4b898 100644 --- resource_ids +++ resource_ids @@ -14,6 +14,12 @@ diff --git a/patch/patches/gyp_331.patch b/patch/patches/gyp_331.patch index b2b768a35..3d8debffc 100644 --- a/patch/patches/gyp_331.patch +++ b/patch/patches/gyp_331.patch @@ -1,8 +1,8 @@ diff --git gyp/generator/ninja.py gyp/generator/ninja.py -index d8a45c7..3dd5518 100644 +index 552b2f8..3d61233 100644 --- gyp/generator/ninja.py +++ gyp/generator/ninja.py -@@ -745,7 +745,16 @@ class NinjaWriter(object): +@@ -747,7 +747,16 @@ class NinjaWriter(object): for path in copy['files']: # Normalize the path so trailing slashes don't confuse us. path = os.path.normpath(path) diff --git a/patch/patches/hwnd_message_handler_1481.patch b/patch/patches/hwnd_message_handler_1481.patch index fb3b43f95..e7d091113 100644 --- a/patch/patches/hwnd_message_handler_1481.patch +++ b/patch/patches/hwnd_message_handler_1481.patch @@ -1,8 +1,8 @@ diff --git hwnd_message_handler.cc hwnd_message_handler.cc -index 0cacffe..847ce2b 100644 +index f632827..b6c912c 100644 --- hwnd_message_handler.cc +++ hwnd_message_handler.cc -@@ -2387,8 +2387,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -2382,8 +2382,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, active_mouse_tracking_flags_ = 0; } else if (event.type() == ui::ET_MOUSEWHEEL) { // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/ime_1610.patch b/patch/patches/ime_1610.patch index 3fea88932..2decaa98b 100644 --- a/patch/patches/ime_1610.patch +++ b/patch/patches/ime_1610.patch @@ -1,8 +1,8 @@ diff --git input_method_win.cc input_method_win.cc -index 56bbac1..3265c64 100644 +index 6ac7e6f..ad372ce 100644 --- input_method_win.cc +++ input_method_win.cc -@@ -588,8 +588,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const { +@@ -614,8 +614,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const { // receiving keyboard input as long as it is an active window. This works well // even when the |attached_window_handle| becomes active but has not received // WM_FOCUS yet. diff --git a/patch/patches/message_loop_443.patch b/patch/patches/message_loop_443.patch index 9539e70ff..32dd401ad 100644 --- a/patch/patches/message_loop_443.patch +++ b/patch/patches/message_loop_443.patch @@ -1,5 +1,5 @@ diff --git message_loop.cc message_loop.cc -index e84765a..560bd39 100644 +index 88f75e9..7abb471 100644 --- message_loop.cc +++ message_loop.cc @@ -139,12 +139,6 @@ MessageLoop::~MessageLoop() { diff --git a/patch/patches/net_filter_515.patch b/patch/patches/net_filter_515.patch index f2ca10620..702078dc2 100644 --- a/patch/patches/net_filter_515.patch +++ b/patch/patches/net_filter_515.patch @@ -45,10 +45,10 @@ index e9df3db..768b7fc 100644 friend class GZipUnitTest; friend class SdchFilterChainingTest; diff --git url_request/url_request_job.cc url_request/url_request_job.cc -index 55a4f51..937f163 100644 +index e46d3f1..0c0430f 100644 --- url_request/url_request_job.cc +++ url_request/url_request_job.cc -@@ -447,6 +447,9 @@ void URLRequestJob::NotifyHeadersComplete() { +@@ -448,6 +448,9 @@ void URLRequestJob::NotifyHeadersComplete() { if (request_->status().is_success()) filter_.reset(SetupFilter()); diff --git a/patch/patches/pdfium_print_549365.patch b/patch/patches/pdfium_print_549365.patch index d964ca136..6bc9439a9 100644 --- a/patch/patches/pdfium_print_549365.patch +++ b/patch/patches/pdfium_print_549365.patch @@ -1,5 +1,5 @@ diff --git fpdfsdk/src/fpdfview.cpp fpdfsdk/src/fpdfview.cpp -index a6c1420..88c1b97 100644 +index ba64709..02e1391 100644 --- fpdfsdk/src/fpdfview.cpp +++ fpdfsdk/src/fpdfview.cpp @@ -14,6 +14,7 @@ diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch index 9df3285e6..1905ecbcd 100644 --- a/patch/patches/prefs_content_1161.patch +++ b/patch/patches/prefs_content_1161.patch @@ -1,8 +1,8 @@ diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h -index a9811c4..a43f9d1 100644 +index 45a9516..419f17e 100644 --- public/common/common_param_traits_macros.h +++ public/common/common_param_traits_macros.h -@@ -193,6 +193,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) +@@ -194,6 +194,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes) IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) @@ -11,10 +11,10 @@ index a9811c4..a43f9d1 100644 IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop) IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) diff --git public/common/web_preferences.cc public/common/web_preferences.cc -index 4a83a70..98781c0 100644 +index 62af1ce..23e31de 100644 --- public/common/web_preferences.cc +++ public/common/web_preferences.cc -@@ -171,6 +171,7 @@ WebPreferences::WebPreferences() +@@ -172,6 +172,7 @@ WebPreferences::WebPreferences() pinch_overlay_scrollbar_thickness(0), use_solid_color_scrollbars(false), navigate_on_drag_drop(true), @@ -23,10 +23,10 @@ index 4a83a70..98781c0 100644 cookie_enabled(true), pepper_accelerated_video_decode_enabled(false), diff --git public/common/web_preferences.h public/common/web_preferences.h -index de5a3c5..afdf03f 100644 +index 7d6ca7d..ba38861 100644 --- public/common/web_preferences.h +++ public/common/web_preferences.h -@@ -172,6 +172,7 @@ struct CONTENT_EXPORT WebPreferences { +@@ -174,6 +174,7 @@ struct CONTENT_EXPORT WebPreferences { int pinch_overlay_scrollbar_thickness; bool use_solid_color_scrollbars; bool navigate_on_drag_drop; @@ -35,10 +35,10 @@ index de5a3c5..afdf03f 100644 // This flags corresponds to a Page's Settings' setCookieEnabled state. It diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc -index 8e6b887..77ef5ad 100644 +index 36d226c..ce8fd74 100644 --- renderer/render_view_impl.cc +++ renderer/render_view_impl.cc -@@ -938,6 +938,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, +@@ -953,6 +953,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, settings->setCookieEnabled(prefs.cookie_enabled); settings->setNavigateOnDragDrop(prefs.navigate_on_drag_drop); diff --git a/patch/patches/prefs_tab_helper_1680.patch b/patch/patches/prefs_tab_helper_1680.patch index 328bab199..5d6130d5d 100644 --- a/patch/patches/prefs_tab_helper_1680.patch +++ b/patch/patches/prefs_tab_helper_1680.patch @@ -1,5 +1,5 @@ diff --git prefs_tab_helper.cc prefs_tab_helper.cc -index ee406db..fc86170 100644 +index 36d6fe9..a875d1e 100644 --- prefs_tab_helper.cc +++ prefs_tab_helper.cc @@ -12,7 +12,7 @@ @@ -9,8 +9,8 @@ index ee406db..fc86170 100644 -#include "base/memory/singleton.h" +#include "base/lazy_instance.h" #include "base/metrics/field_trial.h" - #include "base/prefs/overlay_user_pref_store.h" - #include "base/prefs/pref_change_registrar.h" + #include "base/strings/string_number_conversions.h" + #include "base/strings/string_util.h" @@ -431,12 +431,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { GetInstance()->GetServiceForBrowserContext(profile, true)); } diff --git a/patch/patches/print_header_footer_1478_1565.patch b/patch/patches/print_header_footer_1478_1565.patch index a10cfb846..28f44873c 100644 --- a/patch/patches/print_header_footer_1478_1565.patch +++ b/patch/patches/print_header_footer_1478_1565.patch @@ -16,7 +16,7 @@ index c3469fc..9fc71ac 100644 } -#endif // defined(ENABLE_PRINT_PREVIEW) diff --git printing/common/print_messages.h printing/common/print_messages.h -index 372097f..ae8a227 100644 +index 6060a1c..d051297 100644 --- printing/common/print_messages.h +++ printing/common/print_messages.h @@ -70,7 +70,6 @@ struct PrintMsg_PrintPages_Params { @@ -106,7 +106,7 @@ index 372097f..ae8a227 100644 // Messages sent from the renderer to the browser. -@@ -423,7 +413,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, +@@ -415,7 +405,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, int /* fd in browser */) // Used only by Chrome OS. #endif // defined(OS_ANDROID) @@ -114,7 +114,7 @@ index 372097f..ae8a227 100644 // Asks the browser to do print preview. IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, PrintHostMsg_RequestPrintPreview_Params /* params */) -@@ -457,7 +446,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, +@@ -449,7 +438,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, // The memory handle in this message is already valid in the browser process. IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting, PrintHostMsg_DidPreviewDocument_Params /* params */) @@ -122,7 +122,7 @@ index 372097f..ae8a227 100644 // This is sent when there are invalid printer settings. IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) -@@ -466,7 +454,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) +@@ -458,7 +446,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, int /* document cookie */) @@ -130,16 +130,16 @@ index 372097f..ae8a227 100644 // Tell the browser print preview failed. IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, int /* document cookie */) -@@ -493,4 +480,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, +@@ -485,4 +472,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, // Notify the browser to set print presets based on source PDF document. IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, PrintHostMsg_SetOptionsFromDocument_Params /* params */) -#endif // defined(ENABLE_PRINT_PREVIEW) diff --git printing/renderer/print_web_view_helper.cc printing/renderer/print_web_view_helper.cc -index ff97954..c93dabf 100644 +index 6a8f1c3..f66469e 100644 --- printing/renderer/print_web_view_helper.cc +++ printing/renderer/print_web_view_helper.cc -@@ -80,6 +80,9 @@ const double kMinDpi = 1.0; +@@ -81,6 +81,9 @@ const double kMinDpi = 1.0; #if defined(ENABLE_PRINT_PREVIEW) bool g_is_preview_enabled = true; @@ -149,7 +149,7 @@ index ff97954..c93dabf 100644 const char kPageLoadScriptFormat[] = "document.open(); document.write(%s); document.close();"; -@@ -94,9 +97,6 @@ void ExecuteScript(blink::WebFrame* frame, +@@ -95,9 +98,6 @@ void ExecuteScript(blink::WebFrame* frame, std::string script = base::StringPrintf(script_format, json.c_str()); frame->executeScript(blink::WebString(base::UTF8ToUTF16(script))); } @@ -159,7 +159,7 @@ index ff97954..c93dabf 100644 int GetDPI(const PrintMsg_Print_Params* print_params) { #if defined(OS_MACOSX) -@@ -306,7 +306,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, +@@ -307,7 +307,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, return plugin && plugin->supportsPaginatedPrint(); } @@ -167,7 +167,7 @@ index ff97954..c93dabf 100644 // Returns true if the current destination printer is PRINT_TO_PDF. bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) { bool print_to_pdf = false; -@@ -328,7 +327,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebFrame* frame, +@@ -329,7 +328,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebFrame* frame, } return frame_has_custom_page_size_style; } @@ -175,7 +175,7 @@ index ff97954..c93dabf 100644 // Disable scaling when either: // - The PDF specifies disabling scaling. -@@ -375,7 +373,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame, +@@ -376,7 +374,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame, } #endif @@ -183,7 +183,7 @@ index ff97954..c93dabf 100644 bool FitToPageEnabled(const base::DictionaryValue& job_settings) { bool fit_to_paper_size = false; if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) { -@@ -417,7 +414,6 @@ blink::WebPrintScalingOption GetPrintScalingOption( +@@ -418,7 +415,6 @@ blink::WebPrintScalingOption GetPrintScalingOption( } return blink::WebPrintScalingOptionFitToPrintableArea; } @@ -191,7 +191,7 @@ index ff97954..c93dabf 100644 PrintMsg_Print_Params CalculatePrintParamsForCss( blink::WebFrame* frame, -@@ -501,7 +497,6 @@ blink::WebView* FrameReference::view() { +@@ -502,7 +498,6 @@ blink::WebView* FrameReference::view() { return view_; } @@ -199,7 +199,7 @@ index ff97954..c93dabf 100644 // static - Not anonymous so that platform implementations can use it. void PrintWebViewHelper::PrintHeaderAndFooter( blink::WebCanvas* canvas, -@@ -557,7 +552,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter( +@@ -558,7 +553,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter( web_view->close(); frame->close(); } @@ -207,7 +207,7 @@ index ff97954..c93dabf 100644 // static - Not anonymous so that platform implementations can use it. float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame, -@@ -830,6 +824,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view, +@@ -831,6 +825,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view, print_for_preview_(false), delegate_(std::move(delegate)), print_node_in_progress_(false), @@ -215,7 +215,7 @@ index ff97954..c93dabf 100644 is_loading_(false), is_scripted_preview_delayed_(false), ipc_nesting_level_(0), -@@ -888,10 +883,8 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame, +@@ -889,10 +884,8 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame, return; if (g_is_preview_enabled) { @@ -226,7 +226,7 @@ index ff97954..c93dabf 100644 } else { #if defined(ENABLE_BASIC_PRINTING) Print(frame, blink::WebNode(), true); -@@ -915,14 +908,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) { +@@ -916,14 +909,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages) IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog) #endif // defined(ENABLE_BASIC_PRINTING) @@ -241,7 +241,7 @@ index ff97954..c93dabf 100644 IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked, SetScriptedPrintBlocked) IPC_MESSAGE_UNHANDLED(handled = false) -@@ -974,7 +963,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() { +@@ -975,7 +964,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() { } #endif // defined(ENABLE_BASIC_PRINTING) @@ -249,7 +249,7 @@ index ff97954..c93dabf 100644 void PrintWebViewHelper::OnPrintForPrintPreview( const base::DictionaryValue& job_settings) { CHECK_LE(ipc_nesting_level_, 1); -@@ -1039,7 +1027,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview( +@@ -1040,7 +1028,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview( DidFinishPrinting(FAIL_PRINT); } } @@ -257,7 +257,7 @@ index ff97954..c93dabf 100644 void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout( const PageSizeMargins& page_layout_in_points, -@@ -1064,7 +1051,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo( +@@ -1065,7 +1052,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo( ignore_css_margins_ = (margins_type != DEFAULT_MARGINS); } @@ -265,7 +265,7 @@ index ff97954..c93dabf 100644 void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) { if (ipc_nesting_level_ > 1) return; -@@ -1225,7 +1211,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() { +@@ -1226,7 +1212,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() { return true; } @@ -274,7 +274,7 @@ index ff97954..c93dabf 100644 bool PrintWebViewHelper::RenderPreviewPage( int page_number, const PrintMsg_Print_Params& print_params) { -@@ -1254,7 +1240,7 @@ bool PrintWebViewHelper::RenderPreviewPage( +@@ -1255,7 +1241,7 @@ bool PrintWebViewHelper::RenderPreviewPage( } return PreviewPageRendered(page_number, draft_metafile.get()); } @@ -283,7 +283,7 @@ index ff97954..c93dabf 100644 bool PrintWebViewHelper::FinalizePrintReadyDocument() { DCHECK(!is_print_ready_metafile_sent_); -@@ -1284,7 +1270,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() { +@@ -1285,7 +1271,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() { Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params)); return true; } @@ -291,7 +291,7 @@ index ff97954..c93dabf 100644 void PrintWebViewHelper::OnPrintingDone(bool success) { if (ipc_nesting_level_ > 1) -@@ -1299,7 +1284,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) { +@@ -1300,7 +1285,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) { is_scripted_printing_blocked_ = blocked; } @@ -299,7 +299,7 @@ index ff97954..c93dabf 100644 void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { if (ipc_nesting_level_ > 1) return; -@@ -1310,7 +1294,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { +@@ -1311,7 +1295,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { // that instead. auto plugin = delegate_->GetPdfElement(frame); if (!plugin.isNull()) { @@ -309,7 +309,7 @@ index ff97954..c93dabf 100644 return; } print_preview_context_.InitWithFrame(frame); -@@ -1318,7 +1304,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { +@@ -1319,7 +1305,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { ? PRINT_PREVIEW_USER_INITIATED_SELECTION : PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME); } @@ -317,7 +317,7 @@ index ff97954..c93dabf 100644 bool PrintWebViewHelper::IsPrintingEnabled() { bool result = false; -@@ -1344,11 +1329,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) { +@@ -1345,11 +1330,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) { // Make a copy of the node, in case RenderView::OnContextMenuClosed resets // its |context_menu_node_|. @@ -330,7 +330,7 @@ index ff97954..c93dabf 100644 } else { #if defined(ENABLE_BASIC_PRINTING) blink::WebNode duplicate_node(node); -@@ -1414,7 +1397,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { +@@ -1415,7 +1398,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { } break; @@ -338,7 +338,7 @@ index ff97954..c93dabf 100644 case FAIL_PREVIEW: int cookie = print_pages_params_ ? print_pages_params_->params.document_cookie : 0; -@@ -1426,7 +1408,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { +@@ -1427,7 +1409,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { } print_preview_context_.Failed(notify_browser_of_print_failure_); break; @@ -346,7 +346,7 @@ index ff97954..c93dabf 100644 } prep_frame_view_.reset(); print_pages_params_.reset(); -@@ -1558,7 +1539,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, +@@ -1559,7 +1540,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, return true; } @@ -354,7 +354,7 @@ index ff97954..c93dabf 100644 bool PrintWebViewHelper::SetOptionsFromPdfDocument( PrintHostMsg_SetOptionsFromDocument_Params* options) { blink::WebLocalFrame* source_frame = print_preview_context_.source_frame(); -@@ -1667,7 +1647,6 @@ bool PrintWebViewHelper::UpdatePrintSettings( +@@ -1668,7 +1648,6 @@ bool PrintWebViewHelper::UpdatePrintSettings( return true; } @@ -362,7 +362,7 @@ index ff97954..c93dabf 100644 #if defined(ENABLE_BASIC_PRINTING) bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame, -@@ -1759,11 +1738,14 @@ void PrintWebViewHelper::PrintPageInternal( +@@ -1760,11 +1739,14 @@ void PrintWebViewHelper::PrintPageInternal( gfx::Rect canvas_area = params.params.display_header_footer ? gfx::Rect(page_size) : content_area; @@ -378,7 +378,7 @@ index ff97954..c93dabf 100644 // TODO(thestig) GetVectorCanvasForNewPage() and RenderPageContent() take a // different scale factor vs Windows. Figure out why and combine the two. #if defined(OS_WIN) -@@ -1779,14 +1761,12 @@ void PrintWebViewHelper::PrintPageInternal( +@@ -1780,14 +1762,12 @@ void PrintWebViewHelper::PrintPageInternal( MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); @@ -393,7 +393,7 @@ index ff97954..c93dabf 100644 float webkit_scale_factor = RenderPageContent(frame, params.page_number, canvas_area, content_area, -@@ -1841,7 +1821,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( +@@ -1836,7 +1816,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( #endif // defined(OS_WIN) } @@ -401,7 +401,7 @@ index ff97954..c93dabf 100644 void PrintWebViewHelper::ShowScriptedPrintPreview() { if (is_scripted_preview_delayed_) { is_scripted_preview_delayed_ = false; -@@ -1969,7 +1948,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number, +@@ -1964,7 +1943,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number, Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params)); return true; } @@ -507,7 +507,7 @@ index ca10384..7aacfbc 100644 bool is_loading_; bool is_scripted_preview_delayed_; diff --git printing/renderer/print_web_view_helper_mac.mm printing/renderer/print_web_view_helper_mac.mm -index e94f21e..e148860 100644 +index 08a1c10..4a80a2d 100644 --- printing/renderer/print_web_view_helper_mac.mm +++ printing/renderer/print_web_view_helper_mac.mm @@ -69,7 +69,6 @@ void PrintWebViewHelper::PrintPageInternal( diff --git a/patch/patches/public_browser_1257.patch b/patch/patches/public_browser_1257.patch index 38f543da2..f9c57be45 100644 --- a/patch/patches/public_browser_1257.patch +++ b/patch/patches/public_browser_1257.patch @@ -14,7 +14,7 @@ index 1b6d8a6..b606a30 100644 WebContents::CreateParams::~CreateParams() { } diff --git web_contents.h web_contents.h -index a96ed1c..d0a6772 100644 +index 5260b91..4495078 100644 --- web_contents.h +++ web_contents.h @@ -54,9 +54,11 @@ class PageState; @@ -41,7 +41,7 @@ index a96ed1c..d0a6772 100644 // Creates a new WebContents. diff --git web_contents_delegate.cc web_contents_delegate.cc -index 0a1d3f1..1d03511 100644 +index 71c3075..7abcac3 100644 --- web_contents_delegate.cc +++ web_contents_delegate.cc @@ -144,7 +144,9 @@ bool WebContentsDelegate::ShouldCreateWebContents( @@ -56,7 +56,7 @@ index 0a1d3f1..1d03511 100644 } diff --git web_contents_delegate.h web_contents_delegate.h -index ed46e43..9ffeee9 100644 +index b6015b0..75b53d4 100644 --- web_contents_delegate.h +++ web_contents_delegate.h @@ -41,9 +41,11 @@ class DownloadItem; @@ -71,7 +71,7 @@ index ed46e43..9ffeee9 100644 struct ColorSuggestion; struct ContextMenuParams; struct DropData; -@@ -305,7 +307,9 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -309,7 +311,9 @@ class CONTENT_EXPORT WebContentsDelegate { const std::string& frame_name, const GURL& target_url, const std::string& partition_id, diff --git a/patch/patches/render_widget_host_1070383005.patch b/patch/patches/render_widget_host_1070383005.patch index f574f9b5c..731f94568 100644 --- a/patch/patches/render_widget_host_1070383005.patch +++ b/patch/patches/render_widget_host_1070383005.patch @@ -1,5 +1,5 @@ diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm -index ef38d30..00fb343 100644 +index acc1c8a..c07cb49 100644 --- render_widget_host_view_mac.mm +++ render_widget_host_view_mac.mm @@ -530,9 +530,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, diff --git a/patch/patches/renderer_preferences_util_545103.patch b/patch/patches/renderer_preferences_util_545103.patch index dd5bfaf51..20a63eabf 100644 --- a/patch/patches/renderer_preferences_util_545103.patch +++ b/patch/patches/renderer_preferences_util_545103.patch @@ -1,5 +1,5 @@ diff --git renderer_preferences_util.cc renderer_preferences_util.cc -index a6498fc..4bf2cf91 100644 +index 2fff3f3..86c7f0c 100644 --- renderer_preferences_util.cc +++ renderer_preferences_util.cc @@ -27,7 +27,8 @@ diff --git a/patch/patches/spellcheck_137.patch b/patch/patches/spellcheck_137.patch index 70551cd9c..9aa8547df 100644 --- a/patch/patches/spellcheck_137.patch +++ b/patch/patches/spellcheck_137.patch @@ -1,5 +1,5 @@ diff --git spellcheck_factory.cc spellcheck_factory.cc -index 87b5b9e..8e6dfff 100644 +index 3fd085b..b2705bf 100644 --- spellcheck_factory.cc +++ spellcheck_factory.cc @@ -16,6 +16,13 @@ diff --git a/patch/patches/supports_user_data_1710.patch b/patch/patches/supports_user_data_1710.patch index 34da88402..d3d72ea22 100644 --- a/patch/patches/supports_user_data_1710.patch +++ b/patch/patches/supports_user_data_1710.patch @@ -1,5 +1,5 @@ diff --git supports_user_data.h supports_user_data.h -index 5c1c7e9..77c9253 100644 +index ab40c1b..2b145e8 100644 --- supports_user_data.h +++ supports_user_data.h @@ -33,9 +33,9 @@ class BASE_EXPORT SupportsUserData { diff --git a/patch/patches/views_widget_180_1677.patch b/patch/patches/views_widget_180_1677.patch index e2e702754..4fccd1702 100644 --- a/patch/patches/views_widget_180_1677.patch +++ b/patch/patches/views_widget_180_1677.patch @@ -1,9 +1,9 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index c5494d9..6515181 100644 +index d06fde4..329432e 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -774,6 +774,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { - ::SetFocus(host->GetAcceleratedWidget()); +@@ -776,6 +776,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { + } } #endif +#if defined(OS_LINUX) @@ -17,10 +17,10 @@ index c5494d9..6515181 100644 set_focus_on_mouse_down_or_key_event_ = false; host_->Focus(); diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index a2a0884..c6eef9d 100644 +index 780ced5..9409858 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -375,6 +375,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() +@@ -376,6 +376,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() current_device_scale_factor_(0), current_display_rotation_(gfx::Display::ROTATE_0), pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), @@ -40,18 +40,18 @@ index a2a0884..c6eef9d 100644 return renderer_frame_number_; } diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h -index d714137..9d17d2f 100644 +index 9a2e25b..dd753a5 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -87,6 +87,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -95,6 +95,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, void BeginFrameSubscription( scoped_ptr subscriber) override; void EndFrameSubscription() override; + void SetHasExternalParent(bool val) override; - // IPC::Listener implementation: - bool OnMessageReceived(const IPC::Message& msg) override; -@@ -438,6 +439,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, + // This only needs to be overridden by RenderWidgetHostViewBase subclasses + // that handle content embedded within other RenderWidgetHostViews. +@@ -445,6 +446,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, // renderer. bool pinch_zoom_enabled_; @@ -63,10 +63,10 @@ index d714137..9d17d2f 100644 void FlushInput(); diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index 9b48ddb..0314569 100644 +index 7c749a2..df2a254 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h -@@ -146,6 +146,10 @@ class CONTENT_EXPORT RenderWidgetHostView { +@@ -159,6 +159,10 @@ class CONTENT_EXPORT RenderWidgetHostView { // deleted after this call. virtual void EndFrameSubscription() = 0; @@ -91,7 +91,7 @@ index a8e088c..838b6a0 100644 return host ? host->GetAcceleratedWidget() : NULL; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index c354154..c6f0fc9 100644 +index f79b3c4..f585bea 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -84,6 +84,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( @@ -102,7 +102,7 @@ index c354154..c6f0fc9 100644 tooltip_(NULL) { } -@@ -133,8 +134,12 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window, +@@ -134,8 +135,12 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window, native_widget_delegate_); HWND parent_hwnd = NULL; @@ -116,7 +116,7 @@ index c354154..c6f0fc9 100644 message_handler_->set_remove_standard_frame(params.remove_standard_frame); -@@ -799,11 +804,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -800,11 +805,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -135,7 +135,7 @@ index c354154..c6f0fc9 100644 bool DesktopWindowTreeHostWin::HandleMouseEvent(const ui::MouseEvent& event) { diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -index ad82485..13e74b9 100644 +index 963658a..36c8d63 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h @@ -244,6 +244,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin @@ -150,10 +150,10 @@ index ad82485..13e74b9 100644 // a reference. corewm::TooltipWin* tooltip_; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -index f7495f0..3d9b9a2 100644 +index e2eaf14..0652daa 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -@@ -168,6 +168,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( +@@ -167,6 +167,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( use_native_frame_(false), should_maximize_after_map_(false), use_argb_visual_(false), @@ -161,17 +161,17 @@ index f7495f0..3d9b9a2 100644 drag_drop_client_(NULL), native_widget_delegate_(native_widget_delegate), desktop_native_widget_aura_(desktop_native_widget_aura), -@@ -177,7 +178,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( +@@ -175,7 +176,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( + custom_window_shape_(false), urgency_hint_set_(false), activatable_(true), - modal_dialog_xid_(0), - close_widget_factory_(this) { + close_widget_factory_(this), + xwindow_destroyed_(false) { } DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() { -@@ -388,7 +390,8 @@ void DesktopWindowTreeHostX11::CloseNow() { +@@ -386,7 +388,8 @@ void DesktopWindowTreeHostX11::CloseNow() { // Actually free our native resources. if (ui::PlatformEventSource::GetInstance()) ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); @@ -181,7 +181,7 @@ index f7495f0..3d9b9a2 100644 xwindow_ = None; desktop_native_widget_aura_->OnHostClosed(); -@@ -537,6 +540,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( +@@ -535,6 +538,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( } gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { @@ -190,7 +190,7 @@ index f7495f0..3d9b9a2 100644 return ToDIPRect(bounds_in_pixels_); } -@@ -974,6 +979,8 @@ void DesktopWindowTreeHostX11::HideImpl() { +@@ -972,6 +977,8 @@ void DesktopWindowTreeHostX11::HideImpl() { } gfx::Rect DesktopWindowTreeHostX11::GetBounds() const { @@ -199,7 +199,7 @@ index f7495f0..3d9b9a2 100644 return bounds_in_pixels_; } -@@ -1031,6 +1038,8 @@ void DesktopWindowTreeHostX11::SetBounds( +@@ -1029,6 +1036,8 @@ void DesktopWindowTreeHostX11::SetBounds( } gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const { @@ -208,7 +208,7 @@ index f7495f0..3d9b9a2 100644 return bounds_in_pixels_.origin(); } -@@ -1139,9 +1148,15 @@ void DesktopWindowTreeHostX11::InitX11Window( +@@ -1137,9 +1146,15 @@ void DesktopWindowTreeHostX11::InitX11Window( use_argb_visual_ = true; } @@ -225,7 +225,7 @@ index f7495f0..3d9b9a2 100644 bounds_in_pixels_.y(), bounds_in_pixels_.width(), bounds_in_pixels_.height(), 0, // border width -@@ -1770,6 +1785,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( +@@ -1767,6 +1782,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( } break; } @@ -237,12 +237,12 @@ index f7495f0..3d9b9a2 100644 if (xev->xfocus.mode != NotifyGrab) { ReleaseCapture(); diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -index 1036152..7b2b426 100644 +index 759194f..13af979 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -@@ -98,6 +98,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 - // there is no dialog on the host window. - XID GetModalDialog(); +@@ -87,6 +87,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 + // internal list of open windows. + static void CleanUpWindowList(void (*func)(aura::Window* window)); + void set_screen_bounds(const gfx::Rect& bounds) { screen_bounds_ = bounds; } + @@ -253,7 +253,7 @@ index 1036152..7b2b426 100644 protected: // Overridden from DesktopWindowTreeHost: void Init(aura::Window* content_window, -@@ -274,6 +280,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -263,6 +269,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // The bounds of |xwindow_|. gfx::Rect bounds_in_pixels_; @@ -263,7 +263,7 @@ index 1036152..7b2b426 100644 // Whenever the bounds are set, we keep the previous set of bounds around so // we can have a better chance of getting the real // |restored_bounds_in_pixels_|. Window managers tend to send a Configure -@@ -310,6 +319,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -299,6 +308,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // Whether we used an ARGB visual for our window. bool use_argb_visual_; @@ -274,7 +274,7 @@ index 1036152..7b2b426 100644 DesktopDragDropClientAuraX11* drag_drop_client_; scoped_ptr x11_non_client_event_filter_; -@@ -366,6 +379,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -351,6 +364,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 base::WeakPtrFactory close_widget_factory_; @@ -285,7 +285,7 @@ index 1036152..7b2b426 100644 }; diff --git ui/views/widget/desktop_aura/x11_desktop_handler.cc ui/views/widget/desktop_aura/x11_desktop_handler.cc -index 9b20295..20b1aec 100644 +index 5ab84f9..c4095fa 100644 --- ui/views/widget/desktop_aura/x11_desktop_handler.cc +++ ui/views/widget/desktop_aura/x11_desktop_handler.cc @@ -31,6 +31,30 @@ views::X11DesktopHandler* g_handler = NULL; @@ -346,26 +346,18 @@ index 9b20295..20b1aec 100644 x_active_window_ = None; } diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 18aa4c6..147c5a7 100644 +index 88a68da..faf4da6 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -126,6 +126,7 @@ Widget::InitParams::InitParams() +@@ -128,6 +128,7 @@ Widget::InitParams::InitParams(Type type) use_system_default_icon(false), show_state(ui::SHOW_STATE_DEFAULT), parent(nullptr), + parent_widget(gfx::kNullAcceleratedWidget), native_widget(nullptr), - native_theme(nullptr), desktop_window_tree_host(nullptr), -@@ -151,6 +152,7 @@ Widget::InitParams::InitParams(Type type) - use_system_default_icon(false), - show_state(ui::SHOW_STATE_DEFAULT), - parent(nullptr), -+ parent_widget(gfx::kNullAcceleratedWidget), - native_widget(nullptr), - native_theme(nullptr), - desktop_window_tree_host(nullptr), -@@ -328,7 +330,7 @@ void Widget::Init(const InitParams& in_params) { + layer_type(ui::LAYER_TEXTURED), +@@ -303,7 +304,7 @@ void Widget::Init(const InitParams& in_params) { InitParams params = in_params; params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -374,7 +366,7 @@ index 18aa4c6..147c5a7 100644 if (params.opacity == views::Widget::InitParams::INFER_OPACITY && params.type != views::Widget::InitParams::TYPE_WINDOW && -@@ -391,7 +393,12 @@ void Widget::Init(const InitParams& in_params) { +@@ -365,7 +366,12 @@ void Widget::Init(const InitParams& in_params) { Minimize(); } else if (params.delegate) { SetContentsView(params.delegate->GetContentsView()); @@ -389,10 +381,10 @@ index 18aa4c6..147c5a7 100644 // This must come after SetContentsView() or it might not be able to find // the correct NativeTheme (on Linux). See http://crbug.com/384492 diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 80aadde..c278b84 100644 +index 8c92b90..869a7b8 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -234,6 +234,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -233,6 +233,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // Whether the widget should be maximized or minimized. ui::WindowShowState show_state; gfx::NativeView parent; diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 3da036633..0c1920c40 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,8 @@ diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp -index e728623..e0f051e 100644 +index 02bb02e..eca142e 100644 --- Source/web/ChromeClientImpl.cpp +++ Source/web/ChromeClientImpl.cpp -@@ -825,7 +825,7 @@ bool ChromeClientImpl::hasOpenedPopup() const +@@ -834,7 +834,7 @@ bool ChromeClientImpl::hasOpenedPopup() const PassRefPtrWillBeRawPtr ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { notifyPopupOpeningObservers(); @@ -12,7 +12,7 @@ index e728623..e0f051e 100644 ASSERT(RuntimeEnabledFeatures::pagePopupEnabled()); diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp -index 416f9d8..43934e3 100644 +index 25425db..26aac0f 100644 --- Source/web/WebViewImpl.cpp +++ Source/web/WebViewImpl.cpp @@ -476,6 +476,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) @@ -23,7 +23,7 @@ index 416f9d8..43934e3 100644 , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) , m_compositorDeviceScaleFactorOverride(0) -@@ -4138,9 +4139,14 @@ void WebViewImpl::pageScaleFactorChanged() +@@ -4148,9 +4149,14 @@ void WebViewImpl::pageScaleFactorChanged() m_client->pageScaleFactorChanged(); } @@ -40,7 +40,7 @@ index 416f9d8..43934e3 100644 void WebViewImpl::startDragging(LocalFrame* frame, diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h -index cc4c325..b709524 100644 +index 9ee6613..74e5494 100644 --- Source/web/WebViewImpl.h +++ Source/web/WebViewImpl.h @@ -395,7 +395,8 @@ public: @@ -53,7 +53,7 @@ index cc4c325..b709524 100644 bool shouldAutoResize() const { -@@ -692,6 +693,8 @@ private: +@@ -691,6 +692,8 @@ private: float m_fakePageScaleAnimationPageScaleFactor; bool m_fakePageScaleAnimationUseAnchor; diff --git a/tests/cefclient/browser/main_context_impl.cc b/tests/cefclient/browser/main_context_impl.cc index bdc06defb..936e06a63 100644 --- a/tests/cefclient/browser/main_context_impl.cc +++ b/tests/cefclient/browser/main_context_impl.cc @@ -14,6 +14,27 @@ namespace { // The default URL to load in a browser window. const char kDefaultUrl[] = "http://www.google.com"; +// Returns the ARGB value for |color|. +cef_color_t ParseColor(const std::string& color) { + std::string colorToLower; + colorToLower.resize(color.size()); + std::transform(color.begin(), color.end(), colorToLower.begin(), ::tolower); + + if (colorToLower == "black") + return CefColorSetARGB(255, 0, 0, 0); + else if (colorToLower == "blue") + return CefColorSetARGB(255, 0, 0, 255); + else if (colorToLower == "green") + return CefColorSetARGB(255, 0, 255, 0); + else if (colorToLower == "red") + return CefColorSetARGB(255, 255, 0, 0); + else if (colorToLower == "white") + return CefColorSetARGB(255, 255, 255, 255); + + // Use the default color. + return 0U; +} + } // namespace MainContextImpl::MainContextImpl(CefRefPtr command_line, @@ -33,8 +54,8 @@ MainContextImpl::MainContextImpl(CefRefPtr command_line, if (command_line_->HasSwitch(switches::kBackgroundColor)) { // Parse the background color value. - CefParseCSSColor(command_line_->GetSwitchValue(switches::kBackgroundColor), - false, background_color_); + background_color_ = + ParseColor(command_line_->GetSwitchValue(switches::kBackgroundColor)); } } diff --git a/tests/unittests/geolocation_unittest.cc b/tests/unittests/geolocation_unittest.cc index d93a26793..9fe846e84 100644 --- a/tests/unittests/geolocation_unittest.cc +++ b/tests/unittests/geolocation_unittest.cc @@ -16,11 +16,12 @@ namespace { -const char* kTestOrigin = "http://tests/"; -const char* kTestUrl = "http://tests/GeolocationTestHandler"; -const char* kTestAllowUrl = "http://tests/GeolocationTestHandler.Allow"; -const char* kTestDenyUrl = "http://tests/GeolocationTestHandler.Deny"; -const char* kTestCancelUrl = "http://tests/GeolocationTestHandler.Cancel"; +// Geolocation access is now restricted to "secure" origins. +const char* kTestOrigin = "https://tests/"; +const char* kTestUrl = "https://tests/GeolocationTestHandler"; +const char* kTestAllowUrl = "https://tests/GeolocationTestHandler.Allow"; +const char* kTestDenyUrl = "https://tests/GeolocationTestHandler.Deny"; +const char* kTestCancelUrl = "https://tests/GeolocationTestHandler.Cancel"; enum TestMode { TEST_ALLOW, diff --git a/tests/unittests/os_rendering_unittest.cc b/tests/unittests/os_rendering_unittest.cc index d657e3eb0..cb5b0c458 100644 --- a/tests/unittests/os_rendering_unittest.cc +++ b/tests/unittests/os_rendering_unittest.cc @@ -88,7 +88,6 @@ const CefRect kSelectRect(461, 21, 87, 26); const CefRect kExpandedSelectRect(463, 42, 78, 286); const CefRect kDropDivRect(9, 330, 52, 52); const CefRect kDragDivRect(60, 330, 52, 52); -const int kVerticalScrollbarWidth = 15; #elif defined(OS_LINUX) const CefRect kEditBoxRect(434, 246, 60, 20); const CefRect kNavigateButtonRect(380, 271, 140, 22); @@ -537,11 +536,11 @@ class OSRTestHandler : public RoutingTestHandler, case OSR_TEST_RESIZE: if (StartTest()) { browser->GetHost()->WasResized(); - } else { + // There may be some partial repaints before the full repaint. + } else if (IsFullRepaint(dirtyRects[0], width, height)) { EXPECT_EQ(GetScaledInt(kOsrWidth) * 2, width); EXPECT_EQ(GetScaledInt(kOsrHeight) * 2, height); EXPECT_EQ(dirtyRects.size(), 1U); - EXPECT_TRUE(IsFullRepaint(dirtyRects[0], width, height)); DestroySucceededTestSoon(); } break; @@ -616,20 +615,11 @@ class OSRTestHandler : public RoutingTestHandler, browser->GetHost()->SendMouseWheelEvent(mouse_event, 0, - deltaY); } else { EXPECT_EQ(dirtyRects.size(), 1U); -#if defined(OS_MACOSX) - const CefRect& expected_rect1 = - GetScaledRect(CefRect(0, 0, kOsrWidth, kOsrHeight)); - const CefRect& expected_rect2 = - GetScaledRect(CefRect(0, 0, kOsrWidth - kVerticalScrollbarWidth, - kOsrHeight)); - EXPECT_TRUE(dirtyRects[0] == expected_rect1 || - dirtyRects[0] == expected_rect2); -#else const CefRect& expected_rect = GetScaledRect(CefRect(0, 0, kOsrWidth, kOsrHeight)); - EXPECT_EQ(expected_rect, dirtyRects[0]); -#endif - DestroySucceededTestSoon(); + // There may be some partial repaints before the full repaint. + if (dirtyRects[0] == expected_rect) + DestroySucceededTestSoon(); } break; } diff --git a/tests/unittests/parser_unittest.cc b/tests/unittests/parser_unittest.cc index 3d3a85621..1f485027b 100644 --- a/tests/unittests/parser_unittest.cc +++ b/tests/unittests/parser_unittest.cc @@ -303,42 +303,6 @@ TEST(ParserTest, URIDecode) { EXPECT_STREQ(test_str_decoded.c_str(), decoded_value.ToString().c_str()); } -TEST(ParserTest, ParseCSSColor) { - std::string value; - cef_color_t color; - - // Color by name. - value = "red"; - color = 0; - EXPECT_TRUE(CefParseCSSColor(value, false, color)); - EXPECT_EQ(CefColorSetARGB(255, 255, 0, 0), color); - - // Color by RGB. - value = "rgb(1,2,3)"; - color = 0; - EXPECT_TRUE(CefParseCSSColor(value, false, color)); - EXPECT_EQ(CefColorSetARGB(255, 1, 2, 3), color); - - // Color by RGBA. - value = "rgba(1,2,3,0.0)"; - color = 0; - EXPECT_TRUE(CefParseCSSColor(value, false, color)); - EXPECT_EQ(CefColorSetARGB(0, 1, 2, 3), color); - - // Color by hex code. - value = "#FFAACC"; - color = 0; - EXPECT_TRUE(CefParseCSSColor(value, false, color)); - EXPECT_EQ(CefColorSetARGB(255, 0xFF, 0xAA, 0xCC), color); - - // Invalid color. - value = "not_a_color"; - color = 0; - EXPECT_FALSE(CefParseCSSColor(value, false, color)); - EXPECT_EQ(0U, color); -} - - TEST(ParserTest, ParseJSONInvalid) { const char data[] = "This is my test data"; CefRefPtr value = CefParseJSON(data, JSON_PARSER_RFC);