Update to Chromium revision 2b3ae3b8 (#394939)

This commit is contained in:
Marshall Greenblatt 2016-05-24 19:35:43 -04:00
parent 582ce074aa
commit ab2636b012
125 changed files with 619 additions and 626 deletions

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': '6e53600def8f60d8c632fadc70d7c1939ccea347',
'chromium_checkout': '2b3ae3b8090361f8af5a611712fc1a5ab2de53cb',
}

19
cef.gyp
View File

@ -149,6 +149,7 @@
# Modify the Info.plist as needed.
'postbuild_name': 'Tweak Info.plist',
'action': ['../build/mac/tweak_info_plist.py',
'--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}',
'--scm=1'],
},
],
@ -317,6 +318,7 @@
# Modify the Info.plist as needed.
'postbuild_name': 'Tweak Info.plist',
'action': ['../build/mac/tweak_info_plist.py',
'--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}',
'--scm=1'],
},
],
@ -542,6 +544,7 @@
# Modify the Info.plist as needed.
'postbuild_name': 'Tweak Info.plist',
'action': ['../build/mac/tweak_info_plist.py',
'--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}',
'--scm=1'],
},
],
@ -1014,6 +1017,7 @@
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/storage/storage_browser.gyp:storage',
'<(DEPTH)/sync/sync.gyp:sync',
'<(DEPTH)/third_party/cld_2/cld_2.gyp:cld2_platform_impl',
'<(DEPTH)/third_party/hunspell/hunspell.gyp:hunspell',
'<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
@ -1024,7 +1028,7 @@
'<(DEPTH)/ui/gl/gl.gyp:gl',
'<(DEPTH)/ui/base/ime/ui_base_ime.gyp:ui_base_ime',
'<(DEPTH)/ui/base/ui_base.gyp:ui_base',
'<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
'<(DEPTH)/v8/src/v8.gyp:v8',
# Necessary to generate the grit include files.
'cef_pak',
# Necessary to generate API bindings for extensions.
@ -1328,8 +1332,8 @@
'libcef/renderer/render_frame_observer.h',
'libcef/renderer/render_message_filter.cc',
'libcef/renderer/render_message_filter.h',
'libcef/renderer/render_process_observer.cc',
'libcef/renderer/render_process_observer.h',
'libcef/renderer/render_thread_observer.cc',
'libcef/renderer/render_thread_observer.h',
'libcef/renderer/render_urlrequest_impl.cc',
'libcef/renderer/render_urlrequest_impl.h',
'libcef/renderer/thread_util.h',
@ -1582,11 +1586,6 @@
'<(DEPTH)/components/components.gyp:breakpad_host',
],
}],
['cld_version==2', {
'dependencies': [
'<(DEPTH)/third_party/cld_2/cld_2.gyp:cld2_platform_impl',
],
}],
['use_aura==1', {
'dependencies': [
'<(DEPTH)/ui/views/controls/webview/webview.gyp:webview',
@ -1763,6 +1762,7 @@
# but this seems like a really good place to store them.
'postbuild_name': 'Tweak Info.plist',
'action': ['../build/mac/tweak_info_plist.py',
'--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}',
'--breakpad=1',
'--keystone=0',
'--scm=1',
@ -1846,6 +1846,7 @@
# never placed into the helper.
'postbuild_name': 'Tweak Info.plist',
'action': ['../build/mac/tweak_info_plist.py',
'--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}',
'--breakpad=0',
'--keystone=0',
'--scm=0'],
@ -1917,6 +1918,7 @@
# never placed into the helper.
'postbuild_name': 'Tweak Info.plist',
'action': ['../build/mac/tweak_info_plist.py',
'--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}',
'--breakpad=0',
'--keystone=0',
'--scm=0'],
@ -2024,6 +2026,7 @@
# never placed into the helper.
'postbuild_name': 'Tweak Info.plist',
'action': ['../build/mac/tweak_info_plist.py',
'--plist=${TARGET_BUILD_DIR}/${INFOPLIST_PATH}',
'--breakpad=0',
'--keystone=0',
'--scm=0'],

View File

@ -50,6 +50,7 @@
#include "include/base/internal/cef_lock_impl.h"
namespace base {
namespace cef_internal {
// A convenient wrapper for an OS specific critical section. The only real
// intelligence in this class is in debug mode for the support for the
@ -113,7 +114,7 @@ class Lock {
#endif // NDEBUG
// Platform specific underlying lock implementation.
cef_internal::LockImpl lock_;
LockImpl lock_;
DISALLOW_COPY_AND_ASSIGN(Lock);
};
@ -160,6 +161,15 @@ class AutoUnlock {
DISALLOW_COPY_AND_ASSIGN(AutoUnlock);
};
} // namespace cef_internal
// Implement classes in the cef_internal namespace and then expose them to the
// base namespace. This avoids conflicts with the base.lib implementation when
// linking sandbox support on Windows.
using cef_internal::Lock;
using cef_internal::AutoLock;
using cef_internal::AutoUnlock;
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES

View File

@ -40,6 +40,7 @@
#define MOVE_SCOPED_PTR(var) std::move(var)
// Chromium uses std types.
#define SCOPED_PTR(type) std::unique_ptr<type>
#define DEFAULT_DELETER(type) std::default_delete<type>
#else // !USING_CHROMIUM_INCLUDES
@ -54,6 +55,7 @@
#define MOVE_SCOPED_PTR(var) var.Pass()
// CEF uses base types.
#define SCOPED_PTR(type) scoped_ptr<type>
#define DEFAULT_DELETER(type) struct base::DefaultDeleter<type>
#if !defined(arraysize)

View File

@ -120,8 +120,7 @@
// client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts.
#elif defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/memory/scoped_ptr.h"
// Do nothing when building CEF.
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be

View File

@ -31,7 +31,7 @@
#define CEF_INCLUDE_CEF_SANDBOX_WIN_H_
#pragma once
#include "include/cef_base.h"
#include "include/base/cef_build.h"
#if defined(OS_WIN)

View File

@ -159,18 +159,18 @@ class CefResourceManager :
// The below methods are called on the browser process IO thread.
explicit Request(scoped_ptr<RequestState> state);
explicit Request(SCOPED_PTR(RequestState) state);
scoped_ptr<RequestState> SendRequest();
SCOPED_PTR(RequestState) SendRequest();
bool HasState();
static void ContinueOnIOThread(scoped_ptr<RequestState> state,
static void ContinueOnIOThread(SCOPED_PTR(RequestState) state,
CefRefPtr<CefResourceHandler> handler);
static void StopOnIOThread(scoped_ptr<RequestState> state);
static void StopOnIOThread(SCOPED_PTR(RequestState) state);
// Will be non-NULL while the request is pending. Only accessed on the
// browser process IO thread.
scoped_ptr<RequestState> state_;
SCOPED_PTR(RequestState) state_;
// Params that stay with this request object. Safe to access on any thread.
RequestParams params_;
@ -343,10 +343,10 @@ class CefResourceManager :
// Methods that manage request state between requests. Called on the browser
// process IO thread.
bool SendRequest(scoped_ptr<RequestState> state);
void ContinueRequest(scoped_ptr<RequestState> state,
bool SendRequest(SCOPED_PTR(RequestState) state);
void ContinueRequest(SCOPED_PTR(RequestState) state,
CefRefPtr<CefResourceHandler> handler);
void StopRequest(scoped_ptr<RequestState> state);
void StopRequest(SCOPED_PTR(RequestState) state);
bool IncrementProvider(RequestState* state);
void DetachRequestFromProvider(RequestState* state);
void GetNextValidProvider(ProviderEntryList::iterator& iterator);
@ -365,7 +365,7 @@ class CefResourceManager :
MimeTypeResolver mime_type_resolver_;
// Must be the last member. Created and accessed on the IO thread.
scoped_ptr<base::WeakPtrFactory<CefResourceManager> > weak_ptr_factory_;
SCOPED_PTR(base::WeakPtrFactory<CefResourceManager>) weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefResourceManager);
};

View File

@ -90,7 +90,7 @@ class CefStreamResourceHandler : public CefResourceHandler {
bool read_on_file_thread_;
class Buffer;
scoped_ptr<Buffer> buffer_;
SCOPED_PTR(Buffer) buffer_;
#ifndef NDEBUG
// Used in debug builds to verify that |buffer_| isn't being accessed on
// multiple threads at the same time.

View File

@ -102,6 +102,22 @@ content::ResourceContext* CefBrowserContext::GetResourceContext() {
return resource_context_.get();
}
net::URLRequestContextGetter* CefBrowserContext::GetRequestContext() {
CEF_REQUIRE_UIT();
return GetDefaultStoragePartition(this)->GetURLRequestContext();
}
net::URLRequestContextGetter* CefBrowserContext::CreateMediaRequestContext() {
return GetRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContext::CreateMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) {
return nullptr;
}
ChromeZoomLevelPrefs* CefBrowserContext::GetZoomLevelPrefs() {
return static_cast<ChromeZoomLevelPrefs*>(
GetStoragePartition(this, NULL)->GetZoomLevelDelegate());

View File

@ -127,6 +127,11 @@ class CefBrowserContext
// BrowserContext methods.
content::ResourceContext* GetResourceContext() override;
net::URLRequestContextGetter* GetRequestContext() override;
net::URLRequestContextGetter* CreateMediaRequestContext() override;
net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) override;
// Profile methods.
ChromeZoomLevelPrefs* GetZoomLevelPrefs() override;

View File

@ -339,7 +339,7 @@ std::unique_ptr<content::ZoomLevelDelegate>
if (cache_path_.empty())
return std::unique_ptr<content::ZoomLevelDelegate>();
return make_scoped_ptr(new ChromeZoomLevelPrefs(
return base::WrapUnique(new ChromeZoomLevelPrefs(
GetPrefs(), cache_path_, partition_path,
ui_zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr()));
}
@ -357,29 +357,6 @@ content::DownloadManagerDelegate*
return download_manager_delegate_.get();
}
net::URLRequestContextGetter* CefBrowserContextImpl::GetRequestContext() {
CEF_REQUIRE_UIT();
return GetDefaultStoragePartition(this)->GetURLRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextImpl::GetMediaRequestContext() {
return GetRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextImpl::GetMediaRequestContextForRenderProcess(
int renderer_child_id) {
return GetRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextImpl::GetMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) {
return GetRequestContext();
}
content::BrowserPluginGuestManager* CefBrowserContextImpl::GetGuestManager() {
DCHECK(extensions::ExtensionsEnabled());
return guest_view::GuestViewManager::FromBrowserContext(this);

View File

@ -59,14 +59,6 @@ class CefBrowserContextImpl : public CefBrowserContext,
const base::FilePath& partition_path) override;
bool IsOffTheRecord() const override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
net::URLRequestContextGetter* GetRequestContext() override;
net::URLRequestContextGetter* GetMediaRequestContext() override;
net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
int renderer_child_id) override;
net::URLRequestContextGetter*
GetMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) override;
content::BrowserPluginGuestManager* GetGuestManager() override;
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
content::PushMessagingService* GetPushMessagingService() override;

View File

@ -101,29 +101,6 @@ content::DownloadManagerDelegate*
return download_manager_delegate_.get();
}
net::URLRequestContextGetter* CefBrowserContextProxy::GetRequestContext() {
CEF_REQUIRE_UIT();
return GetDefaultStoragePartition(this)->GetURLRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextProxy::GetMediaRequestContext() {
return GetRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextProxy::GetMediaRequestContextForRenderProcess(
int renderer_child_id) {
return GetRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextProxy::GetMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) {
return GetRequestContext();
}
content::BrowserPluginGuestManager* CefBrowserContextProxy::GetGuestManager() {
return parent_->GetGuestManager();
}

View File

@ -34,14 +34,6 @@ class CefBrowserContextProxy : public CefBrowserContext {
const base::FilePath& partition_path) override;
bool IsOffTheRecord() const override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
net::URLRequestContextGetter* GetRequestContext() override;
net::URLRequestContextGetter* GetMediaRequestContext() override;
net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
int renderer_child_id) override;
net::URLRequestContextGetter*
GetMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) override;
content::BrowserPluginGuestManager* GetGuestManager() override;
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
content::PushMessagingService* GetPushMessagingService() override;

View File

@ -556,7 +556,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->DispatchBeforeUnload(false);
contents->DispatchBeforeUnload();
} else {
CloseContents(contents);
}

View File

@ -488,7 +488,7 @@ std::unique_ptr<CefBrowserInfoManager::PendingPopup>
popup->opener_view_id == opener_view_id &&
popup->target_url == target_url) {
pending_popup_list_.weak_erase(it);
return make_scoped_ptr(popup);
return base::WrapUnique(popup);
}
}

View File

@ -39,7 +39,7 @@
#if defined(USE_AURA)
#include "ui/aura/env.h"
#include "ui/gfx/screen.h"
#include "ui/display/screen.h"
#include "ui/views/test/desktop_test_views_delegate.h"
#include "ui/views/widget/desktop_aura/desktop_screen.h"
@ -120,7 +120,7 @@ int CefBrowserMainParts::PreCreateThreads() {
content::GpuDataManager::GetInstance();
#if defined(USE_AURA)
gfx::Screen::SetScreenInstance(views::CreateDesktopScreen());
display::Screen::SetScreenInstance(views::CreateDesktopScreen());
#endif
return 0;
@ -187,8 +187,6 @@ void CefBrowserMainParts::PostMainMessageLoopRun() {
void CefBrowserMainParts::PostDestroyThreads() {
#if defined(USE_AURA)
aura::Env::DeleteInstance();
// Delete the DesktopTestViewsDelegate.
delete views::ViewsDelegate::GetInstance();
#endif

View File

@ -6,6 +6,7 @@
#include "libcef/browser/context.h"
#include "libcef/common/content_client.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#if defined(OS_MACOSX)
@ -87,12 +88,12 @@ CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() {
return nullptr;
}
scoped_ptr<base::MessagePump> CreatePump() {
std::unique_ptr<base::MessagePump> CreatePump() {
const CefSettings& settings = CefContext::Get()->settings();
if (settings.external_message_pump) {
CefRefPtr<CefBrowserProcessHandler> handler = GetBrowserProcessHandler();
if (handler)
return make_scoped_ptr(new MessagePumpExternal(0.01f, handler));
return base::WrapUnique(new MessagePumpExternal(0.01f, handler));
}
return base::MessageLoop::CreateMessagePumpForType(

View File

@ -6,6 +6,7 @@
#include <utility>
#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#if defined(OS_WIN)
@ -30,11 +31,11 @@ namespace {
std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
const CefWindowInfo& window_info) {
#if defined(OS_WIN)
return make_scoped_ptr(new CefBrowserPlatformDelegateNativeWin(window_info));
return base::WrapUnique(new CefBrowserPlatformDelegateNativeWin(window_info));
#elif defined(OS_MACOSX)
return make_scoped_ptr(new CefBrowserPlatformDelegateNativeMac(window_info));
return base::WrapUnique(new CefBrowserPlatformDelegateNativeMac(window_info));
#elif defined(OS_LINUX)
return make_scoped_ptr(
return base::WrapUnique(
new CefBrowserPlatformDelegateNativeLinux(window_info));
#endif
}
@ -42,14 +43,14 @@ std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
std::unique_ptr<CefBrowserPlatformDelegateOsr> CreateOSRDelegate(
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate) {
#if defined(OS_WIN)
return make_scoped_ptr(
new CefBrowserPlatformDelegateOsrWin(std::move(native_delegate)));
return base::WrapUnique(
new CefBrowserPlatformDelegateOsrWin(std::move(native_delegate)));
#elif defined(OS_MACOSX)
return make_scoped_ptr(
new CefBrowserPlatformDelegateOsrMac(std::move(native_delegate)));
return base::WrapUnique(
new CefBrowserPlatformDelegateOsrMac(std::move(native_delegate)));
#elif defined(OS_LINUX)
return make_scoped_ptr(
new CefBrowserPlatformDelegateOsrLinux(std::move(native_delegate)));
return base::WrapUnique(
new CefBrowserPlatformDelegateOsrLinux(std::move(native_delegate)));
#endif
}
@ -73,7 +74,7 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
// CefWindowInfo is not used in this case.
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
CreateNativeDelegate(CefWindowInfo());
return make_scoped_ptr(new CefBrowserPlatformDelegateViews(
return base::WrapUnique(new CefBrowserPlatformDelegateViews(
std::move(native_delegate),
static_cast<CefBrowserViewImpl*>(create_params.browser_view.get())));
}

View File

@ -72,12 +72,6 @@ variations::VariationsService*
return NULL;
}
web_resource::PromoResourceService*
ChromeBrowserProcessStub::promo_resource_service() {
NOTIMPLEMENTED();
return NULL;
}
BrowserProcessPlatformPart* ChromeBrowserProcessStub::platform_part() {
NOTIMPLEMENTED();
return NULL;
@ -94,6 +88,12 @@ NotificationUIManager* ChromeBrowserProcessStub::notification_ui_manager() {
return NULL;
}
NotificationPlatformBridge*
ChromeBrowserProcessStub::notification_platform_bridge() {
NOTIMPLEMENTED();
return NULL;
}
message_center::MessageCenter* ChromeBrowserProcessStub::message_center() {
NOTIMPLEMENTED();
return NULL;

View File

@ -40,11 +40,11 @@ class ChromeBrowserProcessStub : public BrowserProcess {
PrefService* local_state() override;
net::URLRequestContextGetter* system_request_context() override;
variations::VariationsService* variations_service() override;
web_resource::PromoResourceService* promo_resource_service() override;
BrowserProcessPlatformPart* platform_part() override;
extensions::EventRouterForwarder*
extension_event_router_forwarder() override;
NotificationUIManager* notification_ui_manager() override;
NotificationPlatformBridge* notification_platform_bridge() override;
message_center::MessageCenter* message_center() override;
policy::BrowserPolicyConnector* browser_policy_connector() override;
policy::PolicyService* policy_service() override;

View File

@ -92,7 +92,8 @@ std::string GetSwitchArgument(const std::vector<std::string>& vec,
class CefConfigurator : public Configurator {
public:
CefConfigurator(const base::CommandLine* cmdline,
net::URLRequestContextGetter* url_request_getter);
net::URLRequestContextGetter* url_request_getter,
PrefService* pref_service);
int InitialDelay() const override;
int NextCheckDelay() const override;
@ -116,6 +117,7 @@ class CefConfigurator : public Configurator {
bool UseCupSigning() const override;
scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner()
const override;
PrefService* GetPrefService() const override;
private:
friend class base::RefCountedThreadSafe<CefConfigurator>;
@ -123,6 +125,7 @@ class CefConfigurator : public Configurator {
~CefConfigurator() override {}
net::URLRequestContextGetter* url_request_getter_;
PrefService* pref_service_;
std::string extra_info_;
GURL url_source_override_;
bool fast_update_;
@ -133,8 +136,10 @@ class CefConfigurator : public Configurator {
CefConfigurator::CefConfigurator(
const base::CommandLine* cmdline,
net::URLRequestContextGetter* url_request_getter)
net::URLRequestContextGetter* url_request_getter,
PrefService* pref_service)
: url_request_getter_(url_request_getter),
pref_service_(pref_service),
fast_update_(false),
pings_enabled_(false),
deltas_enabled_(false),
@ -282,13 +287,18 @@ CefConfigurator::GetSequencedTaskRunner() const {
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
}
PrefService* CefConfigurator::GetPrefService() const {
return pref_service_;
}
} // namespace
scoped_refptr<update_client::Configurator>
MakeCefComponentUpdaterConfigurator(
const base::CommandLine* cmdline,
net::URLRequestContextGetter* context_getter) {
return new CefConfigurator(cmdline, context_getter);
net::URLRequestContextGetter* context_getter,
PrefService* pref_service) {
return new CefConfigurator(cmdline, context_getter, pref_service);
}
} // namespace component_updater

View File

@ -16,12 +16,15 @@ namespace net {
class URLRequestContextGetter;
}
class PrefService;
namespace component_updater {
scoped_refptr<update_client::Configurator>
MakeCefComponentUpdaterConfigurator(
const base::CommandLine* cmdline,
net::URLRequestContextGetter* context_getter);
net::URLRequestContextGetter* context_getter,
PrefService* pref_service);
} // namespace component_updater

View File

@ -823,12 +823,7 @@ const wchar_t* CefContentBrowserClient::GetResourceDllName() {
bool CefContentBrowserClient::PreSpawnRenderer(
sandbox::TargetPolicy* policy) {
// Flash requires this permission to play video files.
sandbox::ResultCode result = policy->AddRule(
sandbox::TargetPolicy::SUBSYS_HANDLES,
sandbox::TargetPolicy::HANDLES_DUP_ANY,
L"File");
return result == sandbox::SBOX_ALL_OK;
return true;
}
#endif // defined(OS_WIN)

View File

@ -363,11 +363,13 @@ component_updater::ComponentUpdateService*
CefContext::component_updater() {
if (!component_updater_.get()) {
CEF_REQUIRE_UIT_RETURN(NULL);
scoped_refptr<CefBrowserContextImpl> browser_context =
CefContentBrowserClient::Get()->browser_context();
scoped_refptr<update_client::Configurator> configurator =
component_updater::MakeCefComponentUpdaterConfigurator(
base::CommandLine::ForCurrentProcess(),
CefContentBrowserClient::Get()->browser_context()->
request_context().get());
browser_context->request_context().get(),
browser_context->GetPrefs());
// Creating the component updater does not do anything, components
// need to be registered and Start() needs to be called.
component_updater_.reset(component_updater::ComponentUpdateServiceFactory(

View File

@ -18,6 +18,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/threading/thread_restrictions.h"
#include "content/browser/storage_partition_impl.h"
#include "net/cookies/cookie_util.h"
#include "net/cookies/parsed_cookie.h"
#include "net/extras/sqlite/sqlite_persistent_cookie_store.h"
@ -608,8 +609,9 @@ void CefCookieManagerImpl::DeleteCookiesInternal(
base::Bind(DeleteCookiesCallbackImpl, callback));
} else if (cookie_name.empty()) {
// Delete all matching host cookies.
cookie_store->DeleteAllCreatedBetweenForHostAsync(
base::Time(), base::Time::Max(), url,
cookie_store->DeleteAllCreatedBetweenWithPredicateAsync(
base::Time(), base::Time::Max(),
content::StoragePartitionImpl::CreatePredicateForHostCookies(url),
base::Bind(DeleteCookiesCallbackImpl, callback));
} else {
// Delete all matching host and domain cookies.

View File

@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@ -19,6 +20,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
#include "ipc/ipc_channel.h"
@ -261,10 +263,12 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
net::URLFetcher* fetcher =
net::URLFetcher::Create(gurl, net::URLFetcher::GET, this).release();
pending_requests_[fetcher] = request_id;
fetcher->SetRequestContext(web_contents()->GetBrowserContext()->
GetRequestContext());
fetcher->SetRequestContext(
content::BrowserContext::GetDefaultStoragePartition(
web_contents()->GetBrowserContext())->
GetURLRequestContext());
fetcher->SetExtraRequestHeaders(headers);
fetcher->SaveResponseWithWriter(std::unique_ptr<net::URLFetcherResponseWriter>(
fetcher->SaveResponseWithWriter(base::WrapUnique(
new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id)));
fetcher->Start();
return;

View File

@ -263,7 +263,7 @@ ContentVerifier* CefExtensionSystem::content_verifier() {
std::unique_ptr<ExtensionSet> CefExtensionSystem::GetDependentExtensions(
const Extension* extension) {
return make_scoped_ptr(new ExtensionSet());
return base::WrapUnique(new ExtensionSet());
}
void CefExtensionSystem::InstallUpdate(const std::string& extension_id,

View File

@ -12,6 +12,7 @@
#include "libcef/browser/extensions/pdf_web_contents_helper_client.h"
#include "libcef/browser/printing/print_view_manager.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
#include "components/pdf/browser/pdf_web_contents_helper.h"
#include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h"
@ -39,7 +40,7 @@ CefExtensionsAPIClient::CreateGuestViewManagerDelegate(
// to provide the *Impl object instead of |context| which may be a *Proxy
// object. If we don't do this then the Delegate may attempt to access a
// *Proxy object that has already been deleted.
return make_scoped_ptr(
return base::WrapUnique(
new extensions::ExtensionsGuestViewManagerDelegate(
CefBrowserContextImpl::GetForContext(context).get()));
}
@ -47,7 +48,7 @@ CefExtensionsAPIClient::CreateGuestViewManagerDelegate(
std::unique_ptr<MimeHandlerViewGuestDelegate>
CefExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate(
MimeHandlerViewGuest* guest) const {
return make_scoped_ptr(new CefMimeHandlerViewGuestDelegate(guest));
return base::WrapUnique(new CefMimeHandlerViewGuestDelegate(guest));
}
void CefExtensionsAPIClient::AttachWebContentsHelpers(

View File

@ -115,6 +115,14 @@ void CefMediaCaptureDevicesDispatcher::OnCreatingAudioStream(
int render_view_id) {
}
void CefMediaCaptureDevicesDispatcher::OnSetCapturingLinkSecured(
int render_process_id,
int render_frame_id,
int page_request_id,
content::MediaStreamType stream_type,
bool is_secure) {
}
const MediaStreamDevices&
CefMediaCaptureDevicesDispatcher::GetAudioCaptureDevices() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));

View File

@ -6,7 +6,6 @@
#define CEF_LIBCEF_BROWSER_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/observer_list.h"
#include "content/public/browser/media_observer.h"
@ -53,6 +52,11 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver {
content::MediaRequestState state) override;
void OnCreatingAudioStream(int render_process_id,
int render_view_id) override;
void OnSetCapturingLinkSecured(int render_process_id,
int render_frame_id,
int page_request_id,
content::MediaStreamType stream_type,
bool is_secure) override;
private:
friend struct base::DefaultSingletonTraits<CefMediaCaptureDevicesDispatcher>;

View File

@ -369,7 +369,7 @@ CefEventHandle CefBrowserPlatformDelegateNativeLinux::GetEventHandle(
std::unique_ptr<CefMenuRunner>
CefBrowserPlatformDelegateNativeLinux::CreateMenuRunner() {
return make_scoped_ptr(new CefMenuRunnerLinux);
return base::WrapUnique(new CefMenuRunnerLinux);
}
void CefBrowserPlatformDelegateNativeLinux::TranslateMouseEvent(

View File

@ -15,6 +15,7 @@
#include "libcef/browser/thread_util.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/memory/ptr_util.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/render_widget_host_view.h"
@ -465,17 +466,17 @@ CefEventHandle CefBrowserPlatformDelegateNativeMac::GetEventHandle(
std::unique_ptr<CefFileDialogRunner>
CefBrowserPlatformDelegateNativeMac::CreateFileDialogRunner() {
return make_scoped_ptr(new CefFileDialogRunnerMac);
return base::WrapUnique(new CefFileDialogRunnerMac);
}
std::unique_ptr<CefJavaScriptDialogRunner>
CefBrowserPlatformDelegateNativeMac::CreateJavaScriptDialogRunner() {
return make_scoped_ptr(new CefJavaScriptDialogRunnerMac);
return base::WrapUnique(new CefJavaScriptDialogRunnerMac);
}
std::unique_ptr<CefMenuRunner>
CefBrowserPlatformDelegateNativeMac::CreateMenuRunner() {
return make_scoped_ptr(new CefMenuRunnerMac);
return base::WrapUnique(new CefMenuRunnerMac);
}
void CefBrowserPlatformDelegateNativeMac::TranslateMouseEvent(

View File

@ -22,7 +22,8 @@
#include "content/public/browser/native_web_keyboard_event.h"
#include "ui/aura/window.h"
#include "ui/base/win/shell.h"
#include "ui/gfx/screen.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gfx/win/hwnd_util.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
#include "ui/views/widget/widget.h"
@ -166,7 +167,7 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() {
// Adjust for potential display scaling.
gfx::Point point = gfx::Point(cr.right, cr.bottom);
float scale = gfx::Screen::GetScreen()->
float scale = display::Screen::GetScreen()->
GetDisplayNearestPoint(point).device_scale_factor();
point = gfx::ToFlooredPoint(
gfx::ScalePoint(gfx::PointF(point), 1.0f / scale));
@ -296,7 +297,7 @@ gfx::Point CefBrowserPlatformDelegateNativeWin::GetScreenPoint(
bounds_in_screen.y() + view.y());
// Adjust for potential display scaling.
float scale = gfx::Screen::GetScreen()->
float scale = display::Screen::GetScreen()->
GetDisplayNearestPoint(screen_point).device_scale_factor();
return gfx::ToFlooredPoint(
gfx::ScalePoint(gfx::PointF(screen_point), scale));
@ -499,17 +500,17 @@ CefEventHandle CefBrowserPlatformDelegateNativeWin::GetEventHandle(
std::unique_ptr<CefFileDialogRunner>
CefBrowserPlatformDelegateNativeWin::CreateFileDialogRunner() {
return make_scoped_ptr(new CefFileDialogRunnerWin);
return base::WrapUnique(new CefFileDialogRunnerWin);
}
std::unique_ptr<CefJavaScriptDialogRunner>
CefBrowserPlatformDelegateNativeWin::CreateJavaScriptDialogRunner() {
return make_scoped_ptr(new CefJavaScriptDialogRunnerWin);
return base::WrapUnique(new CefJavaScriptDialogRunnerWin);
}
std::unique_ptr<CefMenuRunner>
CefBrowserPlatformDelegateNativeWin::CreateMenuRunner() {
return make_scoped_ptr(new CefMenuRunnerWin);
return base::WrapUnique(new CefMenuRunnerWin);
}
void CefBrowserPlatformDelegateNativeWin::TranslateMouseEvent(

View File

@ -190,7 +190,7 @@ class TemplateParser {
using ResourcesMap = base::hash_map<std::string, int>;
// TODO(rkc): Once we have a separate source for apps, remove '*/apps/' aliases.
const char* kPathAliases[][2] = {
const char* const kPathAliases[][2] = {
{"../../../third_party/polymer/v1_0/components-chromium/", "polymer/v1_0/"},
{"../../../third_party/web-animations-js/sources/",
"polymer/v1_0/web-animations-js/"},
@ -211,7 +211,7 @@ const ResourcesMap* CreateResourcesMap() {
const std::string resource_name = kWebuiResources[i].name;
const int resource_id = kWebuiResources[i].value;
AddResource(resource_name, resource_id, result);
for (const char* (&alias)[2]: kPathAliases) {
for (const char* const (&alias)[2] : kPathAliases) {
if (base::StartsWith(resource_name, alias[0],
base::CompareCase::SENSITIVE)) {
AddResource(alias[1] + resource_name.substr(strlen(alias[0])),

View File

@ -115,15 +115,15 @@ void CefCookieStoreProxy::DeleteAllCreatedBetweenAsync(
}
}
void CefCookieStoreProxy::DeleteAllCreatedBetweenForHostAsync(
const base::Time delete_begin,
const base::Time delete_end,
const GURL& url,
void CefCookieStoreProxy::DeleteAllCreatedBetweenWithPredicateAsync(
const base::Time& delete_begin,
const base::Time& delete_end,
const CookiePredicate& predicate,
const DeleteCallback& callback) {
net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store) {
cookie_store->DeleteAllCreatedBetweenForHostAsync(delete_begin, delete_end,
url, callback);
cookie_store->DeleteAllCreatedBetweenWithPredicateAsync(
delete_begin, delete_end, predicate, callback);
}
}

View File

@ -59,10 +59,10 @@ class CefCookieStoreProxy : public net::CookieStore {
void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
const base::Time& delete_end,
const DeleteCallback& callback) override;
void DeleteAllCreatedBetweenForHostAsync(
const base::Time delete_begin,
const base::Time delete_end,
const GURL& url,
void DeleteAllCreatedBetweenWithPredicateAsync(
const base::Time& delete_begin,
const base::Time& delete_end,
const CookiePredicate& predicate,
const DeleteCallback& callback) override;
void DeleteSessionCookiesAsync(const DeleteCallback& callback) override;
void FlushStore(const base::Closure& callback) override;

View File

@ -10,6 +10,7 @@
#include "libcef/browser/net/devtools_scheme_handler.h"
#include "libcef/common/net/scheme_registration.h"
#include "base/memory/ptr_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/url_constants.h"
@ -60,7 +61,7 @@ void InstallInternalProtectedHandlers(
protocol_handler.reset(
scheme::WrapChromeProtocolHandler(
request_manager,
make_scoped_ptr(it->second.release())).release());
base::WrapUnique(it->second.release())).release());
} else {
protocol_handler.reset(it->second.release());
}
@ -70,7 +71,7 @@ void InstallInternalProtectedHandlers(
DCHECK(IsInternalProtectedScheme(scheme));
bool set_protocol = job_factory->SetProtocolHandler(
scheme, make_scoped_ptr(protocol_handler.release()));
scheme, base::WrapUnique(protocol_handler.release()));
DCHECK(set_protocol);
}
}

View File

@ -154,7 +154,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
storage_->set_network_delegate(base::WrapUnique(new CefNetworkDelegate));
storage_->set_channel_id_service(make_scoped_ptr(
storage_->set_channel_id_service(base::WrapUnique(
new net::ChannelIDService(
new net::DefaultChannelIDStore(NULL),
base::WorkerPool::GetTaskRunner(true))));
@ -168,7 +168,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
storage_->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL));
storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
storage_->set_transport_security_state(
make_scoped_ptr(new net::TransportSecurityState));
base::WrapUnique(new net::TransportSecurityState));
std::unique_ptr<net::ProxyService> system_proxy_service =
ProxyServiceFactory::CreateProxyService(
@ -232,8 +232,8 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
settings_.ignore_certificate_errors ? true : false;
storage_->set_http_network_session(
make_scoped_ptr(new net::HttpNetworkSession(network_session_params)));
storage_->set_http_transaction_factory(make_scoped_ptr(
base::WrapUnique(new net::HttpNetworkSession(network_session_params)));
storage_->set_http_transaction_factory(base::WrapUnique(
new net::HttpCache(storage_->http_network_session(),
std::move(main_backend),
true /* set_up_quic_server_info */)));
@ -267,7 +267,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
i != request_interceptors_.rend();
++i) {
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
std::move(top_job_factory), make_scoped_ptr(*i)));
std::move(top_job_factory), base::WrapUnique(*i)));
}
request_interceptors_.weak_clear();

View File

@ -16,6 +16,7 @@
#include "libcef/common/request_impl.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
@ -201,7 +202,7 @@ void CefURLRequestManager::SetProtocolHandlerIfNecessary(
bool set_protocol = job_factory_->SetProtocolHandler(
scheme,
make_scoped_ptr(add ? new CefProtocolHandler(this, scheme) : NULL));
base::WrapUnique(add ? new CefProtocolHandler(this, scheme) : NULL));
DCHECK(set_protocol);
}

View File

@ -20,10 +20,11 @@
#include "cc/base/switches.h"
#include "cc/output/copy_output_request.h"
#include "cc/scheduler/delay_based_time_source.h"
#include "components/display_compositor/gl_helper.h"
#include "content/browser/bad_message.h"
#include "content/browser/compositor/gl_helper.h"
#include "content/browser/compositor/image_transport_factory.h"
#include "content/browser/renderer_host/dip_util.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/resize_lock.h"
#include "content/common/view_messages.h"
@ -251,7 +252,7 @@ class CefCopyFrameGenerator {
content::ImageTransportFactory* factory =
content::ImageTransportFactory::GetInstance();
content::GLHelper* gl_helper = factory->GetGLHelper();
display_compositor::GLHelper* gl_helper = factory->GetGLHelper();
if (!gl_helper)
return;
@ -283,7 +284,7 @@ class CefCopyFrameGenerator {
damage_rect,
base::Passed(&bitmap_),
base::Passed(&bitmap_pixels_lock)),
content::GLHelper::SCALER_QUALITY_FAST);
display_compositor::GLHelper::SCALER_QUALITY_FAST);
}
static void CopyFromCompositingSurfaceFinishedProxy(
@ -296,7 +297,7 @@ class CefCopyFrameGenerator {
// This method may be called after the view has been deleted.
gpu::SyncToken sync_token;
if (result) {
content::GLHelper* gl_helper =
display_compositor::GLHelper* gl_helper =
content::ImageTransportFactory::GetInstance()->GetGLHelper();
if (gl_helper)
gl_helper->GenerateSyncToken(&sync_token);
@ -552,10 +553,6 @@ gfx::NativeView CefRenderWidgetHostViewOSR::GetNativeView() const {
return gfx::NativeView();
}
gfx::NativeViewId CefRenderWidgetHostViewOSR::GetNativeViewId() const {
return gfx::NativeViewId();
}
gfx::NativeViewAccessible
CefRenderWidgetHostViewOSR::GetNativeViewAccessible() {
return gfx::NativeViewAccessible();
@ -788,8 +785,8 @@ void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) {
}
#if !defined(OS_MACOSX)
void CefRenderWidgetHostViewOSR::UpdateInputMethodIfNecessary(
bool text_input_state_changed) {
void CefRenderWidgetHostViewOSR::TextInputStateChanged(
const content::TextInputState& params) {
}
void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
@ -1017,6 +1014,19 @@ bool CefRenderWidgetHostViewOSR::DelegatedFrameHostIsVisible() const {
return !render_widget_host_->is_hidden();
}
SkColor CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGutterColor(
SkColor color) const {
// When making an element on the page fullscreen the element's background
// may not match the page's, so use black as the gutter color to avoid
// flashes of brighter colors during the transition.
if (render_widget_host_->delegate() &&
render_widget_host_->delegate()->IsFullscreenForCurrentTab(
render_widget_host_)) {
return SK_ColorBLACK;
}
return color;
}
gfx::Size
CefRenderWidgetHostViewOSR::DelegatedFrameHostDesiredSizeInDIP() const {
return root_layer_->bounds().size();
@ -1068,6 +1078,13 @@ void CefRenderWidgetHostViewOSR::DelegatedFrameHostUpdateVSyncParameters(
render_widget_host_->UpdateVSyncParameters(timebase, interval);
}
void CefRenderWidgetHostViewOSR::SetBeginFrameSource(
cc::BeginFrameSource* source) {
// TODO(cef): Maybe we can use this method in combination with
// OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer.
// See https://codereview.chromium.org/1841083007.
}
bool CefRenderWidgetHostViewOSR::InstallTransparency() {
if (transparent_) {
SetBackgroundColor(SkColor());

View File

@ -96,7 +96,6 @@ class CefRenderWidgetHostViewOSR
void SetBounds(const gfx::Rect& rect) override;
gfx::Vector2dF GetLastScrollOffset() const override;
gfx::NativeView GetNativeView() const override;
gfx::NativeViewId GetNativeViewId() const override;
gfx::NativeViewAccessible GetNativeViewAccessible() override;
ui::TextInputClient* GetTextInputClient() override;
void Focus() override;
@ -111,6 +110,7 @@ class CefRenderWidgetHostViewOSR
void UnlockMouse() override;
#if defined(OS_MACOSX)
ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac() const override;
void SetActive(bool active) override;
void ShowDefinitionForSelection() override;
bool SupportsSpeech() const override;
@ -130,7 +130,7 @@ class CefRenderWidgetHostViewOSR
content::RenderWidgetHostView* reference_host_view) override;
void UpdateCursor(const content::WebCursor& cursor) override;
void SetIsLoading(bool is_loading) override;
void UpdateInputMethodIfNecessary(bool text_input_state_changed) override;
void TextInputStateChanged(const content::TextInputState& params) override;
void ImeCancelComposition() override;
void RenderProcessGone(base::TerminationStatus status,
int error_code) override;
@ -203,6 +203,7 @@ class CefRenderWidgetHostViewOSR
// DelegatedFrameHostClient implementation.
ui::Layer* DelegatedFrameHostGetLayer() const override;
bool DelegatedFrameHostIsVisible() const override;
SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override;
gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override;
bool DelegatedFrameCanCreateResizeLock() const override;
std::unique_ptr<content::ResizeLock> DelegatedFrameHostCreateResizeLock(
@ -218,6 +219,7 @@ class CefRenderWidgetHostViewOSR
void DelegatedFrameHostUpdateVSyncParameters(
const base::TimeTicks& timebase,
const base::TimeDelta& interval) override;
void SetBeginFrameSource(cc::BeginFrameSource* source) override;
bool InstallTransparency();

View File

@ -30,6 +30,13 @@ CefTextInputClientOSRMac* GetInputClientFromContext(
} // namespace
ui::AcceleratedWidgetMac* CefRenderWidgetHostViewOSR::GetAcceleratedWidgetMac()
const {
if (browser_compositor_)
return browser_compositor_->accelerated_widget_mac();
return nullptr;
}
void CefRenderWidgetHostViewOSR::SetActive(bool active) {
}
@ -50,8 +57,8 @@ bool CefRenderWidgetHostViewOSR::IsSpeaking() const {
void CefRenderWidgetHostViewOSR::StopSpeaking() {
}
void CefRenderWidgetHostViewOSR::UpdateInputMethodIfNecessary(
bool text_input_state_changed) {
void CefRenderWidgetHostViewOSR::TextInputStateChanged(
const content::TextInputState& params) {
[NSApp updateWindows];
}

View File

@ -16,7 +16,7 @@
#include "base/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/plugins/plugin_finder.h"
#include "chrome/common/pref_names.h"

View File

@ -51,12 +51,13 @@ class CefPluginInfoMessageFilter : public content::BrowserMessageFilter {
const content::WebPluginInfo& plugin,
const PluginMetadata* plugin_metadata,
CefViewHostMsg_GetPluginInfo_Status* status) const;
bool FindEnabledPlugin(const GetPluginInfo_Params& params,
CefRequestContextHandler* handler,
CefViewHostMsg_GetPluginInfo_Status* status,
content::WebPluginInfo* plugin,
std::string* actual_mime_type,
std::unique_ptr<PluginMetadata>* plugin_metadata) const;
bool FindEnabledPlugin(
const GetPluginInfo_Params& params,
CefRequestContextHandler* handler,
CefViewHostMsg_GetPluginInfo_Status* status,
content::WebPluginInfo* plugin,
std::string* actual_mime_type,
std::unique_ptr<PluginMetadata>* plugin_metadata) const;
void GetPluginContentSetting(const content::WebPluginInfo& plugin,
const GURL& policy_url,
const GURL& plugin_url,
@ -64,8 +65,6 @@ class CefPluginInfoMessageFilter : public content::BrowserMessageFilter {
ContentSetting* setting,
bool* is_default,
bool* is_managed) const;
void MaybeGrantAccess(CefViewHostMsg_GetPluginInfo_Status status,
const base::FilePath& path) const;
bool IsPluginEnabled(const content::WebPluginInfo& plugin) const;
private:

View File

@ -25,6 +25,7 @@
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "components/update_client/update_client.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_prefs.h"
#include "grit/cef_strings.h"
@ -126,6 +127,7 @@ std::unique_ptr<PrefService> CreatePrefService(const base::FilePath& pref_path)
extensions::ExtensionPrefs::RegisterProfilePrefs(registry.get());
HostContentSettingsMap::RegisterProfilePrefs(registry.get());
renderer_prefs::RegisterProfilePrefs(registry.get());
update_client::RegisterPrefs(registry.get());
// Print preferences.
registry->RegisterBooleanPref(prefs::kPrintingEnabled, true);

View File

@ -5,7 +5,7 @@
#ifndef CEF_LIBCEF_BROWSER_PREFS_BROWSER_PREFS_H_
#define CEF_LIBCEF_BROWSER_PREFS_BROWSER_PREFS_H_
#include "base/memory/scoped_ptr.h"
#include <memory>
class PrefService;

View File

@ -13,6 +13,7 @@
#include "libcef/common/extensions/extensions_util.h"
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/character_encoding.h"
@ -280,7 +281,7 @@ void SetString(CommandLinePrefStore* prefs,
const std::string& value) {
prefs->SetValue(
key,
make_scoped_ptr(new base::StringValue(value)),
base::WrapUnique(new base::StringValue(value)),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
}
@ -288,7 +289,7 @@ void SetBool(CommandLinePrefStore* prefs,
const std::string& key,
bool value) {
prefs->SetValue(key,
make_scoped_ptr(new base::FundamentalValue(value)),
base::WrapUnique(new base::FundamentalValue(value)),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
}

View File

@ -13,7 +13,7 @@
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/timer/timer.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"

View File

@ -33,13 +33,14 @@
namespace {
void SendExecuteMimeTypeHandlerEvent(std::unique_ptr<content::StreamInfo> stream,
int64_t expected_content_size,
int render_process_id,
int render_frame_id,
const std::string& extension_id,
const std::string& view_id,
bool embedded) {
void SendExecuteMimeTypeHandlerEvent(
std::unique_ptr<content::StreamInfo> stream,
int64_t expected_content_size,
int render_process_id,
int render_frame_id,
const std::string& extension_id,
const std::string& view_id,
bool embedded) {
CEF_REQUIRE_UIT();
CefRefPtr<CefBrowserHostImpl> browser =

View File

@ -198,12 +198,6 @@ void CefSpeechRecognitionManagerDelegate::OnAudioLevelsChange(
void CefSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) {
}
void CefSpeechRecognitionManagerDelegate::GetDiagnosticInformation(
bool* can_report_metrics,
std::string* hardware_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
void CefSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
int session_id,
base::Callback<void(bool ask_user, bool is_allowed)> callback) {

View File

@ -7,7 +7,6 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/speech_recognition_event_listener.h"
#include "content/public/browser/speech_recognition_manager_delegate.h"
@ -39,8 +38,6 @@ class CefSpeechRecognitionManagerDelegate
float noise_volume) override;
// SpeechRecognitionManagerDelegate methods.
void GetDiagnosticInformation(bool* can_report_metrics,
std::string* hardware_info) override;
void CheckRecognitionIsAllowed(
int session_id,
base::Callback<void(bool ask_user, bool is_allowed)> callback) override;

View File

@ -10,7 +10,6 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted_memory.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
// May only be accessed on the browser process UI thread.

View File

@ -267,8 +267,9 @@ std::unique_ptr<CefJavaScriptDialogRunner>
return native_delegate_->CreateJavaScriptDialogRunner();
}
std::unique_ptr<CefMenuRunner> CefBrowserPlatformDelegateViews::CreateMenuRunner() {
return make_scoped_ptr(new CefMenuRunnerViews(browser_view_.get()));
std::unique_ptr<CefMenuRunner>
CefBrowserPlatformDelegateViews::CreateMenuRunner() {
return base::WrapUnique(new CefMenuRunnerViews(browser_view_.get()));
}
bool CefBrowserPlatformDelegateViews::IsWindowless() const {

View File

@ -6,12 +6,12 @@
#include "libcef/browser/views/view_util.h"
#include "ui/gfx/screen.h"
#include "ui/display/screen.h"
// static
CefRefPtr<CefDisplay> CefDisplay::GetPrimaryDisplay() {
CEF_REQUIRE_UIT_RETURN(nullptr);
return new CefDisplayImpl(gfx::Screen::GetScreen()->GetPrimaryDisplay());
return new CefDisplayImpl(display::Screen::GetScreen()->GetPrimaryDisplay());
}
// static
@ -36,7 +36,7 @@ CefRefPtr<CefDisplay> CefDisplay::GetDisplayMatchingBounds(
// static
size_t CefDisplay::GetDisplayCount() {
CEF_REQUIRE_UIT_RETURN(0U);
return static_cast<size_t>(gfx::Screen::GetScreen()->GetNumDisplays());
return static_cast<size_t>(display::Screen::GetScreen()->GetNumDisplays());
}
// static
@ -45,13 +45,13 @@ void CefDisplay::GetAllDisplays(std::vector<CefRefPtr<CefDisplay> >& displays) {
displays.clear();
typedef std::vector<gfx::Display> DisplayVector;
DisplayVector vec = gfx::Screen::GetScreen()->GetAllDisplays();
typedef std::vector<display::Display> DisplayVector;
DisplayVector vec = display::Screen::GetScreen()->GetAllDisplays();
for (size_t i = 0; i < vec.size(); ++i)
displays.push_back(new CefDisplayImpl(vec[i]));
}
CefDisplayImpl::CefDisplayImpl(const gfx::Display& display)
CefDisplayImpl::CefDisplayImpl(const display::Display& display)
: display_(display) {
CEF_REQUIRE_UIT();
}

View File

@ -9,11 +9,11 @@
#include "include/views/cef_display.h"
#include "libcef/browser/thread_util.h"
#include "ui/gfx/display.h"
#include "ui/display/display.h"
class CefDisplayImpl : public CefDisplay {
public:
explicit CefDisplayImpl(const gfx::Display& display);
explicit CefDisplayImpl(const display::Display& display);
~CefDisplayImpl() override;
// CefDisplay methods:
@ -25,10 +25,10 @@ class CefDisplayImpl : public CefDisplay {
CefRect GetWorkArea() override;
int GetRotation() override;
const gfx::Display& display() const { return display_; }
const display::Display& display() const { return display_; }
private:
gfx::Display display_;
display::Display display_;
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDisplayImpl);
DISALLOW_COPY_AND_ASSIGN(CefDisplayImpl);

View File

@ -620,7 +620,8 @@ CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsEnabled() {
CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetFocusable(bool focusable) {
CEF_REQUIRE_VALID_RETURN_VOID();
root_view()->SetFocusable(focusable);
root_view()->SetFocusBehavior(focusable ? views::View::FocusBehavior::ALWAYS :
views::View::FocusBehavior::NEVER);
}
CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsFocusable() {

View File

@ -12,13 +12,14 @@
#include "ui/aura/window_tree_host.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/screen.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/window/non_client_view.h"
#if defined(OS_WIN)
#include "ui/gfx/win/dpi.h"
#include "ui/display/win/screen_win.h"
#endif
namespace view_util {
@ -180,24 +181,26 @@ CefRefPtr<CefWindow> GetWindowFor(views::Widget* widget) {
return window;
}
gfx::Display GetDisplayNearestPoint(const gfx::Point& point,
bool input_pixel_coords) {
display::Display GetDisplayNearestPoint(const gfx::Point& point,
bool input_pixel_coords) {
gfx::Point find_point = point;
#if defined(OS_WIN)
if (input_pixel_coords)
find_point = gfx::win::ScreenToDIPPoint(point);
find_point = display::win::ScreenWin::ScreenToDIPPoint(point);
#endif
return gfx::Screen::GetScreen()->GetDisplayNearestPoint(find_point);
return display::Screen::GetScreen()->GetDisplayNearestPoint(find_point);
}
gfx::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
bool input_pixel_coords) {
display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
bool input_pixel_coords) {
gfx::Rect find_bounds = bounds;
#if defined(OS_WIN)
if (input_pixel_coords)
find_bounds = gfx::win::ScreenToDIPRect(find_bounds);
if (input_pixel_coords) {
find_bounds = display::win::ScreenWin::ScreenToDIPRect(nullptr,
find_bounds);
}
#endif
return gfx::Screen::GetScreen()->GetDisplayMatching(bounds);
return display::Screen::GetScreen()->GetDisplayMatching(bounds);
}
void ConvertPointFromPixels(gfx::Point* point,
@ -221,7 +224,7 @@ bool ConvertPointToScreen(views::View* view,
views::View::ConvertPointToScreen(view, point);
if (output_pixel_coords) {
const gfx::Display& display = GetDisplayNearestPoint(*point, false);
const display::Display& display = GetDisplayNearestPoint(*point, false);
ConvertPointToPixels(point, display.device_scale_factor());
}
@ -235,7 +238,7 @@ bool ConvertPointFromScreen(views::View* view,
return false;
if (input_pixel_coords) {
const gfx::Display& display = GetDisplayNearestPoint(*point, true);
const display::Display& display = GetDisplayNearestPoint(*point, true);
ConvertPointFromPixels(point, display.device_scale_factor());
}

View File

@ -11,8 +11,11 @@
#include "ui/views/view.h"
namespace gfx {
namespace display {
class Display;
}
namespace gfx {
class Point;
}
@ -70,14 +73,14 @@ CefRefPtr<CefWindow> GetWindowFor(views::Widget* widget);
// Returns the Display nearest |point|. Set |input_pixel_coords| to true if
// |point| is in pixel coordinates instead of density independent pixels (DIP).
gfx::Display GetDisplayNearestPoint(const gfx::Point& point,
bool input_pixel_coords);
display::Display GetDisplayNearestPoint(const gfx::Point& point,
bool input_pixel_coords);
// Returns the Display that most closely intersects |bounds|. Set
// |input_pixel_coords| to true if |bounds| is in pixel coordinates instead of
// density independent pixels (DIP).
gfx::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
bool input_pixel_coords);
display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
bool input_pixel_coords);
// Convert |point| from pixel coordinates to density independent pixels (DIP)
// using |device_scale_factor|.

View File

@ -24,7 +24,7 @@
#endif
#if defined(OS_WIN)
#include "ui/gfx/win/dpi.h"
#include "ui/display/win/screen_win.h"
#endif
namespace {
@ -379,7 +379,7 @@ void CefWindowImpl::CancelMenu() {
CefRefPtr<CefDisplay> CefWindowImpl::GetDisplay() {
CEF_REQUIRE_VALID_RETURN(nullptr);
if (widget_ && root_view()) {
const gfx::Display& display = root_view()->GetDisplay();
const display::Display& display = root_view()->GetDisplay();
if (display.is_valid())
return new CefDisplayImpl(display);
}
@ -444,7 +444,7 @@ void CefWindowImpl::SendMouseMove(int screen_x, int screen_y) {
gfx::Point point(screen_x, screen_y);
#if defined(OS_WIN)
// Windows expects pixel coordinates.
point = gfx::win::DIPToScreenPoint(point);
point = display::win::ScreenWin::DIPToScreenPoint(point);
#endif
ui_controls::SendMouseMove(point.x(), point.y());

View File

@ -18,7 +18,7 @@
#endif
#if defined(OS_WIN)
#include "ui/gfx/win/dpi.h"
#include "ui/display/screen.h"
#include "ui/views/win/hwnd_util.h"
#endif
@ -61,11 +61,14 @@ class NativeFrameViewEx : public views::NativeFrameView {
// views::GetWindowBoundsForClientBounds() expects the input Rect to be in
// pixel coordinates. NativeFrameView does not implement this correctly so
// we need to provide our own implementation. See http://crbug.com/602692.
gfx::Rect pixel_bounds = gfx::win::DIPToScreenRect(client_bounds);
gfx::Rect pixel_bounds =
display::Screen::GetScreen()->DIPToScreenRectInWindow(
view_util::GetNativeWindow(widget_), client_bounds);
pixel_bounds = views::GetWindowBoundsForClientBounds(
static_cast<View*>(const_cast<NativeFrameViewEx*>(this)),
pixel_bounds);
return gfx::win::ScreenToDIPRect(pixel_bounds);
return display::Screen::GetScreen()->ScreenToDIPRectInWindow(
view_util::GetNativeWindow(widget_), pixel_bounds);
#else
// Use the default implementation.
return views::NativeFrameView::GetWindowBoundsForClientBounds(
@ -427,13 +430,13 @@ void CefWindowView::ViewHierarchyChanged(
ParentClass::ViewHierarchyChanged(details);
}
gfx::Display CefWindowView::GetDisplay() const {
display::Display CefWindowView::GetDisplay() const {
const views::Widget* widget = GetWidget();
if (widget) {
return view_util::GetDisplayMatchingBounds(
widget->GetWindowBoundsInScreen(), false);
}
return gfx::Display();
return display::Display();
}
void CefWindowView::SetTitle(const base::string16& title) {

View File

@ -11,7 +11,7 @@
#include "libcef/browser/views/panel_view.h"
#include "ui/gfx/display.h"
#include "ui/display/display.h"
#include "ui/views/widget/widget_delegate.h"
class SkRegion;
@ -71,7 +71,7 @@ class CefWindowView :
const views::View::ViewHierarchyChangedDetails& details) override;
// Returns the Display containing this Window.
gfx::Display GetDisplay() const;
display::Display GetDisplay() const;
// Set/get the window title.
void SetTitle(const base::string16& title);

View File

@ -35,6 +35,7 @@
#include "extensions/common/constants.h"
#include "pdf/pdf.h"
#include "ui/base/layout.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
@ -709,6 +710,9 @@ void CefMainDelegate::InitializeResourceBundle() {
std::string locale = command_line->GetSwitchValueASCII(switches::kLang);
DCHECK(!locale.empty());
// Avoid DCHECK() in ResourceBundle::LoadChromeResources().
ui::MaterialDesignController::Initialize();
const std::string loaded_locale =
ui::ResourceBundle::InitSharedInstanceWithLocale(
locale,

View File

@ -12,7 +12,6 @@
#include "include/cef_app.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/app/content_main_delegate.h"
namespace base {

View File

@ -482,7 +482,7 @@ void CefRequestImpl::Get(net::URLRequest* request, bool changed_only) const {
if (ShouldSet(kChangedPostData, changed_only)) {
if (postdata_.get()) {
request->set_upload(make_scoped_ptr(
request->set_upload(base::WrapUnique(
static_cast<CefPostDataImpl*>(postdata_.get())->Get()));
} else if (request->get_upload()) {
request->set_upload(std::unique_ptr<net::UploadDataStream>());
@ -1025,7 +1025,7 @@ net::UploadDataStream* CefPostDataImpl::Get() const {
UploadElementReaders element_readers;
ElementVector::const_iterator it = elements_.begin();
for (; it != elements_.end(); ++it) {
element_readers.push_back(make_scoped_ptr(
element_readers.push_back(base::WrapUnique(
static_cast<CefPostDataElementImpl*>(it->get())->Get()));
}
@ -1282,12 +1282,12 @@ net::UploadElementReader* CefPostDataElementImpl::Get() const {
net::UploadElement* element = new net::UploadElement();
element->SetToBytes(static_cast<char*>(data_.bytes.bytes),
data_.bytes.size);
return new BytesElementReader(make_scoped_ptr(element));
return new BytesElementReader(base::WrapUnique(element));
} else if (type_ == PDE_TYPE_FILE) {
net::UploadElement* element = new net::UploadElement();
base::FilePath path = base::FilePath(CefString(&data_.filename));
element->SetToFilePath(path);
return new FileElementReader(make_scoped_ptr(element));
return new FileElementReader(base::WrapUnique(element));
} else {
NOTREACHED();
return NULL;

View File

@ -10,7 +10,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;

View File

@ -12,7 +12,6 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "base/threading/platform_thread.h"

View File

@ -32,7 +32,7 @@
#include "libcef/renderer/plugins/plugin_preroller.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/render_thread_observer.h"
#include "libcef/renderer/thread_util.h"
#include "libcef/renderer/v8_impl.h"
#include "libcef/renderer/webkit_glue.h"
@ -60,7 +60,7 @@
#include "components/nacl/common/nacl_constants.h"
#include "components/printing/renderer/print_web_view_helper.h"
#include "components/visitedlink/renderer/visitedlink_slave.h"
#include "components/web_cache/renderer/web_cache_render_process_observer.h"
#include "components/web_cache/renderer/web_cache_impl.h"
#include "content/common/frame_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
@ -389,8 +389,8 @@ void CefContentRendererClient::RenderThreadStarted() {
base::CommandLine::ForCurrentProcess();
render_task_runner_ = base::ThreadTaskRunnerHandle::Get();
observer_.reset(new CefRenderProcessObserver());
web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver());
observer_.reset(new CefRenderThreadObserver());
web_cache_impl_.reset(new web_cache::WebCacheImpl());
content::RenderThread* thread = content::RenderThread::Get();
thread->AddObserver(observer_.get());
@ -420,7 +420,7 @@ void CefContentRendererClient::RenderThreadStarted() {
cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries;
#if defined(OS_MACOSX)
if (base::mac::IsOSLionOrLater()) {
{
base::ScopedCFTypeRef<CFStringRef> key(
base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding"));
base::ScopedCFTypeRef<CFStringRef> value;
@ -629,8 +629,8 @@ CefContentRendererClient::CreateBrowserPluginDelegate(
render_frame, mime_type, original_url);
}
void CefContentRendererClient::AddKeySystems(
std::vector<media::KeySystemInfo>* key_systems) {
void CefContentRendererClient::AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) {
AddCefKeySystems(key_systems);
}

View File

@ -34,11 +34,11 @@ class VisitedLinkSlave;
}
namespace web_cache {
class WebCacheRenderProcessObserver;
class WebCacheImpl;
}
class CefGuestView;
class CefRenderProcessObserver;
class CefRenderThreadObserver;
struct Cef_CrossOriginWhiteListEntry_Params;
struct CefViewHostMsg_GetPluginInfo_Output;
class ChromePDFPrintClient;
@ -126,7 +126,9 @@ class CefContentRendererClient : public content::ContentRendererClient,
content::RenderFrame* render_frame,
const std::string& mime_type,
const GURL& original_url) override;
void AddKeySystems(std::vector<media::KeySystemInfo>* key_systems) override;
void AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems)
override;
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override;
void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override;
@ -150,8 +152,8 @@ class CefContentRendererClient : public content::ContentRendererClient,
void RunSingleProcessCleanupOnUIThread();
scoped_refptr<base::SequencedTaskRunner> render_task_runner_;
std::unique_ptr<CefRenderProcessObserver> observer_;
std::unique_ptr<web_cache::WebCacheRenderProcessObserver> web_cache_observer_;
std::unique_ptr<CefRenderThreadObserver> observer_;
std::unique_ptr<web_cache::WebCacheImpl> web_cache_impl_;
std::unique_ptr<SpellCheck> spellcheck_;
std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_;

View File

@ -355,8 +355,9 @@ bool CefDOMNodeImpl::SetElementAttribute(const CefString& attrName,
}
WebElement element = node_.to<blink::WebElement>();
return element.setAttribute(base::string16(attrName),
base::string16(value));
element.setAttribute(base::string16(attrName),
base::string16(value));
return true;
}
CefString CefDOMNodeImpl::GetElementInnerText() {

View File

@ -6,7 +6,7 @@
#include "libcef/common/cef_messages.h"
#include "libcef/renderer/extensions/extensions_dispatcher_delegate.h"
#include "libcef/renderer/render_process_observer.h"
#include "libcef/renderer/render_thread_observer.h"
#include "base/command_line.h"
#include "chrome/common/extensions/extension_process_policy.h"
@ -117,7 +117,7 @@ CefExtensionsRendererClient::~CefExtensionsRendererClient() {
}
bool CefExtensionsRendererClient::IsIncognitoProcess() const {
return CefRenderProcessObserver::is_incognito_process();
return CefRenderThreadObserver::is_incognito_process();
}
int CefExtensionsRendererClient::GetLowestIsolatedWorldId() const {

View File

@ -5,10 +5,10 @@
#ifndef CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_RENDERER_CLIENT_H_
#define CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_RENDERER_CLIENT_H_
#include <memory>
#include <string>
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "extensions/renderer/extensions_renderer_client.h"
#include "ui/base/page_transition_types.h"

View File

@ -11,10 +11,13 @@
#include "base/strings/string16.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "components/cdm/renderer/widevine_key_systems.h"
#include "components/cdm/renderer/widevine_key_system_properties.h"
#include "content/public/renderer/render_thread.h"
#include "libcef/common/cef_messages.h"
#include "media/base/eme_constants.h"
#include "media/base/key_system_properties.h"
#include "media/media_features.h"
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
@ -25,7 +28,7 @@
#include "base/version.h"
#endif
using media::KeySystemInfo;
using media::KeySystemProperties;
using media::SupportedCodecs;
#if defined(ENABLE_PEPPER_CDMS)
@ -74,7 +77,7 @@ void GetSupportedCodecsForPepperCdm(
}
static void AddPepperBasedWidevine(
std::vector<KeySystemInfo>* concrete_key_systems) {
std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) {
#if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
Version glibc_version(gnu_get_libc_version());
DCHECK(glibc_version.IsValid());
@ -115,27 +118,31 @@ static void AddPepperBasedWidevine(
#if defined(USE_PROPRIETARY_CODECS)
if (codecs[i] == kCdmSupportedCodecAvc1)
supported_codecs |= media::EME_CODEC_MP4_AVC1;
#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING)
if (codecs[i] == kCdmSupportedCodecVp9)
supported_codecs |= media::EME_CODEC_MP4_VP9;
#endif
#endif // defined(USE_PROPRIETARY_CODECS)
}
cdm::AddWidevineWithCodecs(
concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties(
supported_codecs,
media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness.
media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness.
media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
media::EmeSessionTypeSupport::
NOT_SUPPORTED, // persistent-release-message.
media::EmeFeatureSupport::REQUESTABLE, // Persistent state.
media::EmeFeatureSupport::NOT_SUPPORTED, // Distinctive identifier.
concrete_key_systems);
NOT_SUPPORTED, // persistent-release-message.
media::EmeFeatureSupport::REQUESTABLE, // Persistent state.
media::EmeFeatureSupport::NOT_SUPPORTED)); // Distinctive identifier.
}
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#endif // defined(ENABLE_PEPPER_CDMS)
void AddCefKeySystems(std::vector<KeySystemInfo>* key_systems_info) {
void AddCefKeySystems(
std::vector<std::unique_ptr<KeySystemProperties>>* key_systems_properties) {
#if defined(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE)
AddPepperBasedWidevine(key_systems_info);
AddPepperBasedWidevine(key_systems_properties);
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#endif // defined(ENABLE_PEPPER_CDMS)
}

View File

@ -5,10 +5,16 @@
#ifndef CEF_LIBCEF_RENDERER_MEDIA_CEF_KEY_SYSTEMS_H_
#define CEF_LIBCEF_RENDERER_MEDIA_CEF_KEY_SYSTEMS_H_
#include <memory>
#include <vector>
#include "media/base/key_system_info.h"
namespace media {
class KeySystemProperties;
}
void AddCefKeySystems(std::vector<media::KeySystemInfo>* key_systems_info);
// Register the key systems supported by populating |key_systems_properties|.
void AddCefKeySystems(
std::vector<std::unique_ptr<media::KeySystemProperties>>*
key_systems_properties);
#endif // CEF_LIBCEF_RENDERER_MEDIA_CEF_KEY_SYSTEMS_H_

View File

@ -59,7 +59,8 @@ CefPluginPlaceholder::CefPluginPlaceholder(
status_(CefViewHostMsg_GetPluginInfo_Status::kAllowed),
title_(title),
has_host_(false),
context_menu_request_id_(0) {
context_menu_request_id_(0),
ignore_updates_(false) {
RenderThread::Get()->AddObserver(this);
}
@ -285,6 +286,31 @@ blink::WebPlugin* CefPluginPlaceholder::CreatePlugin() {
GetPluginParams(), std::move(throttler));
}
void CefPluginPlaceholder::OnLoadedRectUpdate(
const gfx::Rect& unobscured_rect,
content::RenderFrame::PeripheralContentStatus status) {
// If the placeholder is in the blocked state, do nothing.
if (ignore_updates_)
return;
// This should only be called once.
set_delayed(false);
// block tiny cross-origin - simply by not continuing the load chain.
if (status ==
content::RenderFrame::CONTENT_STATUS_ESSENTIAL_CROSS_ORIGIN_TINY) {
ignore_updates_ = true;
return;
}
// For essential content, powersaver can be turned off.
if (status != content::RenderFrame::CONTENT_STATUS_PERIPHERAL)
set_power_saver_enabled(false);
AllowLoading();
LoadPlugin();
}
gin::ObjectTemplateBuilder CefPluginPlaceholder::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
gin::ObjectTemplateBuilder builder =

View File

@ -11,13 +11,13 @@
#include "chrome/renderer/plugins/power_saver_info.h"
#include "components/plugins/renderer/loadable_plugin_placeholder.h"
#include "content/public/renderer/context_menu_client.h"
#include "content/public/renderer/render_process_observer.h"
#include "content/public/renderer/render_thread_observer.h"
enum class CefViewHostMsg_GetPluginInfo_Status;
class CefPluginPlaceholder final
: public plugins::LoadablePluginPlaceholder,
public content::RenderProcessObserver,
public content::RenderThreadObserver,
public content::ContextMenuClient,
public gin::Wrappable<CefPluginPlaceholder> {
public:
@ -50,8 +50,11 @@ class CefPluginPlaceholder final
const base::string16& title);
~CefPluginPlaceholder() override;
// content::LoadablePluginPlaceholder method
// content::LoadablePluginPlaceholder overrides:
blink::WebPlugin* CreatePlugin() override;
void OnLoadedRectUpdate(
const gfx::Rect& unobscured_rect,
content::RenderFrame::PeripheralContentStatus status) override;
// gin::Wrappable (via PluginPlaceholder) method
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
@ -64,7 +67,7 @@ class CefPluginPlaceholder final
v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) override;
void ShowContextMenu(const blink::WebMouseEvent&) override;
// content::RenderProcessObserver methods:
// content::RenderThreadObserver methods:
void PluginListChanged() override;
// content::ContextMenuClient methods:
@ -83,6 +86,8 @@ class CefPluginPlaceholder final
int context_menu_request_id_; // Nonzero when request pending.
base::string16 plugin_name_;
bool ignore_updates_;
DISALLOW_COPY_AND_ASSIGN(CefPluginPlaceholder);
};

View File

@ -5,7 +5,6 @@
#include "base/compiler_specific.h"
#include "config.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "platform/ScriptForbiddenScope.h"
MSVC_POP_WARNING();

View File

@ -3,7 +3,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "libcef/renderer/render_process_observer.h"
#include "libcef/renderer/render_thread_observer.h"
#include "libcef/common/cef_messages.h"
#include "libcef/common/net/net_resource_provider.h"
#include "libcef/renderer/content_renderer_client.h"
@ -13,19 +13,19 @@
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
bool CefRenderProcessObserver::is_incognito_process_ = false;
bool CefRenderThreadObserver::is_incognito_process_ = false;
CefRenderProcessObserver::CefRenderProcessObserver() {
CefRenderThreadObserver::CefRenderThreadObserver() {
net::NetModule::SetResourceProvider(NetResourceProvider);
}
CefRenderProcessObserver::~CefRenderProcessObserver() {
CefRenderThreadObserver::~CefRenderThreadObserver() {
}
bool CefRenderProcessObserver::OnControlMessageReceived(
bool CefRenderThreadObserver::OnControlMessageReceived(
const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(CefRenderProcessObserver, message)
IPC_BEGIN_MESSAGE_MAP(CefRenderThreadObserver, message)
IPC_MESSAGE_HANDLER(CefProcessMsg_SetIsIncognitoProcess,
OnSetIsIncognitoProcess)
IPC_MESSAGE_HANDLER(CefProcessMsg_ModifyCrossOriginWhitelistEntry,
@ -37,16 +37,16 @@ bool CefRenderProcessObserver::OnControlMessageReceived(
return handled;
}
void CefRenderProcessObserver::OnRenderProcessShutdown() {
void CefRenderThreadObserver::OnRenderProcessShutdown() {
CefContentRendererClient::Get()->OnRenderProcessShutdown();
}
void CefRenderProcessObserver::OnSetIsIncognitoProcess(
void CefRenderThreadObserver::OnSetIsIncognitoProcess(
bool is_incognito_process) {
is_incognito_process_ = is_incognito_process;
}
void CefRenderProcessObserver::OnModifyCrossOriginWhitelistEntry(
void CefRenderThreadObserver::OnModifyCrossOriginWhitelistEntry(
bool add,
const Cef_CrossOriginWhiteListEntry_Params& params) {
GURL gurl = GURL(params.source_origin);
@ -65,6 +65,6 @@ void CefRenderProcessObserver::OnModifyCrossOriginWhitelistEntry(
}
}
void CefRenderProcessObserver::OnClearCrossOriginWhitelist() {
void CefRenderThreadObserver::OnClearCrossOriginWhitelist() {
blink::WebSecurityPolicy::resetOriginAccessWhitelists();
}

View File

@ -3,23 +3,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_RENDERER_RENDER_PROCESS_OBSERVER_H_
#define CEF_LIBCEF_RENDERER_RENDER_PROCESS_OBSERVER_H_
#ifndef CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_
#define CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_
#include "base/compiler_specific.h"
#include "content/public/renderer/render_process_observer.h"
#include "content/public/renderer/render_thread_observer.h"
struct Cef_CrossOriginWhiteListEntry_Params;
// This class sends and receives control messages on the renderer process.
class CefRenderProcessObserver : public content::RenderProcessObserver {
class CefRenderThreadObserver : public content::RenderThreadObserver {
public:
CefRenderProcessObserver();
~CefRenderProcessObserver() override;
CefRenderThreadObserver();
~CefRenderThreadObserver() override;
static bool is_incognito_process() { return is_incognito_process_; }
// RenderProcessObserver implementation.
// RenderThreadObserver implementation.
bool OnControlMessageReceived(const IPC::Message& message) override;
void OnRenderProcessShutdown() override;
@ -33,7 +33,7 @@ class CefRenderProcessObserver : public content::RenderProcessObserver {
static bool is_incognito_process_;
DISALLOW_COPY_AND_ASSIGN(CefRenderProcessObserver);
DISALLOW_COPY_AND_ASSIGN(CefRenderThreadObserver);
};
#endif // CEF_LIBCEF_RENDERER_RENDER_PROCESS_OBSERVER_H_
#endif // CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_

View File

@ -12,7 +12,6 @@
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "config.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "core/frame/Frame.h"
#include "core/frame/LocalFrame.h"

View File

@ -17,7 +17,6 @@
#include "base/compiler_specific.h"
#include "config.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebDocument.h"

View File

@ -11,7 +11,6 @@
#include "chrome/common/chrome_utility_messages.h"
#include "chrome/utility/utility_message_handler.h"
#include "content/public/common/service_registry.h"
#include "content/public/utility/utility_thread.h"
#include "net/proxy/mojo_proxy_resolver_factory_impl.h"
#if defined(OS_WIN)
@ -20,10 +19,6 @@
namespace {
bool Send(IPC::Message* message) {
return content::UtilityThread::Get()->Send(message);
}
void CreateProxyResolverFactory(
mojo::InterfaceRequest<net::interfaces::ProxyResolverFactory> request) {
// MojoProxyResolverFactoryImpl is strongly bound to the Mojo message pipe it
@ -46,12 +41,7 @@ CefContentUtilityClient::~CefContentUtilityClient() {
bool CefContentUtilityClient::OnMessageReceived(
const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(CefContentUtilityClient, message)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_StartupPing, OnStartupPing)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
bool handled = false;
for (Handlers::iterator it = handlers_.begin();
!handled && it != handlers_.end(); ++it) {
@ -66,8 +56,3 @@ void CefContentUtilityClient::RegisterMojoServices(
registry->AddService<net::interfaces::ProxyResolverFactory>(
base::Bind(CreateProxyResolverFactory));
}
void CefContentUtilityClient::OnStartupPing() {
Send(new ChromeUtilityHostMsg_ProcessStarted);
// Don't release the process, we assume further messages are on the way.
}

View File

@ -20,9 +20,6 @@ class CefContentUtilityClient : public content::ContentUtilityClient {
void RegisterMojoServices(content::ServiceRegistry* registry) override;
private:
// IPC message handlers.
void OnStartupPing();
typedef ScopedVector<UtilityMessageHandler> Handlers;
Handlers handlers_;

View File

@ -12,6 +12,7 @@
#include "include/base/cef_logging.h"
namespace base {
namespace cef_internal {
Lock::Lock() : lock_() {
}
@ -39,6 +40,7 @@ void Lock::CheckUnheldAndMark() {
owning_thread_ref_ = PlatformThread::CurrentRef();
}
} // namespace cef_internal
} // namespace base
#endif // NDEBUG

View File

@ -2,9 +2,6 @@
// 2011 the Chromium Authors. All rights reserved. Use of this source code is
// governed by a BSD-style license that can be found in the LICENSE file.
// Include this first to avoid conflicts with cef_macros.h.
#include "base/macros.h"
#include "include/cef_sandbox_win.h"
#include "sandbox/win/src/process_mitigations.h"

View File

@ -318,7 +318,7 @@ struct CefResourceManager::ProviderEntry {
deletion_pending_(false) {
}
scoped_ptr<Provider> provider_;
SCOPED_PTR(Provider) provider_;
int order_;
std::string identifier_;
@ -378,7 +378,7 @@ void CefResourceManager::Request::Stop() {
base::Passed(&state_)));
}
CefResourceManager::Request::Request(scoped_ptr<RequestState> state)
CefResourceManager::Request::Request(SCOPED_PTR(RequestState) state)
: state_(MOVE_SCOPED_PTR(state)),
params_(state_->params_) {
CEF_REQUIRE_IO_THREAD();
@ -396,13 +396,13 @@ CefResourceManager::Request::Request(scoped_ptr<RequestState> state)
// handle the request. Note that |state_| may already be NULL if OnRequest
// executes a callback before returning, in which case execution will continue
// asynchronously in any case.
scoped_ptr<CefResourceManager::RequestState>
SCOPED_PTR(CefResourceManager::RequestState)
CefResourceManager::Request::SendRequest() {
CEF_REQUIRE_IO_THREAD();
Provider* provider = (*state_->current_entry_pos_)->provider_.get();
if (!provider->OnRequest(this))
return MOVE_SCOPED_PTR(state_);
return scoped_ptr<RequestState>();
return SCOPED_PTR(RequestState)();
}
bool CefResourceManager::Request::HasState() {
@ -412,7 +412,7 @@ bool CefResourceManager::Request::HasState() {
// static
void CefResourceManager::Request::ContinueOnIOThread(
scoped_ptr<RequestState> state,
SCOPED_PTR(RequestState) state,
CefRefPtr<CefResourceHandler> handler) {
CEF_REQUIRE_IO_THREAD();
// The manager may already have been deleted.
@ -423,7 +423,7 @@ void CefResourceManager::Request::ContinueOnIOThread(
// static
void CefResourceManager::Request::StopOnIOThread(
scoped_ptr<RequestState> state) {
SCOPED_PTR(RequestState) state) {
CEF_REQUIRE_IO_THREAD();
// The manager may already have been deleted.
base::WeakPtr<CefResourceManager> manager = state->manager_;
@ -493,7 +493,7 @@ void CefResourceManager::AddProvider(Provider* provider,
return;
}
scoped_ptr<ProviderEntry> new_entry(
SCOPED_PTR(ProviderEntry) new_entry(
new ProviderEntry(provider, order, identifier));
if (providers_.empty()) {
@ -587,7 +587,7 @@ cef_return_value_t CefResourceManager::OnBeforeResourceLoad(
return RV_CONTINUE;
}
scoped_ptr<RequestState> state(new RequestState);
SCOPED_PTR(RequestState) state(new RequestState);
if (!weak_ptr_factory_.get()) {
// WeakPtrFactory instances need to be created and destroyed on the same
@ -637,7 +637,7 @@ CefRefPtr<CefResourceHandler> CefResourceManager::GetResourceHandler(
// Send the request to providers in order until one potentially handles it or we
// run out of providers. Returns true if the request is potentially handled.
bool CefResourceManager::SendRequest(scoped_ptr<RequestState> state) {
bool CefResourceManager::SendRequest(SCOPED_PTR(RequestState) state) {
bool potentially_handled = false;
do {
@ -661,7 +661,7 @@ bool CefResourceManager::SendRequest(scoped_ptr<RequestState> state) {
}
void CefResourceManager::ContinueRequest(
scoped_ptr<RequestState> state,
SCOPED_PTR(RequestState) state,
CefRefPtr<CefResourceHandler> handler) {
CEF_REQUIRE_IO_THREAD();
@ -679,7 +679,7 @@ void CefResourceManager::ContinueRequest(
}
}
void CefResourceManager::StopRequest(scoped_ptr<RequestState> state) {
void CefResourceManager::StopRequest(SCOPED_PTR(RequestState) state) {
CEF_REQUIRE_IO_THREAD();
// Detach from the current provider.

View File

@ -69,7 +69,7 @@ class CefStreamResourceHandler::Buffer {
}
private:
scoped_ptr<char[]> buffer_;
SCOPED_PTR(char[]) buffer_;
int size_;
int bytes_requested_;
int bytes_written_;

View File

@ -57,7 +57,7 @@ class CefZipFile : public CefZipArchive::File {
private:
size_t data_size_;
scoped_ptr<unsigned char[]> data_;
SCOPED_PTR(unsigned char[]) data_;
IMPLEMENT_REFCOUNTING(CefZipFile);
DISALLOW_COPY_AND_ASSIGN(CefZipFile);

View File

@ -162,13 +162,6 @@ patches = [
'name': 'content_pepper_flash_1586',
'path': '../content/browser/renderer_host/pepper/',
},
{
# Support loading of newer system Flash installations on OS X.
# https://bitbucket.org/chromiumembedded/cef/issue/1586
# https://bugs.chromium.org/p/chromium/issues/detail?id=470737
'name': 'chrome_pepper_flash_1586',
'path': '../chrome/common/',
},
{
# Fix placement of IME window on Windows.
# https://bitbucket.org/chromiumembedded/cef/issue/1610
@ -255,10 +248,4 @@ patches = [
'name': 'render_view_host_impl_1392',
'path': '../content/browser/renderer_host/',
},
{
# Fix incorrect initialization of WebCursor object.
# https://bitbucket.org/chromiumembedded/cef/issues/1894
'name': 'webcursor_1894',
'path': '../content/common/cursors/',
},
]

View File

@ -1,8 +1,8 @@
diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc
index 41e31c0..509ebd8 100644
index 54d6c4c..4a5268d 100644
--- render_widget_host_view_guest.cc
+++ render_widget_host_view_guest.cc
@@ -191,6 +191,9 @@ void RenderWidgetHostViewGuest::Destroy() {
@@ -212,6 +212,9 @@ void RenderWidgetHostViewGuest::Destroy() {
}
gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const {

View File

@ -1,5 +1,5 @@
diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc
index ad4474f..d0318065 100644
index 71e2857..73d4e45 100644
--- browser/browser_plugin/browser_plugin_guest.cc
+++ browser/browser_plugin/browser_plugin_guest.cc
@@ -28,7 +28,7 @@
@ -11,7 +11,7 @@ index ad4474f..d0318065 100644
#include "content/common/browser_plugin/browser_plugin_constants.h"
#include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/common/content_constants_internal.h"
@@ -286,20 +286,19 @@ void BrowserPluginGuest::InitInternal(
@@ -287,20 +287,19 @@ void BrowserPluginGuest::InitInternal(
guest_window_rect_ = params.view_rect;
if (owner_web_contents_ != owner_web_contents) {
@ -36,7 +36,7 @@ index ad4474f..d0318065 100644
}
RendererPreferences* renderer_prefs =
@@ -749,11 +748,10 @@ void BrowserPluginGuest::OnWillAttachComplete(
@@ -750,11 +749,10 @@ void BrowserPluginGuest::OnWillAttachComplete(
->GetWidget()
->Init();
GetWebContents()->GetMainFrame()->Init();

View File

@ -1,18 +1,19 @@
diff --git web_contents_impl.cc web_contents_impl.cc
index 61d8bf3..0cee4d7 100644
index 5621f82..3124d00 100644
--- web_contents_impl.cc
+++ web_contents_impl.cc
@@ -1412,32 +1412,40 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -1510,39 +1510,47 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
// frame - let's do the same thing here.
std::string unique_name = params.main_frame_name;
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
- WebContentsViewDelegate* delegate =
- GetContentClient()->browser()->GetWebContentsViewDelegate(this);
+
+ if (params.view && params.delegate_view) {
+ view_.reset(params.view);
+ render_view_host_delegate_view_ = params.delegate_view;
+ }
+
- WebContentsViewDelegate* delegate =
- GetContentClient()->browser()->GetWebContentsViewDelegate(this);
+ if (!view_) {
+ WebContentsViewDelegate* delegate =
+ GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@ -38,31 +39,41 @@ index 61d8bf3..0cee4d7 100644
#endif
- if (!view_) {
- view_.reset(CreateWebContentsView(this, delegate,
- &render_view_host_delegate_view_));
- }
+ if (!view_) {
+ view_.reset(CreateWebContentsView(this, delegate,
+ &render_view_host_delegate_view_));
+ if (browser_plugin_guest_ &&
+ BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ view_.reset(new WebContentsViewChildFrame(
+ this, delegate, &render_view_host_delegate_view_));
+ } else {
+ view_.reset(CreateWebContentsView(this, delegate,
+ &render_view_host_delegate_view_));
+ }
+ }
+
if (browser_plugin_guest_ &&
- BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
- view_.reset(new WebContentsViewChildFrame(
- this, delegate, &render_view_host_delegate_view_));
- } else {
- view_.reset(CreateWebContentsView(this, delegate,
- &render_view_host_delegate_view_));
+ !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
+ std::move(view_),
+ &render_view_host_delegate_view_));
}
}
- if (browser_plugin_guest_ &&
- !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
- view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
- std::move(view_),
- &render_view_host_delegate_view_));
+ if (browser_plugin_guest_ &&
+ !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
+ std::move(view_),
+ &render_view_host_delegate_view_));
+ }
}
+
- }
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
@@ -1867,11 +1875,14 @@ void WebContentsImpl::CreateNewWindow(
@@ -1974,11 +1982,14 @@ void WebContentsImpl::CreateNewWindow(
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
@ -78,7 +89,7 @@ index 61d8bf3..0cee4d7 100644
if (route_id != MSG_ROUTING_NONE &&
!RenderViewHost::FromID(render_process_id, route_id)) {
// If the embedder didn't create a WebContents for this route, we need to
@@ -1895,6 +1906,8 @@ void WebContentsImpl::CreateNewWindow(
@@ -2002,6 +2013,8 @@ void WebContentsImpl::CreateNewWindow(
create_params.opener_render_process_id = render_process_id;
create_params.opener_render_frame_id = params.opener_render_frame_id;
create_params.opener_suppressed = params.opener_suppressed;

View File

@ -1,5 +1,5 @@
diff --git common.gypi common.gypi
index 1aad5054..5bccbed 100644
index 3724f2f..5eb9cde 100644
--- common.gypi
+++ common.gypi
@@ -9,6 +9,9 @@
@ -12,7 +12,7 @@ index 1aad5054..5bccbed 100644
# 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
@@ -96,7 +99,10 @@
@@ -90,7 +93,10 @@
# depending on the packages installed on the local machine. Set this
# to 0 to build against locally installed headers and libraries (e.g.
# if packaging for a linux distro)

View File

@ -1,8 +1,8 @@
diff --git ui/browser.cc ui/browser.cc
index b9d1732..7754dd9 100644
index e551474..222b6ad 100644
--- ui/browser.cc
+++ ui/browser.cc
@@ -1729,7 +1729,9 @@ bool Browser::ShouldCreateWebContents(
@@ -1731,7 +1731,9 @@ bool Browser::ShouldCreateWebContents(
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
@ -14,10 +14,10 @@ index b9d1732..7754dd9 100644
// If a BackgroundContents is created, suppress the normal WebContents.
return !MaybeCreateBackgroundContents(
diff --git ui/browser.h ui/browser.h
index 3cb7401..e41d498 100644
index 2196898..af9df43 100644
--- ui/browser.h
+++ ui/browser.h
@@ -613,7 +613,9 @@ class Browser : public TabStripModelObserver,
@@ -616,7 +616,9 @@ class Browser : public TabStripModelObserver,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,

View File

@ -1,20 +0,0 @@
diff --git pepper_flash.cc pepper_flash.cc
index 3b6cbd9..d4ba7ed 100644
--- pepper_flash.cc
+++ pepper_flash.cc
@@ -121,8 +121,15 @@ bool CheckPepperFlashManifest(const base::DictionaryValue& manifest,
std::string arch;
manifest.GetStringASCII("x-ppapi-arch", &arch);
+#if defined(OS_MACOSX)
+ // On Mac newer versions of the plugin are a universal binary and use "mac"
+ // as the value.
+ if (arch != kPepperFlashArch && arch != kPepperFlashOperatingSystem)
+ return false;
+#else
if (arch != kPepperFlashArch)
return false;
+#endif
*version_out = version;
return true;

View File

@ -1,23 +1,23 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index 9a4ad65..5a6d428 100644
index ea713fd..e4119f6 100644
--- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -130,6 +130,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
scoped_ptr<cc::SoftwareOutputDevice>
@@ -188,6 +188,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
std::unique_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
+ if (compositor->delegate()) {
+ scoped_ptr<cc::SoftwareOutputDevice> output_device =
+ std::unique_ptr<cc::SoftwareOutputDevice> output_device =
+ compositor->delegate()->CreateSoftwareOutputDevice(compositor);
+ if (output_device.get())
+ if (output_device)
+ return output_device;
+ }
+
#if defined(MOJO_RUNNER_CLIENT)
if (IsRunningInMojoShell()) {
return scoped_ptr<cc::SoftwareOutputDevice>(
return std::unique_ptr<cc::SoftwareOutputDevice>(
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index acae0be..90ff7e1 100644
index a6245da..edfdeb5c 100644
--- ui/compositor/compositor.h
+++ ui/compositor/compositor.h
@@ -17,6 +17,7 @@
@ -28,15 +28,15 @@ index acae0be..90ff7e1 100644
#include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
@@ -152,6 +153,17 @@ class COMPOSITOR_EXPORT CompositorBeginFrameObserver {
virtual void OnSendBeginFrame(const cc::BeginFrameArgs& args) = 0;
@@ -156,6 +157,17 @@ class COMPOSITOR_EXPORT CompositorLock
DISALLOW_COPY_AND_ASSIGN(CompositorLock);
};
+class COMPOSITOR_EXPORT CompositorDelegate {
+ public:
+ virtual scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
+ virtual std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
+ ui::Compositor* compositor) {
+ return scoped_ptr<cc::SoftwareOutputDevice>();
+ return nullptr;
+ }
+
+ protected:
@ -46,7 +46,7 @@ index acae0be..90ff7e1 100644
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -172,6 +184,9 @@ class COMPOSITOR_EXPORT Compositor
@@ -176,6 +188,9 @@ class COMPOSITOR_EXPORT Compositor
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
@ -56,7 +56,7 @@ index acae0be..90ff7e1 100644
// Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -346,6 +361,8 @@ class COMPOSITOR_EXPORT Compositor
@@ -345,6 +360,8 @@ class COMPOSITOR_EXPORT Compositor
ui::ContextFactory* context_factory_;

View File

@ -1,5 +1,5 @@
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
index a1389fc..6dcaabb 100644
index 4ad49c8..f1fa7ab 100644
--- public/renderer/content_renderer_client.cc
+++ public/renderer/content_renderer_client.cc
@@ -98,7 +98,6 @@ bool ContentRendererClient::AllowPopup() {
@ -19,7 +19,7 @@ index a1389fc..6dcaabb 100644
return false;
}
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
index 0fab037..848a8f7 100644
index d96adc9..348ae16 100644
--- public/renderer/content_renderer_client.h
+++ public/renderer/content_renderer_client.h
@@ -200,7 +200,6 @@ class CONTENT_EXPORT ContentRendererClient {
@ -39,10 +39,10 @@ index 0fab037..848a8f7 100644
// built in media player for the given |url|. Defaults to false.
virtual bool ShouldUseMediaPlayerForURL(const GURL& url);
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
index af44d57..93a57ff 100644
index 4ff6aaa..4309775 100644
--- renderer/render_frame_impl.cc
+++ renderer/render_frame_impl.cc
@@ -4697,7 +4697,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
@@ -4771,7 +4771,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
(pending_navigation_params_ &&
!pending_navigation_params_->request_params.redirects.empty());
@ -50,7 +50,7 @@ index af44d57..93a57ff 100644
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (GetContentClient()->renderer()->HandleNavigation(
@@ -4706,7 +4705,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
@@ -4780,7 +4779,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
is_redirect)) {
return blink::WebNavigationPolicyIgnore;
}

View File

@ -1,8 +1,8 @@
diff --git browser/guest_view/extension_options/extension_options_guest.cc browser/guest_view/extension_options/extension_options_guest.cc
index 57eb9c2..275632a 100644
index eb8eb4d..836ce55 100644
--- browser/guest_view/extension_options/extension_options_guest.cc
+++ browser/guest_view/extension_options/extension_options_guest.cc
@@ -202,7 +202,9 @@ bool ExtensionOptionsGuest::ShouldCreateWebContents(
@@ -203,7 +203,9 @@ bool ExtensionOptionsGuest::ShouldCreateWebContents(
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
@ -14,7 +14,7 @@ index 57eb9c2..275632a 100644
// view is used for displaying embedded extension options, we want any
// external links to be opened in a new tab, not in a new guest view.
diff --git browser/guest_view/extension_options/extension_options_guest.h browser/guest_view/extension_options/extension_options_guest.h
index b81fe41..41e3e2a 100644
index e0309f7..f6a3878 100644
--- browser/guest_view/extension_options/extension_options_guest.h
+++ browser/guest_view/extension_options/extension_options_guest.h
@@ -56,7 +56,9 @@ class ExtensionOptionsGuest

View File

@ -1,5 +1,5 @@
diff --git resource_ids resource_ids
index b790c72..fca33586 100644
index 5c46a26..b0babb3 100644
--- resource_ids
+++ resource_ids
@@ -14,6 +14,12 @@

View File

@ -1,5 +1,5 @@
diff --git gyp/generator/ninja.py gyp/generator/ninja.py
index edac48d..3bcc3b9 100644
index 9cfc706..932dc86 100644
--- gyp/generator/ninja.py
+++ gyp/generator/ninja.py
@@ -760,7 +760,16 @@ class NinjaWriter(object):

Some files were not shown because too many files have changed in this diff Show More