Update to Chromium revision c78c0ad7 (#363565)

This commit is contained in:
Marshall Greenblatt
2015-12-09 11:10:16 -05:00
parent 535c4fbc30
commit 5dec0c5f57
62 changed files with 534 additions and 478 deletions

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{ {
'chromium_checkout': '304f01a1e1f7ebeb7d637f847469c90ba008b86d', 'chromium_checkout': 'c78c0ad7cca1b37761b488e9499d619b21c8016d',
} }

View File

@ -871,6 +871,9 @@
# Generate chrome/common/safe_browsing/csd.pb.h required by # Generate chrome/common/safe_browsing/csd.pb.h required by
# zip_analyzer_results.h via chrome_utility_messages.h # zip_analyzer_results.h via chrome_utility_messages.h
'<(DEPTH)/chrome/chrome.gyp:safe_browsing_proto', '<(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 # Generate chrome/common/chrome_version.h required by
# chrome/common/chrome_contants.cc # chrome/common/chrome_contants.cc
'<(DEPTH)/chrome/common_constants.gyp:version_header', '<(DEPTH)/chrome/common_constants.gyp:version_header',
@ -878,7 +881,7 @@
'<(DEPTH)/components/components.gyp:component_updater', '<(DEPTH)/components/components.gyp:component_updater',
'<(DEPTH)/components/components.gyp:content_settings_core_browser', '<(DEPTH)/components/components.gyp:content_settings_core_browser',
'<(DEPTH)/components/components.gyp:content_settings_core_common', '<(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:crx_file',
'<(DEPTH)/components/components.gyp:data_use_measurement_core', '<(DEPTH)/components/components.gyp:data_use_measurement_core',
'<(DEPTH)/components/components.gyp:devtools_discovery', '<(DEPTH)/components/components.gyp:devtools_discovery',

View File

@ -364,6 +364,7 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
url_request_getter_ = new CefURLRequestContextGetterImpl( url_request_getter_ = new CefURLRequestContextGetterImpl(
settings_, settings_,
GetPrefs(),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE),
protocol_handlers, protocol_handlers,

View File

@ -209,7 +209,7 @@ class CefBrowserPlatformDelegate {
protected: protected:
// Allow deletion via scoped_ptr only. // Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<CefBrowserPlatformDelegate>; friend std::default_delete<CefBrowserPlatformDelegate>;
CefBrowserPlatformDelegate(); CefBrowserPlatformDelegate();
virtual ~CefBrowserPlatformDelegate(); virtual ~CefBrowserPlatformDelegate();

View File

@ -203,7 +203,8 @@ StatusTray* ChromeBrowserProcessStub::status_tray() {
return NULL; return NULL;
} }
SafeBrowsingService* ChromeBrowserProcessStub::safe_browsing_service() { safe_browsing::SafeBrowsingService*
ChromeBrowserProcessStub::safe_browsing_service() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return NULL; return NULL;
} }

View File

@ -73,7 +73,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
void set_background_mode_manager_for_test( void set_background_mode_manager_for_test(
scoped_ptr<BackgroundModeManager> manager) override; scoped_ptr<BackgroundModeManager> manager) override;
StatusTray* status_tray() override; StatusTray* status_tray() override;
SafeBrowsingService* safe_browsing_service() override; safe_browsing::SafeBrowsingService* safe_browsing_service() override;
safe_browsing::ClientSideDetectionService* safe_browsing::ClientSideDetectionService*
safe_browsing_detection_service() override; safe_browsing_detection_service() override;

View File

@ -594,7 +594,6 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kDisableScrollBounce, switches::kDisableScrollBounce,
switches::kDisableSpellChecking, switches::kDisableSpellChecking,
switches::kEnableSpeechInput, switches::kEnableSpeechInput,
switches::kEnableSpellingAutoCorrect,
switches::kEnableSystemFlash, switches::kEnableSystemFlash,
switches::kPpapiFlashArgs, switches::kPpapiFlashArgs,
switches::kPpapiFlashPath, switches::kPpapiFlashPath,
@ -677,8 +676,7 @@ content::SpeechRecognitionManagerDelegate*
} }
void CefContentBrowserClient::AllowCertificateError( void CefContentBrowserClient::AllowCertificateError(
int render_process_id, content::WebContents* web_contents,
int render_frame_id,
int cert_error, int cert_error,
const net::SSLInfo& ssl_info, const net::SSLInfo& ssl_info,
const GURL& request_url, const GURL& request_url,
@ -699,8 +697,7 @@ void CefContentBrowserClient::AllowCertificateError(
} }
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForFrame(render_process_id, CefBrowserHostImpl::GetBrowserForContents(web_contents);
render_frame_id);
if (!browser.get()) if (!browser.get())
return; return;
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
@ -846,7 +843,8 @@ CefContentBrowserClient::CreateThrottlesForNavigation(
new navigation_interception::InterceptNavigationThrottle( new navigation_interception::InterceptNavigationThrottle(
navigation_handle, navigation_handle,
base::Bind(&NavigationOnUIThread, is_main_frame, frame_id, base::Bind(&NavigationOnUIThread, is_main_frame, frame_id,
parent_frame_id)); parent_frame_id),
true);
throttles.push_back(throttle); throttles.push_back(throttle);
return throttles.Pass(); return throttles.Pass();
@ -882,18 +880,14 @@ const wchar_t* CefContentBrowserClient::GetResourceDllName() {
return file_path; return file_path;
} }
void CefContentBrowserClient::PreSpawnRenderer( bool CefContentBrowserClient::PreSpawnRenderer(
sandbox::TargetPolicy* policy, sandbox::TargetPolicy* policy) {
bool* success) {
// Flash requires this permission to play video files. // Flash requires this permission to play video files.
sandbox::ResultCode result = policy->AddRule( sandbox::ResultCode result = policy->AddRule(
sandbox::TargetPolicy::SUBSYS_HANDLES, sandbox::TargetPolicy::SUBSYS_HANDLES,
sandbox::TargetPolicy::HANDLES_DUP_ANY, sandbox::TargetPolicy::HANDLES_DUP_ANY,
L"File"); L"File");
if (result != sandbox::SBOX_ALL_OK) { return result == sandbox::SBOX_ALL_OK;
*success = false;
return;
}
} }
#endif // defined(OS_WIN) #endif // defined(OS_WIN)

View File

@ -65,8 +65,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::SpeechRecognitionManagerDelegate* content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override; CreateSpeechRecognitionManagerDelegate() override;
void AllowCertificateError( void AllowCertificateError(
int render_process_id, content::WebContents* web_contents,
int render_frame_id,
int cert_error, int cert_error,
const net::SSLInfo& ssl_info, const net::SSLInfo& ssl_info,
const GURL& request_url, const GURL& request_url,
@ -117,7 +116,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
#if defined(OS_WIN) #if defined(OS_WIN)
const wchar_t* GetResourceDllName() override; const wchar_t* GetResourceDllName() override;
void PreSpawnRenderer(sandbox::TargetPolicy* policy, bool* success) override; bool PreSpawnRenderer(sandbox::TargetPolicy* policy) override;
#endif #endif
// Perform browser process registration for the custom scheme. // Perform browser process registration for the custom scheme.

View File

@ -10,6 +10,7 @@
#include "libcef/browser/content_browser_client.h" #include "libcef/browser/content_browser_client.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/net/network_delegate.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/common/time_util.h" #include "libcef/common/time_util.h"
@ -556,7 +557,8 @@ void CefCookieManagerImpl::SetCookieInternal(
cookie.secure ? true : false, cookie.secure ? true : false,
cookie.httponly ? true : false, cookie.httponly ? true : false,
false, // First-party only. false, // First-party only.
false, // Enforces prefixes. CefNetworkDelegate::AreExperimentalCookieFeaturesEnabled(),
CefNetworkDelegate::AreStrictSecureCookiesEnabled(),
net::COOKIE_PRIORITY_DEFAULT, net::COOKIE_PRIORITY_DEFAULT,
base::Bind(SetCookieCallbackImpl, callback)); base::Bind(SetCookieCallbackImpl, callback));
} }

View File

@ -41,7 +41,7 @@ class CefFileDialogRunner {
protected: protected:
// Allow deletion via scoped_ptr only. // Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<CefFileDialogRunner>; friend std::default_delete<CefFileDialogRunner>;
CefFileDialogRunner() {} CefFileDialogRunner() {}
virtual ~CefFileDialogRunner() {} virtual ~CefFileDialogRunner() {}

View File

@ -90,7 +90,7 @@ class CefFrameHostImpl : public CefFrame {
int64 parent_frame_id_; int64 parent_frame_id_;
IMPLEMENT_REFCOUNTING(CefFrameHostImpl); IMPLEMENT_REFCOUNTING(CefFrameHostImpl);
DISALLOW_EVIL_CONSTRUCTORS(CefFrameHostImpl); DISALLOW_COPY_AND_ASSIGN(CefFrameHostImpl);
}; };
#endif // CEF_LIBCEF_BROWSER_FRAME_HOST_IMPL_H_ #endif // CEF_LIBCEF_BROWSER_FRAME_HOST_IMPL_H_

View File

@ -34,7 +34,7 @@ class CefJavaScriptDialogRunner {
protected: protected:
// Allow deletion via scoped_ptr only. // Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<CefJavaScriptDialogRunner>; friend std::default_delete<CefJavaScriptDialogRunner>;
CefJavaScriptDialogRunner() {} CefJavaScriptDialogRunner() {}
virtual ~CefJavaScriptDialogRunner() {} virtual ~CefJavaScriptDialogRunner() {}

View File

@ -29,7 +29,7 @@ class CefMenuRunner {
protected: protected:
// Allow deletion via scoped_ptr only. // Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<CefMenuRunner>; friend std::default_delete<CefMenuRunner>;
CefMenuRunner() {} CefMenuRunner() {}
virtual ~CefMenuRunner() {} virtual ~CefMenuRunner() {}

View File

@ -139,7 +139,8 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
// Likewise, the X server needs to know this window's pid so it knows which // Likewise, the X server needs to know this window's pid so it knows which
// program to kill if the window hangs. // program to kill if the window hangs.
// XChangeProperty() expects "pid" to be long. // 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(); long pid = getpid();
XChangeProperty(xdisplay_, XChangeProperty(xdisplay_,
xwindow_, xwindow_,

View File

@ -14,6 +14,10 @@
#include "libcef/common/request_impl.h" #include "libcef/common/request_impl.h"
#include "libcef/common/response_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/base/net_errors.h"
#include "net/filter/filter.h" #include "net/filter/filter.h"
#include "net/http/http_util.h" #include "net/http/http_util.h"
@ -225,6 +229,27 @@ CefNetworkDelegate::CefNetworkDelegate() {
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( int CefNetworkDelegate::OnBeforeURLRequest(
net::URLRequest* request, net::URLRequest* request,
const net::CompletionCallback& callback, const net::CompletionCallback& callback,
@ -387,6 +412,14 @@ bool CefNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
return true; return true;
} }
bool CefNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
return AreExperimentalCookieFeaturesEnabled();
}
bool CefNetworkDelegate::OnAreStrictSecureCookiesEnabled() const {
return AreStrictSecureCookiesEnabled();
}
net::Filter* CefNetworkDelegate::SetupFilter(net::URLRequest* request, net::Filter* CefNetworkDelegate::SetupFilter(net::URLRequest* request,
net::Filter* filter_list) { net::Filter* filter_list) {
CefRefPtr<CefResponseFilter> cef_filter; CefRefPtr<CefResponseFilter> cef_filter;

View File

@ -15,6 +15,11 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
CefNetworkDelegate(); CefNetworkDelegate();
~CefNetworkDelegate() override; ~CefNetworkDelegate() override;
// Match the logic from ChromeNetworkDelegate and
// RenderFrameMessageFilter::OnSetCookie.
static bool AreExperimentalCookieFeaturesEnabled();
static bool AreStrictSecureCookiesEnabled();
private: private:
// net::NetworkDelegate methods. // net::NetworkDelegate methods.
int OnBeforeURLRequest(net::URLRequest* request, int OnBeforeURLRequest(net::URLRequest* request,
@ -28,6 +33,8 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
void OnCompleted(net::URLRequest* request, bool started) override; void OnCompleted(net::URLRequest* request, bool started) override;
bool OnCanAccessFile(const net::URLRequest& request, bool OnCanAccessFile(const net::URLRequest& request,
const base::FilePath& path) const override; const base::FilePath& path) const override;
bool OnAreExperimentalCookieFeaturesEnabled() const override;
bool OnAreStrictSecureCookiesEnabled() const override;
net::Filter* SetupFilter(net::URLRequest* request, net::Filter* SetupFilter(net::URLRequest* request,
net::Filter* filter_list) override; net::Filter* filter_list) override;

View File

@ -106,25 +106,23 @@ class CefResourceRequestJobCallback : public CefCallback {
if (job_->has_response_started() && if (job_->has_response_started() &&
job_->GetStatus().is_io_pending()) { job_->GetStatus().is_io_pending()) {
// Read the bytes. They should be available but, if not, wait again. // Read the bytes. They should be available but, if not, wait again.
int bytes_read = 0; int bytes_read = job_->ReadRawData(dest_, dest_size_);
if (job_->ReadRawData(dest_, dest_size_, &bytes_read)) { 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 // Must clear the members here because they may be reset as a result
// of calling NotifyReadComplete. // of calling ReadRawDataComplete.
dest_size_ = 0; dest_size_ = 0;
dest_ = NULL; dest_ = NULL;
// Clear the IO_PENDING status.
job_->SetStatus(URLRequestStatus());
// Notify about the available bytes. If bytes_read > 0 then // Notify about the available bytes. If bytes_read > 0 then
// ReadRawData may be called from URLRequest::Read. If bytes_read == 0 // ReadRawData may be called from URLRequest::Read. If bytes_read == 0
// then Kill will be called from the URLRequest destructor. // then Kill will be called from the URLRequest destructor.
job_->NotifyReadComplete(bytes_read); job_->ReadRawDataComplete(bytes_read);
} else if (!job_->GetStatus().is_io_pending()) { } else {
// Failed due to an error. // Failed due to an error.
NOTREACHED() << NOTREACHED() << "ReadRawData returned error " << bytes_read;
"ReadRawData returned false without setting IO as pending"; job_->ReadRawDataComplete(bytes_read);
job_->NotifyDone(URLRequestStatus());
Detach(); Detach();
} }
} }
@ -220,28 +218,19 @@ void CefResourceRequestJob::Kill() {
// This method will be called by URLRequestJob::Read and our callback. // This method will be called by URLRequestJob::Read and our callback.
// It can indicate the following states: // It can indicate the following states:
// 1. If the request is complete set |bytes_read| == 0 and return true. The // 1. Return ERR_IO_PENDING, and call ReadRawDataComplete when the read
// caller is then responsible for calling NotifyReadComplete. ReadRawData // completes in any way, or
// should not be called again. // 2. Return a count of bytes read >= 0, indicating synchronous success, or
// 2. If data is available synchronously set |bytes_read| > 0 and return true. // 3. Return another error code < 0, indicating synchronous failure.
// The caller is then responsible for calling NotifyReadComplete. ReadRawData int CefResourceRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size) {
// 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) {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
DCHECK_NE(dest_size, 0); DCHECK_NE(dest_size, 0);
DCHECK(bytes_read);
if (remaining_bytes_ == 0) { if (remaining_bytes_ == 0) {
// No more data to read. // No more data to read.
*bytes_read = 0;
DoneWithRequest(); DoneWithRequest();
return true; return 0;
} else if (remaining_bytes_ > 0 && remaining_bytes_ < dest_size) { } else if (remaining_bytes_ > 0 && remaining_bytes_ < dest_size) {
// The handler knows the content size beforehand. // The handler knows the content size beforehand.
dest_size = static_cast<int>(remaining_bytes_); 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. // 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()); callback_.get());
if (!rv) { if (!rv) {
// The handler has indicated completion of the request. // The handler has indicated completion of the request.
*bytes_read = 0;
DoneWithRequest(); DoneWithRequest();
return true; return 0;
} else if (*bytes_read == 0) { } else if (bytes_read == 0) {
// Continue reading asynchronously. May happen multiple times in a row so // Continue reading asynchronously. May happen multiple times in a row so
// only set IO pending the first time. // only set destination members the first time.
if (!GetStatus().is_io_pending()) { if (!GetStatus().is_io_pending())
SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
callback_->SetDestination(dest, dest_size); callback_->SetDestination(dest, dest_size);
} return net::ERR_IO_PENDING;
return false; } else if (bytes_read > dest_size) {
} else if (*bytes_read > dest_size) {
// Normalize the return value. // Normalize the return value.
*bytes_read = dest_size; bytes_read = dest_size;
} }
sent_bytes_ += *bytes_read; sent_bytes_ += bytes_read;
if (remaining_bytes_ > 0) if (remaining_bytes_ > 0)
remaining_bytes_ -= *bytes_read; remaining_bytes_ -= bytes_read;
// Continue calling this method. // Continue calling this method.
return true; return bytes_read;
} }
void CefResourceRequestJob::GetResponseInfo(net::HttpResponseInfo* info) { void CefResourceRequestJob::GetResponseInfo(net::HttpResponseInfo* info) {

View File

@ -33,7 +33,7 @@ class CefResourceRequestJob : public net::URLRequestJob {
// net::URLRequestJob methods. // net::URLRequestJob methods.
void Start() override; void Start() override;
void Kill() 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 GetResponseInfo(net::HttpResponseInfo* info) override;
void GetLoadTimingInfo( void GetLoadTimingInfo(
net::LoadTimingInfo* load_timing_info) const override; net::LoadTimingInfo* load_timing_info) const override;

View File

@ -21,11 +21,13 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/prefs/pref_service.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "base/threading/worker_pool.h" #include "base/threading/worker_pool.h"
#include "chrome/browser/net/proxy_service_factory.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/browser/browser_thread.h"
#include "content/public/common/content_client.h" #include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
@ -36,6 +38,7 @@
#include "net/dns/host_resolver.h" #include "net/dns/host_resolver.h"
#include "net/ftp/ftp_network_layer.h" #include "net/ftp/ftp_network_layer.h"
#include "net/http/http_auth_handler_factory.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_cache.h"
#include "net/http/http_server_properties_impl.h" #include "net/http/http_server_properties_impl.h"
#include "net/http/http_util.h" #include "net/http/http_util.h"
@ -97,6 +100,7 @@ class CefHttpUserAgentSettings : public net::HttpUserAgentSettings {
CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl( CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
const CefRequestContextSettings& settings, const CefRequestContextSettings& settings,
PrefService* pref_service,
base::MessageLoop* io_loop, base::MessageLoop* io_loop,
base::MessageLoop* file_loop, base::MessageLoop* file_loop,
content::ProtocolHandlerMap* protocol_handlers, content::ProtocolHandlerMap* protocol_handlers,
@ -111,6 +115,10 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
std::swap(protocol_handlers_, *protocol_handlers); std::swap(protocol_handlers_, *protocol_handlers);
#if defined(OS_POSIX) && !defined(OS_ANDROID)
gsapi_library_name_ = pref_service->GetString(prefs::kGSSAPILibraryName);
#endif
} }
CefURLRequestContextGetterImpl::~CefURLRequestContextGetterImpl() { CefURLRequestContextGetterImpl::~CefURLRequestContextGetterImpl() {
@ -172,24 +180,23 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); 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; std::vector<std::string> supported_schemes;
supported_schemes.push_back("basic"); supported_schemes.push_back("basic");
supported_schemes.push_back("digest"); supported_schemes.push_back("digest");
supported_schemes.push_back("ntlm"); supported_schemes.push_back("ntlm");
supported_schemes.push_back("negotiate"); 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( net::HttpAuthHandlerRegistryFactory::Create(
supported_schemes, http_auth_preferences_.get(),
url_security_manager_.get(), url_request_context_->host_resolver()));
url_request_context_->host_resolver(),
std::string(),
std::string(),
false,
false)));
storage_->set_http_server_properties( storage_->set_http_server_properties(
make_scoped_ptr<net::HttpServerProperties>( make_scoped_ptr<net::HttpServerProperties>(
new net::HttpServerPropertiesImpl)); new net::HttpServerPropertiesImpl));

View File

@ -21,6 +21,8 @@
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
#include "net/url_request/url_request_job_factory.h" #include "net/url_request/url_request_job_factory.h"
class PrefService;
namespace base { namespace base {
class MessageLoop; class MessageLoop;
} }
@ -28,11 +30,11 @@ class MessageLoop;
namespace net { namespace net {
class CookieMonster; class CookieMonster;
class FtpTransactionFactory; class FtpTransactionFactory;
class HttpAuthPreferences;
class ProxyConfigService; class ProxyConfigService;
class URLRequestContextStorage; class URLRequestContextStorage;
class URLRequestJobFactory; class URLRequestJobFactory;
class URLRequestJobFactoryImpl; class URLRequestJobFactoryImpl;
class URLSecurityManager;
} }
// Isolated URLRequestContextGetter implementation. Life span is primarily // Isolated URLRequestContextGetter implementation. Life span is primarily
@ -43,6 +45,7 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
public: public:
CefURLRequestContextGetterImpl( CefURLRequestContextGetterImpl(
const CefRequestContextSettings& settings, const CefRequestContextSettings& settings,
PrefService* pref_service,
base::MessageLoop* io_loop, base::MessageLoop* io_loop,
base::MessageLoop* file_loop, base::MessageLoop* file_loop,
content::ProtocolHandlerMap* protocol_handlers, content::ProtocolHandlerMap* protocol_handlers,
@ -80,11 +83,15 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
base::MessageLoop* io_loop_; base::MessageLoop* io_loop_;
base::MessageLoop* file_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::ProxyConfigService> proxy_config_service_;
scoped_ptr<net::URLRequestContextStorage> storage_; scoped_ptr<net::URLRequestContextStorage> storage_;
scoped_ptr<net::HttpAuthPreferences> http_auth_preferences_;
scoped_ptr<CefURLRequestContextImpl> url_request_context_; scoped_ptr<CefURLRequestContextImpl> url_request_context_;
scoped_ptr<CefURLRequestManager> url_request_manager_; scoped_ptr<CefURLRequestManager> url_request_manager_;
scoped_ptr<net::URLSecurityManager> url_security_manager_;
scoped_ptr<net::FtpTransactionFactory> ftp_transaction_factory_; scoped_ptr<net::FtpTransactionFactory> ftp_transaction_factory_;
content::ProtocolHandlerMap protocol_handlers_; content::ProtocolHandlerMap protocol_handlers_;
content::URLRequestInterceptorScopedVector request_interceptors_; content::URLRequestInterceptorScopedVector request_interceptors_;

View File

@ -147,7 +147,7 @@ class CefOriginWhitelistManager {
typedef std::vector<Cef_CrossOriginWhiteListEntry_Params> OriginList; typedef std::vector<Cef_CrossOriginWhiteListEntry_Params> OriginList;
OriginList origin_list_; OriginList origin_list_;
DISALLOW_EVIL_CONSTRUCTORS(CefOriginWhitelistManager); DISALLOW_COPY_AND_ASSIGN(CefOriginWhitelistManager);
}; };
base::LazyInstance<CefOriginWhitelistManager> g_manager = base::LazyInstance<CefOriginWhitelistManager> g_manager =

View File

@ -293,7 +293,7 @@ class CefCopyFrameGenerator {
content::GLHelper* gl_helper = content::GLHelper* gl_helper =
content::ImageTransportFactory::GetInstance()->GetGLHelper(); content::ImageTransportFactory::GetInstance()->GetGLHelper();
if (gl_helper) if (gl_helper)
sync_token = gpu::SyncToken(gl_helper->InsertSyncPoint()); gl_helper->GenerateSyncToken(&sync_token);
} }
const bool lost_resource = !sync_token.HasData(); const bool lost_resource = !sync_token.HasData();
release_callback->Run(sync_token, lost_resource); release_callback->Run(sync_token, lost_resource);
@ -658,12 +658,8 @@ void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame(
// The compositor will draw directly to the SoftwareOutputDevice which // The compositor will draw directly to the SoftwareOutputDevice which
// then calls OnPaint. // then calls OnPaint.
delegated_frame_host_->SwapDelegatedFrame( delegated_frame_host_->SwapDelegatedFrame(output_surface_id,
output_surface_id, frame.Pass());
frame->delegated_frame_data.Pass(),
frame->metadata.device_scale_factor,
frame->metadata.latency_info,
&frame->metadata.satisfies_sequences);
} else { } else {
if (!copy_frame_generator_.get()) { if (!copy_frame_generator_.get()) {
copy_frame_generator_.reset( copy_frame_generator_.reset(
@ -673,18 +669,14 @@ void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame(
// Determine the damage rectangle for the current frame. This is the same // Determine the damage rectangle for the current frame. This is the same
// calculation that SwapDelegatedFrame uses. // calculation that SwapDelegatedFrame uses.
cc::RenderPass* root_pass = 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::Size frame_size = root_pass->output_rect.size();
gfx::Rect damage_rect = gfx::Rect damage_rect =
gfx::ToEnclosingRect(gfx::RectF(root_pass->damage_rect)); gfx::ToEnclosingRect(gfx::RectF(root_pass->damage_rect));
damage_rect.Intersect(gfx::Rect(frame_size)); damage_rect.Intersect(gfx::Rect(frame_size));
delegated_frame_host_->SwapDelegatedFrame( delegated_frame_host_->SwapDelegatedFrame(output_surface_id,
output_surface_id, frame.Pass());
frame->delegated_frame_data.Pass(),
frame->metadata.device_scale_factor,
frame->metadata.latency_info,
&frame->metadata.satisfies_sequences);
// Request a copy of the last compositor frame which will eventually call // Request a copy of the last compositor frame which will eventually call
// OnPaint asynchronously. // OnPaint asynchronously.
@ -866,7 +858,7 @@ void CefRenderWidgetHostViewOSR::CopyFromCompositingSurface(
void CefRenderWidgetHostViewOSR::CopyFromCompositingSurfaceToVideoFrame( void CefRenderWidgetHostViewOSR::CopyFromCompositingSurfaceToVideoFrame(
const gfx::Rect& src_subrect, const gfx::Rect& src_subrect,
const scoped_refptr<media::VideoFrame>& target, 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( delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame(
src_subrect, target, callback); src_subrect, target, callback);
} }

View File

@ -159,7 +159,7 @@ class CefRenderWidgetHostViewOSR
void CopyFromCompositingSurfaceToVideoFrame( void CopyFromCompositingSurfaceToVideoFrame(
const gfx::Rect& src_subrect, const gfx::Rect& src_subrect,
const scoped_refptr<media::VideoFrame>& target, 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; bool CanCopyToVideoFrame() const override;
void BeginFrameSubscription( void BeginFrameSubscription(
scoped_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber) scoped_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber)

View File

@ -147,10 +147,6 @@ scoped_ptr<PrefService> CreatePrefService(const base::FilePath& pref_path) {
registry->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService, registry->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService,
command_line->HasSwitch(switches::kEnableSpellingService)); command_line->HasSwitch(switches::kEnableSpellingService));
registry->RegisterBooleanPref(prefs::kEnableContinuousSpellcheck, true); 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. // Pepper flash preferences.
// Based on DeviceIDFetcher::RegisterProfilePrefs. // 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::kPluginsAllowOutdated, false);
registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, 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)) { if (command_line->HasSwitch(switches::kEnablePreferenceTesting)) {
// Preferences used with unit tests. // Preferences used with unit tests.
registry->RegisterBooleanPref("test.bool", true); registry->RegisterBooleanPref("test.bool", true);

View File

@ -31,6 +31,7 @@
#include "content/public/browser/site_instance.h" #include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/common/web_preferences.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/extension_registry.h"
#include "extensions/browser/view_type_utils.h" #include "extensions/browser/view_type_utils.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
@ -58,11 +59,6 @@ void SetDefaultPrefs(content::WebPreferences& web) {
command_line->HasSwitch(switches::kImageShrinkStandaloneToFit); command_line->HasSwitch(switches::kImageShrinkStandaloneToFit);
web.text_areas_are_resizable = web.text_areas_are_resizable =
!command_line->HasSwitch(switches::kDisableTextAreaResize); !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. // Chrome preferences.
@ -346,10 +342,15 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
prefs::kEnableDoNotTrack, prefs::kEnableDoNotTrack,
false, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#if defined(ENABLE_WEBRTC) #if defined(ENABLE_WEBRTC)
// TODO(guoweis): Remove next 2 options at M50.
registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true); registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true); registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true);
registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy,
content::kWebRTCIPHandlingDefault);
#endif #endif
#if !defined(OS_MACOSX) #if !defined(OS_MACOSX)
registry->RegisterBooleanPref(prefs::kFullscreenAllowed, true); registry->RegisterBooleanPref(prefs::kFullscreenAllowed, true);
#endif #endif

View File

@ -37,7 +37,7 @@ CefTraceSubscriber::CefTraceSubscriber()
CefTraceSubscriber::~CefTraceSubscriber() { CefTraceSubscriber::~CefTraceSubscriber() {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
if (collecting_trace_data_) if (collecting_trace_data_)
TracingController::GetInstance()->DisableRecording(NULL); TracingController::GetInstance()->StopTracing(NULL);
} }
bool CefTraceSubscriber::BeginTracing( bool CefTraceSubscriber::BeginTracing(
@ -50,13 +50,13 @@ bool CefTraceSubscriber::BeginTracing(
collecting_trace_data_ = true; collecting_trace_data_ = true;
TracingController::EnableRecordingDoneCallback done_callback; TracingController::StartTracingDoneCallback done_callback;
if (callback.get()) { if (callback.get()) {
done_callback = done_callback =
base::Bind(&CefCompletionCallback::OnComplete, callback.get()); base::Bind(&CefCompletionCallback::OnComplete, callback.get());
} }
TracingController::GetInstance()->EnableRecording( TracingController::GetInstance()->StartTracing(
base::trace_event::TraceConfig(categories, ""), base::trace_event::TraceConfig(categories, ""),
done_callback); done_callback);
return true; return true;
@ -73,7 +73,7 @@ bool CefTraceSubscriber::EndTracing(
if (!callback.get()) { if (!callback.get()) {
// Discard the trace data. // Discard the trace data.
collecting_trace_data_ = false; collecting_trace_data_ = false;
TracingController::GetInstance()->DisableRecording(NULL); TracingController::GetInstance()->StopTracing(NULL);
return true; return true;
} }
@ -91,7 +91,7 @@ bool CefTraceSubscriber::EndTracing(
base::Bind(&CefTraceSubscriber::OnTracingFileResult, base::Bind(&CefTraceSubscriber::OnTracingFileResult,
weak_factory_.GetWeakPtr(), callback, tracing_file); weak_factory_.GetWeakPtr(), callback, tracing_file);
TracingController::GetInstance()->DisableRecording( TracingController::GetInstance()->StopTracing(
TracingController::CreateFileSink(tracing_file, result_callback)); TracingController::CreateFileSink(tracing_file, result_callback));
return true; return true;
} }

View File

@ -213,6 +213,9 @@ void SetHeaderMap(const CefRequest::HeaderMap& map,
} }
} }
// Type used in UploadDataStream.
typedef std::vector<scoped_ptr<net::UploadElementReader>> UploadElementReaders;
} // namespace } // namespace
@ -983,11 +986,9 @@ void CefPostDataImpl::Set(const net::UploadDataStream& data_stream) {
CefRefPtr<CefPostDataElement> postelem; CefRefPtr<CefPostDataElement> postelem;
const ScopedVector<net::UploadElementReader>* elements = const UploadElementReaders* elements = data_stream.GetElementReaders();
data_stream.GetElementReaders();
if (elements) { if (elements) {
ScopedVector<net::UploadElementReader>::const_iterator it = UploadElementReaders::const_iterator it = elements->begin();
elements->begin();
for (; it != elements->end(); ++it) { for (; it != elements->end(); ++it) {
postelem = CefPostDataElement::Create(); postelem = CefPostDataElement::Create();
static_cast<CefPostDataElementImpl*>(postelem.get())->Set(**it); static_cast<CefPostDataElementImpl*>(postelem.get())->Set(**it);
@ -1015,14 +1016,14 @@ void CefPostDataImpl::Get(net::UploadData& data) const {
net::UploadDataStream* CefPostDataImpl::Get() const { net::UploadDataStream* CefPostDataImpl::Get() const {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
ScopedVector<net::UploadElementReader> element_readers; UploadElementReaders element_readers;
ElementVector::const_iterator it = elements_.begin(); ElementVector::const_iterator it = elements_.begin();
for (; it != elements_.end(); ++it) { for (; it != elements_.end(); ++it) {
element_readers.push_back( element_readers.push_back(make_scoped_ptr(
static_cast<CefPostDataElementImpl*>(it->get())->Get()); static_cast<CefPostDataElementImpl*>(it->get())->Get()));
} }
return new net::ElementsUploadDataStream(element_readers.Pass(), 0); return new net::ElementsUploadDataStream(std::move(element_readers), 0);
} }
void CefPostDataImpl::Set(const blink::WebHTTPBody& data) { void CefPostDataImpl::Set(const blink::WebHTTPBody& data) {

View File

@ -63,6 +63,7 @@
#include "extensions/renderer/renderer_extension_registry.h" #include "extensions/renderer/renderer_extension_registry.h"
#include "ipc/ipc_sync_channel.h" #include "ipc/ipc_sync_channel.h"
#include "media/base/media.h" #include "media/base/media.h"
#include "printing/print_settings.h"
#include "third_party/WebKit/public/platform/WebPrerenderingSupport.h" #include "third_party/WebKit/public/platform/WebPrerenderingSupport.h"
#include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURL.h"
@ -175,6 +176,9 @@ CefContentRendererClient::CefContentRendererClient()
extensions::ExtensionsRendererClient::Set( extensions::ExtensionsRendererClient::Set(
extensions_renderer_client_.get()); extensions_renderer_client_.get());
} }
#if defined(ENABLE_PRINTING)
printing::SetAgent(CefContentClient::Get()->GetUserAgent());
#endif
} }
CefContentRendererClient::~CefContentRendererClient() { CefContentRendererClient::~CefContentRendererClient() {

View File

@ -64,7 +64,7 @@ class CefFrameImpl : public CefFrame {
int64 frame_id_; int64 frame_id_;
IMPLEMENT_REFCOUNTING(CefFrameImpl); IMPLEMENT_REFCOUNTING(CefFrameImpl);
DISALLOW_EVIL_CONSTRUCTORS(CefFrameImpl); DISALLOW_COPY_AND_ASSIGN(CefFrameImpl);
}; };
#endif // CEF_LIBCEF_RENDERER_FRAME_IMPL_H_ #endif // CEF_LIBCEF_RENDERER_FRAME_IMPL_H_

View File

@ -49,7 +49,7 @@ bool CefRenderMessageFilter::OnMessageReceived(const IPC::Message& message) {
} }
void CefRenderMessageFilter::OnDevToolsAgentAttach( void CefRenderMessageFilter::OnDevToolsAgentAttach(
const std::string& host_id) { const std::string& host_id, int session_id) {
CEF_POST_TASK_RT( CEF_POST_TASK_RT(
base::Bind(&CefRenderMessageFilter::OnDevToolsAgentAttach_RT, this)); base::Bind(&CefRenderMessageFilter::OnDevToolsAgentAttach_RT, this));
} }

View File

@ -23,7 +23,7 @@ class CefRenderMessageFilter : public IPC::MessageFilter {
private: private:
// Message handlers called on the IO thread. // Message handlers called on the IO thread.
void OnDevToolsAgentAttach(const std::string& host_id); void OnDevToolsAgentAttach(const std::string& host_id, int session_id);
void OnDevToolsAgentDetach(int32 routing_id); void OnDevToolsAgentDetach(int32 routing_id);
void OnDevToolsAgentAttach_RT(); void OnDevToolsAgentAttach_RT();

View File

@ -51,6 +51,45 @@ static const char kCefContextState[] = "Cef::ContextState";
void MessageListenerCallbackImpl(v8::Handle<v8::Message> message, void MessageListenerCallbackImpl(v8::Handle<v8::Message> message,
v8::Handle<v8::Value> data); v8::Handle<v8::Value> data);
// The following *Private functions are convenience wrappers for methods on
// v8::Object with the corresponding names.
// Based on extensions/renderer/object_backed_native_handler.cc.
void SetPrivate(v8::Local<v8::Context> context,
v8::Local<v8::Object> obj,
const char* key,
v8::Local<v8::Value> value) {
v8::Isolate* isolate = context->GetIsolate();
obj->SetPrivate(context,
v8::Private::ForApi(isolate,
v8::String::NewFromUtf8(isolate, key)),
value)
.FromJust();
}
bool GetPrivate(v8::Local<v8::Context> context,
v8::Local<v8::Object> obj,
const char* key,
v8::Local<v8::Value>* result) {
v8::Isolate* isolate = context->GetIsolate();
return obj->GetPrivate(context,
v8::Private::ForApi(
isolate,
v8::String::NewFromUtf8(isolate, key)))
.ToLocal(result);
}
void DeletePrivate(v8::Local<v8::Context> context,
v8::Local<v8::Object> obj,
const char* key) {
v8::Isolate* isolate = context->GetIsolate();
obj->DeletePrivate(context,
v8::Private::ForApi(
isolate,
v8::String::NewFromUtf8(isolate, key)))
.FromJust();
}
// Manages memory and state information associated with a single Isolate. // Manages memory and state information associated with a single Isolate.
class CefV8IsolateManager { class CefV8IsolateManager {
public: public:
@ -108,18 +147,17 @@ class CefV8IsolateManager {
return state; return state;
} else { } else {
v8::Local<v8::String> key =
v8::String::NewFromUtf8(isolate_, kCefContextState);
v8::Local<v8::Object> object = context->Global(); v8::Local<v8::Object> object = context->Global();
v8::Local<v8::Value> value = object->GetHiddenValue(key);
if (!value.IsEmpty()) { v8::Local<v8::Value> value;
if (GetPrivate(context, object, kCefContextState, &value)) {
return static_cast<CefV8ContextState*>( return static_cast<CefV8ContextState*>(
v8::External::Cast(*value)->Value()); v8::External::Cast(*value)->Value());
} }
scoped_refptr<CefV8ContextState> state = new CefV8ContextState(); scoped_refptr<CefV8ContextState> state = new CefV8ContextState();
object->SetHiddenValue(key, v8::External::New(isolate_, state.get())); SetPrivate(context, object, kCefContextState,
v8::External::New(isolate_, state.get()));
// Reference will be released in ReleaseContext. // Reference will be released in ReleaseContext.
state->AddRef(); state->AddRef();
@ -143,20 +181,19 @@ class CefV8IsolateManager {
context_map_.erase(it); context_map_.erase(it);
} }
} else { } else {
v8::Local<v8::String> key =
v8::String::NewFromUtf8(isolate_, kCefContextState);
v8::Local<v8::Object> object = context->Global(); v8::Local<v8::Object> object = context->Global();
v8::Local<v8::Value> value = object->GetHiddenValue(key);
if (value.IsEmpty())
return;
scoped_refptr<CefV8ContextState> state = v8::Local<v8::Value> value;
static_cast<CefV8ContextState*>(v8::External::Cast(*value)->Value()); if (GetPrivate(context, object, kCefContextState, &value)) {
state->Detach(); scoped_refptr<CefV8ContextState> state =
object->DeleteHiddenValue(key); static_cast<CefV8ContextState*>(
v8::External::Cast(*value)->Value());
state->Detach();
DeletePrivate(context, object, kCefContextState);
// Match the AddRef in GetContextState. // Match the AddRef in GetContextState.
state->Release(); state->Release();
}
} }
} }
@ -323,19 +360,17 @@ class V8TrackObject : public CefTrackNode {
} }
// Attach this track object to the specified V8 object. // Attach this track object to the specified V8 object.
void AttachTo(v8::Local<v8::Object> object) { void AttachTo(v8::Local<v8::Context> context,
object->SetHiddenValue(v8::String::NewFromUtf8(isolate_, kCefTrackObject), v8::Local<v8::Object> object) {
v8::External::New(isolate_, this)); SetPrivate(context, object, kCefTrackObject,
v8::External::New(isolate_, this));
} }
// Retrieve the track object for the specified V8 object. // Retrieve the track object for the specified V8 object.
static V8TrackObject* Unwrap(v8::Isolate* isolate, static V8TrackObject* Unwrap(v8::Local<v8::Context> context,
v8::Local<v8::Object> object) { v8::Local<v8::Object> object) {
DCHECK(isolate); v8::Local<v8::Value> value;
v8::Local<v8::Value> value = if (GetPrivate(context, object, kCefTrackObject, &value))
object->GetHiddenValue(
v8::String::NewFromUtf8(isolate, kCefTrackObject));
if (!value.IsEmpty())
return static_cast<V8TrackObject*>(v8::External::Cast(*value)->Value()); return static_cast<V8TrackObject*>(v8::External::Cast(*value)->Value());
return NULL; return NULL;
@ -480,12 +515,13 @@ void AccessorGetterCallbackImpl(
v8::Local<v8::String> property, v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) { const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate(); v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Context> context = isolate->GetCurrentContext();
v8::Local<v8::Object> obj = info.This(); v8::Local<v8::Object> obj = info.This();
CefRefPtr<CefV8Accessor> accessorPtr; CefRefPtr<CefV8Accessor> accessorPtr;
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
if (tracker) if (tracker)
accessorPtr = tracker->GetAccessor(); accessorPtr = tracker->GetAccessor();
@ -518,12 +554,13 @@ void AccessorSetterCallbackImpl(
v8::Local<v8::Value> value, v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) { const v8::PropertyCallbackInfo<void>& info) {
v8::Isolate* isolate = info.GetIsolate(); v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Context> context = isolate->GetCurrentContext();
v8::Local<v8::Object> obj = info.This(); v8::Local<v8::Object> obj = info.This();
CefRefPtr<CefV8Accessor> accessorPtr; CefRefPtr<CefV8Accessor> accessorPtr;
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
if (tracker) if (tracker)
accessorPtr = tracker->GetAccessor(); accessorPtr = tracker->GetAccessor();
@ -947,7 +984,7 @@ bool CefV8ContextImpl::Eval(const CefString& code,
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(val); v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(val);
v8::Local<v8::Value> code_val = GetV8String(isolate, code); v8::Local<v8::Value> code_val = GetV8String(isolate, code);
v8::TryCatch try_catch; v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
retval = NULL; retval = NULL;
@ -1172,7 +1209,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
tracker->SetAccessor(accessor); tracker->SetAccessor(accessor);
// Attach the tracker object. // Attach the tracker object.
tracker->AttachTo(obj); tracker->AttachTo(context, obj);
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
impl->InitObject(obj, tracker); impl->InitObject(obj, tracker);
@ -1200,7 +1237,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateArray(int length) {
v8::Local<v8::Array> arr = v8::Array::New(isolate, length); v8::Local<v8::Array> arr = v8::Array::New(isolate, length);
// Attach the tracker object. // Attach the tracker object.
tracker->AttachTo(arr); tracker->AttachTo(context, arr);
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
impl->InitObject(arr, tracker); impl->InitObject(arr, tracker);
@ -1250,7 +1287,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
tracker->SetHandler(handler); tracker->SetHandler(handler);
// Attach the tracker object. // Attach the tracker object.
tracker->AttachTo(func); tracker->AttachTo(context, func);
// Create the CefV8ValueImpl and provide a tracker object that will cause // Create the CefV8ValueImpl and provide a tracker object that will cause
// the handler reference to be released when the V8 object is destroyed. // the handler reference to be released when the V8 object is destroyed.
@ -1567,10 +1604,17 @@ bool CefV8ValueImpl::IsUserCreated() {
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context";
return false;
}
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
return (tracker != NULL); return (tracker != NULL);
} }
@ -1638,7 +1682,7 @@ bool CefV8ValueImpl::DeleteValue(const CefString& key) {
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch; v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
bool del = obj->Delete(GetV8String(isolate, key)); bool del = obj->Delete(GetV8String(isolate, key));
return (!HasCaught(try_catch) && del); return (!HasCaught(try_catch) && del);
@ -1652,11 +1696,12 @@ bool CefV8ValueImpl::DeleteValue(int index) {
return false; return false;
} }
v8::HandleScope handle_scope(handle_->isolate()); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch; v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
bool del = obj->Delete(index); bool del = obj->Delete(index);
return (!HasCaught(try_catch) && del); return (!HasCaught(try_catch) && del);
@ -1670,7 +1715,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(const CefString& key) {
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch; v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
v8::Local<v8::Value> ret_value = obj->Get(GetV8String(isolate, key)); v8::Local<v8::Value> ret_value = obj->Get(GetV8String(isolate, key));
if (!HasCaught(try_catch) && !ret_value.IsEmpty()) if (!HasCaught(try_catch) && !ret_value.IsEmpty())
@ -1691,7 +1736,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(int index) {
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch; v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
v8::Local<v8::Value> ret_value = obj->Get(v8::Number::New(isolate, index)); v8::Local<v8::Value> ret_value = obj->Get(v8::Number::New(isolate, index));
if (!HasCaught(try_catch) && !ret_value.IsEmpty()) if (!HasCaught(try_catch) && !ret_value.IsEmpty())
@ -1711,7 +1756,7 @@ bool CefV8ValueImpl::SetValue(const CefString& key,
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch; v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
bool set; bool set;
// TODO(cef): This usage may not exactly match the previous implementation. // TODO(cef): This usage may not exactly match the previous implementation.
@ -1741,11 +1786,12 @@ bool CefV8ValueImpl::SetValue(int index, CefRefPtr<CefV8Value> value) {
CefV8ValueImpl* impl = static_cast<CefV8ValueImpl*>(value.get()); CefV8ValueImpl* impl = static_cast<CefV8ValueImpl*>(value.get());
if (impl && impl->IsValid()) { if (impl && impl->IsValid()) {
v8::HandleScope handle_scope(handle_->isolate()); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
v8::TryCatch try_catch; v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
bool set = obj->Set(index, impl->GetV8Value(true)); bool set = obj->Set(index, impl->GetV8Value(true));
return (!HasCaught(try_catch) && set); return (!HasCaught(try_catch) && set);
@ -1761,12 +1807,19 @@ bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings,
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context";
return false;
}
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
CefRefPtr<CefV8Accessor> accessorPtr; CefRefPtr<CefV8Accessor> accessorPtr;
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
if (tracker) if (tracker)
accessorPtr = tracker->GetAccessor(); accessorPtr = tracker->GetAccessor();
@ -1779,7 +1832,7 @@ bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings,
(attribute & V8_PROPERTY_ATTRIBUTE_READONLY) ? (attribute & V8_PROPERTY_ATTRIBUTE_READONLY) ?
NULL : AccessorSetterCallbackImpl; NULL : AccessorSetterCallbackImpl;
v8::TryCatch try_catch; v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
bool set = obj->SetAccessor(GetV8String(isolate, key), getter, setter, obj, bool set = obj->SetAccessor(GetV8String(isolate, key), getter, setter, obj,
static_cast<v8::AccessControl>(settings), static_cast<v8::AccessControl>(settings),
@ -1811,10 +1864,17 @@ bool CefV8ValueImpl::SetUserData(CefRefPtr<CefBase> user_data) {
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context";
return false;
}
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
if (tracker) { if (tracker) {
tracker->SetUserData(user_data); tracker->SetUserData(user_data);
return true; return true;
@ -1828,10 +1888,17 @@ CefRefPtr<CefBase> CefV8ValueImpl::GetUserData() {
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context";
return NULL;
}
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
if (tracker) if (tracker)
return tracker->GetUserData(); return tracker->GetUserData();
@ -1843,10 +1910,17 @@ int CefV8ValueImpl::GetExternallyAllocatedMemory() {
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context";
return 0;
}
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
if (tracker) if (tracker)
return tracker->GetExternallyAllocatedMemory(); return tracker->GetExternallyAllocatedMemory();
@ -1858,10 +1932,17 @@ int CefV8ValueImpl::AdjustExternallyAllocatedMemory(int change_in_bytes) {
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context";
return 0;
}
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
if (tracker) if (tracker)
return tracker->AdjustExternallyAllocatedMemory(change_in_bytes); return tracker->AdjustExternallyAllocatedMemory(change_in_bytes);
@ -1905,14 +1986,21 @@ CefRefPtr<CefV8Handler> CefV8ValueImpl::GetFunctionHandler() {
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (context.IsEmpty()) {
NOTREACHED() << "not currently in a V8 context";
return NULL;
}
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false); v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
if (!value->IsFunction()) { if (!value->IsFunction()) {
NOTREACHED() << "V8 value is not a function"; NOTREACHED() << "V8 value is not a function";
return 0; return NULL;
} }
v8::Local<v8::Object> obj = value->ToObject(); v8::Local<v8::Object> obj = value->ToObject();
V8TrackObject* tracker = V8TrackObject::Unwrap(isolate, obj); V8TrackObject* tracker = V8TrackObject::Unwrap(context, obj);
if (tracker) if (tracker)
return tracker->GetHandler(); return tracker->GetHandler();
@ -1995,7 +2083,7 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
CefRefPtr<CefV8Value> retval; CefRefPtr<CefV8Value> retval;
{ {
v8::TryCatch try_catch; v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
v8::MaybeLocal<v8::Value> func_rv = v8::MaybeLocal<v8::Value> func_rv =

View File

@ -14,6 +14,10 @@ patches = [
{ {
# Fix Xcode 4 build on OS X Lion. # Fix Xcode 4 build on OS X Lion.
# http://codereview.chromium.org/8086022/ # http://codereview.chromium.org/8086022/
#
# Disable use of the sysroot image for CEF because it does not include
# the GTK dependency required by cefclient. It would be nice to enable
# this functionality in the future. See http://crbug.com/504446.
'name': 'build', 'name': 'build',
'path': '../build/', 'path': '../build/',
}, },
@ -227,13 +231,6 @@ patches = [
'name': 'font_family_cache_1501', 'name': 'font_family_cache_1501',
'path': '../chrome/browser/', 'path': '../chrome/browser/',
}, },
{
# Fix crash while printing on Windows by properly initializing V8 in the PDF
# module.
# https://code.google.com/p/chromium/issues/detail?id=549365#c12
'name': 'pdf_print_549365',
'path': '../pdf/',
},
{ {
# Fix crash while printing on Windows by properly initializing V8 in the PDF # Fix crash while printing on Windows by properly initializing V8 in the PDF
# module. # module.

View File

@ -1,5 +1,5 @@
diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc
index b389e40..c3b5d3e 100644 index 8971b07f..f37aa2a 100644
--- render_widget_host_view_guest.cc --- render_widget_host_view_guest.cc
+++ render_widget_host_view_guest.cc +++ render_widget_host_view_guest.cc
@@ -191,6 +191,9 @@ void RenderWidgetHostViewGuest::Destroy() { @@ -191,6 +191,9 @@ void RenderWidgetHostViewGuest::Destroy() {

View File

@ -1,5 +1,5 @@
diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc
index cef0842..d79092d 100644 index 61dbe6c..59d1673 100644
--- browser/browser_plugin/browser_plugin_guest.cc --- browser/browser_plugin/browser_plugin_guest.cc
+++ browser/browser_plugin/browser_plugin_guest.cc +++ browser/browser_plugin/browser_plugin_guest.cc
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
@ -36,10 +36,10 @@ index cef0842..d79092d 100644
} }
RendererPreferences* renderer_prefs = RendererPreferences* renderer_prefs =
@@ -792,11 +791,10 @@ void BrowserPluginGuest::OnWillAttachComplete( @@ -787,11 +786,10 @@ void BrowserPluginGuest::OnWillAttachComplete(
// This will trigger a callback to RenderViewReady after a round-trip IPC. static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost())
static_cast<RenderViewHostImpl*>( ->GetWidget()
GetWebContents()->GetRenderViewHost())->Init(); ->Init();
- WebContentsViewGuest* web_contents_view = - WebContentsViewGuest* web_contents_view =
- static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); - static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) {

View File

@ -1,56 +1,65 @@
diff --git web_contents_impl.cc web_contents_impl.cc diff --git web_contents_impl.cc web_contents_impl.cc
index bf45da9..19ef2c7 100644 index 18589f1..85f57e4 100644
--- web_contents_impl.cc --- web_contents_impl.cc
+++ web_contents_impl.cc +++ web_contents_impl.cc
@@ -1351,23 +1351,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { @@ -1383,30 +1383,38 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
main_frame_widget_routing_id); main_frame_widget_routing_id);
frame_tree_.root()->SetFrameName(params.main_frame_name); frame_tree_.root()->SetFrameName(params.main_frame_name);
- WebContentsViewDelegate* delegate = - WebContentsViewDelegate* delegate =
- GetContentClient()->browser()->GetWebContentsViewDelegate(this); - GetContentClient()->browser()->GetWebContentsViewDelegate(this);
-
- if (browser_plugin_guest_ &&
- !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
- scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
- this, delegate, &render_view_host_delegate_view_));
-
- WebContentsViewGuest* rv = new WebContentsViewGuest(
- this, browser_plugin_guest_.get(), platform_view.Pass(),
- render_view_host_delegate_view_);
- render_view_host_delegate_view_ = rv;
- view_.reset(rv);
- } else {
- // Regular WebContentsView.
- view_.reset(CreateWebContentsView(
- this, delegate, &render_view_host_delegate_view_));
+ if (params.view && params.delegate_view) { + if (params.view && params.delegate_view) {
+ view_.reset(params.view); + view_.reset(params.view);
+ render_view_host_delegate_view_ = params.delegate_view; + render_view_host_delegate_view_ = params.delegate_view;
+ } + }
+
- view_.reset(
- CreateWebContentsView(this, delegate, &render_view_host_delegate_view_));
+ if (!view_) { + if (!view_) {
+ WebContentsViewDelegate* delegate = + WebContentsViewDelegate* delegate =
+ GetContentClient()->browser()->GetWebContentsViewDelegate(this); + GetContentClient()->browser()->GetWebContentsViewDelegate(this);
- if (browser_plugin_guest_ &&
- !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
- view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
- view_.Pass(),
- &render_view_host_delegate_view_));
- }
+ view_.reset(
+ CreateWebContentsView(this, delegate,
+ &render_view_host_delegate_view_));
+ +
+ if (browser_plugin_guest_ && + if (browser_plugin_guest_ &&
+ !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { + !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ scoped_ptr<WebContentsView> platform_view(CreateWebContentsView( + view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
+ this, delegate, &render_view_host_delegate_view_)); + view_.Pass(),
+ + &render_view_host_delegate_view_));
+ WebContentsViewGuest* rv = new WebContentsViewGuest(
+ this, browser_plugin_guest_.get(), platform_view.Pass(),
+ render_view_host_delegate_view_);
+ render_view_host_delegate_view_ = rv;
+ view_.reset(rv);
+ } else {
+ // Regular WebContentsView.
+ view_.reset(CreateWebContentsView(
+ this, delegate, &render_view_host_delegate_view_));
+ } + }
}
#if defined(MOJO_SHELL_CLIENT)
- if (MojoShellConnection::Get() &&
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kUseMusInRenderer)) {
- mus::Window* window = aura::GetMusWindow(params.context);
- if (window) {
- view_.reset(new WebContentsViewMus(this, window, view_.Pass(),
- &render_view_host_delegate_view_));
+ if (MojoShellConnection::Get() &&
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseMusInRenderer)) {
+ mus::Window* window = aura::GetMusWindow(params.context);
+ if (window) {
+ view_.reset(new WebContentsViewMus(this, window, view_.Pass(),
+ &render_view_host_delegate_view_));
+ }
}
- }
#endif
+ }
CHECK(render_view_host_delegate_view_); CHECK(render_view_host_delegate_view_);
CHECK(view_.get()); CHECK(view_.get());
@@ -1719,11 +1726,14 @@ void WebContentsImpl::CreateNewWindow( @@ -1810,11 +1818,14 @@ void WebContentsImpl::CreateNewWindow(
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
@ -66,7 +75,7 @@ index bf45da9..19ef2c7 100644
if (route_id != MSG_ROUTING_NONE && if (route_id != MSG_ROUTING_NONE &&
!RenderViewHost::FromID(render_process_id, route_id)) { !RenderViewHost::FromID(render_process_id, route_id)) {
// If the embedder didn't create a WebContents for this route, we need to // If the embedder didn't create a WebContents for this route, we need to
@@ -1748,6 +1758,8 @@ void WebContentsImpl::CreateNewWindow( @@ -1839,6 +1850,8 @@ void WebContentsImpl::CreateNewWindow(
create_params.opener_render_process_id = render_process_id; create_params.opener_render_process_id = render_process_id;
create_params.opener_render_frame_id = params.opener_render_frame_id; create_params.opener_render_frame_id = params.opener_render_frame_id;
create_params.opener_suppressed = params.opener_suppressed; create_params.opener_suppressed = params.opener_suppressed;

View File

@ -1,5 +1,5 @@
diff --git common.gypi common.gypi diff --git common.gypi common.gypi
index 780f43d..409a018 100644 index 6b2cb0a..2bc614d 100644
--- common.gypi --- common.gypi
+++ common.gypi +++ common.gypi
@@ -9,6 +9,9 @@ @@ -9,6 +9,9 @@
@ -12,6 +12,18 @@ index 780f43d..409a018 100644
# Putting a variables dict inside another variables dict looks kind of # Putting a variables dict inside another variables dict looks kind of
# weird. This is done so that 'host_arch', 'chromeos', etc are defined as # weird. This is done so that 'host_arch', 'chromeos', etc are defined as
# variables within the outer variables dict here. This is necessary # variables within the outer variables dict here. This is necessary
@@ -92,7 +95,10 @@
# depending on the packages installed on the local machine. Set this
# to 0 to build against locally installed headers and libraries (e.g.
# if packaging for a linux distro)
- 'use_sysroot%': 1,
+ # Disable use of the sysroot image for CEF because it does not include
+ # the GTK dependency required by cefclient. It would be nice to enable
+ # this functionality in the future. See http://crbug.com/504446.
+ 'use_sysroot%': 0,
# Override buildtype to select the desired build flavor.
# Dev - everyday build for development/testing
diff --git mac/strip_save_dsym mac/strip_save_dsym diff --git mac/strip_save_dsym mac/strip_save_dsym
index c9cf226..0dedbe3 100755 index c9cf226..0dedbe3 100755
--- mac/strip_save_dsym --- mac/strip_save_dsym

View File

@ -1,8 +1,8 @@
diff --git ui/browser.cc ui/browser.cc diff --git ui/browser.cc ui/browser.cc
index d6a2493..c352fd6a 100644 index c633924..b93d698 100644
--- ui/browser.cc --- ui/browser.cc
+++ ui/browser.cc +++ ui/browser.cc
@@ -1673,7 +1673,9 @@ bool Browser::ShouldCreateWebContents( @@ -1677,7 +1677,9 @@ bool Browser::ShouldCreateWebContents(
const std::string& frame_name, const std::string& frame_name,
const GURL& target_url, const GURL& target_url,
const std::string& partition_id, const std::string& partition_id,

View File

@ -1,8 +1,8 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index b74845f..4ac77c3 100644 index 1ae2b11..2379d27 100644
--- content/browser/compositor/gpu_process_transport_factory.cc --- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -143,6 +143,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { @@ -136,6 +136,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
scoped_ptr<cc::SoftwareOutputDevice> scoped_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice( GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) { ui::Compositor* compositor) {
@ -13,9 +13,9 @@ index b74845f..4ac77c3 100644
+ return output_device; + return output_device;
+ } + }
+ +
#if defined(OS_WIN) #if defined(MOJO_RUNNER_CLIENT)
return scoped_ptr<cc::SoftwareOutputDevice>( if (IsRunningInMojoShell()) {
new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); return scoped_ptr<cc::SoftwareOutputDevice>(
diff --git ui/compositor/compositor.h ui/compositor/compositor.h diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index 1602d30..3dd3e3e 100644 index 1602d30..3dd3e3e 100644
--- ui/compositor/compositor.h --- ui/compositor/compositor.h

View File

@ -1,60 +1,73 @@
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
index 3d0316f..ccd1f58 100644 index 32004d1..ccd1f58 100644
--- public/renderer/content_renderer_client.cc --- public/renderer/content_renderer_client.cc
+++ public/renderer/content_renderer_client.cc +++ public/renderer/content_renderer_client.cc
@@ -98,7 +98,6 @@ bool ContentRendererClient::AllowPopup() { @@ -98,6 +98,18 @@ bool ContentRendererClient::AllowPopup() {
return false; return false;
} }
-#ifdef OS_ANDROID +bool ContentRendererClient::HandleNavigation(
bool ContentRendererClient::HandleNavigation( + RenderFrame* render_frame,
RenderFrame* render_frame, + bool is_content_initiated,
bool is_content_initiated, + int opener_id,
@@ -110,7 +109,6 @@ bool ContentRendererClient::HandleNavigation( + blink::WebFrame* frame,
bool is_redirect) { + const blink::WebURLRequest& request,
return false; + blink::WebNavigationType type,
} + blink::WebNavigationPolicy default_policy,
-#endif + bool is_redirect) {
+ return false;
+}
+
bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame, bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
const GURL& url, const GURL& url,
const std::string& http_method,
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
index f55c691..0aeb1b24 100644 index 59d448c..ef15ff1 100644
--- public/renderer/content_renderer_client.h --- public/renderer/content_renderer_client.h
+++ public/renderer/content_renderer_client.h +++ public/renderer/content_renderer_client.h
@@ -192,7 +192,6 @@ class CONTENT_EXPORT ContentRendererClient { @@ -16,6 +16,8 @@
#include "base/strings/string16.h"
#include "content/public/common/content_client.h"
#include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
+#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
+#include "third_party/WebKit/public/web/WebNavigationType.h"
#include "ui/base/page_transition_types.h"
#include "v8/include/v8.h"
@@ -189,6 +191,17 @@ class CONTENT_EXPORT ContentRendererClient {
// Returns true if a popup window should be allowed. // Returns true if a popup window should be allowed.
virtual bool AllowPopup(); virtual bool AllowPopup();
+
-#ifdef OS_ANDROID + // Returns true if the navigation was handled by the embedder and should be
// TODO(sgurun) This callback is deprecated and will be removed as soon + // ignored by WebKit. This method is used by CEF and android_webview.
// as android webview completes implementation of a resource throttle based + virtual bool HandleNavigation(RenderFrame* render_frame,
// shouldoverrideurl implementation. See crbug.com/325351 + bool is_content_initiated,
@@ -207,7 +206,6 @@ class CONTENT_EXPORT ContentRendererClient { + int opener_id,
blink::WebNavigationType type, + blink::WebFrame* frame,
blink::WebNavigationPolicy default_policy, + const blink::WebURLRequest& request,
bool is_redirect); + blink::WebNavigationType type,
-#endif + blink::WebNavigationPolicy default_policy,
+ bool is_redirect);
// Returns true if we should fork a new process for the given navigation. // Returns true if we should fork a new process for the given navigation.
// If |send_referrer| is set to false (which is the default), no referrer // If |send_referrer| is set to false (which is the default), no referrer
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
index 33219e5..f6aac25 100644 index 314fe7b..c519785 100644
--- renderer/render_frame_impl.cc --- renderer/render_frame_impl.cc
+++ renderer/render_frame_impl.cc +++ renderer/render_frame_impl.cc
@@ -4395,7 +4395,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( @@ -4440,6 +4440,14 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
(pending_navigation_params_ && (pending_navigation_params_ &&
!pending_navigation_params_->request_params.redirects.empty()); !pending_navigation_params_->request_params.redirects.empty());
-#ifdef OS_ANDROID + if (info.urlRequest.url() != GURL(kSwappedOutURL) &&
// The handlenavigation API is deprecated and will be removed once + GetContentClient()->renderer()->HandleNavigation(
// crbug.com/325351 is resolved. + this, is_content_initiated, render_view_->opener_id_, frame_,
if (info.urlRequest.url() != GURL(kSwappedOutURL) && + info.urlRequest, info.navigationType, info.defaultPolicy,
@@ -4405,7 +4404,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( + is_redirect)) {
is_redirect)) { + return blink::WebNavigationPolicyIgnore;
return blink::WebNavigationPolicyIgnore; + }
} +
-#endif
Referrer referrer( Referrer referrer(
RenderViewImpl::GetReferrerFromRequest(frame_, info.urlRequest)); RenderViewImpl::GetReferrerFromRequest(frame_, info.urlRequest));

View File

@ -1,8 +1,8 @@
diff --git browser/guest_view/extension_options/extension_options_guest.cc browser/guest_view/extension_options/extension_options_guest.cc diff --git browser/guest_view/extension_options/extension_options_guest.cc browser/guest_view/extension_options/extension_options_guest.cc
index 6a34aa0..1743907 100644 index 5806540..6d1a8a7 100644
--- browser/guest_view/extension_options/extension_options_guest.cc --- browser/guest_view/extension_options/extension_options_guest.cc
+++ browser/guest_view/extension_options/extension_options_guest.cc +++ browser/guest_view/extension_options/extension_options_guest.cc
@@ -197,7 +197,9 @@ bool ExtensionOptionsGuest::ShouldCreateWebContents( @@ -200,7 +200,9 @@ bool ExtensionOptionsGuest::ShouldCreateWebContents(
const std::string& frame_name, const std::string& frame_name,
const GURL& target_url, const GURL& target_url,
const std::string& partition_id, const std::string& partition_id,

View File

@ -1,5 +1,5 @@
diff --git resource_ids resource_ids diff --git resource_ids resource_ids
index a5bcffe..6b897df 100644 index 6f53f31..21b5454 100644
--- resource_ids --- resource_ids
+++ resource_ids +++ resource_ids
@@ -14,6 +14,12 @@ @@ -14,6 +14,12 @@

View File

@ -1,5 +1,5 @@
diff --git gyp/generator/ninja.py gyp/generator/ninja.py diff --git gyp/generator/ninja.py gyp/generator/ninja.py
index 58be3bf..4dcb2a6 100644 index 907542b..4d77af4 100644
--- gyp/generator/ninja.py --- gyp/generator/ninja.py
+++ gyp/generator/ninja.py +++ gyp/generator/ninja.py
@@ -745,7 +745,16 @@ class NinjaWriter(object): @@ -745,7 +745,16 @@ class NinjaWriter(object):

View File

@ -1,8 +1,8 @@
diff --git hwnd_message_handler.cc hwnd_message_handler.cc diff --git hwnd_message_handler.cc hwnd_message_handler.cc
index 035df76..d1517b4 100644 index b5bd8a8..997c4da 100644
--- hwnd_message_handler.cc --- hwnd_message_handler.cc
+++ hwnd_message_handler.cc +++ hwnd_message_handler.cc
@@ -2364,8 +2364,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, @@ -2381,8 +2381,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
active_mouse_tracking_flags_ = 0; active_mouse_tracking_flags_ = 0;
} else if (event.type() == ui::ET_MOUSEWHEEL) { } else if (event.type() == ui::ET_MOUSEWHEEL) {
// Reroute the mouse wheel to the window under the pointer if applicable. // Reroute the mouse wheel to the window under the pointer if applicable.

View File

@ -1,8 +1,8 @@
diff --git message_loop.cc message_loop.cc diff --git message_loop.cc message_loop.cc
index a44f468..6e391e9 100644 index a0c5f61..a3033dc 100644
--- message_loop.cc --- message_loop.cc
+++ message_loop.cc +++ message_loop.cc
@@ -135,12 +135,6 @@ MessageLoop::~MessageLoop() { @@ -136,12 +136,6 @@ MessageLoop::~MessageLoop() {
// bound to a thread. // bound to a thread.
DCHECK(current() == this || !current()); DCHECK(current() == this || !current());

View File

@ -1,5 +1,5 @@
diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc
index 55b2426..bea8823 100644 index 1f9ebfb..37c2217 100644
--- mime_handler_view_guest.cc --- mime_handler_view_guest.cc
+++ mime_handler_view_guest.cc +++ mime_handler_view_guest.cc
@@ -132,6 +132,8 @@ void MimeHandlerViewGuest::CreateWebContents( @@ -132,6 +132,8 @@ void MimeHandlerViewGuest::CreateWebContents(

View File

@ -1,5 +1,5 @@
diff --git base/network_delegate.h base/network_delegate.h diff --git base/network_delegate.h base/network_delegate.h
index e8d82a3..8b536d7 100644 index 979d3ec..0ccfd16 100644
--- base/network_delegate.h --- base/network_delegate.h
+++ base/network_delegate.h +++ base/network_delegate.h
@@ -35,6 +35,7 @@ namespace net { @@ -35,6 +35,7 @@ namespace net {
@ -10,7 +10,7 @@ index e8d82a3..8b536d7 100644
class HttpRequestHeaders; class HttpRequestHeaders;
class HttpResponseHeaders; class HttpResponseHeaders;
class ProxyInfo; class ProxyInfo;
@@ -118,6 +119,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { @@ -119,6 +120,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
const GURL& target_url, const GURL& target_url,
const GURL& referrer_url) const; const GURL& referrer_url) const;
@ -45,10 +45,10 @@ index 1904a8c..8d5f1ec 100644
friend class SdchFilterChainingTest; friend class SdchFilterChainingTest;
FRIEND_TEST_ALL_PREFIXES(FilterTest, ThreeFilterChain); FRIEND_TEST_ALL_PREFIXES(FilterTest, ThreeFilterChain);
diff --git url_request/url_request_job.cc url_request/url_request_job.cc diff --git url_request/url_request_job.cc url_request/url_request_job.cc
index 641c07b..e613c86 100644 index fc9f4a9..4f6dbcc 100644
--- url_request/url_request_job.cc --- url_request/url_request_job.cc
+++ url_request/url_request_job.cc +++ url_request/url_request_job.cc
@@ -466,6 +466,9 @@ void URLRequestJob::NotifyHeadersComplete() { @@ -472,6 +472,9 @@ void URLRequestJob::NotifyHeadersComplete() {
if (request_->status().is_success()) if (request_->status().is_success())
filter_.reset(SetupFilter()); filter_.reset(SetupFilter());

View File

@ -1,8 +1,8 @@
diff --git url_request.h url_request.h diff --git url_request.h url_request.h
index f685cf7..d01faaee 100644 index 33b2859..44cca91 100644
--- url_request.h --- url_request.h
+++ url_request.h +++ url_request.h
@@ -645,10 +645,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe), @@ -653,10 +653,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// or after the response headers are received. // or after the response headers are received.
void GetConnectionAttempts(ConnectionAttempts* out) const; void GetConnectionAttempts(ConnectionAttempts* out) const;

View File

@ -1,103 +0,0 @@
diff --git pdf.cc pdf.cc
index 1f580e4..9521fdf 100644
--- pdf.cc
+++ pdf.cc
@@ -10,8 +10,6 @@
#include "base/command_line.h"
#include "base/logging.h"
-#include "gin/array_buffer.h"
-#include "gin/public/isolate_holder.h"
#include "pdf/out_of_process_instance.h"
#include "ppapi/c/ppp.h"
#include "ppapi/cpp/private/internal_module.h"
@@ -24,14 +22,6 @@ namespace {
bool g_sdk_initialized_via_pepper = false;
-gin::IsolateHolder* g_isolate_holder = nullptr;
-
-void TearDownV8() {
- g_isolate_holder->isolate()->Exit();
- delete g_isolate_holder;
- g_isolate_holder = nullptr;
-}
-
} // namespace
PDFModule::PDFModule() {
@@ -39,7 +29,6 @@ PDFModule::PDFModule() {
PDFModule::~PDFModule() {
if (g_sdk_initialized_via_pepper) {
- TearDownV8();
chrome_pdf::ShutdownSDK();
g_sdk_initialized_via_pepper = false;
}
@@ -60,15 +49,8 @@ pp::Instance* PDFModule::CreateInstance(PP_Instance instance) {
v8::V8::SetNativesDataBlob(&natives);
v8::V8::SetSnapshotDataBlob(&snapshot);
}
- gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
- gin::ArrayBufferAllocator::SharedInstance());
- g_isolate_holder =
- new gin::IsolateHolder(gin::IsolateHolder::kSingleThread);
- g_isolate_holder->isolate()->Enter();
- if (!chrome_pdf::InitializeSDK()) {
- TearDownV8();
+ if (!chrome_pdf::InitializeSDK())
return NULL;
- }
g_sdk_initialized_via_pepper = true;
}
diff --git pdfium/pdfium_engine.cc pdfium/pdfium_engine.cc
index 8631088..d23c141 100644
--- pdfium/pdfium_engine.cc
+++ pdfium/pdfium_engine.cc
@@ -18,7 +18,9 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#include "gin/array_buffer.h"
#include "gin/public/gin_embedders.h"
+#include "gin/public/isolate_holder.h"
#include "pdf/draw_utils.h"
#include "pdf/pdfium/pdfium_api_string_buffer_adapter.h"
#include "pdf/pdfium/pdfium_mem_buffer_file_read.h"
@@ -449,9 +451,27 @@ std::string GetDocumentMetadata(FPDF_DOCUMENT doc, const std::string& key) {
return base::UTF16ToUTF8(value);
}
+gin::IsolateHolder* g_isolate_holder = nullptr;
+
+void SetUpV8() {
+ gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
+ gin::ArrayBufferAllocator::SharedInstance());
+ g_isolate_holder =
+ new gin::IsolateHolder(gin::IsolateHolder::kSingleThread);
+ g_isolate_holder->isolate()->Enter();
+}
+
+void TearDownV8() {
+ g_isolate_holder->isolate()->Exit();
+ delete g_isolate_holder;
+ g_isolate_holder = nullptr;
+}
+
} // namespace
bool InitializeSDK() {
+ SetUpV8();
+
FPDF_LIBRARY_CONFIG config;
config.version = 2;
config.m_pUserFontPaths = nullptr;
@@ -470,6 +490,7 @@ bool InitializeSDK() {
}
void ShutdownSDK() {
+ TearDownV8();
FPDF_DestroyLibrary();
}

View File

@ -1,16 +1,16 @@
diff --git fpdfsdk/src/fpdfview.cpp fpdfsdk/src/fpdfview.cpp diff --git fpdfsdk/src/fpdfview.cpp fpdfsdk/src/fpdfview.cpp
index 97da89e..0484d93 100644 index fcb6731..0c92fe5 100644
--- fpdfsdk/src/fpdfview.cpp --- fpdfsdk/src/fpdfview.cpp
+++ fpdfsdk/src/fpdfview.cpp +++ fpdfsdk/src/fpdfview.cpp
@@ -6,6 +6,7 @@ @@ -12,6 +12,7 @@
#include "fpdfsdk/include/fsdk_mgr.h"
#include "../../core/include/fxcodec/fx_codec.h" #include "fpdfsdk/include/fsdk_rendercontext.h"
#include "../../core/include/fxcrt/fx_safe_types.h" #include "fpdfsdk/include/javascript/IJavaScript.h"
+#include "../../fpdfsdk/include/jsapi/fxjs_v8.h" +#include "fpdfsdk/include/jsapi/fxjs_v8.h"
#include "../../public/fpdf_ext.h" #include "public/fpdf_ext.h"
#include "../../public/fpdf_progressive.h" #include "public/fpdf_progressive.h"
#include "../../public/fpdfview.h" #include "third_party/base/nonstd_unique_ptr.h"
@@ -105,6 +106,7 @@ DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig( @@ -117,6 +118,7 @@ DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig(
DLLEXPORT void STDCALL FPDF_DestroyLibrary() { DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
CPDF_ModuleMgr::Destroy(); CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy(); CFX_GEModule::Destroy();

View File

@ -1,8 +1,8 @@
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
index 48ba994..039d8fe 100644 index f71d867..c9d82fd 100644
--- public/common/common_param_traits_macros.h --- public/common/common_param_traits_macros.h
+++ public/common/common_param_traits_macros.h +++ public/common/common_param_traits_macros.h
@@ -195,6 +195,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) @@ -191,6 +191,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes) IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
@ -11,10 +11,10 @@ index 48ba994..039d8fe 100644
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop) IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git public/common/web_preferences.cc public/common/web_preferences.cc diff --git public/common/web_preferences.cc public/common/web_preferences.cc
index 6b599c0..d2ff454 100644 index a86de33..6129690 100644
--- public/common/web_preferences.cc --- public/common/web_preferences.cc
+++ public/common/web_preferences.cc +++ public/common/web_preferences.cc
@@ -176,6 +176,7 @@ WebPreferences::WebPreferences() @@ -170,6 +170,7 @@ WebPreferences::WebPreferences()
pinch_overlay_scrollbar_thickness(0), pinch_overlay_scrollbar_thickness(0),
use_solid_color_scrollbars(false), use_solid_color_scrollbars(false),
navigate_on_drag_drop(true), navigate_on_drag_drop(true),
@ -23,10 +23,10 @@ index 6b599c0..d2ff454 100644
slimming_paint_v2_enabled(false), slimming_paint_v2_enabled(false),
cookie_enabled(true), cookie_enabled(true),
diff --git public/common/web_preferences.h public/common/web_preferences.h diff --git public/common/web_preferences.h public/common/web_preferences.h
index 0378cd7..484342b 100644 index eb8f77e..6616a39 100644
--- public/common/web_preferences.h --- public/common/web_preferences.h
+++ public/common/web_preferences.h +++ public/common/web_preferences.h
@@ -173,6 +173,7 @@ struct CONTENT_EXPORT WebPreferences { @@ -168,6 +168,7 @@ struct CONTENT_EXPORT WebPreferences {
int pinch_overlay_scrollbar_thickness; int pinch_overlay_scrollbar_thickness;
bool use_solid_color_scrollbars; bool use_solid_color_scrollbars;
bool navigate_on_drag_drop; bool navigate_on_drag_drop;
@ -35,10 +35,10 @@ index 0378cd7..484342b 100644
bool slimming_paint_v2_enabled; bool slimming_paint_v2_enabled;
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
index 3fd5464..4bf3639 100644 index a5aa817..e02557b 100644
--- renderer/render_view_impl.cc --- renderer/render_view_impl.cc
+++ renderer/render_view_impl.cc +++ renderer/render_view_impl.cc
@@ -953,6 +953,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, @@ -941,6 +941,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
settings->setCookieEnabled(prefs.cookie_enabled); settings->setCookieEnabled(prefs.cookie_enabled);
settings->setNavigateOnDragDrop(prefs.navigate_on_drag_drop); settings->setNavigateOnDragDrop(prefs.navigate_on_drag_drop);

View File

@ -1,5 +1,5 @@
diff --git prefs_tab_helper.cc prefs_tab_helper.cc diff --git prefs_tab_helper.cc prefs_tab_helper.cc
index 5cb2d6e..b0c8689 100644 index 1eb1268..aa4b840 100644
--- prefs_tab_helper.cc --- prefs_tab_helper.cc
+++ prefs_tab_helper.cc +++ prefs_tab_helper.cc
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
@ -11,7 +11,7 @@ index 5cb2d6e..b0c8689 100644
#include "base/prefs/overlay_user_pref_store.h" #include "base/prefs/overlay_user_pref_store.h"
#include "base/prefs/pref_change_registrar.h" #include "base/prefs/pref_change_registrar.h"
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
@@ -413,12 +413,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { @@ -415,12 +415,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
GetInstance()->GetServiceForBrowserContext(profile, true)); GetInstance()->GetServiceForBrowserContext(profile, true));
} }
@ -26,7 +26,7 @@ index 5cb2d6e..b0c8689 100644
PrefWatcherFactory() : BrowserContextKeyedServiceFactory( PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
"PrefWatcher", "PrefWatcher",
@@ -439,6 +437,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { @@ -441,6 +439,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
} }
}; };

View File

@ -94,18 +94,18 @@ index d9ea441..dce6b9e 100644
bool is_loading_; bool is_loading_;
bool is_scripted_preview_delayed_; bool is_scripted_preview_delayed_;
diff --git printing/renderer/print_web_view_helper_linux.cc printing/renderer/print_web_view_helper_linux.cc diff --git printing/renderer/print_web_view_helper_linux.cc printing/renderer/print_web_view_helper_linux.cc
index 52f92ec..85f7adb 100644 index 3e4033d..7a8b61f 100644
--- printing/renderer/print_web_view_helper_linux.cc --- printing/renderer/print_web_view_helper_linux.cc
+++ printing/renderer/print_web_view_helper_linux.cc +++ printing/renderer/print_web_view_helper_linux.cc
@@ -154,7 +154,6 @@ void PrintWebViewHelper::PrintPageInternal( @@ -152,7 +152,6 @@ void PrintWebViewHelper::PrintPageInternal(
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_);
-#if defined(ENABLE_PRINT_PREVIEW) -#if defined(ENABLE_PRINT_PREVIEW)
if (params.params.display_header_footer) { if (params.params.display_header_footer) {
// |page_number| is 0-based, so 1 is added. // |page_number| is 0-based, so 1 is added.
// TODO(vitalybuka) : why does it work only with 1.25? // TODO(vitalybuka) : why does it work only with 1.25?
@@ -163,7 +162,6 @@ void PrintWebViewHelper::PrintPageInternal( @@ -161,7 +160,6 @@ void PrintWebViewHelper::PrintPageInternal(
scale_factor / 1.25, page_layout_in_points, scale_factor / 1.25, page_layout_in_points,
params.params); params.params);
} }
@ -114,12 +114,12 @@ index 52f92ec..85f7adb 100644
RenderPageContent(frame, params.page_number, canvas_area, content_area, RenderPageContent(frame, params.page_number, canvas_area, content_area,
scale_factor, canvas); scale_factor, canvas);
diff --git printing/renderer/print_web_view_helper_mac.mm printing/renderer/print_web_view_helper_mac.mm diff --git printing/renderer/print_web_view_helper_mac.mm printing/renderer/print_web_view_helper_mac.mm
index f2b94e7..8c5df5e 100644 index 293f567..601fee6 100644
--- printing/renderer/print_web_view_helper_mac.mm --- printing/renderer/print_web_view_helper_mac.mm
+++ printing/renderer/print_web_view_helper_mac.mm +++ printing/renderer/print_web_view_helper_mac.mm
@@ -126,14 +126,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, @@ -125,14 +125,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_);
skia::SetIsPreviewMetafile(*canvas, is_preview); skia::SetIsPreviewMetafile(*canvas, is_preview);
-#if defined(ENABLE_PRINT_PREVIEW) -#if defined(ENABLE_PRINT_PREVIEW)
if (params.display_header_footer) { if (params.display_header_footer) {
@ -133,12 +133,12 @@ index f2b94e7..8c5df5e 100644
scale_factor, static_cast<blink::WebCanvas*>(canvas)); scale_factor, static_cast<blink::WebCanvas*>(canvas));
} }
diff --git printing/renderer/print_web_view_helper_pdf_win.cc printing/renderer/print_web_view_helper_pdf_win.cc diff --git printing/renderer/print_web_view_helper_pdf_win.cc printing/renderer/print_web_view_helper_pdf_win.cc
index 56acc74..ac85bf6 100644 index 13ad735..fffce71 100644
--- printing/renderer/print_web_view_helper_pdf_win.cc --- printing/renderer/print_web_view_helper_pdf_win.cc
+++ printing/renderer/print_web_view_helper_pdf_win.cc +++ printing/renderer/print_web_view_helper_pdf_win.cc
@@ -162,14 +162,12 @@ void PrintWebViewHelper::PrintPageInternal( @@ -160,14 +160,12 @@ void PrintWebViewHelper::PrintPageInternal(
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_);
-#if defined(ENABLE_PRINT_PREVIEW) -#if defined(ENABLE_PRINT_PREVIEW)
if (params.params.display_header_footer) { if (params.params.display_header_footer) {

View File

@ -14,7 +14,7 @@ index 1b6d8a6..b606a30 100644
WebContents::CreateParams::~CreateParams() { WebContents::CreateParams::~CreateParams() {
} }
diff --git web_contents.h web_contents.h diff --git web_contents.h web_contents.h
index cda6487..6a84ed1 100644 index c9fa8a01..e075a76 100644
--- web_contents.h --- web_contents.h
+++ web_contents.h +++ web_contents.h
@@ -52,9 +52,11 @@ class PageState; @@ -52,9 +52,11 @@ class PageState;
@ -41,10 +41,10 @@ index cda6487..6a84ed1 100644
// Creates a new WebContents. // Creates a new WebContents.
diff --git web_contents_delegate.cc web_contents_delegate.cc diff --git web_contents_delegate.cc web_contents_delegate.cc
index b39436d..bf257a7 100644 index 70a1f06..b9673d2 100644
--- web_contents_delegate.cc --- web_contents_delegate.cc
+++ web_contents_delegate.cc +++ web_contents_delegate.cc
@@ -139,7 +139,9 @@ bool WebContentsDelegate::ShouldCreateWebContents( @@ -165,7 +165,9 @@ bool WebContentsDelegate::ShouldCreateWebContents(
const std::string& frame_name, const std::string& frame_name,
const GURL& target_url, const GURL& target_url,
const std::string& partition_id, const std::string& partition_id,
@ -56,7 +56,7 @@ index b39436d..bf257a7 100644
} }
diff --git web_contents_delegate.h web_contents_delegate.h diff --git web_contents_delegate.h web_contents_delegate.h
index 40a4904..e857dee 100644 index f6a04a5..f41ec5b 100644
--- web_contents_delegate.h --- web_contents_delegate.h
+++ web_contents_delegate.h +++ web_contents_delegate.h
@@ -39,9 +39,11 @@ class DownloadItem; @@ -39,9 +39,11 @@ class DownloadItem;

View File

@ -1,8 +1,8 @@
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm
index fb89516..6edca6e 100644 index ccf0de2..c4b758e 100644
--- render_widget_host_view_mac.mm --- render_widget_host_view_mac.mm
+++ render_widget_host_view_mac.mm +++ render_widget_host_view_mac.mm
@@ -529,9 +529,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, @@ -530,9 +530,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
// Paint this view host with |background_color_| when there is no content // Paint this view host with |background_color_| when there is no content
// ready to draw. // ready to draw.
background_layer_.reset([[CALayer alloc] init]); background_layer_.reset([[CALayer alloc] init]);

View File

@ -1,8 +1,8 @@
diff --git renderer_preferences_util.cc renderer_preferences_util.cc diff --git renderer_preferences_util.cc renderer_preferences_util.cc
index f7628fe..e2f1451 100644 index 89b7d77..9996edf 100644
--- renderer_preferences_util.cc --- renderer_preferences_util.cc
+++ renderer_preferences_util.cc +++ renderer_preferences_util.cc
@@ -25,7 +25,8 @@ @@ -26,7 +26,8 @@
#include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield.h"
#endif #endif
@ -12,7 +12,7 @@ index f7628fe..e2f1451 100644
#include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/themes/theme_service_factory.h"
#include "ui/views/linux_ui/linux_ui.h" #include "ui/views/linux_ui/linux_ui.h"
@@ -81,7 +82,8 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs, @@ -94,7 +95,8 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs,
prefs->caret_blink_interval = views::Textfield::GetCaretBlinkMs() / 1000.0; prefs->caret_blink_interval = views::Textfield::GetCaretBlinkMs() / 1000.0;
#endif #endif

View File

@ -1,5 +1,5 @@
diff --git spellcheck_factory.cc spellcheck_factory.cc diff --git spellcheck_factory.cc spellcheck_factory.cc
index fcf2ce8..9e4f3d1 100644 index 87b5b9e..8e6dfff 100644
--- spellcheck_factory.cc --- spellcheck_factory.cc
+++ spellcheck_factory.cc +++ spellcheck_factory.cc
@@ -16,6 +16,13 @@ @@ -16,6 +16,13 @@

View File

@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
index bbb79c9..bf9a924 100644 index edb45db..0dfcfb2 100644
--- content/browser/renderer_host/render_widget_host_view_aura.cc --- content/browser/renderer_host/render_widget_host_view_aura.cc
+++ content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -758,6 +758,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { @@ -772,6 +772,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() {
::SetFocus(host->GetAcceleratedWidget()); ::SetFocus(host->GetAcceleratedWidget());
} }
#endif #endif
@ -17,7 +17,7 @@ index bbb79c9..bf9a924 100644
set_focus_on_mouse_down_ = false; set_focus_on_mouse_down_ = false;
host_->Focus(); host_->Focus();
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
index 1b40705..52599e5 100644 index 1c07d7d..47c1911 100644
--- content/browser/renderer_host/render_widget_host_view_base.cc --- content/browser/renderer_host/render_widget_host_view_base.cc
+++ content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc
@@ -374,6 +374,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() @@ -374,6 +374,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase()
@ -40,7 +40,7 @@ index 1b40705..52599e5 100644
return renderer_frame_number_; return renderer_frame_number_;
} }
diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h
index bf3b8e1..351c601 100644 index 1f1e43c..22b5593 100644
--- content/browser/renderer_host/render_widget_host_view_base.h --- content/browser/renderer_host/render_widget_host_view_base.h
+++ content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h
@@ -78,6 +78,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, @@ -78,6 +78,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
@ -51,7 +51,7 @@ index bf3b8e1..351c601 100644
// IPC::Listener implementation: // IPC::Listener implementation:
bool OnMessageReceived(const IPC::Message& msg) override; bool OnMessageReceived(const IPC::Message& msg) override;
@@ -414,6 +415,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, @@ -434,6 +435,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// renderer. // renderer.
bool pinch_zoom_enabled_; bool pinch_zoom_enabled_;
@ -150,10 +150,10 @@ index 363c019..97ada1d 100644
// a reference. // a reference.
corewm::TooltipWin* tooltip_; corewm::TooltipWin* tooltip_;
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 298c92b..393a5dc 100644 index 656769c..0e5d460 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -165,6 +165,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( @@ -168,6 +168,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
use_native_frame_(false), use_native_frame_(false),
should_maximize_after_map_(false), should_maximize_after_map_(false),
use_argb_visual_(false), use_argb_visual_(false),
@ -161,17 +161,17 @@ index 298c92b..393a5dc 100644
drag_drop_client_(NULL), drag_drop_client_(NULL),
native_widget_delegate_(native_widget_delegate), native_widget_delegate_(native_widget_delegate),
desktop_native_widget_aura_(desktop_native_widget_aura), desktop_native_widget_aura_(desktop_native_widget_aura),
@@ -173,7 +174,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( @@ -177,7 +178,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
custom_window_shape_(false),
urgency_hint_set_(false), urgency_hint_set_(false),
activatable_(true), activatable_(true),
modal_dialog_xid_(0),
- close_widget_factory_(this) { - close_widget_factory_(this) {
+ close_widget_factory_(this), + close_widget_factory_(this),
+ xwindow_destroyed_(false) { + xwindow_destroyed_(false) {
} }
DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() { DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() {
@@ -384,7 +386,8 @@ void DesktopWindowTreeHostX11::CloseNow() { @@ -388,7 +390,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
// Actually free our native resources. // Actually free our native resources.
if (ui::PlatformEventSource::GetInstance()) if (ui::PlatformEventSource::GetInstance())
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
@ -181,7 +181,7 @@ index 298c92b..393a5dc 100644
xwindow_ = None; xwindow_ = None;
desktop_native_widget_aura_->OnHostClosed(); desktop_native_widget_aura_->OnHostClosed();
@@ -533,6 +536,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( @@ -537,6 +540,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
} }
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
@ -190,7 +190,7 @@ index 298c92b..393a5dc 100644
return ToDIPRect(bounds_in_pixels_); return ToDIPRect(bounds_in_pixels_);
} }
@@ -970,6 +975,8 @@ void DesktopWindowTreeHostX11::HideImpl() { @@ -974,6 +979,8 @@ void DesktopWindowTreeHostX11::HideImpl() {
} }
gfx::Rect DesktopWindowTreeHostX11::GetBounds() const { gfx::Rect DesktopWindowTreeHostX11::GetBounds() const {
@ -199,7 +199,7 @@ index 298c92b..393a5dc 100644
return bounds_in_pixels_; return bounds_in_pixels_;
} }
@@ -1027,6 +1034,8 @@ void DesktopWindowTreeHostX11::SetBounds( @@ -1031,6 +1038,8 @@ void DesktopWindowTreeHostX11::SetBounds(
} }
gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const { gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
@ -208,8 +208,8 @@ index 298c92b..393a5dc 100644
return bounds_in_pixels_.origin(); return bounds_in_pixels_.origin();
} }
@@ -1140,9 +1149,15 @@ void DesktopWindowTreeHostX11::InitX11Window( @@ -1135,9 +1144,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
} use_argb_visual_ = true;
} }
+ gfx::AcceleratedWidget parent_widget = params.parent_widget; + gfx::AcceleratedWidget parent_widget = params.parent_widget;
@ -225,7 +225,7 @@ index 298c92b..393a5dc 100644
bounds_in_pixels_.y(), bounds_in_pixels_.width(), bounds_in_pixels_.y(), bounds_in_pixels_.width(),
bounds_in_pixels_.height(), bounds_in_pixels_.height(),
0, // border width 0, // border width
@@ -1797,6 +1812,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( @@ -1766,6 +1781,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
} }
break; break;
} }
@ -237,12 +237,12 @@ index 298c92b..393a5dc 100644
if (xev->xfocus.mode != NotifyGrab) { if (xev->xfocus.mode != NotifyGrab) {
ReleaseCapture(); ReleaseCapture();
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
index 09b5993..db1b2bc 100644 index c6d9257..0a36f28 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -85,6 +85,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -96,6 +96,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// internal list of open windows. // there is no dialog on the host window.
static void CleanUpWindowList(void (*func)(aura::Window* window)); const XID GetModalDialog();
+ void set_screen_bounds(const gfx::Rect& bounds) { screen_bounds_ = bounds; } + void set_screen_bounds(const gfx::Rect& bounds) { screen_bounds_ = bounds; }
+ +
@ -253,7 +253,7 @@ index 09b5993..db1b2bc 100644
protected: protected:
// Overridden from DesktopWindowTreeHost: // Overridden from DesktopWindowTreeHost:
void Init(aura::Window* content_window, void Init(aura::Window* content_window,
@@ -265,6 +271,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -272,6 +278,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// The bounds of |xwindow_|. // The bounds of |xwindow_|.
gfx::Rect bounds_in_pixels_; gfx::Rect bounds_in_pixels_;
@ -263,7 +263,7 @@ index 09b5993..db1b2bc 100644
// Whenever the bounds are set, we keep the previous set of bounds around so // Whenever the bounds are set, we keep the previous set of bounds around so
// we can have a better chance of getting the real // we can have a better chance of getting the real
// |restored_bounds_in_pixels_|. Window managers tend to send a Configure // |restored_bounds_in_pixels_|. Window managers tend to send a Configure
@@ -301,6 +310,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -308,6 +317,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// Whether we used an ARGB visual for our window. // Whether we used an ARGB visual for our window.
bool use_argb_visual_; bool use_argb_visual_;
@ -274,7 +274,7 @@ index 09b5993..db1b2bc 100644
DesktopDragDropClientAuraX11* drag_drop_client_; DesktopDragDropClientAuraX11* drag_drop_client_;
scoped_ptr<ui::EventHandler> x11_non_client_event_filter_; scoped_ptr<ui::EventHandler> x11_non_client_event_filter_;
@@ -353,6 +366,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -364,6 +377,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
@ -285,7 +285,7 @@ index 09b5993..db1b2bc 100644
}; };
diff --git ui/views/widget/desktop_aura/x11_desktop_handler.cc ui/views/widget/desktop_aura/x11_desktop_handler.cc diff --git ui/views/widget/desktop_aura/x11_desktop_handler.cc ui/views/widget/desktop_aura/x11_desktop_handler.cc
index 5ab84f9..c4095fa 100644 index 9b20295..20b1aec 100644
--- ui/views/widget/desktop_aura/x11_desktop_handler.cc --- ui/views/widget/desktop_aura/x11_desktop_handler.cc
+++ ui/views/widget/desktop_aura/x11_desktop_handler.cc +++ ui/views/widget/desktop_aura/x11_desktop_handler.cc
@@ -31,6 +31,30 @@ views::X11DesktopHandler* g_handler = NULL; @@ -31,6 +31,30 @@ views::X11DesktopHandler* g_handler = NULL;
@ -346,26 +346,26 @@ index 5ab84f9..c4095fa 100644
x_active_window_ = None; x_active_window_ = None;
} }
diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc
index 6c0168d..fbcfbfc 100644 index 6873cde..770e2a9 100644
--- ui/views/widget/widget.cc --- ui/views/widget/widget.cc
+++ ui/views/widget/widget.cc +++ ui/views/widget/widget.cc
@@ -124,6 +124,7 @@ Widget::InitParams::InitParams() @@ -125,6 +125,7 @@ Widget::InitParams::InitParams()
use_system_default_icon(false), use_system_default_icon(false),
show_state(ui::SHOW_STATE_DEFAULT), show_state(ui::SHOW_STATE_DEFAULT),
parent(NULL), parent(nullptr),
+ parent_widget(gfx::kNullAcceleratedWidget), + parent_widget(gfx::kNullAcceleratedWidget),
native_widget(NULL), native_widget(nullptr),
desktop_window_tree_host(NULL), native_theme(nullptr),
layer_type(ui::LAYER_TEXTURED), desktop_window_tree_host(nullptr),
@@ -148,6 +149,7 @@ Widget::InitParams::InitParams(Type type) @@ -150,6 +151,7 @@ Widget::InitParams::InitParams(Type type)
use_system_default_icon(false), use_system_default_icon(false),
show_state(ui::SHOW_STATE_DEFAULT), show_state(ui::SHOW_STATE_DEFAULT),
parent(NULL), parent(nullptr),
+ parent_widget(gfx::kNullAcceleratedWidget), + parent_widget(gfx::kNullAcceleratedWidget),
native_widget(NULL), native_widget(nullptr),
desktop_window_tree_host(NULL), native_theme(nullptr),
layer_type(ui::LAYER_TEXTURED), desktop_window_tree_host(nullptr),
@@ -323,7 +325,7 @@ void Widget::Init(const InitParams& in_params) { @@ -327,7 +329,7 @@ void Widget::Init(const InitParams& in_params) {
InitParams params = in_params; InitParams params = in_params;
params.child |= (params.type == InitParams::TYPE_CONTROL); params.child |= (params.type == InitParams::TYPE_CONTROL);
@ -374,7 +374,7 @@ index 6c0168d..fbcfbfc 100644
if (params.opacity == views::Widget::InitParams::INFER_OPACITY && if (params.opacity == views::Widget::InitParams::INFER_OPACITY &&
params.type != views::Widget::InitParams::TYPE_WINDOW && params.type != views::Widget::InitParams::TYPE_WINDOW &&
@@ -386,7 +388,12 @@ void Widget::Init(const InitParams& in_params) { @@ -390,7 +392,12 @@ void Widget::Init(const InitParams& in_params) {
Minimize(); Minimize();
} else if (params.delegate) { } else if (params.delegate) {
SetContentsView(params.delegate->GetContentsView()); SetContentsView(params.delegate->GetContentsView());
@ -389,7 +389,7 @@ index 6c0168d..fbcfbfc 100644
// This must come after SetContentsView() or it might not be able to find // This must come after SetContentsView() or it might not be able to find
// the correct NativeTheme (on Linux). See http://crbug.com/384492 // the correct NativeTheme (on Linux). See http://crbug.com/384492
diff --git ui/views/widget/widget.h ui/views/widget/widget.h diff --git ui/views/widget/widget.h ui/views/widget/widget.h
index 301c0af..de63108 100644 index b53bb48..f79ce8f 100644
--- ui/views/widget/widget.h --- ui/views/widget/widget.h
+++ ui/views/widget/widget.h +++ ui/views/widget/widget.h
@@ -232,6 +232,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, @@ -232,6 +232,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,

View File

@ -1,8 +1,8 @@
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
index 499991c..b5d6d32 100644 index 5488a95..18c184f 100644
--- Source/web/ChromeClientImpl.cpp --- Source/web/ChromeClientImpl.cpp
+++ Source/web/ChromeClientImpl.cpp +++ Source/web/ChromeClientImpl.cpp
@@ -809,7 +809,7 @@ bool ChromeClientImpl::hasOpenedPopup() const @@ -821,7 +821,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
PassRefPtrWillBeRawPtr<PopupMenu> ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select) PassRefPtrWillBeRawPtr<PopupMenu> ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select)
{ {
notifyPopupOpeningObservers(); notifyPopupOpeningObservers();
@ -12,10 +12,10 @@ index 499991c..b5d6d32 100644
ASSERT(RuntimeEnabledFeatures::pagePopupEnabled()); ASSERT(RuntimeEnabledFeatures::pagePopupEnabled());
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
index c97a89c..6d2fb40 100644 index 3efbcdf..18f0c9e3 100644
--- Source/web/WebViewImpl.cpp --- Source/web/WebViewImpl.cpp
+++ Source/web/WebViewImpl.cpp +++ Source/web/WebViewImpl.cpp
@@ -418,6 +418,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) @@ -414,6 +414,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_enableFakePageScaleAnimationForTesting(false) , m_enableFakePageScaleAnimationForTesting(false)
, m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false) , m_fakePageScaleAnimationUseAnchor(false)
@ -23,7 +23,7 @@ index c97a89c..6d2fb40 100644
, m_doingDragAndDrop(false) , m_doingDragAndDrop(false)
, m_ignoreInputEvents(false) , m_ignoreInputEvents(false)
, m_compositorDeviceScaleFactorOverride(0) , m_compositorDeviceScaleFactorOverride(0)
@@ -4018,9 +4019,14 @@ void WebViewImpl::pageScaleFactorChanged() @@ -4050,9 +4051,14 @@ void WebViewImpl::pageScaleFactorChanged()
m_client->pageScaleFactorChanged(); m_client->pageScaleFactorChanged();
} }
@ -40,10 +40,10 @@ index c97a89c..6d2fb40 100644
void WebViewImpl::startDragging(LocalFrame* frame, void WebViewImpl::startDragging(LocalFrame* frame,
diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h
index 09b718d..a1bc2ffc 100644 index c4453c1..bb6ee4e 100644
--- Source/web/WebViewImpl.h --- Source/web/WebViewImpl.h
+++ Source/web/WebViewImpl.h +++ Source/web/WebViewImpl.h
@@ -389,7 +389,8 @@ public: @@ -395,7 +395,8 @@ public:
// Returns true if popup menus should be rendered by the browser, false if // Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default). // they should be rendered by WebKit (which is the default).
@ -53,7 +53,7 @@ index 09b718d..a1bc2ffc 100644
bool shouldAutoResize() const bool shouldAutoResize() const
{ {
@@ -670,6 +671,8 @@ private: @@ -678,6 +679,8 @@ private:
float m_fakePageScaleAnimationPageScaleFactor; float m_fakePageScaleAnimationPageScaleFactor;
bool m_fakePageScaleAnimationUseAnchor; bool m_fakePageScaleAnimationUseAnchor;
@ -63,10 +63,10 @@ index 09b718d..a1bc2ffc 100644
bool m_ignoreInputEvents; bool m_ignoreInputEvents;
diff --git public/web/WebView.h public/web/WebView.h diff --git public/web/WebView.h public/web/WebView.h
index 83d8c13..350bca4 100644 index 843f633..f922327 100644
--- public/web/WebView.h --- public/web/WebView.h
+++ public/web/WebView.h +++ public/web/WebView.h
@@ -400,6 +400,7 @@ public: @@ -411,6 +411,7 @@ public:
// Sets whether select popup menus should be rendered by the browser. // Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void setUseExternalPopupMenus(bool); BLINK_EXPORT static void setUseExternalPopupMenus(bool);

View File

@ -6,12 +6,10 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include <gl/gl.h> #include <gl/gl.h>
#include <gl/glu.h>
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#elif defined(OS_LINUX) #elif defined(OS_LINUX)
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h>
#else #else
#error Platform is not supported. #error Platform is not supported.
#endif #endif

View File

@ -76,7 +76,7 @@ const CefRect kExpectedRectLI[] = {
const CefRect kEditBoxRect(412, 245, 60, 22); const CefRect kEditBoxRect(412, 245, 60, 22);
const CefRect kNavigateButtonRect(360, 271, 140, 22); const CefRect kNavigateButtonRect(360, 271, 140, 22);
const CefRect kSelectRect(467, 22, 75, 20); const CefRect kSelectRect(467, 22, 75, 20);
const CefRect kExpandedSelectRect(466, 42, 81, 334); const CefRect kExpandedSelectRect(463, 42, 81, 342);
const CefRect kDropDivRect(8, 332, 52, 52); const CefRect kDropDivRect(8, 332, 52, 52);
const CefRect kDragDivRect(71, 342, 30, 30); const CefRect kDragDivRect(71, 342, 30, 30);
const int kDefaultVerticalScrollbarWidth = 17; const int kDefaultVerticalScrollbarWidth = 17;
@ -85,7 +85,7 @@ const int kVerticalScrollbarWidth = GetSystemMetrics(SM_CXVSCROLL);
const CefRect kEditBoxRect(442, 251, 46, 16); const CefRect kEditBoxRect(442, 251, 46, 16);
const CefRect kNavigateButtonRect(375, 275, 130, 20); const CefRect kNavigateButtonRect(375, 275, 130, 20);
const CefRect kSelectRect(461, 21, 87, 26); const CefRect kSelectRect(461, 21, 87, 26);
const CefRect kExpandedSelectRect(466, 42, 78, 286); const CefRect kExpandedSelectRect(463, 42, 78, 286);
const CefRect kDropDivRect(9, 330, 52, 52); const CefRect kDropDivRect(9, 330, 52, 52);
const CefRect kDragDivRect(60, 330, 52, 52); const CefRect kDragDivRect(60, 330, 52, 52);
const int kVerticalScrollbarWidth = 15; const int kVerticalScrollbarWidth = 15;
@ -93,7 +93,7 @@ const int kVerticalScrollbarWidth = 15;
const CefRect kEditBoxRect(434, 246, 60, 20); const CefRect kEditBoxRect(434, 246, 60, 20);
const CefRect kNavigateButtonRect(380, 271, 140, 22); const CefRect kNavigateButtonRect(380, 271, 140, 22);
const CefRect kSelectRect(467, 22, 75, 20); const CefRect kSelectRect(467, 22, 75, 20);
const CefRect kExpandedSelectRect(466, 42, 79, 334); const CefRect kExpandedSelectRect(463, 42, 81, 342);
const CefRect kDropDivRect(8, 332, 52, 52); const CefRect kDropDivRect(8, 332, 52, 52);
const CefRect kDragDivRect(71, 342, 30, 30); const CefRect kDragDivRect(71, 342, 30, 30);
const int kDefaultVerticalScrollbarWidth = 14; const int kDefaultVerticalScrollbarWidth = 14;

View File

@ -522,9 +522,6 @@ class V8RendererTest : public ClientAppRenderer::Delegate,
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(NULL); CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(NULL);
// Exit the V8 context.
EXPECT_TRUE(context->Exit());
EXPECT_TRUE(value.get()); EXPECT_TRUE(value.get());
EXPECT_TRUE(value->IsObject()); EXPECT_TRUE(value->IsObject());
EXPECT_FALSE(value->GetUserData().get()); EXPECT_FALSE(value->GetUserData().get());
@ -540,6 +537,9 @@ class V8RendererTest : public ClientAppRenderer::Delegate,
EXPECT_FALSE(value->IsNull()); EXPECT_FALSE(value->IsNull());
EXPECT_FALSE(value->IsString()); EXPECT_FALSE(value->IsString());
// Exit the V8 context.
EXPECT_TRUE(context->Exit());
DestroyTest(); DestroyTest();
} }