Commit 5dec0c5f authored by Marshall Greenblatt's avatar Marshall Greenblatt

Update to Chromium revision c78c0ad7 (#363565)

parent 535c4fbc
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': '304f01a1e1f7ebeb7d637f847469c90ba008b86d',
'chromium_checkout': 'c78c0ad7cca1b37761b488e9499d619b21c8016d',
}
......@@ -871,6 +871,9 @@
# Generate chrome/common/safe_browsing/csd.pb.h required by
# zip_analyzer_results.h via chrome_utility_messages.h
'<(DEPTH)/chrome/chrome.gyp:safe_browsing_proto',
# Generate chrome/common/features.h required by Chrome code that uses
# the BUILDFLAG() macro.
'<(DEPTH)/chrome/chrome_features.gyp:chrome_common_features',
# Generate chrome/common/chrome_version.h required by
# chrome/common/chrome_contants.cc
'<(DEPTH)/chrome/common_constants.gyp:version_header',
......@@ -878,7 +881,7 @@
'<(DEPTH)/components/components.gyp:component_updater',
'<(DEPTH)/components/components.gyp:content_settings_core_browser',
'<(DEPTH)/components/components.gyp:content_settings_core_common',
'<(DEPTH)/components/components.gyp:crash_component_breakpad_mac_to_be_deleted',
'<(DEPTH)/components/components.gyp:crash_component_breakpad_to_be_deleted',
'<(DEPTH)/components/components.gyp:crx_file',
'<(DEPTH)/components/components.gyp:data_use_measurement_core',
'<(DEPTH)/components/components.gyp:devtools_discovery',
......
......@@ -364,6 +364,7 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
url_request_getter_ = new CefURLRequestContextGetterImpl(
settings_,
GetPrefs(),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE),
protocol_handlers,
......
......@@ -209,7 +209,7 @@ class CefBrowserPlatformDelegate {
protected:
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<CefBrowserPlatformDelegate>;
friend std::default_delete<CefBrowserPlatformDelegate>;
CefBrowserPlatformDelegate();
virtual ~CefBrowserPlatformDelegate();
......
......@@ -203,7 +203,8 @@ StatusTray* ChromeBrowserProcessStub::status_tray() {
return NULL;
}
SafeBrowsingService* ChromeBrowserProcessStub::safe_browsing_service() {
safe_browsing::SafeBrowsingService*
ChromeBrowserProcessStub::safe_browsing_service() {
NOTIMPLEMENTED();
return NULL;
}
......
......@@ -73,7 +73,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
void set_background_mode_manager_for_test(
scoped_ptr<BackgroundModeManager> manager) override;
StatusTray* status_tray() override;
SafeBrowsingService* safe_browsing_service() override;
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
safe_browsing::ClientSideDetectionService*
safe_browsing_detection_service() override;
......
......@@ -594,7 +594,6 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kDisableScrollBounce,
switches::kDisableSpellChecking,
switches::kEnableSpeechInput,
switches::kEnableSpellingAutoCorrect,
switches::kEnableSystemFlash,
switches::kPpapiFlashArgs,
switches::kPpapiFlashPath,
......@@ -677,8 +676,7 @@ content::SpeechRecognitionManagerDelegate*
}
void CefContentBrowserClient::AllowCertificateError(
int render_process_id,
int render_frame_id,
content::WebContents* web_contents,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
......@@ -699,8 +697,7 @@ void CefContentBrowserClient::AllowCertificateError(
}
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForFrame(render_process_id,
render_frame_id);
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (!browser.get())
return;
CefRefPtr<CefClient> client = browser->GetClient();
......@@ -846,7 +843,8 @@ CefContentBrowserClient::CreateThrottlesForNavigation(
new navigation_interception::InterceptNavigationThrottle(
navigation_handle,
base::Bind(&NavigationOnUIThread, is_main_frame, frame_id,
parent_frame_id));
parent_frame_id),
true);
throttles.push_back(throttle);
return throttles.Pass();
......@@ -882,18 +880,14 @@ const wchar_t* CefContentBrowserClient::GetResourceDllName() {
return file_path;
}
void CefContentBrowserClient::PreSpawnRenderer(
sandbox::TargetPolicy* policy,
bool* success) {
bool CefContentBrowserClient::PreSpawnRenderer(
sandbox::TargetPolicy* policy) {
// Flash requires this permission to play video files.
sandbox::ResultCode result = policy->AddRule(
sandbox::TargetPolicy::SUBSYS_HANDLES,
sandbox::TargetPolicy::HANDLES_DUP_ANY,
L"File");
if (result != sandbox::SBOX_ALL_OK) {
*success = false;
return;
}
return result == sandbox::SBOX_ALL_OK;
}
#endif // defined(OS_WIN)
......
......@@ -65,8 +65,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override;
void AllowCertificateError(
int render_process_id,
int render_frame_id,
content::WebContents* web_contents,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
......@@ -117,7 +116,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
#if defined(OS_WIN)
const wchar_t* GetResourceDllName() override;
void PreSpawnRenderer(sandbox::TargetPolicy* policy, bool* success) override;
bool PreSpawnRenderer(sandbox::TargetPolicy* policy) override;
#endif
// Perform browser process registration for the custom scheme.
......
......@@ -10,6 +10,7 @@
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/context.h"
#include "libcef/browser/net/network_delegate.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/time_util.h"
......@@ -556,7 +557,8 @@ void CefCookieManagerImpl::SetCookieInternal(
cookie.secure ? true : false,
cookie.httponly ? true : false,
false, // First-party only.
false, // Enforces prefixes.
CefNetworkDelegate::AreExperimentalCookieFeaturesEnabled(),
CefNetworkDelegate::AreStrictSecureCookiesEnabled(),
net::COOKIE_PRIORITY_DEFAULT,
base::Bind(SetCookieCallbackImpl, callback));
}
......
......@@ -41,7 +41,7 @@ class CefFileDialogRunner {
protected:
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<CefFileDialogRunner>;
friend std::default_delete<CefFileDialogRunner>;
CefFileDialogRunner() {}
virtual ~CefFileDialogRunner() {}
......
......@@ -90,7 +90,7 @@ class CefFrameHostImpl : public CefFrame {
int64 parent_frame_id_;
IMPLEMENT_REFCOUNTING(CefFrameHostImpl);
DISALLOW_EVIL_CONSTRUCTORS(CefFrameHostImpl);
DISALLOW_COPY_AND_ASSIGN(CefFrameHostImpl);
};
#endif // CEF_LIBCEF_BROWSER_FRAME_HOST_IMPL_H_
......@@ -34,7 +34,7 @@ class CefJavaScriptDialogRunner {
protected:
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<CefJavaScriptDialogRunner>;
friend std::default_delete<CefJavaScriptDialogRunner>;
CefJavaScriptDialogRunner() {}
virtual ~CefJavaScriptDialogRunner() {}
......
......@@ -29,7 +29,7 @@ class CefMenuRunner {
protected:
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<CefMenuRunner>;
friend std::default_delete<CefMenuRunner>;
CefMenuRunner() {}
virtual ~CefMenuRunner() {}
......
......@@ -139,7 +139,8 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
// Likewise, the X server needs to know this window's pid so it knows which
// program to kill if the window hangs.
// XChangeProperty() expects "pid" to be long.
COMPILE_ASSERT(sizeof(long) >= sizeof(pid_t), pid_t_bigger_than_long);
static_assert(sizeof(long) >= sizeof(pid_t),
"pid_t should not be larger than long");
long pid = getpid();
XChangeProperty(xdisplay_,
xwindow_,
......
......@@ -14,6 +14,10 @@
#include "libcef/common/request_impl.h"
#include "libcef/common/response_impl.h"
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_util.h"
#include "content/public/common/content_switches.h"
#include "net/base/net_errors.h"
#include "net/filter/filter.h"
#include "net/http/http_util.h"
......@@ -225,6 +229,27 @@ CefNetworkDelegate::CefNetworkDelegate() {
CefNetworkDelegate::~CefNetworkDelegate() {
}
// static
bool CefNetworkDelegate::AreExperimentalCookieFeaturesEnabled() {
static bool initialized = false;
static bool enabled = false;
if (!initialized) {
enabled = base::CommandLine::ForCurrentProcess()->
HasSwitch(switches::kEnableExperimentalWebPlatformFeatures);
initialized = true;
}
return enabled;
}
// static
bool CefNetworkDelegate::AreStrictSecureCookiesEnabled() {
const std::string enforce_strict_secure_group =
base::FieldTrialList::FindFullName("StrictSecureCookies");
return AreExperimentalCookieFeaturesEnabled() ||
base::StartsWith(enforce_strict_secure_group, "Enabled",
base::CompareCase::INSENSITIVE_ASCII);
}
int CefNetworkDelegate::OnBeforeURLRequest(
net::URLRequest* request,
const net::CompletionCallback& callback,
......@@ -387,6 +412,14 @@ bool CefNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
return true;
}
bool CefNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
return AreExperimentalCookieFeaturesEnabled();
}
bool CefNetworkDelegate::OnAreStrictSecureCookiesEnabled() const {
return AreStrictSecureCookiesEnabled();
}
net::Filter* CefNetworkDelegate::SetupFilter(net::URLRequest* request,
net::Filter* filter_list) {
CefRefPtr<CefResponseFilter> cef_filter;
......
......@@ -15,6 +15,11 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
CefNetworkDelegate();
~CefNetworkDelegate() override;
// Match the logic from ChromeNetworkDelegate and
// RenderFrameMessageFilter::OnSetCookie.
static bool AreExperimentalCookieFeaturesEnabled();
static bool AreStrictSecureCookiesEnabled();
private:
// net::NetworkDelegate methods.
int OnBeforeURLRequest(net::URLRequest* request,
......@@ -28,6 +33,8 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
void OnCompleted(net::URLRequest* request, bool started) override;
bool OnCanAccessFile(const net::URLRequest& request,
const base::FilePath& path) const override;
bool OnAreExperimentalCookieFeaturesEnabled() const override;
bool OnAreStrictSecureCookiesEnabled() const override;
net::Filter* SetupFilter(net::URLRequest* request,
net::Filter* filter_list) override;
......
......@@ -106,25 +106,23 @@ class CefResourceRequestJobCallback : public CefCallback {
if (job_->has_response_started() &&
job_->GetStatus().is_io_pending()) {
// Read the bytes. They should be available but, if not, wait again.
int bytes_read = 0;
if (job_->ReadRawData(dest_, dest_size_, &bytes_read)) {
int bytes_read = job_->ReadRawData(dest_, dest_size_);
if (bytes_read == net::ERR_IO_PENDING) {
// Still pending, nothing to do...
} else if (bytes_read >= 0) {
// Must clear the members here because they may be reset as a result
// of calling NotifyReadComplete.
// of calling ReadRawDataComplete.
dest_size_ = 0;
dest_ = NULL;
// Clear the IO_PENDING status.
job_->SetStatus(URLRequestStatus());
// Notify about the available bytes. If bytes_read > 0 then
// ReadRawData may be called from URLRequest::Read. If bytes_read == 0
// then Kill will be called from the URLRequest destructor.
job_->NotifyReadComplete(bytes_read);
} else if (!job_->GetStatus().is_io_pending()) {
job_->ReadRawDataComplete(bytes_read);
} else {
// Failed due to an error.
NOTREACHED() <<
"ReadRawData returned false without setting IO as pending";
job_->NotifyDone(URLRequestStatus());
NOTREACHED() << "ReadRawData returned error " << bytes_read;
job_->ReadRawDataComplete(bytes_read);
Detach();
}
}
......@@ -220,28 +218,19 @@ void CefResourceRequestJob::Kill() {
// This method will be called by URLRequestJob::Read and our callback.
// It can indicate the following states:
// 1. If the request is complete set |bytes_read| == 0 and return true. The
// caller is then responsible for calling NotifyReadComplete. ReadRawData
// should not be called again.
// 2. If data is available synchronously set |bytes_read| > 0 and return true.
// The caller is then responsible for calling NotifyReadComplete. ReadRawData
// may be called again by URLRequestJob::Read.
// 3. If data is not available now but may be available asynchronously set
// status to IO_PENDING and return false. When executed asynchronously the
// callback will again call ReadRawData. If data is returned at that time the
// callback will clear the status and call NotifyReadComplete.
bool CefResourceRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size,
int* bytes_read) {
// 1. Return ERR_IO_PENDING, and call ReadRawDataComplete when the read
// completes in any way, or
// 2. Return a count of bytes read >= 0, indicating synchronous success, or
// 3. Return another error code < 0, indicating synchronous failure.
int CefResourceRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size) {
CEF_REQUIRE_IOT();
DCHECK_NE(dest_size, 0);
DCHECK(bytes_read);
if (remaining_bytes_ == 0) {
// No more data to read.
*bytes_read = 0;
DoneWithRequest();
return true;
return 0;
} else if (remaining_bytes_ > 0 && remaining_bytes_ < dest_size) {
// The handler knows the content size beforehand.
dest_size = static_cast<int>(remaining_bytes_);
......@@ -255,33 +244,31 @@ bool CefResourceRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size,
}
// Read response data from the handler.
bool rv = handler_->ReadResponse(dest->data(), dest_size, *bytes_read,
int bytes_read = 0;
bool rv = handler_->ReadResponse(dest->data(), dest_size, bytes_read,
callback_.get());
if (!rv) {
// The handler has indicated completion of the request.
*bytes_read = 0;
DoneWithRequest();
return true;
} else if (*bytes_read == 0) {
return 0;
} else if (bytes_read == 0) {
// Continue reading asynchronously. May happen multiple times in a row so
// only set IO pending the first time.
if (!GetStatus().is_io_pending()) {
SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
// only set destination members the first time.
if (!GetStatus().is_io_pending())
callback_->SetDestination(dest, dest_size);
}
return false;
} else if (*bytes_read > dest_size) {
return net::ERR_IO_PENDING;
} else if (bytes_read > dest_size) {
// Normalize the return value.
*bytes_read = dest_size;
bytes_read = dest_size;
}
sent_bytes_ += *bytes_read;
sent_bytes_ += bytes_read;
if (remaining_bytes_ > 0)
remaining_bytes_ -= *bytes_read;
remaining_bytes_ -= bytes_read;
// Continue calling this method.
return true;
return bytes_read;
}
void CefResourceRequestJob::GetResponseInfo(net::HttpResponseInfo* info) {
......
......@@ -33,7 +33,7 @@ class CefResourceRequestJob : public net::URLRequestJob {
// net::URLRequestJob methods.
void Start() override;
void Kill() override;
bool ReadRawData(net::IOBuffer* dest, int dest_size, int* bytes_read) override;
int ReadRawData(net::IOBuffer* dest, int dest_size) override;
void GetResponseInfo(net::HttpResponseInfo* info) override;
void GetLoadTimingInfo(
net::LoadTimingInfo* load_timing_info) const override;
......
......@@ -21,11 +21,13 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/prefs/pref_service.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/worker_pool.h"
#include "chrome/browser/net/proxy_service_factory.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
......@@ -36,6 +38,7 @@
#include "net/dns/host_resolver.h"
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_auth_preferences.h"
#include "net/http/http_cache.h"
#include "net/http/http_server_properties_impl.h"
#include "net/http/http_util.h"
......@@ -97,6 +100,7 @@ class CefHttpUserAgentSettings : public net::HttpUserAgentSettings {
CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
const CefRequestContextSettings& settings,
PrefService* pref_service,
base::MessageLoop* io_loop,
base::MessageLoop* file_loop,
content::ProtocolHandlerMap* protocol_handlers,
......@@ -111,6 +115,10 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
CEF_REQUIRE_UIT();
std::swap(protocol_handlers_, *protocol_handlers);
#if defined(OS_POSIX) && !defined(OS_ANDROID)
gsapi_library_name_ = pref_service->GetString(prefs::kGSSAPILibraryName);
#endif
}
CefURLRequestContextGetterImpl::~CefURLRequestContextGetterImpl() {
......@@ -172,24 +180,23 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
// Add support for single sign-on.
url_security_manager_.reset(net::URLSecurityManager::Create(NULL, NULL));
std::vector<std::string> supported_schemes;
supported_schemes.push_back("basic");
supported_schemes.push_back("digest");
supported_schemes.push_back("ntlm");
supported_schemes.push_back("negotiate");
storage_->set_http_auth_handler_factory(make_scoped_ptr(
http_auth_preferences_.reset(
new net::HttpAuthPreferences(supported_schemes
#if defined(OS_POSIX) && !defined(OS_ANDROID)
, gsapi_library_name_
#endif
));
storage_->set_http_auth_handler_factory(
net::HttpAuthHandlerRegistryFactory::Create(
supported_schemes,
url_security_manager_.get(),
url_request_context_->host_resolver(),
std::string(),
std::string(),
false,
false)));
http_auth_preferences_.get(),
url_request_context_->host_resolver()));
storage_->set_http_server_properties(
make_scoped_ptr<net::HttpServerProperties>(
new net::HttpServerPropertiesImpl));
......
......@@ -21,6 +21,8 @@
#include "content/public/browser/content_browser_client.h"
#include "net/url_request/url_request_job_factory.h"
class PrefService;
namespace base {
class MessageLoop;
}
......@@ -28,11 +30,11 @@ class MessageLoop;
namespace net {
class CookieMonster;
class FtpTransactionFactory;
class HttpAuthPreferences;
class ProxyConfigService;
class URLRequestContextStorage;
class URLRequestJobFactory;
class URLRequestJobFactoryImpl;
class URLSecurityManager;
}
// Isolated URLRequestContextGetter implementation. Life span is primarily
......@@ -43,6 +45,7 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
public:
CefURLRequestContextGetterImpl(
const CefRequestContextSettings& settings,
PrefService* pref_service,
base::MessageLoop* io_loop,
base::MessageLoop* file_loop,
content::ProtocolHandlerMap* protocol_handlers,
......@@ -80,11 +83,15 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
base::MessageLoop* io_loop_;
base::MessageLoop* file_loop_;
#if defined(OS_POSIX) && !defined(OS_ANDROID)
std::string gsapi_library_name_;
#endif
scoped_ptr<net::ProxyConfigService> proxy_config_service_;
scoped_ptr<net::URLRequestContextStorage> storage_;
scoped_ptr<net::HttpAuthPreferences> http_auth_preferences_;
scoped_ptr<CefURLRequestContextImpl> url_request_context_;
scoped_ptr<CefURLRequestManager> url_request_manager_;
scoped_ptr<net::URLSecurityManager> url_security_manager_;
scoped_ptr<net::FtpTransactionFactory> ftp_transaction_factory_;
content::ProtocolHandlerMap protocol_handlers_;
content::URLRequestInterceptorScopedVector request_interceptors_;
......
......@@ -147,7 +147,7 @@ class CefOriginWhitelistManager {
typedef std::vector<Cef_CrossOriginWhiteListEntry_Params> OriginList;
OriginList origin_list_;
DISALLOW_EVIL_CONSTRUCTORS(CefOriginWhitelistManager);
DISALLOW_COPY_AND_ASSIGN(CefOriginWhitelistManager);
};
base::LazyInstance<CefOriginWhitelistManager> g_manager =
......
......@@ -293,7 +293,7 @@ class CefCopyFrameGenerator {
content::GLHelper* gl_helper =
content::ImageTransportFactory::GetInstance()->GetGLHelper();
if (gl_helper)
sync_token = gpu::SyncToken(gl_helper->InsertSyncPoint());
gl_helper->GenerateSyncToken(&sync_token);
}
const bool lost_resource = !sync_token.HasData();
release_callback->Run(sync_token, lost_resource);
......@@ -658,12 +658,8 @@ void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame(
// The compositor will draw directly to the SoftwareOutputDevice which
// then calls OnPaint.
delegated_frame_host_->SwapDelegatedFrame(
output_surface_id,
frame->delegated_frame_data.Pass(),
frame->metadata.device_scale_factor,
frame->metadata.latency_info,
&frame->metadata.satisfies_sequences);
delegated_frame_host_->SwapDelegatedFrame(output_surface_id,
frame.Pass());
} else {
if (!copy_frame_generator_.get()) {
copy_frame_generator_.reset(
......@@ -673,18 +669,14 @@ void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame(
// Determine the damage rectangle for the current frame. This is the same
// calculation that SwapDelegatedFrame uses.
cc::RenderPass* root_pass =
frame->delegated_frame_data->render_pass_list.back();
frame->delegated_frame_data->render_pass_list.back().get();
gfx::Size frame_size = root_pass->output_rect.size();
gfx::Rect damage_rect =
gfx::ToEnclosingRect(gfx::RectF(root_pass->damage_rect));
damage_rect.Intersect(gfx::Rect(frame_size));
delegated_frame_host_->SwapDelegatedFrame(
output_surface_id,
frame->delegated_frame_data.Pass(),
frame->metadata.device_scale_factor,
frame->metadata.latency_info,
&frame->metadata.satisfies_sequences);
delegated_frame_host_->SwapDelegatedFrame(output_surface_id,
frame.Pass());
// Request a copy of the last compositor frame which will eventually call
// OnPaint asynchronously.
......@@ -866,7 +858,7 @@ void CefRenderWidgetHostViewOSR::CopyFromCompositingSurface(
void CefRenderWidgetHostViewOSR::CopyFromCompositingSurfaceToVideoFrame(
const gfx::Rect& src_subrect,
const scoped_refptr<media::VideoFrame>& target,
const base::Callback<void(bool)>& callback) {
const base::Callback<void(const gfx::Rect&, bool)>& callback) {
delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame(
src_subrect, target, callback);
}
......
......@@ -159,7 +159,7 @@ class CefRenderWidgetHostViewOSR
void CopyFromCompositingSurfaceToVideoFrame(
const gfx::Rect& src_subrect,
const scoped_refptr<media::VideoFrame>& target,
const base::Callback<void(bool)>& callback) override;
const base::Callback<void(const gfx::Rect&, bool)>& callback) override;
bool CanCopyToVideoFrame() const override;
void BeginFrameSubscription(
scoped_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber)
......
......@@ -147,10 +147,6 @@ scoped_ptr<PrefService> CreatePrefService(const base::FilePath& pref_path) {
registry->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService,
command_line->HasSwitch(switches::kEnableSpellingService));
registry->RegisterBooleanPref(prefs::kEnableContinuousSpellcheck, true);
// The kEnableSpellingAutoCorrect command-line value is also checked in
// SpellCheckProvider::autoCorrectWord.
registry->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect,
command_line->HasSwitch(switches::kEnableSpellingAutoCorrect));
// Pepper flash preferences.
// Based on DeviceIDFetcher::RegisterProfilePrefs.
......@@ -162,6 +158,12 @@ scoped_ptr<PrefService> CreatePrefService(const base::FilePath& pref_path) {
registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false);
registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, false);
// Network preferences.
// Based on IOThread::RegisterPrefs.
#if defined(OS_POSIX) && !defined(OS_ANDROID)
registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string());
#endif
if (command_line->HasSwitch(switches::kEnablePreferenceTesting)) {
// Preferences used with unit tests.
registry->RegisterBooleanPref("test.bool", true);
......
......@@ -31,6 +31,7 @@
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/web_preferences.h"
#include "content/public/common/webrtc_ip_handling_policy.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/constants.h"
......@@ -58,11 +59,6 @@ void SetDefaultPrefs(content::WebPreferences& web) {
command_line->HasSwitch(switches::kImageShrinkStandaloneToFit);
web.text_areas_are_resizable =
!command_line->HasSwitch(switches::kDisableTextAreaResize);
web.asynchronous_spell_checking_enabled = true;
// Auto-correct does not work in combination with the unified text checker.
web.unified_textchecker_enabled =
!command_line->HasSwitch(switches::kEnableSpellingAutoCorrect);
}
// Chrome preferences.
......@@ -346,10 +342,15 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
prefs::kEnableDoNotTrack,
false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#if defined(ENABLE_WEBRTC)
// TODO(guoweis): Remove next 2 options at M50.
registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);