From a2a351362003b98291ee548fd27aff9d39c46e0c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 24 Jul 2013 20:15:18 +0000 Subject: [PATCH] Update to Chromium revision 213078. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1338 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- cef.gyp | 9 +- include/capi/cef_download_item_capi.h | 2 +- include/cef_download_item.h | 2 +- libcef/browser/browser_context.cc | 41 +- libcef/browser/browser_context.h | 11 +- libcef/browser/browser_host_impl.cc | 24 +- libcef/browser/browser_host_impl.h | 11 +- libcef/browser/browser_main.cc | 12 +- libcef/browser/browser_message_loop.h | 2 +- libcef/browser/browser_urlrequest_impl.cc | 2 +- libcef/browser/chrome_scheme_handler.cc | 5 +- libcef/browser/chrome_scheme_handler.h | 2 +- libcef/browser/content_browser_client.cc | 4 +- libcef/browser/content_browser_client.h | 2 +- libcef/browser/context.cc | 2 +- libcef/browser/cookie_manager_impl.cc | 4 +- libcef/browser/devtools_delegate.cc | 2 +- libcef/browser/download_item_impl.cc | 4 +- libcef/browser/download_item_impl.h | 2 +- libcef/browser/download_manager_delegate.cc | 20 +- libcef/browser/download_manager_delegate.h | 1 + libcef/browser/internal_scheme_handler.h | 2 +- .../media_capture_devices_dispatcher.cc | 25 +- .../media_capture_devices_dispatcher.h | 21 +- libcef/browser/menu_creator_runner_mac.mm | 2 +- libcef/browser/menu_creator_runner_win.cc | 2 +- libcef/browser/menu_model_impl.cc | 2 +- libcef/browser/navigate_params.h | 2 +- libcef/browser/origin_whitelist_impl.cc | 2 +- libcef/browser/render_widget_host_view_osr.cc | 9 +- libcef/browser/render_widget_host_view_osr.h | 7 +- .../render_widget_host_view_osr_mac.mm | 3 +- libcef/browser/scheme_handler.h | 2 +- libcef/browser/scheme_impl.cc | 4 +- .../speech_recognition_manager_delegate.cc | 439 +++++++++--------- .../speech_recognition_manager_delegate.h | 2 + libcef/browser/trace_impl.cc | 2 +- libcef/browser/url_request_context_getter.cc | 6 +- libcef/browser/web_contents_view_osr.cc | 10 +- libcef/browser/web_contents_view_osr.h | 10 +- libcef/browser/web_plugin_impl.cc | 6 +- libcef/browser/web_plugin_impl.h | 6 +- libcef/common/cef_messages.h | 2 +- libcef/common/drag_data_impl.cc | 4 +- libcef/common/drag_data_impl.h | 6 +- libcef/common/main_delegate.cc | 4 +- libcef/common/task_runner_impl.cc | 2 +- libcef/common/time_util.h | 2 +- libcef/common/url_impl.cc | 2 +- libcef/common/urlrequest_impl.cc | 2 +- libcef/renderer/browser_impl.cc | 20 +- libcef/renderer/content_renderer_client.cc | 2 +- libcef/renderer/content_renderer_client.h | 2 +- libcef/renderer/render_message_filter.cc | 6 +- libcef/renderer/render_urlrequest_impl.cc | 2 +- libcef/renderer/v8_impl.cc | 62 +-- libcef/renderer/webkit_glue.cc | 36 +- libcef/renderer/webkit_glue.h | 6 +- libcef/resources/cef_resources.grd | 2 - libcef_dll/cpptoc/download_item_cpptoc.cc | 4 +- libcef_dll/ctocpp/download_item_ctocpp.cc | 4 +- libcef_dll/ctocpp/download_item_ctocpp.h | 2 +- patch/patch.cfg | 2 +- patch/patches/message_loop_443.patch | 4 +- patch/patches/spi_webcore_364.patch | 6 +- patch/patches/webkit_933.patch | 6 +- patch/patches/webkit_popups.patch | 32 +- tests/cefclient/client_handler.cpp | 2 +- 69 files changed, 510 insertions(+), 444 deletions(-) diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 313c72132..ac1b2b7aa 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': '208345', + 'chromium_revision': '213078', } diff --git a/cef.gyp b/cef.gyp index 9aff7d266..69e76e547 100644 --- a/cef.gyp +++ b/cef.gyp @@ -564,7 +564,7 @@ 'type': 'none', 'dependencies': [ '<(DEPTH)/ui/base/strings/ui_strings.gyp:ui_strings', - '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings', + '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings', 'cef_strings', ], 'variables': { @@ -693,10 +693,11 @@ 'type': 'none', 'dependencies': [ '<(DEPTH)/content/browser/devtools/devtools_resources.gyp:devtools_resources', + '<(DEPTH)/content/browser/tracing/tracing_resources.gyp:tracing_resources', '<(DEPTH)/content/content_resources.gyp:content_resources', '<(DEPTH)/net/net.gyp:net_resources', '<(DEPTH)/ui/ui.gyp:ui_resources', - '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources', + '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources', 'cef_locales', 'cef_resources', ], @@ -709,6 +710,7 @@ 'action_name': 'repack_cef_pack', 'variables': { 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak', @@ -731,6 +733,7 @@ 'action_name': 'make_pack_resources_header', 'variables': { 'header_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/grit/tracing_resources.h', '<(SHARED_INTERMEDIATE_DIR)/content/grit/content_resources.h', '<(SHARED_INTERMEDIATE_DIR)/net/grit/net_resources.h', '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/grit/ui_resources.h', @@ -793,6 +796,7 @@ '<(DEPTH)/third_party/WebKit/public/web', # CEF grit resource includes '<(grit_out_dir)', + '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing', '<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings', '<(SHARED_INTERMEDIATE_DIR)/webkit', ], @@ -1002,6 +1006,7 @@ # Include sources for proxy support. '<(DEPTH)/base/prefs/testing_pref_store.cc', '<(DEPTH)/base/prefs/testing_pref_store.h', + '<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker.cc', '<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker.h', '<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker_impl.cc', '<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker_impl.h', diff --git a/include/capi/cef_download_item_capi.h b/include/capi/cef_download_item_capi.h index 5639eb53f..6f6c678dd 100644 --- a/include/capi/cef_download_item_capi.h +++ b/include/capi/cef_download_item_capi.h @@ -116,7 +116,7 @@ typedef struct _cef_download_item_t { /// // Returns the unique identifier for this download. /// - int32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self); + uint32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self); /// // Returns the URL. diff --git a/include/cef_download_item.h b/include/cef_download_item.h index 55f7fce06..6f76ff5e4 100644 --- a/include/cef_download_item.h +++ b/include/cef_download_item.h @@ -118,7 +118,7 @@ class CefDownloadItem : public virtual CefBase { // Returns the unique identifier for this download. /// /*--cef()--*/ - virtual int32 GetId() =0; + virtual uint32 GetId() =0; /// // Returns the URL. diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index 911f3185d..b7e4e1747 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -11,17 +11,14 @@ #include "libcef/browser/download_manager_delegate.h" #include "libcef/browser/thread_util.h" #include "libcef/browser/url_request_context_getter.h" -#include "libcef/common/cef_switches.h" #include "base/bind.h" -#include "base/command_line.h" #include "base/logging.h" #include "base/threading/thread.h" #include "content/public/browser/download_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/geolocation_permission_context.h" #include "content/public/browser/resource_context.h" -#include "content/public/browser/speech_recognition_preferences.h" #include "content/public/browser/storage_partition.h" using content::BrowserThread; @@ -158,26 +155,6 @@ class CefGeolocationPermissionContext DISALLOW_COPY_AND_ASSIGN(CefGeolocationPermissionContext); }; -class CefSpeechRecognitionPreferences - : public content::SpeechRecognitionPreferences { - public: - CefSpeechRecognitionPreferences() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - filter_profanities_ = - command_line.HasSwitch(switches::kEnableProfanityFilter); - } - - // Overridden from SpeechRecognitionPreferences: - virtual bool FilterProfanities() const OVERRIDE { - return filter_profanities_; - } - - private: - bool filter_profanities_; - - DISALLOW_COPY_AND_ASSIGN(CefSpeechRecognitionPreferences); -}; - } // namespace class CefBrowserContext::CefResourceContext : public content::ResourceContext { @@ -222,7 +199,7 @@ CefBrowserContext::~CefBrowserContext() { } } -base::FilePath CefBrowserContext::GetPath() { +base::FilePath CefBrowserContext::GetPath() const { return _Context->cache_path(); } @@ -272,6 +249,15 @@ net::URLRequestContextGetter* return GetRequestContext(); } +void CefBrowserContext::RequestMIDISysExPermission( + int render_process_id, + int render_view_id, + const GURL& requesting_frame, + const MIDISysExPermissionCallback& callback) { + // TODO(CEF): Implement Web MIDI API permission handling. + callback.Run(false); +} + content::ResourceContext* CefBrowserContext::GetResourceContext() { return resource_context_.get(); } @@ -285,13 +271,6 @@ content::GeolocationPermissionContext* return geolocation_permission_context_; } -content::SpeechRecognitionPreferences* - CefBrowserContext::GetSpeechRecognitionPreferences() { - if (!speech_recognition_preferences_.get()) - speech_recognition_preferences_ = new CefSpeechRecognitionPreferences(); - return speech_recognition_preferences_.get(); -} - quota::SpecialStoragePolicy* CefBrowserContext::GetSpecialStoragePolicy() { return NULL; } diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index e9799922f..e5a1af07f 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -28,7 +28,7 @@ class CefBrowserContext : public content::BrowserContext { virtual ~CefBrowserContext(); // BrowserContext methods. - virtual base::FilePath GetPath() OVERRIDE; + virtual base::FilePath GetPath() const OVERRIDE; virtual bool IsOffTheRecord() const OVERRIDE; virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE; virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; @@ -41,11 +41,14 @@ class CefBrowserContext : public content::BrowserContext { GetMediaRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory) OVERRIDE; + virtual void RequestMIDISysExPermission( + int render_process_id, + int render_view_id, + const GURL& requesting_frame, + const MIDISysExPermissionCallback& callback) OVERRIDE; virtual content::ResourceContext* GetResourceContext() OVERRIDE; virtual content::GeolocationPermissionContext* GetGeolocationPermissionContext() OVERRIDE; - virtual content::SpeechRecognitionPreferences* - GetSpeechRecognitionPreferences() OVERRIDE; virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; net::URLRequestContextGetter* CreateRequestContext( @@ -70,8 +73,6 @@ class CefBrowserContext : public content::BrowserContext { scoped_refptr url_request_getter_; scoped_refptr geolocation_permission_context_; - scoped_refptr - speech_recognition_preferences_; bool use_osr_next_contents_view_; diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 139695885..5a163a966 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -1631,7 +1631,7 @@ void CefBrowserHostImpl::HandleKeyboardEvent( bool CefBrowserHostImpl::CanDragEnter( content::WebContents* source, - const WebDropData& data, + const content::DropData& data, WebKit::WebDragOperationsMask mask) { CefRefPtr handler = client_->GetDragHandler(); if (handler.get()) { @@ -1649,7 +1649,10 @@ bool CefBrowserHostImpl::ShouldCreateWebContents( int route_id, WindowContainerType window_container_type, const string16& frame_name, - const GURL& target_url) { + const GURL& target_url, + WindowOpenDisposition disposition, + const WebKit::WebWindowFeatures& features, + bool user_gesture) { CefContentBrowserClient::Get()->GetOrCreateBrowserInfo( web_contents->GetRenderProcessHost()->GetID(), route_id); @@ -1714,7 +1717,7 @@ void CefBrowserHostImpl::RunFileChooser( RunFileChooserOnUIThread(params, base::Bind(&CefBrowserHostImpl::OnRunFileChooserDelegateCallback, this, - tab)); + tab, params.mode)); } bool CefBrowserHostImpl::SetPendingPopupInfo( @@ -1757,7 +1760,8 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( // For open device request pick the desired device or fall back to the // first available of the given type. CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice( - request.requested_device_id, + (microphone_requested ? request.requested_audio_device_id : + request.requested_video_device_id), microphone_requested, webcam_requested, &devices); @@ -1828,7 +1832,7 @@ void CefBrowserHostImpl::RenderViewReady() { } } -void CefBrowserHostImpl::RenderViewGone(base::TerminationStatus status) { +void CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) { queue_messages_ = true; cef_termination_status_t ts = TS_ABNORMAL_TERMINATION; @@ -2354,6 +2358,7 @@ void CefBrowserHostImpl::OnRunFileChooserCallback( void CefBrowserHostImpl::OnRunFileChooserDelegateCallback( content::WebContents* tab, + content::FileChooserParams::Mode mode, const std::vector& file_paths) { CEF_REQUIRE_UIT(); @@ -2361,12 +2366,6 @@ void CefBrowserHostImpl::OnRunFileChooserDelegateCallback( if (!render_view_host) return; - const int kReadFilePermissions = - base::PLATFORM_FILE_OPEN | - base::PLATFORM_FILE_READ | - base::PLATFORM_FILE_EXCLUSIVE_READ | - base::PLATFORM_FILE_ASYNC; - // Convert FilePath list to SelectedFileInfo list. std::vector selected_files; for (size_t i = 0; i < file_paths.size(); ++i) { @@ -2375,6 +2374,5 @@ void CefBrowserHostImpl::OnRunFileChooserDelegateCallback( } // Notify our RenderViewHost in all cases. - render_view_host->FilesSelectedInChooser(selected_files, - kReadFilePermissions); + render_view_host->FilesSelectedInChooser(selected_files, mode); } diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 2f7ada456..b3bd89c26 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -28,6 +28,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" +#include "content/public/common/file_chooser_params.h" #include "net/url_request/url_request_context_getter.h" namespace content { @@ -303,14 +304,17 @@ class CefBrowserHostImpl : public CefBrowserHost, const content::NativeWebKeyboardEvent& event) OVERRIDE; virtual bool CanDragEnter( content::WebContents* source, - const WebDropData& data, + const content::DropData& data, WebKit::WebDragOperationsMask operations_allowed) OVERRIDE; virtual bool ShouldCreateWebContents( content::WebContents* web_contents, int route_id, WindowContainerType window_container_type, const string16& frame_name, - const GURL& target_url) OVERRIDE; + const GURL& target_url, + WindowOpenDisposition disposition, + const WebKit::WebWindowFeatures& features, + bool user_gesture) OVERRIDE; virtual void WebContentsCreated(content::WebContents* source_contents, int64 source_frame_id, const string16& frame_name, @@ -337,7 +341,7 @@ class CefBrowserHostImpl : public CefBrowserHost, virtual void RenderViewDeleted( content::RenderViewHost* render_view_host) OVERRIDE; virtual void RenderViewReady() OVERRIDE; - virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; + virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; virtual void DidCommitProvisionalLoadForFrame( int64 frame_id, bool is_main_frame, @@ -471,6 +475,7 @@ class CefBrowserHostImpl : public CefBrowserHost, // Used with WebContentsDelegate::RunFileChooser to notify the WebContents. void OnRunFileChooserDelegateCallback( content::WebContents* tab, + content::FileChooserParams::Mode mode, const std::vector& file_paths); CefWindowInfo window_info_; diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index e1148f500..567021fc6 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -14,7 +14,7 @@ #include "base/bind.h" #include "base/command_line.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/net/proxy_service_factory.h" #include "content/browser/webui/content_web_ui_controller_factory.h" @@ -74,7 +74,7 @@ int CefBrowserMainParts::PreCreateThreads() { // Initialize proxy configuration tracker. pref_proxy_config_tracker_.reset( - ProxyServiceFactory::CreatePrefProxyConfigTracker( + ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( pref_service_.get())); return 0; @@ -86,11 +86,9 @@ void CefBrowserMainParts::PreMainMessageLoopRun() { // Initialize the proxy configuration service. This needs to occur before // CefURLRequestContextGetter::GetURLRequestContext() is called for the // first time. - ChromeProxyConfigService* chrome_proxy_config_service = - ProxyServiceFactory::CreateProxyConfigService(); - proxy_config_service_.reset(chrome_proxy_config_service); - pref_proxy_config_tracker_->SetChromeProxyConfigService( - chrome_proxy_config_service); + proxy_config_service_.reset( + ProxyServiceFactory::CreateProxyConfigService( + pref_proxy_config_tracker_.get())); // Initialize the request context getter. This indirectly triggers a call // to CefURLRequestContextGetter::GetURLRequestContext() on the IO thread. diff --git a/libcef/browser/browser_message_loop.h b/libcef/browser/browser_message_loop.h index 53d8da84d..990b1aa9a 100644 --- a/libcef/browser/browser_message_loop.h +++ b/libcef/browser/browser_message_loop.h @@ -7,7 +7,7 @@ #pragma once #include "base/basictypes.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" // Class used to process events on the current message loop. class CefBrowserMessageLoop : public base::MessageLoopForUI { diff --git a/libcef/browser/browser_urlrequest_impl.cc b/libcef/browser/browser_urlrequest_impl.cc index cdf3932a7..a8be4763c 100644 --- a/libcef/browser/browser_urlrequest_impl.cc +++ b/libcef/browser/browser_urlrequest_impl.cc @@ -14,7 +14,7 @@ #include "libcef/common/response_impl.h" #include "base/logging.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" #include "content/public/common/url_fetcher.h" #include "net/base/load_flags.h" diff --git a/libcef/browser/chrome_scheme_handler.cc b/libcef/browser/chrome_scheme_handler.cc index 9295b7963..8647cb40f 100644 --- a/libcef/browser/chrome_scheme_handler.cc +++ b/libcef/browser/chrome_scheme_handler.cc @@ -31,6 +31,7 @@ #include "content/browser/net/view_blob_internals_job_factory.h" #include "content/public/common/url_constants.h" #include "grit/cef_resources.h" +#include "grit/tracing_resources.h" #include "ipc/ipc_channel.h" #include "net/url_request/url_request.h" #include "v8/include/v8.h" @@ -257,10 +258,10 @@ class Delegate : public InternalHandlerDelegate { bool OnTracing(const std::string& path, Action* action) { if (path == "tracing.js") { - action->resource_id = IDR_CEF_TRACING_JS; + action->resource_id = IDR_TRACING_JS; } else { action->mime_type = "text/html"; - action->resource_id = IDR_CEF_TRACING_HTML; + action->resource_id = IDR_TRACING_HTML; } return true; } diff --git a/libcef/browser/chrome_scheme_handler.h b/libcef/browser/chrome_scheme_handler.h index cd339f335..25f60efa3 100644 --- a/libcef/browser/chrome_scheme_handler.h +++ b/libcef/browser/chrome_scheme_handler.h @@ -13,8 +13,8 @@ #include "include/cef_process_message.h" #include "base/memory/scoped_ptr.h" -#include "googleurl/src/gurl.h" #include "net/url_request/url_request_job_factory.h" +#include "url/gurl.h" namespace base { class ListValue; diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 50e54a707..657b1e5a3 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -38,8 +38,8 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/resource_dispatcher_host.h" #include "content/public/common/content_switches.h" -#include "googleurl/src/gurl.h" #include "ui/base/ui_base_switches.h" +#include "url/gurl.h" namespace { @@ -213,7 +213,7 @@ class CefPluginServiceFilter : public content::PluginServiceFilter { const void* context, const GURL& url, const GURL& policy_url, - webkit::WebPluginInfo* plugin) OVERRIDE { + content::WebPluginInfo* plugin) OVERRIDE { bool allowed = true; CefRefPtr browser = diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index e42fc1d80..7376a7f37 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -17,7 +17,7 @@ #include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" #include "content/public/browser/content_browser_client.h" -#include "googleurl/src/gurl.h" +#include "url/gurl.h" class CefBrowserContext; class CefBrowserInfo; diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc index 6395e4838..c5565b6e3 100644 --- a/libcef/browser/context.cc +++ b/libcef/browser/context.cc @@ -182,7 +182,7 @@ bool CefContext::Initialize(const CefMainArgs& args, cache_path_ = base::FilePath(CefString(&settings.cache_path)); if (!cache_path_.empty() && - !file_util::DirectoryExists(cache_path_) && + !base::DirectoryExists(cache_path_) && !file_util::CreateDirectory(cache_path_)) { NOTREACHED() << "The cache_path directory could not be created"; cache_path_ = base::FilePath(); diff --git a/libcef/browser/cookie_manager_impl.cc b/libcef/browser/cookie_manager_impl.cc index d548cb1b9..09c9fb532 100644 --- a/libcef/browser/cookie_manager_impl.cc +++ b/libcef/browser/cookie_manager_impl.cc @@ -20,10 +20,10 @@ #include "base/logging.h" #include "base/threading/thread_restrictions.h" #include "content/browser/net/sqlite_persistent_cookie_store.h" -#include "googleurl/src/gurl.h" #include "net/cookies/cookie_util.h" #include "net/cookies/parsed_cookie.h" #include "net/url_request/url_request_context.h" +#include "url/gurl.h" using content::BrowserThread; @@ -285,7 +285,7 @@ bool CefCookieManagerImpl::SetStoragePath( // TODO(cef): Move directory creation to the blocking pool instead of // allowing file IO on this thread. base::ThreadRestrictions::ScopedAllowIO allow_io; - if (file_util::DirectoryExists(new_path) || + if (base::DirectoryExists(new_path) || file_util::CreateDirectory(new_path)) { const base::FilePath& cookie_path = new_path.AppendASCII("Cookies"); persistent_store = diff --git a/libcef/browser/devtools_delegate.cc b/libcef/browser/devtools_delegate.cc index 90fcfe5df..99aec54b1 100644 --- a/libcef/browser/devtools_delegate.cc +++ b/libcef/browser/devtools_delegate.cc @@ -14,7 +14,7 @@ #include "base/rand_util.h" #include "base/strings/stringprintf.h" #include "base/strings/string_number_conversions.h" -#include "base/time.h" +#include "base/time/time.h" #include "content/public/browser/devtools_http_handler.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" diff --git a/libcef/browser/download_item_impl.cc b/libcef/browser/download_item_impl.cc index a7bae5752..ae8787744 100644 --- a/libcef/browser/download_item_impl.cc +++ b/libcef/browser/download_item_impl.cc @@ -7,7 +7,7 @@ #include "libcef/common/time_util.h" #include "content/public/browser/download_item.h" -#include "googleurl/src/gurl.h" +#include "url/gurl.h" CefDownloadItemImpl::CefDownloadItemImpl(content::DownloadItem* value) @@ -76,7 +76,7 @@ CefString CefDownloadItemImpl::GetFullPath() { return const_value().GetFullPath().value(); } -int32 CefDownloadItemImpl::GetId() { +uint32 CefDownloadItemImpl::GetId() { CEF_VALUE_VERIFY_RETURN(false, 0); return const_value().GetId(); } diff --git a/libcef/browser/download_item_impl.h b/libcef/browser/download_item_impl.h index 64a598310..6f3fcc8df 100644 --- a/libcef/browser/download_item_impl.h +++ b/libcef/browser/download_item_impl.h @@ -31,7 +31,7 @@ class CefDownloadItemImpl virtual CefTime GetStartTime() OVERRIDE; virtual CefTime GetEndTime() OVERRIDE; virtual CefString GetFullPath() OVERRIDE; - virtual int32 GetId() OVERRIDE; + virtual uint32 GetId() OVERRIDE; virtual CefString GetURL() OVERRIDE; virtual CefString GetSuggestedFileName() OVERRIDE; virtual CefString GetContentDisposition() OVERRIDE; diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index 1181b32b0..bd6fe2064 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -53,7 +53,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { public: CefBeforeDownloadCallbackImpl( const base::WeakPtr& manager, - int32 download_id, + uint32 download_id, const base::FilePath& suggested_name, const content::DownloadTargetCallback& callback) : manager_(manager), @@ -88,7 +88,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { private: static void GenerateFilename( base::WeakPtr manager, - int32 download_id, + uint32 download_id, const base::FilePath& suggested_name, const base::FilePath& download_path, bool show_dialog, @@ -97,7 +97,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { if (!suggested_path.empty()) { // Create the directory if necessary. base::FilePath dir_path = suggested_path.DirName(); - if (!file_util::DirectoryExists(dir_path) && + if (!base::DirectoryExists(dir_path) && !file_util::CreateDirectory(dir_path)) { NOTREACHED() << "failed to create the download directory"; suggested_path.clear(); @@ -122,7 +122,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { static void ChooseDownloadPath( base::WeakPtr manager, - int32 download_id, + uint32 download_id, const base::FilePath& suggested_path, bool show_dialog, const content::DownloadTargetCallback& callback) { @@ -184,7 +184,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { } base::WeakPtr manager_; - int32 download_id_; + uint32 download_id_; base::FilePath suggested_name_; content::DownloadTargetCallback callback_; @@ -198,7 +198,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { public: explicit CefDownloadItemCallbackImpl( const base::WeakPtr& manager, - int32 download_id) + uint32 download_id) : manager_(manager), download_id_(download_id) { } @@ -223,7 +223,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { } base::WeakPtr manager_; - int32 download_id_; + uint32 download_id_; IMPLEMENT_REFCOUNTING(CefDownloadItemCallbackImpl); DISALLOW_COPY_AND_ASSIGN(CefDownloadItemCallbackImpl); @@ -341,3 +341,9 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget( return true; } + +void CefDownloadManagerDelegate::GetNextId( + const content::DownloadIdCallback& callback) { + static uint32 next_id = DownloadItem::kInvalidId + 1; + callback.Run(next_id++); +} diff --git a/libcef/browser/download_manager_delegate.h b/libcef/browser/download_manager_delegate.h index 272dc4f64..86f01f78c 100644 --- a/libcef/browser/download_manager_delegate.h +++ b/libcef/browser/download_manager_delegate.h @@ -36,6 +36,7 @@ class CefDownloadManagerDelegate virtual bool DetermineDownloadTarget( content::DownloadItem* item, const content::DownloadTargetCallback& callback) OVERRIDE; + virtual void GetNextId(const content::DownloadIdCallback& callback) OVERRIDE; content::DownloadManager* manager_; base::WeakPtrFactory manager_ptr_factory_; diff --git a/libcef/browser/internal_scheme_handler.h b/libcef/browser/internal_scheme_handler.h index e6c39052c..f29637374 100644 --- a/libcef/browser/internal_scheme_handler.h +++ b/libcef/browser/internal_scheme_handler.h @@ -9,7 +9,7 @@ #include #include "include/cef_scheme.h" #include "base/memory/scoped_ptr.h" -#include "googleurl/src/gurl.h" +#include "url/gurl.h" namespace scheme { diff --git a/libcef/browser/media_capture_devices_dispatcher.cc b/libcef/browser/media_capture_devices_dispatcher.cc index 62b74c461..7f3ced996 100644 --- a/libcef/browser/media_capture_devices_dispatcher.cc +++ b/libcef/browser/media_capture_devices_dispatcher.cc @@ -153,22 +153,33 @@ void CefMediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged( } void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged( - int render_process_id, - int render_view_id, - const content::MediaStreamDevice& device, + int render_process_id, + int render_view_id, + int page_request_id, + const content::MediaStreamDevice& device, content::MediaRequestState state) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind( &CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread, - base::Unretained(this), render_process_id, render_view_id, device, - state)); + base::Unretained(this), render_process_id, render_view_id, + page_request_id, device, state)); } void CefMediaCaptureDevicesDispatcher::OnAudioStreamPlayingChanged( - int render_process_id, int render_view_id, int stream_id, bool playing) { + int render_process_id, + int render_view_id, + int stream_id, + bool is_playing, + float power_dbfs, + bool clipped) { +} + +void CefMediaCaptureDevicesDispatcher::OnCreatingAudioStream( + int render_process_id, + int render_view_id) { } void CefMediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread( @@ -192,11 +203,13 @@ void CefMediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread( void CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread( int render_process_id, int render_view_id, + int page_request_id, const content::MediaStreamDevice& device, content::MediaRequestState state) { FOR_EACH_OBSERVER(Observer, observers_, OnRequestUpdate(render_process_id, render_view_id, + page_request_id, device, state)); } diff --git a/libcef/browser/media_capture_devices_dispatcher.h b/libcef/browser/media_capture_devices_dispatcher.h index c3ebc8874..91ad52309 100644 --- a/libcef/browser/media_capture_devices_dispatcher.h +++ b/libcef/browser/media_capture_devices_dispatcher.h @@ -35,6 +35,7 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { virtual void OnRequestUpdate( int render_process_id, int render_view_id, + int page_request_id, const content::MediaStreamDevice& device, const content::MediaRequestState state) {} @@ -78,15 +79,20 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { virtual void OnVideoCaptureDevicesChanged( const content::MediaStreamDevices& devices) OVERRIDE; virtual void OnMediaRequestStateChanged( - int render_process_id, - int render_view_id, - const content::MediaStreamDevice& device, + int render_process_id, + int render_view_id, + int page_request_id, + const content::MediaStreamDevice& device, content::MediaRequestState state) OVERRIDE; virtual void OnAudioStreamPlayingChanged( - int render_process_id, - int render_view_id, - int stream_id, - bool playing) OVERRIDE; + int render_process_id, + int render_view_id, + int stream_id, + bool is_playing, + float power_dbfs, + bool clipped) OVERRIDE; + virtual void OnCreatingAudioStream(int render_process_id, + int render_view_id) OVERRIDE; private: friend struct DefaultSingletonTraits; @@ -100,6 +106,7 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { void UpdateMediaRequestStateOnUIThread( int render_process_id, int render_view_id, + int page_request_id, const content::MediaStreamDevice& device, content::MediaRequestState state); diff --git a/libcef/browser/menu_creator_runner_mac.mm b/libcef/browser/menu_creator_runner_mac.mm index 3a2f10f80..4dcad49fe 100644 --- a/libcef/browser/menu_creator_runner_mac.mm +++ b/libcef/browser/menu_creator_runner_mac.mm @@ -5,7 +5,7 @@ #include "libcef/browser/menu_creator_runner_mac.h" #include "libcef/browser/browser_host_impl.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "base/compiler_specific.h" #import "base/mac/scoped_sending_event.h" #include "content/public/browser/web_contents_view.h" diff --git a/libcef/browser/menu_creator_runner_win.cc b/libcef/browser/menu_creator_runner_win.cc index fddb699f3..6019c051e 100644 --- a/libcef/browser/menu_creator_runner_win.cc +++ b/libcef/browser/menu_creator_runner_win.cc @@ -5,7 +5,7 @@ #include "libcef/browser/menu_creator_runner_win.h" #include "libcef/browser/browser_host_impl.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "content/public/browser/web_contents_view.h" #include "ui/gfx/point.h" #include "ui/views/controls/menu/menu_2.h" diff --git a/libcef/browser/menu_model_impl.cc b/libcef/browser/menu_model_impl.cc index f9d149067..50658cd89 100644 --- a/libcef/browser/menu_model_impl.cc +++ b/libcef/browser/menu_model_impl.cc @@ -9,7 +9,7 @@ #include "base/bind.h" #include "base/logging.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "ui/base/accelerators/accelerator.h" namespace { diff --git a/libcef/browser/navigate_params.h b/libcef/browser/navigate_params.h index e78907413..d846d19ba 100644 --- a/libcef/browser/navigate_params.h +++ b/libcef/browser/navigate_params.h @@ -12,9 +12,9 @@ #include "content/public/browser/global_request_id.h" #include "content/public/common/page_transition_types.h" #include "content/public/common/referrer.h" -#include "googleurl/src/gurl.h" #include "net/base/upload_data.h" #include "ui/base/window_open_disposition.h" +#include "url/gurl.h" // Parameters that tell CefBrowserHostImpl::Navigate() what to do. struct CefNavigateParams { diff --git a/libcef/browser/origin_whitelist_impl.cc b/libcef/browser/origin_whitelist_impl.cc index 7f3f6cf0e..209cb7dc7 100644 --- a/libcef/browser/origin_whitelist_impl.cc +++ b/libcef/browser/origin_whitelist_impl.cc @@ -16,7 +16,7 @@ #include "base/lazy_instance.h" #include "base/synchronization/lock.h" #include "content/public/browser/render_process_host.h" -#include "googleurl/src/gurl.h" +#include "url/gurl.h" namespace { diff --git a/libcef/browser/render_widget_host_view_osr.cc b/libcef/browser/render_widget_host_view_osr.cc index 78a1b43d0..43f83f68a 100644 --- a/libcef/browser/render_widget_host_view_osr.cc +++ b/libcef/browser/render_widget_host_view_osr.cc @@ -8,7 +8,7 @@ #include "libcef/browser/render_widget_host_view_osr.h" #include "libcef/common/content_client.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_view_host.h" @@ -165,7 +165,7 @@ void CefRenderWidgetHostViewOSR::WasHidden() { void CefRenderWidgetHostViewOSR::MovePluginWindows( const gfx::Vector2d& scroll_offset, - const std::vector& moves) { + const std::vector& moves) { } void CefRenderWidgetHostViewOSR::Focus() { @@ -206,7 +206,8 @@ void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) { #if !defined(OS_MACOSX) void CefRenderWidgetHostViewOSR::TextInputTypeChanged( ui::TextInputType type, - bool can_compose_inline) { + bool can_compose_inline, + ui::TextInputMode mode) { } void CefRenderWidgetHostViewOSR::ImeCancelComposition() { @@ -232,7 +233,7 @@ void CefRenderWidgetHostViewOSR::DidUpdateBackingStore( } } -void CefRenderWidgetHostViewOSR::RenderViewGone( +void CefRenderWidgetHostViewOSR::RenderProcessGone( base::TerminationStatus status, int error_code) { render_widget_host_ = NULL; diff --git a/libcef/browser/render_widget_host_view_osr.h b/libcef/browser/render_widget_host_view_osr.h index d940d390b..c15c04a6c 100644 --- a/libcef/browser/render_widget_host_view_osr.h +++ b/libcef/browser/render_widget_host_view_osr.h @@ -113,13 +113,14 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase { virtual void WasHidden() OVERRIDE; virtual void MovePluginWindows( const gfx::Vector2d& scroll_offset, - const std::vector& moves) OVERRIDE; + const std::vector& moves) OVERRIDE; virtual void Focus() OVERRIDE; virtual void Blur() OVERRIDE; virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE; virtual void SetIsLoading(bool is_loading) OVERRIDE; virtual void TextInputTypeChanged(ui::TextInputType type, - bool can_compose_inline) OVERRIDE; + bool can_compose_inline, + ui::TextInputMode mode) OVERRIDE; virtual void ImeCancelComposition() OVERRIDE; virtual void ImeCompositionRangeChanged( const ui::Range& range, @@ -129,7 +130,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase { const gfx::Vector2d& scroll_delta, const std::vector& copy_rects, const ui::LatencyInfo& latency_info) OVERRIDE; - virtual void RenderViewGone(base::TerminationStatus status, + virtual void RenderProcessGone(base::TerminationStatus status, int error_code) OVERRIDE; #if defined(OS_WIN) && !defined(USE_AURA) virtual void WillWmDestroy() OVERRIDE; diff --git a/libcef/browser/render_widget_host_view_osr_mac.mm b/libcef/browser/render_widget_host_view_osr_mac.mm index cf61b5902..dd47accf5 100644 --- a/libcef/browser/render_widget_host_view_osr_mac.mm +++ b/libcef/browser/render_widget_host_view_osr_mac.mm @@ -76,7 +76,8 @@ void CefRenderWidgetHostViewOSR::ImeCancelComposition() { void CefRenderWidgetHostViewOSR::TextInputTypeChanged( ui::TextInputType type, - bool can_compose_inline) { + bool can_compose_inline, + ui::TextInputMode mode) { [NSApp updateWindows]; } diff --git a/libcef/browser/scheme_handler.h b/libcef/browser/scheme_handler.h index a44b0120c..062c5a24f 100644 --- a/libcef/browser/scheme_handler.h +++ b/libcef/browser/scheme_handler.h @@ -9,7 +9,7 @@ #include "include/cef_frame.h" #include "content/public/browser/content_browser_client.h" -#include "googleurl/src/gurl.h" +#include "url/gurl.h" namespace net { class FtpTransactionFactory; diff --git a/libcef/browser/scheme_impl.cc b/libcef/browser/scheme_impl.cc index f3e89d2d9..7af9f102c 100644 --- a/libcef/browser/scheme_impl.cc +++ b/libcef/browser/scheme_impl.cc @@ -21,10 +21,9 @@ #include "base/bind.h" #include "base/lazy_instance.h" #include "base/logging.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" #include "base/synchronization/lock.h" -#include "googleurl/src/url_util.h" #include "net/base/completion_callback.h" #include "net/base/io_buffer.h" #include "net/base/upload_data.h" @@ -36,6 +35,7 @@ #include "net/url_request/url_request_http_job.h" #include "net/url_request/url_request_job.h" #include "net/url_request/url_request_job_factory_impl.h" +#include "url/url_util.h" using net::URLRequestStatus; diff --git a/libcef/browser/speech_recognition_manager_delegate.cc b/libcef/browser/speech_recognition_manager_delegate.cc index 2baef9259..147ead94d 100644 --- a/libcef/browser/speech_recognition_manager_delegate.cc +++ b/libcef/browser/speech_recognition_manager_delegate.cc @@ -1,217 +1,228 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "libcef/browser/speech_recognition_manager_delegate.h" - -#include -#include - -#include "base/bind.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/browser/notification_observer.h" -#include "content/public/browser/notification_registrar.h" -#include "content/public/browser/notification_source.h" -#include "content/public/browser/notification_types.h" -#include "content/public/browser/render_process_host.h" -#include "content/public/browser/render_view_host.h" -#include "content/public/browser/speech_recognition_manager.h" -#include "content/public/browser/speech_recognition_session_context.h" -#include "content/public/browser/web_contents.h" -#include "content/public/common/speech_recognition_error.h" -#include "content/public/common/speech_recognition_result.h" - -using content::BrowserThread; -using content::SpeechRecognitionManager; -using content::WebContents; - -// Simple utility to get notified when a WebContents is closed or crashes. -// Both the callback site and the callback thread are passed by the caller in -// the constructor. There is no restriction on the constructor, however this -// class must be destroyed on the UI thread, due to the NotificationRegistrar -// dependency. -class CefSpeechRecognitionManagerDelegate::WebContentsWatcher - : public base::RefCountedThreadSafe, - public content::NotificationObserver { - public: - typedef base::Callback - WebContentsClosedCallback; - - WebContentsWatcher(WebContentsClosedCallback web_contents_closed_callback, - BrowserThread::ID callback_thread) - : web_contents_closed_callback_(web_contents_closed_callback), - callback_thread_(callback_thread) { - } - - // Starts monitoring the WebContents corresponding to the given - // |render_process_id|, |render_view_id| pair, invoking - // |web_contents_closed_callback_| if closed/unloaded. - void Watch(int render_process_id, int render_view_id) { - if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( - &WebContentsWatcher::Watch, this, render_process_id, render_view_id)); - return; - } - - WebContents* web_contents = NULL; +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "libcef/browser/speech_recognition_manager_delegate.h" + +#include +#include + +#include "libcef/common/cef_switches.h" + +#include "base/bind.h" +#include "base/command_line.h" +#include "content/public/browser/browser_thread.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" +#include "content/public/browser/notification_source.h" +#include "content/public/browser/notification_types.h" +#include "content/public/browser/render_process_host.h" +#include "content/public/browser/render_view_host.h" +#include "content/public/browser/speech_recognition_manager.h" +#include "content/public/browser/speech_recognition_session_context.h" +#include "content/public/browser/web_contents.h" +#include "content/public/common/speech_recognition_error.h" +#include "content/public/common/speech_recognition_result.h" + +using content::BrowserThread; +using content::SpeechRecognitionManager; +using content::WebContents; + +// Simple utility to get notified when a WebContents is closed or crashes. +// Both the callback site and the callback thread are passed by the caller in +// the constructor. There is no restriction on the constructor, however this +// class must be destroyed on the UI thread, due to the NotificationRegistrar +// dependency. +class CefSpeechRecognitionManagerDelegate::WebContentsWatcher + : public base::RefCountedThreadSafe, + public content::NotificationObserver { + public: + typedef base::Callback + WebContentsClosedCallback; + + WebContentsWatcher(WebContentsClosedCallback web_contents_closed_callback, + BrowserThread::ID callback_thread) + : web_contents_closed_callback_(web_contents_closed_callback), + callback_thread_(callback_thread) { + } + + // Starts monitoring the WebContents corresponding to the given + // |render_process_id|, |render_view_id| pair, invoking + // |web_contents_closed_callback_| if closed/unloaded. + void Watch(int render_process_id, int render_view_id) { + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( + &WebContentsWatcher::Watch, this, render_process_id, render_view_id)); + return; + } + + WebContents* web_contents = NULL; content::RenderViewHost* render_view_host = content::RenderViewHost::FromID(render_process_id, render_view_id); if (render_view_host) - web_contents = WebContents::FromRenderViewHost(render_view_host); - DCHECK(web_contents); - - // Avoid multiple registrations on |registrar_| for the same |web_contents|. - if (registered_web_contents_.find(web_contents) != - registered_web_contents_.end()) { - return; - } - registered_web_contents_.insert(web_contents); - - // Lazy initialize the registrar. - if (!registrar_.get()) - registrar_.reset(new content::NotificationRegistrar()); - - registrar_->Add(this, - content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, - content::Source(web_contents)); - } - - // content::NotificationObserver implementation. - virtual void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, type); - - WebContents* web_contents = content::Source(source).ptr(); - int render_process_id = web_contents->GetRenderProcessHost()->GetID(); - int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID(); - - registrar_->Remove(this, - content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, - content::Source(web_contents)); - registered_web_contents_.erase(web_contents); - - BrowserThread::PostTask(callback_thread_, FROM_HERE, base::Bind( - web_contents_closed_callback_, render_process_id, render_view_id)); - } - - private: - friend class base::RefCountedThreadSafe; - - virtual ~WebContentsWatcher() { - // Must be destroyed on the UI thread due to |registrar_| non thread-safety. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - } - - // Lazy-initialized and used on the UI thread to handle web contents - // notifications (tab closing). - scoped_ptr registrar_; - - // Keeps track of which WebContent(s) have been registered, in order to avoid - // double registrations on |registrar_| - std::set registered_web_contents_; - - // Callback used to notify, on the thread specified by |callback_thread_| the - // closure of a registered tab. - WebContentsClosedCallback web_contents_closed_callback_; - content::BrowserThread::ID callback_thread_; - - DISALLOW_COPY_AND_ASSIGN(WebContentsWatcher); -}; - -CefSpeechRecognitionManagerDelegate -::CefSpeechRecognitionManagerDelegate() { -} - -CefSpeechRecognitionManagerDelegate -::~CefSpeechRecognitionManagerDelegate() { -} - -void CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback( - int render_process_id, int render_view_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - - SpeechRecognitionManager* manager = SpeechRecognitionManager::GetInstance(); - // |manager| becomes NULL if a browser shutdown happens between the post of - // this task (from the UI thread) and this call (on the IO thread). In this - // case we just return. - if (!manager) - return; - - manager->AbortAllSessionsForRenderView(render_process_id, render_view_id); -} - -void CefSpeechRecognitionManagerDelegate::OnRecognitionStart( - int session_id) { - const content::SpeechRecognitionSessionContext& context = - SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id); - - // Register callback to auto abort session on tab closure. - // |web_contents_watcher_| is lazyly istantiated on the first call. - if (!web_contents_watcher_.get()) { - web_contents_watcher_ = new WebContentsWatcher( - base::Bind( - &CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback, - base::Unretained(this)), - BrowserThread::IO); - } - web_contents_watcher_->Watch(context.render_process_id, - context.render_view_id); -} - -void CefSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) { -} - -void CefSpeechRecognitionManagerDelegate::OnEnvironmentEstimationComplete( - int session_id) { -} - -void CefSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) { -} - -void CefSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) { -} - -void CefSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) { -} - -void CefSpeechRecognitionManagerDelegate::OnRecognitionResults( - int session_id, const content::SpeechRecognitionResults& result) { -} - -void CefSpeechRecognitionManagerDelegate::OnRecognitionError( - int session_id, const content::SpeechRecognitionError& error) { -} - -void CefSpeechRecognitionManagerDelegate::OnAudioLevelsChange( - int session_id, float volume, float noise_volume) { -} - -void CefSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) { -} - -void CefSpeechRecognitionManagerDelegate::GetDiagnosticInformation( - bool* can_report_metrics, - std::string* hardware_info) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); -} - -void CefSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( - int session_id, - base::Callback callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - - const content::SpeechRecognitionSessionContext& context = - SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id); - - // Make sure that initiators properly set the |render_process_id| field. - DCHECK_NE(context.render_process_id, 0); - - callback.Run(false, true); -} - -content::SpeechRecognitionEventListener* -CefSpeechRecognitionManagerDelegate::GetEventListener() { - return this; -} + web_contents = WebContents::FromRenderViewHost(render_view_host); + DCHECK(web_contents); + + // Avoid multiple registrations on |registrar_| for the same |web_contents|. + if (registered_web_contents_.find(web_contents) != + registered_web_contents_.end()) { + return; + } + registered_web_contents_.insert(web_contents); + + // Lazy initialize the registrar. + if (!registrar_.get()) + registrar_.reset(new content::NotificationRegistrar()); + + registrar_->Add(this, + content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, + content::Source(web_contents)); + } + + // content::NotificationObserver implementation. + virtual void Observe(int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, type); + + WebContents* web_contents = content::Source(source).ptr(); + int render_process_id = web_contents->GetRenderProcessHost()->GetID(); + int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID(); + + registrar_->Remove(this, + content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, + content::Source(web_contents)); + registered_web_contents_.erase(web_contents); + + BrowserThread::PostTask(callback_thread_, FROM_HERE, base::Bind( + web_contents_closed_callback_, render_process_id, render_view_id)); + } + + private: + friend class base::RefCountedThreadSafe; + + virtual ~WebContentsWatcher() { + // Must be destroyed on the UI thread due to |registrar_| non thread-safety. + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + } + + // Lazy-initialized and used on the UI thread to handle web contents + // notifications (tab closing). + scoped_ptr registrar_; + + // Keeps track of which WebContent(s) have been registered, in order to avoid + // double registrations on |registrar_| + std::set registered_web_contents_; + + // Callback used to notify, on the thread specified by |callback_thread_| the + // closure of a registered tab. + WebContentsClosedCallback web_contents_closed_callback_; + content::BrowserThread::ID callback_thread_; + + DISALLOW_COPY_AND_ASSIGN(WebContentsWatcher); +}; + +CefSpeechRecognitionManagerDelegate +::CefSpeechRecognitionManagerDelegate() { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + filter_profanities_ = + command_line.HasSwitch(switches::kEnableProfanityFilter); +} + +CefSpeechRecognitionManagerDelegate +::~CefSpeechRecognitionManagerDelegate() { +} + +void CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback( + int render_process_id, int render_view_id) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + + SpeechRecognitionManager* manager = SpeechRecognitionManager::GetInstance(); + // |manager| becomes NULL if a browser shutdown happens between the post of + // this task (from the UI thread) and this call (on the IO thread). In this + // case we just return. + if (!manager) + return; + + manager->AbortAllSessionsForRenderView(render_process_id, render_view_id); +} + +void CefSpeechRecognitionManagerDelegate::OnRecognitionStart( + int session_id) { + const content::SpeechRecognitionSessionContext& context = + SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id); + + // Register callback to auto abort session on tab closure. + // |web_contents_watcher_| is lazyly istantiated on the first call. + if (!web_contents_watcher_.get()) { + web_contents_watcher_ = new WebContentsWatcher( + base::Bind( + &CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback, + base::Unretained(this)), + BrowserThread::IO); + } + web_contents_watcher_->Watch(context.render_process_id, + context.render_view_id); +} + +void CefSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) { +} + +void CefSpeechRecognitionManagerDelegate::OnEnvironmentEstimationComplete( + int session_id) { +} + +void CefSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) { +} + +void CefSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) { +} + +void CefSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) { +} + +void CefSpeechRecognitionManagerDelegate::OnRecognitionResults( + int session_id, const content::SpeechRecognitionResults& result) { +} + +void CefSpeechRecognitionManagerDelegate::OnRecognitionError( + int session_id, const content::SpeechRecognitionError& error) { +} + +void CefSpeechRecognitionManagerDelegate::OnAudioLevelsChange( + int session_id, float volume, float noise_volume) { +} + +void CefSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) { +} + +void CefSpeechRecognitionManagerDelegate::GetDiagnosticInformation( + bool* can_report_metrics, + std::string* hardware_info) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); +} + +void CefSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( + int session_id, + base::Callback callback) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + + const content::SpeechRecognitionSessionContext& context = + SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id); + + // Make sure that initiators properly set the |render_process_id| field. + DCHECK_NE(context.render_process_id, 0); + + callback.Run(false, true); +} + +content::SpeechRecognitionEventListener* +CefSpeechRecognitionManagerDelegate::GetEventListener() { + return this; +} + +bool CefSpeechRecognitionManagerDelegate::FilterProfanities( + int render_process_id) { + return filter_profanities_; +} diff --git a/libcef/browser/speech_recognition_manager_delegate.h b/libcef/browser/speech_recognition_manager_delegate.h index 34cccc02f..5553079ef 100644 --- a/libcef/browser/speech_recognition_manager_delegate.h +++ b/libcef/browser/speech_recognition_manager_delegate.h @@ -45,6 +45,7 @@ class CefSpeechRecognitionManagerDelegate int session_id, base::Callback callback) OVERRIDE; virtual content::SpeechRecognitionEventListener* GetEventListener() OVERRIDE; + virtual bool FilterProfanities(int render_process_id) OVERRIDE; private: class WebContentsWatcher; @@ -54,6 +55,7 @@ class CefSpeechRecognitionManagerDelegate void WebContentsClosedCallback(int render_process_id, int render_view_id); scoped_refptr web_contents_watcher_; + bool filter_profanities_; DISALLOW_COPY_AND_ASSIGN(CefSpeechRecognitionManagerDelegate); }; diff --git a/libcef/browser/trace_impl.cc b/libcef/browser/trace_impl.cc index 0c15c9460..606ae1dd1 100644 --- a/libcef/browser/trace_impl.cc +++ b/libcef/browser/trace_impl.cc @@ -9,7 +9,7 @@ #include "libcef/browser/thread_util.h" #include "base/debug/trace_event.h" -#include "base/time.h" +#include "base/time/time.h" bool CefBeginTracing(CefRefPtr client, const CefString& categories) { diff --git a/libcef/browser/url_request_context_getter.cc b/libcef/browser/url_request_context_getter.cc index acbf6f6d2..473fc7cb7 100644 --- a/libcef/browser/url_request_context_getter.cc +++ b/libcef/browser/url_request_context_getter.cc @@ -130,7 +130,9 @@ net::URLRequestContext* CefURLRequestContextGetter::GetURLRequestContext() { std::string(), false, false)); - storage_->set_http_server_properties(new net::HttpServerPropertiesImpl); + storage_->set_http_server_properties( + make_scoped_ptr( + new net::HttpServerPropertiesImpl)); net::HttpCache::DefaultBackend* main_backend = new net::HttpCache::DefaultBackend( @@ -216,7 +218,7 @@ void CefURLRequestContextGetter::SetCookieStoragePath( // TODO(cef): Move directory creation to the blocking pool instead of // allowing file IO on this thread. base::ThreadRestrictions::ScopedAllowIO allow_io; - if (file_util::DirectoryExists(path) || + if (base::DirectoryExists(path) || file_util::CreateDirectory(path)) { const base::FilePath& cookie_path = path.AppendASCII("Cookies"); persistent_store = diff --git a/libcef/browser/web_contents_view_osr.cc b/libcef/browser/web_contents_view_osr.cc index 72214ad59..f0c752248 100644 --- a/libcef/browser/web_contents_view_osr.cc +++ b/libcef/browser/web_contents_view_osr.cc @@ -95,7 +95,7 @@ void CefWebContentsViewOSR::StoreFocus() { void CefWebContentsViewOSR::RestoreFocus() { } -WebDropData* CefWebContentsViewOSR::GetDropData() const { +content::DropData* CefWebContentsViewOSR::GetDropData() const { return NULL; } @@ -121,7 +121,8 @@ bool CefWebContentsViewOSR::GetAllowOverlappingViews() const { // RenderViewHostDelegateView methods. -void CefWebContentsViewOSR::StartDragging(const WebDropData& drop_data, +void CefWebContentsViewOSR::StartDragging( + const content::DropData& drop_data, WebKit::WebDragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, @@ -130,11 +131,12 @@ void CefWebContentsViewOSR::StartDragging(const WebDropData& drop_data, web_contents_->SystemDragEnded(); } -void CefWebContentsViewOSR::ShowPopupMenu(const gfx::Rect& bounds, +void CefWebContentsViewOSR::ShowPopupMenu( + const gfx::Rect& bounds, int item_height, double item_font_size, int selected_item, - const std::vector& items, + const std::vector& items, bool right_aligned, bool allow_multiple_selection) { } diff --git a/libcef/browser/web_contents_view_osr.h b/libcef/browser/web_contents_view_osr.h index 4b695c73b..7f0a73e7d 100644 --- a/libcef/browser/web_contents_view_osr.h +++ b/libcef/browser/web_contents_view_osr.h @@ -48,7 +48,7 @@ class CefWebContentsViewOSR : public content::WebContentsViewPort, virtual void SetInitialFocus() OVERRIDE; virtual void StoreFocus() OVERRIDE; virtual void RestoreFocus() OVERRIDE; - virtual WebDropData* GetDropData() const OVERRIDE; + virtual content::DropData* GetDropData() const OVERRIDE; virtual gfx::Rect GetViewBounds() const OVERRIDE; #if defined(OS_MACOSX) virtual bool IsEventTracking() const OVERRIDE; @@ -58,16 +58,18 @@ class CefWebContentsViewOSR : public content::WebContentsViewPort, #endif // RenderViewHostDelegateView methods. - virtual void StartDragging(const WebDropData& drop_data, + virtual void StartDragging( + const content::DropData& drop_data, WebKit::WebDragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, const content::DragEventSourceInfo& event_info) OVERRIDE; - virtual void ShowPopupMenu(const gfx::Rect& bounds, + virtual void ShowPopupMenu( + const gfx::Rect& bounds, int item_height, double item_font_size, int selected_item, - const std::vector& items, + const std::vector& items, bool right_aligned, bool allow_multiple_selection) OVERRIDE; diff --git a/libcef/browser/web_plugin_impl.cc b/libcef/browser/web_plugin_impl.cc index 367d4675a..3cb4ecc3c 100644 --- a/libcef/browser/web_plugin_impl.cc +++ b/libcef/browser/web_plugin_impl.cc @@ -14,13 +14,13 @@ namespace { void PluginsCallbackImpl( CefRefPtr visitor, - const std::vector& all_plugins) { + const std::vector& all_plugins) { CEF_REQUIRE_UIT(); int count = 0; int total = static_cast(all_plugins.size()); - std::vector::const_iterator it = all_plugins.begin(); + std::vector::const_iterator it = all_plugins.begin(); for (; it != all_plugins.end(); ++it, ++count) { CefRefPtr info(new CefWebPluginInfoImpl(*it)); if (!visitor->Visit(info.get(), count, total)) @@ -34,7 +34,7 @@ void PluginsCallbackImpl( // CefWebPluginInfoImpl CefWebPluginInfoImpl::CefWebPluginInfoImpl( - const webkit::WebPluginInfo& plugin_info) + const content::WebPluginInfo& plugin_info) : plugin_info_(plugin_info) { } diff --git a/libcef/browser/web_plugin_impl.h b/libcef/browser/web_plugin_impl.h index 4ec9c87be..20acd73dc 100644 --- a/libcef/browser/web_plugin_impl.h +++ b/libcef/browser/web_plugin_impl.h @@ -7,11 +7,11 @@ #pragma once #include "include/cef_web_plugin.h" -#include "webkit/plugins/webplugininfo.h" +#include "content/public/common/webplugininfo.h" class CefWebPluginInfoImpl : public CefWebPluginInfo { public: - explicit CefWebPluginInfoImpl(const webkit::WebPluginInfo& plugin_info); + explicit CefWebPluginInfoImpl(const content::WebPluginInfo& plugin_info); virtual CefString GetName() OVERRIDE; virtual CefString GetPath() OVERRIDE; @@ -19,7 +19,7 @@ class CefWebPluginInfoImpl : public CefWebPluginInfo { virtual CefString GetDescription() OVERRIDE; private: - webkit::WebPluginInfo plugin_info_; + content::WebPluginInfo plugin_info_; IMPLEMENT_REFCOUNTING(CefWebPluginInfoImpl); }; diff --git a/libcef/common/cef_messages.h b/libcef/common/cef_messages.h index 21adde6f3..4f2bf6af3 100644 --- a/libcef/common/cef_messages.h +++ b/libcef/common/cef_messages.h @@ -6,7 +6,7 @@ // IPC messages for CEF. // Multiply-included message file, hence no include guard. -#include "base/shared_memory.h" +#include "base/memory/shared_memory.h" #include "base/values.h" #include "content/public/common/common_param_traits.h" #include "content/public/common/referrer.h" diff --git a/libcef/common/drag_data_impl.cc b/libcef/common/drag_data_impl.cc index 114a2f3ca..eae50e963 100644 --- a/libcef/common/drag_data_impl.cc +++ b/libcef/common/drag_data_impl.cc @@ -5,7 +5,7 @@ #include "libcef/common/drag_data_impl.h" #include "base/files/file_path.h" -CefDragDataImpl::CefDragDataImpl(const WebDropData& data) +CefDragDataImpl::CefDragDataImpl(const content::DropData& data) : data_(data) { } @@ -54,7 +54,7 @@ bool CefDragDataImpl::GetFileNames(std::vector& names) { if (data_.filenames.empty()) return false; - std::vector::const_iterator it = + std::vector::const_iterator it = data_.filenames.begin(); for (; it != data_.filenames.end(); ++it) names.push_back(it->path); diff --git a/libcef/common/drag_data_impl.h b/libcef/common/drag_data_impl.h index b7425578a..882cb172f 100644 --- a/libcef/common/drag_data_impl.h +++ b/libcef/common/drag_data_impl.h @@ -9,12 +9,12 @@ #include #include "include/cef_drag_data.h" -#include "webkit/common/webdropdata.h" +#include "content/public/common/drop_data.h" // Implementation of CefDragData. class CefDragDataImpl : public CefDragData { public: - explicit CefDragDataImpl(const WebDropData& data); + explicit CefDragDataImpl(const content::DropData& data); virtual bool IsLink(); virtual bool IsFragment(); @@ -29,7 +29,7 @@ class CefDragDataImpl : public CefDragData { virtual bool GetFileNames(std::vector& names); protected: - WebDropData data_; + content::DropData data_; IMPLEMENT_REFCOUNTING(CefDragDataImpl); }; diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index ed046bc94..95958cd6a 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -445,14 +445,14 @@ void CefMainDelegate::InitializeResourceBundle() { content_client_.set_allow_pack_file_load(true); - if (file_util::PathExists(cef_pak_file)) { + if (base::PathExists(cef_pak_file)) { ResourceBundle::GetSharedInstance().AddDataPackFromPath( cef_pak_file, ui::SCALE_FACTOR_NONE); } else { NOTREACHED() << "Could not load cef.pak"; } - if (file_util::PathExists(devtools_pak_file)) { + if (base::PathExists(devtools_pak_file)) { ResourceBundle::GetSharedInstance().AddDataPackFromPath( devtools_pak_file, ui::SCALE_FACTOR_NONE); } diff --git a/libcef/common/task_runner_impl.cc b/libcef/common/task_runner_impl.cc index 2abb3b671..771afae4a 100644 --- a/libcef/common/task_runner_impl.cc +++ b/libcef/common/task_runner_impl.cc @@ -9,7 +9,7 @@ #include "base/bind.h" #include "base/location.h" #include "base/logging.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" #include "content/public/browser/browser_thread.h" diff --git a/libcef/common/time_util.h b/libcef/common/time_util.h index fb010ff6c..8d92da7ec 100644 --- a/libcef/common/time_util.h +++ b/libcef/common/time_util.h @@ -7,7 +7,7 @@ #pragma once #include "include/internal/cef_time.h" -#include "base/time.h" +#include "base/time/time.h" // Converts cef_time_t to/from a base::Time object. void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time); diff --git a/libcef/common/url_impl.cc b/libcef/common/url_impl.cc index cc9d7a964..671b0aa6f 100644 --- a/libcef/common/url_impl.cc +++ b/libcef/common/url_impl.cc @@ -4,7 +4,7 @@ #include #include "include/cef_url.h" -#include "googleurl/src/gurl.h" +#include "url/gurl.h" bool CefParseURL(const CefString& url, CefURLParts& parts) { diff --git a/libcef/common/urlrequest_impl.cc b/libcef/common/urlrequest_impl.cc index c3b089ce0..958722fd4 100644 --- a/libcef/common/urlrequest_impl.cc +++ b/libcef/common/urlrequest_impl.cc @@ -8,7 +8,7 @@ #include "libcef/renderer/render_urlrequest_impl.h" #include "base/logging.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "content/public/common/content_client.h" // static diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index 81a5dbaf4..8641415c7 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -34,7 +34,6 @@ #include "third_party/WebKit/public/web/WebScriptSource.h" #include "third_party/WebKit/public/web/WebSecurityPolicy.h" #include "third_party/WebKit/public/web/WebView.h" -#include "webkit/base/file_path_string_conversions.h" #include "webkit/glue/webkit_glue.h" using WebKit::WebFrame; @@ -48,6 +47,15 @@ namespace { const int64 kInvalidBrowserId = -1; const int64 kInvalidFrameId = -1; +WebKit::WebString FilePathStringToWebString( + const base::FilePath::StringType& str) { +#if defined(OS_POSIX) + return WideToUTF16Hack(base::SysNativeMBToWide(str)); +#elif defined(OS_WIN) + return WideToUTF16Hack(str); +#endif +} + } // namespace @@ -78,25 +86,25 @@ CefRefPtr CefBrowserImpl::GetHost() { bool CefBrowserImpl::CanGoBack() { CEF_REQUIRE_RT_RETURN(false); - return webkit_glue::CanGoBackOrForward(render_view()->GetWebView(), -1); + return webkit_glue::CanGoBack(render_view()->GetWebView()); } void CefBrowserImpl::GoBack() { CEF_REQUIRE_RT_RETURN_VOID(); - webkit_glue::GoBackOrForward(render_view()->GetWebView(), -1); + webkit_glue::GoBack(render_view()->GetWebView()); } bool CefBrowserImpl::CanGoForward() { CEF_REQUIRE_RT_RETURN(false); - return webkit_glue::CanGoBackOrForward(render_view()->GetWebView(), 1); + return webkit_glue::CanGoForward(render_view()->GetWebView()); } void CefBrowserImpl::GoForward() { CEF_REQUIRE_RT_RETURN_VOID(); - webkit_glue::GoBackOrForward(render_view()->GetWebView(), 1); + webkit_glue::GoForward(render_view()->GetWebView()); } bool CefBrowserImpl::IsLoading() { @@ -334,7 +342,7 @@ void CefBrowserImpl::LoadRequest(const CefMsg_LoadRequest_Params& params) { data.assign(element.bytes(), element.bytes_length()); body.appendData(data); } else if (element.type() == net::UploadElement::TYPE_FILE) { - body.appendFile(webkit_base::FilePathToWebString(element.file_path())); + body.appendFile(FilePathStringToWebString(element.file_path().value())); } else { NOTREACHED(); } diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index ffd68ea13..0887fbf12 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -469,7 +469,7 @@ bool CefContentRendererClient::OverrideCreatePlugin( content::RenderViewImpl* render_view_impl = static_cast(render_view); - webkit::WebPluginInfo info; + content::WebPluginInfo info; std::string mime_type; bool found = render_view_impl->GetPluginInfo(params.url, frame->top()->document().url(), diff --git a/libcef/renderer/content_renderer_client.h b/libcef/renderer/content_renderer_client.h index 4508ae64a..59cbcd402 100644 --- a/libcef/renderer/content_renderer_client.h +++ b/libcef/renderer/content_renderer_client.h @@ -16,7 +16,7 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "base/sequenced_task_runner.h" #include "content/public/renderer/content_renderer_client.h" diff --git a/libcef/renderer/render_message_filter.cc b/libcef/renderer/render_message_filter.cc index 12074467d..30355afd3 100644 --- a/libcef/renderer/render_message_filter.cc +++ b/libcef/renderer/render_message_filter.cc @@ -8,12 +8,12 @@ #include "libcef/common/cef_messages.h" #include "base/bind.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "content/common/devtools_messages.h" -#include "googleurl/src/gurl.h" -#include "googleurl/src/url_util.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/web/WebSecurityPolicy.h" +#include "url/gurl.h" +#include "url/url_util.h" CefRenderMessageFilter::CefRenderMessageFilter() : channel_(NULL) { diff --git a/libcef/renderer/render_urlrequest_impl.cc b/libcef/renderer/render_urlrequest_impl.cc index c08d77923..113d49a7c 100644 --- a/libcef/renderer/render_urlrequest_impl.cc +++ b/libcef/renderer/render_urlrequest_impl.cc @@ -7,7 +7,7 @@ #include "libcef/common/response_impl.h" #include "base/logging.h" -#include "base/message_loop.h" +#include "base/message_loop/message_loop.h" #include "third_party/WebKit/public/platform/Platform.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURL.h" diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index ce25b55a3..b01305f4d 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -11,7 +11,7 @@ #include "config.h" MSVC_PUSH_WARNING_LEVEL(0); #include "core/page/Frame.h" -#include "core/workers//WorkerContext.h" +#include "core/workers/WorkerGlobalScope.h" #include "bindings/v8/ScriptController.h" #include "bindings/v8/V8Binding.h" #include "bindings/v8/V8RecursionScope.h" @@ -32,10 +32,10 @@ MSVC_POP_WARNING(); #include "base/lazy_instance.h" #include "base/strings/string_number_conversions.h" #include "base/threading/thread_local.h" -#include "googleurl/src/gurl.h" #include "third_party/WebKit/public/web/WebKit.h" #include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebScriptController.h" +#include "url/gurl.h" namespace { @@ -472,40 +472,45 @@ void GetCefString(v8::Handle str, CefString& out) { } // V8 function callback. -v8::Handle FunctionCallbackImpl(const v8::Arguments& args) { +void FunctionCallbackImpl(const v8::FunctionCallbackInfo& info) { WebCore::V8RecursionScope recursion_scope( WebCore::toScriptExecutionContext(v8::Context::GetCurrent())); CefV8Handler* handler = - static_cast(v8::External::Cast(*args.Data())->Value()); + static_cast(v8::External::Cast(*info.Data())->Value()); CefV8ValueList params; - for (int i = 0; i < args.Length(); i++) - params.push_back(new CefV8ValueImpl(args[i])); + for (int i = 0; i < info.Length(); i++) + params.push_back(new CefV8ValueImpl(info[i])); CefString func_name; - GetCefString(v8::Handle::Cast(args.Callee()->GetName()), + GetCefString(v8::Handle::Cast(info.Callee()->GetName()), func_name); - CefRefPtr object = new CefV8ValueImpl(args.This()); + CefRefPtr object = new CefV8ValueImpl(info.This()); CefRefPtr retval; CefString exception; if (handler->Execute(func_name, object, params, retval, exception)) { if (!exception.empty()) { - return v8::ThrowException(v8::Exception::Error(GetV8String(exception))); + info.GetReturnValue().Set( + v8::ThrowException(v8::Exception::Error(GetV8String(exception)))); + return; } else { CefV8ValueImpl* rv = static_cast(retval.get()); - if (rv && rv->IsValid()) - return rv->GetV8Value(true); + if (rv && rv->IsValid()) { + info.GetReturnValue().Set(rv->GetV8Value(true)); + return; + } } } - return v8::Undefined(); + info.GetReturnValue().SetUndefined(); } // V8 Accessor callbacks -v8::Handle AccessorGetterCallbackImpl(v8::Local property, - const v8::AccessorInfo& info) { +void AccessorGetterCallbackImpl( + v8::Local property, + const v8::PropertyCallbackInfo& info) { WebCore::V8RecursionScope recursion_scope( WebCore::toScriptExecutionContext(v8::Context::GetCurrent())); @@ -524,22 +529,26 @@ v8::Handle AccessorGetterCallbackImpl(v8::Local property, GetCefString(property, name); if (accessorPtr->Get(name, object, retval, exception)) { if (!exception.empty()) { - return v8::ThrowException( - v8::Exception::Error(GetV8String(exception))); + info.GetReturnValue().Set( + v8::ThrowException(v8::Exception::Error(GetV8String(exception)))); + return; } else { CefV8ValueImpl* rv = static_cast(retval.get()); - if (rv && rv->IsValid()) - return rv->GetV8Value(true); + if (rv && rv->IsValid()) { + info.GetReturnValue().Set(rv->GetV8Value(true)); + return; + } } } } - return v8::Undefined(); + return info.GetReturnValue().SetUndefined(); } -void AccessorSetterCallbackImpl(v8::Local property, - v8::Local value, - const v8::AccessorInfo& info) { +void AccessorSetterCallbackImpl( + v8::Local property, + v8::Local value, + const v8::PropertyCallbackInfo& info) { WebCore::V8RecursionScope recursion_scope( WebCore::toScriptExecutionContext(v8::Context::GetCurrent())); @@ -586,7 +595,7 @@ v8::Local CallV8Function(v8::Handle context, DCHECK(controller); if (controller) { func_rv = WebCore::ScriptController::callFunctionWithInstrumentation( - controller->workerContext()->scriptExecutionContext(), + controller->workerGlobalScope()->scriptExecutionContext(), function, receiver, argc, args); } } @@ -1673,9 +1682,10 @@ bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings, if (!accessorPtr.get()) return false; - v8::AccessorGetter getter = AccessorGetterCallbackImpl; - v8::AccessorSetter setter = (attribute & V8_PROPERTY_ATTRIBUTE_READONLY) ? - NULL : AccessorSetterCallbackImpl; + v8::AccessorGetterCallback getter = AccessorGetterCallbackImpl; + v8::AccessorSetterCallback setter = + (attribute & V8_PROPERTY_ATTRIBUTE_READONLY) ? + NULL : AccessorSetterCallbackImpl; v8::TryCatch try_catch; try_catch.SetVerbose(true); diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/webkit_glue.cc index 384500a7b..1a8dab3a5 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/webkit_glue.cc @@ -14,31 +14,43 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "bindings/v8/ScriptController.h" #include "core/history/BackForwardController.h" #include "core/page/Page.h" -#include "third_party/WebKit/Source/WebKit/chromium/src/WebFrameImpl.h" -#include "third_party/WebKit/Source/WebKit/chromium/src/WebViewImpl.h" +#include "third_party/WebKit/Source/web/WebFrameImpl.h" +#include "third_party/WebKit/Source/web/WebViewImpl.h" MSVC_POP_WARNING(); #undef LOG namespace webkit_glue { -bool CanGoBackOrForward(WebKit::WebView* view, int distance) { +bool CanGoBack(WebKit::WebView* view) { if (!view) return false; WebKit::WebViewImpl* impl = reinterpret_cast(view); - if (distance == 0) - return true; - if (distance > 0 && distance <= impl->page()->backForward()->forwardCount()) - return true; - if (distance < 0 && -distance <= impl->page()->backForward()->backCount()) - return true; - return false; + return (impl->page()->backForward()->backCount() > 0); } -void GoBackOrForward(WebKit::WebView* view, int distance) { +bool CanGoForward(WebKit::WebView* view) { + if (!view) + return false; + WebKit::WebViewImpl* impl = reinterpret_cast(view); + return (impl->page()->backForward()->forwardCount() > 0); +} + +void GoBack(WebKit::WebView* view) { if (!view) return; WebKit::WebViewImpl* impl = reinterpret_cast(view); - impl->page()->goBackOrForward(distance); + 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(); } v8::Handle GetV8Context(WebKit::WebFrame* frame) { diff --git a/libcef/renderer/webkit_glue.h b/libcef/renderer/webkit_glue.h index f788e41f4..e705700a5 100644 --- a/libcef/renderer/webkit_glue.h +++ b/libcef/renderer/webkit_glue.h @@ -17,8 +17,10 @@ class WebView; namespace webkit_glue { -bool CanGoBackOrForward(WebKit::WebView* view, int distance); -void GoBackOrForward(WebKit::WebView* view, int distance); +bool CanGoBack(WebKit::WebView* view); +bool CanGoForward(WebKit::WebView* view); +void GoBack(WebKit::WebView* view); +void GoForward(WebKit::WebView* view); // Retrieve the V8 context associated with the frame. v8::Handle GetV8Context(WebKit::WebFrame* frame); diff --git a/libcef/resources/cef_resources.grd b/libcef/resources/cef_resources.grd index f93cfefc2..f7ebd0325 100644 --- a/libcef/resources/cef_resources.grd +++ b/libcef/resources/cef_resources.grd @@ -15,8 +15,6 @@ - - diff --git a/libcef_dll/cpptoc/download_item_cpptoc.cc b/libcef_dll/cpptoc/download_item_cpptoc.cc index 326431426..48057a086 100644 --- a/libcef_dll/cpptoc/download_item_cpptoc.cc +++ b/libcef_dll/cpptoc/download_item_cpptoc.cc @@ -177,7 +177,7 @@ cef_string_userfree_t CEF_CALLBACK download_item_get_full_path( return _retval.DetachToUserFree(); } -int32 CEF_CALLBACK download_item_get_id(struct _cef_download_item_t* self) { +uint32 CEF_CALLBACK download_item_get_id(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -185,7 +185,7 @@ int32 CEF_CALLBACK download_item_get_id(struct _cef_download_item_t* self) { return 0; // Execute - int32 _retval = CefDownloadItemCppToC::Get(self)->GetId(); + uint32 _retval = CefDownloadItemCppToC::Get(self)->GetId(); // Return type: simple return _retval; diff --git a/libcef_dll/ctocpp/download_item_ctocpp.cc b/libcef_dll/ctocpp/download_item_ctocpp.cc index ae50f3ffc..ccaa05ebd 100644 --- a/libcef_dll/ctocpp/download_item_ctocpp.cc +++ b/libcef_dll/ctocpp/download_item_ctocpp.cc @@ -160,14 +160,14 @@ CefString CefDownloadItemCToCpp::GetFullPath() { return _retvalStr; } -int32 CefDownloadItemCToCpp::GetId() { +uint32 CefDownloadItemCToCpp::GetId() { if (CEF_MEMBER_MISSING(struct_, get_id)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int32 _retval = struct_->get_id(struct_); + uint32 _retval = struct_->get_id(struct_); // Return type: simple return _retval; diff --git a/libcef_dll/ctocpp/download_item_ctocpp.h b/libcef_dll/ctocpp/download_item_ctocpp.h index be2e7b35a..a7424978d 100644 --- a/libcef_dll/ctocpp/download_item_ctocpp.h +++ b/libcef_dll/ctocpp/download_item_ctocpp.h @@ -45,7 +45,7 @@ class CefDownloadItemCToCpp virtual CefTime GetStartTime() OVERRIDE; virtual CefTime GetEndTime() OVERRIDE; virtual CefString GetFullPath() OVERRIDE; - virtual int32 GetId() OVERRIDE; + virtual uint32 GetId() OVERRIDE; virtual CefString GetURL() OVERRIDE; virtual CefString GetSuggestedFileName() OVERRIDE; virtual CefString GetContentDisposition() OVERRIDE; diff --git a/patch/patch.cfg b/patch/patch.cfg index 83ef83834..ae6fde745 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -29,7 +29,7 @@ patches = [ { # http://code.google.com/p/chromiumembedded/issues/detail?id=933 'name': 'webkit_933', - 'path': '../third_party/WebKit/Source/WebKit/chromium/src/', + 'path': '../third_party/WebKit/Source/web/', }, { # http://code.google.com/p/gyp/issues/detail?id=331 diff --git a/patch/patches/message_loop_443.patch b/patch/patches/message_loop_443.patch index b9e6a28d4..db664925a 100644 --- a/patch/patches/message_loop_443.patch +++ b/patch/patches/message_loop_443.patch @@ -1,8 +1,8 @@ Index: message_loop.cc =================================================================== ---- message_loop.cc (revision 194165) +--- message_loop.cc (revision 213078) +++ message_loop.cc (working copy) -@@ -191,7 +191,7 @@ +@@ -193,7 +193,7 @@ MessageLoop::~MessageLoop() { DCHECK_EQ(this, current()); diff --git a/patch/patches/spi_webcore_364.patch b/patch/patches/spi_webcore_364.patch index 10f98a80e..a1cf565fe 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 151551) +--- page/FrameView.cpp (revision 154753) +++ page/FrameView.cpp (working copy) -@@ -198,10 +198,12 @@ +@@ -191,10 +191,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 151551) +--- platform/mac/NSScrollerImpDetails.mm (revision 154753) +++ platform/mac/NSScrollerImpDetails.mm (working copy) @@ -33,6 +33,7 @@ diff --git a/patch/patches/webkit_933.patch b/patch/patches/webkit_933.patch index dc39bd7ba..d687fdc05 100644 --- a/patch/patches/webkit_933.patch +++ b/patch/patches/webkit_933.patch @@ -1,13 +1,13 @@ Index: WebNode.cpp =================================================================== ---- WebNode.cpp (revision 146842) +--- WebNode.cpp (revision 154753) +++ WebNode.cpp (working copy) -@@ -181,7 +181,7 @@ +@@ -173,7 +173,7 @@ void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture) { // Please do not add more eventTypes to this list without an API review. - RELEASE_ASSERT(eventType == "mousedown"); -+ //RELEASE_ASSERT(eventType == "mousedown"); ++ // RELEASE_ASSERT(eventType == "mousedown"); EventListenerWrapper* listenerWrapper = listener->createEventListenerWrapper(eventType, useCapture, m_private.get()); // The listenerWrapper is only referenced by the actual Node. Once it goes diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 9923ab0d1..3ef5abab2 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 152953) +--- public/web/WebView.h (revision 154753) +++ public/web/WebView.h (working copy) -@@ -421,6 +421,7 @@ +@@ -423,6 +423,7 @@ // Sets whether select popup menus should be rendered by the browser. WEBKIT_EXPORT static void setUseExternalPopupMenus(bool); @@ -10,11 +10,11 @@ Index: public/web/WebView.h // Visited link state -------------------------------------------------- -Index: Source/WebKit/chromium/src/ChromeClientImpl.cpp +Index: Source/web/ChromeClientImpl.cpp =================================================================== ---- Source/WebKit/chromium/src/ChromeClientImpl.cpp (revision 152953) -+++ Source/WebKit/chromium/src/ChromeClientImpl.cpp (working copy) -@@ -895,7 +895,7 @@ +--- Source/web/ChromeClientImpl.cpp (revision 154753) ++++ Source/web/ChromeClientImpl.cpp (working copy) +@@ -872,7 +872,7 @@ PassRefPtr ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const { @@ -23,11 +23,11 @@ Index: Source/WebKit/chromium/src/ChromeClientImpl.cpp return adoptRef(new ExternalPopupMenu(frame, client, m_webView->client())); return adoptRef(new PopupMenuChromium(frame, client)); -Index: Source/WebKit/chromium/src/WebViewImpl.cpp +Index: Source/web/WebViewImpl.cpp =================================================================== ---- Source/WebKit/chromium/src/WebViewImpl.cpp (revision 152953) -+++ Source/WebKit/chromium/src/WebViewImpl.cpp (working copy) -@@ -393,6 +393,7 @@ +--- Source/web/WebViewImpl.cpp (revision 154753) ++++ Source/web/WebViewImpl.cpp (working copy) +@@ -388,6 +388,7 @@ , m_fakeDoubleTapPageScaleFactor(0) , m_fakeDoubleTapUseAnchor(false) , m_contextMenuAllowed(false) @@ -35,7 +35,7 @@ Index: Source/WebKit/chromium/src/WebViewImpl.cpp , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) , m_suppressNextKeypressEvent(false) -@@ -3676,9 +3677,14 @@ +@@ -3702,9 +3703,14 @@ updateLayerTreeViewport(); } @@ -51,11 +51,11 @@ Index: Source/WebKit/chromium/src/WebViewImpl.cpp } void WebViewImpl::setEmulatedTextZoomFactor(float textZoomFactor) -Index: Source/WebKit/chromium/src/WebViewImpl.h +Index: Source/web/WebViewImpl.h =================================================================== ---- Source/WebKit/chromium/src/WebViewImpl.h (revision 152953) -+++ Source/WebKit/chromium/src/WebViewImpl.h (working copy) -@@ -415,7 +415,8 @@ +--- Source/web/WebViewImpl.h (revision 154753) ++++ Source/web/WebViewImpl.h (working copy) +@@ -420,7 +420,8 @@ // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -65,7 +65,7 @@ Index: Source/WebKit/chromium/src/WebViewImpl.h bool contextMenuAllowed() const { -@@ -733,6 +734,8 @@ +@@ -721,6 +722,8 @@ bool m_contextMenuAllowed; diff --git a/tests/cefclient/client_handler.cpp b/tests/cefclient/client_handler.cpp index e9f8f067b..f11bb1803 100644 --- a/tests/cefclient/client_handler.cpp +++ b/tests/cefclient/client_handler.cpp @@ -268,7 +268,7 @@ bool ClientHandler::OnDragEnter(CefRefPtr browser, REQUIRE_UI_THREAD(); // Forbid dragging of link URLs. - if (dragData->IsLink()) + if (mask & DRAG_OPERATION_LINK) return true; return false;