diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 3ba18e280..504ce2c9e 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -17,5 +17,5 @@ { 'chromium_url': 'http://src.chromium.org/svn/trunk/src', - 'chromium_revision': '251746', + 'chromium_revision': '261035', } diff --git a/cef.gyp b/cef.gyp index 7ff854dd2..a737f25d7 100644 --- a/cef.gyp +++ b/cef.gyp @@ -10,10 +10,10 @@ 'about_credits_file': '<(SHARED_INTERMEDIATE_DIR)/about_credits.html', 'framework_name': 'Chromium Embedded Framework', 'revision': 'log_file.str, src->log_file.length, &target->log_file, copy); target->log_severity = src->log_severity; - target->release_dcheck_enabled = src->release_dcheck_enabled; cef_string_set(src->javascript_flags.str, src->javascript_flags.length, &target->javascript_flags, copy); diff --git a/libcef/browser/application_mac.h b/libcef/browser/application_mac.h deleted file mode 100644 index 440cbf180..000000000 --- a/libcef/browser/application_mac.h +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights -// reserved. Use of this source code is governed by a BSD-style license that can -// be found in the LICENSE file. - -#ifndef CEF_LIBCEF_BROWSER_APPLICATION_MAC_H_ -#define CEF_LIBCEF_BROWSER_APPLICATION_MAC_H_ - -// Create the CefCrApplication instance used by secondary processes. -void CefCrApplicationCreate(); - -#endif // CEF_LIBCEF_BROWSER_APPLICATION_MAC_H_ diff --git a/libcef/browser/application_mac.mm b/libcef/browser/application_mac.mm deleted file mode 100644 index 1e9a9bd4b..000000000 --- a/libcef/browser/application_mac.mm +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2012 The Chromium Embedded Framework Authors. -// Portions copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "libcef/browser/application_mac.h" - -#include "base/mac/scoped_sending_event.h" -#include "base/message_loop/message_pump_mac.h" - -@interface CefCrApplication : NSApplication { - @private - BOOL handlingSendEvent_; -} - -// CrAppProtocol: -- (BOOL)isHandlingSendEvent; - -// CrAppControlProtocol: -- (void)setHandlingSendEvent:(BOOL)handlingSendEvent; - -@end - -@implementation CefCrApplication - -- (BOOL)isHandlingSendEvent { - return handlingSendEvent_; -} - -- (void)sendEvent:(NSEvent*)event { - BOOL wasHandlingSendEvent = handlingSendEvent_; - handlingSendEvent_ = YES; - [super sendEvent:event]; - handlingSendEvent_ = wasHandlingSendEvent; -} - -- (void)setHandlingSendEvent:(BOOL)handlingSendEvent { - handlingSendEvent_ = handlingSendEvent; -} - -@end - -void CefCrApplicationCreate() { - [CefCrApplication sharedApplication]; -} diff --git a/libcef/browser/backing_store_osr.cc b/libcef/browser/backing_store_osr.cc index 7496c7d6c..1fcca11f8 100644 --- a/libcef/browser/backing_store_osr.cc +++ b/libcef/browser/backing_store_osr.cc @@ -29,10 +29,9 @@ BackingStoreOSR::BackingStoreOSR(content::RenderWidgetHost* widget, device_scale_factor_(scale_factor) { gfx::Size pixel_size = gfx::ToFlooredSize( gfx::ScaleSize(size, device_scale_factor_)); - device_.reset(new SkBitmapDevice(SkBitmap::kARGB_8888_Config, - pixel_size.width(), - pixel_size.height(), - true)); + SkImageInfo info = SkImageInfo::MakeN32Premul(pixel_size.width(), + pixel_size.height()); + device_.reset(SkBitmapDevice::Create(info)); canvas_.reset(new SkCanvas(device_.get())); canvas_->drawColor(SK_ColorWHITE); @@ -49,11 +48,9 @@ void BackingStoreOSR::ScaleFactorChanged(float scale_factor) { gfx::Size pixel_size = gfx::ToFlooredSize( gfx::ScaleSize(size(), device_scale_factor_)); - scoped_ptr new_device( - new SkBitmapDevice(SkBitmap::kARGB_8888_Config, - pixel_size.width(), - pixel_size.height(), - true)); + SkImageInfo info = SkImageInfo::MakeN32Premul(pixel_size.width(), + pixel_size.height()); + scoped_ptr new_device(SkBitmapDevice::Create(info)); scoped_ptr new_canvas(new SkCanvas(new_device.get())); diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index 059a19fbe..d0f266ccd 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -12,11 +12,13 @@ class CefBrowserContext : public content::BrowserContext { public: virtual net::URLRequestContextGetter* CreateRequestContext( - content::ProtocolHandlerMap* protocol_handlers) = 0; + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) = 0; virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory, - content::ProtocolHandlerMap* protocol_handlers) = 0; + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) = 0; }; #endif // CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_H_ diff --git a/libcef/browser/browser_context_impl.cc b/libcef/browser/browser_context_impl.cc index 4fa02428d..02dc9f28f 100644 --- a/libcef/browser/browser_context_impl.cc +++ b/libcef/browser/browser_context_impl.cc @@ -255,6 +255,7 @@ void CefBrowserContextImpl::RequestMidiSysExPermission( int render_view_id, int bridge_id, const GURL& requesting_frame, + bool user_gesture, const MidiSysExPermissionCallback& callback) { // TODO(CEF): Implement Web MIDI API permission handling. callback.Run(false); @@ -298,12 +299,14 @@ quota::SpecialStoragePolicy* CefBrowserContextImpl::GetSpecialStoragePolicy() { } net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext( - content::ProtocolHandlerMap* protocol_handlers) { + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) { DCHECK(!url_request_getter_); url_request_getter_ = new CefURLRequestContextGetter( BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), - protocol_handlers); + protocol_handlers, + protocol_interceptors.Pass()); resource_context_->set_url_request_context_getter(url_request_getter_.get()); return url_request_getter_.get(); } @@ -312,6 +315,7 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory, - content::ProtocolHandlerMap* protocol_handlers) { + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) { return NULL; } diff --git a/libcef/browser/browser_context_impl.h b/libcef/browser/browser_context_impl.h index a5b1fc14b..45396f1b5 100644 --- a/libcef/browser/browser_context_impl.h +++ b/libcef/browser/browser_context_impl.h @@ -44,6 +44,7 @@ class CefBrowserContextImpl : public CefBrowserContext { int render_view_id, int bridge_id, const GURL& requesting_frame, + bool user_gesture, const MidiSysExPermissionCallback& callback) OVERRIDE; virtual void CancelMidiSysExPermissionRequest( int render_process_id, @@ -66,11 +67,13 @@ class CefBrowserContextImpl : public CefBrowserContext { // CefBrowserContext methods. virtual net::URLRequestContextGetter* CreateRequestContext( - content::ProtocolHandlerMap* protocol_handlers) OVERRIDE; + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE; virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory, - content::ProtocolHandlerMap* protocol_handlers) OVERRIDE; + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE; private: class CefResourceContext; diff --git a/libcef/browser/browser_context_proxy.cc b/libcef/browser/browser_context_proxy.cc index c809df83b..3dbd8cb4e 100644 --- a/libcef/browser/browser_context_proxy.cc +++ b/libcef/browser/browser_context_proxy.cc @@ -117,6 +117,7 @@ void CefBrowserContextProxy::RequestMidiSysExPermission( int render_view_id, int bridge_id, const GURL& requesting_frame, + bool user_gesture, const MidiSysExPermissionCallback& callback) { // TODO(CEF): Implement Web MIDI API permission handling. callback.Run(false); @@ -156,7 +157,8 @@ quota::SpecialStoragePolicy* CefBrowserContextProxy::GetSpecialStoragePolicy() { } net::URLRequestContextGetter* CefBrowserContextProxy::CreateRequestContext( - content::ProtocolHandlerMap* protocol_handlers) { + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) { DCHECK(!url_request_getter_); url_request_getter_ = new CefURLRequestContextGetterProxy(handler_, @@ -170,6 +172,7 @@ net::URLRequestContextGetter* CefBrowserContextProxy::CreateRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory, - content::ProtocolHandlerMap* protocol_handlers) { + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) { return NULL; } diff --git a/libcef/browser/browser_context_proxy.h b/libcef/browser/browser_context_proxy.h index 4b012ab44..86c6be427 100644 --- a/libcef/browser/browser_context_proxy.h +++ b/libcef/browser/browser_context_proxy.h @@ -52,6 +52,7 @@ class CefBrowserContextProxy : public CefBrowserContext { int render_view_id, int bridge_id, const GURL& requesting_frame, + bool user_gesture, const MidiSysExPermissionCallback& callback) OVERRIDE; virtual void CancelMidiSysExPermissionRequest( int render_process_id, @@ -74,11 +75,13 @@ class CefBrowserContextProxy : public CefBrowserContext { // CefBrowserContext methods. virtual net::URLRequestContextGetter* CreateRequestContext( - content::ProtocolHandlerMap* protocol_handlers) OVERRIDE; + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE; virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory, - content::ProtocolHandlerMap* protocol_handlers) OVERRIDE; + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE; CefRefPtr handler() const { return handler_; } diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index b9f0ce742..8a9fd5ee9 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -672,7 +672,7 @@ void CefBrowserHostImpl::CloseBrowser(bool force_close) { if (contents && contents->NeedToFireBeforeUnload()) { // Will result in a call to BeforeUnloadFired() and, if the close isn't // canceled, CloseContents(). - contents->GetRenderViewHost()->FirePageBeforeUnload(false); + contents->GetMainFrame()->DispatchBeforeUnload(false); } else { CloseContents(contents); } @@ -1415,8 +1415,11 @@ CefRefPtr CefBrowserHostImpl::GetFrameForRequest( content::ResourceRequestInfo::ForRequest(request); if (!info) return NULL; - return GetOrCreateFrame(info->GetFrameID(), info->GetParentFrameID(), - info->IsMainFrame(), base::string16(), GURL()); + return GetOrCreateFrame(info->GetRenderFrameID(), + info->GetParentRenderFrameID(), + info->IsMainFrame(), + base::string16(), + GURL()); } void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) { @@ -1731,7 +1734,8 @@ content::WebContents* CefBrowserHostImpl::OpenURLFromTab( return source; } -void CefBrowserHostImpl::LoadingStateChanged(content::WebContents* source) { +void CefBrowserHostImpl::LoadingStateChanged(content::WebContents* source, + bool to_different_document) { int current_index = web_contents_->GetController().GetLastCommittedEntryIndex(); int max_index = web_contents_->GetController().GetEntryCount() - 1; @@ -1939,7 +1943,7 @@ bool CefBrowserHostImpl::ShouldCreateWebContents( void CefBrowserHostImpl::WebContentsCreated( content::WebContents* source_contents, - int64 source_frame_id, + int opener_render_frame_id, const base::string16& frame_name, const GURL& target_url, content::WebContents* new_contents) { @@ -2025,7 +2029,8 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( const CommandLine& command_line = *CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kEnableMediaStream)) { // Cancel the request. - callback.Run(devices, scoped_ptr()); + callback.Run(devices, content::MEDIA_DEVICE_PERMISSION_DENIED, + scoped_ptr()); return; } @@ -2059,7 +2064,8 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( } } - callback.Run(devices, scoped_ptr()); + callback.Run(devices, content::MEDIA_DEVICE_OK, + scoped_ptr()); } diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index ef52c43ce..b2528dbb9 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -313,7 +313,8 @@ class CefBrowserHostImpl : public CefBrowserHost, virtual content::WebContents* OpenURLFromTab( content::WebContents* source, const content::OpenURLParams& params) OVERRIDE; - virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE; + virtual void LoadingStateChanged(content::WebContents* source, + bool to_different_document) OVERRIDE; virtual void CloseContents(content::WebContents* source) OVERRIDE; virtual void UpdateTargetURL(content::WebContents* source, int32 page_id, @@ -352,7 +353,7 @@ class CefBrowserHostImpl : public CefBrowserHost, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) OVERRIDE; virtual void WebContentsCreated(content::WebContents* source_contents, - int64 source_frame_id, + int opener_render_frame_id, const base::string16& frame_name, const GURL& target_url, content::WebContents* new_contents) OVERRIDE; diff --git a/libcef/browser/browser_host_impl_gtk.cc b/libcef/browser/browser_host_impl_gtk.cc index 3f381da68..257f53637 100644 --- a/libcef/browser/browser_host_impl_gtk.cc +++ b/libcef/browser/browser_host_impl_gtk.cc @@ -85,7 +85,7 @@ void AddFiltersForAcceptTypes(GtkFileChooser* chooser, bool has_filter = false; for (size_t i = 0; i < accept_types.size(); ++i) { - std::string ascii_type = UTF16ToASCII(accept_types[i]); + std::string ascii_type = base::UTF16ToASCII(accept_types[i]); if (ascii_type.length()) { // Just treat as extension if contains '.' as the first character. if (ascii_type[0] == '.') { diff --git a/libcef/browser/browser_host_impl_mac.mm b/libcef/browser/browser_host_impl_mac.mm index 74d3302aa..4b1271450 100644 --- a/libcef/browser/browser_host_impl_mac.mm +++ b/libcef/browser/browser_host_impl_mac.mm @@ -17,6 +17,7 @@ #include "base/mac/scoped_nsautorelease_pool.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" +#include "base/strings/utf_string_conversions.h" #include "base/threading/thread_restrictions.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/web_contents.h" @@ -128,7 +129,7 @@ NSMutableArray* GetFileTypesFromAcceptTypes( const std::vector& accept_types) { NSMutableArray* acceptArray = [[NSMutableArray alloc] init]; for (size_t i=0; i str) { tmp_file = tmp_file.AddExtension(L"txt"); const std::string& data = str->data(); - int write_ct = file_util::WriteFile(tmp_file, data.c_str(), data.size()); + int write_ct = base::WriteFile(tmp_file, data.c_str(), data.size()); DCHECK_EQ(static_cast(data.size()), write_ct); ui::win::OpenItemViaShell(tmp_file); @@ -213,7 +213,7 @@ std::wstring GetFilterStringFromAcceptTypes( std::vector descriptions; for (size_t i = 0; i < accept_types.size(); ++i) { - std::string ascii_type = UTF16ToASCII(accept_types[i]); + std::string ascii_type = base::UTF16ToASCII(accept_types[i]); if (ascii_type.length()) { // Just treat as extension if contains '.' as the first character. if (ascii_type[0] == '.') { @@ -448,7 +448,7 @@ WORD KeyStatesToWord() { return result; } -// From webkit/common/cursors/webcursor_win.cc. +// From content/common/cursors/webcursor_win.cc. using blink::WebCursorInfo; diff --git a/libcef/browser/browser_message_filter.cc b/libcef/browser/browser_message_filter.cc index ac77165b2..b97858554 100644 --- a/libcef/browser/browser_message_filter.cc +++ b/libcef/browser/browser_message_filter.cc @@ -100,7 +100,7 @@ void CefBrowserMessageFilter::OnCreateWindow( CefContentBrowserClient::LastCreateWindowParams lcwp; lcwp.opener_process_id = host_->GetID(); lcwp.opener_view_id = params.opener_id; - lcwp.opener_frame_id = params.opener_frame_id; + lcwp.opener_frame_id = params.opener_render_frame_id; lcwp.target_url = params.target_url; lcwp.target_frame_name = params.frame_name; CefContentBrowserClient::Get()->set_last_create_window_params(lcwp); diff --git a/libcef/browser/browser_urlrequest_impl.cc b/libcef/browser/browser_urlrequest_impl.cc index ea40af430..b576f12ae 100644 --- a/libcef/browser/browser_urlrequest_impl.cc +++ b/libcef/browser/browser_urlrequest_impl.cc @@ -266,12 +266,7 @@ class CefBrowserURLRequest::Context if (cef_flags & UR_FLAG_SKIP_CACHE) load_flags |= net::LOAD_BYPASS_CACHE; - if (cef_flags & UR_FLAG_ALLOW_CACHED_CREDENTIALS) { - if (!(cef_flags & UR_FLAG_ALLOW_COOKIES)) { - load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; - load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; - } - } else { + if (!(cef_flags & UR_FLAG_ALLOW_CACHED_CREDENTIALS)) { load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; diff --git a/libcef/browser/chrome_browser_process_stub.cc b/libcef/browser/chrome_browser_process_stub.cc index 6d7f80ef1..4703f0faf 100644 --- a/libcef/browser/chrome_browser_process_stub.cc +++ b/libcef/browser/chrome_browser_process_stub.cc @@ -30,6 +30,11 @@ MetricsService* ChromeBrowserProcessStub::metrics_service() { return NULL; } +rappor::RapporService* ChromeBrowserProcessStub::rappor_service() { + NOTIMPLEMENTED(); + return NULL; +} + IOThread* ChromeBrowserProcessStub::io_thread() { NOTIMPLEMENTED(); return NULL; @@ -109,17 +114,10 @@ GpuModeManager* ChromeBrowserProcessStub::gpu_mode_manager() { return NULL; } -AutomationProviderList* - ChromeBrowserProcessStub::GetAutomationProviderList() { - NOTIMPLEMENTED(); - return NULL; -} - void ChromeBrowserProcessStub::CreateDevToolsHttpProtocolHandler( chrome::HostDesktopType host_desktop_type, const std::string& ip, - int port, - const std::string& frontend_url) { + int port) { } unsigned int ChromeBrowserProcessStub::AddRefModule() { diff --git a/libcef/browser/chrome_browser_process_stub.h b/libcef/browser/chrome_browser_process_stub.h index bfb3bbf2f..57cc016f4 100644 --- a/libcef/browser/chrome_browser_process_stub.h +++ b/libcef/browser/chrome_browser_process_stub.h @@ -32,6 +32,7 @@ class ChromeBrowserProcessStub : public BrowserProcess { virtual void ResourceDispatcherHostCreated() OVERRIDE; virtual void EndSession() OVERRIDE; virtual MetricsService* metrics_service() OVERRIDE; + virtual rappor::RapporService* rappor_service() OVERRIDE; virtual IOThread* io_thread() OVERRIDE; virtual WatchDogThread* watchdog_thread() OVERRIDE; virtual ProfileManager* profile_manager() OVERRIDE; @@ -48,12 +49,10 @@ class ChromeBrowserProcessStub : public BrowserProcess { virtual IconManager* icon_manager() OVERRIDE; virtual GLStringManager* gl_string_manager() OVERRIDE; virtual GpuModeManager* gpu_mode_manager() OVERRIDE; - virtual AutomationProviderList* GetAutomationProviderList() OVERRIDE; virtual void CreateDevToolsHttpProtocolHandler( chrome::HostDesktopType host_desktop_type, const std::string& ip, - int port, - const std::string& frontend_url) OVERRIDE; + int port) OVERRIDE; virtual unsigned int AddRefModule() OVERRIDE; virtual unsigned int ReleaseModule() OVERRIDE; virtual bool IsShuttingDown() OVERRIDE; diff --git a/libcef/browser/chrome_scheme_handler.cc b/libcef/browser/chrome_scheme_handler.cc index 80a5535c3..527603509 100644 --- a/libcef/browser/chrome_scheme_handler.cc +++ b/libcef/browser/chrome_scheme_handler.cc @@ -28,11 +28,11 @@ #include "content/browser/net/view_http_cache_job_factory.h" #include "content/browser/net/view_blob_internals_job_factory.h" #include "content/public/common/url_constants.h" +#include "content/public/common/user_agent.h" #include "grit/cef_resources.h" #include "ipc/ipc_channel.h" #include "net/url_request/url_request.h" #include "v8/include/v8.h" -#include "webkit/common/user_agent/user_agent_util.h" namespace scheme { @@ -271,11 +271,11 @@ class Delegate : public InternalHandlerDelegate { parser.Add("OS", GetOSType()); parser.Add("WEBKIT", base::StringPrintf("%d.%d", - webkit_glue::GetWebKitMajorVersion(), - webkit_glue::GetWebKitMinorVersion())); + content::GetWebKitMajorVersion(), + content::GetWebKitMinorVersion())); parser.Add("JAVASCRIPT", v8::V8::GetVersion()); parser.Add("FLASH", std::string()); // Value populated asynchronously. - parser.Add("USERAGENT", content::GetUserAgent(GURL())); + parser.Add("USERAGENT", CefContentClient::Get()->GetUserAgent()); parser.Add("COMMANDLINE", GetCommandLine()); parser.Add("MODULEPATH", GetModulePath()); parser.Add("CACHEPATH", CefString(CefContext::Get()->cache_path().value())); diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index ac6bbb396..2e67f8d3d 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -567,10 +567,13 @@ void CefContentBrowserClient::RenderProcessWillLaunch( net::URLRequestContextGetter* CefContentBrowserClient::CreateRequestContext( content::BrowserContext* content_browser_context, - content::ProtocolHandlerMap* protocol_handlers) { + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) { CefBrowserContext* cef_browser_context = static_cast(content_browser_context); - return cef_browser_context->CreateRequestContext(protocol_handlers); + return cef_browser_context->CreateRequestContext( + protocol_handlers, + protocol_interceptors.Pass()); } net::URLRequestContextGetter* @@ -578,11 +581,15 @@ CefContentBrowserClient::CreateRequestContextForStoragePartition( content::BrowserContext* content_browser_context, const base::FilePath& partition_path, bool in_memory, - content::ProtocolHandlerMap* protocol_handlers) { + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) { CefBrowserContext* cef_browser_context = static_cast(content_browser_context); return cef_browser_context->CreateRequestContextForStoragePartition( - partition_path, in_memory, protocol_handlers); + partition_path, + in_memory, + protocol_handlers, + protocol_interceptors.Pass()); } bool CefContentBrowserClient::IsHandledURL(const GURL& url) { @@ -610,7 +617,6 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( #endif switches::kDisablePackLoading, switches::kEnableCrashReporter, - switches::kEnableReleaseDcheck, switches::kLang, switches::kLocalesDirPath, switches::kLogFile, @@ -873,7 +879,7 @@ std::string CefContentBrowserClient::GetDefaultDownloadName() { #if defined(OS_POSIX) && !defined(OS_MACOSX) void CefContentBrowserClient::GetAdditionalMappedFilesForChildProcess( - const CommandLine& command_line, + const base::CommandLine& command_line, int child_process_id, std::vector* mappings) { int crash_signal_fd = GetCrashSignalFD(command_line); diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index f56c94799..0ee555533 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -88,14 +88,16 @@ class CefContentBrowserClient : public content::ContentBrowserClient { content::RenderProcessHost* host) OVERRIDE; virtual net::URLRequestContextGetter* CreateRequestContext( content::BrowserContext* browser_context, - content::ProtocolHandlerMap* protocol_handlers) OVERRIDE; + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE; virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( content::BrowserContext* browser_context, const base::FilePath& partition_path, bool in_memory, - content::ProtocolHandlerMap* protocol_handlers) OVERRIDE; + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE; virtual bool IsHandledURL(const GURL& url) OVERRIDE; - virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, + virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) OVERRIDE; virtual content::QuotaPermissionContext* CreateQuotaPermissionContext() OVERRIDE; @@ -139,7 +141,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient { #if defined(OS_POSIX) && !defined(OS_MACOSX) virtual void GetAdditionalMappedFilesForChildProcess( - const CommandLine& command_line, + const base::CommandLine& command_line, int child_process_id, std::vector* mappings) OVERRIDE; #endif diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc index e1f24b659..3754971ba 100644 --- a/libcef/browser/context.cc +++ b/libcef/browser/context.cc @@ -31,10 +31,6 @@ #include "content/public/common/content_switches.h" #include "ui/base/ui_base_switches.h" -#if defined(OS_MACOSX) -#include "libcef/browser/application_mac.h" -#endif - #if defined(OS_WIN) #include "content/public/app/startup_helper_win.h" #include "sandbox/win/src/sandbox_types.h" @@ -80,11 +76,6 @@ int CefExecuteProcess(const CefMainArgs& args, if (process_type.empty()) return -1; -#if defined(OS_MACOSX) - // Create the CefCrApplication instance. - CefCrApplicationCreate(); -#endif - CefMainDelegate main_delegate(application); // Execute the secondary process. @@ -95,12 +86,18 @@ int CefExecuteProcess(const CefMainArgs& args, windows_sandbox_info = &sandbox_info; } - return content::ContentMain(args.instance, - static_cast(windows_sandbox_info), - &main_delegate); + content::ContentMainParams params(&main_delegate); + params.instance = args.instance; + params.sandbox_info = + static_cast(windows_sandbox_info); + + return content::ContentMain(params); #else - return content::ContentMain(args.argc, const_cast(args.argv), - &main_delegate); + content::ContentMainParams params(&main_delegate); + params.argc = args.argc; + params.argv = const_cast(args.argv); + + return content::ContentMain(params); #endif } @@ -272,13 +269,18 @@ bool CefContext::Initialize(const CefMainArgs& args, settings_.no_sandbox = true; } - exit_code = main_runner_->Initialize(args.instance, - static_cast(windows_sandbox_info), - main_delegate_.get()); + content::ContentMainParams params(main_delegate_.get()); + params.instance = args.instance; + params.sandbox_info = + static_cast(windows_sandbox_info); + + exit_code = main_runner_->Initialize(params); #else - exit_code = main_runner_->Initialize(args.argc, - const_cast(args.argv), - main_delegate_.get()); + content::ContentMainParams params(main_delegate_.get()); + params.argc = args.argc; + params.argv = const_cast(args.argv); + + exit_code = main_runner_->Initialize(params); #endif DCHECK_LT(exit_code, 0); diff --git a/libcef/browser/devtools_frontend.cc b/libcef/browser/devtools_frontend.cc index e5bb11cbc..e0c753c34 100644 --- a/libcef/browser/devtools_frontend.cc +++ b/libcef/browser/devtools_frontend.cc @@ -13,6 +13,7 @@ #include "base/strings/utf_string_conversions.h" #include "content/public/browser/devtools_http_handler.h" #include "content/public/browser/devtools_manager.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" @@ -84,8 +85,7 @@ void CefDevToolsFrontend::RenderViewCreated( } void CefDevToolsFrontend::DocumentOnLoadCompletedInMainFrame(int32 page_id) { - web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame( - base::string16(), + web_contents()->GetMainFrame()->ExecuteJavaScript( base::ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); } diff --git a/libcef/browser/media_capture_devices_dispatcher.cc b/libcef/browser/media_capture_devices_dispatcher.cc index a4b778280..0bd4082dc 100644 --- a/libcef/browser/media_capture_devices_dispatcher.cc +++ b/libcef/browser/media_capture_devices_dispatcher.cc @@ -8,8 +8,7 @@ #include "base/prefs/pref_service.h" #include "chrome/common/pref_names.h" #include "content/public/browser/browser_thread.h" -#include "content/public/browser/media_devices_monitor.h" -#include "content/public/common/media_stream_request.h" +#include "content/public/browser/media_capture_devices.h" using content::BrowserThread; using content::MediaStreamDevices; @@ -40,8 +39,7 @@ CefMediaCaptureDevicesDispatcher* return Singleton::get(); } -CefMediaCaptureDevicesDispatcher::CefMediaCaptureDevicesDispatcher() - : devices_enumerated_(false) {} +CefMediaCaptureDevicesDispatcher::CefMediaCaptureDevicesDispatcher() {} CefMediaCaptureDevicesDispatcher::~CefMediaCaptureDevicesDispatcher() {} @@ -53,41 +51,6 @@ void CefMediaCaptureDevicesDispatcher::RegisterPrefs( std::string()); } -void CefMediaCaptureDevicesDispatcher::AddObserver(Observer* observer) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - if (!observers_.HasObserver(observer)) - observers_.AddObserver(observer); -} - -void CefMediaCaptureDevicesDispatcher::RemoveObserver(Observer* observer) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - observers_.RemoveObserver(observer); -} - -const MediaStreamDevices& -CefMediaCaptureDevicesDispatcher::GetAudioCaptureDevices() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - if (!devices_enumerated_) { - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::Bind(&content::EnsureMonitorCaptureDevices)); - devices_enumerated_ = true; - } - return audio_devices_; -} - -const MediaStreamDevices& -CefMediaCaptureDevicesDispatcher::GetVideoCaptureDevices() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - if (!devices_enumerated_) { - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::Bind(&content::EnsureMonitorCaptureDevices)); - devices_enumerated_ = true; - } - return video_devices_; -} - void CefMediaCaptureDevicesDispatcher::GetDefaultDevices( PrefService* prefs, bool audio, @@ -132,24 +95,10 @@ void CefMediaCaptureDevicesDispatcher::GetRequestedDevice( } } -void CefMediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged( - const content::MediaStreamDevices& devices) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - base::Bind( - &CefMediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread, - base::Unretained(this), devices)); +void CefMediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged() { } -void CefMediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged( - const content::MediaStreamDevices& devices) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - base::Bind( - &CefMediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread, - base::Unretained(this), devices)); +void CefMediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged() { } void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged( @@ -159,23 +108,6 @@ void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged( const GURL& security_origin, const content::MediaStreamDevice& device, content::MediaRequestState state) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - base::Bind( - &CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread, - base::Unretained(this), render_process_id, render_view_id, - page_request_id, device, state)); - -} - -void CefMediaCaptureDevicesDispatcher::OnAudioStreamPlayingChanged( - int render_process_id, - int render_view_id, - int stream_id, - bool is_playing, - float power_dbfs, - bool clipped) { } void CefMediaCaptureDevicesDispatcher::OnCreatingAudioStream( @@ -183,34 +115,27 @@ void CefMediaCaptureDevicesDispatcher::OnCreatingAudioStream( int render_view_id) { } -void CefMediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread( - const content::MediaStreamDevices& devices) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - devices_enumerated_ = true; - audio_devices_ = devices; - FOR_EACH_OBSERVER(Observer, observers_, - OnUpdateAudioDevices(audio_devices_)); +void CefMediaCaptureDevicesDispatcher::OnAudioStreamPlaying( + int render_process_id, + int render_frame_id, + int stream_id, + const ReadPowerAndClipCallback& power_read_callback) { } -void CefMediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread( - const content::MediaStreamDevices& devices){ - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - devices_enumerated_ = true; - video_devices_ = devices; - FOR_EACH_OBSERVER(Observer, observers_, - OnUpdateVideoDevices(video_devices_)); +void CefMediaCaptureDevicesDispatcher::OnAudioStreamStopped( + int render_process_id, + int render_frame_id, + int stream_id) { } -void CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread( - int render_process_id, - int render_view_id, - int page_request_id, - const content::MediaStreamDevice& device, - content::MediaRequestState state) { - FOR_EACH_OBSERVER(Observer, observers_, - OnRequestUpdate(render_process_id, - render_view_id, - page_request_id, - device, - state)); +const MediaStreamDevices& +CefMediaCaptureDevicesDispatcher::GetAudioCaptureDevices() { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + return content::MediaCaptureDevices::GetInstance()->GetAudioCaptureDevices(); +} + +const MediaStreamDevices& +CefMediaCaptureDevicesDispatcher::GetVideoCaptureDevices() { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + return content::MediaCaptureDevices::GetInstance()->GetVideoCaptureDevices(); } diff --git a/libcef/browser/media_capture_devices_dispatcher.h b/libcef/browser/media_capture_devices_dispatcher.h index 95f0b5816..bde4f05ef 100644 --- a/libcef/browser/media_capture_devices_dispatcher.h +++ b/libcef/browser/media_capture_devices_dispatcher.h @@ -19,46 +19,14 @@ class PrefService; // layer. Based on chrome/browser/media/media_capture_devices_dispatcher.[h|cc]. class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { public: - class Observer { - public: - // Handle an information update consisting of a up-to-date audio capture - // device lists. This happens when a microphone is plugged in or unplugged. - virtual void OnUpdateAudioDevices( - const content::MediaStreamDevices& devices) {} - - // Handle an information update consisting of a up-to-date video capture - // device lists. This happens when a camera is plugged in or unplugged. - virtual void OnUpdateVideoDevices( - const content::MediaStreamDevices& devices) {} - - // Handle an information update related to a media stream request. - virtual void OnRequestUpdate( - int render_process_id, - int render_view_id, - int page_request_id, - const content::MediaStreamDevice& device, - const content::MediaRequestState state) {} - - virtual ~Observer() {} - }; - static CefMediaCaptureDevicesDispatcher* GetInstance(); // Registers the preferences related to Media Stream default devices. static void RegisterPrefs(PrefRegistrySimple* registry); - // Methods for observers. Called on UI thread. - // Observers should add themselves on construction and remove themselves - // on destruction. - void AddObserver(Observer* observer); - void RemoveObserver(Observer* observer); - const content::MediaStreamDevices& GetAudioCaptureDevices(); - const content::MediaStreamDevices& GetVideoCaptureDevices(); - // Helper to get the default devices which can be used by the media request, // if the return list is empty, it means there is no available device on the - // OS. - // Called on the UI thread. + // OS. Called on the UI thread. void GetDefaultDevices(PrefService* prefs, bool audio, bool video, @@ -67,17 +35,15 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { // Helper for picking the device that was requested for an OpenDevice request. // If the device requested is not available it will revert to using the first // available one instead or will return an empty list if no devices of the - // requested kind are present. + // requested kind are present. Called on the UI thread. void GetRequestedDevice(const std::string& requested_device_id, bool audio, bool video, content::MediaStreamDevices* devices); // Overridden from content::MediaObserver: - virtual void OnAudioCaptureDevicesChanged( - const content::MediaStreamDevices& devices) OVERRIDE; - virtual void OnVideoCaptureDevicesChanged( - const content::MediaStreamDevices& devices) OVERRIDE; + virtual void OnAudioCaptureDevicesChanged() OVERRIDE; + virtual void OnVideoCaptureDevicesChanged() OVERRIDE; virtual void OnMediaRequestStateChanged( int render_process_id, int render_view_id, @@ -85,15 +51,17 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { const GURL& security_origin, const content::MediaStreamDevice& device, content::MediaRequestState state) OVERRIDE; - virtual void OnAudioStreamPlayingChanged( - int render_process_id, - int render_view_id, - int stream_id, - bool is_playing, - float power_dbfs, - bool clipped) OVERRIDE; virtual void OnCreatingAudioStream(int render_process_id, int render_view_id) OVERRIDE; + virtual void OnAudioStreamPlaying( + int render_process_id, + int render_frame_id, + int stream_id, + const ReadPowerAndClipCallback& power_read_callback) OVERRIDE; + virtual void OnAudioStreamStopped( + int render_process_id, + int render_frame_id, + int stream_id) OVERRIDE; private: friend struct DefaultSingletonTraits; @@ -101,28 +69,8 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { CefMediaCaptureDevicesDispatcher(); virtual ~CefMediaCaptureDevicesDispatcher(); - // Called by the MediaObserver() functions, executed on UI thread. - void UpdateAudioDevicesOnUIThread(const content::MediaStreamDevices& devices); - void UpdateVideoDevicesOnUIThread(const content::MediaStreamDevices& devices); - void UpdateMediaRequestStateOnUIThread( - int render_process_id, - int render_view_id, - int page_request_id, - const content::MediaStreamDevice& device, - content::MediaRequestState state); - - // A list of cached audio capture devices. - content::MediaStreamDevices audio_devices_; - - // A list of cached video capture devices. - content::MediaStreamDevices video_devices_; - - // A list of observers for the device update notifications. - ObserverList observers_; - - // Flag to indicate if device enumeration has been done/doing. - // Only accessed on UI thread. - bool devices_enumerated_; + const content::MediaStreamDevices& GetAudioCaptureDevices(); + const content::MediaStreamDevices& GetVideoCaptureDevices(); }; #endif // CEF_LIBCEF_BROWSER_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ diff --git a/libcef/browser/menu_creator.cc b/libcef/browser/menu_creator.cc index 0676cd919..6f32d74a6 100644 --- a/libcef/browser/menu_creator.cc +++ b/libcef/browser/menu_creator.cc @@ -84,8 +84,8 @@ bool CefMenuCreator::CreateContextMenu( client->GetContextMenuHandler(); if (handler.get()) { CefRefPtr frame; - if (params_.frame_id > 0) - frame = browser_->GetFrame(params_.frame_id); + if (render_frame_id_ > 0) + frame = browser_->GetFrame(render_frame_id_); if (!frame.get()) frame = browser_->GetMainFrame(); @@ -138,8 +138,8 @@ void CefMenuCreator::ExecuteCommand(CefRefPtr source, client->GetContextMenuHandler(); if (handler.get()) { CefRefPtr frame; - if (params_.frame_id > 0) - frame = browser_->GetFrame(params_.frame_id); + if (render_frame_id_ > 0) + frame = browser_->GetFrame(render_frame_id_); if (!frame.get()) frame = browser_->GetMainFrame(); @@ -189,8 +189,8 @@ void CefMenuCreator::MenuClosed(CefRefPtr source) { client->GetContextMenuHandler(); if (handler.get()) { CefRefPtr frame; - if (params_.frame_id > 0) - frame = browser_->GetFrame(params_.frame_id); + if (render_frame_id_ > 0) + frame = browser_->GetFrame(render_frame_id_); if (!frame.get()) frame = browser_->GetMainFrame(); diff --git a/libcef/browser/printing/print_view_manager_base.cc b/libcef/browser/printing/print_view_manager_base.cc index a88c2390b..b706129ac 100644 --- a/libcef/browser/printing/print_view_manager_base.cc +++ b/libcef/browser/printing/print_view_manager_base.cc @@ -158,10 +158,9 @@ void PrintViewManagerBase::OnDidPrintPage( #if defined(OS_WIN) bool big_emf = (params.data_size && params.data_size >= kMetafileMaxSize); - const CommandLine* cmdline = CommandLine::ForCurrentProcess(); int raster_size = std::min(params.page_size.GetArea(), kMaxRasterSizeInPixels); - if (big_emf || (cmdline && cmdline->HasSwitch(switches::kPrintRaster))) { + if (big_emf) { scoped_ptr raster_metafile( metafile->RasterizeMetafile(raster_size)); if (raster_metafile.get()) { diff --git a/libcef/browser/render_widget_host_view_osr.cc b/libcef/browser/render_widget_host_view_osr.cc index 54969236b..c85801583 100644 --- a/libcef/browser/render_widget_host_view_osr.cc +++ b/libcef/browser/render_widget_host_view_osr.cc @@ -9,11 +9,11 @@ #include "base/message_loop/message_loop.h" #include "content/browser/renderer_host/render_widget_host_impl.h" +#include "content/common/cursors/webcursor.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_view_host.h" #include "third_party/WebKit/public/platform/WebScreenInfo.h" #include "ui/gfx/size_conversions.h" -#include "webkit/common/cursors/webcursor.h" namespace { @@ -180,19 +180,20 @@ void CefRenderWidgetHostViewOSR::Focus() { void CefRenderWidgetHostViewOSR::Blur() { } -void CefRenderWidgetHostViewOSR::UpdateCursor(const WebCursor& cursor) { +void CefRenderWidgetHostViewOSR::UpdateCursor( + const content::WebCursor& cursor) { TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::UpdateCursor"); if (!browser_impl_.get()) return; #if defined(USE_AURA) - WebCursor web_cursor = cursor; + content::WebCursor web_cursor = cursor; ui::PlatformCursor platform_cursor; if (web_cursor.IsCustom()) { // |web_cursor| owns the resulting |platform_cursor|. platform_cursor = web_cursor.GetPlatformCursor(); } else { - WebCursor::CursorInfo cursor_info; + content::WebCursor::CursorInfo cursor_info; cursor.GetCursorInfo(&cursor_info); platform_cursor = browser_impl_->GetPlatformCursor(cursor_info.type); } @@ -201,7 +202,7 @@ void CefRenderWidgetHostViewOSR::UpdateCursor(const WebCursor& cursor) { browser_impl_->GetBrowser(), platform_cursor); #elif defined(OS_MACOSX) || defined(TOOLKIT_GTK) // |web_cursor| owns the resulting |native_cursor|. - WebCursor web_cursor = cursor; + content::WebCursor web_cursor = cursor; CefCursorHandle native_cursor = web_cursor.GetNativeCursor(); browser_impl_->GetClient()->GetRenderHandler()->OnCursorChange( browser_impl_->GetBrowser(), native_cursor); diff --git a/libcef/browser/render_widget_host_view_osr.h b/libcef/browser/render_widget_host_view_osr.h index 5a7daf305..a4ba8a9c9 100644 --- a/libcef/browser/render_widget_host_view_osr.h +++ b/libcef/browser/render_widget_host_view_osr.h @@ -117,7 +117,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase { const std::vector& moves) OVERRIDE; virtual void Focus() OVERRIDE; virtual void Blur() OVERRIDE; - virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE; + virtual void UpdateCursor(const content::WebCursor& cursor) OVERRIDE; virtual void SetIsLoading(bool is_loading) OVERRIDE; virtual void TextInputTypeChanged(ui::TextInputType type, ui::TextInputMode mode, diff --git a/libcef/browser/resource_dispatcher_host_delegate.cc b/libcef/browser/resource_dispatcher_host_delegate.cc index 141750c29..85f3ec10f 100644 --- a/libcef/browser/resource_dispatcher_host_delegate.cc +++ b/libcef/browser/resource_dispatcher_host_delegate.cc @@ -75,7 +75,7 @@ void CefResourceDispatcherHostDelegate::RequestBeginning( const content::ResourceRequestInfo* info = content::ResourceRequestInfo::ForRequest(request); if (info) - frame_id = info->GetFrameID(); + frame_id = info->GetRenderFrameID(); if (frame_id >= 0) { CefRefPtr cef_request(new CefRequestImpl); diff --git a/libcef/browser/resource_request_job.cc b/libcef/browser/resource_request_job.cc index 2984b12ed..d6767b381 100644 --- a/libcef/browser/resource_request_job.cc +++ b/libcef/browser/resource_request_job.cc @@ -187,7 +187,7 @@ void CefResourceRequestJob::Start() { if (SetHeaderIfMissing(headerMap, net::HttpRequestHeaders::kUserAgent, - ua_settings->GetUserAgent(request_->url()))) { + ua_settings->GetUserAgent())) { changed = true; } } diff --git a/libcef/browser/url_network_delegate.cc b/libcef/browser/url_network_delegate.cc index 0cc5e0f4c..6bd19c69f 100644 --- a/libcef/browser/url_network_delegate.cc +++ b/libcef/browser/url_network_delegate.cc @@ -122,47 +122,6 @@ int CefNetworkDelegate::OnBeforeURLRequest( return net::OK; } -int CefNetworkDelegate::OnBeforeSendHeaders( - net::URLRequest* request, - const net::CompletionCallback& callback, - net::HttpRequestHeaders* headers) { - return net::OK; -} - -void CefNetworkDelegate::OnSendHeaders( - net::URLRequest* request, - const net::HttpRequestHeaders& headers) { -} - -int CefNetworkDelegate::OnHeadersReceived( - net::URLRequest* request, - const net::CompletionCallback& callback, - const net::HttpResponseHeaders* original_response_headers, - scoped_refptr* override_response_headers) { - return net::OK; -} - -void CefNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, - const GURL& new_location) { -} - -void CefNetworkDelegate::OnResponseStarted(net::URLRequest* request) { -} - -void CefNetworkDelegate::OnRawBytesRead(const net::URLRequest& request, - int bytes_read) { -} - -void CefNetworkDelegate::OnCompleted(net::URLRequest* request, bool started) { -} - -void CefNetworkDelegate::OnURLRequestDestroyed(net::URLRequest* request) { -} - -void CefNetworkDelegate::OnPACScriptError(int line_number, - const base::string16& error) { -} - net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired( net::URLRequest* request, const net::AuthChallengeInfo& auth_info, @@ -218,30 +177,3 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired( return AUTH_REQUIRED_RESPONSE_NO_ACTION; } - -bool CefNetworkDelegate::OnCanGetCookies(const net::URLRequest& request, - const net::CookieList& cookie_list) { - return true; -} - -bool CefNetworkDelegate::OnCanSetCookie(const net::URLRequest& request, - const std::string& cookie_line, - net::CookieOptions* options) { - return true; -} - -bool CefNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, - const base::FilePath& path) const { - return true; -} - -bool CefNetworkDelegate::OnCanThrottleRequest( - const net::URLRequest& request) const { - return false; -} - -int CefNetworkDelegate::OnBeforeSocketStreamConnect( - net::SocketStream* socket, - const net::CompletionCallback& callback) { - return net::OK; -} diff --git a/libcef/browser/url_network_delegate.h b/libcef/browser/url_network_delegate.h index a012b2055..8fc7493fb 100644 --- a/libcef/browser/url_network_delegate.h +++ b/libcef/browser/url_network_delegate.h @@ -20,43 +20,11 @@ class CefNetworkDelegate : public net::NetworkDelegate { virtual int OnBeforeURLRequest(net::URLRequest* request, const net::CompletionCallback& callback, GURL* new_url) OVERRIDE; - virtual int OnBeforeSendHeaders(net::URLRequest* request, - const net::CompletionCallback& callback, - net::HttpRequestHeaders* headers) OVERRIDE; - virtual void OnSendHeaders(net::URLRequest* request, - const net::HttpRequestHeaders& headers) OVERRIDE; - virtual int OnHeadersReceived( - net::URLRequest* request, - const net::CompletionCallback& callback, - const net::HttpResponseHeaders* original_response_headers, - scoped_refptr* override_response_headers) - OVERRIDE; - virtual void OnBeforeRedirect(net::URLRequest* request, - const GURL& new_location) OVERRIDE; - virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; - virtual void OnRawBytesRead(const net::URLRequest& request, int bytes_read) - OVERRIDE; - virtual void OnCompleted(net::URLRequest* request, bool started) OVERRIDE; - virtual void OnURLRequestDestroyed(net::URLRequest* request) OVERRIDE; - virtual void OnPACScriptError(int line_number, const base::string16& error) - OVERRIDE; virtual AuthRequiredResponse OnAuthRequired( net::URLRequest* request, const net::AuthChallengeInfo& auth_info, const AuthCallback& callback, net::AuthCredentials* credentials) OVERRIDE; - virtual bool OnCanGetCookies(const net::URLRequest& request, - const net::CookieList& cookie_list) OVERRIDE; - virtual bool OnCanSetCookie(const net::URLRequest& request, - const std::string& cookie_line, - net::CookieOptions* options) OVERRIDE; - virtual bool OnCanAccessFile(const net::URLRequest& request, - const base::FilePath& path) const OVERRIDE; - virtual bool OnCanThrottleRequest( - const net::URLRequest& request) const OVERRIDE; - virtual int OnBeforeSocketStreamConnect( - net::SocketStream* stream, - const net::CompletionCallback& callback) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(CefNetworkDelegate); }; diff --git a/libcef/browser/url_request_context_getter.cc b/libcef/browser/url_request_context_getter.cc index 7f7e4e94c..8e0a69606 100644 --- a/libcef/browser/url_request_context_getter.cc +++ b/libcef/browser/url_request_context_getter.cc @@ -18,6 +18,7 @@ #include "libcef/browser/url_request_context_proxy.h" #include "libcef/browser/url_request_interceptor.h" #include "libcef/common/cef_switches.h" +#include "libcef/common/content_client.h" #include "base/command_line.h" #include "base/file_util.h" @@ -47,6 +48,7 @@ #include "net/ssl/server_bound_cert_service.h" #include "net/ssl/ssl_config_service_defaults.h" #include "net/url_request/http_user_agent_settings.h" +#include "net/url_request/protocol_intercept_job_factory.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_storage.h" @@ -82,9 +84,9 @@ class CefHttpUserAgentSettings : public net::HttpUserAgentSettings { return http_accept_language_; } - virtual std::string GetUserAgent(const GURL& url) const OVERRIDE { + virtual std::string GetUserAgent() const OVERRIDE { CEF_REQUIRE_IOT(); - return content::GetUserAgent(url); + return CefContentClient::Get()->GetUserAgent(); } private: @@ -98,9 +100,11 @@ class CefHttpUserAgentSettings : public net::HttpUserAgentSettings { CefURLRequestContextGetter::CefURLRequestContextGetter( base::MessageLoop* io_loop, base::MessageLoop* file_loop, - content::ProtocolHandlerMap* protocol_handlers) + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors) : io_loop_(io_loop), - file_loop_(file_loop) { + file_loop_(file_loop), + protocol_interceptors_(protocol_interceptors.Pass()) { // Must first be created on the UI thread. CEF_REQUIRE_UIT(); @@ -230,7 +234,19 @@ net::URLRequestContext* CefURLRequestContextGetter::GetURLRequestContext() { ftp_transaction_factory_.get()); protocol_handlers_.clear(); - storage_->set_job_factory(job_factory.release()); + // Set up interceptors in the reverse order. + scoped_ptr top_job_factory = + job_factory.PassAs(); + for (content::ProtocolHandlerScopedVector::reverse_iterator i = + protocol_interceptors_.rbegin(); + i != protocol_interceptors_.rend(); + ++i) { + top_job_factory.reset(new net::ProtocolInterceptJobFactory( + top_job_factory.Pass(), make_scoped_ptr(*i))); + } + protocol_interceptors_.weak_clear(); + + storage_->set_job_factory(top_job_factory.release()); request_interceptor_.reset(new CefRequestInterceptor); } diff --git a/libcef/browser/url_request_context_getter.h b/libcef/browser/url_request_context_getter.h index 03db67e62..6984fa6cc 100644 --- a/libcef/browser/url_request_context_getter.h +++ b/libcef/browser/url_request_context_getter.h @@ -81,7 +81,8 @@ class CefURLRequestContextGetter : public net::URLRequestContextGetter { CefURLRequestContextGetter( base::MessageLoop* io_loop, base::MessageLoop* file_loop, - content::ProtocolHandlerMap* protocol_handlers); + content::ProtocolHandlerMap* protocol_handlers, + content::ProtocolHandlerScopedVector protocol_interceptors); virtual ~CefURLRequestContextGetter(); // net::URLRequestContextGetter implementation. @@ -117,6 +118,7 @@ class CefURLRequestContextGetter : public net::URLRequestContextGetter { scoped_ptr url_security_manager_; scoped_ptr ftp_transaction_factory_; content::ProtocolHandlerMap protocol_handlers_; + content::ProtocolHandlerScopedVector protocol_interceptors_; net::URLRequestJobFactoryImpl* job_factory_impl_; typedef std::set RequestContextProxySet; diff --git a/libcef/browser/url_request_context_proxy.cc b/libcef/browser/url_request_context_proxy.cc index ba5b77d90..3bc9f1522 100644 --- a/libcef/browser/url_request_context_proxy.cc +++ b/libcef/browser/url_request_context_proxy.cc @@ -53,6 +53,13 @@ class CefCookieStoreProxy : public net::CookieStore { cookie_store->DeleteCookieAsync(url, cookie_name, callback); } + virtual void GetAllCookiesForURLAsync( + const GURL& url, + const GetCookieListCallback& callback) OVERRIDE { + scoped_refptr cookie_store = GetCookieStore(); + cookie_store->GetAllCookiesForURLAsync(url, callback); + } + virtual void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, const base::Time& delete_end, const DeleteCallback& callback) diff --git a/libcef/browser/url_request_interceptor.cc b/libcef/browser/url_request_interceptor.cc index becb553bf..64bc0cf31 100644 --- a/libcef/browser/url_request_interceptor.cc +++ b/libcef/browser/url_request_interceptor.cc @@ -76,7 +76,8 @@ net::URLRequestJob* CefRequestInterceptor::MaybeInterceptRedirect( if (!new_url.is_empty() && new_url.is_valid()) { return new net::URLRequestRedirectJob( request, network_delegate, new_url, - net::URLRequestRedirectJob::REDIRECT_302_FOUND); + net::URLRequestRedirectJob::REDIRECT_307_TEMPORARY_REDIRECT, + "Resource Redirect"); } } } diff --git a/libcef/common/cef_switches.cc b/libcef/common/cef_switches.cc index 8fd461570..e29ad0402 100644 --- a/libcef/common/cef_switches.cc +++ b/libcef/common/cef_switches.cc @@ -18,9 +18,6 @@ const char kLogSeverity_Error[] = "error"; const char kLogSeverity_ErrorReport[] = "error-report"; const char kLogSeverity_Disable[] = "disable"; -// Enable DCHECK for release mode. -const char kEnableReleaseDcheck[] = "enable-release-dcheck"; - // Path to resources directory. const char kResourcesDirPath[] = "resources-dir-path"; diff --git a/libcef/common/cef_switches.h b/libcef/common/cef_switches.h index 26826d534..278bde7cd 100644 --- a/libcef/common/cef_switches.h +++ b/libcef/common/cef_switches.h @@ -18,7 +18,6 @@ extern const char kLogSeverity_Warning[]; extern const char kLogSeverity_Error[]; extern const char kLogSeverity_ErrorReport[]; extern const char kLogSeverity_Disable[]; -extern const char kEnableReleaseDcheck[]; extern const char kResourcesDirPath[]; extern const char kLocalesDirPath[]; extern const char kDisablePackLoading[]; diff --git a/libcef/common/content_client.cc b/libcef/common/content_client.cc index ef12419e5..fbdc87618 100644 --- a/libcef/common/content_client.cc +++ b/libcef/common/content_client.cc @@ -15,8 +15,8 @@ #include "base/strings/stringprintf.h" #include "chrome/common/chrome_switches.h" #include "content/public/common/content_switches.h" +#include "content/public/common/user_agent.h" #include "ui/base/resource/resource_bundle.h" -#include "webkit/common/user_agent/user_agent_util.h" namespace { @@ -69,7 +69,7 @@ void CefContentClient::AddAdditionalSchemes( std::string CefContentClient::GetUserAgent() const { std::string product_version; - static CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kProductVersion)) { product_version = command_line.GetSwitchValueASCII(switches::kProductVersion); @@ -79,7 +79,7 @@ std::string CefContentClient::GetUserAgent() const { CHROME_VERSION_PATCH); } - return webkit_glue::BuildUserAgentFromProduct(product_version); + return content::BuildUserAgentFromProduct(product_version); } base::string16 CefContentClient::GetLocalizedString(int message_id) const { diff --git a/libcef/common/drag_data_impl.cc b/libcef/common/drag_data_impl.cc index 969ae24e4..8251f5a37 100644 --- a/libcef/common/drag_data_impl.cc +++ b/libcef/common/drag_data_impl.cc @@ -54,10 +54,10 @@ bool CefDragDataImpl::GetFileNames(std::vector& names) { if (data_.filenames.empty()) return false; - std::vector::const_iterator it = + std::vector::const_iterator it = data_.filenames.begin(); for (; it != data_.filenames.end(); ++it) - names.push_back(it->path); + names.push_back(it->path.value()); return true; } diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index 16e0c7bf5..25ed91e75 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -248,9 +248,6 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) { command_line->AppendSwitchASCII(switches::kLogSeverity, log_severity); } - if (settings.release_dcheck_enabled) - command_line->AppendSwitch(switches::kEnableReleaseDcheck); - if (settings.javascript_flags.length > 0) { command_line->AppendSwitchASCII(switches::kJavaScriptFlags, CefString(&settings.javascript_flags)); @@ -347,14 +344,6 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) { logging::SetMinLogLevel(log_severity); } - if (command_line->HasSwitch(switches::kEnableReleaseDcheck)) { - log_settings.dcheck_state = - logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS; - } else { - log_settings.dcheck_state = - logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS; - } - logging::InitLogging(log_settings); content::SetContentClient(&content_client_); diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 583271493..1b016720d 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -307,8 +307,6 @@ void CefRequestImpl::Set(const blink::WebURLRequest& request) { flags_ |= UR_FLAG_SKIP_CACHE; if (request.allowStoredCredentials()) flags_ |= UR_FLAG_ALLOW_CACHED_CREDENTIALS; - if (request.allowCookies()) - flags_ |= UR_FLAG_ALLOW_COOKIES; if (request.reportUploadProgress()) flags_ |= UR_FLAG_REPORT_UPLOAD_PROGRESS; if (request.reportLoadTiming()) @@ -351,8 +349,6 @@ void CefRequestImpl::Get(blink::WebURLRequest& request) { SETBOOLFLAG(request, flags_, setAllowStoredCredentials, UR_FLAG_ALLOW_CACHED_CREDENTIALS); - SETBOOLFLAG(request, flags_, setAllowCookies, - UR_FLAG_ALLOW_COOKIES); SETBOOLFLAG(request, flags_, setReportUploadProgress, UR_FLAG_REPORT_UPLOAD_PROGRESS); SETBOOLFLAG(request, flags_, setReportLoadTiming, diff --git a/libcef/common/scheme_registration.cc b/libcef/common/scheme_registration.cc index 402688f27..b19efc655 100644 --- a/libcef/common/scheme_registration.cc +++ b/libcef/common/scheme_registration.cc @@ -25,7 +25,7 @@ void AddInternalSchemes(std::vector* standard_schemes) { bool IsInternalHandledScheme(const std::string& scheme) { static const char* schemes[] = { - chrome::kBlobScheme, + content::kBlobScheme, content::kChromeDevToolsScheme, content::kChromeUIScheme, content::kDataScheme, @@ -46,7 +46,7 @@ bool IsInternalProtectedScheme(const std::string& scheme) { // content/browser/storage_partition_impl_map.cc and are modified by // InstallInternalProtectedHandlers(). static const char* schemes[] = { - chrome::kBlobScheme, + content::kBlobScheme, content::kChromeUIScheme, content::kDataScheme, content::kFileScheme, diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index 210cd69f7..1963ab38e 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -46,8 +46,6 @@ using blink::WebView; namespace { -const int64 kInvalidFrameId = -1; - blink::WebString FilePathStringToWebString( const base::FilePath::StringType& str) { #if defined(OS_POSIX) @@ -228,7 +226,7 @@ void CefBrowserImpl::GetFrameIdentifiers(std::vector& identifiers) { if (main_frame) { WebFrame* cur = main_frame; do { - identifiers.push_back(cur->identifier()); + identifiers.push_back(webkit_glue::GetIdentifier(cur)); cur = cur->traverseNext(true); } while (cur != main_frame); } @@ -275,7 +273,7 @@ CefBrowserImpl::CefBrowserImpl(content::RenderView* render_view, browser_id_(browser_id), is_popup_(is_popup), is_window_rendering_disabled_(is_window_rendering_disabled), - last_focused_frame_id_(kInvalidFrameId) { + last_focused_frame_id_(webkit_glue::kInvalidFrameId) { response_manager_.reset(new CefResponseManager); } @@ -380,7 +378,7 @@ bool CefBrowserImpl::SendProcessMessage(CefProcessId target_process, CefRefPtr CefBrowserImpl::GetWebFrameImpl( blink::WebFrame* frame) { DCHECK(frame); - int64 frame_id = frame->identifier(); + int64 frame_id = webkit_glue::GetIdentifier(frame); // Frames are re-used between page loads. Only add the frame to the map once. FrameMap::const_iterator it = frames_.find(frame_id); @@ -391,7 +389,7 @@ CefRefPtr CefBrowserImpl::GetWebFrameImpl( frames_.insert(std::make_pair(frame_id, framePtr)); int64 parent_id = frame->parent() == NULL ? - kInvalidFrameId : frame->parent()->identifier(); + webkit_glue::kInvalidFrameId : webkit_glue::GetIdentifier(frame->parent()); base::string16 name = frame->uniqueName(); // Notify the browser that the frame has been identified. @@ -401,7 +399,7 @@ CefRefPtr CefBrowserImpl::GetWebFrameImpl( } CefRefPtr CefBrowserImpl::GetWebFrameImpl(int64 frame_id) { - if (frame_id == kInvalidFrameId) { + if (frame_id == webkit_glue::kInvalidFrameId) { if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) return GetWebFrameImpl(render_view()->GetWebView()->mainFrame()); return NULL; @@ -418,7 +416,7 @@ CefRefPtr CefBrowserImpl::GetWebFrameImpl(int64 frame_id) { if (main_frame) { WebFrame* cur = main_frame; do { - if (cur->identifier() == frame_id) + if (webkit_glue::GetIdentifier(cur) == frame_id) return GetWebFrameImpl(cur); cur = cur->traverseNext(true); } while (cur != main_frame); @@ -489,7 +487,7 @@ void CefBrowserImpl::DidFailLoad( void CefBrowserImpl::DidFinishLoad(blink::WebFrame* frame) { blink::WebDataSource* ds = frame->dataSource(); Send(new CefHostMsg_DidFinishLoad(routing_id(), - frame->identifier(), + webkit_glue::GetIdentifier(frame), ds->request().url(), !frame->parent(), ds->response().httpStatusCode())); @@ -513,7 +511,7 @@ void CefBrowserImpl::DidCommitProvisionalLoad(blink::WebFrame* frame, } void CefBrowserImpl::FrameDetached(WebFrame* frame) { - int64 frame_id = frame->identifier(); + int64 frame_id = webkit_glue::GetIdentifier(frame); if (!frames_.empty()) { // Remove the frame from the map. @@ -577,9 +575,9 @@ void CefBrowserImpl::FocusedNodeChanged(const blink::WebNode& node) { focused_frame = render_view()->GetWebView()->focusedFrame(); } - int64 frame_id = kInvalidFrameId; + int64 frame_id = webkit_glue::kInvalidFrameId; if (focused_frame != NULL) - frame_id = focused_frame->identifier(); + frame_id = webkit_glue::GetIdentifier(focused_frame); // Don't send a message if the focused frame has not changed. if (frame_id == last_focused_frame_id_) diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index 33a9de61c..0fa32493a 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -9,9 +9,9 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "bindings/v8/V8Binding.h" #include "bindings/v8/V8RecursionScope.h" -#include "bindings/v8/V8Utilities.h" MSVC_POP_WARNING(); #undef ceil +#undef FROM_HERE #undef LOG #include "libcef/renderer/content_renderer_client.h" @@ -23,6 +23,7 @@ MSVC_POP_WARNING(); #include "libcef/common/request_impl.h" #include "libcef/common/values_impl.h" #include "libcef/renderer/browser_impl.h" +#include "libcef/renderer/render_frame_observer.h" #include "libcef/renderer/render_message_filter.h" #include "libcef/renderer/render_process_observer.h" #include "libcef/renderer/thread_util.h" @@ -32,9 +33,11 @@ MSVC_POP_WARNING(); #include "base/command_line.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/renderer/loadtimes_extension_bindings.h" #include "chrome/renderer/printing/print_web_view_helper.h" #include "content/child/child_thread.h" +#include "content/child/worker_task_runner.h" #include "content/common/frame_messages.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" @@ -59,7 +62,6 @@ MSVC_POP_WARNING(); #include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebWorkerInfo.h" #include "v8/include/v8.h" -#include "webkit/child/worker_task_runner.h" namespace { @@ -92,9 +94,9 @@ class CefPrerendererClient : public content::RenderViewObserver, // Implementation of SequencedTaskRunner for WebWorker threads. class CefWebWorkerTaskRunner : public base::SequencedTaskRunner, - public webkit_glue::WorkerTaskRunner::Observer { + public content::WorkerTaskRunner::Observer { public: - CefWebWorkerTaskRunner(webkit_glue::WorkerTaskRunner* runner, + CefWebWorkerTaskRunner(content::WorkerTaskRunner* runner, int worker_id) : runner_(runner), worker_id_(worker_id) { @@ -134,7 +136,7 @@ class CefWebWorkerTaskRunner : public base::SequencedTaskRunner, } private: - webkit_glue::WorkerTaskRunner* runner_; + content::WorkerTaskRunner* runner_; int worker_id_; }; @@ -309,8 +311,8 @@ scoped_refptr return render_task_runner_; // Check if a WebWorker exists for the current thread. - webkit_glue::WorkerTaskRunner* worker_runner = - webkit_glue::WorkerTaskRunner::Instance(); + content::WorkerTaskRunner* worker_runner = + content::WorkerTaskRunner::Instance(); int worker_id = worker_runner->CurrentWorkerId(); if (worker_id > 0) { base::AutoLock lock_scope(worker_task_runner_lock_); @@ -425,6 +427,7 @@ void CefContentRendererClient::RenderThreadStarted() { void CefContentRendererClient::RenderFrameCreated( content::RenderFrame* render_frame) { + new CefRenderFrameObserver(render_frame); BrowserCreated(render_frame->GetRenderView(), render_frame); } @@ -444,7 +447,7 @@ bool CefContentRendererClient::OverrideCreatePlugin( return false; #if defined(ENABLE_PLUGINS) - if (UTF16ToASCII(params.mimeType) == content::kBrowserPluginMimeType) + if (base::UTF16ToASCII(params.mimeType) == content::kBrowserPluginMimeType) return false; content::RenderFrameImpl* render_frame_impl = diff --git a/libcef/renderer/content_renderer_client.h b/libcef/renderer/content_renderer_client.h index 6a8d9c1fc..eb0362719 100644 --- a/libcef/renderer/content_renderer_client.h +++ b/libcef/renderer/content_renderer_client.h @@ -72,7 +72,6 @@ class CefContentRendererClient : public content::ContentRendererClient, // single-process mode. Blocks until cleanup is complete. void RunSingleProcessCleanup(); - private: // ContentRendererClient implementation. virtual void RenderThreadStarted() OVERRIDE; virtual void RenderFrameCreated(content::RenderFrame* render_frame) OVERRIDE; @@ -94,13 +93,15 @@ class CefContentRendererClient : public content::ContentRendererClient, v8::Handle context, int extension_group, int world_id) OVERRIDE; - virtual void WillReleaseScriptContext(blink::WebFrame* frame, - v8::Handle context, - int world_id) OVERRIDE; + + void WillReleaseScriptContext(blink::WebFrame* frame, + v8::Handle context, + int world_id); // MessageLoop::DestructionObserver implementation. virtual void WillDestroyCurrentMessageLoop() OVERRIDE; + private: void BrowserCreated(content::RenderView* render_view, content::RenderFrame* render_frame); diff --git a/libcef/renderer/dom_document_impl.cc b/libcef/renderer/dom_document_impl.cc index 76e8985f6..46aeebc98 100644 --- a/libcef/renderer/dom_document_impl.cc +++ b/libcef/renderer/dom_document_impl.cc @@ -88,7 +88,7 @@ CefRefPtr CefDOMDocumentImpl::GetElementById(const CefString& id) { CefRefPtr CefDOMDocumentImpl::GetFocusedNode() { const WebDocument& document = frame_->document(); - return GetOrCreateNode(document.focusedNode()); + return GetOrCreateNode(document.focusedElement()); } bool CefDOMDocumentImpl::HasSelection() { diff --git a/libcef/renderer/dom_event_impl.cc b/libcef/renderer/dom_event_impl.cc index 24c7346a1..3559570b2 100644 --- a/libcef/renderer/dom_event_impl.cc +++ b/libcef/renderer/dom_event_impl.cc @@ -75,8 +75,6 @@ CefDOMEventImpl::Category CefDOMEventImpl::GetCategory() { flags |= DOM_EVENT_CATEGORY_PROGRESS; if (event_.isXMLHttpRequestProgressEvent()) flags |= DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS; - if (event_.isBeforeLoadEvent()) - flags |= DOM_EVENT_CATEGORY_BEFORE_LOAD; return static_cast(flags); } diff --git a/libcef/renderer/dom_node_impl.cc b/libcef/renderer/dom_node_impl.cc index 13b96e24c..359855bec 100644 --- a/libcef/renderer/dom_node_impl.cc +++ b/libcef/renderer/dom_node_impl.cc @@ -47,7 +47,7 @@ class CefDOMEventListenerWrapper : public WebDOMEventListener, frame_(frame), listener_(listener) { // Cause this object to be deleted immediately before the frame is closed. - browser->AddFrameObject(frame->identifier(), this); + browser->AddFrameObject(webkit_glue::GetIdentifier(frame), this); } virtual ~CefDOMEventListenerWrapper() { CEF_REQUIRE_RT(); @@ -246,7 +246,7 @@ CefString CefDOMNodeImpl::GetValue() { value = select_element.value(); } - TrimWhitespace(value, TRIM_LEADING, &value); + base::TrimWhitespace(value, base::TRIM_LEADING, &value); str = value; } } diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index 2c0e45cc2..64bc37739 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -28,7 +28,7 @@ CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, blink::WebFrame* frame) : browser_(browser), frame_(frame), - frame_id_(frame->identifier()) { + frame_id_(webkit_glue::GetIdentifier(frame)) { } CefFrameImpl::~CefFrameImpl() { diff --git a/libcef/renderer/render_frame_observer.cc b/libcef/renderer/render_frame_observer.cc new file mode 100644 index 000000000..d76462ed1 --- /dev/null +++ b/libcef/renderer/render_frame_observer.cc @@ -0,0 +1,24 @@ +// Copyright 2014 The Chromium Embedded Framework Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be found +// in the LICENSE file. + +#include "libcef/renderer/render_frame_observer.h" + +#include "libcef/renderer/content_renderer_client.h" + +#include "content/public/renderer/render_frame.h" + +CefRenderFrameObserver::CefRenderFrameObserver( + content::RenderFrame* render_frame) + : content::RenderFrameObserver(render_frame) { +} + +CefRenderFrameObserver::~CefRenderFrameObserver() { +} + +void CefRenderFrameObserver::WillReleaseScriptContext( + v8::Handle context, + int world_id) { + CefContentRendererClient::Get()->WillReleaseScriptContext( + render_frame()->GetWebFrame(), context, world_id); +} diff --git a/libcef/renderer/render_frame_observer.h b/libcef/renderer/render_frame_observer.h new file mode 100644 index 000000000..f18d1b9f3 --- /dev/null +++ b/libcef/renderer/render_frame_observer.h @@ -0,0 +1,26 @@ +// Copyright 2014 The Chromium Embedded Framework Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be found +// in the LICENSE file. + +#ifndef LIBCEF_RENDERER_RENDER_FRAME_OBSERVER_H_ +#define LIBCEF_RENDERER_RENDER_FRAME_OBSERVER_H_ + +#include "content/public/renderer/render_frame_observer.h" + +namespace content { +class RenderFrame; +} + +class CefRenderFrameObserver : public content::RenderFrameObserver { + public: + explicit CefRenderFrameObserver(content::RenderFrame* render_frame); + virtual ~CefRenderFrameObserver(); + + virtual void WillReleaseScriptContext(v8::Handle context, + int world_id) OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(CefRenderFrameObserver); +}; + +#endif // LIBCEF_RENDERER_RENDER_FRAME_OBSERVER_H_ diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index bf7b8fadd..dc57b2be0 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -15,12 +15,14 @@ #include "config.h" MSVC_PUSH_WARNING_LEVEL(0); #include "core/frame/Frame.h" +#include "core/frame/LocalFrame.h" #include "core/workers/WorkerGlobalScope.h" #include "bindings/v8/ScriptController.h" #include "bindings/v8/V8Binding.h" #include "bindings/v8/V8RecursionScope.h" #include "bindings/v8/WorkerScriptController.h" MSVC_POP_WARNING(); +#undef FROM_HERE #undef LOG #include "libcef/renderer/v8_impl.h" @@ -31,6 +33,7 @@ MSVC_POP_WARNING(); #include "libcef/common/tracker.h" #include "libcef/renderer/browser_impl.h" #include "libcef/renderer/thread_util.h" +#include "libcef/renderer/webkit_glue.h" #include "base/bind.h" #include "base/lazy_instance.h" @@ -612,21 +615,16 @@ v8::Local CallV8Function(v8::Handle context, // Execute the function call using the ScriptController so that inspector // instrumentation works. if (CEF_CURRENTLY_ON_RT()) { - RefPtr frame = WebCore::toFrameIfNotDetached(context); + RefPtr frame = WebCore::toFrameIfNotDetached(context); DCHECK(frame); if (frame && frame->script().canExecuteScripts(WebCore::AboutToExecuteScript)) { func_rv = frame->script().callFunction(function, receiver, argc, args); } } else { - WebCore::WorkerScriptController* controller = - WebCore::WorkerScriptController::controllerForContext(isolate); - DCHECK(controller); - if (controller) { - func_rv = WebCore::ScriptController::callFunction( - controller->workerGlobalScope().executionContext(), - function, receiver, argc, args, isolate); - } + func_rv = WebCore::ScriptController::callFunction( + WebCore::toExecutionContext(context), + function, receiver, argc, args, isolate); } return func_rv; @@ -932,7 +930,7 @@ CefRefPtr CefV8ContextImpl::GetFrame() { if (webframe) { CefRefPtr browser = CefBrowserImpl::GetBrowserForMainFrame(webframe->top()); - frame = browser->GetFrame(webframe->identifier()); + frame = browser->GetFrame(webkit_glue::GetIdentifier(webframe)); } return frame; diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/webkit_glue.cc index b1ec598c6..c069aa65c 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/webkit_glue.cc @@ -31,8 +31,13 @@ MSVC_PUSH_WARNING_LEVEL(0); MSVC_POP_WARNING(); #undef LOG +#include "base/logging.h" +#include "content/public/renderer/render_frame.h" + namespace webkit_glue { +const int64 kInvalidFrameId = -1; + bool CanGoBack(blink::WebView* view) { if (!view) return false; @@ -79,4 +84,15 @@ bool SetNodeValue(blink::WebNode& node, const blink::WebString& value) { return true; } +int64 GetIdentifier(blink::WebFrame* frame) { + // Each WebFrame will have an associated RenderFrame. The RenderFrame + // routing IDs are unique within a given renderer process. + content::RenderFrame* render_frame = + content::RenderFrame::FromWebFrame(frame); + DCHECK(render_frame); + if (render_frame) + return render_frame->GetRoutingID(); + return kInvalidFrameId; +} + } // webkit_glue diff --git a/libcef/renderer/webkit_glue.h b/libcef/renderer/webkit_glue.h index 146abdfe6..479d81099 100644 --- a/libcef/renderer/webkit_glue.h +++ b/libcef/renderer/webkit_glue.h @@ -7,6 +7,7 @@ #define CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_ #include +#include "base/basictypes.h" namespace v8 { class Context; @@ -23,6 +24,8 @@ class WebView; namespace webkit_glue { +extern const int64 kInvalidFrameId; + bool CanGoBack(blink::WebView* view); bool CanGoForward(blink::WebView* view); void GoBack(blink::WebView* view); @@ -33,6 +36,8 @@ std::string DumpDocumentText(blink::WebFrame* frame); bool SetNodeValue(blink::WebNode& node, const blink::WebString& value); +int64 GetIdentifier(blink::WebFrame* frame); + } // webkit_glue #endif // CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_ diff --git a/patch/patches/build.patch b/patch/patches/build.patch index bd3155e58..ac1a5b3dc 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,6 +1,6 @@ Index: common.gypi =================================================================== ---- common.gypi (revision 251746) +--- common.gypi (revision 261035) +++ common.gypi (working copy) @@ -9,6 +9,9 @@ # Variables expected to be overriden on the GYP command line (-D) or by @@ -12,7 +12,7 @@ Index: common.gypi # Putting a variables dict inside another variables dict looks kind of # weird. This is done so that 'host_arch', 'chromeos', etc are defined as # variables within the outer variables dict here. This is necessary -@@ -85,9 +88,9 @@ +@@ -101,9 +104,9 @@ # # TODO(erg): Merge this into the previous block once compiling with # aura safely implies including ash capabilities. @@ -27,7 +27,7 @@ Index: common.gypi ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', { Index: mac/strip_save_dsym =================================================================== ---- mac/strip_save_dsym (revision 251746) +--- mac/strip_save_dsym (revision 261035) +++ mac/strip_save_dsym (working copy) @@ -48,7 +48,7 @@ "bundle"] diff --git a/patch/patches/content_nav_1129.patch b/patch/patches/content_nav_1129.patch index 5da94caf2..e299d7644 100644 --- a/patch/patches/content_nav_1129.patch +++ b/patch/patches/content_nav_1129.patch @@ -1,6 +1,6 @@ Index: public/renderer/content_renderer_client.cc =================================================================== ---- public/renderer/content_renderer_client.cc (revision 251746) +--- public/renderer/content_renderer_client.cc (revision 261035) +++ public/renderer/content_renderer_client.cc (working copy) @@ -92,7 +92,6 @@ return false; @@ -20,7 +20,7 @@ Index: public/renderer/content_renderer_client.cc const GURL& url, Index: public/renderer/content_renderer_client.h =================================================================== ---- public/renderer/content_renderer_client.h (revision 251746) +--- public/renderer/content_renderer_client.h (revision 261035) +++ public/renderer/content_renderer_client.h (working copy) @@ -175,7 +175,6 @@ // Returns true if a popup window should be allowed. @@ -38,23 +38,23 @@ Index: public/renderer/content_renderer_client.h // 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 -Index: renderer/render_view_impl.cc +Index: renderer/render_frame_impl.cc =================================================================== ---- renderer/render_view_impl.cc (revision 251746) -+++ renderer/render_view_impl.cc (working copy) -@@ -2628,7 +2628,6 @@ - WebDataSource::ExtraData* extraData, const WebURLRequest& request, - WebNavigationType type, WebNavigationPolicy default_policy, +--- renderer/render_frame_impl.cc (revision 261035) ++++ renderer/render_frame_impl.cc (working copy) +@@ -2661,7 +2661,6 @@ + WebNavigationType type, + WebNavigationPolicy default_policy, bool is_redirect) { -#ifdef OS_ANDROID // The handlenavigation API is deprecated and will be removed once // crbug.com/325351 is resolved. if (request.url() != GURL(kSwappedOutURL) && -@@ -2643,7 +2642,6 @@ +@@ -2676,7 +2675,6 @@ is_redirect)) { return blink::WebNavigationPolicyIgnore; } -#endif - Referrer referrer(GetReferrerFromRequest(frame, request)); + Referrer referrer(RenderViewImpl::GetReferrerFromRequest(frame, request)); diff --git a/patch/patches/gyp_331.patch b/patch/patches/gyp_331.patch index 701bf620e..811aad654 100644 --- a/patch/patches/gyp_331.patch +++ b/patch/patches/gyp_331.patch @@ -1,8 +1,8 @@ Index: gyp/generator/ninja.py =================================================================== ---- gyp/generator/ninja.py (revision 1852) +--- gyp/generator/ninja.py (revision 1880) +++ gyp/generator/ninja.py (working copy) -@@ -726,7 +726,16 @@ +@@ -738,7 +738,16 @@ for path in copy['files']: # Normalize the path so trailing slashes don't confuse us. path = os.path.normpath(path) diff --git a/patch/patches/message_loop_443.patch b/patch/patches/message_loop_443.patch index 344e9bd84..dd398edce 100644 --- a/patch/patches/message_loop_443.patch +++ b/patch/patches/message_loop_443.patch @@ -1,8 +1,8 @@ Index: message_loop.cc =================================================================== ---- message_loop.cc (revision 248478) +--- message_loop.cc (revision 261035) +++ message_loop.cc (working copy) -@@ -142,7 +142,7 @@ +@@ -144,7 +144,7 @@ MessageLoop::~MessageLoop() { DCHECK_EQ(this, current()); diff --git a/patch/patches/renderer_host_1161.patch b/patch/patches/renderer_host_1161.patch index 816d2f1d0..416e10568 100644 --- a/patch/patches/renderer_host_1161.patch +++ b/patch/patches/renderer_host_1161.patch @@ -1,8 +1,8 @@ Index: compositing_iosurface_layer_mac.mm =================================================================== ---- compositing_iosurface_layer_mac.mm (revision 251746) +--- compositing_iosurface_layer_mac.mm (revision 261035) +++ compositing_iosurface_layer_mac.mm (working copy) -@@ -119,7 +119,7 @@ +@@ -120,7 +120,7 @@ (context_ && context_->cgl_context() != glContext) || !renderWidgetHostView_ || !renderWidgetHostView_->compositing_iosurface_) { @@ -13,9 +13,9 @@ Index: compositing_iosurface_layer_mac.mm } Index: compositing_iosurface_mac.mm =================================================================== ---- compositing_iosurface_mac.mm (revision 251746) +--- compositing_iosurface_mac.mm (revision 261035) +++ compositing_iosurface_mac.mm (working copy) -@@ -360,7 +360,7 @@ +@@ -362,7 +362,7 @@ glUseProgram(0); CHECK_AND_SAVE_GL_ERROR(); } else { // Should match the clear color of RenderWidgetHostViewMac. @@ -26,7 +26,7 @@ Index: compositing_iosurface_mac.mm Index: compositing_iosurface_shader_programs_mac.cc =================================================================== ---- compositing_iosurface_shader_programs_mac.cc (revision 251746) +--- compositing_iosurface_shader_programs_mac.cc (revision 261035) +++ compositing_iosurface_shader_programs_mac.cc (working copy) @@ -11,6 +11,7 @@ #include "base/debug/trace_event.h" @@ -78,7 +78,7 @@ Index: compositing_iosurface_shader_programs_mac.cc shader_programs_[which] = Index: compositing_iosurface_shader_programs_mac.h =================================================================== ---- compositing_iosurface_shader_programs_mac.h (revision 251746) +--- compositing_iosurface_shader_programs_mac.h (revision 261035) +++ compositing_iosurface_shader_programs_mac.h (working copy) @@ -48,6 +48,8 @@ return rgb_to_yv12_output_format_; @@ -91,18 +91,18 @@ Index: compositing_iosurface_shader_programs_mac.h TransformsRGBToYV12); Index: render_widget_host_view_mac.mm =================================================================== ---- render_widget_host_view_mac.mm (revision 251746) +--- render_widget_host_view_mac.mm (revision 261035) +++ render_widget_host_view_mac.mm (working copy) -@@ -483,7 +483,7 @@ - software_layer_.reset([[CALayer alloc] init]); - if (!software_layer_) - LOG(ERROR) << "Failed to create CALayer for software rendering"; -- [software_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; -+ [software_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorClear)]; - [software_layer_ setDelegate:cocoa_view_]; - [software_layer_ setContentsGravity:kCAGravityTopLeft]; - [software_layer_ setFrame:NSRectToCGRect([cocoa_view_ bounds])]; -@@ -2856,7 +2856,7 @@ +@@ -434,7 +434,7 @@ + use_core_animation_ = true; + background_layer_.reset([[CALayer alloc] init]); + [background_layer_ +- setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; ++ setBackgroundColor:CGColorGetConstantColor(kCGColorClear)]; + [cocoa_view_ setLayer:background_layer_]; + [cocoa_view_ setWantsLayer:YES]; + } +@@ -3087,7 +3087,7 @@ NSRect r = [self flipRectToNSRect:gfx::Rect(x, y, width, height)]; CGContextSetFillColorWithColor(context, @@ -111,7 +111,7 @@ Index: render_widget_host_view_mac.mm CGContextFillRect(context, NSRectToCGRect(r)); } if (damagedRect.bottom() > rect.bottom()) { -@@ -2878,7 +2878,7 @@ +@@ -3109,7 +3109,7 @@ NSRect r = [self flipRectToNSRect:gfx::Rect(x, y, width, height)]; CGContextSetFillColorWithColor(context, @@ -120,7 +120,7 @@ Index: render_widget_host_view_mac.mm CGContextFillRect(context, NSRectToCGRect(r)); } } -@@ -3037,7 +3037,7 @@ +@@ -3259,7 +3259,7 @@ } } else { CGContextSetFillColorWithColor(context, @@ -129,12 +129,21 @@ Index: render_widget_host_view_mac.mm CGContextFillRect(context, dirtyRect); if (renderWidgetHostView_->whiteout_start_time_.is_null()) renderWidgetHostView_->whiteout_start_time_ = base::TimeTicks::Now(); -@@ -4045,7 +4045,7 @@ - if (!renderWidgetHostView_->render_widget_host_ || - renderWidgetHostView_->render_widget_host_->is_hidden()) { +@@ -4282,7 +4282,7 @@ + if (self = [super init]) { + renderWidgetHostView_ = r; + +- [self setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; ++ [self setBackgroundColor:CGColorGetConstantColor(kCGColorClear)]; + [self setAnchorPoint:CGPointMake(0, 0)]; + // Setting contents gravity is necessary to prevent the layer from being + // scaled during dyanmic resizes (especially with devtools open). +@@ -4311,7 +4311,7 @@ + inContext:context]; + } else { CGContextSetFillColorWithColor(context, - CGColorGetConstantColor(kCGColorWhite)); + CGColorGetConstantColor(kCGColorClear)); CGContextFillRect(context, clipRect); - return; } + } diff --git a/patch/patches/spi_webcore_364.patch b/patch/patches/spi_webcore_364.patch index 4e2e3fd97..d87e5a3b6 100644 --- a/patch/patches/spi_webcore_364.patch +++ b/patch/patches/spi_webcore_364.patch @@ -1,8 +1,8 @@ Index: core/frame/FrameView.cpp =================================================================== ---- core/frame/FrameView.cpp (revision 167304) +--- core/frame/FrameView.cpp (revision 170525) +++ core/frame/FrameView.cpp (working copy) -@@ -141,8 +141,10 @@ +@@ -165,8 +165,10 @@ if (!isMainFrame()) return; @@ -12,12 +12,12 @@ Index: core/frame/FrameView.cpp +#endif } - PassRefPtr FrameView::create(Frame* frame) + PassRefPtr FrameView::create(LocalFrame* frame) Index: platform/scroll/ScrollbarThemeMacCommon.mm =================================================================== ---- platform/scroll/ScrollbarThemeMacCommon.mm (revision 167304) +--- platform/scroll/ScrollbarThemeMacCommon.mm (revision 170525) +++ platform/scroll/ScrollbarThemeMacCommon.mm (working copy) -@@ -369,10 +369,14 @@ +@@ -358,10 +358,14 @@ // static bool ScrollbarThemeMacCommon::isOverlayAPIAvailable() { diff --git a/patch/patches/views_webview_304341.patch b/patch/patches/views_webview_304341.patch index 8c165b950..494c9a93d 100644 --- a/patch/patches/views_webview_304341.patch +++ b/patch/patches/views_webview_304341.patch @@ -1,8 +1,8 @@ Index: web_dialog_view.cc =================================================================== ---- web_dialog_view.cc (revision 248478) +--- web_dialog_view.cc (revision 261035) +++ web_dialog_view.cc (working copy) -@@ -261,13 +261,6 @@ +@@ -257,13 +257,6 @@ return true; } @@ -16,7 +16,7 @@ Index: web_dialog_view.cc //////////////////////////////////////////////////////////////////////////////// // content::WebContentsDelegate implementation: -@@ -347,6 +340,16 @@ +@@ -337,6 +330,15 @@ *proceed_to_fire_unload = proceed; } @@ -26,16 +26,15 @@ Index: web_dialog_view.cc + if (delegate_) + return delegate_->HandleContextMenu(params); + return WebDialogWebContentsDelegate::HandleContextMenu(render_frame_host, -+ params); ++ params); +} -+ + //////////////////////////////////////////////////////////////////////////////// // WebDialogView, private: Index: web_dialog_view.h =================================================================== ---- web_dialog_view.h (revision 248478) +--- web_dialog_view.h (revision 261035) +++ web_dialog_view.h (working copy) @@ -74,6 +74,7 @@ virtual const views::Widget* GetWidget() const OVERRIDE; @@ -54,7 +53,7 @@ Index: web_dialog_view.h // Overridden from content::WebContentsDelegate: virtual void MoveContents(content::WebContents* source, -@@ -114,6 +113,9 @@ +@@ -115,6 +114,9 @@ virtual void BeforeUnloadFired(content::WebContents* tab, bool proceed, bool* proceed_to_fire_unload) OVERRIDE; diff --git a/patch/patches/views_widget_180.patch b/patch/patches/views_widget_180.patch index 29b72a99b..196a2ad2c 100644 --- a/patch/patches/views_widget_180.patch +++ b/patch/patches/views_widget_180.patch @@ -1,6 +1,6 @@ Index: desktop_aura/desktop_screen_win.cc =================================================================== ---- desktop_aura/desktop_screen_win.cc (revision 251746) +--- desktop_aura/desktop_screen_win.cc (revision 261035) +++ desktop_aura/desktop_screen_win.cc (working copy) @@ -54,6 +54,8 @@ } @@ -8,29 +8,29 @@ Index: desktop_aura/desktop_screen_win.cc HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const { + if (!window) + return NULL; - aura::WindowEventDispatcher* dispatcher = window->GetDispatcher(); - return dispatcher ? dispatcher->host()->GetAcceleratedWidget() : NULL; + aura::WindowTreeHost* host = window->GetHost(); + return host ? host->GetAcceleratedWidget() : NULL; } Index: desktop_aura/desktop_window_tree_host_win.cc =================================================================== ---- desktop_aura/desktop_window_tree_host_win.cc (revision 251746) +--- desktop_aura/desktop_window_tree_host_win.cc (revision 261035) +++ desktop_aura/desktop_window_tree_host_win.cc (working copy) -@@ -133,7 +133,9 @@ +@@ -130,7 +130,9 @@ native_widget_delegate_); HWND parent_hwnd = NULL; -- if (params.parent && params.parent->GetDispatcher()) { -+ if (params.parent_widget) { +- if (params.parent && params.parent->GetHost()) ++ if (params.parent_widget) + parent_hwnd = params.parent_widget; -+ } else if (params.parent && params.parent->GetDispatcher()) { - parent_hwnd = - params.parent->GetDispatcher()->host()->GetAcceleratedWidget(); - } ++ else if (params.parent && params.parent->GetHost()) + parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget(); + + message_handler_->set_remove_standard_frame(params.remove_standard_frame); Index: widget.cc =================================================================== ---- widget.cc (revision 251746) +--- widget.cc (revision 261035) +++ widget.cc (working copy) -@@ -124,6 +124,7 @@ +@@ -122,6 +122,7 @@ show_state(ui::SHOW_STATE_DEFAULT), double_buffer(false), parent(NULL), @@ -38,7 +38,7 @@ Index: widget.cc native_widget(NULL), desktop_window_tree_host(NULL), top_level(false), -@@ -149,6 +150,7 @@ +@@ -148,6 +149,7 @@ show_state(ui::SHOW_STATE_DEFAULT), double_buffer(false), parent(NULL), @@ -46,7 +46,7 @@ Index: widget.cc native_widget(NULL), desktop_window_tree_host(NULL), top_level(false), -@@ -389,7 +391,12 @@ +@@ -386,7 +388,12 @@ Minimize(); } else if (params.delegate) { SetContentsView(params.delegate->GetContentsView()); @@ -62,9 +62,9 @@ Index: widget.cc } Index: widget.h =================================================================== ---- widget.h (revision 251746) +--- widget.h (revision 261035) +++ widget.h (working copy) -@@ -197,6 +197,7 @@ +@@ -200,6 +200,7 @@ // Should the widget be double buffered? Default is false. bool double_buffer; gfx::NativeView parent; diff --git a/patch/patches/web_contents_304341.patch b/patch/patches/web_contents_304341.patch index 90f3fef47..707dc8745 100644 --- a/patch/patches/web_contents_304341.patch +++ b/patch/patches/web_contents_304341.patch @@ -1,8 +1,8 @@ Index: browser/browser_plugin/browser_plugin_guest.cc =================================================================== ---- browser/browser_plugin/browser_plugin_guest.cc (revision 251746) +--- browser/browser_plugin/browser_plugin_guest.cc (revision 261035) +++ browser/browser_plugin/browser_plugin_guest.cc (working copy) -@@ -789,7 +789,8 @@ +@@ -794,7 +794,8 @@ return this; } @@ -14,7 +14,7 @@ Index: browser/browser_plugin/browser_plugin_guest.cc // http://crbug.com/140315). Index: browser/browser_plugin/browser_plugin_guest.h =================================================================== ---- browser/browser_plugin/browser_plugin_guest.h (revision 251746) +--- browser/browser_plugin/browser_plugin_guest.h (revision 261035) +++ browser/browser_plugin/browser_plugin_guest.h (working copy) @@ -204,7 +204,8 @@ double progress) OVERRIDE; @@ -28,9 +28,9 @@ Index: browser/browser_plugin/browser_plugin_guest.h const NativeWebKeyboardEvent& event) OVERRIDE; Index: browser/web_contents/web_contents_impl.cc =================================================================== ---- browser/web_contents/web_contents_impl.cc (revision 251746) +--- browser/web_contents/web_contents_impl.cc (revision 261035) +++ browser/web_contents/web_contents_impl.cc (working copy) -@@ -2727,7 +2727,7 @@ +@@ -2831,7 +2831,7 @@ void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host, const ContextMenuParams& params) { // Allow WebContentsDelegates to handle the context menu operation first. @@ -41,9 +41,9 @@ Index: browser/web_contents/web_contents_impl.cc render_view_host_delegate_view_->ShowContextMenu(render_frame_host, params); Index: browser/web_contents/web_contents_view_mac.mm =================================================================== ---- browser/web_contents/web_contents_view_mac.mm (revision 251746) +--- browser/web_contents/web_contents_view_mac.mm (revision 261035) +++ browser/web_contents/web_contents_view_mac.mm (working copy) -@@ -233,12 +233,6 @@ +@@ -227,12 +227,6 @@ void WebContentsViewMac::ShowContextMenu( content::RenderFrameHost* render_frame_host, const ContextMenuParams& params) { @@ -58,7 +58,7 @@ Index: browser/web_contents/web_contents_view_mac.mm else Index: public/browser/web_contents_delegate.cc =================================================================== ---- public/browser/web_contents_delegate.cc (revision 251746) +--- public/browser/web_contents_delegate.cc (revision 261035) +++ public/browser/web_contents_delegate.cc (working copy) @@ -76,6 +76,7 @@ } @@ -70,7 +70,7 @@ Index: public/browser/web_contents_delegate.cc } Index: public/browser/web_contents_delegate.h =================================================================== ---- public/browser/web_contents_delegate.h (revision 251746) +--- public/browser/web_contents_delegate.h (revision 261035) +++ public/browser/web_contents_delegate.h (working copy) @@ -35,6 +35,7 @@ class DownloadItem; @@ -80,7 +80,7 @@ Index: public/browser/web_contents_delegate.h class RenderViewHost; class SessionStorageNamespace; class WebContents; -@@ -228,7 +229,8 @@ +@@ -231,7 +232,8 @@ virtual int GetExtraRenderViewHeight() const; // Returns true if the context menu operation was handled by the delegate. diff --git a/patch/patches/webkit_933.patch b/patch/patches/webkit_933.patch index bdcfcb527..74ebc4c24 100644 --- a/patch/patches/webkit_933.patch +++ b/patch/patches/webkit_933.patch @@ -1,8 +1,8 @@ Index: WebNode.cpp =================================================================== ---- WebNode.cpp (revision 166298) +--- WebNode.cpp (revision 170525) +++ WebNode.cpp (working copy) -@@ -171,7 +171,7 @@ +@@ -172,7 +172,7 @@ void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture) { // Please do not add more eventTypes to this list without an API review. diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index c758a4d1a..3e83dbc9f 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,8 @@ Index: public/web/WebView.h =================================================================== ---- public/web/WebView.h (revision 167304) +--- public/web/WebView.h (revision 170525) +++ public/web/WebView.h (working copy) -@@ -424,6 +424,7 @@ +@@ -416,6 +416,7 @@ // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void setUseExternalPopupMenus(bool); @@ -12,11 +12,11 @@ Index: public/web/WebView.h virtual void hidePopups() = 0; Index: Source/web/ChromeClientImpl.cpp =================================================================== ---- Source/web/ChromeClientImpl.cpp (revision 167304) +--- Source/web/ChromeClientImpl.cpp (revision 170525) +++ Source/web/ChromeClientImpl.cpp (working copy) -@@ -751,7 +751,7 @@ +@@ -755,7 +755,7 @@ - PassRefPtr ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const + PassRefPtr ChromeClientImpl::createPopupMenu(LocalFrame& frame, PopupMenuClient* client) const { - if (WebViewImpl::useExternalPopupMenus()) + if (m_webView->useExternalPopupMenus()) @@ -25,9 +25,9 @@ Index: Source/web/ChromeClientImpl.cpp return adoptRef(new PopupMenuChromium(frame, client)); Index: Source/web/WebViewImpl.cpp =================================================================== ---- Source/web/WebViewImpl.cpp (revision 167304) +--- Source/web/WebViewImpl.cpp (revision 170525) +++ Source/web/WebViewImpl.cpp (working copy) -@@ -343,6 +343,7 @@ +@@ -339,6 +339,7 @@ , m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationUseAnchor(false) , m_contextMenuAllowed(false) @@ -35,7 +35,7 @@ Index: Source/web/WebViewImpl.cpp , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) , m_compositorDeviceScaleFactorOverride(0) -@@ -3521,9 +3522,14 @@ +@@ -3488,9 +3489,14 @@ updateLayerTreeViewport(); } @@ -50,12 +50,12 @@ Index: Source/web/WebViewImpl.cpp + return m_shouldUseExternalPopupMenus; } - void WebViewImpl::startDragging(Frame* frame, + void WebViewImpl::startDragging(LocalFrame* frame, Index: Source/web/WebViewImpl.h =================================================================== ---- Source/web/WebViewImpl.h (revision 167304) +--- Source/web/WebViewImpl.h (revision 170525) +++ Source/web/WebViewImpl.h (working copy) -@@ -401,7 +401,8 @@ +@@ -390,7 +390,8 @@ // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -65,7 +65,7 @@ Index: Source/web/WebViewImpl.h bool contextMenuAllowed() const { -@@ -685,6 +686,8 @@ +@@ -668,6 +669,8 @@ bool m_contextMenuAllowed; diff --git a/tests/unittests/test_suite.cc b/tests/unittests/test_suite.cc index 7b3b4ab49..d10cc0682 100644 --- a/tests/unittests/test_suite.cc +++ b/tests/unittests/test_suite.cc @@ -94,8 +94,6 @@ void CefTestSuite::Initialize() { log_settings.logging_dest = logging::LOG_TO_ALL; log_settings.lock_log = logging::LOCK_LOG_FILE; log_settings.delete_old = logging::DELETE_OLD_LOG_FILE; - log_settings.dcheck_state = - logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS; logging::InitLogging(log_settings); // We want process and thread IDs because we may have multiple processes. diff --git a/tests/unittests/test_suite.h b/tests/unittests/test_suite.h index 81a0696a5..6ea3797a7 100644 --- a/tests/unittests/test_suite.h +++ b/tests/unittests/test_suite.h @@ -10,7 +10,9 @@ #include "include/internal/cef_types_wrappers.h" #include "base/test/test_suite.h" +namespace base { class CommandLine; +} class CefTestSuite : public TestSuite { public: @@ -31,7 +33,7 @@ class CefTestSuite : public TestSuite { #endif // The singleton CommandLine representing the current process's command line. - static CommandLine* commandline_; + static base::CommandLine* commandline_; }; #endif // CEF_TESTS_UNITTESTS_TEST_SUITE_H_ diff --git a/tests/unittests/urlrequest_unittest.cc b/tests/unittests/urlrequest_unittest.cc index 9d8b508de..26cc66f93 100644 --- a/tests/unittests/urlrequest_unittest.cc +++ b/tests/unittests/urlrequest_unittest.cc @@ -604,8 +604,7 @@ class RequestTestRunner { SetupGetTest(); // Send cookies. - settings_.request->SetFlags(UR_FLAG_ALLOW_CACHED_CREDENTIALS | - UR_FLAG_ALLOW_COOKIES); + settings_.request->SetFlags(UR_FLAG_ALLOW_CACHED_CREDENTIALS); settings_.expect_save_cookie = true; settings_.expect_send_cookie = true; @@ -653,7 +652,7 @@ class RequestTestRunner { const base::FilePath& path = post_file_tmpdir_.path().Append(FILE_PATH_LITERAL("example.txt")); const char content[] = "HELLO FRIEND!"; - int write_ct = file_util::WriteFile(path, content, sizeof(content) - 1); + int write_ct = base::WriteFile(path, content, sizeof(content) - 1); EXPECT_EQ(static_cast(sizeof(content) - 1), write_ct); SetUploadFile(settings_.request, path);