From 05ee60b7b4704f5e763b65d2a1fbea83815b34ac Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 20 Jun 2016 18:59:23 -0400 Subject: [PATCH] Update to Chromium revision 318e6f54 (#400326) --- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- cef.gyp | 3 +- libcef/browser/browser_context_impl.cc | 4 +- libcef/browser/browser_host_impl.cc | 7 +- libcef/browser/browser_host_impl.h | 2 +- libcef/browser/browser_main.cc | 1 - libcef/browser/context.cc | 5 +- libcef/browser/devtools_frontend.cc | 25 +++-- libcef/browser/extensions/extension_system.cc | 12 +- .../extensions/extensions_browser_client.cc | 8 ++ libcef/browser/file_dialog_manager.cc | 88 ++++++++------- libcef/browser/file_dialog_manager.h | 25 ++++- .../browser_platform_delegate_native_win.cc | 1 + libcef/browser/native/native_menu_win.cc | 9 +- libcef/browser/net/resource_request_job.cc | 9 -- libcef/browser/net/resource_request_job.h | 1 - .../net/url_request_context_getter_impl.cc | 33 +++++- .../net/url_request_context_getter_impl.h | 7 ++ .../osr/browser_platform_delegate_osr.cc | 23 +++- .../osr/browser_platform_delegate_osr.h | 3 + .../osr/render_widget_host_view_osr.cc | 16 ++- .../browser/osr/render_widget_host_view_osr.h | 20 ++-- .../osr/render_widget_host_view_osr_mac.mm | 50 ++++++--- libcef/browser/prefs/browser_prefs.cc | 10 +- libcef/browser/printing/print_view_manager.cc | 2 +- .../printing/print_view_manager_base.cc | 15 +-- .../resource_dispatcher_host_delegate.cc | 21 ++-- .../resource_dispatcher_host_delegate.h | 3 +- libcef/browser/views/view_util.cc | 2 +- libcef/common/crash_reporter_client.cc | 31 +++-- libcef/common/crash_reporter_client.h | 6 +- libcef/common/drag_data_impl.h | 4 +- libcef/common/values_impl.cc | 3 +- libcef/renderer/content_renderer_client.cc | 6 + libcef/renderer/media/cef_key_systems.cc | 5 +- libcef/renderer/pepper/pepper_helper.cc | 4 + libcef/renderer/pepper/pepper_helper.h | 1 + .../plugins/cef_plugin_placeholder.cc | 1 - .../renderer/plugins/cef_plugin_placeholder.h | 1 - libcef/renderer/plugins/plugin_preroller.cc | 4 + libcef/renderer/plugins/plugin_preroller.h | 3 + libcef/renderer/render_frame_observer.cc | 4 + libcef/renderer/render_frame_observer.h | 1 + libcef/renderer/v8_impl.cc | 1 - patch/patch.cfg | 5 +- .../browser_frame_host_guest_1687.patch | 4 +- patch/patches/browser_plugin_guest_1565.patch | 6 +- patch/patches/browser_web_contents_1257.patch | 76 +++---------- patch/patches/build.patch | 2 +- patch/patches/chrome_browser_1257.patch | 6 +- patch/patches/compositor_1368.patch | 6 +- patch/patches/content_nav_1129.patch | 12 +- patch/patches/extensions_1257.patch | 2 +- patch/patches/gritsettings.patch | 4 +- patch/patches/message_loop_443.patch | 17 --- .../patches/message_loop_443_1992243003.patch | 106 ++++++++++++++++++ patch/patches/net_filter_515.patch | 10 +- patch/patches/net_urlrequest_1327.patch | 4 +- patch/patches/pdfium_print_549365.patch | 6 +- patch/patches/prefs_content_1161.patch | 16 +-- .../print_header_footer_1478_1565.patch | 66 +++++------ patch/patches/public_browser_1257.patch | 26 ++--- .../patches/render_view_host_impl_1392.patch | 4 +- .../render_widget_host_1070383005.patch | 4 +- patch/patches/ui_dragdrop_355390.patch | 6 +- patch/patches/views_1749.patch | 8 +- .../views_widget_180_1481_1677_1749.patch | 80 ++++++------- patch/patches/webkit_popups.patch | 20 ++-- tests/unittests/cookie_unittest.cc | 72 +++++++++--- tests/unittests/geolocation_unittest.cc | 4 +- tests/unittests/os_rendering_unittest.cc | 6 +- tests/unittests/preference_unittest.cc | 24 +++- tests/unittests/test_handler.cc | 3 +- tests/unittests/test_handler.h | 4 +- tests/unittests/thread_helper.cc | 8 +- tests/unittests/thread_helper.h | 8 +- tests/unittests/tracing_unittest.cc | 3 +- tests/unittests/urlrequest_unittest.cc | 11 +- 78 files changed, 679 insertions(+), 442 deletions(-) delete mode 100644 patch/patches/message_loop_443.patch create mode 100644 patch/patches/message_loop_443_1992243003.patch diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 0e13859a3..83f3b7eeb 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': '2b3ae3b8090361f8af5a611712fc1a5ab2de53cb', + 'chromium_checkout': '318e6f543c58eeeac93b122030041139da7e1e6a', } diff --git a/cef.gyp b/cef.gyp index 60a250451..8d2bce4cf 100644 --- a/cef.gyp +++ b/cef.gyp @@ -972,6 +972,7 @@ '<(DEPTH)/components/components.gyp:keyed_service_content', '<(DEPTH)/components/components.gyp:keyed_service_core', '<(DEPTH)/components/components.gyp:navigation_interception', + '<(DEPTH)/components/components.gyp:network_session_configurator_switches', '<(DEPTH)/components/components.gyp:pdf_browser', '<(DEPTH)/components/components.gyp:pdf_renderer', '<(DEPTH)/components/components.gyp:plugins_renderer', @@ -1018,7 +1019,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/cld_2/cld_2.gyp:cld_2', '<(DEPTH)/third_party/hunspell/hunspell.gyp:hunspell', '<(DEPTH)/third_party/libxml/libxml.gyp:libxml', '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink', diff --git a/libcef/browser/browser_context_impl.cc b/libcef/browser/browser_context_impl.cc index afb4641ec..56bc34fd5 100644 --- a/libcef/browser/browser_context_impl.cc +++ b/libcef/browser/browser_context_impl.cc @@ -29,9 +29,9 @@ #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/guest_view/browser/guest_view_manager.h" #include "components/prefs/pref_service.h" -#include "components/ui/zoom/zoom_event_manager.h" #include "components/visitedlink/browser/visitedlink_event_listener.h" #include "components/visitedlink/browser/visitedlink_master.h" +#include "components/zoom/zoom_event_manager.h" #include "content/public/browser/download_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" @@ -343,7 +343,7 @@ std::unique_ptr return base::WrapUnique(new ChromeZoomLevelPrefs( GetPrefs(), cache_path_, partition_path, - ui_zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr())); + zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr())); } bool CefBrowserContextImpl::IsOffTheRecord() const { diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 071f15085..14ff96a67 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -695,7 +695,8 @@ void CefBrowserHostImpl::StartDownload(const CefString& url) { return; std::unique_ptr params( - content::DownloadUrlParameters::FromWebContents(web_contents(), gurl)); + content::DownloadUrlParameters::CreateForWebContentsMainFrame( + web_contents(), gurl)); manager->DownloadUrl(std::move(params)); } @@ -2243,10 +2244,10 @@ content::JavaScriptDialogManager* } void CefBrowserHostImpl::RunFileChooser( - content::WebContents* web_contents, + content::RenderFrameHost* render_frame_host, const content::FileChooserParams& params) { EnsureFileDialogManager(); - file_dialog_manager_->RunFileChooser(web_contents, params); + file_dialog_manager_->RunFileChooser(render_frame_host, params); } bool CefBrowserHostImpl::HandleContextMenu( diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 4a9c96e99..e76dfb3d9 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -404,7 +404,7 @@ class CefBrowserHostImpl : public CefBrowserHost, content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::WebContents* source) override; void RunFileChooser( - content::WebContents* web_contents, + content::RenderFrameHost* render_frame_host, const content::FileChooserParams& params) override; bool EmbedsFullscreenWidget() const override; void EnterFullscreenModeForTab(content::WebContents* web_contents, diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index bda35cb59..53809d94d 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -69,7 +69,6 @@ void CefBrowserMainParts::PreMainMessageLoopStart() { if (!base::MessageLoop::current()) { // Create the browser message loop. message_loop_.reset(new CefBrowserMessageLoop()); - message_loop_->set_thread_name("CrBrowserMain"); } } diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc index c9e4dd2e0..add5bb20f 100644 --- a/libcef/browser/context.cc +++ b/libcef/browser/context.cc @@ -28,6 +28,7 @@ #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" #include "chrome/browser/printing/print_job_manager.h" #include "components/component_updater/component_updater_service.h" +#include "components/network_session_configurator/switches.h" #include "components/update_client/configurator.h" #include "content/public/app/content_main.h" #include "content/public/app/content_main_runner.h" @@ -326,7 +327,9 @@ void CefContext::Shutdown() { if (settings_.multi_threaded_message_loop) { // Events that will be used to signal when shutdown is complete. Start in // non-signaled mode so that the event will block. - base::WaitableEvent uithread_shutdown_event(false, false); + base::WaitableEvent uithread_shutdown_event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); // Finish shutdown on the UI thread. CEF_POST_TASK(CEF_UIT, diff --git a/libcef/browser/devtools_frontend.cc b/libcef/browser/devtools_frontend.cc index c2d18059d..542a1d9c7 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/json/string_escape.h" #include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" @@ -158,7 +159,7 @@ void CefDevToolsFrontend::Close() { void CefDevToolsFrontend::DisconnectFromTarget() { if (!agent_host_) return; - agent_host_->DetachClient(); + agent_host_->DetachClient(this); agent_host_ = NULL; } @@ -206,7 +207,7 @@ void CefDevToolsFrontend::DocumentAvailableInMainFrame() { void CefDevToolsFrontend::WebContentsDestroyed() { if (agent_host_) - agent_host_->DetachClient(); + agent_host_->DetachClient(this); delete this; } @@ -228,11 +229,12 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( dict->GetList("params", ¶ms); if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) { + if (!agent_host_ || !agent_host_->IsAttached()) + return; std::string protocol_message; if (!params->GetString(0, &protocol_message)) return; - if (agent_host_) - agent_host_->DispatchProtocolMessage(protocol_message); + agent_host_->DispatchProtocolMessage(this, protocol_message); } else if (method == "loadCompleted") { web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);")); @@ -298,18 +300,21 @@ void CefDevToolsFrontend::DispatchProtocolMessage( content::DevToolsAgentHost* agent_host, const std::string& message) { if (message.length() < kMaxMessageChunkSize) { - base::string16 javascript = base::UTF8ToUTF16( - "DevToolsAPI.dispatchMessage(" + message + ");"); + std::string param; + base::EscapeJSONString(message, true, ¶m); + std::string code = "DevToolsAPI.dispatchMessage(" + param + ");"; + base::string16 javascript = base::UTF8ToUTF16(code); web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(javascript); return; } - base::FundamentalValue total_size(static_cast(message.length())); + size_t total_size = message.length(); for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) { std::string param; - base::JSONWriter::Write( - base::StringValue(message.substr(pos, kMaxMessageChunkSize)), ¶m); - std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + ");"; + base::EscapeJSONString(message.substr(pos, kMaxMessageChunkSize), true, + ¶m); + std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + "," + + std::to_string(pos ? 0 : total_size) + ");"; base::string16 javascript = base::UTF8ToUTF16(code); web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(javascript); } diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index 555285ade..ebb5bf06e 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -122,17 +122,19 @@ void CefExtensionSystem::Init() { // 5. A MimeHandlerViewGuest and CefMimeHandlerViewGuestDelegate is created in // the browser process. // 6. MimeHandlerViewGuest navigates to the PDF extension URL. - // 7. PDF extension resources are provided from bundle via + // 7. Access to PDF extension resources is checked by + // CefExtensionsBrowserClient::AllowCrossRendererResourceLoad. + // 8. PDF extension resources are provided from bundle via // CefExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob and // CefComponentExtensionResourceManager. - // 8. The PDF extension communicates via the chrome.mimeHandlerPrivate Mojo + // 9. The PDF extension communicates via the chrome.mimeHandlerPrivate Mojo // API which is implemented as described in // libcef/common/extensions/api/README.txt. - // 9. The PDF extension requests a plugin to handle + // 10.The PDF extension requests a plugin to handle // kPDFPluginOutOfProcessMimeType which loads the PDF PPAPI plugin. - // 10.Routing of print-related commands are handled by ChromePDFPrintClient + // 11.Routing of print-related commands are handled by ChromePDFPrintClient // and CefPrintWebViewHelperDelegate in the renderer process. - // 11.The PDF extension is granted access to chrome://resources via + // 12.The PDF extension is granted access to chrome://resources via // CefExtensionWebContentsObserver::RenderViewCreated in the browser // process. if (PdfExtensionEnabled()) { diff --git a/libcef/browser/extensions/extensions_browser_client.cc b/libcef/browser/extensions/extensions_browser_client.cc index e5ed8950f..5eafbf348 100644 --- a/libcef/browser/extensions/extensions_browser_client.cc +++ b/libcef/browser/extensions/extensions_browser_client.cc @@ -27,6 +27,7 @@ #include "extensions/browser/extension_host_delegate.h" #include "extensions/browser/mojo/service_registration.h" #include "extensions/browser/url_request_util.h" +#include "extensions/common/constants.h" using content::BrowserContext; using content::BrowserThread; @@ -114,6 +115,13 @@ bool CefExtensionsBrowserClient::AllowCrossRendererResourceLoad( bool is_incognito, const Extension* extension, InfoMap* extension_info_map) { + // TODO(cef): This bypasses additional checks added to + // AllowCrossRendererResourceLoad() in https://crrev.com/5cf9d45c. Figure out + // why permission is not being granted based on "web_accessible_resources" + // specified in the PDF extension manifest.json file. + if (extension->id() == extension_misc::kPdfExtensionId) + return true; + bool allowed = false; if (url_request_util::AllowCrossRendererResourceLoad( request, is_incognito, extension, extension_info_map, &allowed)) { diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index f73f1969f..075a287bd 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -12,7 +12,7 @@ #include "libcef/browser/thread_util.h" #include "base/threading/worker_pool.h" -#include "content/public/browser/render_view_host.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/common/file_chooser_file_info.h" #include "net/base/directory_lister.h" @@ -158,6 +158,7 @@ CefFileDialogManager::CefFileDialogManager( browser_(browser), runner_(std::move(runner)), file_chooser_pending_(false), + render_frame_host_(nullptr), weak_ptr_factory_(this) { DCHECK(web_contents()); } @@ -217,40 +218,41 @@ void CefFileDialogManager::RunFileDialog( } void CefFileDialogManager::RunFileChooser( - content::WebContents* web_contents, + content::RenderFrameHost* render_frame_host, const content::FileChooserParams& params) { CEF_REQUIRE_UIT(); - DCHECK_EQ(web_contents, this->web_contents()); - - content::RenderViewHost* render_view_host = web_contents->GetRenderViewHost(); - if (!render_view_host) - return; + DCHECK(render_frame_host); CefFileDialogRunner::FileChooserParams cef_params; static_cast(cef_params) = params; - if (lister_) { - // Cancel the previous upload folder run. - lister_->Cancel(); - lister_.reset(); - } - + CefFileDialogRunner::RunFileChooserCallback callback; if (params.mode == content::FileChooserParams::UploadFolder) { - RunFileChooser(cef_params, - base::Bind( - &CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback, - weak_ptr_factory_.GetWeakPtr(), params.mode)); - return; + callback = base::Bind( + &CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback, + weak_ptr_factory_.GetWeakPtr(), params.mode); + } else { + callback = base::Bind( + &CefFileDialogManager::OnRunFileChooserDelegateCallback, + weak_ptr_factory_.GetWeakPtr(), params.mode); } - RunFileChooser(cef_params, - base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback, - weak_ptr_factory_.GetWeakPtr(), params.mode)); + RunFileChooserInternal(render_frame_host, cef_params, callback); } void CefFileDialogManager::RunFileChooser( const CefFileDialogRunner::FileChooserParams& params, const CefFileDialogRunner::RunFileChooserCallback& callback) { + const CefFileDialogRunner::RunFileChooserCallback& host_callback = + base::Bind(&CefFileDialogManager::OnRunFileChooserCallback, + weak_ptr_factory_.GetWeakPtr(), callback); + RunFileChooserInternal(nullptr, params, host_callback); +} + +void CefFileDialogManager::RunFileChooserInternal( + content::RenderFrameHost* render_frame_host, + const CefFileDialogRunner::FileChooserParams& params, + const CefFileDialogRunner::RunFileChooserCallback& callback) { CEF_REQUIRE_UIT(); if (file_chooser_pending_) { @@ -260,11 +262,7 @@ void CefFileDialogManager::RunFileChooser( } file_chooser_pending_ = true; - - // Ensure that the |file_chooser_pending_| flag is cleared. - const CefFileDialogRunner::RunFileChooserCallback& host_callback = - base::Bind(&CefFileDialogManager::OnRunFileChooserCallback, - weak_ptr_factory_.GetWeakPtr(), callback); + render_frame_host_ = render_frame_host; bool handled = false; @@ -304,7 +302,7 @@ void CefFileDialogManager::RunFileChooser( accept_filters.push_back(*it); CefRefPtr callbackImpl( - new CefFileDialogCallbackImpl(host_callback)); + new CefFileDialogCallbackImpl(callback)); handled = handler->OnFileDialog( browser_, static_cast(mode), @@ -327,10 +325,10 @@ void CefFileDialogManager::RunFileChooser( if (!handled) { if (runner_.get()) { - runner_->Run(browser_, params, host_callback); + runner_->Run(browser_, params, callback); } else { LOG(WARNING) << "No file dialog runner available for this platform"; - host_callback.Run(0, std::vector()); + callback.Run(0, std::vector()); } } } @@ -341,7 +339,7 @@ void CefFileDialogManager::OnRunFileChooserCallback( const std::vector& file_paths) { CEF_REQUIRE_UIT(); - file_chooser_pending_ = false; + Cleanup(); // Execute the callback asynchronously. CEF_POST_TASK(CEF_UIT, @@ -375,17 +373,6 @@ void CefFileDialogManager::OnRunFileChooserDelegateCallback( const std::vector& file_paths) { CEF_REQUIRE_UIT(); - if (lister_.get()) - lister_.reset(); - - if (!web_contents()) - return; - - content::RenderViewHost* render_view_host = - web_contents()->GetRenderViewHost(); - if (!render_view_host) - return; - // Convert FilePath list to SelectedFileInfo list. std::vector selected_files; for (size_t i = 0; i < file_paths.size(); ++i) { @@ -395,5 +382,22 @@ void CefFileDialogManager::OnRunFileChooserDelegateCallback( } // Notify our RenderViewHost in all cases. - render_view_host->FilesSelectedInChooser(selected_files, mode); + if (render_frame_host_) + render_frame_host_->FilesSelectedInChooser(selected_files, mode); + + Cleanup(); +} + +void CefFileDialogManager::Cleanup() { + if (lister_) + lister_.reset(); + + render_frame_host_ = nullptr; + file_chooser_pending_ = false; +} + +void CefFileDialogManager::RenderFrameDeleted( + content::RenderFrameHost* render_frame_host) { + if (render_frame_host == render_frame_host_) + render_frame_host_ = nullptr; } diff --git a/libcef/browser/file_dialog_manager.h b/libcef/browser/file_dialog_manager.h index 5eb075dba..de93d3113 100644 --- a/libcef/browser/file_dialog_manager.h +++ b/libcef/browser/file_dialog_manager.h @@ -48,8 +48,8 @@ class CefFileDialogManager : public content::WebContentsObserver { // Called from CefBrowserHostImpl::RunFileChooser. // See WebContentsDelegate::RunFileChooser documentation. void RunFileChooser( - content::WebContents* web_contents, - const content::FileChooserParams& params); + content::RenderFrameHost* render_frame_host, + const content::FileChooserParams& params); // Run the file chooser dialog specified by |params|. Only a single dialog may // be pending at any given time. |callback| will be executed asynchronously @@ -59,7 +59,13 @@ class CefFileDialogManager : public content::WebContentsObserver { const CefFileDialogRunner::RunFileChooserCallback& callback); private: - // Used with RunFileChooser to clear the |file_chooser_pending_| flag. + void RunFileChooserInternal( + content::RenderFrameHost* render_frame_host, + const CefFileDialogRunner::FileChooserParams& params, + const CefFileDialogRunner::RunFileChooserCallback& callback); + + // Used with the RunFileChooser variant where the caller specifies a callback + // (no associated RenderFrameHost). void OnRunFileChooserCallback( const CefFileDialogRunner::RunFileChooserCallback& callback, int selected_accept_filter, @@ -72,12 +78,20 @@ class CefFileDialogManager : public content::WebContentsObserver { int selected_accept_filter, const std::vector& file_paths); - // Used with WebContentsDelegate::RunFileChooser to notify the WebContents. + // Used with WebContentsDelegate::RunFileChooser to notify the + // RenderFrameHost. void OnRunFileChooserDelegateCallback( content::FileChooserParams::Mode mode, int selected_accept_filter, const std::vector& file_paths); + // Clean up state associated with the last run. + void Cleanup(); + + // WebContentsObserver methods: + void RenderFrameDeleted( + content::RenderFrameHost* render_frame_host) override; + // CefBrowserHostImpl pointer is guaranteed to outlive this object. CefBrowserHostImpl* browser_; @@ -86,6 +100,9 @@ class CefFileDialogManager : public content::WebContentsObserver { // True if a file chooser is currently pending. bool file_chooser_pending_; + // RenderFrameHost associated with the pending file chooser. May be nullptr. + content::RenderFrameHost* render_frame_host_; + // Used for asynchronously listing directory contents. std::unique_ptr lister_; diff --git a/libcef/browser/native/browser_platform_delegate_native_win.cc b/libcef/browser/native/browser_platform_delegate_native_win.cc index ce8d34cf8..4faf70321 100644 --- a/libcef/browser/native/browser_platform_delegate_native_win.cc +++ b/libcef/browser/native/browser_platform_delegate_native_win.cc @@ -17,6 +17,7 @@ #include "libcef/browser/thread_util.h" #include "base/files/file_util.h" +#include "base/memory/ref_counted_memory.h" #include "base/strings/utf_string_conversions.h" #include "base/win/registry.h" #include "content/public/browser/native_web_keyboard_event.h" diff --git a/libcef/browser/native/native_menu_win.cc b/libcef/browser/native/native_menu_win.cc index 7f7444886..6a51bbdd0 100644 --- a/libcef/browser/native/native_menu_win.cc +++ b/libcef/browser/native/native_menu_win.cc @@ -258,16 +258,15 @@ class NativeMenuWin::MenuHostWindow { gfx::Image icon; if (data->native_menu_win->model_->GetIconAt(data->model_index, &icon)) { // We currently don't support items with both icons and checkboxes. - const gfx::ImageSkia* skia_icon = icon.ToImageSkia(); + const gfx::ImageSkia skia_icon = icon.AsImageSkia(); DCHECK(type != ui::MenuModel::TYPE_CHECK); - gfx::Canvas canvas( - skia_icon->GetRepresentation(1.0f), - false); + gfx::Canvas canvas(skia_icon.size(), 1.0f, false); + canvas.DrawImageInt(skia_icon, 0, 0); skia::DrawToNativeContext( canvas.sk_canvas(), dc, draw_item_struct->rcItem.left + kItemLeftMargin, draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - - draw_item_struct->rcItem.top - skia_icon->height()) / 2, NULL); + draw_item_struct->rcItem.top - skia_icon.height()) / 2, NULL); } else if (type == ui::MenuModel::TYPE_CHECK && data->native_menu_win->model_->IsItemCheckedAt( data->model_index)) { diff --git a/libcef/browser/net/resource_request_job.cc b/libcef/browser/net/resource_request_job.cc index b9f8f3d32..34d7c9288 100644 --- a/libcef/browser/net/resource_request_job.cc +++ b/libcef/browser/net/resource_request_job.cc @@ -287,15 +287,6 @@ void CefResourceRequestJob::GetLoadTimingInfo( load_timing_info->receive_headers_end = receive_headers_end_; } -bool CefResourceRequestJob::GetResponseCookies( - std::vector* cookies) { - CEF_REQUIRE_IOT(); - - cookies->clear(); - FetchResponseCookies(cookies); - return true; -} - bool CefResourceRequestJob::IsRedirectResponse(GURL* location, int* http_status_code) { CEF_REQUIRE_IOT(); diff --git a/libcef/browser/net/resource_request_job.h b/libcef/browser/net/resource_request_job.h index 42fa71dd5..364415810 100644 --- a/libcef/browser/net/resource_request_job.h +++ b/libcef/browser/net/resource_request_job.h @@ -39,7 +39,6 @@ class CefResourceRequestJob : public net::URLRequestJob { void GetResponseInfo(net::HttpResponseInfo* info) override; void GetLoadTimingInfo( net::LoadTimingInfo* load_timing_info) const override; - bool GetResponseCookies(std::vector* cookies) override; bool IsRedirectResponse(GURL* location, int* http_status_code) override; bool GetMimeType(std::string* mime_type) const override; diff --git a/libcef/browser/net/url_request_context_getter_impl.cc b/libcef/browser/net/url_request_context_getter_impl.cc index e4d429f37..f967dd26e 100644 --- a/libcef/browser/net/url_request_context_getter_impl.cc +++ b/libcef/browser/net/url_request_context_getter_impl.cc @@ -27,6 +27,7 @@ #include "build/build_config.h" #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/common/pref_names.h" +#include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_client.h" @@ -120,9 +121,18 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl( std::swap(protocol_handlers_, *protocol_handlers); + auto io_thread_proxy = + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); + + quick_check_enabled_.Init(prefs::kQuickCheckEnabled, pref_service); + quick_check_enabled_.MoveToThread(io_thread_proxy); + + pac_https_url_stripping_enabled_.Init(prefs::kPacHttpsUrlStrippingEnabled, + pref_service); + pac_https_url_stripping_enabled_.MoveToThread(io_thread_proxy); + force_google_safesearch_.Init(prefs::kForceGoogleSafeSearch, pref_service); - force_google_safesearch_.MoveToThread( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); + force_google_safesearch_.MoveToThread(io_thread_proxy); #if defined(OS_POSIX) && !defined(OS_ANDROID) gsapi_library_name_ = pref_service->GetString(prefs::kGSSAPILibraryName); @@ -138,8 +148,24 @@ CefURLRequestContextGetterImpl::~CefURLRequestContextGetterImpl() { storage_->set_proxy_service(NULL); } +// static +void CefURLRequestContextGetterImpl::RegisterPrefs( + PrefRegistrySimple* registry) { + // Based on IOThread::RegisterPrefs. +#if defined(OS_POSIX) && !defined(OS_ANDROID) + registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); +#endif + registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true); + registry->RegisterBooleanPref(prefs::kPacHttpsUrlStrippingEnabled, true); + + // Based on ProfileImpl::RegisterProfilePrefs. + registry->RegisterBooleanPref(prefs::kForceGoogleSafeSearch, false); +} + void CefURLRequestContextGetterImpl::ShutdownOnUIThread() { CEF_REQUIRE_UIT(); + quick_check_enabled_.Destroy(); + pac_https_url_stripping_enabled_.Destroy(); force_google_safesearch_.Destroy(); } @@ -189,7 +215,8 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { url_request_context_->network_delegate(), std::move(proxy_config_service_), *command_line, - true); + quick_check_enabled_.GetValue(), + pac_https_url_stripping_enabled_.GetValue()); storage_->set_proxy_service(std::move(system_proxy_service)); storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); diff --git a/libcef/browser/net/url_request_context_getter_impl.h b/libcef/browser/net/url_request_context_getter_impl.h index 9645da358..a009070f3 100644 --- a/libcef/browser/net/url_request_context_getter_impl.h +++ b/libcef/browser/net/url_request_context_getter_impl.h @@ -21,6 +21,7 @@ #include "content/public/browser/browser_context.h" #include "net/url_request/url_request_job_factory.h" +class PrefRegistrySimple; class PrefService; namespace base { @@ -53,6 +54,9 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter { content::URLRequestInterceptorScopedVector request_interceptors); ~CefURLRequestContextGetterImpl() override; + // Register preferences. Called from browser_prefs::CreatePrefService(). + static void RegisterPrefs(PrefRegistrySimple* registry); + // Called when the BrowserContextImpl is destroyed. void ShutdownOnUIThread(); @@ -106,6 +110,9 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter { std::vector > handler_list_; + BooleanPrefMember quick_check_enabled_; + BooleanPrefMember pac_https_url_stripping_enabled_; + // Member variables which are pointed to by the various context objects. mutable BooleanPrefMember force_google_safesearch_; diff --git a/libcef/browser/osr/browser_platform_delegate_osr.cc b/libcef/browser/osr/browser_platform_delegate_osr.cc index 3ada15d37..566be0fb4 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.cc +++ b/libcef/browser/osr/browser_platform_delegate_osr.cc @@ -217,16 +217,19 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragEnter( if (!rvh) return; + drag_data_ = drag_data; + CefDragDataImpl* data_impl = static_cast(drag_data.get()); base::AutoLock lock_scope(data_impl->lock()); - const content::DropData& drop_data = data_impl->drop_data(); + content::DropData* drop_data = data_impl->drop_data(); const gfx::Point client_pt(event.x, event.y); const gfx::Point& screen_pt = GetScreenPoint(client_pt); blink::WebDragOperationsMask ops = static_cast(allowed_ops); int modifiers = TranslateModifiers(event.modifiers); - rvh->DragTargetDragEnter(drop_data, client_pt, screen_pt, ops, modifiers); + rvh->FilterDropData(drop_data); + rvh->DragTargetDragEnter(*drop_data, client_pt, screen_pt, ops, modifiers); } void CefBrowserPlatformDelegateOsr::DragTargetDragOver( @@ -258,11 +261,19 @@ void CefBrowserPlatformDelegateOsr::DragTargetDrop(const CefMouseEvent& event) { if (!rvh) return; - const gfx::Point client_pt(event.x, event.y); - const gfx::Point& screen_pt = GetScreenPoint(client_pt); - int modifiers = TranslateModifiers(event.modifiers); + { + CefDragDataImpl* data_impl = + static_cast(drag_data_.get()); + base::AutoLock lock_scope(data_impl->lock()); + content::DropData* drop_data = data_impl->drop_data(); + const gfx::Point client_pt(event.x, event.y); + const gfx::Point& screen_pt = GetScreenPoint(client_pt); + int modifiers = TranslateModifiers(event.modifiers); - rvh->DragTargetDrop(client_pt, screen_pt, modifiers); + rvh->DragTargetDrop(*drop_data, client_pt, screen_pt, modifiers); + } + + drag_data_ = nullptr; } void CefBrowserPlatformDelegateOsr::DragSourceEndedAt( diff --git a/libcef/browser/osr/browser_platform_delegate_osr.h b/libcef/browser/osr/browser_platform_delegate_osr.h index 28871be2a..0956b6c1f 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.h +++ b/libcef/browser/osr/browser_platform_delegate_osr.h @@ -83,6 +83,9 @@ class CefBrowserPlatformDelegateOsr : std::unique_ptr native_delegate_; CefWebContentsViewOSR* view_osr_; // Not owned by this class. + + // Pending drag/drop data. + CefRefPtr drag_data_; }; #endif // CEF_LIBCEF_BROWSER_OSR_BROWSER_PLATFORM_DELEGATE_OSR_H_ diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 6e8f84080..1068d8350 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -409,9 +409,11 @@ class CefBeginFrameTimer : public cc::DelayBasedTimeSourceClient { CefBeginFrameTimer(int frame_rate_threshold_ms, const base::Closure& callback) : callback_(callback) { - time_source_ = cc::DelayBasedTimeSource::Create( - base::TimeDelta::FromMilliseconds(frame_rate_threshold_ms), - content::BrowserThread::GetMessageLoopProxyForThread(CEF_UIT).get()); + time_source_.reset(new cc::DelayBasedTimeSource( + content::BrowserThread::GetMessageLoopProxyForThread(CEF_UIT).get())); + time_source_->SetTimebaseAndInterval( + base::TimeTicks(), + base::TimeDelta::FromMilliseconds(frame_rate_threshold_ms)); time_source_->SetClient(this); } @@ -1006,6 +1008,11 @@ CefRenderWidgetHostViewOSR::CreateSoftwareOutputDevice( return base::WrapUnique(software_output_device_); } +int CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGpuMemoryBufferClientId() + const { + return render_widget_host_->GetProcess()->GetID(); +} + ui::Layer* CefRenderWidgetHostViewOSR::DelegatedFrameHostGetLayer() const { return root_layer_.get(); } @@ -1020,8 +1027,7 @@ SkColor CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGutterColor( // 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_)) { + render_widget_host_->delegate()->IsFullscreenForCurrentTab()) { return SK_ColorBLACK; } return color; diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index a969e5e8f..535b01c62 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -25,7 +25,6 @@ #if defined(OS_MACOSX) #include "content/browser/renderer_host/browser_compositor_view_mac.h" -#include "ui/accelerated_widget_mac/accelerated_widget_mac.h" #endif #if defined(OS_WIN) @@ -76,11 +75,12 @@ class CefWindowX11; // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. /////////////////////////////////////////////////////////////////////////////// +#if defined(OS_MACOSX) +class AcceleratedWidgetMacNSViewHelper; +#endif + class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, -#if defined(OS_MACOSX) - public ui::AcceleratedWidgetMacNSView, -#endif public ui::CompositorDelegate, public content::DelegatedFrameHostClient { public: @@ -183,14 +183,6 @@ class CefRenderWidgetHostViewOSR const std::vector& character_bounds) override; #endif -#if defined(OS_MACOSX) - // AcceleratedWidgetMacNSView implementation. - NSView* AcceleratedWidgetGetNSView() const override; - void AcceleratedWidgetGetVSyncParameters( - base::TimeTicks* timebase, base::TimeDelta* interval) const override; - void AcceleratedWidgetSwapCompleted() override; -#endif // defined(OS_MACOSX) - bool OnMessageReceived(const IPC::Message& msg) override; // Message handlers. @@ -201,6 +193,7 @@ class CefRenderWidgetHostViewOSR ui::Compositor* compositor) override; // DelegatedFrameHostClient implementation. + virtual int DelegatedFrameHostGetGpuMemoryBufferClientId() const override; ui::Layer* DelegatedFrameHostGetLayer() const override; bool DelegatedFrameHostIsVisible() const override; SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override; @@ -295,6 +288,8 @@ class CefRenderWidgetHostViewOSR void OnScrollOffsetChanged(); #if defined(OS_MACOSX) + friend class AcceleratedWidgetMacNSViewHelper; + // Returns composition character boundary rectangle. The |range| is // composition based range. Also stores |actual_range| which is corresponding // to actually used range for returned rectangle. @@ -339,6 +334,7 @@ class CefRenderWidgetHostViewOSR NSWindow* window_; CALayer* background_layer_; std::unique_ptr browser_compositor_; + AcceleratedWidgetMacNSViewHelper* accelerated_widget_helper_; #elif defined(USE_X11) CefWindowX11* window_; std::unique_ptr invisible_cursor_; 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 9188ddb4b..8d5d1ed80 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_mac.mm +++ b/libcef/browser/osr/render_widget_host_view_osr_mac.mm @@ -17,6 +17,7 @@ #include "base/compiler_specific.h" #include "base/strings/utf_string_conversions.h" #include "content/common/view_messages.h" +#include "ui/accelerated_widget_mac/accelerated_widget_mac.h" #include "ui/events/latency_info.h" namespace { @@ -30,6 +31,35 @@ CefTextInputClientOSRMac* GetInputClientFromContext( } // namespace + +class AcceleratedWidgetMacNSViewHelper : public ui::AcceleratedWidgetMacNSView { + public: + explicit AcceleratedWidgetMacNSViewHelper(CefRenderWidgetHostViewOSR* view) + : view_(view) { + } + virtual ~AcceleratedWidgetMacNSViewHelper() {} + + NSView* AcceleratedWidgetGetNSView() const override { + return [view_->window_ contentView]; + } + + void AcceleratedWidgetGetVSyncParameters( + base::TimeTicks* timebase, base::TimeDelta* interval) const override { + *timebase = base::TimeTicks(); + *interval = base::TimeDelta(); + } + + void AcceleratedWidgetSwapCompleted() override { + } + + private: + // Guaranteed to outlive this object. + CefRenderWidgetHostViewOSR* view_; + + DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMacNSViewHelper); +}; + + ui::AcceleratedWidgetMac* CefRenderWidgetHostViewOSR::GetAcceleratedWidgetMac() const { if (browser_compositor_) @@ -109,19 +139,6 @@ void CefRenderWidgetHostViewOSR::SelectionBoundsChanged( first_selection_rect_ = params.anchor_rect; } -NSView* CefRenderWidgetHostViewOSR::AcceleratedWidgetGetNSView() const { - return [window_ contentView]; -} - -void CefRenderWidgetHostViewOSR::AcceleratedWidgetGetVSyncParameters( - base::TimeTicks* timebase, base::TimeDelta* interval) const { - *timebase = base::TimeTicks(); - *interval = base::TimeDelta(); -} - -void CefRenderWidgetHostViewOSR::AcceleratedWidgetSwapCompleted() { -} - CefTextInputContext CefRenderWidgetHostViewOSR::GetNSTextInputContext() { if (!text_input_context_osr_mac_) { CefTextInputClientOSRMac* text_input_client_osr_mac = @@ -305,10 +322,12 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() { [content_view setWantsLayer:YES]; browser_compositor_ = content::BrowserCompositorMac::Create(); + accelerated_widget_helper_ = new AcceleratedWidgetMacNSViewHelper(this); compositor_.reset(browser_compositor_->compositor()); compositor_->SetRootLayer(root_layer_.get()); - browser_compositor_->accelerated_widget_mac()->SetNSView(this); + browser_compositor_->accelerated_widget_mac()->SetNSView( + accelerated_widget_helper_); browser_compositor_->compositor()->SetVisible(true); // CEF needs the browser compositor to remain responsive whereas normal @@ -335,4 +354,7 @@ void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() { browser_compositor_->compositor()->SetScaleAndSize(1.0, gfx::Size(0, 0)); browser_compositor_->compositor()->SetRootLayer(NULL); content::BrowserCompositorMac::Recycle(std::move(browser_compositor_)); + + delete accelerated_widget_helper_; + accelerated_widget_helper_ = nullptr; } diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 88d55437c..5d1e502c7 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -5,6 +5,7 @@ #include "libcef/browser/prefs/browser_prefs.h" #include "libcef/browser/media_capture_devices_dispatcher.h" +#include "libcef/browser/net/url_request_context_getter_impl.h" #include "libcef/browser/prefs/renderer_prefs.h" #include "libcef/common/cef_switches.h" @@ -126,6 +127,7 @@ std::unique_ptr CreatePrefService(const base::FilePath& pref_path) PrefProxyConfigTrackerImpl::RegisterPrefs(registry.get()); extensions::ExtensionPrefs::RegisterProfilePrefs(registry.get()); HostContentSettingsMap::RegisterProfilePrefs(registry.get()); + CefURLRequestContextGetterImpl::RegisterPrefs(registry.get()); renderer_prefs::RegisterProfilePrefs(registry.get()); update_client::RegisterPrefs(registry.get()); @@ -160,14 +162,6 @@ std::unique_ptr CreatePrefService(const base::FilePath& pref_path) registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false); registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, false); - // Network preferences. - // Based on ProfileImpl::RegisterProfilePrefs. - registry->RegisterBooleanPref(prefs::kForceGoogleSafeSearch, false); - // Based on IOThread::RegisterPrefs. -#if defined(OS_POSIX) && !defined(OS_ANDROID) - registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); -#endif - if (command_line->HasSwitch(switches::kEnablePreferenceTesting)) { // Preferences used with unit tests. registry->RegisterBooleanPref("test.bool", true); diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index 7252d572d..cf9b67466 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -140,7 +140,7 @@ void SavePdfFile(scoped_refptr data, DCHECK_CURRENTLY_ON(BrowserThread::FILE); DCHECK_GT(data->size(), 0U); - PdfMetafileSkia metafile; + PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE); metafile.InitFromData(static_cast(data->front()), data->size()); base::File file(path, diff --git a/libcef/browser/printing/print_view_manager_base.cc b/libcef/browser/printing/print_view_manager_base.cc index a3b53dc9c..c5ecaffb2 100644 --- a/libcef/browser/printing/print_view_manager_base.cc +++ b/libcef/browser/printing/print_view_manager_base.cc @@ -151,7 +151,8 @@ void PrintViewManagerBase::OnDidPrintPage( } } - std::unique_ptr metafile(new PdfMetafileSkia); + std::unique_ptr metafile( + new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE)); if (metafile_must_be_valid) { if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) { NOTREACHED() << "Invalid metafile header"; @@ -214,16 +215,8 @@ void PrintViewManagerBase::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { - switch (type) { - case chrome::NOTIFICATION_PRINT_JOB_EVENT: { - OnNotifyPrintJobEvent(*content::Details(details).ptr()); - break; - } - default: { - NOTREACHED(); - break; - } - } + DCHECK_EQ(chrome::NOTIFICATION_PRINT_JOB_EVENT, type); + OnNotifyPrintJobEvent(*content::Details(details).ptr()); } void PrintViewManagerBase::OnNotifyPrintJobEvent( diff --git a/libcef/browser/resource_dispatcher_host_delegate.cc b/libcef/browser/resource_dispatcher_host_delegate.cc index dedd42a02..2d00f2caf 100644 --- a/libcef/browser/resource_dispatcher_host_delegate.cc +++ b/libcef/browser/resource_dispatcher_host_delegate.cc @@ -84,20 +84,23 @@ bool CefResourceDispatcherHostDelegate::HandleExternalProtocol( const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter, bool is_main_frame, ui::PageTransition page_transition, - bool has_user_gesture) { - if (CEF_CURRENTLY_ON_UIT()) { - content::WebContents* web_contents = web_contents_getter.Run(); - CefRefPtr browser = - CefBrowserHostImpl::GetBrowserForContents(web_contents); - if (browser.get()) - browser->HandleExternalProtocol(url); - } else { + bool has_user_gesture, + content::ResourceContext* resource_context) { + if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, base::Bind(base::IgnoreResult(&CefResourceDispatcherHostDelegate:: HandleExternalProtocol), base::Unretained(this), url, child_id, web_contents_getter, - is_main_frame, page_transition, has_user_gesture)); + is_main_frame, page_transition, has_user_gesture, + resource_context)); + return false; } + + content::WebContents* web_contents = web_contents_getter.Run(); + CefRefPtr browser = + CefBrowserHostImpl::GetBrowserForContents(web_contents); + if (browser.get()) + browser->HandleExternalProtocol(url); return false; } diff --git a/libcef/browser/resource_dispatcher_host_delegate.h b/libcef/browser/resource_dispatcher_host_delegate.h index d87f950d5..e82ac6f80 100644 --- a/libcef/browser/resource_dispatcher_host_delegate.h +++ b/libcef/browser/resource_dispatcher_host_delegate.h @@ -28,7 +28,8 @@ class CefResourceDispatcherHostDelegate web_contents_getter, bool is_main_frame, ui::PageTransition page_transition, - bool has_user_gesture) override; + bool has_user_gesture, + content::ResourceContext* resource_context) override; bool ShouldInterceptResourceAsStream(net::URLRequest* request, const base::FilePath& plugin_path, const std::string& mime_type, diff --git a/libcef/browser/views/view_util.cc b/libcef/browser/views/view_util.cc index 0c222604d..8bd629413 100644 --- a/libcef/browser/views/view_util.cc +++ b/libcef/browser/views/view_util.cc @@ -200,7 +200,7 @@ display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds, find_bounds); } #endif - return display::Screen::GetScreen()->GetDisplayMatching(bounds); + return display::Screen::GetScreen()->GetDisplayMatching(find_bounds); } void ConvertPointFromPixels(gfx::Point* point, diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index 2071a8ff5..c7c0b47d4 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -3,6 +3,9 @@ // found in the LICENSE file. #include "libcef/common/crash_reporter_client.h" + +#include + #include "libcef/common/cef_switches.h" #include "include/cef_version.h" @@ -19,7 +22,7 @@ CefCrashReporterClient::~CefCrashReporterClient() {} #if defined(OS_WIN) void CefCrashReporterClient::GetProductNameAndVersion( - const base::FilePath& exe_path, + const base::string16& exe_path, base::string16* product_name, base::string16* version, base::string16* special_build, @@ -44,18 +47,24 @@ base::FilePath CefCrashReporterClient::GetReporterLogFilename() { } #endif -bool CefCrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) { -#if !defined(OS_WIN) - const base::CommandLine* command_line = - base::CommandLine::ForCurrentProcess(); - if (!command_line->HasSwitch(switches::kCrashDumpsDir)) - return false; - *crash_dir = command_line->GetSwitchValuePath(switches::kCrashDumpsDir); - return true; +#if defined(OS_WIN) +bool CefCrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) { #else - NOTREACHED(); - return false; +bool CefCrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) { #endif + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kCrashDumpsDir)) + return false; + + base::FilePath crash_directory = + base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( + switches::kCrashDumpsDir); +#if defined(OS_WIN) + *crash_dir = crash_directory.value(); +#else + *crash_dir = std::move(crash_directory); +#endif + return true; } bool CefCrashReporterClient::EnableBreakpadForProcess( diff --git a/libcef/common/crash_reporter_client.h b/libcef/common/crash_reporter_client.h index 65c0b64d6..3dd2dbf61 100644 --- a/libcef/common/crash_reporter_client.h +++ b/libcef/common/crash_reporter_client.h @@ -17,7 +17,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { #if defined(OS_WIN) // Returns a textual description of the product type and version to include // in the crash report. - void GetProductNameAndVersion(const base::FilePath& exe_path, + void GetProductNameAndVersion(const base::string16& exe_path, base::string16* product_name, base::string16* version, base::string16* special_build, @@ -35,7 +35,11 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { // The location where minidump files should be written. Returns true if // |crash_dir| was set. +#if defined(OS_WIN) + bool GetCrashDumpLocation(base::string16* crash_dir) override; +#else bool GetCrashDumpLocation(base::FilePath* crash_dir) override; +#endif bool EnableBreakpadForProcess(const std::string& process_type) override; diff --git a/libcef/common/drag_data_impl.h b/libcef/common/drag_data_impl.h index 1c1533c0b..64f29ed37 100644 --- a/libcef/common/drag_data_impl.h +++ b/libcef/common/drag_data_impl.h @@ -43,8 +43,8 @@ class CefDragDataImpl : public CefDragData { void AddFile(const CefString& path, const CefString& display_name) override; // This method is not safe. Use Lock/Unlock to get mutually exclusive access. - const content::DropData& drop_data() { - return data_; + content::DropData* drop_data() { + return &data_; } void SetReadOnly(bool read_only); diff --git a/libcef/common/values_impl.cc b/libcef/common/values_impl.cc index cb02b62ac..c36fa2d4d 100644 --- a/libcef/common/values_impl.cc +++ b/libcef/common/values_impl.cc @@ -454,7 +454,8 @@ CefBinaryValueImpl::CefBinaryValueImpl(char* data, size_t data_size, bool copy) : CefValueBase( - copy ? base::BinaryValue::CreateWithCopiedBuffer(data, data_size) : + copy ? base::BinaryValue::CreateWithCopiedBuffer(data, + data_size).release() : new base::BinaryValue(std::unique_ptr(data), data_size), NULL, kOwnerWillDelete, true, NULL) { } diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index 125694e57..e80d339cb 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -120,6 +120,12 @@ class CefPrerendererClient : public content::RenderViewObserver, private: ~CefPrerendererClient() override {} + // RenderViewObserver methods: + void OnDestruct() override { + delete this; + } + + // WebPrerendererClient methods: void willAddPrerender(blink::WebPrerender* prerender) override {} }; diff --git a/libcef/renderer/media/cef_key_systems.cc b/libcef/renderer/media/cef_key_systems.cc index 0b27510df..c6281a5ea 100644 --- a/libcef/renderer/media/cef_key_systems.cc +++ b/libcef/renderer/media/cef_key_systems.cc @@ -125,10 +125,11 @@ static void AddPepperBasedWidevine( #endif // defined(USE_PROPRIETARY_CODECS) } + using Robustness = cdm::WidevineKeySystemProperties::Robustness; 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. + Robustness::SW_SECURE_CRYPTO, // Maximum audio robustness. + Robustness::SW_SECURE_DECODE, // Maximum video robustness. media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. media::EmeSessionTypeSupport:: NOT_SUPPORTED, // persistent-release-message. diff --git a/libcef/renderer/pepper/pepper_helper.cc b/libcef/renderer/pepper/pepper_helper.cc index 92b1a8c60..86e3e1261 100644 --- a/libcef/renderer/pepper/pepper_helper.cc +++ b/libcef/renderer/pepper/pepper_helper.cc @@ -23,3 +23,7 @@ void CefPepperHelper::DidCreatePepperPlugin(content::RendererPpapiHost* host) { host->GetPpapiHost()->AddHostFactoryFilter( base::WrapUnique(new CefRendererPepperHostFactory(host))); } + +void CefPepperHelper::OnDestruct() { + delete this; +} \ No newline at end of file diff --git a/libcef/renderer/pepper/pepper_helper.h b/libcef/renderer/pepper/pepper_helper.h index 62f5a0451..67d766035 100644 --- a/libcef/renderer/pepper/pepper_helper.h +++ b/libcef/renderer/pepper/pepper_helper.h @@ -17,6 +17,7 @@ class CefPepperHelper : public content::RenderFrameObserver { // RenderFrameObserver. void DidCreatePepperPlugin(content::RendererPpapiHost* host) override; + void OnDestruct() override; private: DISALLOW_COPY_AND_ASSIGN(CefPepperHelper); diff --git a/libcef/renderer/plugins/cef_plugin_placeholder.cc b/libcef/renderer/plugins/cef_plugin_placeholder.cc index 36ab3fdc2..78fffa939 100644 --- a/libcef/renderer/plugins/cef_plugin_placeholder.cc +++ b/libcef/renderer/plugins/cef_plugin_placeholder.cc @@ -58,7 +58,6 @@ CefPluginPlaceholder::CefPluginPlaceholder( html_data), status_(CefViewHostMsg_GetPluginInfo_Status::kAllowed), title_(title), - has_host_(false), context_menu_request_id_(0), ignore_updates_(false) { RenderThread::Get()->AddObserver(this); diff --git a/libcef/renderer/plugins/cef_plugin_placeholder.h b/libcef/renderer/plugins/cef_plugin_placeholder.h index d1e075ae8..0e803e00c 100644 --- a/libcef/renderer/plugins/cef_plugin_placeholder.h +++ b/libcef/renderer/plugins/cef_plugin_placeholder.h @@ -82,7 +82,6 @@ class CefPluginPlaceholder final base::string16 title_; - bool has_host_; int context_menu_request_id_; // Nonzero when request pending. base::string16 plugin_name_; diff --git a/libcef/renderer/plugins/plugin_preroller.cc b/libcef/renderer/plugins/plugin_preroller.cc index 60fc3cce9..52dbb7b34 100644 --- a/libcef/renderer/plugins/plugin_preroller.cc +++ b/libcef/renderer/plugins/plugin_preroller.cc @@ -91,3 +91,7 @@ void CefPluginPreroller::OnThrottlerDestroyed() { throttler_ = nullptr; delete this; } + +void CefPluginPreroller::OnDestruct() { + delete this; +} diff --git a/libcef/renderer/plugins/plugin_preroller.h b/libcef/renderer/plugins/plugin_preroller.h index 620ddbe17..86ec614d6 100644 --- a/libcef/renderer/plugins/plugin_preroller.h +++ b/libcef/renderer/plugins/plugin_preroller.h @@ -44,6 +44,9 @@ class CefPluginPreroller : public content::PluginInstanceThrottler::Observer, void OnThrottleStateChange() override; void OnThrottlerDestroyed() override; + // content::RenderFrameObserver implementation. + void OnDestruct() override; + blink::WebLocalFrame* frame_; blink::WebPluginParams params_; content::WebPluginInfo info_; diff --git a/libcef/renderer/render_frame_observer.cc b/libcef/renderer/render_frame_observer.cc index d733f597a..84f96a5aa 100644 --- a/libcef/renderer/render_frame_observer.cc +++ b/libcef/renderer/render_frame_observer.cc @@ -99,6 +99,10 @@ void CefRenderFrameObserver::WillReleaseScriptContext( CefV8ReleaseContext(context); } +void CefRenderFrameObserver::OnDestruct() { + delete this; +} + // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) diff --git a/libcef/renderer/render_frame_observer.h b/libcef/renderer/render_frame_observer.h index 5fd671413..84f0a413f 100644 --- a/libcef/renderer/render_frame_observer.h +++ b/libcef/renderer/render_frame_observer.h @@ -21,6 +21,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver { int world_id) override; void WillReleaseScriptContext(v8::Handle context, int world_id) override; + void OnDestruct() override; private: DISALLOW_COPY_AND_ASSIGN(CefRenderFrameObserver); diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index d64509ed8..e3489a7e7 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -15,7 +15,6 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "core/frame/Frame.h" #include "core/frame/LocalFrame.h" -#include "core/workers/WorkerGlobalScope.h" #include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/V8Binding.h" MSVC_POP_WARNING(); diff --git a/patch/patch.cfg b/patch/patch.cfg index 04385a2bd..27502a65d 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -27,7 +27,10 @@ patches = [ { # Avoid MessageLoop assertion on OS X. # https://bitbucket.org/chromiumembedded/cef/issues/443 - 'name': 'message_loop_443', + # + # Revert change on Windows that removes MessageLoop::os_modal_loop(). + # https://codereview.chromium.org/1992243003 + 'name': 'message_loop_443_1992243003', 'path': '../base/message_loop/', }, { diff --git a/patch/patches/browser_frame_host_guest_1687.patch b/patch/patches/browser_frame_host_guest_1687.patch index 5714d2d82..6b8f5db0c 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 54d6c4c..4a5268d 100644 +index 2f7ff29..49389ce 100644 --- render_widget_host_view_guest.cc +++ render_widget_host_view_guest.cc -@@ -212,6 +212,9 @@ void RenderWidgetHostViewGuest::Destroy() { +@@ -215,6 +215,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 294ec1dac..bbda696ee 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 71e2857..73d4e45 100644 +index 826c644..f52fd25 100644 --- browser/browser_plugin/browser_plugin_guest.cc +++ browser/browser_plugin/browser_plugin_guest.cc @@ -28,7 +28,7 @@ @@ -11,7 +11,7 @@ index 71e2857..73d4e45 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" -@@ -287,20 +287,19 @@ void BrowserPluginGuest::InitInternal( +@@ -289,20 +289,19 @@ void BrowserPluginGuest::InitInternal( guest_window_rect_ = params.view_rect; if (owner_web_contents_ != owner_web_contents) { @@ -36,7 +36,7 @@ index 71e2857..73d4e45 100644 } RendererPreferences* renderer_prefs = -@@ -750,11 +749,10 @@ void BrowserPluginGuest::OnWillAttachComplete( +@@ -755,11 +754,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 ad6f83548..6fd58ade9 100644 --- a/patch/patches/browser_web_contents_1257.patch +++ b/patch/patches/browser_web_contents_1257.patch @@ -1,79 +1,29 @@ diff --git web_contents_impl.cc web_contents_impl.cc -index 5621f82..3124d00 100644 +index 7754791..8aebfcd 100644 --- web_contents_impl.cc +++ web_contents_impl.cc -@@ -1510,39 +1510,47 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { - // frame - let's do the same thing here. +@@ -1498,6 +1498,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { std::string unique_name = params.main_frame_name; frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); -+ + + 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); - - #if defined(MOJO_SHELL_CLIENT) -- if (MojoShellConnection::Get() && -- base::CommandLine::ForCurrentProcess()->HasSwitch( -- switches::kUseMusInRenderer)) { -- mus::Window* mus_window = aura::GetMusWindow(params.context); -- if (mus_window) { -- view_.reset(new WebContentsViewMus(mus_window, this, delegate, -- &render_view_host_delegate_view_)); -+ if (MojoShellConnection::Get() && -+ base::CommandLine::ForCurrentProcess()->HasSwitch( -+ switches::kUseMusInRenderer)) { -+ mus::Window* mus_window = aura::GetMusWindow(params.context); -+ if (mus_window) { -+ view_.reset(new WebContentsViewMus(mus_window, this, delegate, -+ &render_view_host_delegate_view_)); -+ } - } -- } - #endif - -- if (!view_) { -+ if (!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 (!view_) { + WebContentsViewDelegate* delegate = + GetContentClient()->browser()->GetWebContentsViewDelegate(this); -- if (browser_plugin_guest_ && -- !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { -- view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), -- std::move(view_), -- &render_view_host_delegate_view_)); -- } +@@ -1530,6 +1536,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { + std::move(view_), + &render_view_host_delegate_view_)); + } ++ } CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -1974,11 +1982,14 @@ void WebContentsImpl::CreateNewWindow( +@@ -1973,11 +1980,14 @@ void WebContentsImpl::CreateNewWindow( static_cast(session_storage_namespace); CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); @@ -89,7 +39,7 @@ index 5621f82..3124d00 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 -@@ -2002,6 +2013,8 @@ void WebContentsImpl::CreateNewWindow( +@@ -2001,6 +2011,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 fa312d3fb..13037140b 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,5 +1,5 @@ diff --git common.gypi common.gypi -index 3724f2f..5eb9cde 100644 +index 203247d..2991dfc 100644 --- common.gypi +++ common.gypi @@ -9,6 +9,9 @@ diff --git a/patch/patches/chrome_browser_1257.patch b/patch/patches/chrome_browser_1257.patch index d1685492a..f9f0d6164 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 e551474..222b6ad 100644 +index 14a9336..6f26daf 100644 --- ui/browser.cc +++ ui/browser.cc -@@ -1731,7 +1731,9 @@ bool Browser::ShouldCreateWebContents( +@@ -1614,7 +1614,9 @@ bool Browser::ShouldCreateWebContents( const std::string& frame_name, const GURL& target_url, const std::string& partition_id, @@ -14,7 +14,7 @@ index e551474..222b6ad 100644 // If a BackgroundContents is created, suppress the normal WebContents. return !MaybeCreateBackgroundContents( diff --git ui/browser.h ui/browser.h -index 2196898..af9df43 100644 +index 01f2880..e741e21 100644 --- ui/browser.h +++ ui/browser.h @@ -616,7 +616,9 @@ class Browser : public TabStripModelObserver, diff --git a/patch/patches/compositor_1368.patch b/patch/patches/compositor_1368.patch index 7c2578fc8..648d0210b 100644 --- a/patch/patches/compositor_1368.patch +++ b/patch/patches/compositor_1368.patch @@ -1,8 +1,8 @@ diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc -index ea713fd..e4119f6 100644 +index 6fdb92e..5405306 100644 --- content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc -@@ -188,6 +188,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() { +@@ -184,6 +184,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() { std::unique_ptr GpuProcessTransportFactory::CreateSoftwareOutputDevice( ui::Compositor* compositor) { @@ -14,7 +14,7 @@ index ea713fd..e4119f6 100644 + } + #if defined(MOJO_RUNNER_CLIENT) - if (IsRunningInMojoShell()) { + if (shell::ShellIsRemote()) { return std::unique_ptr( diff --git ui/compositor/compositor.h ui/compositor/compositor.h index a6245da..edfdeb5c 100644 diff --git a/patch/patches/content_nav_1129.patch b/patch/patches/content_nav_1129.patch index 1f8492869..6adcf2588 100644 --- a/patch/patches/content_nav_1129.patch +++ b/patch/patches/content_nav_1129.patch @@ -19,10 +19,10 @@ index 4ad49c8..f1fa7ab 100644 return false; } diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h -index d96adc9..348ae16 100644 +index 579335b..2248549 100644 --- public/renderer/content_renderer_client.h +++ public/renderer/content_renderer_client.h -@@ -200,7 +200,6 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -201,7 +201,6 @@ class CONTENT_EXPORT ContentRendererClient { // Returns true if a popup window should be allowed. virtual bool AllowPopup(); @@ -30,7 +30,7 @@ index d96adc9..348ae16 100644 // TODO(sgurun) This callback is deprecated and will be removed as soon // as android webview completes implementation of a resource throttle based // shouldoverrideurl implementation. See crbug.com/325351 -@@ -216,6 +215,7 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -217,6 +216,7 @@ class CONTENT_EXPORT ContentRendererClient { blink::WebNavigationPolicy default_policy, bool is_redirect); @@ -39,10 +39,10 @@ index d96adc9..348ae16 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 4ff6aaa..4309775 100644 +index 5f3ab60..b6f503f 100644 --- renderer/render_frame_impl.cc +++ renderer/render_frame_impl.cc -@@ -4771,7 +4771,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( +@@ -4867,7 +4867,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( (pending_navigation_params_ && !pending_navigation_params_->request_params.redirects.empty()); @@ -50,7 +50,7 @@ index 4ff6aaa..4309775 100644 // The handlenavigation API is deprecated and will be removed once // crbug.com/325351 is resolved. if (GetContentClient()->renderer()->HandleNavigation( -@@ -4780,7 +4779,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( +@@ -4876,7 +4875,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( is_redirect)) { return blink::WebNavigationPolicyIgnore; } diff --git a/patch/patches/extensions_1257.patch b/patch/patches/extensions_1257.patch index e581b2a5b..6935fd3a0 100644 --- a/patch/patches/extensions_1257.patch +++ b/patch/patches/extensions_1257.patch @@ -1,5 +1,5 @@ diff --git browser/guest_view/extension_options/extension_options_guest.cc browser/guest_view/extension_options/extension_options_guest.cc -index eb8eb4d..836ce55 100644 +index 85bd364..60e936c 100644 --- browser/guest_view/extension_options/extension_options_guest.cc +++ browser/guest_view/extension_options/extension_options_guest.cc @@ -203,7 +203,9 @@ bool ExtensionOptionsGuest::ShouldCreateWebContents( diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 4468baeb8..ce6f16fa3 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,5 +1,5 @@ diff --git resource_ids resource_ids -index 5c46a26..b0babb3 100644 +index bac636f2..979a58f0 100644 --- resource_ids +++ resource_ids @@ -14,6 +14,12 @@ @@ -14,4 +14,4 @@ index 5c46a26..b0babb3 100644 + }, "chrome/browser/browser_resources.grd": { "includes": [400], - "structures": [750], + "structures": [850], diff --git a/patch/patches/message_loop_443.patch b/patch/patches/message_loop_443.patch deleted file mode 100644 index 6c18d4e8b..000000000 --- a/patch/patches/message_loop_443.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git message_loop.cc message_loop.cc -index 3fef91b..58ddbf3 100644 ---- message_loop.cc -+++ message_loop.cc -@@ -142,12 +142,6 @@ MessageLoop::~MessageLoop() { - // may be current. - DCHECK((pump_ && current() == this) || (!pump_ && current() != this)); - -- // iOS just attaches to the loop, it doesn't Run it. -- // TODO(stuartmorgan): Consider wiring up a Detach(). --#if !defined(OS_IOS) -- DCHECK(!run_loop_); --#endif -- - #if defined(OS_WIN) - if (in_high_res_mode_) - Time::ActivateHighResolutionTimer(false); diff --git a/patch/patches/message_loop_443_1992243003.patch b/patch/patches/message_loop_443_1992243003.patch new file mode 100644 index 000000000..a8be46edc --- /dev/null +++ b/patch/patches/message_loop_443_1992243003.patch @@ -0,0 +1,106 @@ +diff --git message_loop.cc message_loop.cc +index 2d6e2a5..7509494 100644 +--- message_loop.cc ++++ message_loop.cc +@@ -143,12 +143,6 @@ MessageLoop::~MessageLoop() { + // may be current. + DCHECK((pump_ && current() == this) || (!pump_ && current() != this)); + +- // iOS just attaches to the loop, it doesn't Run it. +- // TODO(stuartmorgan): Consider wiring up a Detach(). +-#if !defined(OS_IOS) +- DCHECK(!run_loop_); +-#endif +- + #if defined(OS_WIN) + if (in_high_res_mode_) + Time::ActivateHighResolutionTimer(false); +@@ -390,6 +384,9 @@ MessageLoop::MessageLoop(Type type, MessagePumpFactoryCallback pump_factory) + in_high_res_mode_(false), + #endif + nestable_tasks_allowed_(true), ++#if defined(OS_WIN) ++ os_modal_loop_(false), ++#endif // OS_WIN + pump_factory_(pump_factory), + message_histogram_(NULL), + run_loop_(NULL), +diff --git message_loop.h message_loop.h +index 11d8712..bddc532 100644 +--- message_loop.h ++++ message_loop.h +@@ -373,6 +373,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { + void AddTaskObserver(TaskObserver* task_observer); + void RemoveTaskObserver(TaskObserver* task_observer); + ++#if defined(OS_WIN) ++ void set_os_modal_loop(bool os_modal_loop) { ++ os_modal_loop_ = os_modal_loop; ++ } ++ ++ bool os_modal_loop() const { ++ return os_modal_loop_; ++ } ++#endif // OS_WIN ++ + // Can only be called from the thread that owns the MessageLoop. + bool is_running() const; + +@@ -511,6 +521,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { + // insider a (accidentally induced?) nested message pump. + bool nestable_tasks_allowed_; + ++#if defined(OS_WIN) ++ // Should be set to true before calling Windows APIs like TrackPopupMenu, etc. ++ // which enter a modal message loop. ++ bool os_modal_loop_; ++#endif ++ + // pump_factory_.Run() is called to create a message pump for this loop + // if type_ is TYPE_CUSTOM and pump_ is null. + MessagePumpFactoryCallback pump_factory_; +diff --git message_pump_win.cc message_pump_win.cc +index 499d2d8..9002e15 100644 +--- message_pump_win.cc ++++ message_pump_win.cc +@@ -474,20 +474,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) { + } + + bool MessagePumpForUI::ProcessPumpReplacementMessage() { +- // When we encounter a kMsgHaveWork message, this method is called to peek and +- // process a replacement message. The goal is to make the kMsgHaveWork as non- +- // intrusive as possible, even though a continuous stream of such messages are +- // posted. This method carefully peeks a message while there is no chance for +- // a kMsgHaveWork to be pending, then resets the |have_work_| flag (allowing a +- // replacement kMsgHaveWork to possibly be posted), and finally dispatches +- // that peeked replacement. Note that the re-post of kMsgHaveWork may be +- // asynchronous to this thread!! +- ++ // When we encounter a kMsgHaveWork message, this method is called to peek ++ // and process a replacement message, such as a WM_PAINT or WM_TIMER. The ++ // goal is to make the kMsgHaveWork as non-intrusive as possible, even though ++ // a continuous stream of such messages are posted. This method carefully ++ // peeks a message while there is no chance for a kMsgHaveWork to be pending, ++ // then resets the have_work_ flag (allowing a replacement kMsgHaveWork to ++ // possibly be posted), and finally dispatches that peeked replacement. Note ++ // that the re-post of kMsgHaveWork may be asynchronous to this thread!! ++ ++ bool have_message = false; + MSG msg; +- const bool have_message = +- g_peek_message(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE; ++ // We should not process all window messages if we are in the context of an ++ // OS modal loop, i.e. in the context of a windows API call like MessageBox. ++ // This is to ensure that these messages are peeked out by the OS modal loop. ++ if (MessageLoop::current()->os_modal_loop()) { ++ // We only peek out WM_PAINT and WM_TIMER here for reasons mentioned above. ++ have_message = PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE) || ++ PeekMessage(&msg, NULL, WM_TIMER, WM_TIMER, PM_REMOVE); ++ } else { ++ have_message = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) != FALSE; ++ } + +- // Expect no message or a message different than kMsgHaveWork. + DCHECK(!have_message || kMsgHaveWork != msg.message || + msg.hwnd != message_hwnd_); + diff --git a/patch/patches/net_filter_515.patch b/patch/patches/net_filter_515.patch index 9ad9cdfa1..fcc1aefe1 100644 --- a/patch/patches/net_filter_515.patch +++ b/patch/patches/net_filter_515.patch @@ -1,8 +1,8 @@ diff --git base/network_delegate.h base/network_delegate.h -index 81d8190..3405e31 100644 +index 2deb9c58..0896a36 100644 --- base/network_delegate.h +++ base/network_delegate.h -@@ -35,6 +35,7 @@ namespace net { +@@ -36,6 +36,7 @@ namespace net { // of net/base here, because we have a net_base library. Forward declarations // are ok. class CookieOptions; @@ -10,7 +10,7 @@ index 81d8190..3405e31 100644 class HttpRequestHeaders; class HttpResponseHeaders; class ProxyInfo; -@@ -109,6 +110,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { +@@ -111,6 +112,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { const GURL& target_url, const GURL& referrer_url) const; @@ -45,10 +45,10 @@ index 78b8c34..387bea5 100644 friend class GZipUnitTest; friend class SdchFilterChainingTest; diff --git url_request/url_request_job.cc url_request/url_request_job.cc -index 63edfe3..8ab84cc 100644 +index b9c8646..f1ed586 100644 --- url_request/url_request_job.cc +++ url_request/url_request_job.cc -@@ -448,6 +448,9 @@ void URLRequestJob::NotifyHeadersComplete() { +@@ -444,6 +444,9 @@ void URLRequestJob::NotifyHeadersComplete() { if (request_->status().is_success()) filter_ = SetupFilter(); diff --git a/patch/patches/net_urlrequest_1327.patch b/patch/patches/net_urlrequest_1327.patch index b91486693..474cddee9 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 eb94da8..e4a9370 100644 +index a4dba71..bde4569 100644 --- url_request.h +++ url_request.h -@@ -659,10 +659,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe), +@@ -648,10 +648,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 db5559c2d..032bfdaed 100644 --- a/patch/patches/pdfium_print_549365.patch +++ b/patch/patches/pdfium_print_549365.patch @@ -1,8 +1,8 @@ diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp -index 020ff8d..e4c5d9a 100644 +index 43ca318..ca42502 100644 --- fpdfsdk/fpdfview.cpp +++ fpdfsdk/fpdfview.cpp -@@ -19,6 +19,7 @@ +@@ -20,6 +20,7 @@ #include "fpdfsdk/include/fsdk_mgr.h" #include "fpdfsdk/include/fsdk_rendercontext.h" #include "fpdfsdk/javascript/ijs_runtime.h" @@ -10,7 +10,7 @@ index 020ff8d..e4c5d9a 100644 #include "public/fpdf_ext.h" #include "public/fpdf_progressive.h" #include "third_party/base/numerics/safe_conversions_impl.h" -@@ -267,6 +268,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() { +@@ -291,6 +292,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 fc7e8c60d..37de2163e 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 3a1b8fb..927061c 100644 +index c58e881..ccce3c1 100644 --- public/common/common_param_traits_macros.h +++ public/common/common_param_traits_macros.h -@@ -207,6 +207,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) +@@ -208,6 +208,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 3a1b8fb..927061c 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 a0bc6f1..96d1478 100644 +index 21411ea..2555544 100644 --- public/common/web_preferences.cc +++ public/common/web_preferences.cc -@@ -163,6 +163,7 @@ WebPreferences::WebPreferences() +@@ -167,6 +167,7 @@ WebPreferences::WebPreferences() pinch_overlay_scrollbar_thickness(0), use_solid_color_scrollbars(false), navigate_on_drag_drop(true), @@ -23,10 +23,10 @@ index a0bc6f1..96d1478 100644 inert_visual_viewport(false), record_whole_document(false), diff --git public/common/web_preferences.h public/common/web_preferences.h -index 54b8ed4..160991f 100644 +index b30f22a9..7779d08 100644 --- public/common/web_preferences.h +++ public/common/web_preferences.h -@@ -176,6 +176,7 @@ struct CONTENT_EXPORT WebPreferences { +@@ -178,6 +178,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 54b8ed4..160991f 100644 bool inert_visual_viewport; bool record_whole_document; diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc -index 71c52a3..cef247f 100644 +index bec4737..ea6262b 100644 --- renderer/render_view_impl.cc +++ renderer/render_view_impl.cc -@@ -1475,6 +1475,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal( +@@ -1468,6 +1468,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 6074e620c..18c868e32 100644 --- a/patch/patches/print_header_footer_1478_1565.patch +++ b/patch/patches/print_header_footer_1478_1565.patch @@ -136,7 +136,7 @@ index 705211b..a524333 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 cfb1c77..33dad1a 100644 +index fa79d1a..3cf2f1d 100644 --- printing/renderer/print_web_view_helper.cc +++ printing/renderer/print_web_view_helper.cc @@ -83,6 +83,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f; @@ -241,7 +241,7 @@ index cfb1c77..33dad1a 100644 IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked, SetScriptedPrintBlocked) IPC_MESSAGE_UNHANDLED(handled = false) -@@ -984,7 +973,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() { +@@ -988,7 +977,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() { } #endif // defined(ENABLE_BASIC_PRINTING) @@ -249,7 +249,7 @@ index cfb1c77..33dad1a 100644 void PrintWebViewHelper::OnPrintForPrintPreview( const base::DictionaryValue& job_settings) { CHECK_LE(ipc_nesting_level_, 1); -@@ -1049,7 +1037,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview( +@@ -1053,7 +1041,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview( DidFinishPrinting(FAIL_PRINT); } } @@ -257,7 +257,7 @@ index cfb1c77..33dad1a 100644 void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout( const PageSizeMargins& page_layout_in_points, -@@ -1074,7 +1061,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo( +@@ -1078,7 +1065,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo( ignore_css_margins_ = (margins_type != DEFAULT_MARGINS); } @@ -265,7 +265,7 @@ index cfb1c77..33dad1a 100644 void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) { if (ipc_nesting_level_ > 1) return; -@@ -1235,7 +1221,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() { +@@ -1239,7 +1225,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() { return true; } @@ -274,7 +274,7 @@ index cfb1c77..33dad1a 100644 bool PrintWebViewHelper::RenderPreviewPage( int page_number, const PrintMsg_Print_Params& print_params) { -@@ -1264,7 +1250,7 @@ bool PrintWebViewHelper::RenderPreviewPage( +@@ -1269,7 +1255,7 @@ bool PrintWebViewHelper::RenderPreviewPage( } return PreviewPageRendered(page_number, draft_metafile.get()); } @@ -283,7 +283,7 @@ index cfb1c77..33dad1a 100644 bool PrintWebViewHelper::FinalizePrintReadyDocument() { DCHECK(!is_print_ready_metafile_sent_); -@@ -1294,7 +1280,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() { +@@ -1299,7 +1285,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() { Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params)); return true; } @@ -291,7 +291,7 @@ index cfb1c77..33dad1a 100644 void PrintWebViewHelper::OnPrintingDone(bool success) { if (ipc_nesting_level_ > 1) -@@ -1309,7 +1294,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) { +@@ -1314,7 +1299,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) { is_scripted_printing_blocked_ = blocked; } @@ -299,7 +299,7 @@ index cfb1c77..33dad1a 100644 void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { if (ipc_nesting_level_ > 1) return; -@@ -1320,7 +1304,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { +@@ -1325,7 +1309,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { // that instead. auto plugin = delegate_->GetPdfElement(frame); if (!plugin.isNull()) { @@ -309,7 +309,7 @@ index cfb1c77..33dad1a 100644 return; } print_preview_context_.InitWithFrame(frame); -@@ -1328,7 +1314,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { +@@ -1333,7 +1319,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { ? PRINT_PREVIEW_USER_INITIATED_SELECTION : PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME); } @@ -317,7 +317,7 @@ index cfb1c77..33dad1a 100644 bool PrintWebViewHelper::IsPrintingEnabled() { bool result = false; -@@ -1354,11 +1339,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) { +@@ -1359,11 +1344,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) { // Make a copy of the node, in case RenderView::OnContextMenuClosed resets // its |context_menu_node_|. @@ -330,7 +330,7 @@ index cfb1c77..33dad1a 100644 } else { #if defined(ENABLE_BASIC_PRINTING) blink::WebNode duplicate_node(node); -@@ -1424,7 +1407,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { +@@ -1429,7 +1412,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { } break; @@ -338,7 +338,7 @@ index cfb1c77..33dad1a 100644 case FAIL_PREVIEW: int cookie = print_pages_params_ ? print_pages_params_->params.document_cookie : 0; -@@ -1436,7 +1418,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { +@@ -1441,7 +1423,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { } print_preview_context_.Failed(notify_browser_of_print_failure_); break; @@ -346,7 +346,7 @@ index cfb1c77..33dad1a 100644 } prep_frame_view_.reset(); print_pages_params_.reset(); -@@ -1568,7 +1549,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, +@@ -1573,7 +1554,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, return true; } @@ -354,7 +354,7 @@ index cfb1c77..33dad1a 100644 bool PrintWebViewHelper::SetOptionsFromPdfDocument( PrintHostMsg_SetOptionsFromDocument_Params* options) { blink::WebLocalFrame* source_frame = print_preview_context_.source_frame(); -@@ -1677,7 +1657,6 @@ bool PrintWebViewHelper::UpdatePrintSettings( +@@ -1682,7 +1662,6 @@ bool PrintWebViewHelper::UpdatePrintSettings( return true; } @@ -362,7 +362,7 @@ index cfb1c77..33dad1a 100644 #if defined(ENABLE_BASIC_PRINTING) bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame, -@@ -1785,7 +1764,6 @@ void PrintWebViewHelper::PrintPageInternal( +@@ -1790,7 +1769,6 @@ void PrintWebViewHelper::PrintPageInternal( MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); @@ -370,7 +370,7 @@ index cfb1c77..33dad1a 100644 if (params.params.display_header_footer) { // TODO(thestig): Figure out why Linux needs this. It is almost certainly // |printingMinimumShrinkFactor| from Blink. -@@ -1800,7 +1778,6 @@ void PrintWebViewHelper::PrintPageInternal( +@@ -1805,7 +1783,6 @@ void PrintWebViewHelper::PrintPageInternal( scale_factor / fudge_factor, page_layout_in_points, params.params); } @@ -378,7 +378,7 @@ index cfb1c77..33dad1a 100644 float webkit_scale_factor = RenderPageContent(frame, params.page_number, canvas_area, content_area, -@@ -1836,7 +1813,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( +@@ -1841,7 +1818,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( return true; } @@ -386,7 +386,7 @@ index cfb1c77..33dad1a 100644 void PrintWebViewHelper::ShowScriptedPrintPreview() { if (is_scripted_preview_delayed_) { is_scripted_preview_delayed_ = false; -@@ -1964,7 +1940,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number, +@@ -1969,7 +1945,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number, Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params)); return true; } @@ -395,7 +395,7 @@ index cfb1c77..33dad1a 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 7232b22..d2833f8 100644 +index fe33d5e..3f1b7b5 100644 --- printing/renderer/print_web_view_helper.h +++ printing/renderer/print_web_view_helper.h @@ -137,9 +137,7 @@ class PrintWebViewHelper @@ -408,7 +408,7 @@ index 7232b22..d2833f8 100644 }; enum PrintPreviewErrorBuckets { -@@ -173,10 +171,8 @@ class PrintWebViewHelper +@@ -174,10 +172,8 @@ class PrintWebViewHelper void OnPrintForSystemDialog(); void OnPrintForPrintPreview(const base::DictionaryValue& job_settings); #endif // defined(ENABLE_BASIC_PRINTING) @@ -419,7 +419,7 @@ index 7232b22..d2833f8 100644 void OnPrintingDone(bool success); // Get |page_size| and |content_area| information from -@@ -189,7 +185,6 @@ class PrintWebViewHelper +@@ -190,7 +186,6 @@ class PrintWebViewHelper // Update |ignore_css_margins_| based on settings. void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings); @@ -427,7 +427,7 @@ index 7232b22..d2833f8 100644 // Prepare frame for creating preview document. void PrepareFrameForPreviewDocument(); -@@ -206,7 +201,6 @@ class PrintWebViewHelper +@@ -207,7 +202,6 @@ class PrintWebViewHelper // Finalize the print ready preview document. bool FinalizePrintReadyDocument(); @@ -435,7 +435,7 @@ index 7232b22..d2833f8 100644 // Enable/Disable window.print calls. If |blocked| is true window.print // calls will silently fail. Call with |blocked| set to false to reenable. -@@ -235,7 +229,6 @@ class PrintWebViewHelper +@@ -236,7 +230,6 @@ class PrintWebViewHelper const blink::WebNode& node, int* number_of_pages); @@ -443,7 +443,7 @@ index 7232b22..d2833f8 100644 // Set options for print preset from source PDF document. bool SetOptionsFromPdfDocument( PrintHostMsg_SetOptionsFromDocument_Params* options); -@@ -246,7 +239,6 @@ class PrintWebViewHelper +@@ -247,7 +240,6 @@ class PrintWebViewHelper bool UpdatePrintSettings(blink::WebLocalFrame* frame, const blink::WebNode& node, const base::DictionaryValue& passed_job_settings); @@ -451,7 +451,7 @@ index 7232b22..d2833f8 100644 // Get final print settings from the user. // Return false if the user cancels or on error. -@@ -321,7 +313,6 @@ class PrintWebViewHelper +@@ -322,7 +314,6 @@ class PrintWebViewHelper const PrintMsg_PrintPages_Params& params, int page_count); @@ -459,7 +459,7 @@ index 7232b22..d2833f8 100644 // Given the |device| and |canvas| to draw on, prints the appropriate headers // and footers using strings from |header_footer_info| on to the canvas. static void PrintHeaderAndFooter(blink::WebCanvas* canvas, -@@ -331,7 +322,6 @@ class PrintWebViewHelper +@@ -332,7 +323,6 @@ class PrintWebViewHelper float webkit_scale_factor, const PageSizeMargins& page_layout_in_points, const PrintMsg_Print_Params& params); @@ -467,7 +467,7 @@ index 7232b22..d2833f8 100644 bool GetPrintFrame(blink::WebLocalFrame** frame); -@@ -343,7 +333,6 @@ class PrintWebViewHelper +@@ -344,7 +334,6 @@ class PrintWebViewHelper bool IsScriptInitiatedPrintAllowed(blink::WebFrame* frame, bool user_initiated); @@ -475,7 +475,7 @@ index 7232b22..d2833f8 100644 // Shows scripted print preview when options from plugin are available. void ShowScriptedPrintPreview(); -@@ -359,7 +348,6 @@ class PrintWebViewHelper +@@ -360,7 +349,6 @@ class PrintWebViewHelper // |metafile| is the rendered page. Otherwise |metafile| is NULL. // Returns true if print preview should continue, false on failure. bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile); @@ -483,7 +483,7 @@ index 7232b22..d2833f8 100644 void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings); -@@ -512,6 +500,7 @@ class PrintWebViewHelper +@@ -513,6 +501,7 @@ class PrintWebViewHelper ScriptingThrottler scripting_throttler_; bool print_node_in_progress_; @@ -492,7 +492,7 @@ index 7232b22..d2833f8 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 1d23d5b..e99373b 100644 +index d227c5e..f362093 100644 --- printing/renderer/print_web_view_helper_mac.mm +++ printing/renderer/print_web_view_helper_mac.mm @@ -68,7 +68,6 @@ void PrintWebViewHelper::PrintPageInternal( @@ -503,7 +503,7 @@ index 1d23d5b..e99373b 100644 bool PrintWebViewHelper::RenderPreviewPage( int page_number, const PrintMsg_Print_Params& print_params) { -@@ -104,7 +103,6 @@ bool PrintWebViewHelper::RenderPreviewPage( +@@ -105,7 +104,6 @@ bool PrintWebViewHelper::RenderPreviewPage( } return PreviewPageRendered(page_number, draft_metafile.get()); } @@ -511,7 +511,7 @@ index 1d23d5b..e99373b 100644 void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, int page_number, -@@ -139,14 +137,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, +@@ -140,14 +138,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); skia::SetIsPreviewMetafile(*canvas, is_preview); diff --git a/patch/patches/public_browser_1257.patch b/patch/patches/public_browser_1257.patch index c8452d156..9fbce17b0 100644 --- a/patch/patches/public_browser_1257.patch +++ b/patch/patches/public_browser_1257.patch @@ -1,20 +1,20 @@ diff --git web_contents.cc web_contents.cc -index 69190cf..05d2250 100644 +index fa0afb5..d677b31 100644 --- web_contents.cc +++ web_contents.cc -@@ -28,7 +28,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context, - initially_hidden(false), +@@ -29,7 +29,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context, guest_delegate(nullptr), context(nullptr), -- renderer_initiated_creation(false) {} -+ renderer_initiated_creation(false), + renderer_initiated_creation(false), +- initialize_renderer(false) { ++ initialize_renderer(false), + view(nullptr), -+ delegate_view(nullptr) {} ++ delegate_view(nullptr) { + } WebContents::CreateParams::CreateParams(const CreateParams& other) = default; - diff --git web_contents.h web_contents.h -index 6aa00e6..41223fa 100644 +index 90b647e..9fcedc0 100644 --- web_contents.h +++ web_contents.h @@ -55,8 +55,10 @@ class PageState; @@ -28,10 +28,10 @@ index 6aa00e6..41223fa 100644 struct CustomContextMenuContext; struct DropData; struct Manifest; -@@ -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; +@@ -157,6 +159,10 @@ class WebContents : public PageNavigator, + // Note that the pre-created renderer process may not be used if the first + // navigation requires a dedicated or privileged process, such as a WebUI. + bool initialize_renderer; + + // Optionally specify the view and delegate view. + content::WebContentsView* view; @@ -55,7 +55,7 @@ index df97348..8e2168e 100644 } diff --git web_contents_delegate.h web_contents_delegate.h -index 74b56e1..b4dcb2a 100644 +index 2816c4d..387821f 100644 --- web_contents_delegate.h +++ web_contents_delegate.h @@ -42,9 +42,11 @@ class JavaScriptDialogManager; diff --git a/patch/patches/render_view_host_impl_1392.patch b/patch/patches/render_view_host_impl_1392.patch index c07e68c98..f38e2e6b2 100644 --- a/patch/patches/render_view_host_impl_1392.patch +++ b/patch/patches/render_view_host_impl_1392.patch @@ -1,8 +1,8 @@ diff --git render_view_host_impl.h render_view_host_impl.h -index d54b2d7..c696c6f 100644 +index 495ee21..952ddc8 100644 --- render_view_host_impl.h +++ render_view_host_impl.h -@@ -193,6 +193,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost, +@@ -196,6 +196,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost, void set_is_swapped_out(bool is_swapped_out) { is_swapped_out_ = is_swapped_out; } diff --git a/patch/patches/render_widget_host_1070383005.patch b/patch/patches/render_widget_host_1070383005.patch index 68b7c7f22..c2413eccf 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 86481a9..e2e56c0 100644 +index 68b3476..5fd78d0 100644 --- render_widget_host_view_mac.mm +++ render_widget_host_view_mac.mm -@@ -572,9 +572,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, +@@ -575,9 +575,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/ui_dragdrop_355390.patch b/patch/patches/ui_dragdrop_355390.patch index 1bddec913..e51227316 100644 --- a/patch/patches/ui_dragdrop_355390.patch +++ b/patch/patches/ui_dragdrop_355390.patch @@ -1,9 +1,9 @@ diff --git os_exchange_data_provider_aurax11.cc os_exchange_data_provider_aurax11.cc -index e2bba47..ea698fa3 100644 +index 6048670..b37f4bf 100644 --- os_exchange_data_provider_aurax11.cc +++ os_exchange_data_provider_aurax11.cc -@@ -159,7 +159,8 @@ void OSExchangeDataProviderAuraX11::SetURL(const GURL& url, - format_map_.Insert(atom_cache_.GetAtom(kMimeTypeMozillaURL), mem); +@@ -158,7 +158,8 @@ void OSExchangeDataProviderAuraX11::SetURL(const GURL& url, + mem); // Set a string fallback as well. - SetString(spec); diff --git a/patch/patches/views_1749.patch b/patch/patches/views_1749.patch index 8a6eb52a0..8539e7ba6 100644 --- a/patch/patches/views_1749.patch +++ b/patch/patches/views_1749.patch @@ -1,8 +1,8 @@ diff --git controls/button/menu_button.cc controls/button/menu_button.cc -index 3602b45..ec83c86 100644 +index 20b3452..ec73e01 100644 --- controls/button/menu_button.cc +++ controls/button/menu_button.cc -@@ -199,7 +199,7 @@ void MenuButton::OnPaint(gfx::Canvas* canvas) { +@@ -195,7 +195,7 @@ void MenuButton::OnPaint(gfx::Canvas* canvas) { gfx::Size MenuButton::GetPreferredSize() const { gfx::Size prefsize = LabelButton::GetPreferredSize(); if (show_menu_marker_) { @@ -11,7 +11,7 @@ index 3602b45..ec83c86 100644 kMenuMarkerPaddingRight, 0); } -@@ -329,7 +329,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() { +@@ -324,7 +324,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() { gfx::Size s = size(); if (show_menu_marker_) { @@ -20,7 +20,7 @@ index 3602b45..ec83c86 100644 kMenuMarkerPaddingRight); } -@@ -415,4 +415,10 @@ int MenuButton::GetMaximumScreenXCoordinate() { +@@ -412,4 +412,10 @@ int MenuButton::GetMaximumScreenXCoordinate() { return monitor_bounds.right() - 1; } diff --git a/patch/patches/views_widget_180_1481_1677_1749.patch b/patch/patches/views_widget_180_1481_1677_1749.patch index dc658df7e..3a829d05b 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 c33e325c..04ad7d9 100644 +index f65febf0..9ffc653 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -695,6 +695,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { +@@ -770,6 +770,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { } } #endif @@ -17,19 +17,19 @@ index c33e325c..04ad7d9 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 dd88fae..0aaaf78 100644 +index c4b9d14..c8f8cb2 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -40,6 +40,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() - current_device_scale_factor_(0), +@@ -42,6 +42,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() current_display_rotation_(display::Display::ROTATE_0), pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), + text_input_manager_(nullptr), + has_external_parent_(false), renderer_frame_number_(0), weak_factory_(this) {} -@@ -250,6 +251,10 @@ void RenderWidgetHostViewBase::EndFrameSubscription() { - NOTREACHED(); +@@ -269,6 +270,10 @@ void RenderWidgetHostViewBase::FocusedNodeTouched( + DVLOG(1) << "FocusedNodeTouched: " << editable; } +void RenderWidgetHostViewBase::SetHasExternalParent(bool val) { @@ -40,20 +40,20 @@ index dd88fae..0aaaf78 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 8eb9689..d076b3b 100644 +index 772dca1..d28c177 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( - std::unique_ptr subscriber) override; +@@ -101,6 +101,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, void EndFrameSubscription() override; + void FocusedNodeTouched(const gfx::Point& location_dips_screen, + bool editable) override; + void SetHasExternalParent(bool val) override; // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. -@@ -423,6 +424,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, - // renderer. - bool pinch_zoom_enabled_; +@@ -455,6 +456,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, + // destroyed before the RWHV is destroyed. + TextInputManager* text_input_manager_; + // True if the widget has a external parent view/window outside of the + // Chromium-controlled view/window hierarchy. @@ -63,12 +63,12 @@ index 8eb9689..d076b3b 100644 void FlushInput(); diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index b902288..932f398 100644 +index 5ef49e4..d391b20 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h -@@ -160,6 +160,10 @@ class CONTENT_EXPORT RenderWidgetHostView { - // deleted after this call. - virtual void EndFrameSubscription() = 0; +@@ -167,6 +167,10 @@ class CONTENT_EXPORT RenderWidgetHostView { + virtual void FocusedNodeTouched(const gfx::Point& location_dips_screen, + bool editable) = 0; + // Set whether the widget has a external parent view/window outside of the + // Chromium-controlled view/window hierarchy. @@ -91,7 +91,7 @@ index f772f64..7d13f9f 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 7591042..ea6b52c 100644 +index fd8de8f..e7750f7 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -86,6 +86,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( @@ -116,7 +116,7 @@ index 7591042..ea6b52c 100644 remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); -@@ -642,6 +647,10 @@ bool DesktopWindowTreeHostWin::CanActivate() const { +@@ -641,6 +646,10 @@ bool DesktopWindowTreeHostWin::CanActivate() const { return native_widget_delegate_->CanActivate(); } @@ -127,7 +127,7 @@ index 7591042..ea6b52c 100644 bool DesktopWindowTreeHostWin::WantsMouseEventsWhenInactive() const { return wants_mouse_events_when_inactive_; } -@@ -822,11 +831,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -821,11 +830,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -146,7 +146,7 @@ index 7591042..ea6b52c 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 f357a5c..173d64d 100644 +index e568375..6865670 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h @@ -137,6 +137,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin @@ -169,10 +169,10 @@ index f357a5c..173d64d 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 f792797..417d965 100644 +index 586d36d..76c8f1e 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -@@ -170,6 +170,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( +@@ -174,6 +174,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( use_native_frame_(false), should_maximize_after_map_(false), use_argb_visual_(false), @@ -180,7 +180,7 @@ index f792797..417d965 100644 drag_drop_client_(NULL), native_widget_delegate_(native_widget_delegate), desktop_native_widget_aura_(desktop_native_widget_aura), -@@ -178,7 +179,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( +@@ -182,7 +183,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( custom_window_shape_(false), urgency_hint_set_(false), activatable_(true), @@ -190,7 +190,7 @@ index f792797..417d965 100644 } DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() { -@@ -389,7 +391,8 @@ void DesktopWindowTreeHostX11::CloseNow() { +@@ -392,7 +394,8 @@ void DesktopWindowTreeHostX11::CloseNow() { // Actually free our native resources. if (ui::PlatformEventSource::GetInstance()) ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); @@ -200,7 +200,7 @@ index f792797..417d965 100644 xwindow_ = None; desktop_native_widget_aura_->OnHostClosed(); -@@ -538,6 +541,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( +@@ -541,6 +544,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( } gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { @@ -209,7 +209,7 @@ index f792797..417d965 100644 return ToDIPRect(bounds_in_pixels_); } -@@ -982,6 +987,8 @@ void DesktopWindowTreeHostX11::HideImpl() { +@@ -986,6 +991,8 @@ void DesktopWindowTreeHostX11::HideImpl() { } gfx::Rect DesktopWindowTreeHostX11::GetBounds() const { @@ -218,7 +218,7 @@ index f792797..417d965 100644 return bounds_in_pixels_; } -@@ -1039,6 +1046,8 @@ void DesktopWindowTreeHostX11::SetBounds( +@@ -1043,6 +1050,8 @@ void DesktopWindowTreeHostX11::SetBounds( } gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const { @@ -227,7 +227,7 @@ index f792797..417d965 100644 return bounds_in_pixels_.origin(); } -@@ -1147,9 +1156,15 @@ void DesktopWindowTreeHostX11::InitX11Window( +@@ -1151,9 +1160,15 @@ void DesktopWindowTreeHostX11::InitX11Window( use_argb_visual_ = true; } @@ -244,7 +244,7 @@ index f792797..417d965 100644 bounds_in_pixels_.y(), bounds_in_pixels_.width(), bounds_in_pixels_.height(), 0, // border width -@@ -1771,6 +1786,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( +@@ -1784,6 +1799,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( } break; } @@ -256,7 +256,7 @@ index f792797..417d965 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 6a963f8..6cf5c02 100644 +index fa262f1..78a4aba 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 6a963f8..6cf5c02 100644 protected: // Overridden from DesktopWindowTreeHost: void Init(aura::Window* content_window, -@@ -263,6 +269,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -266,6 +272,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // The bounds of |xwindow_|. gfx::Rect bounds_in_pixels_; @@ -282,7 +282,7 @@ index 6a963f8..6cf5c02 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 -@@ -299,6 +308,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -302,6 +311,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // Whether we used an ARGB visual for our window. bool use_argb_visual_; @@ -293,7 +293,7 @@ index 6a963f8..6cf5c02 100644 DesktopDragDropClientAuraX11* drag_drop_client_; std::unique_ptr x11_non_client_event_filter_; -@@ -351,6 +364,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -354,6 +367,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 base::WeakPtrFactory close_widget_factory_; @@ -365,7 +365,7 @@ index 8ec4b1e..587e4e3 100644 x_active_window_ = None; } diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index a86fe48..8ec377d 100644 +index 62b4b56..5fe4bd0 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc @@ -126,9 +126,11 @@ Widget::InitParams::InitParams(Type type) @@ -413,7 +413,7 @@ index a86fe48..8ec377d 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 e52c7ff..57e466c 100644 +index 0376866..7901ea4 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h @@ -238,12 +238,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, @@ -473,10 +473,10 @@ index b843416..8b81a51 100644 } case Widget::InitParams::TYPE_CONTROL: diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index 921b838..954d426 100644 +index d8c14ee..ca22040 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -852,6 +852,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() { +@@ -855,6 +855,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() { } else { style &= ~WS_MINIMIZEBOX; } @@ -485,7 +485,7 @@ index 921b838..954d426 100644 SetWindowLong(hwnd(), GWL_STYLE, style); } -@@ -2503,8 +2505,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -2500,8 +2502,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, active_mouse_tracking_flags_ = 0; } else if (event.type() == ui::ET_MOUSEWHEEL) { // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 8bbbed810..fe9ffc719 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 ab5b0e7..c977d57 100644 +index f3d796c..bc0ee90 100644 --- Source/web/ChromeClientImpl.cpp +++ Source/web/ChromeClientImpl.cpp -@@ -880,7 +880,7 @@ bool ChromeClientImpl::hasOpenedPopup() const +@@ -881,7 +881,7 @@ bool ChromeClientImpl::hasOpenedPopup() const PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { notifyPopupOpeningObservers(); @@ -12,10 +12,10 @@ index ab5b0e7..c977d57 100644 DCHECK(RuntimeEnabledFeatures::pagePopupEnabled()); diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp -index 218f70f..24824fd 100644 +index 3df57d6..07c2307 100644 --- Source/web/WebViewImpl.cpp +++ Source/web/WebViewImpl.cpp -@@ -415,6 +415,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) +@@ -419,6 +419,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_enableFakePageScaleAnimationForTesting(false) , m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationUseAnchor(false) @@ -23,7 +23,7 @@ index 218f70f..24824fd 100644 , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) , m_compositorDeviceScaleFactorOverride(0) -@@ -4072,9 +4073,14 @@ void WebViewImpl::pageScaleFactorChanged() +@@ -4110,9 +4111,14 @@ void WebViewImpl::pageScaleFactorChanged() m_client->pageScaleFactorChanged(); } @@ -40,10 +40,10 @@ index 218f70f..24824fd 100644 void WebViewImpl::startDragging(LocalFrame* frame, diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h -index 3015ed1..0eb5455 100644 +index 716e264..9726e8f 100644 --- Source/web/WebViewImpl.h +++ Source/web/WebViewImpl.h -@@ -383,7 +383,8 @@ public: +@@ -387,7 +387,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 3015ed1..0eb5455 100644 bool shouldAutoResize() const { -@@ -672,6 +673,8 @@ private: +@@ -673,6 +674,8 @@ private: float m_fakePageScaleAnimationPageScaleFactor; bool m_fakePageScaleAnimationUseAnchor; @@ -63,10 +63,10 @@ index 3015ed1..0eb5455 100644 bool m_ignoreInputEvents; diff --git public/web/WebView.h public/web/WebView.h -index d25040c..67a9a1a 100644 +index bca14ae..10b7ff6 100644 --- public/web/WebView.h +++ public/web/WebView.h -@@ -443,6 +443,7 @@ public: +@@ -445,6 +445,7 @@ public: // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void setUseExternalPopupMenus(bool); diff --git a/tests/unittests/cookie_unittest.cc b/tests/unittests/cookie_unittest.cc index bea811593..91242ce0c 100644 --- a/tests/unittests/cookie_unittest.cc +++ b/tests/unittests/cookie_unittest.cc @@ -500,7 +500,9 @@ void TestChangeDirectory(CefRefPtr manager, // Test creation of a domain cookie. TEST(CookieTest, DomainCookieGlobal) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); @@ -512,7 +514,9 @@ TEST(CookieTest, DomainCookieGlobal) { // Test creation of a domain cookie. TEST(CookieTest, DomainCookieInMemory) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::CreateManager(CefString(), false, @@ -530,7 +534,9 @@ TEST(CookieTest, DomainCookieOnDisk) { // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::CreateManager(temp_dir.path().value(), false, @@ -548,7 +554,9 @@ TEST(CookieTest, DomainCookieOnDisk) { // Test creation of a host cookie. TEST(CookieTest, HostCookieGlobal) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); @@ -560,7 +568,9 @@ TEST(CookieTest, HostCookieGlobal) { // Test creation of a host cookie. TEST(CookieTest, HostCookieInMemory) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::CreateManager(CefString(), false, @@ -578,7 +588,9 @@ TEST(CookieTest, HostCookieOnDisk) { // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::CreateManager(temp_dir.path().value(), false, @@ -596,7 +608,9 @@ TEST(CookieTest, HostCookieOnDisk) { // Test creation of multiple cookies. TEST(CookieTest, MultipleCookiesGlobal) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); @@ -608,7 +622,9 @@ TEST(CookieTest, MultipleCookiesGlobal) { // Test creation of multiple cookies. TEST(CookieTest, MultipleCookiesInMemory) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::CreateManager(CefString(), false, @@ -626,7 +642,9 @@ TEST(CookieTest, MultipleCookiesOnDisk) { // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::CreateManager(temp_dir.path().value(), false, @@ -643,7 +661,9 @@ TEST(CookieTest, MultipleCookiesOnDisk) { } TEST(CookieTest, AllCookiesGlobal) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); @@ -654,7 +674,9 @@ TEST(CookieTest, AllCookiesGlobal) { } TEST(CookieTest, AllCookiesInMemory) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::CreateManager(CefString(), false, @@ -671,7 +693,9 @@ TEST(CookieTest, AllCookiesOnDisk) { // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::CreateManager(temp_dir.path().value(), false, @@ -688,7 +712,9 @@ TEST(CookieTest, AllCookiesOnDisk) { } TEST(CookieTest, ChangeDirectoryGlobal) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); @@ -702,7 +728,9 @@ TEST(CookieTest, ChangeDirectoryGlobal) { } TEST(CookieTest, ChangeDirectoryCreated) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr manager = CefCookieManager::CreateManager(CefString(), false, @@ -715,7 +743,9 @@ TEST(CookieTest, ChangeDirectoryCreated) { TEST(CookieTest, SessionCookieNoPersist) { base::ScopedTempDir temp_dir; - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefCookie cookie; // Create a new temporary directory. @@ -749,7 +779,9 @@ TEST(CookieTest, SessionCookieNoPersist) { TEST(CookieTest, SessionCookieWillPersist) { base::ScopedTempDir temp_dir; - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefCookie cookie; // Create a new temporary directory. @@ -894,7 +926,9 @@ class CookieTestJSHandler : public TestHandler { const std::string& name, const std::string& value, TrackCallback& callback) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CookieVector cookies; // Get the cookie. @@ -1170,7 +1204,9 @@ class CookieTestSchemeHandler : public TestHandler { const std::string& name, const std::string& value, TrackCallback& callback) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CookieVector cookies; // Get the cookie. diff --git a/tests/unittests/geolocation_unittest.cc b/tests/unittests/geolocation_unittest.cc index 141ed1aaa..38ef52bc4 100644 --- a/tests/unittests/geolocation_unittest.cc +++ b/tests/unittests/geolocation_unittest.cc @@ -210,7 +210,9 @@ private: } // namespace TEST(GeolocationTest, GetGeolocation) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefGetGeolocation(new TestGetGeolocationCallback(&event)); event.Wait(); } diff --git a/tests/unittests/os_rendering_unittest.cc b/tests/unittests/os_rendering_unittest.cc index d389d26de..8dc8e3748 100644 --- a/tests/unittests/os_rendering_unittest.cc +++ b/tests/unittests/os_rendering_unittest.cc @@ -73,7 +73,7 @@ const CefRect kExpectedRectLI[] = { const CefRect kEditBoxRect(412, 245, 60, 22); const CefRect kNavigateButtonRect(360, 271, 140, 22); const CefRect kSelectRect(467, 22, 75, 20); -const CefRect kExpandedSelectRect(463, 42, 81, 342); +const CefRect kExpandedSelectRect(463, 47, 81, 342); const CefRect kDropDivRect(8, 332, 52, 52); const CefRect kDragDivRect(71, 342, 30, 30); const int kDefaultVerticalScrollbarWidth = 17; @@ -82,14 +82,14 @@ const int kVerticalScrollbarWidth = GetSystemMetrics(SM_CXVSCROLL); const CefRect kEditBoxRect(442, 251, 46, 16); const CefRect kNavigateButtonRect(375, 275, 130, 20); const CefRect kSelectRect(461, 21, 87, 26); -const CefRect kExpandedSelectRect(463, 42, 78, 286); +const CefRect kExpandedSelectRect(463, 42, 75, 286); const CefRect kDropDivRect(9, 330, 52, 52); const CefRect kDragDivRect(60, 330, 52, 52); #elif defined(OS_LINUX) const CefRect kEditBoxRect(434, 246, 60, 20); const CefRect kNavigateButtonRect(380, 271, 140, 22); const CefRect kSelectRect(467, 22, 75, 20); -const CefRect kExpandedSelectRect(463, 42, 81, 342); +const CefRect kExpandedSelectRect(463, 47, 81, 342); const CefRect kDropDivRect(8, 332, 52, 52); const CefRect kDragDivRect(71, 342, 30, 30); const int kDefaultVerticalScrollbarWidth = 14; diff --git a/tests/unittests/preference_unittest.cc b/tests/unittests/preference_unittest.cc index dc8d348f2..19140fe79 100644 --- a/tests/unittests/preference_unittest.cc +++ b/tests/unittests/preference_unittest.cc @@ -402,7 +402,9 @@ class TestRequestContextHandler : public CefRequestContextHandler { // Verify default preference values on the global context. TEST(PreferenceTest, GlobalDefaults) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr context = CefRequestContext::GetGlobalContext(); EXPECT_TRUE(context.get()); @@ -413,7 +415,9 @@ TEST(PreferenceTest, GlobalDefaults) { // Verify setting/getting preference values on the global context. TEST(PreferenceTest, GlobalSetGet) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr context = CefRequestContext::GetGlobalContext(); EXPECT_TRUE(context.get()); @@ -428,7 +432,9 @@ TEST(PreferenceTest, GlobalSetGet) { // Verify setting/getting preference values on shared global contexts. TEST(PreferenceTest, GlobalSetGetShared) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRefPtr context = CefRequestContext::GetGlobalContext(); EXPECT_TRUE(context.get()); @@ -470,7 +476,9 @@ TEST(PreferenceTest, GlobalSetGetShared) { // Verify default preference values on a custom context. TEST(PreferenceTest, CustomDefaults) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRequestContextSettings settings; CefRefPtr context = @@ -483,7 +491,9 @@ TEST(PreferenceTest, CustomDefaults) { // Verify setting/getting preference values on a custom context. TEST(PreferenceTest, CustomSetGet) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED);; CefRequestContextSettings settings; CefRefPtr context = @@ -500,7 +510,9 @@ TEST(PreferenceTest, CustomSetGet) { // Verify setting/getting preference values on shared custom contexts. TEST(PreferenceTest, CustomSetGetShared) { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefRequestContextSettings settings; CefRefPtr context = diff --git a/tests/unittests/test_handler.cc b/tests/unittests/test_handler.cc index 6a6d1108a..65008e456 100644 --- a/tests/unittests/test_handler.cc +++ b/tests/unittests/test_handler.cc @@ -100,7 +100,8 @@ class TestBrowserViewDelegate : public CefBrowserViewDelegate { TestHandler::CompletionState::CompletionState(int total) : total_(total), count_(0), - event_(true, false) { + event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED) { } void TestHandler::CompletionState::TestComplete() { diff --git a/tests/unittests/test_handler.h b/tests/unittests/test_handler.h index 40a27f0d4..a88870d66 100644 --- a/tests/unittests/test_handler.h +++ b/tests/unittests/test_handler.h @@ -301,7 +301,9 @@ class TestHandler : public CefClient, // all Handler references have been released on test completion. template void ReleaseAndWaitForDestructor(CefRefPtr& handler, int delay_ms = 2000) { - base::WaitableEvent event(true, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); handler->SetDestroyEvent(&event); T* _handler_ptr = handler.get(); handler = NULL; diff --git a/tests/unittests/thread_helper.cc b/tests/unittests/thread_helper.cc index 466159008..8b8dd608a 100644 --- a/tests/unittests/thread_helper.cc +++ b/tests/unittests/thread_helper.cc @@ -11,13 +11,17 @@ void SignalEvent(base::WaitableEvent* event) { } void WaitForThread(CefThreadId thread_id) { - base::WaitableEvent event(true, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); CefPostTask(thread_id, base::Bind(SignalEvent, &event)); event.Wait(); } void WaitForThread(CefRefPtr task_runner) { - base::WaitableEvent event(true, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); task_runner->PostTask(CefCreateClosureTask(base::Bind(SignalEvent, &event))); event.Wait(); } diff --git a/tests/unittests/thread_helper.h b/tests/unittests/thread_helper.h index 6ef167713..18b71b8eb 100644 --- a/tests/unittests/thread_helper.h +++ b/tests/unittests/thread_helper.h @@ -37,7 +37,9 @@ void RunOnThread(CefThreadId thread_id, #define NAMED_THREAD_TEST(thread_id, test_case_name, test_name) \ TEST(test_case_name, test_name) { \ - base::WaitableEvent event(false, false); \ + base::WaitableEvent event( \ + base::WaitableEvent::ResetPolicy::AUTOMATIC, \ + base::WaitableEvent::InitialState::NOT_SIGNALED); \ RunOnThread(thread_id, base::Bind(test_name##Impl), &event); \ event.Wait(); \ } @@ -55,7 +57,9 @@ void RunOnThreadAsync( #define NAMED_THREAD_TEST_ASYNC(thread_id, test_case_name, test_name) \ TEST(test_case_name, test_name) { \ - base::WaitableEvent event(false, false); \ + base::WaitableEvent event( \ + base::WaitableEvent::ResetPolicy::AUTOMATIC, \ + base::WaitableEvent::InitialState::NOT_SIGNALED); \ RunOnThreadAsync(thread_id, base::Bind(test_name##Impl), &event); \ event.Wait(); \ } diff --git a/tests/unittests/tracing_unittest.cc b/tests/unittests/tracing_unittest.cc index 000b3603c..4c48b3c7f 100644 --- a/tests/unittests/tracing_unittest.cc +++ b/tests/unittests/tracing_unittest.cc @@ -74,7 +74,8 @@ class TracingTestHandler : public CefEndTracingCallback, public CefCompletionCallback { public: TracingTestHandler(TracingTestType type, const char* trace_type) - : completion_event_(true, false), + : completion_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED), trace_type_(trace_type), type_(type) { } diff --git a/tests/unittests/urlrequest_unittest.cc b/tests/unittests/urlrequest_unittest.cc index 137dba8bb..bf0411710 100644 --- a/tests/unittests/urlrequest_unittest.cc +++ b/tests/unittests/urlrequest_unittest.cc @@ -1040,7 +1040,9 @@ class RequestTestHandler : public TestHandler, // register any scheme handlers. test_runner_->SetupTest(test_mode_); - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); SetTestCookie(test_runner_->GetRequestContext(), &event); if (test_in_browser_) { @@ -1094,7 +1096,9 @@ class RequestTestHandler : public TestHandler, } void DestroyTest(const RequestRunSettings& settings) override { - base::WaitableEvent event(false, false); + base::WaitableEvent event( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); bool has_save_cookie = false; GetTestCookie(test_runner_->GetRequestContext(), &event, &has_save_cookie); @@ -1244,7 +1248,8 @@ namespace { class InvalidURLTestClient : public CefURLRequestClient { public: InvalidURLTestClient() - : event_(false, false) { + : event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED) { } void RunTest() {