From 255fdad295d35dcb9cded4af1ab0c7bcfa22d227 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 6 Nov 2012 17:13:58 +0000 Subject: [PATCH] Update to Chromium revision 165669. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@902 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- cef1/CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- cef1/cef.gyp | 16 ++------ cef1/cef.gypi | 12 +++++- cef1/libcef/browser_drag_delegate_win.cc | 6 +-- cef1/libcef/browser_drag_delegate_win.h | 6 +-- cef1/libcef/browser_file_system.cc | 6 +-- cef1/libcef/browser_network_delegate.cc | 2 +- cef1/libcef/browser_network_delegate.h | 2 +- cef1/libcef/browser_request_context.cc | 20 +++++----- cef1/libcef/browser_request_context_proxy.cc | 1 - cef1/libcef/browser_webblobregistry_impl.cc | 4 +- cef1/libcef/browser_webview_delegate.cc | 6 +-- cef1/libcef/browser_webview_delegate_gtk.cc | 8 +--- cef1/libcef/browser_webview_delegate_mac.mm | 4 +- cef1/libcef/browser_webview_delegate_win.cc | 24 ++++------- cef1/libcef/cef_context.cc | 6 +-- cef1/libcef/drag_download_file.cc | 42 +++++--------------- cef1/libcef/drag_download_file.h | 16 +++----- cef1/libcef/geolocation_client.cc | 32 ++++++++------- cef1/libcef/geolocation_client.h | 7 +++- cef1/libcef/geolocation_impl.cc | 3 +- cef1/libcef/simple_clipboard_impl.cc | 5 +++ cef1/libcef/simple_clipboard_impl.h | 2 + cef1/libcef/webwidget_host.cc | 13 +++--- cef1/libcef/webwidget_host_gtk.cc | 4 +- cef1/libcef/webwidget_host_mac.mm | 3 +- cef1/patch/patches/tools_gyp.patch | 10 ++--- cef1/tests/unittests/test_suite.cc | 3 +- 28 files changed, 116 insertions(+), 149 deletions(-) diff --git a/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt b/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt index 6f8fdef8c..fd43bd06f 100644 --- a/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/cef1/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -17,5 +17,5 @@ { 'chromium_url': 'http://src.chromium.org/svn/trunk/src', - 'chromium_revision': '160122', + 'chromium_revision': '165669', } diff --git a/cef1/cef.gyp b/cef1/cef.gyp index 8e544702f..2d96ecb93 100644 --- a/cef1/cef.gyp +++ b/cef1/cef.gyp @@ -436,19 +436,16 @@ '<(DEPTH)/third_party/modp_b64/modp_b64.gyp:modp_b64', '<(DEPTH)/third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', + '<(DEPTH)/third_party/zlib/zlib.gyp:minizip', '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', '<(DEPTH)/ui/ui.gyp:ui_resources', '<(DEPTH)/ui/ui.gyp:ui', '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', - '<(DEPTH)/webkit/support/webkit_support.gyp:appcache', - '<(DEPTH)/webkit/support/webkit_support.gyp:blob', - '<(DEPTH)/webkit/support/webkit_support.gyp:database', - '<(DEPTH)/webkit/support/webkit_support.gyp:fileapi', '<(DEPTH)/webkit/support/webkit_support.gyp:glue', - '<(DEPTH)/webkit/support/webkit_support.gyp:quota', '<(DEPTH)/webkit/support/webkit_support.gyp:user_agent', '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_gpu', '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_storage', '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings', 'libcef_static', ], @@ -620,20 +617,16 @@ '<(DEPTH)/third_party/modp_b64/modp_b64.gyp:modp_b64', '<(DEPTH)/third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', + '<(DEPTH)/third_party/zlib/zlib.gyp:minizip', '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', '<(DEPTH)/ui/ui.gyp:ui_resources', '<(DEPTH)/ui/ui.gyp:ui', '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', - '<(DEPTH)/webkit/support/webkit_support.gyp:appcache', - '<(DEPTH)/webkit/support/webkit_support.gyp:blob', - '<(DEPTH)/webkit/support/webkit_support.gyp:database', - '<(DEPTH)/webkit/support/webkit_support.gyp:dom_storage', - '<(DEPTH)/webkit/support/webkit_support.gyp:fileapi', '<(DEPTH)/webkit/support/webkit_support.gyp:glue', - '<(DEPTH)/webkit/support/webkit_support.gyp:quota', '<(DEPTH)/webkit/support/webkit_support.gyp:user_agent', '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_gpu', '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_storage', '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings', ], 'sources': [ @@ -869,7 +862,6 @@ '<(DEPTH)/ui/base/dragdrop/os_exchange_data_provider_gtk.h', # Geolocation implementation '<(DEPTH)/content/browser/geolocation/gps_location_provider_linux.cc', - '<(DEPTH)/content/browser/geolocation/libgps_wrapper_linux.cc', '<(DEPTH)/content/browser/geolocation/wifi_data_provider_linux.cc', ], }], diff --git a/cef1/cef.gypi b/cef1/cef.gypi index 04ecebd5e..5d8435b52 100644 --- a/cef1/cef.gypi +++ b/cef1/cef.gypi @@ -20,5 +20,15 @@ 'clang_use_chrome_plugins': 0, }], ] - }, + }, 'conditions': [ + ['OS=="mac" and clang==1', { + 'target_defaults': { + 'xcode_settings': { + # Temporary workaround for an Xcode 4 build error. This can be + # removed with the next Chromium update. See crbug.com/156530. + 'WARNING_CFLAGS': ['-Wno-unknown-warning-option'], + }, + }, + }] + ] } diff --git a/cef1/libcef/browser_drag_delegate_win.cc b/cef1/libcef/browser_drag_delegate_win.cc index 0b567fe8d..d04641a32 100644 --- a/cef1/libcef/browser_drag_delegate_win.cc +++ b/cef1/libcef/browser_drag_delegate_win.cc @@ -115,7 +115,7 @@ BrowserDragDelegate::~BrowserDragDelegate() { void BrowserDragDelegate::StartDragging(const WebDropData& drop_data, WebDragOperationsMask ops, const SkBitmap& image, - const gfx::Point& image_offset) { + const gfx::Vector2d& image_offset) { DCHECK(CefThread::CurrentlyOn(CefThread::UI)); CefBrowserImpl* browser = view_->GetBrowser(); @@ -175,7 +175,7 @@ void BrowserDragDelegate::StartBackgroundDragging( const GURL& page_url, const std::string& page_encoding, const SkBitmap& image, - const gfx::Point& image_offset) { + const gfx::Vector2d& image_offset) { drag_drop_thread_id_ = base::PlatformThread::CurrentId(); DoDragging(drop_data, ops, page_url, page_encoding, image, image_offset); @@ -263,7 +263,7 @@ void BrowserDragDelegate::DoDragging(const WebDropData& drop_data, const GURL& page_url, const std::string& page_encoding, const SkBitmap& image, - const gfx::Point& image_offset) { + const gfx::Vector2d& image_offset) { ui::OSExchangeData data; if (!drop_data.download_metadata.empty()) { diff --git a/cef1/libcef/browser_drag_delegate_win.h b/cef1/libcef/browser_drag_delegate_win.h index c2b104efa..b1ac0aab8 100644 --- a/cef1/libcef/browser_drag_delegate_win.h +++ b/cef1/libcef/browser_drag_delegate_win.h @@ -38,7 +38,7 @@ class BrowserDragDelegate void StartDragging(const WebDropData& drop_data, WebKit::WebDragOperationsMask ops, const SkBitmap& image, - const gfx::Point& image_offset); + const gfx::Vector2d& image_offset); void CancelDrag(); // DataObjectImpl::Observer implementation. @@ -61,7 +61,7 @@ class BrowserDragDelegate const GURL& page_url, const std::string& page_encoding, const SkBitmap& image, - const gfx::Point& image_offset); + const gfx::Vector2d& image_offset); // Called on drag-and-drop thread. void StartBackgroundDragging(const WebDropData& drop_data, @@ -69,7 +69,7 @@ class BrowserDragDelegate const GURL& page_url, const std::string& page_encoding, const SkBitmap& image, - const gfx::Point& image_offset); + const gfx::Vector2d& image_offset); // Called on UI thread. void EndDragging(); void CloseThread(); diff --git a/cef1/libcef/browser_file_system.cc b/cef1/libcef/browser_file_system.cc index 719586df4..1dc5f66d6 100644 --- a/cef1/libcef/browser_file_system.cc +++ b/cef1/libcef/browser_file_system.cc @@ -23,12 +23,12 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" +#include "webkit/base/file_path_string_conversions.h" #include "webkit/blob/blob_storage_controller.h" #include "webkit/fileapi/file_system_task_runners.h" #include "webkit/fileapi/file_system_url.h" #include "webkit/fileapi/file_system_util.h" #include "webkit/fileapi/mock_file_system_options.h" -#include "webkit/glue/webkit_glue.h" using base::WeakPtr; @@ -340,7 +340,7 @@ void BrowserFileSystem::DidGetMetadata(WebFileSystemCallbacks* callbacks, web_file_info.type = info.is_directory ? WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; web_file_info.platformPath = - webkit_glue::FilePathToWebString(platform_path); + webkit_base::FilePathToWebString(platform_path); callbacks->didReadMetadata(web_file_info); } else { callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result)); @@ -357,7 +357,7 @@ void BrowserFileSystem::DidReadDirectory( for (std::vector::const_iterator it = entries.begin(); it != entries.end(); ++it) { WebFileSystemEntry entry; - entry.name = webkit_glue::FilePathStringToWebString(it->name); + entry.name = webkit_base::FilePathStringToWebString(it->name); entry.isDirectory = it->is_directory; web_entries_vector.push_back(entry); } diff --git a/cef1/libcef/browser_network_delegate.cc b/cef1/libcef/browser_network_delegate.cc index 7e4ce562a..2f70d29aa 100644 --- a/cef1/libcef/browser_network_delegate.cc +++ b/cef1/libcef/browser_network_delegate.cc @@ -38,7 +38,7 @@ void BrowserNetworkDelegate::OnSendHeaders( int BrowserNetworkDelegate::OnHeadersReceived( net::URLRequest* request, const net::CompletionCallback& callback, - net::HttpResponseHeaders* original_response_headers, + const net::HttpResponseHeaders* original_response_headers, scoped_refptr*override_response_headers) { return net::OK; } diff --git a/cef1/libcef/browser_network_delegate.h b/cef1/libcef/browser_network_delegate.h index 085166a5e..76077816d 100644 --- a/cef1/libcef/browser_network_delegate.h +++ b/cef1/libcef/browser_network_delegate.h @@ -27,7 +27,7 @@ class BrowserNetworkDelegate : public net::NetworkDelegate { virtual int OnHeadersReceived( net::URLRequest* request, const net::CompletionCallback& callback, - net::HttpResponseHeaders* original_response_headers, + const net::HttpResponseHeaders* original_response_headers, scoped_refptr* override_response_headers) OVERRIDE; virtual void OnBeforeRedirect(net::URLRequest* request, diff --git a/cef1/libcef/browser_request_context.cc b/cef1/libcef/browser_request_context.cc index 367d58594..4a210a3a0 100644 --- a/cef1/libcef/browser_request_context.cc +++ b/cef1/libcef/browser_request_context.cc @@ -204,10 +204,7 @@ void BrowserRequestContext::Init( CreateProxyConfigService(), 0, NULL)); } - storage_.set_host_resolver( - net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - net::HostResolver::kDefaultRetryAttempts, - NULL)); + storage_.set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); @@ -254,13 +251,6 @@ void BrowserRequestContext::Init( net::URLRequestJobFactory* job_factory = new net::URLRequestJobFactoryImpl(); - blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); - job_factory->SetProtocolHandler( - "blob", - new webkit_blob::BlobProtocolHandler( - blob_storage_controller_.get(), - CefThread::GetMessageLoopProxyForThread(CefThread::FILE))); - BrowserFileSystem* file_system = _Context->file_system(); // Create the context if it doesn't already exist. file_system->CreateContext(); @@ -269,6 +259,14 @@ void BrowserRequestContext::Init( "filesystem", fileapi::CreateFileSystemProtocolHandler( file_system->file_system_context())); + + blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); + job_factory->SetProtocolHandler( + "blob", + new webkit_blob::BlobProtocolHandler( + blob_storage_controller_.get(), + file_system->file_system_context(), + CefThread::GetMessageLoopProxyForThread(CefThread::FILE))); } storage_.set_job_factory(job_factory); diff --git a/cef1/libcef/browser_request_context_proxy.cc b/cef1/libcef/browser_request_context_proxy.cc index 1346d88bd..d13af1c48 100644 --- a/cef1/libcef/browser_request_context_proxy.cc +++ b/cef1/libcef/browser_request_context_proxy.cc @@ -35,7 +35,6 @@ BrowserRequestContextProxy::BrowserRequestContextProxy( set_transport_security_state(context->transport_security_state()); set_accept_charset(context->accept_charset()); set_accept_language(context->accept_language()); - set_referrer_charset(context->referrer_charset()); set_job_factory(context->job_factory()); } diff --git a/cef1/libcef/browser_webblobregistry_impl.cc b/cef1/libcef/browser_webblobregistry_impl.cc index 52fae0155..24fbaa4e0 100644 --- a/cef1/libcef/browser_webblobregistry_impl.cc +++ b/cef1/libcef/browser_webblobregistry_impl.cc @@ -9,9 +9,9 @@ #include "googleurl/src/gurl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobData.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" +#include "webkit/base/file_path_string_conversions.h" #include "webkit/blob/blob_data.h" #include "webkit/blob/blob_storage_controller.h" -#include "webkit/glue/webkit_glue.h" using WebKit::WebBlobData; using WebKit::WebURL; @@ -39,7 +39,7 @@ BlobData* NewBlobData(const WebBlobData& data) { case WebBlobData::Item::TypeFile: if (item.length) { blob->AppendFile( - webkit_glue::WebStringToFilePath(item.filePath), + webkit_base::WebStringToFilePath(item.filePath), static_cast(item.offset), static_cast(item.length), base::Time::FromDoubleT(item.expectedModificationTime)); diff --git a/cef1/libcef/browser_webview_delegate.cc b/cef1/libcef/browser_webview_delegate.cc index 9f33b491a..fff9f0df5 100644 --- a/cef1/libcef/browser_webview_delegate.cc +++ b/cef1/libcef/browser_webview_delegate.cc @@ -60,10 +60,10 @@ #include "ui/gfx/native_widget_types.h" #include "ui/gfx/point.h" #include "webkit/appcache/web_application_cache_host_impl.h" +#include "webkit/base/file_path_string_conversions.h" #include "webkit/glue/glue_serialize.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/weburlrequest_extradata_impl.h" -#include "webkit/glue/webkit_glue.h" #include "webkit/glue/window_open_disposition.h" #include "webkit/plugins/npapi/plugin_list.h" #include "webkit/plugins/npapi/webplugin_delegate_impl.h" @@ -302,13 +302,13 @@ bool BrowserWebViewDelegate::runFileChooser( std::vector file_names; if (!ShowFileChooser(file_names, params.multiSelect, params.title, - webkit_glue::WebStringToFilePath(params.initialValue))) { + webkit_base::WebStringToFilePath(params.initialValue))) { return false; } WebVector ws_file_names(file_names.size()); for (size_t i = 0; i < file_names.size(); ++i) { - ws_file_names[i] = webkit_glue::FilePathToWebString(file_names[i]); + ws_file_names[i] = webkit_base::FilePathToWebString(file_names[i]); } chooser_completion->didChooseFile(ws_file_names); diff --git a/cef1/libcef/browser_webview_delegate_gtk.cc b/cef1/libcef/browser_webview_delegate_gtk.cc index f79b1c22d..a4fe96c58 100644 --- a/cef1/libcef/browser_webview_delegate_gtk.cc +++ b/cef1/libcef/browser_webview_delegate_gtk.cc @@ -328,13 +328,7 @@ void BrowserWebViewDelegate::runModal() { webkit::npapi::WebPluginDelegate* BrowserWebViewDelegate::CreatePluginDelegate( const FilePath& path, const std::string& mime_type) { - // TODO(evanm): we probably shouldn't be doing this mapping to X ids at - // this level. - GdkNativeWindow plugin_parent = - GDK_WINDOW_XWINDOW(browser_->UIT_GetWebViewHost()->view_handle()->window); - - return webkit::npapi::WebPluginDelegateImpl::Create(path, mime_type, - plugin_parent); + return webkit::npapi::WebPluginDelegateImpl::Create(path, mime_type); } void BrowserWebViewDelegate::CreatedPluginWindow( diff --git a/cef1/libcef/browser_webview_delegate_mac.mm b/cef1/libcef/browser_webview_delegate_mac.mm index 2230be163..cb45d4996 100644 --- a/cef1/libcef/browser_webview_delegate_mac.mm +++ b/cef1/libcef/browser_webview_delegate_mac.mm @@ -427,9 +427,7 @@ webkit::npapi::WebPluginDelegate* BrowserWebViewDelegate::CreatePluginDelegate( if (!host) return NULL; - gfx::PluginWindowHandle containing_view = 0; - WebPluginDelegateImpl* delegate = WebPluginDelegateImpl::Create( - path, mime_type, containing_view); + WebPluginDelegateImpl* delegate = WebPluginDelegateImpl::Create(path, mime_type); if (delegate) delegate->SetNoBufferContext(); return delegate; diff --git a/cef1/libcef/browser_webview_delegate_win.cc b/cef1/libcef/browser_webview_delegate_win.cc index 31af6d655..ec13a3332 100644 --- a/cef1/libcef/browser_webview_delegate_win.cc +++ b/cef1/libcef/browser_webview_delegate_win.cc @@ -253,7 +253,7 @@ void BrowserWebViewDelegate::startDragging( drag_delegate_ = new BrowserDragDelegate(this); drag_delegate_->StartDragging(drop_data, mask, image.getSkBitmap(), - image_offset); + gfx::Point(image_offset).OffsetFromOrigin()); } void BrowserWebViewDelegate::runModal() { @@ -318,25 +318,17 @@ webkit::npapi::WebPluginDelegate* BrowserWebViewDelegate::CreatePluginDelegate( if (!host) return NULL; - HWND hwnd; - - if (!browser_->IsWindowRenderingDisabled()) { - // Parent the plugin container to the existing browser window. - hwnd = browser_->UIT_GetWebViewHost()->view_handle(); - DCHECK(hwnd != NULL); - } else { - // Parent the plugin container to the main window handle provided by the - // user. - hwnd = browser_->UIT_GetMainWndHandle(); - DCHECK(hwnd != NULL); - } - - return WebPluginDelegateImpl::Create(file_path, mime_type, hwnd); + return WebPluginDelegateImpl::Create(file_path, mime_type); } void BrowserWebViewDelegate::CreatedPluginWindow( gfx::PluginWindowHandle handle) { - if (browser_->IsWindowRenderingDisabled()) { + if (!browser_->IsWindowRenderingDisabled()) { + // Parent the plugin container to the existing browser window. + HWND parent = browser_->UIT_GetWebViewHost()->view_handle(); + DCHECK(parent != NULL); + SetParent(handle, parent); + } else { static bool registered_class = false; if (!registered_class) { WNDCLASSEX wcex = {0}; diff --git a/cef1/libcef/cef_context.cc b/cef1/libcef/cef_context.cc index c2ee5a56d..460ff14f7 100644 --- a/cef1/libcef/cef_context.cc +++ b/cef1/libcef/cef_context.cc @@ -533,10 +533,8 @@ base::StringPiece CefContext::GetDataResource(int resource_id) const { } #endif // defined(OS_MACOSX) - if (value.empty() && !settings_.pack_loading_disabled) { - value = ResourceBundle::GetSharedInstance().GetRawDataResource( - resource_id, ui::SCALE_FACTOR_NONE); - } + if (value.empty() && !settings_.pack_loading_disabled) + value = ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id); if (value.empty()) LOG(ERROR) << "No data resource available for id " << resource_id; diff --git a/cef1/libcef/drag_download_file.cc b/cef1/libcef/drag_download_file.cc index 5e979a8f9..ddfd05b5f 100644 --- a/cef1/libcef/drag_download_file.cc +++ b/cef1/libcef/drag_download_file.cc @@ -51,11 +51,11 @@ DragDownloadFile::~DragDownloadFile() { #endif } -bool DragDownloadFile::Start(ui::DownloadFileObserver* observer) { +void DragDownloadFile::Start(ui::DownloadFileObserver* observer) { AssertCurrentlyOnDragThread(); if (is_started_) - return true; + return; is_started_ = true; DCHECK(!observer_.get()); @@ -68,18 +68,19 @@ bool DragDownloadFile::Start(ui::DownloadFileObserver* observer) { // name already exists. if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("chrome"), &temp_dir_path_)) - return false; + return; file_path_ = temp_dir_path_.Append(file_name_); } InitiateDownload(); +} - // On Windows, we need to wait till the download file is completed. -#if defined(OS_WIN) - StartNestedMessageLoop(); -#endif +bool DragDownloadFile::Wait() { + AssertCurrentlyOnDragThread(); + if (is_started_) + nested_loop_.Run(); return is_successful_; } @@ -118,10 +119,8 @@ void DragDownloadFile::DownloadCompleted(bool is_successful) { is_successful_ = is_successful; - // On Windows, we need to stop the waiting. -#if defined(OS_WIN) - QuitNestedMessageLoop(); -#endif + if (nested_loop_.running()) + nested_loop_.Quit(); } void DragDownloadFile::AssertCurrentlyOnDragThread() { @@ -137,24 +136,3 @@ void DragDownloadFile::AssertCurrentlyOnUIThread() { DCHECK(CefThread::CurrentlyOn(CefThread::UI)); #endif } - -#if defined(OS_WIN) -void DragDownloadFile::StartNestedMessageLoop() { - AssertCurrentlyOnDragThread(); - - bool old_state = MessageLoop::current()->NestableTasksAllowed(); - MessageLoop::current()->SetNestableTasksAllowed(true); - is_running_nested_message_loop_ = true; - MessageLoop::current()->Run(); - MessageLoop::current()->SetNestableTasksAllowed(old_state); -} - -void DragDownloadFile::QuitNestedMessageLoop() { - AssertCurrentlyOnDragThread(); - - if (is_running_nested_message_loop_) { - is_running_nested_message_loop_ = false; - MessageLoop::current()->Quit(); - } -} -#endif diff --git a/cef1/libcef/drag_download_file.h b/cef1/libcef/drag_download_file.h index 7640176ee..037f043ba 100644 --- a/cef1/libcef/drag_download_file.h +++ b/cef1/libcef/drag_download_file.h @@ -12,6 +12,7 @@ #include "base/file_path.h" #include "base/memory/linked_ptr.h" #include "base/message_loop.h" +#include "base/run_loop.h" #include "googleurl/src/gurl.h" #include "ui/base/dragdrop/download_file_interface.h" @@ -42,23 +43,15 @@ class DragDownloadFile : public ui::DownloadFileProvider { // DownloadFileProvider methods. // Called on drag-and-drop thread (Windows). // Called on UI thread (MacOSX). - virtual bool Start(ui::DownloadFileObserver* observer); - virtual void Stop(); -#if defined(OS_WIN) - virtual IStream* GetStream() { return NULL; } -#endif + virtual void Start(ui::DownloadFileObserver* observer) OVERRIDE; + virtual bool Wait() OVERRIDE; + virtual void Stop() OVERRIDE; private: // Called on drag-and-drop thread (Windows). // Called on UI thread (Windows). virtual ~DragDownloadFile(); - // Called on drag-and-drop thread (Windows only). -#if defined(OS_WIN) - void StartNestedMessageLoop(); - void QuitNestedMessageLoop(); -#endif - // Called on either drag-and-drop thread or UI thread (Windows). // Called on UI thread (MacOSX). void InitiateDownload(); @@ -86,6 +79,7 @@ class DragDownloadFile : public ui::DownloadFileProvider { bool is_started_; bool is_successful_; scoped_refptr observer_; + base::RunLoop nested_loop_; // Accessed on drag-and-drop thread (Windows only). #if defined(OS_WIN) diff --git a/cef1/libcef/geolocation_client.cc b/cef1/libcef/geolocation_client.cc index c64b85d5d..ce63d2f6e 100644 --- a/cef1/libcef/geolocation_client.cc +++ b/cef1/libcef/geolocation_client.cc @@ -77,7 +77,7 @@ class CefAccessTokenStore : public content::AccessTokenStore { void NotifyArbitratorPermissionGranted() { DCHECK(CefThread::CurrentlyOn(CefThread::IO)); - GeolocationProvider::GetInstance()->OnPermissionGranted(); + content::GeolocationProvider::GetInstance()->OnPermissionGranted(); } } // namespace @@ -222,11 +222,11 @@ void CefGeolocationClient::OnStartUpdating(bool enable_high_accuracy) { DCHECK(CefThread::CurrentlyOn(CefThread::IO)); if (!location_provider_) - location_provider_ = GeolocationProvider::GetInstance(); + location_provider_ = content::GeolocationProvider::GetInstance(); // Re-add to re-establish our options, in case they changed. location_provider_->AddObserver( - this, GeolocationObserverOptions(enable_high_accuracy)); + this, content::GeolocationObserverOptions(enable_high_accuracy)); } void CefGeolocationClient::OnStopUpdating() { @@ -310,38 +310,40 @@ void CefGeolocationClient::OnPositionUpdated( // Replacement for content/browser/geolocation/arbitrator_dependency_factory.cc // GeolocationArbitratorDependencyFactory -GeolocationArbitratorDependencyFactory:: +content::GeolocationArbitratorDependencyFactory:: ~GeolocationArbitratorDependencyFactory() { } // DefaultGeolocationArbitratorDependencyFactory -DefaultGeolocationArbitratorDependencyFactory:: +content::DefaultGeolocationArbitratorDependencyFactory:: ~DefaultGeolocationArbitratorDependencyFactory() { } -DefaultGeolocationArbitratorDependencyFactory::GetTimeNow -DefaultGeolocationArbitratorDependencyFactory::GetTimeFunction() { +content::DefaultGeolocationArbitratorDependencyFactory::GetTimeNow +content::DefaultGeolocationArbitratorDependencyFactory::GetTimeFunction() { return base::Time::Now; } content::AccessTokenStore* -DefaultGeolocationArbitratorDependencyFactory::NewAccessTokenStore() { +content::DefaultGeolocationArbitratorDependencyFactory::NewAccessTokenStore() { return new CefAccessTokenStore; } -LocationProviderBase* -DefaultGeolocationArbitratorDependencyFactory::NewNetworkLocationProvider( +content::LocationProviderBase* +content::DefaultGeolocationArbitratorDependencyFactory:: + NewNetworkLocationProvider( content::AccessTokenStore* access_token_store, net::URLRequestContextGetter* context, const GURL& url, const string16& access_token) { - return ::NewNetworkLocationProvider(access_token_store, context, - url, access_token); + return content::NewNetworkLocationProvider(access_token_store, context, + url, access_token); } -LocationProviderBase* -DefaultGeolocationArbitratorDependencyFactory::NewSystemLocationProvider() { - return ::NewSystemLocationProvider(); +content::LocationProviderBase* +content::DefaultGeolocationArbitratorDependencyFactory:: + NewSystemLocationProvider() { + return content::NewSystemLocationProvider(); } diff --git a/cef1/libcef/geolocation_client.h b/cef1/libcef/geolocation_client.h index 85ff5b257..2d4be04b3 100644 --- a/cef1/libcef/geolocation_client.h +++ b/cef1/libcef/geolocation_client.h @@ -15,8 +15,11 @@ class CefBrowserImpl; class CefGeolocationCallbackImpl; + +namespace content { class GeolocationProvider; struct Geoposition; +} namespace WebKit { class WebGeolocationController; @@ -28,7 +31,7 @@ class WebGeolocationPosition; // Delegate for Geolocation messages used by WebKit. class CefGeolocationClient : public WebKit::WebGeolocationClient, - public GeolocationObserver, + public content::GeolocationObserver, public base::RefCountedThreadSafe { public: explicit CefGeolocationClient(CefBrowserImpl* browser); @@ -83,7 +86,7 @@ class CefGeolocationClient // The following members are only accessed on the IO thread. // Only set whilst we are registered with the arbitrator. - GeolocationProvider* location_provider_; + content::GeolocationProvider* location_provider_; DISALLOW_COPY_AND_ASSIGN(CefGeolocationClient); }; diff --git a/cef1/libcef/geolocation_impl.cc b/cef1/libcef/geolocation_impl.cc index f55d43461..b0792bea7 100644 --- a/cef1/libcef/geolocation_impl.cc +++ b/cef1/libcef/geolocation_impl.cc @@ -66,7 +66,8 @@ bool CefGetGeolocation(CefRefPtr callback) { } if (CefThread::CurrentlyOn(CefThread::IO)) { - GeolocationProvider* provider = GeolocationProvider::GetInstance(); + content::GeolocationProvider* provider = + content::GeolocationProvider::GetInstance(); if (provider) { provider->RequestCallback(base::Bind(LocationCallback, callback)); return true; diff --git a/cef1/libcef/simple_clipboard_impl.cc b/cef1/libcef/simple_clipboard_impl.cc index e92d5498f..f14b7bbf1 100644 --- a/cef1/libcef/simple_clipboard_impl.cc +++ b/cef1/libcef/simple_clipboard_impl.cc @@ -104,6 +104,11 @@ void SimpleClipboardClient::ReadCustomData(ui::Clipboard::Buffer buffer, GetClipboard()->ReadCustomData(buffer, type, data); } +void SimpleClipboardClient::ReadData(const ui::Clipboard::FormatType& format, + std::string* data) { + GetClipboard()->ReadData(format, data); +} + webkit_glue::ClipboardClient::WriteContext* SimpleClipboardClient::CreateWriteContext() { return NULL; diff --git a/cef1/libcef/simple_clipboard_impl.h b/cef1/libcef/simple_clipboard_impl.h index 509b5c6ca..3707965ba 100644 --- a/cef1/libcef/simple_clipboard_impl.h +++ b/cef1/libcef/simple_clipboard_impl.h @@ -39,6 +39,8 @@ class SimpleClipboardClient : public webkit_glue::ClipboardClient { virtual void ReadCustomData(ui::Clipboard::Buffer buffer, const string16& type, string16* data) OVERRIDE; + virtual void ReadData(const ui::Clipboard::FormatType& format, + std::string* data) OVERRIDE; virtual WriteContext* CreateWriteContext() OVERRIDE; }; diff --git a/cef1/libcef/webwidget_host.cc b/cef1/libcef/webwidget_host.cc index 5705f524c..aff6ea8b0 100644 --- a/cef1/libcef/webwidget_host.cc +++ b/cef1/libcef/webwidget_host.cc @@ -24,16 +24,15 @@ void WebWidgetHost::InvalidateRect(const gfx::Rect& rect) { int width, height; GetSize(width, height); - const gfx::Rect client_rect(width, height); - - const gfx::Rect rect_in_client = client_rect.Intersect(rect); - if (rect_in_client.IsEmpty()) + gfx::Rect client_rect(width, height); + client_rect.Intersect(rect); + if (client_rect.IsEmpty()) return; - UpdatePaintRect(rect_in_client); + UpdatePaintRect(client_rect); if (view_) - InvalidateWindowRect(rect_in_client); + InvalidateWindowRect(client_rect); else ScheduleTimer(); } @@ -140,7 +139,7 @@ void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) { SkRegion::kUnion_Op); #else // TODO(cef): Update all ports to use regions instead of rectangles. - paint_rect_ = paint_rect_.Union(rect); + paint_rect_.Union(rect); #endif } diff --git a/cef1/libcef/webwidget_host_gtk.cc b/cef1/libcef/webwidget_host_gtk.cc index d010ed7ef..ea0614a27 100644 --- a/cef1/libcef/webwidget_host_gtk.cc +++ b/cef1/libcef/webwidget_host_gtk.cc @@ -355,14 +355,14 @@ void WebWidgetHost::Paint() { // to update that area after we're done painting it. gfx::Rect total_paint; for (int i = 0; i < 2; ++i) { - paint_rect_ = client_rect.Intersect(paint_rect_); + paint_rect_.Intersect(client_rect); if (!paint_rect_.IsEmpty()) { gfx::Rect rect(paint_rect_); paint_rect_ = gfx::Rect(); DLOG_IF(WARNING, i == 1) << "painting caused additional invalidations"; PaintRect(rect); - total_paint = total_paint.Union(rect); + total_paint.Union(rect); } } // DCHECK(paint_rect_.IsEmpty()); diff --git a/cef1/libcef/webwidget_host_mac.mm b/cef1/libcef/webwidget_host_mac.mm index 180c74fc9..8bffc84d4 100644 --- a/cef1/libcef/webwidget_host_mac.mm +++ b/cef1/libcef/webwidget_host_mac.mm @@ -98,7 +98,8 @@ void WebWidgetHost::ScrollRect(int dx, int dy, const gfx::Rect& clip_rect) { int width, height; GetSize(width, height); const gfx::Rect client_rect(width, height); - gfx::Rect rect = clip_rect.Intersect(client_rect); + gfx::Rect rect = clip_rect; + rect.Intersect(client_rect); const int x = rect.x(); const int y = rect.y(); diff --git a/cef1/patch/patches/tools_gyp.patch b/cef1/patch/patches/tools_gyp.patch index 525cf75d2..de0e92da5 100644 --- a/cef1/patch/patches/tools_gyp.patch +++ b/cef1/patch/patches/tools_gyp.patch @@ -1,8 +1,8 @@ -Index: pylib/gyp/input.py -=================================================================== ---- pylib/gyp/input.py (revision 1508) -+++ pylib/gyp/input.py (working copy) -@@ -824,7 +824,8 @@ +Index: pylib/gyp/input.py +=================================================================== +--- pylib/gyp/input.py (revision 1527) ++++ pylib/gyp/input.py (working copy) +@@ -851,7 +851,8 @@ # that don't load quickly, this can be faster than #