From ab2636b012e2e5fc15ab5adfa18a4f0a7db2c5fc Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 24 May 2016 19:35:43 -0400 Subject: [PATCH] Update to Chromium revision 2b3ae3b8 (#394939) --- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- cef.gyp | 19 +-- include/base/cef_lock.h | 12 +- include/base/cef_macros.h | 2 + include/base/cef_scoped_ptr.h | 3 +- include/cef_sandbox_win.h | 2 +- include/wrapper/cef_resource_manager.h | 18 +-- include/wrapper/cef_stream_resource_handler.h | 2 +- libcef/browser/browser_context.cc | 16 +++ libcef/browser/browser_context.h | 5 + libcef/browser/browser_context_impl.cc | 25 +--- libcef/browser/browser_context_impl.h | 8 -- libcef/browser/browser_context_proxy.cc | 23 ---- libcef/browser/browser_context_proxy.h | 8 -- libcef/browser/browser_host_impl.cc | 2 +- libcef/browser/browser_info_manager.cc | 2 +- libcef/browser/browser_main.cc | 6 +- libcef/browser/browser_message_loop.cc | 5 +- .../browser_platform_delegate_create.cc | 21 ++-- libcef/browser/chrome_browser_process_stub.cc | 12 +- libcef/browser/chrome_browser_process_stub.h | 2 +- .../cef_component_updater_configurator.cc | 18 ++- .../cef_component_updater_configurator.h | 5 +- libcef/browser/content_browser_client.cc | 7 +- libcef/browser/context.cc | 6 +- libcef/browser/cookie_manager_impl.cc | 6 +- libcef/browser/devtools_frontend.cc | 10 +- libcef/browser/extensions/extension_system.cc | 2 +- .../extensions/extensions_api_client.cc | 5 +- .../media_capture_devices_dispatcher.cc | 8 ++ .../media_capture_devices_dispatcher.h | 6 +- .../browser_platform_delegate_native_linux.cc | 2 +- .../browser_platform_delegate_native_mac.mm | 7 +- .../browser_platform_delegate_native_win.cc | 13 +- libcef/browser/net/chrome_scheme_handler.cc | 4 +- libcef/browser/net/cookie_store_proxy.cc | 12 +- libcef/browser/net/cookie_store_proxy.h | 8 +- libcef/browser/net/scheme_handler.cc | 5 +- .../net/url_request_context_getter_impl.cc | 10 +- libcef/browser/net/url_request_manager.cc | 3 +- .../osr/render_widget_host_view_osr.cc | 37 ++++-- .../browser/osr/render_widget_host_view_osr.h | 6 +- .../osr/render_widget_host_view_osr_mac.mm | 11 +- .../plugins/plugin_info_message_filter.cc | 2 +- .../plugins/plugin_info_message_filter.h | 15 ++- libcef/browser/prefs/browser_prefs.cc | 2 + libcef/browser/prefs/browser_prefs.h | 2 +- libcef/browser/prefs/renderer_prefs.cc | 5 +- .../printing/print_view_manager_base.cc | 2 +- .../resource_dispatcher_host_delegate.cc | 15 +-- .../speech_recognition_manager_delegate.cc | 6 - .../speech_recognition_manager_delegate.h | 3 - libcef/browser/trace_subscriber.h | 1 - .../views/browser_platform_delegate_views.cc | 5 +- libcef/browser/views/display_impl.cc | 12 +- libcef/browser/views/display_impl.h | 8 +- libcef/browser/views/view_impl.h | 3 +- libcef/browser/views/view_util.cc | 29 +++-- libcef/browser/views/view_util.h | 13 +- libcef/browser/views/window_impl.cc | 6 +- libcef/browser/views/window_view.cc | 13 +- libcef/browser/views/window_view.h | 4 +- libcef/common/main_delegate.cc | 4 + libcef/common/main_delegate.h | 1 - libcef/common/request_impl.cc | 8 +- libcef/common/task_runner_impl.cc | 2 +- libcef/common/value_base.h | 1 - libcef/renderer/content_renderer_client.cc | 14 +-- libcef/renderer/content_renderer_client.h | 12 +- libcef/renderer/dom_node_impl.cc | 5 +- .../extensions/extensions_renderer_client.cc | 4 +- .../extensions/extensions_renderer_client.h | 2 +- libcef/renderer/media/cef_key_systems.cc | 27 ++-- libcef/renderer/media/cef_key_systems.h | 10 +- .../plugins/cef_plugin_placeholder.cc | 28 ++++- .../renderer/plugins/cef_plugin_placeholder.h | 13 +- libcef/renderer/render_frame_observer.cc | 1 - ..._observer.cc => render_thread_observer.cc} | 20 +-- ...ss_observer.h => render_thread_observer.h} | 18 +-- libcef/renderer/v8_impl.cc | 1 - libcef/renderer/webkit_glue.cc | 1 - libcef/utility/content_utility_client.cc | 17 +-- libcef/utility/content_utility_client.h | 3 - libcef_dll/base/cef_lock.cc | 2 + libcef_dll/sandbox/sandbox_win.cc | 3 - libcef_dll/wrapper/cef_resource_manager.cc | 22 ++-- .../wrapper/cef_stream_resource_handler.cc | 2 +- libcef_dll/wrapper/cef_zip_archive.cc | 2 +- patch/patch.cfg | 13 -- .../browser_frame_host_guest_1687.patch | 4 +- patch/patches/browser_plugin_guest_1565.patch | 6 +- patch/patches/browser_web_contents_1257.patch | 53 ++++---- patch/patches/build.patch | 4 +- patch/patches/chrome_browser_1257.patch | 8 +- patch/patches/chrome_pepper_flash_1586.patch | 20 --- patch/patches/compositor_1368.patch | 26 ++-- patch/patches/content_nav_1129.patch | 10 +- patch/patches/extensions_1257.patch | 6 +- patch/patches/gritsettings.patch | 2 +- patch/patches/gyp_331.patch | 2 +- patch/patches/ime_1610.patch | 4 +- patch/patches/message_loop_443.patch | 4 +- patch/patches/mime_handler_view_1565.patch | 4 +- patch/patches/net_filter_515.patch | 10 +- patch/patches/net_urlrequest_1327.patch | 4 +- patch/patches/pdfium_print_549365.patch | 10 +- patch/patches/prefs_content_1161.patch | 16 +-- .../print_header_footer_1478_1565.patch | 14 +-- patch/patches/public_browser_1257.patch | 10 +- .../patches/render_view_host_impl_1392.patch | 2 +- .../render_widget_host_1070383005.patch | 4 +- .../renderer_preferences_util_545103.patch | 6 +- patch/patches/stream_context_1710.patch | 8 +- patch/patches/ui_webview_1257.patch | 4 +- patch/patches/views_1749.patch | 6 +- .../views_widget_180_1481_1677_1749.patch | 116 +++++++++--------- patch/patches/webcursor_1894.patch | 20 --- patch/patches/webkit_popups.patch | 20 +-- .../browser/main_message_loop_external_pump.h | 2 +- .../main_message_loop_external_pump_linux.cc | 6 +- .../main_message_loop_external_pump_mac.mm | 4 +- .../main_message_loop_external_pump_win.cc | 4 +- tests/unittests/frame_unittest.cc | 1 - tests/unittests/os_rendering_unittest.cc | 38 ------ tests/unittests/views/window_unittest.cc | 19 ++- 125 files changed, 619 insertions(+), 626 deletions(-) rename libcef/renderer/{render_process_observer.cc => render_thread_observer.cc} (77%) rename libcef/renderer/{render_process_observer.h => render_thread_observer.h} (66%) delete mode 100644 patch/patches/chrome_pepper_flash_1586.patch delete mode 100644 patch/patches/webcursor_1894.patch diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 26901f6dc..0e13859a3 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': '6e53600def8f60d8c632fadc70d7c1939ccea347', + 'chromium_checkout': '2b3ae3b8090361f8af5a611712fc1a5ab2de53cb', } diff --git a/cef.gyp b/cef.gyp index daf044e08..c715bb97a 100644 --- a/cef.gyp +++ b/cef.gyp @@ -149,6 +149,7 @@ # Modify the Info.plist as needed. 'postbuild_name': 'Tweak Info.plist', 'action': ['../build/mac/tweak_info_plist.py', + '--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}', '--scm=1'], }, ], @@ -317,6 +318,7 @@ # Modify the Info.plist as needed. 'postbuild_name': 'Tweak Info.plist', 'action': ['../build/mac/tweak_info_plist.py', + '--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}', '--scm=1'], }, ], @@ -542,6 +544,7 @@ # Modify the Info.plist as needed. 'postbuild_name': 'Tweak Info.plist', 'action': ['../build/mac/tweak_info_plist.py', + '--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}', '--scm=1'], }, ], @@ -1014,6 +1017,7 @@ '<(DEPTH)/skia/skia.gyp:skia', '<(DEPTH)/storage/storage_browser.gyp:storage', '<(DEPTH)/sync/sync.gyp:sync', + '<(DEPTH)/third_party/cld_2/cld_2.gyp:cld2_platform_impl', '<(DEPTH)/third_party/hunspell/hunspell.gyp:hunspell', '<(DEPTH)/third_party/libxml/libxml.gyp:libxml', '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink', @@ -1024,7 +1028,7 @@ '<(DEPTH)/ui/gl/gl.gyp:gl', '<(DEPTH)/ui/base/ime/ui_base_ime.gyp:ui_base_ime', '<(DEPTH)/ui/base/ui_base.gyp:ui_base', - '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', + '<(DEPTH)/v8/src/v8.gyp:v8', # Necessary to generate the grit include files. 'cef_pak', # Necessary to generate API bindings for extensions. @@ -1328,8 +1332,8 @@ 'libcef/renderer/render_frame_observer.h', 'libcef/renderer/render_message_filter.cc', 'libcef/renderer/render_message_filter.h', - 'libcef/renderer/render_process_observer.cc', - 'libcef/renderer/render_process_observer.h', + 'libcef/renderer/render_thread_observer.cc', + 'libcef/renderer/render_thread_observer.h', 'libcef/renderer/render_urlrequest_impl.cc', 'libcef/renderer/render_urlrequest_impl.h', 'libcef/renderer/thread_util.h', @@ -1582,11 +1586,6 @@ '<(DEPTH)/components/components.gyp:breakpad_host', ], }], - ['cld_version==2', { - 'dependencies': [ - '<(DEPTH)/third_party/cld_2/cld_2.gyp:cld2_platform_impl', - ], - }], ['use_aura==1', { 'dependencies': [ '<(DEPTH)/ui/views/controls/webview/webview.gyp:webview', @@ -1763,6 +1762,7 @@ # but this seems like a really good place to store them. 'postbuild_name': 'Tweak Info.plist', 'action': ['../build/mac/tweak_info_plist.py', + '--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}', '--breakpad=1', '--keystone=0', '--scm=1', @@ -1846,6 +1846,7 @@ # never placed into the helper. 'postbuild_name': 'Tweak Info.plist', 'action': ['../build/mac/tweak_info_plist.py', + '--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}', '--breakpad=0', '--keystone=0', '--scm=0'], @@ -1917,6 +1918,7 @@ # never placed into the helper. 'postbuild_name': 'Tweak Info.plist', 'action': ['../build/mac/tweak_info_plist.py', + '--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}', '--breakpad=0', '--keystone=0', '--scm=0'], @@ -2024,6 +2026,7 @@ # never placed into the helper. 'postbuild_name': 'Tweak Info.plist', 'action': ['../build/mac/tweak_info_plist.py', + '--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}', '--breakpad=0', '--keystone=0', '--scm=0'], diff --git a/include/base/cef_lock.h b/include/base/cef_lock.h index 230bf419b..410b42e89 100644 --- a/include/base/cef_lock.h +++ b/include/base/cef_lock.h @@ -50,6 +50,7 @@ #include "include/base/internal/cef_lock_impl.h" namespace base { +namespace cef_internal { // A convenient wrapper for an OS specific critical section. The only real // intelligence in this class is in debug mode for the support for the @@ -113,7 +114,7 @@ class Lock { #endif // NDEBUG // Platform specific underlying lock implementation. - cef_internal::LockImpl lock_; + LockImpl lock_; DISALLOW_COPY_AND_ASSIGN(Lock); }; @@ -160,6 +161,15 @@ class AutoUnlock { DISALLOW_COPY_AND_ASSIGN(AutoUnlock); }; +} // namespace cef_internal + +// Implement classes in the cef_internal namespace and then expose them to the +// base namespace. This avoids conflicts with the base.lib implementation when +// linking sandbox support on Windows. +using cef_internal::Lock; +using cef_internal::AutoLock; +using cef_internal::AutoUnlock; + } // namespace base #endif // !USING_CHROMIUM_INCLUDES diff --git a/include/base/cef_macros.h b/include/base/cef_macros.h index 6c74d2036..59c020295 100644 --- a/include/base/cef_macros.h +++ b/include/base/cef_macros.h @@ -40,6 +40,7 @@ #define MOVE_SCOPED_PTR(var) std::move(var) // Chromium uses std types. +#define SCOPED_PTR(type) std::unique_ptr #define DEFAULT_DELETER(type) std::default_delete #else // !USING_CHROMIUM_INCLUDES @@ -54,6 +55,7 @@ #define MOVE_SCOPED_PTR(var) var.Pass() // CEF uses base types. +#define SCOPED_PTR(type) scoped_ptr #define DEFAULT_DELETER(type) struct base::DefaultDeleter #if !defined(arraysize) diff --git a/include/base/cef_scoped_ptr.h b/include/base/cef_scoped_ptr.h index 0bca79286..563558979 100644 --- a/include/base/cef_scoped_ptr.h +++ b/include/base/cef_scoped_ptr.h @@ -120,8 +120,7 @@ // client application. When using Chromium code directly always include // the Chromium header first to avoid type conflicts. #elif defined(USING_CHROMIUM_INCLUDES) -// When building CEF include the Chromium header directly. -#include "base/memory/scoped_ptr.h" +// Do nothing when building CEF. #else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be diff --git a/include/cef_sandbox_win.h b/include/cef_sandbox_win.h index 9b6c48b09..04444b49f 100644 --- a/include/cef_sandbox_win.h +++ b/include/cef_sandbox_win.h @@ -31,7 +31,7 @@ #define CEF_INCLUDE_CEF_SANDBOX_WIN_H_ #pragma once -#include "include/cef_base.h" +#include "include/base/cef_build.h" #if defined(OS_WIN) diff --git a/include/wrapper/cef_resource_manager.h b/include/wrapper/cef_resource_manager.h index 9ab8afad0..a69b0322b 100644 --- a/include/wrapper/cef_resource_manager.h +++ b/include/wrapper/cef_resource_manager.h @@ -159,18 +159,18 @@ class CefResourceManager : // The below methods are called on the browser process IO thread. - explicit Request(scoped_ptr state); + explicit Request(SCOPED_PTR(RequestState) state); - scoped_ptr SendRequest(); + SCOPED_PTR(RequestState) SendRequest(); bool HasState(); - static void ContinueOnIOThread(scoped_ptr state, + static void ContinueOnIOThread(SCOPED_PTR(RequestState) state, CefRefPtr handler); - static void StopOnIOThread(scoped_ptr state); + static void StopOnIOThread(SCOPED_PTR(RequestState) state); // Will be non-NULL while the request is pending. Only accessed on the // browser process IO thread. - scoped_ptr state_; + SCOPED_PTR(RequestState) state_; // Params that stay with this request object. Safe to access on any thread. RequestParams params_; @@ -343,10 +343,10 @@ class CefResourceManager : // Methods that manage request state between requests. Called on the browser // process IO thread. - bool SendRequest(scoped_ptr state); - void ContinueRequest(scoped_ptr state, + bool SendRequest(SCOPED_PTR(RequestState) state); + void ContinueRequest(SCOPED_PTR(RequestState) state, CefRefPtr handler); - void StopRequest(scoped_ptr state); + void StopRequest(SCOPED_PTR(RequestState) state); bool IncrementProvider(RequestState* state); void DetachRequestFromProvider(RequestState* state); void GetNextValidProvider(ProviderEntryList::iterator& iterator); @@ -365,7 +365,7 @@ class CefResourceManager : MimeTypeResolver mime_type_resolver_; // Must be the last member. Created and accessed on the IO thread. - scoped_ptr > weak_ptr_factory_; + SCOPED_PTR(base::WeakPtrFactory) weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(CefResourceManager); }; diff --git a/include/wrapper/cef_stream_resource_handler.h b/include/wrapper/cef_stream_resource_handler.h index 6a9a69814..c442dfe0e 100644 --- a/include/wrapper/cef_stream_resource_handler.h +++ b/include/wrapper/cef_stream_resource_handler.h @@ -90,7 +90,7 @@ class CefStreamResourceHandler : public CefResourceHandler { bool read_on_file_thread_; class Buffer; - scoped_ptr buffer_; + SCOPED_PTR(Buffer) buffer_; #ifndef NDEBUG // Used in debug builds to verify that |buffer_| isn't being accessed on // multiple threads at the same time. diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index 16d9da43e..8372191ec 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -102,6 +102,22 @@ content::ResourceContext* CefBrowserContext::GetResourceContext() { return resource_context_.get(); } +net::URLRequestContextGetter* CefBrowserContext::GetRequestContext() { + CEF_REQUIRE_UIT(); + return GetDefaultStoragePartition(this)->GetURLRequestContext(); +} + +net::URLRequestContextGetter* CefBrowserContext::CreateMediaRequestContext() { + return GetRequestContext(); +} + +net::URLRequestContextGetter* + CefBrowserContext::CreateMediaRequestContextForStoragePartition( + const base::FilePath& partition_path, + bool in_memory) { + return nullptr; +} + ChromeZoomLevelPrefs* CefBrowserContext::GetZoomLevelPrefs() { return static_cast( GetStoragePartition(this, NULL)->GetZoomLevelDelegate()); diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index 441e3249f..2220c8fd8 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -127,6 +127,11 @@ class CefBrowserContext // BrowserContext methods. content::ResourceContext* GetResourceContext() override; + net::URLRequestContextGetter* GetRequestContext() override; + net::URLRequestContextGetter* CreateMediaRequestContext() override; + net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition( + const base::FilePath& partition_path, + bool in_memory) override; // Profile methods. ChromeZoomLevelPrefs* GetZoomLevelPrefs() override; diff --git a/libcef/browser/browser_context_impl.cc b/libcef/browser/browser_context_impl.cc index 6f0271227..8b12d7463 100644 --- a/libcef/browser/browser_context_impl.cc +++ b/libcef/browser/browser_context_impl.cc @@ -339,7 +339,7 @@ std::unique_ptr if (cache_path_.empty()) return std::unique_ptr(); - return make_scoped_ptr(new ChromeZoomLevelPrefs( + return base::WrapUnique(new ChromeZoomLevelPrefs( GetPrefs(), cache_path_, partition_path, ui_zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr())); } @@ -357,29 +357,6 @@ content::DownloadManagerDelegate* return download_manager_delegate_.get(); } -net::URLRequestContextGetter* CefBrowserContextImpl::GetRequestContext() { - CEF_REQUIRE_UIT(); - return GetDefaultStoragePartition(this)->GetURLRequestContext(); -} - -net::URLRequestContextGetter* - CefBrowserContextImpl::GetMediaRequestContext() { - return GetRequestContext(); -} - -net::URLRequestContextGetter* - CefBrowserContextImpl::GetMediaRequestContextForRenderProcess( - int renderer_child_id) { - return GetRequestContext(); -} - -net::URLRequestContextGetter* - CefBrowserContextImpl::GetMediaRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory) { - return GetRequestContext(); -} - content::BrowserPluginGuestManager* CefBrowserContextImpl::GetGuestManager() { DCHECK(extensions::ExtensionsEnabled()); return guest_view::GuestViewManager::FromBrowserContext(this); diff --git a/libcef/browser/browser_context_impl.h b/libcef/browser/browser_context_impl.h index da3bf13d0..c539129e7 100644 --- a/libcef/browser/browser_context_impl.h +++ b/libcef/browser/browser_context_impl.h @@ -59,14 +59,6 @@ class CefBrowserContextImpl : public CefBrowserContext, const base::FilePath& partition_path) override; bool IsOffTheRecord() const override; content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; - net::URLRequestContextGetter* GetRequestContext() override; - net::URLRequestContextGetter* GetMediaRequestContext() override; - net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( - int renderer_child_id) override; - net::URLRequestContextGetter* - GetMediaRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory) override; content::BrowserPluginGuestManager* GetGuestManager() override; storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; content::PushMessagingService* GetPushMessagingService() override; diff --git a/libcef/browser/browser_context_proxy.cc b/libcef/browser/browser_context_proxy.cc index e7d882f91..314c6a8b2 100644 --- a/libcef/browser/browser_context_proxy.cc +++ b/libcef/browser/browser_context_proxy.cc @@ -101,29 +101,6 @@ content::DownloadManagerDelegate* return download_manager_delegate_.get(); } -net::URLRequestContextGetter* CefBrowserContextProxy::GetRequestContext() { - CEF_REQUIRE_UIT(); - return GetDefaultStoragePartition(this)->GetURLRequestContext(); -} - -net::URLRequestContextGetter* - CefBrowserContextProxy::GetMediaRequestContext() { - return GetRequestContext(); -} - -net::URLRequestContextGetter* - CefBrowserContextProxy::GetMediaRequestContextForRenderProcess( - int renderer_child_id) { - return GetRequestContext(); -} - -net::URLRequestContextGetter* - CefBrowserContextProxy::GetMediaRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory) { - return GetRequestContext(); -} - content::BrowserPluginGuestManager* CefBrowserContextProxy::GetGuestManager() { return parent_->GetGuestManager(); } diff --git a/libcef/browser/browser_context_proxy.h b/libcef/browser/browser_context_proxy.h index 6850e73fd..d5fcfdf40 100644 --- a/libcef/browser/browser_context_proxy.h +++ b/libcef/browser/browser_context_proxy.h @@ -34,14 +34,6 @@ class CefBrowserContextProxy : public CefBrowserContext { const base::FilePath& partition_path) override; bool IsOffTheRecord() const override; content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; - net::URLRequestContextGetter* GetRequestContext() override; - net::URLRequestContextGetter* GetMediaRequestContext() override; - net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( - int renderer_child_id) override; - net::URLRequestContextGetter* - GetMediaRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory) override; content::BrowserPluginGuestManager* GetGuestManager() override; storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; content::PushMessagingService* GetPushMessagingService() override; diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 9e62c93df..754c2ae27 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -556,7 +556,7 @@ void CefBrowserHostImpl::CloseBrowser(bool force_close) { if (contents && contents->NeedToFireBeforeUnload()) { // Will result in a call to BeforeUnloadFired() and, if the close isn't // canceled, CloseContents(). - contents->DispatchBeforeUnload(false); + contents->DispatchBeforeUnload(); } else { CloseContents(contents); } diff --git a/libcef/browser/browser_info_manager.cc b/libcef/browser/browser_info_manager.cc index f5a195a45..f4db53785 100644 --- a/libcef/browser/browser_info_manager.cc +++ b/libcef/browser/browser_info_manager.cc @@ -488,7 +488,7 @@ std::unique_ptr popup->opener_view_id == opener_view_id && popup->target_url == target_url) { pending_popup_list_.weak_erase(it); - return make_scoped_ptr(popup); + return base::WrapUnique(popup); } } diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index beea5b01d..bda35cb59 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -39,7 +39,7 @@ #if defined(USE_AURA) #include "ui/aura/env.h" -#include "ui/gfx/screen.h" +#include "ui/display/screen.h" #include "ui/views/test/desktop_test_views_delegate.h" #include "ui/views/widget/desktop_aura/desktop_screen.h" @@ -120,7 +120,7 @@ int CefBrowserMainParts::PreCreateThreads() { content::GpuDataManager::GetInstance(); #if defined(USE_AURA) - gfx::Screen::SetScreenInstance(views::CreateDesktopScreen()); + display::Screen::SetScreenInstance(views::CreateDesktopScreen()); #endif return 0; @@ -187,8 +187,6 @@ void CefBrowserMainParts::PostMainMessageLoopRun() { void CefBrowserMainParts::PostDestroyThreads() { #if defined(USE_AURA) - aura::Env::DeleteInstance(); - // Delete the DesktopTestViewsDelegate. delete views::ViewsDelegate::GetInstance(); #endif diff --git a/libcef/browser/browser_message_loop.cc b/libcef/browser/browser_message_loop.cc index 58c8f82ee..d0bf7c089 100644 --- a/libcef/browser/browser_message_loop.cc +++ b/libcef/browser/browser_message_loop.cc @@ -6,6 +6,7 @@ #include "libcef/browser/context.h" #include "libcef/common/content_client.h" +#include "base/memory/ptr_util.h" #include "base/run_loop.h" #if defined(OS_MACOSX) @@ -87,12 +88,12 @@ CefRefPtr GetBrowserProcessHandler() { return nullptr; } -scoped_ptr CreatePump() { +std::unique_ptr CreatePump() { const CefSettings& settings = CefContext::Get()->settings(); if (settings.external_message_pump) { CefRefPtr handler = GetBrowserProcessHandler(); if (handler) - return make_scoped_ptr(new MessagePumpExternal(0.01f, handler)); + return base::WrapUnique(new MessagePumpExternal(0.01f, handler)); } return base::MessageLoop::CreateMessagePumpForType( diff --git a/libcef/browser/browser_platform_delegate_create.cc b/libcef/browser/browser_platform_delegate_create.cc index 821c08ea8..68ce205f8 100644 --- a/libcef/browser/browser_platform_delegate_create.cc +++ b/libcef/browser/browser_platform_delegate_create.cc @@ -6,6 +6,7 @@ #include +#include "base/memory/ptr_util.h" #include "build/build_config.h" #if defined(OS_WIN) @@ -30,11 +31,11 @@ namespace { std::unique_ptr CreateNativeDelegate( const CefWindowInfo& window_info) { #if defined(OS_WIN) - return make_scoped_ptr(new CefBrowserPlatformDelegateNativeWin(window_info)); + return base::WrapUnique(new CefBrowserPlatformDelegateNativeWin(window_info)); #elif defined(OS_MACOSX) - return make_scoped_ptr(new CefBrowserPlatformDelegateNativeMac(window_info)); + return base::WrapUnique(new CefBrowserPlatformDelegateNativeMac(window_info)); #elif defined(OS_LINUX) - return make_scoped_ptr( + return base::WrapUnique( new CefBrowserPlatformDelegateNativeLinux(window_info)); #endif } @@ -42,14 +43,14 @@ std::unique_ptr CreateNativeDelegate( std::unique_ptr CreateOSRDelegate( std::unique_ptr native_delegate) { #if defined(OS_WIN) - return make_scoped_ptr( - new CefBrowserPlatformDelegateOsrWin(std::move(native_delegate))); + return base::WrapUnique( + new CefBrowserPlatformDelegateOsrWin(std::move(native_delegate))); #elif defined(OS_MACOSX) - return make_scoped_ptr( - new CefBrowserPlatformDelegateOsrMac(std::move(native_delegate))); + return base::WrapUnique( + new CefBrowserPlatformDelegateOsrMac(std::move(native_delegate))); #elif defined(OS_LINUX) - return make_scoped_ptr( - new CefBrowserPlatformDelegateOsrLinux(std::move(native_delegate))); + return base::WrapUnique( + new CefBrowserPlatformDelegateOsrLinux(std::move(native_delegate))); #endif } @@ -73,7 +74,7 @@ std::unique_ptr CefBrowserPlatformDelegate::Create( // CefWindowInfo is not used in this case. std::unique_ptr native_delegate = CreateNativeDelegate(CefWindowInfo()); - return make_scoped_ptr(new CefBrowserPlatformDelegateViews( + return base::WrapUnique(new CefBrowserPlatformDelegateViews( std::move(native_delegate), static_cast(create_params.browser_view.get()))); } diff --git a/libcef/browser/chrome_browser_process_stub.cc b/libcef/browser/chrome_browser_process_stub.cc index 60bd82a82..03c594891 100644 --- a/libcef/browser/chrome_browser_process_stub.cc +++ b/libcef/browser/chrome_browser_process_stub.cc @@ -72,12 +72,6 @@ variations::VariationsService* return NULL; } -web_resource::PromoResourceService* -ChromeBrowserProcessStub::promo_resource_service() { - NOTIMPLEMENTED(); - return NULL; -} - BrowserProcessPlatformPart* ChromeBrowserProcessStub::platform_part() { NOTIMPLEMENTED(); return NULL; @@ -94,6 +88,12 @@ NotificationUIManager* ChromeBrowserProcessStub::notification_ui_manager() { return NULL; } +NotificationPlatformBridge* + ChromeBrowserProcessStub::notification_platform_bridge() { + NOTIMPLEMENTED(); + return NULL; +} + message_center::MessageCenter* ChromeBrowserProcessStub::message_center() { NOTIMPLEMENTED(); return NULL; diff --git a/libcef/browser/chrome_browser_process_stub.h b/libcef/browser/chrome_browser_process_stub.h index 167045970..d7d7d4a21 100644 --- a/libcef/browser/chrome_browser_process_stub.h +++ b/libcef/browser/chrome_browser_process_stub.h @@ -40,11 +40,11 @@ class ChromeBrowserProcessStub : public BrowserProcess { PrefService* local_state() override; net::URLRequestContextGetter* system_request_context() override; variations::VariationsService* variations_service() override; - web_resource::PromoResourceService* promo_resource_service() override; BrowserProcessPlatformPart* platform_part() override; extensions::EventRouterForwarder* extension_event_router_forwarder() override; NotificationUIManager* notification_ui_manager() override; + NotificationPlatformBridge* notification_platform_bridge() override; message_center::MessageCenter* message_center() override; policy::BrowserPolicyConnector* browser_policy_connector() override; policy::PolicyService* policy_service() override; diff --git a/libcef/browser/component_updater/cef_component_updater_configurator.cc b/libcef/browser/component_updater/cef_component_updater_configurator.cc index e7593c20a..e0aef6400 100644 --- a/libcef/browser/component_updater/cef_component_updater_configurator.cc +++ b/libcef/browser/component_updater/cef_component_updater_configurator.cc @@ -92,7 +92,8 @@ std::string GetSwitchArgument(const std::vector& vec, class CefConfigurator : public Configurator { public: CefConfigurator(const base::CommandLine* cmdline, - net::URLRequestContextGetter* url_request_getter); + net::URLRequestContextGetter* url_request_getter, + PrefService* pref_service); int InitialDelay() const override; int NextCheckDelay() const override; @@ -116,6 +117,7 @@ class CefConfigurator : public Configurator { bool UseCupSigning() const override; scoped_refptr GetSequencedTaskRunner() const override; + PrefService* GetPrefService() const override; private: friend class base::RefCountedThreadSafe; @@ -123,6 +125,7 @@ class CefConfigurator : public Configurator { ~CefConfigurator() override {} net::URLRequestContextGetter* url_request_getter_; + PrefService* pref_service_; std::string extra_info_; GURL url_source_override_; bool fast_update_; @@ -133,8 +136,10 @@ class CefConfigurator : public Configurator { CefConfigurator::CefConfigurator( const base::CommandLine* cmdline, - net::URLRequestContextGetter* url_request_getter) + net::URLRequestContextGetter* url_request_getter, + PrefService* pref_service) : url_request_getter_(url_request_getter), + pref_service_(pref_service), fast_update_(false), pings_enabled_(false), deltas_enabled_(false), @@ -282,13 +287,18 @@ CefConfigurator::GetSequencedTaskRunner() const { base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); } +PrefService* CefConfigurator::GetPrefService() const { + return pref_service_; +} + } // namespace scoped_refptr MakeCefComponentUpdaterConfigurator( const base::CommandLine* cmdline, - net::URLRequestContextGetter* context_getter) { - return new CefConfigurator(cmdline, context_getter); + net::URLRequestContextGetter* context_getter, + PrefService* pref_service) { + return new CefConfigurator(cmdline, context_getter, pref_service); } } // namespace component_updater diff --git a/libcef/browser/component_updater/cef_component_updater_configurator.h b/libcef/browser/component_updater/cef_component_updater_configurator.h index 400d45aaa..353dc67d2 100644 --- a/libcef/browser/component_updater/cef_component_updater_configurator.h +++ b/libcef/browser/component_updater/cef_component_updater_configurator.h @@ -16,12 +16,15 @@ namespace net { class URLRequestContextGetter; } +class PrefService; + namespace component_updater { scoped_refptr MakeCefComponentUpdaterConfigurator( const base::CommandLine* cmdline, - net::URLRequestContextGetter* context_getter); + net::URLRequestContextGetter* context_getter, + PrefService* pref_service); } // namespace component_updater diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 87992007f..5b24140d9 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -823,12 +823,7 @@ const wchar_t* CefContentBrowserClient::GetResourceDllName() { bool CefContentBrowserClient::PreSpawnRenderer( sandbox::TargetPolicy* policy) { - // Flash requires this permission to play video files. - sandbox::ResultCode result = policy->AddRule( - sandbox::TargetPolicy::SUBSYS_HANDLES, - sandbox::TargetPolicy::HANDLES_DUP_ANY, - L"File"); - return result == sandbox::SBOX_ALL_OK; + return true; } #endif // defined(OS_WIN) diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc index e46223195..c9e4dd2e0 100644 --- a/libcef/browser/context.cc +++ b/libcef/browser/context.cc @@ -363,11 +363,13 @@ component_updater::ComponentUpdateService* CefContext::component_updater() { if (!component_updater_.get()) { CEF_REQUIRE_UIT_RETURN(NULL); + scoped_refptr browser_context = + CefContentBrowserClient::Get()->browser_context(); scoped_refptr configurator = component_updater::MakeCefComponentUpdaterConfigurator( base::CommandLine::ForCurrentProcess(), - CefContentBrowserClient::Get()->browser_context()-> - request_context().get()); + browser_context->request_context().get(), + browser_context->GetPrefs()); // Creating the component updater does not do anything, components // need to be registered and Start() needs to be called. component_updater_.reset(component_updater::ComponentUpdateServiceFactory( diff --git a/libcef/browser/cookie_manager_impl.cc b/libcef/browser/cookie_manager_impl.cc index c4b0aad2e..e6959e5be 100644 --- a/libcef/browser/cookie_manager_impl.cc +++ b/libcef/browser/cookie_manager_impl.cc @@ -18,6 +18,7 @@ #include "base/format_macros.h" #include "base/logging.h" #include "base/threading/thread_restrictions.h" +#include "content/browser/storage_partition_impl.h" #include "net/cookies/cookie_util.h" #include "net/cookies/parsed_cookie.h" #include "net/extras/sqlite/sqlite_persistent_cookie_store.h" @@ -608,8 +609,9 @@ void CefCookieManagerImpl::DeleteCookiesInternal( base::Bind(DeleteCookiesCallbackImpl, callback)); } else if (cookie_name.empty()) { // Delete all matching host cookies. - cookie_store->DeleteAllCreatedBetweenForHostAsync( - base::Time(), base::Time::Max(), url, + cookie_store->DeleteAllCreatedBetweenWithPredicateAsync( + base::Time(), base::Time::Max(), + content::StoragePartitionImpl::CreatePredicateForHostCookies(url), base::Bind(DeleteCookiesCallbackImpl, callback)); } else { // Delete all matching host and domain cookies. diff --git a/libcef/browser/devtools_frontend.cc b/libcef/browser/devtools_frontend.cc index 3a176b147..7af2b7e2b 100644 --- a/libcef/browser/devtools_frontend.cc +++ b/libcef/browser/devtools_frontend.cc @@ -12,6 +12,7 @@ #include "base/command_line.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" +#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -19,6 +20,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_view_host.h" +#include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_client.h" #include "ipc/ipc_channel.h" @@ -261,10 +263,12 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( net::URLFetcher* fetcher = net::URLFetcher::Create(gurl, net::URLFetcher::GET, this).release(); pending_requests_[fetcher] = request_id; - fetcher->SetRequestContext(web_contents()->GetBrowserContext()-> - GetRequestContext()); + fetcher->SetRequestContext( + content::BrowserContext::GetDefaultStoragePartition( + web_contents()->GetBrowserContext())-> + GetURLRequestContext()); fetcher->SetExtraRequestHeaders(headers); - fetcher->SaveResponseWithWriter(std::unique_ptr( + fetcher->SaveResponseWithWriter(base::WrapUnique( new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); fetcher->Start(); return; diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index 3ebfc2e6c..555285ade 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -263,7 +263,7 @@ ContentVerifier* CefExtensionSystem::content_verifier() { std::unique_ptr CefExtensionSystem::GetDependentExtensions( const Extension* extension) { - return make_scoped_ptr(new ExtensionSet()); + return base::WrapUnique(new ExtensionSet()); } void CefExtensionSystem::InstallUpdate(const std::string& extension_id, diff --git a/libcef/browser/extensions/extensions_api_client.cc b/libcef/browser/extensions/extensions_api_client.cc index 9a56d92f3..2c214b998 100644 --- a/libcef/browser/extensions/extensions_api_client.cc +++ b/libcef/browser/extensions/extensions_api_client.cc @@ -12,6 +12,7 @@ #include "libcef/browser/extensions/pdf_web_contents_helper_client.h" #include "libcef/browser/printing/print_view_manager.h" +#include "base/memory/ptr_util.h" #include "chrome/browser/ui/prefs/prefs_tab_helper.h" #include "components/pdf/browser/pdf_web_contents_helper.h" #include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h" @@ -39,7 +40,7 @@ CefExtensionsAPIClient::CreateGuestViewManagerDelegate( // to provide the *Impl object instead of |context| which may be a *Proxy // object. If we don't do this then the Delegate may attempt to access a // *Proxy object that has already been deleted. - return make_scoped_ptr( + return base::WrapUnique( new extensions::ExtensionsGuestViewManagerDelegate( CefBrowserContextImpl::GetForContext(context).get())); } @@ -47,7 +48,7 @@ CefExtensionsAPIClient::CreateGuestViewManagerDelegate( std::unique_ptr CefExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate( MimeHandlerViewGuest* guest) const { - return make_scoped_ptr(new CefMimeHandlerViewGuestDelegate(guest)); + return base::WrapUnique(new CefMimeHandlerViewGuestDelegate(guest)); } void CefExtensionsAPIClient::AttachWebContentsHelpers( diff --git a/libcef/browser/media_capture_devices_dispatcher.cc b/libcef/browser/media_capture_devices_dispatcher.cc index eac5cfeaa..39ea5364e 100644 --- a/libcef/browser/media_capture_devices_dispatcher.cc +++ b/libcef/browser/media_capture_devices_dispatcher.cc @@ -115,6 +115,14 @@ void CefMediaCaptureDevicesDispatcher::OnCreatingAudioStream( int render_view_id) { } +void CefMediaCaptureDevicesDispatcher::OnSetCapturingLinkSecured( + int render_process_id, + int render_frame_id, + int page_request_id, + content::MediaStreamType stream_type, + bool is_secure) { +} + const MediaStreamDevices& CefMediaCaptureDevicesDispatcher::GetAudioCaptureDevices() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); diff --git a/libcef/browser/media_capture_devices_dispatcher.h b/libcef/browser/media_capture_devices_dispatcher.h index e67427634..729f8fe2b 100644 --- a/libcef/browser/media_capture_devices_dispatcher.h +++ b/libcef/browser/media_capture_devices_dispatcher.h @@ -6,7 +6,6 @@ #define CEF_LIBCEF_BROWSER_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ #include "base/callback.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/observer_list.h" #include "content/public/browser/media_observer.h" @@ -53,6 +52,11 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { content::MediaRequestState state) override; void OnCreatingAudioStream(int render_process_id, int render_view_id) override; + void OnSetCapturingLinkSecured(int render_process_id, + int render_frame_id, + int page_request_id, + content::MediaStreamType stream_type, + bool is_secure) override; private: friend struct base::DefaultSingletonTraits; diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index d16ff6f28..5f81b7284 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -369,7 +369,7 @@ CefEventHandle CefBrowserPlatformDelegateNativeLinux::GetEventHandle( std::unique_ptr CefBrowserPlatformDelegateNativeLinux::CreateMenuRunner() { - return make_scoped_ptr(new CefMenuRunnerLinux); + return base::WrapUnique(new CefMenuRunnerLinux); } void CefBrowserPlatformDelegateNativeLinux::TranslateMouseEvent( diff --git a/libcef/browser/native/browser_platform_delegate_native_mac.mm b/libcef/browser/native/browser_platform_delegate_native_mac.mm index bf897bcea..1aadb9b8b 100644 --- a/libcef/browser/native/browser_platform_delegate_native_mac.mm +++ b/libcef/browser/native/browser_platform_delegate_native_mac.mm @@ -15,6 +15,7 @@ #include "libcef/browser/thread_util.h" #include "base/mac/scoped_nsautorelease_pool.h" +#include "base/memory/ptr_util.h" #include "base/threading/thread_restrictions.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/render_widget_host_view.h" @@ -465,17 +466,17 @@ CefEventHandle CefBrowserPlatformDelegateNativeMac::GetEventHandle( std::unique_ptr CefBrowserPlatformDelegateNativeMac::CreateFileDialogRunner() { - return make_scoped_ptr(new CefFileDialogRunnerMac); + return base::WrapUnique(new CefFileDialogRunnerMac); } std::unique_ptr CefBrowserPlatformDelegateNativeMac::CreateJavaScriptDialogRunner() { - return make_scoped_ptr(new CefJavaScriptDialogRunnerMac); + return base::WrapUnique(new CefJavaScriptDialogRunnerMac); } std::unique_ptr CefBrowserPlatformDelegateNativeMac::CreateMenuRunner() { - return make_scoped_ptr(new CefMenuRunnerMac); + return base::WrapUnique(new CefMenuRunnerMac); } void CefBrowserPlatformDelegateNativeMac::TranslateMouseEvent( diff --git a/libcef/browser/native/browser_platform_delegate_native_win.cc b/libcef/browser/native/browser_platform_delegate_native_win.cc index 77774ee2b..ce8d34cf8 100644 --- a/libcef/browser/native/browser_platform_delegate_native_win.cc +++ b/libcef/browser/native/browser_platform_delegate_native_win.cc @@ -22,7 +22,8 @@ #include "content/public/browser/native_web_keyboard_event.h" #include "ui/aura/window.h" #include "ui/base/win/shell.h" -#include "ui/gfx/screen.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" #include "ui/gfx/win/hwnd_util.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" #include "ui/views/widget/widget.h" @@ -166,7 +167,7 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() { // Adjust for potential display scaling. gfx::Point point = gfx::Point(cr.right, cr.bottom); - float scale = gfx::Screen::GetScreen()-> + float scale = display::Screen::GetScreen()-> GetDisplayNearestPoint(point).device_scale_factor(); point = gfx::ToFlooredPoint( gfx::ScalePoint(gfx::PointF(point), 1.0f / scale)); @@ -296,7 +297,7 @@ gfx::Point CefBrowserPlatformDelegateNativeWin::GetScreenPoint( bounds_in_screen.y() + view.y()); // Adjust for potential display scaling. - float scale = gfx::Screen::GetScreen()-> + float scale = display::Screen::GetScreen()-> GetDisplayNearestPoint(screen_point).device_scale_factor(); return gfx::ToFlooredPoint( gfx::ScalePoint(gfx::PointF(screen_point), scale)); @@ -499,17 +500,17 @@ CefEventHandle CefBrowserPlatformDelegateNativeWin::GetEventHandle( std::unique_ptr CefBrowserPlatformDelegateNativeWin::CreateFileDialogRunner() { - return make_scoped_ptr(new CefFileDialogRunnerWin); + return base::WrapUnique(new CefFileDialogRunnerWin); } std::unique_ptr CefBrowserPlatformDelegateNativeWin::CreateJavaScriptDialogRunner() { - return make_scoped_ptr(new CefJavaScriptDialogRunnerWin); + return base::WrapUnique(new CefJavaScriptDialogRunnerWin); } std::unique_ptr CefBrowserPlatformDelegateNativeWin::CreateMenuRunner() { - return make_scoped_ptr(new CefMenuRunnerWin); + return base::WrapUnique(new CefMenuRunnerWin); } void CefBrowserPlatformDelegateNativeWin::TranslateMouseEvent( diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index 3298a3abe..ad378d4d3 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -190,7 +190,7 @@ class TemplateParser { using ResourcesMap = base::hash_map; // TODO(rkc): Once we have a separate source for apps, remove '*/apps/' aliases. -const char* kPathAliases[][2] = { +const char* const kPathAliases[][2] = { {"../../../third_party/polymer/v1_0/components-chromium/", "polymer/v1_0/"}, {"../../../third_party/web-animations-js/sources/", "polymer/v1_0/web-animations-js/"}, @@ -211,7 +211,7 @@ const ResourcesMap* CreateResourcesMap() { const std::string resource_name = kWebuiResources[i].name; const int resource_id = kWebuiResources[i].value; AddResource(resource_name, resource_id, result); - for (const char* (&alias)[2]: kPathAliases) { + for (const char* const (&alias)[2] : kPathAliases) { if (base::StartsWith(resource_name, alias[0], base::CompareCase::SENSITIVE)) { AddResource(alias[1] + resource_name.substr(strlen(alias[0])), diff --git a/libcef/browser/net/cookie_store_proxy.cc b/libcef/browser/net/cookie_store_proxy.cc index cf16f05f0..555e17eea 100644 --- a/libcef/browser/net/cookie_store_proxy.cc +++ b/libcef/browser/net/cookie_store_proxy.cc @@ -115,15 +115,15 @@ void CefCookieStoreProxy::DeleteAllCreatedBetweenAsync( } } -void CefCookieStoreProxy::DeleteAllCreatedBetweenForHostAsync( - const base::Time delete_begin, - const base::Time delete_end, - const GURL& url, +void CefCookieStoreProxy::DeleteAllCreatedBetweenWithPredicateAsync( + const base::Time& delete_begin, + const base::Time& delete_end, + const CookiePredicate& predicate, const DeleteCallback& callback) { net::CookieStore* cookie_store = GetCookieStore(); if (cookie_store) { - cookie_store->DeleteAllCreatedBetweenForHostAsync(delete_begin, delete_end, - url, callback); + cookie_store->DeleteAllCreatedBetweenWithPredicateAsync( + delete_begin, delete_end, predicate, callback); } } diff --git a/libcef/browser/net/cookie_store_proxy.h b/libcef/browser/net/cookie_store_proxy.h index 5168e7eb1..7b48bceb0 100644 --- a/libcef/browser/net/cookie_store_proxy.h +++ b/libcef/browser/net/cookie_store_proxy.h @@ -59,10 +59,10 @@ class CefCookieStoreProxy : public net::CookieStore { void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, const base::Time& delete_end, const DeleteCallback& callback) override; - void DeleteAllCreatedBetweenForHostAsync( - const base::Time delete_begin, - const base::Time delete_end, - const GURL& url, + void DeleteAllCreatedBetweenWithPredicateAsync( + const base::Time& delete_begin, + const base::Time& delete_end, + const CookiePredicate& predicate, const DeleteCallback& callback) override; void DeleteSessionCookiesAsync(const DeleteCallback& callback) override; void FlushStore(const base::Closure& callback) override; diff --git a/libcef/browser/net/scheme_handler.cc b/libcef/browser/net/scheme_handler.cc index fb0d741d0..69aec2f25 100644 --- a/libcef/browser/net/scheme_handler.cc +++ b/libcef/browser/net/scheme_handler.cc @@ -10,6 +10,7 @@ #include "libcef/browser/net/devtools_scheme_handler.h" #include "libcef/common/net/scheme_registration.h" +#include "base/memory/ptr_util.h" #include "base/threading/sequenced_worker_pool.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/url_constants.h" @@ -60,7 +61,7 @@ void InstallInternalProtectedHandlers( protocol_handler.reset( scheme::WrapChromeProtocolHandler( request_manager, - make_scoped_ptr(it->second.release())).release()); + base::WrapUnique(it->second.release())).release()); } else { protocol_handler.reset(it->second.release()); } @@ -70,7 +71,7 @@ void InstallInternalProtectedHandlers( DCHECK(IsInternalProtectedScheme(scheme)); bool set_protocol = job_factory->SetProtocolHandler( - scheme, make_scoped_ptr(protocol_handler.release())); + scheme, base::WrapUnique(protocol_handler.release())); DCHECK(set_protocol); } } diff --git a/libcef/browser/net/url_request_context_getter_impl.cc b/libcef/browser/net/url_request_context_getter_impl.cc index 021a46b87..e56994939 100644 --- a/libcef/browser/net/url_request_context_getter_impl.cc +++ b/libcef/browser/net/url_request_context_getter_impl.cc @@ -154,7 +154,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { storage_->set_network_delegate(base::WrapUnique(new CefNetworkDelegate)); - storage_->set_channel_id_service(make_scoped_ptr( + storage_->set_channel_id_service(base::WrapUnique( new net::ChannelIDService( new net::DefaultChannelIDStore(NULL), base::WorkerPool::GetTaskRunner(true)))); @@ -168,7 +168,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { storage_->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); storage_->set_transport_security_state( - make_scoped_ptr(new net::TransportSecurityState)); + base::WrapUnique(new net::TransportSecurityState)); std::unique_ptr system_proxy_service = ProxyServiceFactory::CreateProxyService( @@ -232,8 +232,8 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { settings_.ignore_certificate_errors ? true : false; storage_->set_http_network_session( - make_scoped_ptr(new net::HttpNetworkSession(network_session_params))); - storage_->set_http_transaction_factory(make_scoped_ptr( + base::WrapUnique(new net::HttpNetworkSession(network_session_params))); + storage_->set_http_transaction_factory(base::WrapUnique( new net::HttpCache(storage_->http_network_session(), std::move(main_backend), true /* set_up_quic_server_info */))); @@ -267,7 +267,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { i != request_interceptors_.rend(); ++i) { top_job_factory.reset(new net::URLRequestInterceptingJobFactory( - std::move(top_job_factory), make_scoped_ptr(*i))); + std::move(top_job_factory), base::WrapUnique(*i))); } request_interceptors_.weak_clear(); diff --git a/libcef/browser/net/url_request_manager.cc b/libcef/browser/net/url_request_manager.cc index 28d4921f4..9fca69c1c 100644 --- a/libcef/browser/net/url_request_manager.cc +++ b/libcef/browser/net/url_request_manager.cc @@ -16,6 +16,7 @@ #include "libcef/common/request_impl.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/strings/string_util.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" @@ -201,7 +202,7 @@ void CefURLRequestManager::SetProtocolHandlerIfNecessary( bool set_protocol = job_factory_->SetProtocolHandler( scheme, - make_scoped_ptr(add ? new CefProtocolHandler(this, scheme) : NULL)); + base::WrapUnique(add ? new CefProtocolHandler(this, scheme) : NULL)); DCHECK(set_protocol); } diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 257025714..6e8f84080 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -20,10 +20,11 @@ #include "cc/base/switches.h" #include "cc/output/copy_output_request.h" #include "cc/scheduler/delay_based_time_source.h" +#include "components/display_compositor/gl_helper.h" #include "content/browser/bad_message.h" -#include "content/browser/compositor/gl_helper.h" #include "content/browser/compositor/image_transport_factory.h" #include "content/browser/renderer_host/dip_util.h" +#include "content/browser/renderer_host/render_widget_host_delegate.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/resize_lock.h" #include "content/common/view_messages.h" @@ -251,7 +252,7 @@ class CefCopyFrameGenerator { content::ImageTransportFactory* factory = content::ImageTransportFactory::GetInstance(); - content::GLHelper* gl_helper = factory->GetGLHelper(); + display_compositor::GLHelper* gl_helper = factory->GetGLHelper(); if (!gl_helper) return; @@ -283,7 +284,7 @@ class CefCopyFrameGenerator { damage_rect, base::Passed(&bitmap_), base::Passed(&bitmap_pixels_lock)), - content::GLHelper::SCALER_QUALITY_FAST); + display_compositor::GLHelper::SCALER_QUALITY_FAST); } static void CopyFromCompositingSurfaceFinishedProxy( @@ -296,7 +297,7 @@ class CefCopyFrameGenerator { // This method may be called after the view has been deleted. gpu::SyncToken sync_token; if (result) { - content::GLHelper* gl_helper = + display_compositor::GLHelper* gl_helper = content::ImageTransportFactory::GetInstance()->GetGLHelper(); if (gl_helper) gl_helper->GenerateSyncToken(&sync_token); @@ -552,10 +553,6 @@ gfx::NativeView CefRenderWidgetHostViewOSR::GetNativeView() const { return gfx::NativeView(); } -gfx::NativeViewId CefRenderWidgetHostViewOSR::GetNativeViewId() const { - return gfx::NativeViewId(); -} - gfx::NativeViewAccessible CefRenderWidgetHostViewOSR::GetNativeViewAccessible() { return gfx::NativeViewAccessible(); @@ -788,8 +785,8 @@ void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) { } #if !defined(OS_MACOSX) -void CefRenderWidgetHostViewOSR::UpdateInputMethodIfNecessary( - bool text_input_state_changed) { +void CefRenderWidgetHostViewOSR::TextInputStateChanged( + const content::TextInputState& params) { } void CefRenderWidgetHostViewOSR::ImeCancelComposition() { @@ -1017,6 +1014,19 @@ bool CefRenderWidgetHostViewOSR::DelegatedFrameHostIsVisible() const { return !render_widget_host_->is_hidden(); } +SkColor CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGutterColor( + SkColor color) const { + // When making an element on the page fullscreen the element's background + // may not match the page's, so use black as the gutter color to avoid + // flashes of brighter colors during the transition. + if (render_widget_host_->delegate() && + render_widget_host_->delegate()->IsFullscreenForCurrentTab( + render_widget_host_)) { + return SK_ColorBLACK; + } + return color; +} + gfx::Size CefRenderWidgetHostViewOSR::DelegatedFrameHostDesiredSizeInDIP() const { return root_layer_->bounds().size(); @@ -1068,6 +1078,13 @@ void CefRenderWidgetHostViewOSR::DelegatedFrameHostUpdateVSyncParameters( render_widget_host_->UpdateVSyncParameters(timebase, interval); } +void CefRenderWidgetHostViewOSR::SetBeginFrameSource( + cc::BeginFrameSource* source) { + // TODO(cef): Maybe we can use this method in combination with + // OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer. + // See https://codereview.chromium.org/1841083007. +} + bool CefRenderWidgetHostViewOSR::InstallTransparency() { if (transparent_) { SetBackgroundColor(SkColor()); diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index 47d4f7063..a969e5e8f 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -96,7 +96,6 @@ class CefRenderWidgetHostViewOSR void SetBounds(const gfx::Rect& rect) override; gfx::Vector2dF GetLastScrollOffset() const override; gfx::NativeView GetNativeView() const override; - gfx::NativeViewId GetNativeViewId() const override; gfx::NativeViewAccessible GetNativeViewAccessible() override; ui::TextInputClient* GetTextInputClient() override; void Focus() override; @@ -111,6 +110,7 @@ class CefRenderWidgetHostViewOSR void UnlockMouse() override; #if defined(OS_MACOSX) + ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac() const override; void SetActive(bool active) override; void ShowDefinitionForSelection() override; bool SupportsSpeech() const override; @@ -130,7 +130,7 @@ class CefRenderWidgetHostViewOSR content::RenderWidgetHostView* reference_host_view) override; void UpdateCursor(const content::WebCursor& cursor) override; void SetIsLoading(bool is_loading) override; - void UpdateInputMethodIfNecessary(bool text_input_state_changed) override; + void TextInputStateChanged(const content::TextInputState& params) override; void ImeCancelComposition() override; void RenderProcessGone(base::TerminationStatus status, int error_code) override; @@ -203,6 +203,7 @@ class CefRenderWidgetHostViewOSR // DelegatedFrameHostClient implementation. ui::Layer* DelegatedFrameHostGetLayer() const override; bool DelegatedFrameHostIsVisible() const override; + SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override; gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override; bool DelegatedFrameCanCreateResizeLock() const override; std::unique_ptr DelegatedFrameHostCreateResizeLock( @@ -218,6 +219,7 @@ class CefRenderWidgetHostViewOSR void DelegatedFrameHostUpdateVSyncParameters( const base::TimeTicks& timebase, const base::TimeDelta& interval) override; + void SetBeginFrameSource(cc::BeginFrameSource* source) override; bool InstallTransparency(); diff --git a/libcef/browser/osr/render_widget_host_view_osr_mac.mm b/libcef/browser/osr/render_widget_host_view_osr_mac.mm index 50b51a276..9188ddb4b 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_mac.mm +++ b/libcef/browser/osr/render_widget_host_view_osr_mac.mm @@ -30,6 +30,13 @@ CefTextInputClientOSRMac* GetInputClientFromContext( } // namespace +ui::AcceleratedWidgetMac* CefRenderWidgetHostViewOSR::GetAcceleratedWidgetMac() + const { + if (browser_compositor_) + return browser_compositor_->accelerated_widget_mac(); + return nullptr; +} + void CefRenderWidgetHostViewOSR::SetActive(bool active) { } @@ -50,8 +57,8 @@ bool CefRenderWidgetHostViewOSR::IsSpeaking() const { void CefRenderWidgetHostViewOSR::StopSpeaking() { } -void CefRenderWidgetHostViewOSR::UpdateInputMethodIfNecessary( - bool text_input_state_changed) { +void CefRenderWidgetHostViewOSR::TextInputStateChanged( + const content::TextInputState& params) { [NSApp updateWindows]; } diff --git a/libcef/browser/plugins/plugin_info_message_filter.cc b/libcef/browser/plugins/plugin_info_message_filter.cc index 6a65cd956..06a5d251e 100644 --- a/libcef/browser/plugins/plugin_info_message_filter.cc +++ b/libcef/browser/plugins/plugin_info_message_filter.cc @@ -16,7 +16,7 @@ #include "base/bind.h" #include "base/metrics/histogram_macros.h" #include "base/strings/utf_string_conversions.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" #include "chrome/browser/plugins/plugin_finder.h" #include "chrome/common/pref_names.h" diff --git a/libcef/browser/plugins/plugin_info_message_filter.h b/libcef/browser/plugins/plugin_info_message_filter.h index 12d436d45..742932d70 100644 --- a/libcef/browser/plugins/plugin_info_message_filter.h +++ b/libcef/browser/plugins/plugin_info_message_filter.h @@ -51,12 +51,13 @@ class CefPluginInfoMessageFilter : public content::BrowserMessageFilter { const content::WebPluginInfo& plugin, const PluginMetadata* plugin_metadata, CefViewHostMsg_GetPluginInfo_Status* status) const; - bool FindEnabledPlugin(const GetPluginInfo_Params& params, - CefRequestContextHandler* handler, - CefViewHostMsg_GetPluginInfo_Status* status, - content::WebPluginInfo* plugin, - std::string* actual_mime_type, - std::unique_ptr* plugin_metadata) const; + bool FindEnabledPlugin( + const GetPluginInfo_Params& params, + CefRequestContextHandler* handler, + CefViewHostMsg_GetPluginInfo_Status* status, + content::WebPluginInfo* plugin, + std::string* actual_mime_type, + std::unique_ptr* plugin_metadata) const; void GetPluginContentSetting(const content::WebPluginInfo& plugin, const GURL& policy_url, const GURL& plugin_url, @@ -64,8 +65,6 @@ class CefPluginInfoMessageFilter : public content::BrowserMessageFilter { ContentSetting* setting, bool* is_default, bool* is_managed) const; - void MaybeGrantAccess(CefViewHostMsg_GetPluginInfo_Status status, - const base::FilePath& path) const; bool IsPluginEnabled(const content::WebPluginInfo& plugin) const; private: diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 0f939d966..3122cf316 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -25,6 +25,7 @@ #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" +#include "components/update_client/update_client.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/extension_prefs.h" #include "grit/cef_strings.h" @@ -126,6 +127,7 @@ std::unique_ptr CreatePrefService(const base::FilePath& pref_path) extensions::ExtensionPrefs::RegisterProfilePrefs(registry.get()); HostContentSettingsMap::RegisterProfilePrefs(registry.get()); renderer_prefs::RegisterProfilePrefs(registry.get()); + update_client::RegisterPrefs(registry.get()); // Print preferences. registry->RegisterBooleanPref(prefs::kPrintingEnabled, true); diff --git a/libcef/browser/prefs/browser_prefs.h b/libcef/browser/prefs/browser_prefs.h index ba3f580b3..d12ff5241 100644 --- a/libcef/browser/prefs/browser_prefs.h +++ b/libcef/browser/prefs/browser_prefs.h @@ -5,7 +5,7 @@ #ifndef CEF_LIBCEF_BROWSER_PREFS_BROWSER_PREFS_H_ #define CEF_LIBCEF_BROWSER_PREFS_BROWSER_PREFS_H_ -#include "base/memory/scoped_ptr.h" +#include class PrefService; diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index 307093d01..0bf774709 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -13,6 +13,7 @@ #include "libcef/common/extensions/extensions_util.h" #include "base/command_line.h" +#include "base/memory/ptr_util.h" #include "base/values.h" #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/character_encoding.h" @@ -280,7 +281,7 @@ void SetString(CommandLinePrefStore* prefs, const std::string& value) { prefs->SetValue( key, - make_scoped_ptr(new base::StringValue(value)), + base::WrapUnique(new base::StringValue(value)), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); } @@ -288,7 +289,7 @@ void SetBool(CommandLinePrefStore* prefs, const std::string& key, bool value) { prefs->SetValue(key, - make_scoped_ptr(new base::FundamentalValue(value)), + base::WrapUnique(new base::FundamentalValue(value)), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); } diff --git a/libcef/browser/printing/print_view_manager_base.cc b/libcef/browser/printing/print_view_manager_base.cc index 3a6ed453f..a3b53dc9c 100644 --- a/libcef/browser/printing/print_view_manager_base.cc +++ b/libcef/browser/printing/print_view_manager_base.cc @@ -13,7 +13,7 @@ #include "base/location.h" #include "base/single_thread_task_runner.h" #include "base/strings/utf_string_conversions.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/timer/timer.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" diff --git a/libcef/browser/resource_dispatcher_host_delegate.cc b/libcef/browser/resource_dispatcher_host_delegate.cc index b2ba3f967..dedd42a02 100644 --- a/libcef/browser/resource_dispatcher_host_delegate.cc +++ b/libcef/browser/resource_dispatcher_host_delegate.cc @@ -33,13 +33,14 @@ namespace { -void SendExecuteMimeTypeHandlerEvent(std::unique_ptr stream, - int64_t expected_content_size, - int render_process_id, - int render_frame_id, - const std::string& extension_id, - const std::string& view_id, - bool embedded) { +void SendExecuteMimeTypeHandlerEvent( + std::unique_ptr stream, + int64_t expected_content_size, + int render_process_id, + int render_frame_id, + const std::string& extension_id, + const std::string& view_id, + bool embedded) { CEF_REQUIRE_UIT(); CefRefPtr browser = diff --git a/libcef/browser/speech_recognition_manager_delegate.cc b/libcef/browser/speech_recognition_manager_delegate.cc index 2a0b1c49d..06bbf6dc4 100644 --- a/libcef/browser/speech_recognition_manager_delegate.cc +++ b/libcef/browser/speech_recognition_manager_delegate.cc @@ -198,12 +198,6 @@ void CefSpeechRecognitionManagerDelegate::OnAudioLevelsChange( void CefSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) { } -void CefSpeechRecognitionManagerDelegate::GetDiagnosticInformation( - bool* can_report_metrics, - std::string* hardware_info) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); -} - void CefSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( int session_id, base::Callback callback) { diff --git a/libcef/browser/speech_recognition_manager_delegate.h b/libcef/browser/speech_recognition_manager_delegate.h index cfc2e8232..b8b0bdb0e 100644 --- a/libcef/browser/speech_recognition_manager_delegate.h +++ b/libcef/browser/speech_recognition_manager_delegate.h @@ -7,7 +7,6 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "content/public/browser/speech_recognition_event_listener.h" #include "content/public/browser/speech_recognition_manager_delegate.h" @@ -39,8 +38,6 @@ class CefSpeechRecognitionManagerDelegate float noise_volume) override; // SpeechRecognitionManagerDelegate methods. - void GetDiagnosticInformation(bool* can_report_metrics, - std::string* hardware_info) override; void CheckRecognitionIsAllowed( int session_id, base::Callback callback) override; diff --git a/libcef/browser/trace_subscriber.h b/libcef/browser/trace_subscriber.h index 86d7c05e4..007b15e13 100644 --- a/libcef/browser/trace_subscriber.h +++ b/libcef/browser/trace_subscriber.h @@ -10,7 +10,6 @@ #include "base/files/file_path.h" #include "base/memory/ref_counted_memory.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" // May only be accessed on the browser process UI thread. diff --git a/libcef/browser/views/browser_platform_delegate_views.cc b/libcef/browser/views/browser_platform_delegate_views.cc index 22252e485..26773c0cf 100644 --- a/libcef/browser/views/browser_platform_delegate_views.cc +++ b/libcef/browser/views/browser_platform_delegate_views.cc @@ -267,8 +267,9 @@ std::unique_ptr return native_delegate_->CreateJavaScriptDialogRunner(); } -std::unique_ptr CefBrowserPlatformDelegateViews::CreateMenuRunner() { - return make_scoped_ptr(new CefMenuRunnerViews(browser_view_.get())); +std::unique_ptr + CefBrowserPlatformDelegateViews::CreateMenuRunner() { + return base::WrapUnique(new CefMenuRunnerViews(browser_view_.get())); } bool CefBrowserPlatformDelegateViews::IsWindowless() const { diff --git a/libcef/browser/views/display_impl.cc b/libcef/browser/views/display_impl.cc index 6d4b36cac..be79310d4 100644 --- a/libcef/browser/views/display_impl.cc +++ b/libcef/browser/views/display_impl.cc @@ -6,12 +6,12 @@ #include "libcef/browser/views/view_util.h" -#include "ui/gfx/screen.h" +#include "ui/display/screen.h" // static CefRefPtr CefDisplay::GetPrimaryDisplay() { CEF_REQUIRE_UIT_RETURN(nullptr); - return new CefDisplayImpl(gfx::Screen::GetScreen()->GetPrimaryDisplay()); + return new CefDisplayImpl(display::Screen::GetScreen()->GetPrimaryDisplay()); } // static @@ -36,7 +36,7 @@ CefRefPtr CefDisplay::GetDisplayMatchingBounds( // static size_t CefDisplay::GetDisplayCount() { CEF_REQUIRE_UIT_RETURN(0U); - return static_cast(gfx::Screen::GetScreen()->GetNumDisplays()); + return static_cast(display::Screen::GetScreen()->GetNumDisplays()); } // static @@ -45,13 +45,13 @@ void CefDisplay::GetAllDisplays(std::vector >& displays) { displays.clear(); - typedef std::vector DisplayVector; - DisplayVector vec = gfx::Screen::GetScreen()->GetAllDisplays(); + typedef std::vector DisplayVector; + DisplayVector vec = display::Screen::GetScreen()->GetAllDisplays(); for (size_t i = 0; i < vec.size(); ++i) displays.push_back(new CefDisplayImpl(vec[i])); } -CefDisplayImpl::CefDisplayImpl(const gfx::Display& display) +CefDisplayImpl::CefDisplayImpl(const display::Display& display) : display_(display) { CEF_REQUIRE_UIT(); } diff --git a/libcef/browser/views/display_impl.h b/libcef/browser/views/display_impl.h index 2b9f9fd45..79562e354 100644 --- a/libcef/browser/views/display_impl.h +++ b/libcef/browser/views/display_impl.h @@ -9,11 +9,11 @@ #include "include/views/cef_display.h" #include "libcef/browser/thread_util.h" -#include "ui/gfx/display.h" +#include "ui/display/display.h" class CefDisplayImpl : public CefDisplay { public: - explicit CefDisplayImpl(const gfx::Display& display); + explicit CefDisplayImpl(const display::Display& display); ~CefDisplayImpl() override; // CefDisplay methods: @@ -25,10 +25,10 @@ class CefDisplayImpl : public CefDisplay { CefRect GetWorkArea() override; int GetRotation() override; - const gfx::Display& display() const { return display_; } + const display::Display& display() const { return display_; } private: - gfx::Display display_; + display::Display display_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDisplayImpl); DISALLOW_COPY_AND_ASSIGN(CefDisplayImpl); diff --git a/libcef/browser/views/view_impl.h b/libcef/browser/views/view_impl.h index addfd8427..c63926731 100644 --- a/libcef/browser/views/view_impl.h +++ b/libcef/browser/views/view_impl.h @@ -620,7 +620,8 @@ CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsEnabled() { CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetFocusable(bool focusable) { CEF_REQUIRE_VALID_RETURN_VOID(); - root_view()->SetFocusable(focusable); + root_view()->SetFocusBehavior(focusable ? views::View::FocusBehavior::ALWAYS : + views::View::FocusBehavior::NEVER); } CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsFocusable() { diff --git a/libcef/browser/views/view_util.cc b/libcef/browser/views/view_util.cc index 5d1b08205..0c222604d 100644 --- a/libcef/browser/views/view_util.cc +++ b/libcef/browser/views/view_util.cc @@ -12,13 +12,14 @@ #include "ui/aura/window_tree_host.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point_conversions.h" -#include "ui/gfx/screen.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/window/non_client_view.h" #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/screen_win.h" #endif namespace view_util { @@ -180,24 +181,26 @@ CefRefPtr GetWindowFor(views::Widget* widget) { return window; } -gfx::Display GetDisplayNearestPoint(const gfx::Point& point, - bool input_pixel_coords) { +display::Display GetDisplayNearestPoint(const gfx::Point& point, + bool input_pixel_coords) { gfx::Point find_point = point; #if defined(OS_WIN) if (input_pixel_coords) - find_point = gfx::win::ScreenToDIPPoint(point); + find_point = display::win::ScreenWin::ScreenToDIPPoint(point); #endif - return gfx::Screen::GetScreen()->GetDisplayNearestPoint(find_point); + return display::Screen::GetScreen()->GetDisplayNearestPoint(find_point); } -gfx::Display GetDisplayMatchingBounds(const gfx::Rect& bounds, - bool input_pixel_coords) { +display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds, + bool input_pixel_coords) { gfx::Rect find_bounds = bounds; #if defined(OS_WIN) - if (input_pixel_coords) - find_bounds = gfx::win::ScreenToDIPRect(find_bounds); + if (input_pixel_coords) { + find_bounds = display::win::ScreenWin::ScreenToDIPRect(nullptr, + find_bounds); + } #endif - return gfx::Screen::GetScreen()->GetDisplayMatching(bounds); + return display::Screen::GetScreen()->GetDisplayMatching(bounds); } void ConvertPointFromPixels(gfx::Point* point, @@ -221,7 +224,7 @@ bool ConvertPointToScreen(views::View* view, views::View::ConvertPointToScreen(view, point); if (output_pixel_coords) { - const gfx::Display& display = GetDisplayNearestPoint(*point, false); + const display::Display& display = GetDisplayNearestPoint(*point, false); ConvertPointToPixels(point, display.device_scale_factor()); } @@ -235,7 +238,7 @@ bool ConvertPointFromScreen(views::View* view, return false; if (input_pixel_coords) { - const gfx::Display& display = GetDisplayNearestPoint(*point, true); + const display::Display& display = GetDisplayNearestPoint(*point, true); ConvertPointFromPixels(point, display.device_scale_factor()); } diff --git a/libcef/browser/views/view_util.h b/libcef/browser/views/view_util.h index cea84bd71..6d2693d18 100644 --- a/libcef/browser/views/view_util.h +++ b/libcef/browser/views/view_util.h @@ -11,8 +11,11 @@ #include "ui/views/view.h" -namespace gfx { +namespace display { class Display; +} + +namespace gfx { class Point; } @@ -70,14 +73,14 @@ CefRefPtr GetWindowFor(views::Widget* widget); // Returns the Display nearest |point|. Set |input_pixel_coords| to true if // |point| is in pixel coordinates instead of density independent pixels (DIP). -gfx::Display GetDisplayNearestPoint(const gfx::Point& point, - bool input_pixel_coords); +display::Display GetDisplayNearestPoint(const gfx::Point& point, + bool input_pixel_coords); // Returns the Display that most closely intersects |bounds|. Set // |input_pixel_coords| to true if |bounds| is in pixel coordinates instead of // density independent pixels (DIP). -gfx::Display GetDisplayMatchingBounds(const gfx::Rect& bounds, - bool input_pixel_coords); +display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds, + bool input_pixel_coords); // Convert |point| from pixel coordinates to density independent pixels (DIP) // using |device_scale_factor|. diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc index 3f58ca7bd..f73319849 100644 --- a/libcef/browser/views/window_impl.cc +++ b/libcef/browser/views/window_impl.cc @@ -24,7 +24,7 @@ #endif #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/screen_win.h" #endif namespace { @@ -379,7 +379,7 @@ void CefWindowImpl::CancelMenu() { CefRefPtr CefWindowImpl::GetDisplay() { CEF_REQUIRE_VALID_RETURN(nullptr); if (widget_ && root_view()) { - const gfx::Display& display = root_view()->GetDisplay(); + const display::Display& display = root_view()->GetDisplay(); if (display.is_valid()) return new CefDisplayImpl(display); } @@ -444,7 +444,7 @@ void CefWindowImpl::SendMouseMove(int screen_x, int screen_y) { gfx::Point point(screen_x, screen_y); #if defined(OS_WIN) // Windows expects pixel coordinates. - point = gfx::win::DIPToScreenPoint(point); + point = display::win::ScreenWin::DIPToScreenPoint(point); #endif ui_controls::SendMouseMove(point.x(), point.y()); diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 1dc40e56c..b29c5ab30 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -18,7 +18,7 @@ #endif #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/screen.h" #include "ui/views/win/hwnd_util.h" #endif @@ -61,11 +61,14 @@ class NativeFrameViewEx : public views::NativeFrameView { // views::GetWindowBoundsForClientBounds() expects the input Rect to be in // pixel coordinates. NativeFrameView does not implement this correctly so // we need to provide our own implementation. See http://crbug.com/602692. - gfx::Rect pixel_bounds = gfx::win::DIPToScreenRect(client_bounds); + gfx::Rect pixel_bounds = + display::Screen::GetScreen()->DIPToScreenRectInWindow( + view_util::GetNativeWindow(widget_), client_bounds); pixel_bounds = views::GetWindowBoundsForClientBounds( static_cast(const_cast(this)), pixel_bounds); - return gfx::win::ScreenToDIPRect(pixel_bounds); + return display::Screen::GetScreen()->ScreenToDIPRectInWindow( + view_util::GetNativeWindow(widget_), pixel_bounds); #else // Use the default implementation. return views::NativeFrameView::GetWindowBoundsForClientBounds( @@ -427,13 +430,13 @@ void CefWindowView::ViewHierarchyChanged( ParentClass::ViewHierarchyChanged(details); } -gfx::Display CefWindowView::GetDisplay() const { +display::Display CefWindowView::GetDisplay() const { const views::Widget* widget = GetWidget(); if (widget) { return view_util::GetDisplayMatchingBounds( widget->GetWindowBoundsInScreen(), false); } - return gfx::Display(); + return display::Display(); } void CefWindowView::SetTitle(const base::string16& title) { diff --git a/libcef/browser/views/window_view.h b/libcef/browser/views/window_view.h index 008ef693c..bdf93c7af 100644 --- a/libcef/browser/views/window_view.h +++ b/libcef/browser/views/window_view.h @@ -11,7 +11,7 @@ #include "libcef/browser/views/panel_view.h" -#include "ui/gfx/display.h" +#include "ui/display/display.h" #include "ui/views/widget/widget_delegate.h" class SkRegion; @@ -71,7 +71,7 @@ class CefWindowView : const views::View::ViewHierarchyChangedDetails& details) override; // Returns the Display containing this Window. - gfx::Display GetDisplay() const; + display::Display GetDisplay() const; // Set/get the window title. void SetTitle(const base::string16& title); diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index 6c66831bc..2f221cd6f 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -35,6 +35,7 @@ #include "extensions/common/constants.h" #include "pdf/pdf.h" #include "ui/base/layout.h" +#include "ui/base/material_design/material_design_controller.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_switches.h" @@ -709,6 +710,9 @@ void CefMainDelegate::InitializeResourceBundle() { std::string locale = command_line->GetSwitchValueASCII(switches::kLang); DCHECK(!locale.empty()); + // Avoid DCHECK() in ResourceBundle::LoadChromeResources(). + ui::MaterialDesignController::Initialize(); + const std::string loaded_locale = ui::ResourceBundle::InitSharedInstanceWithLocale( locale, diff --git a/libcef/common/main_delegate.h b/libcef/common/main_delegate.h index 9742cbd11..aeff1f6b7 100644 --- a/libcef/common/main_delegate.h +++ b/libcef/common/main_delegate.h @@ -12,7 +12,6 @@ #include "include/cef_app.h" #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "content/public/app/content_main_delegate.h" namespace base { diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 852326ee0..a32c2e31a 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -482,7 +482,7 @@ void CefRequestImpl::Get(net::URLRequest* request, bool changed_only) const { if (ShouldSet(kChangedPostData, changed_only)) { if (postdata_.get()) { - request->set_upload(make_scoped_ptr( + request->set_upload(base::WrapUnique( static_cast(postdata_.get())->Get())); } else if (request->get_upload()) { request->set_upload(std::unique_ptr()); @@ -1025,7 +1025,7 @@ net::UploadDataStream* CefPostDataImpl::Get() const { UploadElementReaders element_readers; ElementVector::const_iterator it = elements_.begin(); for (; it != elements_.end(); ++it) { - element_readers.push_back(make_scoped_ptr( + element_readers.push_back(base::WrapUnique( static_cast(it->get())->Get())); } @@ -1282,12 +1282,12 @@ net::UploadElementReader* CefPostDataElementImpl::Get() const { net::UploadElement* element = new net::UploadElement(); element->SetToBytes(static_cast(data_.bytes.bytes), data_.bytes.size); - return new BytesElementReader(make_scoped_ptr(element)); + return new BytesElementReader(base::WrapUnique(element)); } else if (type_ == PDE_TYPE_FILE) { net::UploadElement* element = new net::UploadElement(); base::FilePath path = base::FilePath(CefString(&data_.filename)); element->SetToFilePath(path); - return new FileElementReader(make_scoped_ptr(element)); + return new FileElementReader(base::WrapUnique(element)); } else { NOTREACHED(); return NULL; diff --git a/libcef/common/task_runner_impl.cc b/libcef/common/task_runner_impl.cc index 7ad620102..5df512c22 100644 --- a/libcef/common/task_runner_impl.cc +++ b/libcef/common/task_runner_impl.cc @@ -10,7 +10,7 @@ #include "base/location.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread; diff --git a/libcef/common/value_base.h b/libcef/common/value_base.h index 5eaf2b93d..a26db5676 100644 --- a/libcef/common/value_base.h +++ b/libcef/common/value_base.h @@ -12,7 +12,6 @@ #include "base/logging.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" #include "base/threading/platform_thread.h" diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index 2544a3a89..125694e57 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -32,7 +32,7 @@ #include "libcef/renderer/plugins/plugin_preroller.h" #include "libcef/renderer/render_frame_observer.h" #include "libcef/renderer/render_message_filter.h" -#include "libcef/renderer/render_process_observer.h" +#include "libcef/renderer/render_thread_observer.h" #include "libcef/renderer/thread_util.h" #include "libcef/renderer/v8_impl.h" #include "libcef/renderer/webkit_glue.h" @@ -60,7 +60,7 @@ #include "components/nacl/common/nacl_constants.h" #include "components/printing/renderer/print_web_view_helper.h" #include "components/visitedlink/renderer/visitedlink_slave.h" -#include "components/web_cache/renderer/web_cache_render_process_observer.h" +#include "components/web_cache/renderer/web_cache_impl.h" #include "content/common/frame_messages.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" @@ -389,8 +389,8 @@ void CefContentRendererClient::RenderThreadStarted() { base::CommandLine::ForCurrentProcess(); render_task_runner_ = base::ThreadTaskRunnerHandle::Get(); - observer_.reset(new CefRenderProcessObserver()); - web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); + observer_.reset(new CefRenderThreadObserver()); + web_cache_impl_.reset(new web_cache::WebCacheImpl()); content::RenderThread* thread = content::RenderThread::Get(); thread->AddObserver(observer_.get()); @@ -420,7 +420,7 @@ void CefContentRendererClient::RenderThreadStarted() { cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries; #if defined(OS_MACOSX) - if (base::mac::IsOSLionOrLater()) { + { base::ScopedCFTypeRef key( base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding")); base::ScopedCFTypeRef value; @@ -629,8 +629,8 @@ CefContentRendererClient::CreateBrowserPluginDelegate( render_frame, mime_type, original_url); } -void CefContentRendererClient::AddKeySystems( - std::vector* key_systems) { +void CefContentRendererClient::AddSupportedKeySystems( + std::vector>* key_systems) { AddCefKeySystems(key_systems); } diff --git a/libcef/renderer/content_renderer_client.h b/libcef/renderer/content_renderer_client.h index ddbb90f07..dea9de782 100644 --- a/libcef/renderer/content_renderer_client.h +++ b/libcef/renderer/content_renderer_client.h @@ -34,11 +34,11 @@ class VisitedLinkSlave; } namespace web_cache { -class WebCacheRenderProcessObserver; +class WebCacheImpl; } class CefGuestView; -class CefRenderProcessObserver; +class CefRenderThreadObserver; struct Cef_CrossOriginWhiteListEntry_Params; struct CefViewHostMsg_GetPluginInfo_Output; class ChromePDFPrintClient; @@ -126,7 +126,9 @@ class CefContentRendererClient : public content::ContentRendererClient, content::RenderFrame* render_frame, const std::string& mime_type, const GURL& original_url) override; - void AddKeySystems(std::vector* key_systems) override; + void AddSupportedKeySystems( + std::vector>* key_systems) + override; void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override; @@ -150,8 +152,8 @@ class CefContentRendererClient : public content::ContentRendererClient, void RunSingleProcessCleanupOnUIThread(); scoped_refptr render_task_runner_; - std::unique_ptr observer_; - std::unique_ptr web_cache_observer_; + std::unique_ptr observer_; + std::unique_ptr web_cache_impl_; std::unique_ptr spellcheck_; std::unique_ptr visited_link_slave_; diff --git a/libcef/renderer/dom_node_impl.cc b/libcef/renderer/dom_node_impl.cc index fb3acdb1e..e5ae1df94 100644 --- a/libcef/renderer/dom_node_impl.cc +++ b/libcef/renderer/dom_node_impl.cc @@ -355,8 +355,9 @@ bool CefDOMNodeImpl::SetElementAttribute(const CefString& attrName, } WebElement element = node_.to(); - return element.setAttribute(base::string16(attrName), - base::string16(value)); + element.setAttribute(base::string16(attrName), + base::string16(value)); + return true; } CefString CefDOMNodeImpl::GetElementInnerText() { diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index 3c9c4a533..f51190498 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -6,7 +6,7 @@ #include "libcef/common/cef_messages.h" #include "libcef/renderer/extensions/extensions_dispatcher_delegate.h" -#include "libcef/renderer/render_process_observer.h" +#include "libcef/renderer/render_thread_observer.h" #include "base/command_line.h" #include "chrome/common/extensions/extension_process_policy.h" @@ -117,7 +117,7 @@ CefExtensionsRendererClient::~CefExtensionsRendererClient() { } bool CefExtensionsRendererClient::IsIncognitoProcess() const { - return CefRenderProcessObserver::is_incognito_process(); + return CefRenderThreadObserver::is_incognito_process(); } int CefExtensionsRendererClient::GetLowestIsolatedWorldId() const { diff --git a/libcef/renderer/extensions/extensions_renderer_client.h b/libcef/renderer/extensions/extensions_renderer_client.h index b45df98ee..b7cd290e4 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.h +++ b/libcef/renderer/extensions/extensions_renderer_client.h @@ -5,10 +5,10 @@ #ifndef CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_RENDERER_CLIENT_H_ #define CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_RENDERER_CLIENT_H_ +#include #include #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "extensions/renderer/extensions_renderer_client.h" #include "ui/base/page_transition_types.h" diff --git a/libcef/renderer/media/cef_key_systems.cc b/libcef/renderer/media/cef_key_systems.cc index 51183512f..0b27510df 100644 --- a/libcef/renderer/media/cef_key_systems.cc +++ b/libcef/renderer/media/cef_key_systems.cc @@ -11,10 +11,13 @@ #include "base/strings/string16.h" #include "base/strings/string_split.h" #include "base/strings/utf_string_conversions.h" -#include "components/cdm/renderer/widevine_key_systems.h" +#include "components/cdm/renderer/widevine_key_system_properties.h" #include "content/public/renderer/render_thread.h" #include "libcef/common/cef_messages.h" #include "media/base/eme_constants.h" +#include "media/base/key_system_properties.h" + +#include "media/media_features.h" #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. @@ -25,7 +28,7 @@ #include "base/version.h" #endif -using media::KeySystemInfo; +using media::KeySystemProperties; using media::SupportedCodecs; #if defined(ENABLE_PEPPER_CDMS) @@ -74,7 +77,7 @@ void GetSupportedCodecsForPepperCdm( } static void AddPepperBasedWidevine( - std::vector* concrete_key_systems) { + std::vector>* concrete_key_systems) { #if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) Version glibc_version(gnu_get_libc_version()); DCHECK(glibc_version.IsValid()); @@ -115,27 +118,31 @@ static void AddPepperBasedWidevine( #if defined(USE_PROPRIETARY_CODECS) if (codecs[i] == kCdmSupportedCodecAvc1) supported_codecs |= media::EME_CODEC_MP4_AVC1; +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + if (codecs[i] == kCdmSupportedCodecVp9) + supported_codecs |= media::EME_CODEC_MP4_VP9; +#endif #endif // defined(USE_PROPRIETARY_CODECS) } - cdm::AddWidevineWithCodecs( + concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties( supported_codecs, media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness. media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness. media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. media::EmeSessionTypeSupport:: - NOT_SUPPORTED, // persistent-release-message. - media::EmeFeatureSupport::REQUESTABLE, // Persistent state. - media::EmeFeatureSupport::NOT_SUPPORTED, // Distinctive identifier. - concrete_key_systems); + NOT_SUPPORTED, // persistent-release-message. + media::EmeFeatureSupport::REQUESTABLE, // Persistent state. + media::EmeFeatureSupport::NOT_SUPPORTED)); // Distinctive identifier. } #endif // defined(WIDEVINE_CDM_AVAILABLE) #endif // defined(ENABLE_PEPPER_CDMS) -void AddCefKeySystems(std::vector* key_systems_info) { +void AddCefKeySystems( + std::vector>* key_systems_properties) { #if defined(ENABLE_PEPPER_CDMS) #if defined(WIDEVINE_CDM_AVAILABLE) - AddPepperBasedWidevine(key_systems_info); + AddPepperBasedWidevine(key_systems_properties); #endif // defined(WIDEVINE_CDM_AVAILABLE) #endif // defined(ENABLE_PEPPER_CDMS) } diff --git a/libcef/renderer/media/cef_key_systems.h b/libcef/renderer/media/cef_key_systems.h index aafff1bbe..2e937ff5e 100644 --- a/libcef/renderer/media/cef_key_systems.h +++ b/libcef/renderer/media/cef_key_systems.h @@ -5,10 +5,16 @@ #ifndef CEF_LIBCEF_RENDERER_MEDIA_CEF_KEY_SYSTEMS_H_ #define CEF_LIBCEF_RENDERER_MEDIA_CEF_KEY_SYSTEMS_H_ +#include #include -#include "media/base/key_system_info.h" +namespace media { +class KeySystemProperties; +} -void AddCefKeySystems(std::vector* key_systems_info); +// Register the key systems supported by populating |key_systems_properties|. +void AddCefKeySystems( + std::vector>* + key_systems_properties); #endif // CEF_LIBCEF_RENDERER_MEDIA_CEF_KEY_SYSTEMS_H_ diff --git a/libcef/renderer/plugins/cef_plugin_placeholder.cc b/libcef/renderer/plugins/cef_plugin_placeholder.cc index fe1b04012..36ab3fdc2 100644 --- a/libcef/renderer/plugins/cef_plugin_placeholder.cc +++ b/libcef/renderer/plugins/cef_plugin_placeholder.cc @@ -59,7 +59,8 @@ CefPluginPlaceholder::CefPluginPlaceholder( status_(CefViewHostMsg_GetPluginInfo_Status::kAllowed), title_(title), has_host_(false), - context_menu_request_id_(0) { + context_menu_request_id_(0), + ignore_updates_(false) { RenderThread::Get()->AddObserver(this); } @@ -285,6 +286,31 @@ blink::WebPlugin* CefPluginPlaceholder::CreatePlugin() { GetPluginParams(), std::move(throttler)); } +void CefPluginPlaceholder::OnLoadedRectUpdate( + const gfx::Rect& unobscured_rect, + content::RenderFrame::PeripheralContentStatus status) { + // If the placeholder is in the blocked state, do nothing. + if (ignore_updates_) + return; + + // This should only be called once. + set_delayed(false); + + // block tiny cross-origin - simply by not continuing the load chain. + if (status == + content::RenderFrame::CONTENT_STATUS_ESSENTIAL_CROSS_ORIGIN_TINY) { + ignore_updates_ = true; + return; + } + + // For essential content, powersaver can be turned off. + if (status != content::RenderFrame::CONTENT_STATUS_PERIPHERAL) + set_power_saver_enabled(false); + + AllowLoading(); + LoadPlugin(); +} + gin::ObjectTemplateBuilder CefPluginPlaceholder::GetObjectTemplateBuilder( v8::Isolate* isolate) { gin::ObjectTemplateBuilder builder = diff --git a/libcef/renderer/plugins/cef_plugin_placeholder.h b/libcef/renderer/plugins/cef_plugin_placeholder.h index 4956eb78d..d1e075ae8 100644 --- a/libcef/renderer/plugins/cef_plugin_placeholder.h +++ b/libcef/renderer/plugins/cef_plugin_placeholder.h @@ -11,13 +11,13 @@ #include "chrome/renderer/plugins/power_saver_info.h" #include "components/plugins/renderer/loadable_plugin_placeholder.h" #include "content/public/renderer/context_menu_client.h" -#include "content/public/renderer/render_process_observer.h" +#include "content/public/renderer/render_thread_observer.h" enum class CefViewHostMsg_GetPluginInfo_Status; class CefPluginPlaceholder final : public plugins::LoadablePluginPlaceholder, - public content::RenderProcessObserver, + public content::RenderThreadObserver, public content::ContextMenuClient, public gin::Wrappable { public: @@ -50,8 +50,11 @@ class CefPluginPlaceholder final const base::string16& title); ~CefPluginPlaceholder() override; - // content::LoadablePluginPlaceholder method + // content::LoadablePluginPlaceholder overrides: blink::WebPlugin* CreatePlugin() override; + void OnLoadedRectUpdate( + const gfx::Rect& unobscured_rect, + content::RenderFrame::PeripheralContentStatus status) override; // gin::Wrappable (via PluginPlaceholder) method gin::ObjectTemplateBuilder GetObjectTemplateBuilder( @@ -64,7 +67,7 @@ class CefPluginPlaceholder final v8::Local GetV8Handle(v8::Isolate* isolate) override; void ShowContextMenu(const blink::WebMouseEvent&) override; - // content::RenderProcessObserver methods: + // content::RenderThreadObserver methods: void PluginListChanged() override; // content::ContextMenuClient methods: @@ -83,6 +86,8 @@ class CefPluginPlaceholder final int context_menu_request_id_; // Nonzero when request pending. base::string16 plugin_name_; + bool ignore_updates_; + DISALLOW_COPY_AND_ASSIGN(CefPluginPlaceholder); }; diff --git a/libcef/renderer/render_frame_observer.cc b/libcef/renderer/render_frame_observer.cc index 6aa6581d5..d733f597a 100644 --- a/libcef/renderer/render_frame_observer.cc +++ b/libcef/renderer/render_frame_observer.cc @@ -5,7 +5,6 @@ #include "base/compiler_specific.h" -#include "config.h" MSVC_PUSH_WARNING_LEVEL(0); #include "platform/ScriptForbiddenScope.h" MSVC_POP_WARNING(); diff --git a/libcef/renderer/render_process_observer.cc b/libcef/renderer/render_thread_observer.cc similarity index 77% rename from libcef/renderer/render_process_observer.cc rename to libcef/renderer/render_thread_observer.cc index 47a7410ae..ffa5da513 100644 --- a/libcef/renderer/render_process_observer.cc +++ b/libcef/renderer/render_thread_observer.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "libcef/renderer/render_process_observer.h" +#include "libcef/renderer/render_thread_observer.h" #include "libcef/common/cef_messages.h" #include "libcef/common/net/net_resource_provider.h" #include "libcef/renderer/content_renderer_client.h" @@ -13,19 +13,19 @@ #include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/web/WebSecurityPolicy.h" -bool CefRenderProcessObserver::is_incognito_process_ = false; +bool CefRenderThreadObserver::is_incognito_process_ = false; -CefRenderProcessObserver::CefRenderProcessObserver() { +CefRenderThreadObserver::CefRenderThreadObserver() { net::NetModule::SetResourceProvider(NetResourceProvider); } -CefRenderProcessObserver::~CefRenderProcessObserver() { +CefRenderThreadObserver::~CefRenderThreadObserver() { } -bool CefRenderProcessObserver::OnControlMessageReceived( +bool CefRenderThreadObserver::OnControlMessageReceived( const IPC::Message& message) { bool handled = true; - IPC_BEGIN_MESSAGE_MAP(CefRenderProcessObserver, message) + IPC_BEGIN_MESSAGE_MAP(CefRenderThreadObserver, message) IPC_MESSAGE_HANDLER(CefProcessMsg_SetIsIncognitoProcess, OnSetIsIncognitoProcess) IPC_MESSAGE_HANDLER(CefProcessMsg_ModifyCrossOriginWhitelistEntry, @@ -37,16 +37,16 @@ bool CefRenderProcessObserver::OnControlMessageReceived( return handled; } -void CefRenderProcessObserver::OnRenderProcessShutdown() { +void CefRenderThreadObserver::OnRenderProcessShutdown() { CefContentRendererClient::Get()->OnRenderProcessShutdown(); } -void CefRenderProcessObserver::OnSetIsIncognitoProcess( +void CefRenderThreadObserver::OnSetIsIncognitoProcess( bool is_incognito_process) { is_incognito_process_ = is_incognito_process; } -void CefRenderProcessObserver::OnModifyCrossOriginWhitelistEntry( +void CefRenderThreadObserver::OnModifyCrossOriginWhitelistEntry( bool add, const Cef_CrossOriginWhiteListEntry_Params& params) { GURL gurl = GURL(params.source_origin); @@ -65,6 +65,6 @@ void CefRenderProcessObserver::OnModifyCrossOriginWhitelistEntry( } } -void CefRenderProcessObserver::OnClearCrossOriginWhitelist() { +void CefRenderThreadObserver::OnClearCrossOriginWhitelist() { blink::WebSecurityPolicy::resetOriginAccessWhitelists(); } diff --git a/libcef/renderer/render_process_observer.h b/libcef/renderer/render_thread_observer.h similarity index 66% rename from libcef/renderer/render_process_observer.h rename to libcef/renderer/render_thread_observer.h index b96251bde..345fa2de5 100644 --- a/libcef/renderer/render_process_observer.h +++ b/libcef/renderer/render_thread_observer.h @@ -3,23 +3,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CEF_LIBCEF_RENDERER_RENDER_PROCESS_OBSERVER_H_ -#define CEF_LIBCEF_RENDERER_RENDER_PROCESS_OBSERVER_H_ +#ifndef CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_ +#define CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_ #include "base/compiler_specific.h" -#include "content/public/renderer/render_process_observer.h" +#include "content/public/renderer/render_thread_observer.h" struct Cef_CrossOriginWhiteListEntry_Params; // This class sends and receives control messages on the renderer process. -class CefRenderProcessObserver : public content::RenderProcessObserver { +class CefRenderThreadObserver : public content::RenderThreadObserver { public: - CefRenderProcessObserver(); - ~CefRenderProcessObserver() override; + CefRenderThreadObserver(); + ~CefRenderThreadObserver() override; static bool is_incognito_process() { return is_incognito_process_; } - // RenderProcessObserver implementation. + // RenderThreadObserver implementation. bool OnControlMessageReceived(const IPC::Message& message) override; void OnRenderProcessShutdown() override; @@ -33,7 +33,7 @@ class CefRenderProcessObserver : public content::RenderProcessObserver { static bool is_incognito_process_; - DISALLOW_COPY_AND_ASSIGN(CefRenderProcessObserver); + DISALLOW_COPY_AND_ASSIGN(CefRenderThreadObserver); }; -#endif // CEF_LIBCEF_RENDERER_RENDER_PROCESS_OBSERVER_H_ +#endif // CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_ diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index 2f0c14ee3..d64509ed8 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -12,7 +12,6 @@ #include "base/command_line.h" #include "base/compiler_specific.h" -#include "config.h" MSVC_PUSH_WARNING_LEVEL(0); #include "core/frame/Frame.h" #include "core/frame/LocalFrame.h" diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/webkit_glue.cc index 1c6d1e6cf..614e7c5f6 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/webkit_glue.cc @@ -17,7 +17,6 @@ #include "base/compiler_specific.h" -#include "config.h" MSVC_PUSH_WARNING_LEVEL(0); #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/web/WebDocument.h" diff --git a/libcef/utility/content_utility_client.cc b/libcef/utility/content_utility_client.cc index da16c7eb9..718e4cba9 100644 --- a/libcef/utility/content_utility_client.cc +++ b/libcef/utility/content_utility_client.cc @@ -11,7 +11,6 @@ #include "chrome/common/chrome_utility_messages.h" #include "chrome/utility/utility_message_handler.h" #include "content/public/common/service_registry.h" -#include "content/public/utility/utility_thread.h" #include "net/proxy/mojo_proxy_resolver_factory_impl.h" #if defined(OS_WIN) @@ -20,10 +19,6 @@ namespace { -bool Send(IPC::Message* message) { - return content::UtilityThread::Get()->Send(message); -} - void CreateProxyResolverFactory( mojo::InterfaceRequest request) { // MojoProxyResolverFactoryImpl is strongly bound to the Mojo message pipe it @@ -46,12 +41,7 @@ CefContentUtilityClient::~CefContentUtilityClient() { bool CefContentUtilityClient::OnMessageReceived( const IPC::Message& message) { - bool handled = true; - - IPC_BEGIN_MESSAGE_MAP(CefContentUtilityClient, message) - IPC_MESSAGE_HANDLER(ChromeUtilityMsg_StartupPing, OnStartupPing) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() + bool handled = false; for (Handlers::iterator it = handlers_.begin(); !handled && it != handlers_.end(); ++it) { @@ -66,8 +56,3 @@ void CefContentUtilityClient::RegisterMojoServices( registry->AddService( base::Bind(CreateProxyResolverFactory)); } - -void CefContentUtilityClient::OnStartupPing() { - Send(new ChromeUtilityHostMsg_ProcessStarted); - // Don't release the process, we assume further messages are on the way. -} diff --git a/libcef/utility/content_utility_client.h b/libcef/utility/content_utility_client.h index eb61e8b3f..84f4a9264 100644 --- a/libcef/utility/content_utility_client.h +++ b/libcef/utility/content_utility_client.h @@ -20,9 +20,6 @@ class CefContentUtilityClient : public content::ContentUtilityClient { void RegisterMojoServices(content::ServiceRegistry* registry) override; private: - // IPC message handlers. - void OnStartupPing(); - typedef ScopedVector Handlers; Handlers handlers_; diff --git a/libcef_dll/base/cef_lock.cc b/libcef_dll/base/cef_lock.cc index f0a2cd44a..265f67fb5 100644 --- a/libcef_dll/base/cef_lock.cc +++ b/libcef_dll/base/cef_lock.cc @@ -12,6 +12,7 @@ #include "include/base/cef_logging.h" namespace base { +namespace cef_internal { Lock::Lock() : lock_() { } @@ -39,6 +40,7 @@ void Lock::CheckUnheldAndMark() { owning_thread_ref_ = PlatformThread::CurrentRef(); } +} // namespace cef_internal } // namespace base #endif // NDEBUG diff --git a/libcef_dll/sandbox/sandbox_win.cc b/libcef_dll/sandbox/sandbox_win.cc index 9f5ee10df..5b85bf855 100644 --- a/libcef_dll/sandbox/sandbox_win.cc +++ b/libcef_dll/sandbox/sandbox_win.cc @@ -2,9 +2,6 @@ // 2011 the Chromium Authors. All rights reserved. Use of this source code is // governed by a BSD-style license that can be found in the LICENSE file. -// Include this first to avoid conflicts with cef_macros.h. -#include "base/macros.h" - #include "include/cef_sandbox_win.h" #include "sandbox/win/src/process_mitigations.h" diff --git a/libcef_dll/wrapper/cef_resource_manager.cc b/libcef_dll/wrapper/cef_resource_manager.cc index cc8879910..7f1c048b1 100644 --- a/libcef_dll/wrapper/cef_resource_manager.cc +++ b/libcef_dll/wrapper/cef_resource_manager.cc @@ -318,7 +318,7 @@ struct CefResourceManager::ProviderEntry { deletion_pending_(false) { } - scoped_ptr provider_; + SCOPED_PTR(Provider) provider_; int order_; std::string identifier_; @@ -378,7 +378,7 @@ void CefResourceManager::Request::Stop() { base::Passed(&state_))); } -CefResourceManager::Request::Request(scoped_ptr state) +CefResourceManager::Request::Request(SCOPED_PTR(RequestState) state) : state_(MOVE_SCOPED_PTR(state)), params_(state_->params_) { CEF_REQUIRE_IO_THREAD(); @@ -396,13 +396,13 @@ CefResourceManager::Request::Request(scoped_ptr state) // handle the request. Note that |state_| may already be NULL if OnRequest // executes a callback before returning, in which case execution will continue // asynchronously in any case. -scoped_ptr +SCOPED_PTR(CefResourceManager::RequestState) CefResourceManager::Request::SendRequest() { CEF_REQUIRE_IO_THREAD(); Provider* provider = (*state_->current_entry_pos_)->provider_.get(); if (!provider->OnRequest(this)) return MOVE_SCOPED_PTR(state_); - return scoped_ptr(); + return SCOPED_PTR(RequestState)(); } bool CefResourceManager::Request::HasState() { @@ -412,7 +412,7 @@ bool CefResourceManager::Request::HasState() { // static void CefResourceManager::Request::ContinueOnIOThread( - scoped_ptr state, + SCOPED_PTR(RequestState) state, CefRefPtr handler) { CEF_REQUIRE_IO_THREAD(); // The manager may already have been deleted. @@ -423,7 +423,7 @@ void CefResourceManager::Request::ContinueOnIOThread( // static void CefResourceManager::Request::StopOnIOThread( - scoped_ptr state) { + SCOPED_PTR(RequestState) state) { CEF_REQUIRE_IO_THREAD(); // The manager may already have been deleted. base::WeakPtr manager = state->manager_; @@ -493,7 +493,7 @@ void CefResourceManager::AddProvider(Provider* provider, return; } - scoped_ptr new_entry( + SCOPED_PTR(ProviderEntry) new_entry( new ProviderEntry(provider, order, identifier)); if (providers_.empty()) { @@ -587,7 +587,7 @@ cef_return_value_t CefResourceManager::OnBeforeResourceLoad( return RV_CONTINUE; } - scoped_ptr state(new RequestState); + SCOPED_PTR(RequestState) state(new RequestState); if (!weak_ptr_factory_.get()) { // WeakPtrFactory instances need to be created and destroyed on the same @@ -637,7 +637,7 @@ CefRefPtr CefResourceManager::GetResourceHandler( // Send the request to providers in order until one potentially handles it or we // run out of providers. Returns true if the request is potentially handled. -bool CefResourceManager::SendRequest(scoped_ptr state) { +bool CefResourceManager::SendRequest(SCOPED_PTR(RequestState) state) { bool potentially_handled = false; do { @@ -661,7 +661,7 @@ bool CefResourceManager::SendRequest(scoped_ptr state) { } void CefResourceManager::ContinueRequest( - scoped_ptr state, + SCOPED_PTR(RequestState) state, CefRefPtr handler) { CEF_REQUIRE_IO_THREAD(); @@ -679,7 +679,7 @@ void CefResourceManager::ContinueRequest( } } -void CefResourceManager::StopRequest(scoped_ptr state) { +void CefResourceManager::StopRequest(SCOPED_PTR(RequestState) state) { CEF_REQUIRE_IO_THREAD(); // Detach from the current provider. diff --git a/libcef_dll/wrapper/cef_stream_resource_handler.cc b/libcef_dll/wrapper/cef_stream_resource_handler.cc index 2e8095179..625dc48d5 100644 --- a/libcef_dll/wrapper/cef_stream_resource_handler.cc +++ b/libcef_dll/wrapper/cef_stream_resource_handler.cc @@ -69,7 +69,7 @@ class CefStreamResourceHandler::Buffer { } private: - scoped_ptr buffer_; + SCOPED_PTR(char[]) buffer_; int size_; int bytes_requested_; int bytes_written_; diff --git a/libcef_dll/wrapper/cef_zip_archive.cc b/libcef_dll/wrapper/cef_zip_archive.cc index 8be28b617..dc915a0bd 100644 --- a/libcef_dll/wrapper/cef_zip_archive.cc +++ b/libcef_dll/wrapper/cef_zip_archive.cc @@ -57,7 +57,7 @@ class CefZipFile : public CefZipArchive::File { private: size_t data_size_; - scoped_ptr data_; + SCOPED_PTR(unsigned char[]) data_; IMPLEMENT_REFCOUNTING(CefZipFile); DISALLOW_COPY_AND_ASSIGN(CefZipFile); diff --git a/patch/patch.cfg b/patch/patch.cfg index ef25f20aa..04385a2bd 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -162,13 +162,6 @@ patches = [ 'name': 'content_pepper_flash_1586', 'path': '../content/browser/renderer_host/pepper/', }, - { - # Support loading of newer system Flash installations on OS X. - # https://bitbucket.org/chromiumembedded/cef/issue/1586 - # https://bugs.chromium.org/p/chromium/issues/detail?id=470737 - 'name': 'chrome_pepper_flash_1586', - 'path': '../chrome/common/', - }, { # Fix placement of IME window on Windows. # https://bitbucket.org/chromiumembedded/cef/issue/1610 @@ -255,10 +248,4 @@ patches = [ 'name': 'render_view_host_impl_1392', 'path': '../content/browser/renderer_host/', }, - { - # Fix incorrect initialization of WebCursor object. - # https://bitbucket.org/chromiumembedded/cef/issues/1894 - 'name': 'webcursor_1894', - 'path': '../content/common/cursors/', - }, ] diff --git a/patch/patches/browser_frame_host_guest_1687.patch b/patch/patches/browser_frame_host_guest_1687.patch index 245265c61..5714d2d82 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 41e31c0..509ebd8 100644 +index 54d6c4c..4a5268d 100644 --- render_widget_host_view_guest.cc +++ render_widget_host_view_guest.cc -@@ -191,6 +191,9 @@ void RenderWidgetHostViewGuest::Destroy() { +@@ -212,6 +212,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 6368ae8f0..294ec1dac 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 ad4474f..d0318065 100644 +index 71e2857..73d4e45 100644 --- browser/browser_plugin/browser_plugin_guest.cc +++ browser/browser_plugin/browser_plugin_guest.cc @@ -28,7 +28,7 @@ @@ -11,7 +11,7 @@ index ad4474f..d0318065 100644 #include "content/common/browser_plugin/browser_plugin_constants.h" #include "content/common/browser_plugin/browser_plugin_messages.h" #include "content/common/content_constants_internal.h" -@@ -286,20 +286,19 @@ void BrowserPluginGuest::InitInternal( +@@ -287,20 +287,19 @@ void BrowserPluginGuest::InitInternal( guest_window_rect_ = params.view_rect; if (owner_web_contents_ != owner_web_contents) { @@ -36,7 +36,7 @@ index ad4474f..d0318065 100644 } RendererPreferences* renderer_prefs = -@@ -749,11 +748,10 @@ void BrowserPluginGuest::OnWillAttachComplete( +@@ -750,11 +749,10 @@ void BrowserPluginGuest::OnWillAttachComplete( ->GetWidget() ->Init(); GetWebContents()->GetMainFrame()->Init(); diff --git a/patch/patches/browser_web_contents_1257.patch b/patch/patches/browser_web_contents_1257.patch index af06a9813..ad6f83548 100644 --- a/patch/patches/browser_web_contents_1257.patch +++ b/patch/patches/browser_web_contents_1257.patch @@ -1,18 +1,19 @@ diff --git web_contents_impl.cc web_contents_impl.cc -index 61d8bf3..0cee4d7 100644 +index 5621f82..3124d00 100644 --- web_contents_impl.cc +++ web_contents_impl.cc -@@ -1412,32 +1412,40 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -1510,39 +1510,47 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { + // frame - let's do the same thing here. std::string unique_name = params.main_frame_name; frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); - -- WebContentsViewDelegate* delegate = -- GetContentClient()->browser()->GetWebContentsViewDelegate(this); ++ + if (params.view && params.delegate_view) { + view_.reset(params.view); + render_view_host_delegate_view_ = params.delegate_view; + } -+ + +- WebContentsViewDelegate* delegate = +- GetContentClient()->browser()->GetWebContentsViewDelegate(this); + if (!view_) { + WebContentsViewDelegate* delegate = + GetContentClient()->browser()->GetWebContentsViewDelegate(this); @@ -38,31 +39,41 @@ index 61d8bf3..0cee4d7 100644 #endif - if (!view_) { -- view_.reset(CreateWebContentsView(this, delegate, -- &render_view_host_delegate_view_)); -- } + if (!view_) { -+ view_.reset(CreateWebContentsView(this, delegate, -+ &render_view_host_delegate_view_)); ++ if (browser_plugin_guest_ && ++ BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { ++ view_.reset(new WebContentsViewChildFrame( ++ this, delegate, &render_view_host_delegate_view_)); ++ } else { ++ view_.reset(CreateWebContentsView(this, delegate, ++ &render_view_host_delegate_view_)); ++ } + } ++ + if (browser_plugin_guest_ && +- BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { +- view_.reset(new WebContentsViewChildFrame( +- this, delegate, &render_view_host_delegate_view_)); +- } else { +- view_.reset(CreateWebContentsView(this, delegate, +- &render_view_host_delegate_view_)); ++ !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { ++ view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), ++ std::move(view_), ++ &render_view_host_delegate_view_)); + } + } - if (browser_plugin_guest_ && - !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { - view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), - std::move(view_), - &render_view_host_delegate_view_)); -+ if (browser_plugin_guest_ && -+ !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { -+ view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), -+ std::move(view_), -+ &render_view_host_delegate_view_)); -+ } - } -+ +- } CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -1867,11 +1875,14 @@ void WebContentsImpl::CreateNewWindow( +@@ -1974,11 +1982,14 @@ void WebContentsImpl::CreateNewWindow( static_cast(session_storage_namespace); CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); @@ -78,7 +89,7 @@ index 61d8bf3..0cee4d7 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 -@@ -1895,6 +1906,8 @@ void WebContentsImpl::CreateNewWindow( +@@ -2002,6 +2013,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 72a166828..fa312d3fb 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,5 +1,5 @@ diff --git common.gypi common.gypi -index 1aad5054..5bccbed 100644 +index 3724f2f..5eb9cde 100644 --- common.gypi +++ common.gypi @@ -9,6 +9,9 @@ @@ -12,7 +12,7 @@ index 1aad5054..5bccbed 100644 # Putting a variables dict inside another variables dict looks kind of # weird. This is done so that 'host_arch', 'chromeos', etc are defined as # variables within the outer variables dict here. This is necessary -@@ -96,7 +99,10 @@ +@@ -90,7 +93,10 @@ # depending on the packages installed on the local machine. Set this # to 0 to build against locally installed headers and libraries (e.g. # if packaging for a linux distro) diff --git a/patch/patches/chrome_browser_1257.patch b/patch/patches/chrome_browser_1257.patch index 070b3d5d5..d1685492a 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 b9d1732..7754dd9 100644 +index e551474..222b6ad 100644 --- ui/browser.cc +++ ui/browser.cc -@@ -1729,7 +1729,9 @@ bool Browser::ShouldCreateWebContents( +@@ -1731,7 +1731,9 @@ bool Browser::ShouldCreateWebContents( const std::string& frame_name, const GURL& target_url, const std::string& partition_id, @@ -14,10 +14,10 @@ index b9d1732..7754dd9 100644 // If a BackgroundContents is created, suppress the normal WebContents. return !MaybeCreateBackgroundContents( diff --git ui/browser.h ui/browser.h -index 3cb7401..e41d498 100644 +index 2196898..af9df43 100644 --- ui/browser.h +++ ui/browser.h -@@ -613,7 +613,9 @@ class Browser : public TabStripModelObserver, +@@ -616,7 +616,9 @@ class Browser : public TabStripModelObserver, const std::string& frame_name, const GURL& target_url, const std::string& partition_id, diff --git a/patch/patches/chrome_pepper_flash_1586.patch b/patch/patches/chrome_pepper_flash_1586.patch deleted file mode 100644 index 782e10792..000000000 --- a/patch/patches/chrome_pepper_flash_1586.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git pepper_flash.cc pepper_flash.cc -index 3b6cbd9..d4ba7ed 100644 ---- pepper_flash.cc -+++ pepper_flash.cc -@@ -121,8 +121,15 @@ bool CheckPepperFlashManifest(const base::DictionaryValue& manifest, - - std::string arch; - manifest.GetStringASCII("x-ppapi-arch", &arch); -+#if defined(OS_MACOSX) -+ // On Mac newer versions of the plugin are a universal binary and use "mac" -+ // as the value. -+ if (arch != kPepperFlashArch && arch != kPepperFlashOperatingSystem) -+ return false; -+#else - if (arch != kPepperFlashArch) - return false; -+#endif - - *version_out = version; - return true; diff --git a/patch/patches/compositor_1368.patch b/patch/patches/compositor_1368.patch index 8405c7287..7c2578fc8 100644 --- a/patch/patches/compositor_1368.patch +++ b/patch/patches/compositor_1368.patch @@ -1,23 +1,23 @@ diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc -index 9a4ad65..5a6d428 100644 +index ea713fd..e4119f6 100644 --- content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc -@@ -130,6 +130,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { - scoped_ptr +@@ -188,6 +188,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() { + std::unique_ptr GpuProcessTransportFactory::CreateSoftwareOutputDevice( ui::Compositor* compositor) { + if (compositor->delegate()) { -+ scoped_ptr output_device = ++ std::unique_ptr output_device = + compositor->delegate()->CreateSoftwareOutputDevice(compositor); -+ if (output_device.get()) ++ if (output_device) + return output_device; + } + #if defined(MOJO_RUNNER_CLIENT) if (IsRunningInMojoShell()) { - return scoped_ptr( + return std::unique_ptr( diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index acae0be..90ff7e1 100644 +index a6245da..edfdeb5c 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -17,6 +17,7 @@ @@ -28,15 +28,15 @@ index acae0be..90ff7e1 100644 #include "cc/surfaces/surface_sequence.h" #include "cc/trees/layer_tree_host_client.h" #include "cc/trees/layer_tree_host_single_thread_client.h" -@@ -152,6 +153,17 @@ class COMPOSITOR_EXPORT CompositorBeginFrameObserver { - virtual void OnSendBeginFrame(const cc::BeginFrameArgs& args) = 0; +@@ -156,6 +157,17 @@ class COMPOSITOR_EXPORT CompositorLock + DISALLOW_COPY_AND_ASSIGN(CompositorLock); }; +class COMPOSITOR_EXPORT CompositorDelegate { + public: -+ virtual scoped_ptr CreateSoftwareOutputDevice( ++ virtual std::unique_ptr CreateSoftwareOutputDevice( + ui::Compositor* compositor) { -+ return scoped_ptr(); ++ return nullptr; + } + + protected: @@ -46,7 +46,7 @@ index acae0be..90ff7e1 100644 // Compositor object to take care of GPU painting. // A Browser compositor object is responsible for generating the final // displayable form of pixels comprising a single widget's contents. It draws an -@@ -172,6 +184,9 @@ class COMPOSITOR_EXPORT Compositor +@@ -176,6 +188,9 @@ class COMPOSITOR_EXPORT Compositor // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -56,7 +56,7 @@ index acae0be..90ff7e1 100644 // Sets the root of the layer tree drawn by this Compositor. The root layer // must have no parent. The compositor's root layer is reset if the root layer // is destroyed. NULL can be passed to reset the root layer, in which case the -@@ -346,6 +361,8 @@ class COMPOSITOR_EXPORT Compositor +@@ -345,6 +360,8 @@ class COMPOSITOR_EXPORT Compositor ui::ContextFactory* context_factory_; diff --git a/patch/patches/content_nav_1129.patch b/patch/patches/content_nav_1129.patch index 708c3033f..1f8492869 100644 --- a/patch/patches/content_nav_1129.patch +++ b/patch/patches/content_nav_1129.patch @@ -1,5 +1,5 @@ diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc -index a1389fc..6dcaabb 100644 +index 4ad49c8..f1fa7ab 100644 --- public/renderer/content_renderer_client.cc +++ public/renderer/content_renderer_client.cc @@ -98,7 +98,6 @@ bool ContentRendererClient::AllowPopup() { @@ -19,7 +19,7 @@ index a1389fc..6dcaabb 100644 return false; } diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h -index 0fab037..848a8f7 100644 +index d96adc9..348ae16 100644 --- public/renderer/content_renderer_client.h +++ public/renderer/content_renderer_client.h @@ -200,7 +200,6 @@ class CONTENT_EXPORT ContentRendererClient { @@ -39,10 +39,10 @@ index 0fab037..848a8f7 100644 // built in media player for the given |url|. Defaults to false. virtual bool ShouldUseMediaPlayerForURL(const GURL& url); diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc -index af44d57..93a57ff 100644 +index 4ff6aaa..4309775 100644 --- renderer/render_frame_impl.cc +++ renderer/render_frame_impl.cc -@@ -4697,7 +4697,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( +@@ -4771,7 +4771,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( (pending_navigation_params_ && !pending_navigation_params_->request_params.redirects.empty()); @@ -50,7 +50,7 @@ index af44d57..93a57ff 100644 // The handlenavigation API is deprecated and will be removed once // crbug.com/325351 is resolved. if (GetContentClient()->renderer()->HandleNavigation( -@@ -4706,7 +4705,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( +@@ -4780,7 +4779,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( is_redirect)) { return blink::WebNavigationPolicyIgnore; } diff --git a/patch/patches/extensions_1257.patch b/patch/patches/extensions_1257.patch index f5fc63f3e..e581b2a5b 100644 --- a/patch/patches/extensions_1257.patch +++ b/patch/patches/extensions_1257.patch @@ -1,8 +1,8 @@ diff --git browser/guest_view/extension_options/extension_options_guest.cc browser/guest_view/extension_options/extension_options_guest.cc -index 57eb9c2..275632a 100644 +index eb8eb4d..836ce55 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( +@@ -203,7 +203,9 @@ bool ExtensionOptionsGuest::ShouldCreateWebContents( const std::string& frame_name, const GURL& target_url, const std::string& partition_id, @@ -14,7 +14,7 @@ index 57eb9c2..275632a 100644 // view is used for displaying embedded extension options, we want any // external links to be opened in a new tab, not in a new guest view. diff --git browser/guest_view/extension_options/extension_options_guest.h browser/guest_view/extension_options/extension_options_guest.h -index b81fe41..41e3e2a 100644 +index e0309f7..f6a3878 100644 --- browser/guest_view/extension_options/extension_options_guest.h +++ browser/guest_view/extension_options/extension_options_guest.h @@ -56,7 +56,9 @@ class ExtensionOptionsGuest diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 289486e73..4468baeb8 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,5 +1,5 @@ diff --git resource_ids resource_ids -index b790c72..fca33586 100644 +index 5c46a26..b0babb3 100644 --- resource_ids +++ resource_ids @@ -14,6 +14,12 @@ diff --git a/patch/patches/gyp_331.patch b/patch/patches/gyp_331.patch index 4083ccc9e..c88feacda 100644 --- a/patch/patches/gyp_331.patch +++ b/patch/patches/gyp_331.patch @@ -1,5 +1,5 @@ diff --git gyp/generator/ninja.py gyp/generator/ninja.py -index edac48d..3bcc3b9 100644 +index 9cfc706..932dc86 100644 --- gyp/generator/ninja.py +++ gyp/generator/ninja.py @@ -760,7 +760,16 @@ class NinjaWriter(object): diff --git a/patch/patches/ime_1610.patch b/patch/patches/ime_1610.patch index 6a3fcdc67..bd31a4e1b 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 47160e5..1de804e 100644 +index 4ec5a84..7c99e6c 100644 --- input_method_win.cc +++ input_method_win.cc -@@ -629,8 +629,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const { +@@ -635,8 +635,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 ad60f03d1..6c18d4e8b 100644 --- a/patch/patches/message_loop_443.patch +++ b/patch/patches/message_loop_443.patch @@ -1,8 +1,8 @@ diff --git message_loop.cc message_loop.cc -index 01e7512..e3fcc0d 100644 +index 3fef91b..58ddbf3 100644 --- message_loop.cc +++ message_loop.cc -@@ -140,12 +140,6 @@ MessageLoop::~MessageLoop() { +@@ -142,12 +142,6 @@ MessageLoop::~MessageLoop() { // may be current. DCHECK((pump_ && current() == this) || (!pump_ && current() != this)); diff --git a/patch/patches/mime_handler_view_1565.patch b/patch/patches/mime_handler_view_1565.patch index 124c446b1..d3ca64715 100644 --- a/patch/patches/mime_handler_view_1565.patch +++ b/patch/patches/mime_handler_view_1565.patch @@ -1,5 +1,5 @@ diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc -index 27297f3..a7e0f40b 100644 +index ec15087..7b4a51f 100644 --- mime_handler_view_guest.cc +++ mime_handler_view_guest.cc @@ -134,6 +134,8 @@ void MimeHandlerViewGuest::CreateWebContents( @@ -43,7 +43,7 @@ index 27297f3..a7e0f40b 100644 WebContents* source, const content::OpenURLParams& params) { diff --git mime_handler_view_guest.h mime_handler_view_guest.h -index 4618d9f..84a621b 100644 +index ef91c24..f849918 100644 --- mime_handler_view_guest.h +++ mime_handler_view_guest.h @@ -75,6 +75,15 @@ class MimeHandlerViewGuest : diff --git a/patch/patches/net_filter_515.patch b/patch/patches/net_filter_515.patch index 1b6bed25e..9ad9cdfa1 100644 --- a/patch/patches/net_filter_515.patch +++ b/patch/patches/net_filter_515.patch @@ -25,7 +25,7 @@ index 81d8190..3405e31 100644 // This is the interface for subclasses of NetworkDelegate to implement. These // member functions will be called by the respective public notification diff --git filter/filter.h filter/filter.h -index 31d08d4..1de8e84 100644 +index 78b8c34..387bea5 100644 --- filter/filter.h +++ filter/filter.h @@ -59,6 +59,7 @@ @@ -36,7 +36,7 @@ index 31d08d4..1de8e84 100644 class GURL; namespace net { -@@ -239,6 +240,7 @@ class NET_EXPORT_PRIVATE Filter { +@@ -240,6 +241,7 @@ class NET_EXPORT_PRIVATE Filter { FilterType type() const { return type_id_; } protected: @@ -45,12 +45,12 @@ index 31d08d4..1de8e84 100644 friend class GZipUnitTest; friend class SdchFilterChainingTest; diff --git url_request/url_request_job.cc url_request/url_request_job.cc -index 239ab4b..03a5be1 100644 +index 63edfe3..8ab84cc 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()); + filter_ = SetupFilter(); + if (network_delegate_) + filter_.reset(network_delegate_->SetupFilter(request_, filter_.release())); diff --git a/patch/patches/net_urlrequest_1327.patch b/patch/patches/net_urlrequest_1327.patch index 26127dd31..b91486693 100644 --- a/patch/patches/net_urlrequest_1327.patch +++ b/patch/patches/net_urlrequest_1327.patch @@ -1,8 +1,8 @@ diff --git url_request.h url_request.h -index fcbc445..e424814 100644 +index eb94da8..e4a9370 100644 --- url_request.h +++ url_request.h -@@ -664,10 +664,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe), +@@ -659,10 +659,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe), // or after the response headers are received. void GetConnectionAttempts(ConnectionAttempts* out) const; diff --git a/patch/patches/pdfium_print_549365.patch b/patch/patches/pdfium_print_549365.patch index 1da55abcd..db5559c2d 100644 --- a/patch/patches/pdfium_print_549365.patch +++ b/patch/patches/pdfium_print_549365.patch @@ -1,16 +1,16 @@ diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp -index e5a53da..7e3311a 100644 +index 020ff8d..e4c5d9a 100644 --- fpdfsdk/fpdfview.cpp +++ fpdfsdk/fpdfview.cpp -@@ -18,6 +18,7 @@ - #include "fpdfsdk/include/fsdk_define.h" +@@ -19,6 +19,7 @@ #include "fpdfsdk/include/fsdk_mgr.h" #include "fpdfsdk/include/fsdk_rendercontext.h" -+#include "fpdfsdk/include/jsapi/fxjs_v8.h" #include "fpdfsdk/javascript/ijs_runtime.h" ++#include "fpdfsdk/jsapi/include/fxjs_v8.h" #include "public/fpdf_ext.h" #include "public/fpdf_progressive.h" -@@ -266,6 +267,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() { + #include "third_party/base/numerics/safe_conversions_impl.h" +@@ -267,6 +268,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() { #endif // PDF_ENABLE_XFA CPDF_ModuleMgr::Destroy(); CFX_GEModule::Destroy(); diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch index 966c727e6..fc7e8c60d 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 ae29c73..2b9c996 100644 +index 3a1b8fb..927061c 100644 --- public/common/common_param_traits_macros.h +++ public/common/common_param_traits_macros.h -@@ -196,6 +196,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) +@@ -207,6 +207,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 ae29c73..2b9c996 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 c1cdd19..33af607 100644 +index a0bc6f1..96d1478 100644 --- public/common/web_preferences.cc +++ public/common/web_preferences.cc -@@ -156,6 +156,7 @@ WebPreferences::WebPreferences() +@@ -163,6 +163,7 @@ WebPreferences::WebPreferences() pinch_overlay_scrollbar_thickness(0), use_solid_color_scrollbars(false), navigate_on_drag_drop(true), @@ -23,10 +23,10 @@ index c1cdd19..33af607 100644 inert_visual_viewport(false), record_whole_document(false), diff --git public/common/web_preferences.h public/common/web_preferences.h -index 7b72351..7513ce2 100644 +index 54b8ed4..160991f 100644 --- public/common/web_preferences.h +++ public/common/web_preferences.h -@@ -173,6 +173,7 @@ struct CONTENT_EXPORT WebPreferences { +@@ -176,6 +176,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 7b72351..7513ce2 100644 bool inert_visual_viewport; bool record_whole_document; diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc -index ae2d8ec..f90fba7 100644 +index 71c52a3..cef247f 100644 --- renderer/render_view_impl.cc +++ renderer/render_view_impl.cc -@@ -1483,6 +1483,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal( +@@ -1475,6 +1475,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal( blink::WebView* web_view, CompositorDependencies* compositor_deps) { ApplyWebPreferences(prefs, web_view); diff --git a/patch/patches/print_header_footer_1478_1565.patch b/patch/patches/print_header_footer_1478_1565.patch index 743d473c8..6074e620c 100644 --- a/patch/patches/print_header_footer_1478_1565.patch +++ b/patch/patches/print_header_footer_1478_1565.patch @@ -1,8 +1,8 @@ diff --git printing/common/print_messages.cc printing/common/print_messages.cc -index e1a107a..1601811 100644 +index 6798e35..215777f 100644 --- printing/common/print_messages.cc +++ printing/common/print_messages.cc -@@ -97,7 +97,6 @@ void PrintMsg_PrintPages_Params::Reset() { +@@ -103,7 +103,6 @@ void PrintMsg_PrintPages_Params::Reset() { pages = std::vector(); } @@ -10,13 +10,13 @@ index e1a107a..1601811 100644 PrintHostMsg_RequestPrintPreview_Params:: PrintHostMsg_RequestPrintPreview_Params() : is_modifiable(false), -@@ -119,4 +118,3 @@ PrintHostMsg_SetOptionsFromDocument_Params:: +@@ -125,4 +124,3 @@ PrintHostMsg_SetOptionsFromDocument_Params:: PrintHostMsg_SetOptionsFromDocument_Params:: ~PrintHostMsg_SetOptionsFromDocument_Params() { } -#endif // defined(ENABLE_PRINT_PREVIEW) diff --git printing/common/print_messages.h printing/common/print_messages.h -index 5cccd00..3a847b7 100644 +index 705211b..a524333 100644 --- printing/common/print_messages.h +++ printing/common/print_messages.h @@ -71,7 +71,6 @@ struct PrintMsg_PrintPages_Params { @@ -136,7 +136,7 @@ index 5cccd00..3a847b7 100644 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 9ee4cd9..719060c 100644 +index cfb1c77..33dad1a 100644 --- printing/renderer/print_web_view_helper.cc +++ printing/renderer/print_web_view_helper.cc @@ -83,6 +83,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f; @@ -395,7 +395,7 @@ index 9ee4cd9..719060c 100644 PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext() : total_page_count_(0), diff --git printing/renderer/print_web_view_helper.h printing/renderer/print_web_view_helper.h -index 39ef858..3c4f89e 100644 +index 7232b22..d2833f8 100644 --- printing/renderer/print_web_view_helper.h +++ printing/renderer/print_web_view_helper.h @@ -137,9 +137,7 @@ class PrintWebViewHelper @@ -492,7 +492,7 @@ index 39ef858..3c4f89e 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 6552666..8899b6d 100644 +index 1d23d5b..e99373b 100644 --- printing/renderer/print_web_view_helper_mac.mm +++ printing/renderer/print_web_view_helper_mac.mm @@ -68,7 +68,6 @@ void PrintWebViewHelper::PrintPageInternal( diff --git a/patch/patches/public_browser_1257.patch b/patch/patches/public_browser_1257.patch index 100a3d0c2..c8452d156 100644 --- a/patch/patches/public_browser_1257.patch +++ b/patch/patches/public_browser_1257.patch @@ -14,7 +14,7 @@ index 69190cf..05d2250 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git web_contents.h web_contents.h -index 7c46c73..1315ac11 100644 +index 6aa00e6..41223fa 100644 --- web_contents.h +++ web_contents.h @@ -55,8 +55,10 @@ class PageState; @@ -28,7 +28,7 @@ index 7c46c73..1315ac11 100644 struct CustomContextMenuContext; struct DropData; struct Manifest; -@@ -147,6 +149,10 @@ class WebContents : public PageNavigator, +@@ -149,6 +151,10 @@ class WebContents : public PageNavigator, // RenderFrame, have already been created on the renderer side, and // WebContents construction should take this into account. bool renderer_initiated_creation; @@ -40,7 +40,7 @@ index 7c46c73..1315ac11 100644 // Creates a new WebContents. diff --git web_contents_delegate.cc web_contents_delegate.cc -index fede931..09e6323 100644 +index df97348..8e2168e 100644 --- web_contents_delegate.cc +++ web_contents_delegate.cc @@ -144,7 +144,9 @@ bool WebContentsDelegate::ShouldCreateWebContents( @@ -55,7 +55,7 @@ index fede931..09e6323 100644 } diff --git web_contents_delegate.h web_contents_delegate.h -index 074333a..3a8c277 100644 +index 74b56e1..b4dcb2a 100644 --- web_contents_delegate.h +++ web_contents_delegate.h @@ -42,9 +42,11 @@ class JavaScriptDialogManager; @@ -70,7 +70,7 @@ index 074333a..3a8c277 100644 struct ColorSuggestion; struct ContextMenuParams; struct DropData; -@@ -311,7 +313,9 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -307,7 +309,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_view_host_impl_1392.patch b/patch/patches/render_view_host_impl_1392.patch index 871f669bc..c07e68c98 100644 --- a/patch/patches/render_view_host_impl_1392.patch +++ b/patch/patches/render_view_host_impl_1392.patch @@ -1,5 +1,5 @@ diff --git render_view_host_impl.h render_view_host_impl.h -index 4ec87ca..6919986 100644 +index d54b2d7..c696c6f 100644 --- render_view_host_impl.h +++ render_view_host_impl.h @@ -193,6 +193,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost, diff --git a/patch/patches/render_widget_host_1070383005.patch b/patch/patches/render_widget_host_1070383005.patch index cc6a558ff..68b7c7f22 100644 --- a/patch/patches/render_widget_host_1070383005.patch +++ b/patch/patches/render_widget_host_1070383005.patch @@ -1,8 +1,8 @@ diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm -index 09859f1..0c546e5 100644 +index 86481a9..e2e56c0 100644 --- render_widget_host_view_mac.mm +++ render_widget_host_view_mac.mm -@@ -537,9 +537,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, +@@ -572,9 +572,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, // Paint this view host with |background_color_| when there is no content // ready to draw. background_layer_.reset([[CALayer alloc] init]); diff --git a/patch/patches/renderer_preferences_util_545103.patch b/patch/patches/renderer_preferences_util_545103.patch index 20a63eabf..6a760178a 100644 --- a/patch/patches/renderer_preferences_util_545103.patch +++ b/patch/patches/renderer_preferences_util_545103.patch @@ -1,8 +1,8 @@ diff --git renderer_preferences_util.cc renderer_preferences_util.cc -index 2fff3f3..86c7f0c 100644 +index 1a1a910..94fe66a 100644 --- renderer_preferences_util.cc +++ renderer_preferences_util.cc -@@ -27,7 +27,8 @@ +@@ -22,7 +22,8 @@ #include "ui/views/controls/textfield/textfield.h" #endif @@ -12,7 +12,7 @@ index 2fff3f3..86c7f0c 100644 #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "ui/views/linux_ui/linux_ui.h" -@@ -95,7 +96,8 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs, +@@ -72,7 +73,8 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs, prefs->caret_blink_interval = views::Textfield::GetCaretBlinkMs() / 1000.0; #endif diff --git a/patch/patches/stream_context_1710.patch b/patch/patches/stream_context_1710.patch index 3aff4098c..b6a798260 100644 --- a/patch/patches/stream_context_1710.patch +++ b/patch/patches/stream_context_1710.patch @@ -1,8 +1,8 @@ diff --git stream_context.cc stream_context.cc -index e338396..150cde5 100644 +index 3782205..5d97643 100644 --- stream_context.cc +++ stream_context.cc -@@ -19,6 +19,10 @@ namespace content { +@@ -21,6 +21,10 @@ namespace content { StreamContext::StreamContext() {} @@ -14,10 +14,10 @@ index e338396..150cde5 100644 if (!context->GetUserData(kStreamContextKeyName)) { scoped_refptr stream = new StreamContext(); diff --git stream_context.h stream_context.h -index ad8f65c..60310db 100644 +index 075ae3e..57fb5fd 100644 --- stream_context.h +++ stream_context.h -@@ -28,6 +28,7 @@ class StreamContext +@@ -29,6 +29,7 @@ class StreamContext public: StreamContext(); diff --git a/patch/patches/ui_webview_1257.patch b/patch/patches/ui_webview_1257.patch index 513baf147..22c817f6e 100644 --- a/patch/patches/ui_webview_1257.patch +++ b/patch/patches/ui_webview_1257.patch @@ -1,5 +1,5 @@ diff --git web_dialog_view.cc web_dialog_view.cc -index c5a2b03..0594c4a 100644 +index d8afe6e..59259b7 100644 --- web_dialog_view.cc +++ web_dialog_view.cc @@ -341,7 +341,9 @@ bool WebDialogView::ShouldCreateWebContents( @@ -14,7 +14,7 @@ index c5a2b03..0594c4a 100644 return delegate_->HandleShouldCreateWebContents(); return true; diff --git web_dialog_view.h web_dialog_view.h -index a978921c..5f3fd33 100644 +index 65be6d54..7802d6d 100644 --- web_dialog_view.h +++ web_dialog_view.h @@ -123,7 +123,9 @@ class WEBVIEW_EXPORT WebDialogView : public views::ClientView, diff --git a/patch/patches/views_1749.patch b/patch/patches/views_1749.patch index 9abc80a30..8a6eb52a0 100644 --- a/patch/patches/views_1749.patch +++ b/patch/patches/views_1749.patch @@ -1,5 +1,5 @@ diff --git controls/button/menu_button.cc controls/button/menu_button.cc -index 4d1a1b9..7854bb0 100644 +index 3602b45..ec83c86 100644 --- controls/button/menu_button.cc +++ controls/button/menu_button.cc @@ -199,7 +199,7 @@ void MenuButton::OnPaint(gfx::Canvas* canvas) { @@ -56,13 +56,13 @@ index 696a941..ce5abcd 100644 // The time is used for simulating menu behavior for the menu button; that // is, if the menu is shown and the button is pressed, we need to close the diff --git view.h view.h -index a85ef3d..42bd451 100644 +index 6b45c63..7e52409 100644 --- view.h +++ view.h @@ -18,6 +18,7 @@ + #include "base/i18n/rtl.h" #include "base/logging.h" #include "base/macros.h" - #include "base/memory/scoped_ptr.h" +#include "base/supports_user_data.h" #include "build/build_config.h" #include "ui/accessibility/ax_enums.h" diff --git a/patch/patches/views_widget_180_1481_1677_1749.patch b/patch/patches/views_widget_180_1481_1677_1749.patch index f807b3420..dc658df7e 100644 --- a/patch/patches/views_widget_180_1481_1677_1749.patch +++ b/patch/patches/views_widget_180_1481_1677_1749.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 29e1eef0..2d3408d 100644 +index c33e325c..04ad7d9 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -674,6 +674,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { +@@ -695,6 +695,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { } } #endif @@ -17,18 +17,18 @@ index 29e1eef0..2d3408d 100644 if (host_ && set_focus_on_mouse_down_or_key_event_) { set_focus_on_mouse_down_or_key_event_ = false; diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index febe516..208bdad 100644 +index dd88fae..0aaaf78 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -47,6 +47,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() +@@ -40,6 +40,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() current_device_scale_factor_(0), - current_display_rotation_(gfx::Display::ROTATE_0), + current_display_rotation_(display::Display::ROTATE_0), pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), + has_external_parent_(false), renderer_frame_number_(0), - text_input_state_(new TextInputState()), weak_factory_(this) {} -@@ -300,6 +301,10 @@ void RenderWidgetHostViewBase::EndFrameSubscription() { + +@@ -250,6 +251,10 @@ void RenderWidgetHostViewBase::EndFrameSubscription() { NOTREACHED(); } @@ -40,18 +40,18 @@ index febe516..208bdad 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 c11775b..535caa2 100644 +index 8eb9689..d076b3b 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h @@ -97,6 +97,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, void BeginFrameSubscription( - scoped_ptr subscriber) override; + std::unique_ptr subscriber) override; void EndFrameSubscription() override; + void SetHasExternalParent(bool val) override; // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. -@@ -444,6 +445,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -423,6 +424,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, // renderer. bool pinch_zoom_enabled_; @@ -63,10 +63,10 @@ index c11775b..535caa2 100644 void FlushInput(); diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index 99459ad..bc1d7e7 100644 +index b902288..932f398 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h -@@ -159,6 +159,10 @@ class CONTENT_EXPORT RenderWidgetHostView { +@@ -160,6 +160,10 @@ class CONTENT_EXPORT RenderWidgetHostView { // deleted after this call. virtual void EndFrameSubscription() = 0; @@ -75,13 +75,13 @@ index 99459ad..bc1d7e7 100644 + virtual void SetHasExternalParent(bool val) = 0; + #if defined(OS_MACOSX) - // Set the view's active state (i.e., tint state of controls). - virtual void SetActive(bool active) = 0; + // Return the accelerated widget which hosts the CALayers that draw the + // content of the view in GetNativeView. This may be null. diff --git ui/views/widget/desktop_aura/desktop_screen_win.cc ui/views/widget/desktop_aura/desktop_screen_win.cc -index 4df7b7f..3427925 100644 +index f772f64..7d13f9f 100644 --- ui/views/widget/desktop_aura/desktop_screen_win.cc +++ ui/views/widget/desktop_aura/desktop_screen_win.cc -@@ -32,6 +32,8 @@ gfx::Display DesktopScreenWin::GetDisplayMatching( +@@ -32,6 +32,8 @@ display::Display DesktopScreenWin::GetDisplayMatching( } HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const { @@ -91,10 +91,10 @@ index 4df7b7f..3427925 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 fa9ea48..8e9ec16 100644 +index 7591042..ea6b52c 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( +@@ -86,6 +86,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( should_animate_window_close_(false), pending_close_(false), has_non_client_view_(false), @@ -102,7 +102,7 @@ index fa9ea48..8e9ec16 100644 tooltip_(NULL) { } -@@ -134,8 +135,12 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window, +@@ -136,8 +137,12 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window, native_widget_delegate_); HWND parent_hwnd = NULL; @@ -116,7 +116,7 @@ index fa9ea48..8e9ec16 100644 remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); -@@ -631,6 +636,10 @@ bool DesktopWindowTreeHostWin::CanActivate() const { +@@ -642,6 +647,10 @@ bool DesktopWindowTreeHostWin::CanActivate() const { return native_widget_delegate_->CanActivate(); } @@ -127,7 +127,7 @@ index fa9ea48..8e9ec16 100644 bool DesktopWindowTreeHostWin::WantsMouseEventsWhenInactive() const { return wants_mouse_events_when_inactive_; } -@@ -805,11 +814,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -822,11 +831,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -146,10 +146,10 @@ index fa9ea48..8e9ec16 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 3465112..28822c6 100644 +index f357a5c..173d64d 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -@@ -136,6 +136,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -137,6 +137,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin bool CanMaximize() const override; bool CanMinimize() const override; bool CanActivate() const override; @@ -157,7 +157,7 @@ index 3465112..28822c6 100644 bool WantsMouseEventsWhenInactive() const override; bool WidgetSizeIsClientSize() const override; bool IsModal() const override; -@@ -248,6 +249,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -250,6 +251,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin // True if the window should have the frame removed. bool remove_standard_frame_; @@ -169,10 +169,10 @@ index 3465112..28822c6 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 cecae1e..b9e80b6 100644 +index f792797..417d965 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -@@ -167,6 +167,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( +@@ -170,6 +170,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( use_native_frame_(false), should_maximize_after_map_(false), use_argb_visual_(false), @@ -180,7 +180,7 @@ index cecae1e..b9e80b6 100644 drag_drop_client_(NULL), native_widget_delegate_(native_widget_delegate), desktop_native_widget_aura_(desktop_native_widget_aura), -@@ -175,7 +176,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( +@@ -178,7 +179,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( custom_window_shape_(false), urgency_hint_set_(false), activatable_(true), @@ -190,7 +190,7 @@ index cecae1e..b9e80b6 100644 } DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() { -@@ -386,7 +388,8 @@ void DesktopWindowTreeHostX11::CloseNow() { +@@ -389,7 +391,8 @@ void DesktopWindowTreeHostX11::CloseNow() { // Actually free our native resources. if (ui::PlatformEventSource::GetInstance()) ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); @@ -200,7 +200,7 @@ index cecae1e..b9e80b6 100644 xwindow_ = None; desktop_native_widget_aura_->OnHostClosed(); -@@ -535,6 +538,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( +@@ -538,6 +541,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( } gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { @@ -209,7 +209,7 @@ index cecae1e..b9e80b6 100644 return ToDIPRect(bounds_in_pixels_); } -@@ -972,6 +977,8 @@ void DesktopWindowTreeHostX11::HideImpl() { +@@ -982,6 +987,8 @@ void DesktopWindowTreeHostX11::HideImpl() { } gfx::Rect DesktopWindowTreeHostX11::GetBounds() const { @@ -218,7 +218,7 @@ index cecae1e..b9e80b6 100644 return bounds_in_pixels_; } -@@ -1029,6 +1036,8 @@ void DesktopWindowTreeHostX11::SetBounds( +@@ -1039,6 +1046,8 @@ void DesktopWindowTreeHostX11::SetBounds( } gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const { @@ -227,7 +227,7 @@ index cecae1e..b9e80b6 100644 return bounds_in_pixels_.origin(); } -@@ -1137,9 +1146,15 @@ void DesktopWindowTreeHostX11::InitX11Window( +@@ -1147,9 +1156,15 @@ void DesktopWindowTreeHostX11::InitX11Window( use_argb_visual_ = true; } @@ -244,7 +244,7 @@ index cecae1e..b9e80b6 100644 bounds_in_pixels_.y(), bounds_in_pixels_.width(), bounds_in_pixels_.height(), 0, // border width -@@ -1767,6 +1782,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( +@@ -1771,6 +1786,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( } break; } @@ -256,7 +256,7 @@ index cecae1e..b9e80b6 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 7e842fe..bc5376f 100644 +index 6a963f8..6cf5c02 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h @@ -86,6 +86,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -272,7 +272,7 @@ index 7e842fe..bc5376f 100644 protected: // Overridden from DesktopWindowTreeHost: void Init(aura::Window* content_window, -@@ -262,6 +268,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -263,6 +269,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // The bounds of |xwindow_|. gfx::Rect bounds_in_pixels_; @@ -282,7 +282,7 @@ index 7e842fe..bc5376f 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 -@@ -298,6 +307,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_; @@ -292,8 +292,8 @@ index 7e842fe..bc5376f 100644 + DesktopDragDropClientAuraX11* drag_drop_client_; - scoped_ptr x11_non_client_event_filter_; -@@ -350,6 +363,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 + std::unique_ptr x11_non_client_event_filter_; +@@ -351,6 +364,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 base::WeakPtrFactory close_widget_factory_; @@ -304,7 +304,7 @@ index 7e842fe..bc5376f 100644 }; diff --git ui/views/widget/desktop_aura/x11_desktop_handler.cc ui/views/widget/desktop_aura/x11_desktop_handler.cc -index 5ab84f9..c4095fa 100644 +index 8ec4b1e..587e4e3 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; @@ -351,7 +351,7 @@ index 5ab84f9..c4095fa 100644 DCHECK_EQ(gfx::GetXDisplay(), xdisplay_); // If the window is not already active, send a hint to activate it -@@ -175,8 +203,10 @@ uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) { +@@ -191,8 +219,10 @@ uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) { ::Window window; if (ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) && window) { @@ -365,7 +365,7 @@ index 5ab84f9..c4095fa 100644 x_active_window_ = None; } diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index ffafd0d..e4a12ba 100644 +index a86fe48..8ec377d 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc @@ -126,9 +126,11 @@ Widget::InitParams::InitParams(Type type) @@ -380,7 +380,7 @@ index ffafd0d..e4a12ba 100644 native_widget(nullptr), desktop_window_tree_host(nullptr), layer_type(ui::LAYER_TEXTURED), -@@ -166,6 +168,7 @@ Widget::Widget() +@@ -165,6 +167,7 @@ Widget::Widget() auto_release_capture_(true), root_layers_dirty_(false), movement_disabled_(false), @@ -388,8 +388,8 @@ index ffafd0d..e4a12ba 100644 observer_manager_(this) { } -@@ -291,7 +294,8 @@ void Widget::Init(const InitParams& in_params) { - InitParams params = in_params; +@@ -296,7 +299,8 @@ void Widget::Init(const InitParams& in_params) { + params.name = params.delegate->GetContentsView()->GetClassName(); params.child |= (params.type == InitParams::TYPE_CONTROL); - is_top_level_ = !params.child; @@ -398,8 +398,8 @@ index ffafd0d..e4a12ba 100644 if (params.opacity == views::Widget::InitParams::INFER_OPACITY && params.type != views::Widget::InitParams::TYPE_WINDOW && -@@ -353,7 +357,12 @@ void Widget::Init(const InitParams& in_params) { - Minimize(); +@@ -360,7 +364,12 @@ void Widget::Init(const InitParams& in_params) { + } } else if (params.delegate) { SetContentsView(params.delegate->GetContentsView()); - SetInitialBoundsForFramelessWindow(params.bounds); @@ -413,10 +413,10 @@ index ffafd0d..e4a12ba 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 0ceaf82..7faed82 100644 +index e52c7ff..57e466c 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -230,12 +230,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -238,12 +238,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // rendered, and that the client area should be equivalent to the window // area. Only used on some platforms (Windows and Linux). bool remove_standard_frame; @@ -431,10 +431,10 @@ index 0ceaf82..7faed82 100644 ui::WindowShowState show_state; gfx::NativeView parent; + gfx::AcceleratedWidget parent_widget; + // Used only by mus and is necessitated by mus not being a NativeView. + mus::Window* parent_mus = nullptr; // Specifies the initial bounds of the Widget. Default is empty, which means - // the NativeWidget may specify a default size. If the parent is specified, - // |bounds| is in the parent's coordinate system. If the parent is not -@@ -735,6 +740,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -754,6 +759,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, bool movement_disabled() const { return movement_disabled_; } void set_movement_disabled(bool disabled) { movement_disabled_ = disabled; } @@ -445,7 +445,7 @@ index 0ceaf82..7faed82 100644 // Returns the work area bounds of the screen the Widget belongs to. gfx::Rect GetWorkAreaBoundsInScreen() const; -@@ -949,6 +958,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -972,6 +981,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // disabled. bool movement_disabled_; @@ -457,10 +457,10 @@ index 0ceaf82..7faed82 100644 DISALLOW_COPY_AND_ASSIGN(Widget); diff --git ui/views/widget/widget_hwnd_utils.cc ui/views/widget/widget_hwnd_utils.cc -index ca561b6..7940b5a 100644 +index b843416..8b81a51 100644 --- ui/views/widget/widget_hwnd_utils.cc +++ ui/views/widget/widget_hwnd_utils.cc -@@ -117,6 +117,11 @@ void CalculateWindowStylesFromInitParams( +@@ -114,6 +114,11 @@ void CalculateWindowStylesFromInitParams( // See layered window comment above. if (*ex_style & WS_EX_COMPOSITED) *style &= ~(WS_THICKFRAME | WS_CAPTION); @@ -473,10 +473,10 @@ index ca561b6..7940b5a 100644 } case Widget::InitParams::TYPE_CONTROL: diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index 74d5cd6..19d208e 100644 +index 921b838..954d426 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -838,6 +838,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() { +@@ -852,6 +852,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() { } else { style &= ~WS_MINIMIZEBOX; } @@ -485,7 +485,7 @@ index 74d5cd6..19d208e 100644 SetWindowLong(hwnd(), GWL_STYLE, style); } -@@ -2433,8 +2435,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -2503,8 +2505,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. @@ -501,7 +501,7 @@ index 74d5cd6..19d208e 100644 // There are cases where the code handling the message destroys the window, diff --git ui/views/win/hwnd_message_handler_delegate.h ui/views/win/hwnd_message_handler_delegate.h -index 007157a..78fa051 100644 +index 631f359..9a59aff 100644 --- ui/views/win/hwnd_message_handler_delegate.h +++ ui/views/win/hwnd_message_handler_delegate.h @@ -57,6 +57,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate { diff --git a/patch/patches/webcursor_1894.patch b/patch/patches/webcursor_1894.patch deleted file mode 100644 index e751b0c4c..000000000 --- a/patch/patches/webcursor_1894.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git webcursor_aurawin.cc webcursor_aurawin.cc -index b8b4c57..69fe05e 100644 ---- webcursor_aurawin.cc -+++ webcursor_aurawin.cc -@@ -37,6 +37,7 @@ ui::PlatformCursor WebCursor::GetPlatformCursor() { - - void WebCursor::InitPlatformData() { - custom_cursor_ = NULL; -+ device_scale_factor_ = 1.0f; - } - - bool WebCursor::SerializePlatformData(base::Pickle* pickle) const { -@@ -59,6 +60,7 @@ void WebCursor::CleanupPlatformData() { - } - - void WebCursor::CopyPlatformData(const WebCursor& other) { -+ device_scale_factor_ = other.device_scale_factor_; - } - - } // namespace content diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 1d5021b3c..8bbbed810 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 821b3de..fa8898f 100644 +index ab5b0e7..c977d57 100644 --- Source/web/ChromeClientImpl.cpp +++ Source/web/ChromeClientImpl.cpp -@@ -879,7 +879,7 @@ bool ChromeClientImpl::hasOpenedPopup() const +@@ -880,7 +880,7 @@ bool ChromeClientImpl::hasOpenedPopup() const PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { notifyPopupOpeningObservers(); @@ -12,10 +12,10 @@ index 821b3de..fa8898f 100644 DCHECK(RuntimeEnabledFeatures::pagePopupEnabled()); diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp -index e906bb7..40965ed 100644 +index 218f70f..24824fd 100644 --- Source/web/WebViewImpl.cpp +++ Source/web/WebViewImpl.cpp -@@ -416,6 +416,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) +@@ -415,6 +415,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_enableFakePageScaleAnimationForTesting(false) , m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationUseAnchor(false) @@ -23,7 +23,7 @@ index e906bb7..40965ed 100644 , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) , m_compositorDeviceScaleFactorOverride(0) -@@ -4120,9 +4121,14 @@ void WebViewImpl::pageScaleFactorChanged() +@@ -4072,9 +4073,14 @@ void WebViewImpl::pageScaleFactorChanged() m_client->pageScaleFactorChanged(); } @@ -40,10 +40,10 @@ index e906bb7..40965ed 100644 void WebViewImpl::startDragging(LocalFrame* frame, diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h -index 12d658a..354438c 100644 +index 3015ed1..0eb5455 100644 --- Source/web/WebViewImpl.h +++ Source/web/WebViewImpl.h -@@ -390,7 +390,8 @@ public: +@@ -383,7 +383,8 @@ public: // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -53,7 +53,7 @@ index 12d658a..354438c 100644 bool shouldAutoResize() const { -@@ -688,6 +689,8 @@ private: +@@ -672,6 +673,8 @@ private: float m_fakePageScaleAnimationPageScaleFactor; bool m_fakePageScaleAnimationUseAnchor; @@ -63,10 +63,10 @@ index 12d658a..354438c 100644 bool m_ignoreInputEvents; diff --git public/web/WebView.h public/web/WebView.h -index a04be6d..258e331 100644 +index d25040c..67a9a1a 100644 --- public/web/WebView.h +++ public/web/WebView.h -@@ -394,6 +394,7 @@ public: +@@ -443,6 +443,7 @@ public: // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void setUseExternalPopupMenus(bool); diff --git a/tests/cefclient/browser/main_message_loop_external_pump.h b/tests/cefclient/browser/main_message_loop_external_pump.h index 26680c0a8..aa376776d 100644 --- a/tests/cefclient/browser/main_message_loop_external_pump.h +++ b/tests/cefclient/browser/main_message_loop_external_pump.h @@ -23,7 +23,7 @@ class MainMessageLoopExternalPump : public MainMessageLoopStd { public: // Creates the singleton instance of this object. Must be called on the main // application thread. - static scoped_ptr Create(); + static SCOPED_PTR(MainMessageLoopExternalPump) Create(); // Returns the singleton instance of this object. Safe to call from any // thread. diff --git a/tests/cefclient/browser/main_message_loop_external_pump_linux.cc b/tests/cefclient/browser/main_message_loop_external_pump_linux.cc index 34eaafd8c..2e4306d01 100644 --- a/tests/cefclient/browser/main_message_loop_external_pump_linux.cc +++ b/tests/cefclient/browser/main_message_loop_external_pump_linux.cc @@ -98,7 +98,7 @@ class MainMessageLoopExternalPumpLinux : public MainMessageLoopExternalPump { int wakeup_pipe_write_; // Use a scoped_ptr to avoid needing the definition of GPollFD in the header. - scoped_ptr wakeup_gpollfd_; + SCOPED_PTR(GPollFD) wakeup_gpollfd_; }; // Return a timeout suitable for the glib loop, -1 to block forever, @@ -295,9 +295,9 @@ bool MainMessageLoopExternalPumpLinux::IsTimerPending() { } // namespace // static -scoped_ptr +SCOPED_PTR(MainMessageLoopExternalPump) MainMessageLoopExternalPump::Create() { - return make_scoped_ptr( + return SCOPED_PTR(MainMessageLoopExternalPump)( new MainMessageLoopExternalPumpLinux()); } diff --git a/tests/cefclient/browser/main_message_loop_external_pump_mac.mm b/tests/cefclient/browser/main_message_loop_external_pump_mac.mm index 95275d8ba..58b432d6e 100644 --- a/tests/cefclient/browser/main_message_loop_external_pump_mac.mm +++ b/tests/cefclient/browser/main_message_loop_external_pump_mac.mm @@ -162,9 +162,9 @@ void MainMessageLoopExternalPumpMac::KillTimer() { } // static -scoped_ptr +SCOPED_PTR(MainMessageLoopExternalPump) MainMessageLoopExternalPump::Create() { - return make_scoped_ptr( + return SCOPED_PTR(MainMessageLoopExternalPump)( new MainMessageLoopExternalPumpMac()); } diff --git a/tests/cefclient/browser/main_message_loop_external_pump_win.cc b/tests/cefclient/browser/main_message_loop_external_pump_win.cc index 5ac8bd32d..5a456f925 100644 --- a/tests/cefclient/browser/main_message_loop_external_pump_win.cc +++ b/tests/cefclient/browser/main_message_loop_external_pump_win.cc @@ -140,9 +140,9 @@ LRESULT CALLBACK MainMessageLoopExternalPumpWin::WndProc( } // namespace // static -scoped_ptr +SCOPED_PTR(MainMessageLoopExternalPump) MainMessageLoopExternalPump::Create() { - return make_scoped_ptr( + return SCOPED_PTR(MainMessageLoopExternalPump)( new MainMessageLoopExternalPumpWin()); } diff --git a/tests/unittests/frame_unittest.cc b/tests/unittests/frame_unittest.cc index 3d9cc210d..0f1959426 100644 --- a/tests/unittests/frame_unittest.cc +++ b/tests/unittests/frame_unittest.cc @@ -3,7 +3,6 @@ // can be found in the LICENSE file. #include "include/base/cef_bind.h" -#include "include/base/cef_scoped_ptr.h" #include "include/wrapper/cef_closure_task.h" #include "include/wrapper/cef_stream_resource_handler.h" #include "tests/cefclient/browser/client_app_browser.h" diff --git a/tests/unittests/os_rendering_unittest.cc b/tests/unittests/os_rendering_unittest.cc index 8f4a622bc..d389d26de 100644 --- a/tests/unittests/os_rendering_unittest.cc +++ b/tests/unittests/os_rendering_unittest.cc @@ -118,10 +118,6 @@ const unsigned int kNativeKeyTestCodes[] = { }; #endif -// width for the icon that appear on the screen when pressing -// middle mouse button -const int kMiddleButtonIconWidth = 16; - // test type enum OSRTestType { // IsWindowRenderingDisabled should be true @@ -142,8 +138,6 @@ enum OSRTestType { OSR_TEST_SCREEN_POINT, // left click in text box should query repainting edit box area OSR_TEST_CLICK_LEFT, - // clicking middle mouse button, will draw the scroll icon - OSR_TEST_CLICK_MIDDLE, // Resize should trigger a full repaint with the new given size OSR_TEST_RESIZE, // Invalidate should trigger repaint synchronously @@ -257,10 +251,6 @@ class OSRTestHandler : public RoutingTestHandler, EXPECT_STREQ(messageStr.c_str(), "osrclick0"); DestroySucceededTestSoon(); break; - case OSR_TEST_CLICK_MIDDLE: - EXPECT_STREQ(messageStr.c_str(), "osrclick1"); - DestroySucceededTestSoon(); - break; case OSR_TEST_MOUSE_MOVE: EXPECT_STREQ(messageStr.c_str(), "osrmousemove"); DestroySucceededTestSoon(); @@ -507,29 +497,6 @@ class OSRTestHandler : public RoutingTestHandler, mouse_event, MBT_LEFT, true, 1); } break; - case OSR_TEST_CLICK_MIDDLE: - if (StartTest()) { - CefMouseEvent mouse_event; - const CefRect& expected_rect = GetExpectedRect(0); - mouse_event.x = MiddleX(expected_rect); - mouse_event.y = MiddleY(expected_rect); - mouse_event.modifiers = 0; - browser->GetHost()->SendMouseClickEvent( - mouse_event, MBT_MIDDLE, false, 1); - browser->GetHost()->SendMouseClickEvent( - mouse_event, MBT_MIDDLE, true, 1); - } else { - EXPECT_EQ(dirtyRects.size(), 1U); - const CefRect& expected_rect = GetExpectedRect(0); - CefRect button_icon_rect( - MiddleX(expected_rect) - kMiddleButtonIconWidth / 2, - MiddleY(expected_rect) - kMiddleButtonIconWidth / 2, - kMiddleButtonIconWidth, kMiddleButtonIconWidth); - button_icon_rect = GetScaledRect(button_icon_rect); - EXPECT_EQ(dirtyRects[0], button_icon_rect); - DestroySucceededTestSoon(); - } - break; case OSR_TEST_RESIZE: if (StartTest()) { browser->GetHost()->WasResized(); @@ -1078,11 +1045,6 @@ OSR_TEST(MouseRightClick, OSR_TEST_CLICK_RIGHT, 1.0f); OSR_TEST(MouseRightClick2x, OSR_TEST_CLICK_RIGHT, 2.0f); OSR_TEST(MouseLeftClick, OSR_TEST_CLICK_LEFT, 1.0f); OSR_TEST(MouseLeftClick2x, OSR_TEST_CLICK_LEFT, 2.0f); -#if !defined(OS_WIN) -// The middle mouse click scroll icon is not currently shown on Windows. -OSR_TEST(MouseMiddleClick, OSR_TEST_CLICK_MIDDLE, 1.0f); -OSR_TEST(MouseMiddleClick2x, OSR_TEST_CLICK_MIDDLE, 2.0f); -#endif OSR_TEST(ScreenPoint, OSR_TEST_SCREEN_POINT, 1.0f); OSR_TEST(ScreenPoint2x, OSR_TEST_SCREEN_POINT, 2.0f); OSR_TEST(Resize, OSR_TEST_RESIZE, 1.0f); diff --git a/tests/unittests/views/window_unittest.cc b/tests/unittests/views/window_unittest.cc index c76d91f24..df2f66885 100644 --- a/tests/unittests/views/window_unittest.cc +++ b/tests/unittests/views/window_unittest.cc @@ -22,6 +22,17 @@ const int kStateDelayMS = 200; const int kWSize = TestWindowDelegate::kWSize; +// Test that |expected| and |actual| are within |allowed_deviance| of each +// other. +void ExpectCloseRects(const CefRect& expected, + const CefRect& actual, + int allowed_deviance) { + EXPECT_LE(abs(expected.x - actual.x), allowed_deviance); + EXPECT_LE(abs(expected.y - actual.y), allowed_deviance); + EXPECT_LE(abs(expected.width - actual.width), allowed_deviance); + EXPECT_LE(abs(expected.height - actual.height), allowed_deviance); +} + void WindowCreateImpl(base::WaitableEvent* event) { TestWindowDelegate::RunTest(event, TestWindowDelegate::WindowTest(), false); } @@ -87,10 +98,10 @@ void CreateBoxLayout(CefRefPtr parent) { parent->Layout(); // The children should each take up 50% of the client area. - EXPECT_EQ(CefRect(0, 0, kWSize, kWSize / 2), - panel_child1->GetBounds()); - EXPECT_EQ(CefRect(0, kWSize / 2, kWSize, kWSize / 2), - panel_child2->GetBounds()); + ExpectCloseRects(CefRect(0, 0, kWSize, kWSize / 2), + panel_child1->GetBounds(), 1); + ExpectCloseRects(CefRect(0, kWSize / 2, kWSize, kWSize / 2), + panel_child2->GetBounds(), 1); } void RunWindowLayoutAndCoords(CefRefPtr window) {