Update to Chromium revision 142910.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@702 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-06-21 22:50:34 +00:00
parent c56def5569
commit 65cc337f03
22 changed files with 75 additions and 163 deletions

View File

@ -17,5 +17,5 @@
{
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
'chromium_revision': '140240',
'chromium_revision': '142910',
}

View File

@ -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',

View File

@ -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<base::Environment> 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() {

View File

@ -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;

View File

@ -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.
// -----------------------------------------------------------------------------

View File

@ -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)

View File

@ -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())

View File

@ -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,

View File

@ -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());
}
}

View File

@ -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:

View File

@ -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;
}

View File

@ -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);
};

View File

@ -280,8 +280,8 @@ net::URLRequestContext* CefURLRequestContextGetter::GetURLRequestContext() {
return url_request_context_.get();
}
scoped_refptr<base::MessageLoopProxy>
CefURLRequestContextGetter::GetIOMessageLoopProxy() const {
scoped_refptr<base::SingleThreadTaskRunner>
CefURLRequestContextGetter::GetNetworkTaskRunner() const {
return BrowserThread::GetMessageLoopProxyForThread(CEF_IOT);
}

View File

@ -36,8 +36,8 @@ class CefURLRequestContextGetter : public net::URLRequestContextGetter {
// net::URLRequestContextGetter implementation.
virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE;
virtual scoped_refptr<base::MessageLoopProxy>
GetIOMessageLoopProxy() const OVERRIDE;
virtual scoped_refptr<base::SingleThreadTaskRunner>
GetNetworkTaskRunner() const OVERRIDE;
net::HostResolver* host_resolver();

View File

@ -182,7 +182,7 @@ net::URLRequestContext*
return context_proxy_.get();
}
scoped_refptr<base::MessageLoopProxy>
CefURLRequestContextGetterProxy::GetIOMessageLoopProxy() const {
return parent_->GetIOMessageLoopProxy();
scoped_refptr<base::SingleThreadTaskRunner>
CefURLRequestContextGetterProxy::GetNetworkTaskRunner() const {
return parent_->GetNetworkTaskRunner();
}

View File

@ -18,8 +18,8 @@ class CefURLRequestContextGetterProxy : public net::URLRequestContextGetter {
// net::URLRequestContextGetter implementation.
virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE;
virtual scoped_refptr<base::MessageLoopProxy>
GetIOMessageLoopProxy() const OVERRIDE;
virtual scoped_refptr<base::SingleThreadTaskRunner>
GetNetworkTaskRunner() const OVERRIDE;
private:
CefBrowserHostImpl* browser_;

View File

@ -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;

View File

@ -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<content::BrowserMainRunner> browser_runner_;
@ -59,8 +58,6 @@ class CefMainDelegate : public content::ContentMainDelegate {
scoped_ptr<CefContentBrowserClient> browser_client_;
scoped_ptr<CefContentRendererClient> renderer_client_;
scoped_ptr<CefContentPluginClient> plugin_client_;
scoped_ptr<CefContentUtilityClient> utility_client_;
CefContentClient content_client_;
DISALLOW_COPY_AND_ASSIGN(CefMainDelegate);

View File

@ -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() {
}

View File

@ -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_

View File

@ -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;
}

View File

@ -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_