From 65cc337f033ddd8823d386c0fd6088b0637a59ca Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 21 Jun 2012 22:50:34 +0000 Subject: [PATCH] Update to Chromium revision 142910. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@702 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- cef.gyp | 4 -- libcef/browser/browser_context.cc | 23 ++++------ libcef/browser/browser_context.h | 2 +- libcef/browser/browser_host_impl.cc | 17 +++++++ libcef/browser/browser_host_impl.h | 4 ++ libcef/browser/content_browser_client.cc | 16 ------- libcef/browser/content_browser_client.h | 3 -- libcef/browser/download_manager_delegate.cc | 15 +++---- libcef/browser/download_manager_delegate.h | 5 +-- libcef/browser/url_network_delegate.cc | 11 +++++ libcef/browser/url_network_delegate.h | 5 +++ libcef/browser/url_request_context_getter.cc | 4 +- libcef/browser/url_request_context_getter.h | 4 +- .../url_request_context_getter_proxy.cc | 6 +-- .../url_request_context_getter_proxy.h | 4 +- libcef/common/main_delegate.cc | 45 +++++-------------- libcef/common/main_delegate.h | 9 ++-- libcef/plugin/content_plugin_client.cc | 8 ---- libcef/plugin/content_plugin_client.h | 17 ------- libcef/utility/content_utility_client.cc | 15 ------- libcef/utility/content_utility_client.h | 19 -------- 22 files changed, 75 insertions(+), 163 deletions(-) delete mode 100644 libcef/plugin/content_plugin_client.cc delete mode 100644 libcef/plugin/content_plugin_client.h delete mode 100644 libcef/utility/content_utility_client.cc delete mode 100644 libcef/utility/content_utility_client.h diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 60d16519b..bb4227851 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': '140240', + 'chromium_revision': '142910', } diff --git a/cef.gyp b/cef.gyp index a010cbf2e..043f3cd27 100644 --- a/cef.gyp +++ b/cef.gyp @@ -845,8 +845,6 @@ 'libcef/common/value_base.h', 'libcef/common/values_impl.cc', 'libcef/common/values_impl.h', - 'libcef/plugin/content_plugin_client.cc', - 'libcef/plugin/content_plugin_client.h', 'libcef/renderer/browser_impl.cc', 'libcef/renderer/browser_impl.h', 'libcef/renderer/content_renderer_client.cc', @@ -868,8 +866,6 @@ 'libcef/renderer/v8_impl.h', 'libcef/renderer/webkit_glue.cc', 'libcef/renderer/webkit_glue.h', - 'libcef/utility/content_utility_client.cc', - 'libcef/utility/content_utility_client.h', '<(DEPTH)/chrome/browser/net/clear_on_exit_policy.cc', '<(DEPTH)/chrome/browser/net/clear_on_exit_policy.h', '<(DEPTH)/chrome/browser/net/sqlite_persistent_cookie_store.cc', diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index e4757f130..fb0755fe2 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -180,9 +180,6 @@ class CefSpeechRecognitionPreferences return false; } - virtual void SetFilterProfanities(bool filter_profanities) OVERRIDE { - } - private: DISALLOW_COPY_AND_ASSIGN(CefSpeechRecognitionPreferences); }; @@ -215,9 +212,10 @@ void CefBrowserContext::InitWhileIOAllowed() { path_ = path_.Append(std::wstring(L"cef_data")); #elif defined(OS_LINUX) scoped_ptr env(base::Environment::Create()); - FilePath config_dir(base::nix::GetXDGDirectory(env.get(), - kXdgConfigHomeEnvVar, - kDotConfigDir)); + FilePath config_dir( + base::nix::GetXDGDirectory(env.get(), + base::nix::kXdgConfigHomeEnvVar, + base::nix::kDotConfigDir)); path_ = config_dir.Append("cef_data"); #elif defined(OS_MACOSX) CHECK(PathService::Get(base::DIR_APP_DATA, &path_)); @@ -238,15 +236,10 @@ bool CefBrowserContext::IsOffTheRecord() const { return false; } -content::DownloadManager* CefBrowserContext::GetDownloadManager() { - if (!download_manager_.get()) { - download_manager_delegate_ = new CefDownloadManagerDelegate(); - download_manager_ = - content::DownloadManager::Create(download_manager_delegate_, NULL); - download_manager_delegate_->SetDownloadManager(download_manager_.get()); - download_manager_->Init(this); - } - return download_manager_.get(); +content::DownloadManagerDelegate* + CefBrowserContext::GetDownloadManagerDelegate() { + download_manager_delegate_ = new CefDownloadManagerDelegate(); + return download_manager_delegate_.get(); } net::URLRequestContextGetter* CefBrowserContext::GetRequestContext() { diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index 232d06469..2d6063b9f 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -30,7 +30,7 @@ class CefBrowserContext : public content::BrowserContext { // BrowserContext methods. virtual FilePath GetPath() OVERRIDE; virtual bool IsOffTheRecord() const OVERRIDE; - virtual content::DownloadManager* GetDownloadManager() OVERRIDE; + virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE; virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( int renderer_child_id) OVERRIDE; diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 92491d29c..35aa9bd72 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -1082,6 +1082,23 @@ void CefBrowserHostImpl::UpdatePreferredSize(content::WebContents* source, PlatformSizeTo(pref_size.width(), pref_size.height()); } +void CefBrowserHostImpl::RequestMediaAccessPermission( + content::WebContents* web_contents, + const content::MediaStreamRequest* request, + const content::MediaResponseCallback& callback) { + CEF_CURRENTLY_ON_UIT(); + + content::MediaStreamDevices devices; + for (content::MediaStreamDeviceMap::const_iterator it = + request->devices.begin(); it != request->devices.end(); ++it) { + devices.push_back(*it->second.begin()); + } + + // TODO(cef): Give the user an opportunity to approve the device list or run + // the callback with an empty device list to cancel the request. + callback.Run(devices); +} + // content::WebContentsObserver methods. // ----------------------------------------------------------------------------- diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 0cf3bdfd9..7df86346b 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -229,6 +229,10 @@ class CefBrowserHostImpl : public CefBrowserHost, const content::FileChooserParams& params) OVERRIDE; virtual void UpdatePreferredSize(content::WebContents* source, const gfx::Size& pref_size) OVERRIDE; + virtual void RequestMediaAccessPermission( + content::WebContents* web_contents, + const content::MediaStreamRequest* request, + const content::MediaResponseCallback& callback) OVERRIDE; // content::WebContentsObserver methods. virtual void RenderViewCreated(content::RenderViewHost* render_view_host) diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 55fb74eb8..539134b68 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -109,22 +109,6 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( } } -void CefContentBrowserClient::RequestMediaAccessPermission( - const content::MediaStreamRequest* request, - const content::MediaResponseCallback& callback) { - CEF_CURRENTLY_ON_UIT(); - - content::MediaStreamDevices devices; - for (content::MediaStreamDeviceMap::const_iterator it = - request->devices.begin(); it != request->devices.end(); ++it) { - devices.push_back(*it->second.begin()); - } - - // TODO(cef): Give the user an opportunity to approve the device list or run - // the callback with an empty device list to cancel the request. - callback.Run(devices); -} - content::MediaObserver* CefContentBrowserClient::GetMediaObserver() { // TODO(cef): Return NULL once it's supported. See crbug.com/116113. if (!media_observer_.get()) diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index 294f99b34..3dc9444f5 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -36,9 +36,6 @@ class CefContentBrowserClient : public content::ContentBrowserClient { content::RenderProcessHost* host) OVERRIDE; virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, int child_process_id) OVERRIDE; - virtual void RequestMediaAccessPermission( - const content::MediaStreamRequest* request, - const content::MediaResponseCallback& callback) OVERRIDE; virtual content::MediaObserver* GetMediaObserver() OVERRIDE; virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE; virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh, diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index 5e4dc0ef3..09d035096 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -37,11 +37,6 @@ void CefDownloadManagerDelegate::SetDownloadManager( download_manager_ = download_manager; } -content::DownloadId CefDownloadManagerDelegate::GetNextId() { - static int next_id; - return content::DownloadId(this, ++next_id); -} - bool CefDownloadManagerDelegate::ShouldStartDownload(int32 download_id) { DownloadItem* download = download_manager_->GetActiveDownloadItem(download_id); @@ -72,20 +67,20 @@ bool CefDownloadManagerDelegate::ShouldStartDownload(int32 download_id) { } void CefDownloadManagerDelegate::ChooseDownloadPath( - WebContents* web_contents, - const FilePath& suggested_path, - int32 download_id) { + content::DownloadItem* item) { FilePath result; #if defined(OS_WIN) || defined(OS_MACOSX) + WebContents* web_contents = item->GetWebContents(); + const FilePath suggested_path(item->GetTargetFilePath()); result = PlatformChooseDownloadPath(web_contents, suggested_path); #else NOTIMPLEMENTED(); #endif if (result.empty()) { - download_manager_->FileSelectionCanceled(download_id); + download_manager_->FileSelectionCanceled(item->GetId()); } else { - download_manager_->FileSelected(result, download_id); + download_manager_->FileSelected(result, item->GetId()); } } diff --git a/libcef/browser/download_manager_delegate.h b/libcef/browser/download_manager_delegate.h index b647daffe..09212e244 100644 --- a/libcef/browser/download_manager_delegate.h +++ b/libcef/browser/download_manager_delegate.h @@ -25,11 +25,8 @@ class CefDownloadManagerDelegate void SetDownloadManager(content::DownloadManager* manager); // DownloadManagerDelegate methods. - virtual content::DownloadId GetNextId() OVERRIDE; virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; - virtual void ChooseDownloadPath(content::WebContents* web_contents, - const FilePath& suggested_path, - int32 download_id) OVERRIDE; + virtual void ChooseDownloadPath(content::DownloadItem* item) OVERRIDE; virtual void AddItemToPersistentStore(content::DownloadItem* item) OVERRIDE; private: diff --git a/libcef/browser/url_network_delegate.cc b/libcef/browser/url_network_delegate.cc index c2c0887ba..30c6caced 100644 --- a/libcef/browser/url_network_delegate.cc +++ b/libcef/browser/url_network_delegate.cc @@ -211,3 +211,14 @@ bool CefNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, const FilePath& path) const { return true; } + +bool CefNetworkDelegate::OnCanThrottleRequest( + const net::URLRequest& request) const { + return false; +} + +int CefNetworkDelegate::OnBeforeSocketStreamConnect( + net::SocketStream* socket, + const net::CompletionCallback& callback) { + return net::OK; +} diff --git a/libcef/browser/url_network_delegate.h b/libcef/browser/url_network_delegate.h index 0c86e0092..5ac5a0e24 100644 --- a/libcef/browser/url_network_delegate.h +++ b/libcef/browser/url_network_delegate.h @@ -52,6 +52,11 @@ class CefNetworkDelegate : public net::NetworkDelegate { net::CookieOptions* options) OVERRIDE; virtual bool OnCanAccessFile(const net::URLRequest& request, const FilePath& path) const OVERRIDE; + virtual bool OnCanThrottleRequest( + const net::URLRequest& request) const OVERRIDE; + virtual int OnBeforeSocketStreamConnect( + net::SocketStream* stream, + const net::CompletionCallback& callback) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(CefNetworkDelegate); }; diff --git a/libcef/browser/url_request_context_getter.cc b/libcef/browser/url_request_context_getter.cc index 585b09d34..7544d2c48 100644 --- a/libcef/browser/url_request_context_getter.cc +++ b/libcef/browser/url_request_context_getter.cc @@ -280,8 +280,8 @@ net::URLRequestContext* CefURLRequestContextGetter::GetURLRequestContext() { return url_request_context_.get(); } -scoped_refptr - CefURLRequestContextGetter::GetIOMessageLoopProxy() const { +scoped_refptr + CefURLRequestContextGetter::GetNetworkTaskRunner() const { return BrowserThread::GetMessageLoopProxyForThread(CEF_IOT); } diff --git a/libcef/browser/url_request_context_getter.h b/libcef/browser/url_request_context_getter.h index b7ba8f3f0..1ee5c3e0a 100644 --- a/libcef/browser/url_request_context_getter.h +++ b/libcef/browser/url_request_context_getter.h @@ -36,8 +36,8 @@ class CefURLRequestContextGetter : public net::URLRequestContextGetter { // net::URLRequestContextGetter implementation. virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; - virtual scoped_refptr - GetIOMessageLoopProxy() const OVERRIDE; + virtual scoped_refptr + GetNetworkTaskRunner() const OVERRIDE; net::HostResolver* host_resolver(); diff --git a/libcef/browser/url_request_context_getter_proxy.cc b/libcef/browser/url_request_context_getter_proxy.cc index 02cab8a68..a94dcf47e 100644 --- a/libcef/browser/url_request_context_getter_proxy.cc +++ b/libcef/browser/url_request_context_getter_proxy.cc @@ -182,7 +182,7 @@ net::URLRequestContext* return context_proxy_.get(); } -scoped_refptr - CefURLRequestContextGetterProxy::GetIOMessageLoopProxy() const { - return parent_->GetIOMessageLoopProxy(); +scoped_refptr + CefURLRequestContextGetterProxy::GetNetworkTaskRunner() const { + return parent_->GetNetworkTaskRunner(); } diff --git a/libcef/browser/url_request_context_getter_proxy.h b/libcef/browser/url_request_context_getter_proxy.h index 11d86b0b4..2e4faa190 100644 --- a/libcef/browser/url_request_context_getter_proxy.h +++ b/libcef/browser/url_request_context_getter_proxy.h @@ -18,8 +18,8 @@ class CefURLRequestContextGetterProxy : public net::URLRequestContextGetter { // net::URLRequestContextGetter implementation. virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; - virtual scoped_refptr - GetIOMessageLoopProxy() const OVERRIDE; + virtual scoped_refptr + GetNetworkTaskRunner() const OVERRIDE; private: CefBrowserHostImpl* browser_; diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index 6e29ddb6c..8b6cf8eed 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -7,9 +7,7 @@ #include "libcef/browser/context.h" #include "libcef/common/cef_switches.h" #include "libcef/common/command_line_impl.h" -#include "libcef/plugin/content_plugin_client.h" #include "libcef/renderer/content_renderer_client.h" -#include "libcef/utility/content_utility_client.h" #include "base/command_line.h" #include "base/file_path.h" @@ -229,7 +227,6 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) { } content::SetContentClient(&content_client_); - InitializeContentClient(process_type); return false; } @@ -284,14 +281,17 @@ void CefMainDelegate::ProcessExiting(const std::string& process_type) { ResourceBundle::CleanupSharedInstance(); } -#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) -void CefMainDelegate::ZygoteForked() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - std::string process_type = - command_line.GetSwitchValueASCII(switches::kProcessType); - InitializeContentClient(process_type); + +content::ContentBrowserClient* CefMainDelegate::CreateContentBrowserClient() { + browser_client_.reset(new CefContentBrowserClient); + return browser_client_.get(); +} + +content::ContentRendererClient* + CefMainDelegate::CreateContentRendererClient() { + renderer_client_.reset(new CefContentRendererClient); + return renderer_client_.get(); } -#endif void CefMainDelegate::ShutdownBrowser() { if (browser_runner_.get()) { @@ -305,31 +305,6 @@ void CefMainDelegate::ShutdownBrowser() { } } -void CefMainDelegate::InitializeContentClient( - const std::string& process_type) { - if (process_type.empty()) { - browser_client_.reset(new CefContentBrowserClient); - content::GetContentClient()->set_browser(browser_client_.get()); - - // Single-process is an unsupported and not fully tested mode. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - if (command_line.HasSwitch(switches::kSingleProcess)) { - content::RenderProcessHost::set_run_renderer_in_process(true); - renderer_client_.reset(new CefContentRendererClient); - content::GetContentClient()->set_renderer(renderer_client_.get()); - } - } else if (process_type == switches::kRendererProcess) { - renderer_client_.reset(new CefContentRendererClient); - content::GetContentClient()->set_renderer(renderer_client_.get()); - } else if (process_type == switches::kPluginProcess) { - plugin_client_.reset(new CefContentPluginClient); - content::GetContentClient()->set_plugin(plugin_client_.get()); - } else if (process_type == switches::kUtilityProcess) { - utility_client_.reset(new CefContentUtilityClient); - content::GetContentClient()->set_utility(utility_client_.get()); - } -} - void CefMainDelegate::InitializeResourceBundle() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); FilePath pak_file, locales_dir; diff --git a/libcef/common/main_delegate.h b/libcef/common/main_delegate.h index e859b5ad2..d532b69b5 100644 --- a/libcef/common/main_delegate.h +++ b/libcef/common/main_delegate.h @@ -40,9 +40,9 @@ class CefMainDelegate : public content::ContentMainDelegate { const std::string& process_type, const content::MainFunctionParams& main_function_params) OVERRIDE; virtual void ProcessExiting(const std::string& process_type) OVERRIDE; -#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) - virtual void ZygoteForked() OVERRIDE; -#endif + virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; + virtual content::ContentRendererClient* + CreateContentRendererClient() OVERRIDE; // Shut down the browser runner. void ShutdownBrowser(); @@ -51,7 +51,6 @@ class CefMainDelegate : public content::ContentMainDelegate { CefContentClient* content_client() { return &content_client_; } private: - void InitializeContentClient(const std::string& process_type); void InitializeResourceBundle(); scoped_ptr browser_runner_; @@ -59,8 +58,6 @@ class CefMainDelegate : public content::ContentMainDelegate { scoped_ptr browser_client_; scoped_ptr renderer_client_; - scoped_ptr plugin_client_; - scoped_ptr utility_client_; CefContentClient content_client_; DISALLOW_COPY_AND_ASSIGN(CefMainDelegate); diff --git a/libcef/plugin/content_plugin_client.cc b/libcef/plugin/content_plugin_client.cc deleted file mode 100644 index 81ec0f001..000000000 --- a/libcef/plugin/content_plugin_client.cc +++ /dev/null @@ -1,8 +0,0 @@ -// 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/plugin/content_plugin_client.h" - -CefContentPluginClient::~CefContentPluginClient() { -} diff --git a/libcef/plugin/content_plugin_client.h b/libcef/plugin/content_plugin_client.h deleted file mode 100644 index 9e71fddb5..000000000 --- a/libcef/plugin/content_plugin_client.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CEF_LIBCEF_PLUGIN_CONTENT_PLUGIN_CLIENT_H_ -#define CEF_LIBCEF_PLUGIN_CONTENT_PLUGIN_CLIENT_H_ -#pragma once - -#include "base/compiler_specific.h" -#include "content/public/plugin/content_plugin_client.h" - -class CefContentPluginClient : public content::ContentPluginClient { - public: - virtual ~CefContentPluginClient(); -}; - -#endif // CEF_LIBCEF_PLUGIN_CONTENT_PLUGIN_CLIENT_H_ diff --git a/libcef/utility/content_utility_client.cc b/libcef/utility/content_utility_client.cc deleted file mode 100644 index b9cbeee76..000000000 --- a/libcef/utility/content_utility_client.cc +++ /dev/null @@ -1,15 +0,0 @@ -// 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/utility/content_utility_client.h" - -CefContentUtilityClient::~CefContentUtilityClient() { -} - -void CefContentUtilityClient::UtilityThreadStarted() { -} - -bool CefContentUtilityClient::OnMessageReceived(const IPC::Message& message) { - return false; -} diff --git a/libcef/utility/content_utility_client.h b/libcef/utility/content_utility_client.h deleted file mode 100644 index 0b482dd87..000000000 --- a/libcef/utility/content_utility_client.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CEF_LIBCEF_UTILITY_CONTENT_UTILITY_CLIENT_H_ -#define CEF_LIBCEF_UTILITY_CONTENT_UTILITY_CLIENT_H_ -#pragma once - -#include "base/compiler_specific.h" -#include "content/public/utility/content_utility_client.h" - -class CefContentUtilityClient : public content::ContentUtilityClient { - public: - virtual ~CefContentUtilityClient(); - virtual void UtilityThreadStarted() OVERRIDE; - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; -}; - -#endif // CEF_LIBCEF_UTILITY_CONTENT_UTILITY_CLIENT_H_