From 97dd8beb4f2559bbd6de6bd630bf3b138b120308 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 3 Sep 2013 21:48:12 +0000 Subject: [PATCH] Update to Chromium revision 220934. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1427 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- include/capi/cef_context_menu_handler_capi.h | 6 ++++-- include/cef_context_menu_handler.h | 5 +++-- libcef/browser/backing_store_osr.cc | 17 ++++++++-------- libcef/browser/backing_store_osr.h | 2 +- libcef/browser/chrome_scheme_handler.cc | 2 +- libcef/browser/context_menu_params_impl.cc | 6 +++--- libcef/browser/context_menu_params_impl.h | 2 +- libcef/browser/javascript_dialog_manager.cc | 1 + libcef/browser/javascript_dialog_manager.h | 1 + libcef/browser/scheme_handler.cc | 6 +++++- libcef/renderer/webkit_glue.cc | 16 +++++++-------- .../cpptoc/context_menu_params_cpptoc.cc | 6 +++--- .../ctocpp/context_menu_params_ctocpp.cc | 6 +++--- .../ctocpp/context_menu_params_ctocpp.h | 2 +- patch/patches/spi_webcore_364.patch | 6 +++--- patch/patches/webkit_popups.patch | 20 +++++++++---------- tests/unittests/download_unittest.cc | 2 +- 18 files changed, 59 insertions(+), 49 deletions(-) diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index beed62d96..095b80509 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -17,5 +17,5 @@ { 'chromium_url': 'http://src.chromium.org/svn/trunk/src', - 'chromium_revision': '217791', + 'chromium_revision': '220934', } diff --git a/include/capi/cef_context_menu_handler_capi.h b/include/capi/cef_context_menu_handler_capi.h index c9282393e..e7743b409 100644 --- a/include/capi/cef_context_menu_handler_capi.h +++ b/include/capi/cef_context_menu_handler_capi.h @@ -145,9 +145,11 @@ typedef struct _cef_context_menu_params_t { struct _cef_context_menu_params_t* self); /// - // Returns true (1) if the context menu was invoked on a blocked image. + // Returns true (1) if the context menu was invoked on an image which has non- + // NULL contents. /// - int (CEF_CALLBACK *is_image_blocked)(struct _cef_context_menu_params_t* self); + int (CEF_CALLBACK *has_image_contents)( + struct _cef_context_menu_params_t* self); /// // Returns the URL of the top level page that the context menu was invoked on. diff --git a/include/cef_context_menu_handler.h b/include/cef_context_menu_handler.h index e3e983ad5..239f6a43a 100644 --- a/include/cef_context_menu_handler.h +++ b/include/cef_context_menu_handler.h @@ -148,10 +148,11 @@ class CefContextMenuParams : public virtual CefBase { virtual CefString GetSourceUrl() =0; /// - // Returns true if the context menu was invoked on a blocked image. + // Returns true if the context menu was invoked on an image which has + // non-empty contents. /// /*--cef()--*/ - virtual bool IsImageBlocked() =0; + virtual bool HasImageContents() =0; /// // Returns the URL of the top level page that the context menu was invoked on. diff --git a/libcef/browser/backing_store_osr.cc b/libcef/browser/backing_store_osr.cc index dd9974084..7496c7d6c 100644 --- a/libcef/browser/backing_store_osr.cc +++ b/libcef/browser/backing_store_osr.cc @@ -29,10 +29,10 @@ BackingStoreOSR::BackingStoreOSR(content::RenderWidgetHost* widget, device_scale_factor_(scale_factor) { gfx::Size pixel_size = gfx::ToFlooredSize( gfx::ScaleSize(size, device_scale_factor_)); - device_.reset(new SkDevice(SkBitmap::kARGB_8888_Config, - pixel_size.width(), - pixel_size.height(), - true)); + device_.reset(new SkBitmapDevice(SkBitmap::kARGB_8888_Config, + pixel_size.width(), + pixel_size.height(), + true)); canvas_.reset(new SkCanvas(device_.get())); canvas_->drawColor(SK_ColorWHITE); @@ -49,10 +49,11 @@ void BackingStoreOSR::ScaleFactorChanged(float scale_factor) { gfx::Size pixel_size = gfx::ToFlooredSize( gfx::ScaleSize(size(), device_scale_factor_)); - scoped_ptr new_device(new SkDevice(SkBitmap::kARGB_8888_Config, - pixel_size.width(), - pixel_size.height(), - true)); + scoped_ptr new_device( + new SkBitmapDevice(SkBitmap::kARGB_8888_Config, + pixel_size.width(), + pixel_size.height(), + true)); scoped_ptr new_canvas(new SkCanvas(new_device.get())); diff --git a/libcef/browser/backing_store_osr.h b/libcef/browser/backing_store_osr.h index 916c31973..35bf7047a 100644 --- a/libcef/browser/backing_store_osr.h +++ b/libcef/browser/backing_store_osr.h @@ -46,7 +46,7 @@ class BackingStoreOSR : public content::BackingStore { const gfx::Size& size, float scale_factor); virtual ~BackingStoreOSR() {} - scoped_ptr device_; + scoped_ptr device_; scoped_ptr canvas_; float device_scale_factor_; diff --git a/libcef/browser/chrome_scheme_handler.cc b/libcef/browser/chrome_scheme_handler.cc index 88c0a0224..96165f83e 100644 --- a/libcef/browser/chrome_scheme_handler.cc +++ b/libcef/browser/chrome_scheme_handler.cc @@ -367,7 +367,7 @@ void LoadTraceFile(CefRefPtr frame, return; std::string file_contents; - if (!file_util::ReadFileToString(path, &file_contents)) { + if (!base::ReadFileToString(path, &file_contents)) { frame->SendJavaScript( "tracingController.onLoadTraceFileCanceled();", std::string(), 0); return; diff --git a/libcef/browser/context_menu_params_impl.cc b/libcef/browser/context_menu_params_impl.cc index eaed08b0c..e5e82a5ef 100644 --- a/libcef/browser/context_menu_params_impl.cc +++ b/libcef/browser/context_menu_params_impl.cc @@ -59,9 +59,9 @@ CefString CefContextMenuParamsImpl::GetSourceUrl() { return const_value().src_url.spec(); } -bool CefContextMenuParamsImpl::IsImageBlocked() { - CEF_VALUE_VERIFY_RETURN(false, false); - return const_value().is_image_blocked; +bool CefContextMenuParamsImpl::HasImageContents() { + CEF_VALUE_VERIFY_RETURN(false, true); + return const_value().has_image_contents; } CefString CefContextMenuParamsImpl::GetPageUrl() { diff --git a/libcef/browser/context_menu_params_impl.h b/libcef/browser/context_menu_params_impl.h index 2846febc0..a37e7c3f6 100644 --- a/libcef/browser/context_menu_params_impl.h +++ b/libcef/browser/context_menu_params_impl.h @@ -24,7 +24,7 @@ class CefContextMenuParamsImpl virtual CefString GetLinkUrl() OVERRIDE; virtual CefString GetUnfilteredLinkUrl() OVERRIDE; virtual CefString GetSourceUrl() OVERRIDE; - virtual bool IsImageBlocked() OVERRIDE; + virtual bool HasImageContents() OVERRIDE; virtual CefString GetPageUrl() OVERRIDE; virtual CefString GetFrameUrl() OVERRIDE; virtual CefString GetFrameCharset() OVERRIDE; diff --git a/libcef/browser/javascript_dialog_manager.cc b/libcef/browser/javascript_dialog_manager.cc index 8a9e82b62..169a2da16 100644 --- a/libcef/browser/javascript_dialog_manager.cc +++ b/libcef/browser/javascript_dialog_manager.cc @@ -81,6 +81,7 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( content::JavaScriptMessageType message_type, const string16& message_text, const string16& default_prompt_text, + bool user_gesture, const DialogClosedCallback& callback, bool* did_suppress_message) { CefRefPtr client = browser_->GetClient(); diff --git a/libcef/browser/javascript_dialog_manager.h b/libcef/browser/javascript_dialog_manager.h index b404ddf05..a4b4cd575 100644 --- a/libcef/browser/javascript_dialog_manager.h +++ b/libcef/browser/javascript_dialog_manager.h @@ -29,6 +29,7 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { content::JavaScriptMessageType message_type, const string16& message_text, const string16& default_prompt_text, + bool user_gesture, const DialogClosedCallback& callback, bool* did_suppress_message) OVERRIDE; diff --git a/libcef/browser/scheme_handler.cc b/libcef/browser/scheme_handler.cc index 207d3b5c6..11ad2d50b 100644 --- a/libcef/browser/scheme_handler.cc +++ b/libcef/browser/scheme_handler.cc @@ -10,6 +10,7 @@ #include "libcef/browser/devtools_scheme_handler.h" #include "libcef/common/scheme_registration.h" +#include "content/public/browser/browser_thread.h" #include "content/public/common/url_constants.h" #include "net/url_request/data_protocol_handler.h" #include "net/url_request/file_protocol_handler.h" @@ -25,7 +26,10 @@ void InstallInternalProtectedHandlers( protocol_handlers->insert( std::make_pair(chrome::kDataScheme, new net::DataProtocolHandler)); protocol_handlers->insert( - std::make_pair(chrome::kFileScheme, new net::FileProtocolHandler)); + std::make_pair(chrome::kFileScheme, new net::FileProtocolHandler( + content::BrowserThread::GetBlockingPool()-> + GetTaskRunnerWithShutdownBehavior( + base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); #if !defined(DISABLE_FTP_SUPPORT) protocol_handlers->insert( std::make_pair(chrome::kFtpScheme, diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/webkit_glue.cc index 1a8dab3a5..fd23be401 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/webkit_glue.cc @@ -25,32 +25,32 @@ bool CanGoBack(WebKit::WebView* view) { if (!view) return false; WebKit::WebViewImpl* impl = reinterpret_cast(view); - return (impl->page()->backForward()->backCount() > 0); + return (impl->page()->backForward().backCount() > 0); } bool CanGoForward(WebKit::WebView* view) { if (!view) return false; WebKit::WebViewImpl* impl = reinterpret_cast(view); - return (impl->page()->backForward()->forwardCount() > 0); + return (impl->page()->backForward().forwardCount() > 0); } void GoBack(WebKit::WebView* view) { if (!view) return; WebKit::WebViewImpl* impl = reinterpret_cast(view); - WebCore::BackForwardController* controller = impl->page()->backForward(); - if (controller->backCount() > 0) - controller->goBack(); + WebCore::BackForwardController& controller = impl->page()->backForward(); + if (controller.backCount() > 0) + controller.goBack(); } void GoForward(WebKit::WebView* view) { if (!view) return; WebKit::WebViewImpl* impl = reinterpret_cast(view); - WebCore::BackForwardController* controller = impl->page()->backForward(); - if (controller->forwardCount() > 0) - controller->goForward(); + WebCore::BackForwardController& controller = impl->page()->backForward(); + if (controller.forwardCount() > 0) + controller.goForward(); } v8::Handle GetV8Context(WebKit::WebFrame* frame) { diff --git a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc index 0234b4294..2d7902771 100644 --- a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc +++ b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc @@ -107,7 +107,7 @@ cef_string_userfree_t CEF_CALLBACK context_menu_params_get_source_url( return _retval.DetachToUserFree(); } -int CEF_CALLBACK context_menu_params_is_image_blocked( +int CEF_CALLBACK context_menu_params_has_image_contents( struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -116,7 +116,7 @@ int CEF_CALLBACK context_menu_params_is_image_blocked( return 0; // Execute - bool _retval = CefContextMenuParamsCppToC::Get(self)->IsImageBlocked(); + bool _retval = CefContextMenuParamsCppToC::Get(self)->HasImageContents(); // Return type: bool return _retval; @@ -274,7 +274,7 @@ CefContextMenuParamsCppToC::CefContextMenuParamsCppToC( struct_.struct_.get_unfiltered_link_url = context_menu_params_get_unfiltered_link_url; struct_.struct_.get_source_url = context_menu_params_get_source_url; - struct_.struct_.is_image_blocked = context_menu_params_is_image_blocked; + struct_.struct_.has_image_contents = context_menu_params_has_image_contents; struct_.struct_.get_page_url = context_menu_params_get_page_url; struct_.struct_.get_frame_url = context_menu_params_get_frame_url; struct_.struct_.get_frame_charset = context_menu_params_get_frame_charset; diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc index 5fcbf3b47..1c182e555 100644 --- a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc +++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc @@ -99,14 +99,14 @@ CefString CefContextMenuParamsCToCpp::GetSourceUrl() { return _retvalStr; } -bool CefContextMenuParamsCToCpp::IsImageBlocked() { - if (CEF_MEMBER_MISSING(struct_, is_image_blocked)) +bool CefContextMenuParamsCToCpp::HasImageContents() { + if (CEF_MEMBER_MISSING(struct_, has_image_contents)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_image_blocked(struct_); + int _retval = struct_->has_image_contents(struct_); // Return type: bool return _retval?true:false; diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.h b/libcef_dll/ctocpp/context_menu_params_ctocpp.h index bcbebc9b5..9be4f7589 100644 --- a/libcef_dll/ctocpp/context_menu_params_ctocpp.h +++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.h @@ -40,7 +40,7 @@ class CefContextMenuParamsCToCpp virtual CefString GetLinkUrl() OVERRIDE; virtual CefString GetUnfilteredLinkUrl() OVERRIDE; virtual CefString GetSourceUrl() OVERRIDE; - virtual bool IsImageBlocked() OVERRIDE; + virtual bool HasImageContents() OVERRIDE; virtual CefString GetPageUrl() OVERRIDE; virtual CefString GetFrameUrl() OVERRIDE; virtual CefString GetFrameCharset() OVERRIDE; diff --git a/patch/patches/spi_webcore_364.patch b/patch/patches/spi_webcore_364.patch index 813aea87b..547c33132 100644 --- a/patch/patches/spi_webcore_364.patch +++ b/patch/patches/spi_webcore_364.patch @@ -1,8 +1,8 @@ Index: page/FrameView.cpp =================================================================== ---- page/FrameView.cpp (revision 156144) +--- page/FrameView.cpp (revision 157102) +++ page/FrameView.cpp (working copy) -@@ -189,10 +189,12 @@ +@@ -187,10 +187,12 @@ if (!page) return; @@ -17,7 +17,7 @@ Index: page/FrameView.cpp PassRefPtr FrameView::create(Frame* frame) Index: platform/mac/NSScrollerImpDetails.mm =================================================================== ---- platform/mac/NSScrollerImpDetails.mm (revision 156144) +--- platform/mac/NSScrollerImpDetails.mm (revision 157102) +++ platform/mac/NSScrollerImpDetails.mm (working copy) @@ -33,6 +33,7 @@ diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 42bb0456e..1823aaa7c 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,8 @@ Index: public/web/WebView.h =================================================================== ---- public/web/WebView.h (revision 156144) +--- public/web/WebView.h (revision 157102) +++ public/web/WebView.h (working copy) -@@ -439,6 +439,7 @@ +@@ -444,6 +444,7 @@ // Sets whether select popup menus should be rendered by the browser. WEBKIT_EXPORT static void setUseExternalPopupMenus(bool); @@ -12,9 +12,9 @@ Index: public/web/WebView.h // Visited link state -------------------------------------------------- Index: Source/web/ChromeClientImpl.cpp =================================================================== ---- Source/web/ChromeClientImpl.cpp (revision 156144) +--- Source/web/ChromeClientImpl.cpp (revision 157102) +++ Source/web/ChromeClientImpl.cpp (working copy) -@@ -880,7 +880,7 @@ +@@ -887,7 +887,7 @@ PassRefPtr ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const { @@ -25,9 +25,9 @@ Index: Source/web/ChromeClientImpl.cpp return adoptRef(new PopupMenuChromium(frame, client)); Index: Source/web/WebViewImpl.cpp =================================================================== ---- Source/web/WebViewImpl.cpp (revision 156144) +--- Source/web/WebViewImpl.cpp (revision 157102) +++ Source/web/WebViewImpl.cpp (working copy) -@@ -393,6 +393,7 @@ +@@ -394,6 +394,7 @@ , m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationUseAnchor(false) , m_contextMenuAllowed(false) @@ -35,7 +35,7 @@ Index: Source/web/WebViewImpl.cpp , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) , m_suppressNextKeypressEvent(false) -@@ -3636,9 +3637,14 @@ +@@ -3671,9 +3672,14 @@ updateLayerTreeViewport(); } @@ -50,10 +50,10 @@ Index: Source/web/WebViewImpl.cpp + return m_shouldUseExternalPopupMenus; } - void WebViewImpl::setEmulatedTextZoomFactor(float textZoomFactor) + void WebViewImpl::startDragging(Frame* frame, Index: Source/web/WebViewImpl.h =================================================================== ---- Source/web/WebViewImpl.h (revision 156144) +--- Source/web/WebViewImpl.h (revision 157102) +++ Source/web/WebViewImpl.h (working copy) @@ -422,7 +422,8 @@ @@ -65,7 +65,7 @@ Index: Source/web/WebViewImpl.h bool contextMenuAllowed() const { -@@ -723,6 +724,8 @@ +@@ -720,6 +721,8 @@ bool m_contextMenuAllowed; diff --git a/tests/unittests/download_unittest.cc b/tests/unittests/download_unittest.cc index bd3d6c2a3..14c09aaf9 100644 --- a/tests/unittests/download_unittest.cc +++ b/tests/unittests/download_unittest.cc @@ -234,7 +234,7 @@ class DownloadTestHandler : public TestHandler { // Verify the file contents. std::string contents; - EXPECT_TRUE(file_util::ReadFileToString(test_path_, &contents)); + EXPECT_TRUE(base::ReadFileToString(test_path_, &contents)); EXPECT_STREQ(kTestContent, contents.c_str()); EXPECT_TRUE(temp_dir_.Delete());