Update to Chromium revision 6e53600d (#386251)

- Remove |accept_lang| parameter from CefJSDialogHandler::OnJSDialog
  and CefFormatUrlForSecurityDisplay (see https://crbug.com/336973#c36).
- Remove remaining NPAPI-related code including functions from
  cef_web_plugin.h (see https://crbug.com/493212#c55).
- Mac: 10.7+ deployment target is now required for client applications.
- Mac: Remove CefBrowserHost::SetWindowVisibility (issue #1375). No
  replacement is required for windowed rendering. Use WasHidden for
  off-screen rendering.
- Windows: Visual Studio 2015 Update 2 is now required when building
  CEF/Chromium.
This commit is contained in:
Marshall Greenblatt 2016-04-27 16:38:52 -04:00
parent 3c957f9257
commit e7ddc933c9
215 changed files with 869 additions and 1537 deletions

View File

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

View File

@ -978,7 +978,6 @@
'<(DEPTH)/content/content.gyp:content_browser',
'<(DEPTH)/content/content.gyp:content_common',
'<(DEPTH)/content/content.gyp:content_gpu',
'<(DEPTH)/content/content.gyp:content_plugin',
'<(DEPTH)/content/content.gyp:content_ppapi_plugin',
'<(DEPTH)/content/content.gyp:content_renderer',
'<(DEPTH)/content/content.gyp:content_resources',
@ -1518,9 +1517,6 @@
'<(DEPTH)/chrome/browser/printing/pdf_to_emf_converter.cc',
'<(DEPTH)/chrome/browser/printing/pdf_to_emf_converter.h',
'<(DEPTH)/chrome/common/chrome_utility_printing_messages.h',
# Include sources for font cache.
'<(DEPTH)/chrome/utility/font_cache_handler_win.cc',
'<(DEPTH)/chrome/utility/font_cache_handler_win.h',
],
}],
[ 'OS=="mac"', {

View File

@ -321,13 +321,6 @@ typedef struct _cef_browser_host_t {
///
void (CEF_CALLBACK *set_focus)(struct _cef_browser_host_t* self, int focus);
///
// Set whether the window containing the browser is visible
// (minimized/unminimized, app hidden/unhidden, etc). Only used on Mac OS X.
///
void (CEF_CALLBACK *set_window_visibility)(struct _cef_browser_host_t* self,
int visible);
///
// Retrieve the window handle for this browser. If this browser is wrapped in
// a cef_browser_view_t this function should be called on the browser process

View File

@ -76,26 +76,25 @@ typedef struct _cef_jsdialog_handler_t {
cef_base_t base;
///
// Called to run a JavaScript dialog. If |origin_url| and |accept_lang| are
// non-NULL they can be passed to the CefFormatUrlForSecurityDisplay function
// to retrieve a secure and user-friendly display string. The
// |default_prompt_text| value will be specified for prompt dialogs only. Set
// |suppress_message| to true (1) and return false (0) to suppress the message
// (suppressing messages is preferable to immediately executing the callback
// as this is used to detect presumably malicious behavior like spamming alert
// messages in onbeforeunload). Set |suppress_message| to false (0) and return
// false (0) to use the default implementation (the default implementation
// will show one modal dialog at a time and suppress any additional dialog
// requests until the displayed dialog is dismissed). Return true (1) if the
// application will use a custom dialog or if the callback has been executed
// immediately. Custom dialogs may be either modal or modeless. If a custom
// dialog is used the application must execute |callback| once the custom
// dialog is dismissed.
// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
// and user-friendly display string. The |default_prompt_text| value will be
// specified for prompt dialogs only. Set |suppress_message| to true (1) and
// return false (0) to suppress the message (suppressing messages is
// preferable to immediately executing the callback as this is used to detect
// presumably malicious behavior like spamming alert messages in
// onbeforeunload). Set |suppress_message| to false (0) and return false (0)
// to use the default implementation (the default implementation will show one
// modal dialog at a time and suppress any additional dialog requests until
// the displayed dialog is dismissed). Return true (1) if the application will
// use a custom dialog or if the callback has been executed immediately.
// Custom dialogs may be either modal or modeless. If a custom dialog is used
// the application must execute |callback| once the custom dialog is
// dismissed.
///
int (CEF_CALLBACK *on_jsdialog)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* origin_url,
const cef_string_t* accept_lang, cef_jsdialog_type_t dialog_type,
const cef_string_t* message_text,
cef_jsdialog_type_t dialog_type, const cef_string_t* message_text,
const cef_string_t* default_prompt_text,
struct _cef_jsdialog_callback_t* callback, int* suppress_message);

View File

@ -65,14 +65,14 @@ CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
// friendly way to help users make security-related decisions (or in other
// circumstances when people need to distinguish sites, origins, or otherwise-
// simplified URLs from each other). Internationalized domain names (IDN) may be
// presented in Unicode if |languages| accepts the Unicode representation. The
// returned value will (a) omit the path for standard schemes, excepting file
// and filesystem, and (b) omit the port if it is the default for the scheme. Do
// not use this for URLs which will be parsed or sent to other applications.
// presented in Unicode if the conversion is considered safe. The returned value
// will (a) omit the path for standard schemes, excepting file and filesystem,
// and (b) omit the port if it is the default for the scheme. Do not use this
// for URLs which will be parsed or sent to other applications.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t cef_format_url_for_security_display(
const cef_string_t* origin_url, const cef_string_t* languages);
const cef_string_t* origin_url);
///
// Returns the mime type for the specified file extension or an NULL string if

View File

@ -141,27 +141,6 @@ CEF_EXPORT void cef_visit_web_plugin_info(
///
CEF_EXPORT void cef_refresh_web_plugins();
///
// Add a plugin path (directory + file). This change may not take affect until
// after cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_add_web_plugin_path(const cef_string_t* path);
///
// Add a plugin directory. This change may not take affect until after
// cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_add_web_plugin_directory(const cef_string_t* dir);
///
// Remove a plugin path (directory + file). This change may not take affect
// until after cef_refresh_web_plugins() is called. Can be called on any thread
// in the browser process.
///
CEF_EXPORT void cef_remove_web_plugin_path(const cef_string_t* path);
///
// Unregister an internal plugin. This may be undone the next time
// cef_refresh_web_plugins() is called. Can be called on any thread in the
@ -169,12 +148,6 @@ CEF_EXPORT void cef_remove_web_plugin_path(const cef_string_t* path);
///
CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path);
///
// Force a plugin to shutdown. Can be called on any thread in the browser
// process but will be executed on the IO thread.
///
CEF_EXPORT void cef_force_web_plugin_shutdown(const cef_string_t* path);
///
// Register a plugin crash. Can be called on any thread in the browser process
// but will be executed on the IO thread.

View File

@ -353,13 +353,6 @@ class CefBrowserHost : public virtual CefBase {
/*--cef()--*/
virtual void SetFocus(bool focus) =0;
///
// Set whether the window containing the browser is visible
// (minimized/unminimized, app hidden/unhidden, etc). Only used on Mac OS X.
///
/*--cef()--*/
virtual void SetWindowVisibility(bool visible) =0;
///
// Retrieve the window handle for this browser. If this browser is wrapped in
// a CefBrowserView this method should be called on the browser process UI

View File

@ -68,27 +68,25 @@ class CefJSDialogHandler : public virtual CefBase {
typedef cef_jsdialog_type_t JSDialogType;
///
// Called to run a JavaScript dialog. If |origin_url| and |accept_lang| are
// non-empty they can be passed to the CefFormatUrlForSecurityDisplay function
// to retrieve a secure and user-friendly display string. The
// |default_prompt_text| value will be specified for prompt dialogs only. Set
// |suppress_message| to true and return false to suppress the message
// (suppressing messages is preferable to immediately executing the callback
// as this is used to detect presumably malicious behavior like spamming alert
// messages in onbeforeunload). Set |suppress_message| to false and return
// false to use the default implementation (the default implementation will
// show one modal dialog at a time and suppress any additional dialog requests
// until the displayed dialog is dismissed). Return true if the application
// will use a custom dialog or if the callback has been executed immediately.
// Custom dialogs may be either modal or modeless. If a custom dialog is used
// the application must execute |callback| once the custom dialog is
// dismissed.
// Called to run a JavaScript dialog. If |origin_url| is non-empty it can be
// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
// and user-friendly display string. The |default_prompt_text| value will be
// specified for prompt dialogs only. Set |suppress_message| to true and
// return false to suppress the message (suppressing messages is preferable to
// immediately executing the callback as this is used to detect presumably
// malicious behavior like spamming alert messages in onbeforeunload). Set
// |suppress_message| to false and return false to use the default
// implementation (the default implementation will show one modal dialog at a
// time and suppress any additional dialog requests until the displayed dialog
// is dismissed). Return true if the application will use a custom dialog or
// if the callback has been executed immediately. Custom dialogs may be either
// modal or modeless. If a custom dialog is used the application must execute
// |callback| once the custom dialog is dismissed.
///
/*--cef(optional_param=origin_url,optional_param=accept_lang,
optional_param=message_text,optional_param=default_prompt_text)--*/
virtual bool OnJSDialog(CefRefPtr<CefBrowser> browser,
const CefString& origin_url,
const CefString& accept_lang,
JSDialogType dialog_type,
const CefString& message_text,
const CefString& default_prompt_text,

View File

@ -65,14 +65,13 @@ bool CefCreateURL(const CefURLParts& parts,
// friendly way to help users make security-related decisions (or in other
// circumstances when people need to distinguish sites, origins, or otherwise-
// simplified URLs from each other). Internationalized domain names (IDN) may be
// presented in Unicode if |languages| accepts the Unicode representation. The
// returned value will (a) omit the path for standard schemes, excepting file
// and filesystem, and (b) omit the port if it is the default for the scheme. Do
// not use this for URLs which will be parsed or sent to other applications.
// presented in Unicode if the conversion is considered safe. The returned value
// will (a) omit the path for standard schemes, excepting file and filesystem,
// and (b) omit the port if it is the default for the scheme. Do not use this
// for URLs which will be parsed or sent to other applications.
///
/*--cef(optional_param=languages)--*/
CefString CefFormatUrlForSecurityDisplay(const CefString& origin_url,
const CefString& languages);
CefString CefFormatUrlForSecurityDisplay(const CefString& origin_url);
///
// Returns the mime type for the specified file extension or an empty string if

View File

@ -104,30 +104,6 @@ void CefVisitWebPluginInfo(CefRefPtr<CefWebPluginInfoVisitor> visitor);
/*--cef()--*/
void CefRefreshWebPlugins();
///
// Add a plugin path (directory + file). This change may not take affect until
// after CefRefreshWebPlugins() is called. Can be called on any thread in the
// browser process.
///
/*--cef()--*/
void CefAddWebPluginPath(const CefString& path);
///
// Add a plugin directory. This change may not take affect until after
// CefRefreshWebPlugins() is called. Can be called on any thread in the browser
// process.
///
/*--cef()--*/
void CefAddWebPluginDirectory(const CefString& dir);
///
// Remove a plugin path (directory + file). This change may not take affect
// until after CefRefreshWebPlugins() is called. Can be called on any thread in
// the browser process.
///
/*--cef()--*/
void CefRemoveWebPluginPath(const CefString& path);
///
// Unregister an internal plugin. This may be undone the next time
// CefRefreshWebPlugins() is called. Can be called on any thread in the browser
@ -136,13 +112,6 @@ void CefRemoveWebPluginPath(const CefString& path);
/*--cef()--*/
void CefUnregisterInternalWebPlugin(const CefString& path);
///
// Force a plugin to shutdown. Can be called on any thread in the browser
// process but will be executed on the IO thread.
///
/*--cef()--*/
void CefForceWebPluginShutdown(const CefString& path);
///
// Register a plugin crash. Can be called on any thread in the browser process
// but will be executed on the IO thread.

View File

@ -41,6 +41,7 @@
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h"
#include "include/base/cef_scoped_ptr.h"
#include "include/base/cef_weak_ptr.h"
#include "include/cef_request_handler.h"
#include "include/wrapper/cef_closure_task.h"

View File

@ -14,6 +14,8 @@
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "extensions/browser/extension_protocols.h"
#include "extensions/common/constants.h"
#ifndef NDEBUG
base::AtomicRefCount CefBrowserContext::DebugObjCt = 0;
@ -65,6 +67,21 @@ void CefBrowserContext::Initialize() {
extension_system_->Init();
}
void CefBrowserContext::CreateProtocolHandlers(
content::ProtocolHandlerMap* protocol_handlers) {
if (extensions::ExtensionsEnabled()) {
// Handle only chrome-extension:// requests. CEF does not support
// chrome-extension-resource:// requests (it does not store shared extension
// data in its installation directory).
extensions::InfoMap* extension_info_map =
extension_system()->info_map();
(*protocol_handlers)[extensions::kExtensionScheme] =
linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
extensions::CreateExtensionProtocolHandler(
IsOffTheRecord(), extension_info_map).release());
}
}
void CefBrowserContext::Shutdown() {
CEF_REQUIRE_UIT();

View File

@ -139,16 +139,6 @@ class CefBrowserContext
// thread.
virtual CefRefPtr<CefRequestContextHandler> GetHandler() const = 0;
// Called from CefContentBrowserClient to create the URLRequestContextGetter.
virtual net::URLRequestContextGetter* CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) = 0;
virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory,
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) = 0;
// Settings for plugins and extensions.
virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0;
@ -171,6 +161,8 @@ class CefBrowserContext
protected:
~CefBrowserContext() override;
void CreateProtocolHandlers(content::ProtocolHandlerMap* protocol_handlers);
// Must be called before the child object destructor has completed.
void Shutdown();
@ -180,7 +172,7 @@ class CefBrowserContext
content::BrowserThread::UI>;
friend class base::DeleteHelper<CefBrowserContext>;
scoped_ptr<CefResourceContext> resource_context_;
std::unique_ptr<CefResourceContext> resource_context_;
// Owned by the KeyedService system.
extensions::CefExtensionSystem* extension_system_;

View File

@ -146,7 +146,7 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener {
void CreateListenerForContext(const CefBrowserContext* context) {
CEF_REQUIRE_UIT();
scoped_ptr<visitedlink::VisitedLinkEventListener> listener(
std::unique_ptr<visitedlink::VisitedLinkEventListener> listener(
new visitedlink::VisitedLinkEventListener(
master_, const_cast<CefBrowserContext*>(context)));
listener_map_.insert(std::make_pair(context, std::move(listener)));
@ -187,7 +187,7 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener {
// Map of CefBrowserContext to the associated VisitedLinkEventListener.
typedef std::map<const CefBrowserContext*,
scoped_ptr<visitedlink::VisitedLinkEventListener> >
std::unique_ptr<visitedlink::VisitedLinkEventListener> >
ListenerMap;
ListenerMap listener_map_;
@ -333,11 +333,11 @@ base::FilePath CefBrowserContextImpl::GetPath() const {
return cache_path_;
}
scoped_ptr<content::ZoomLevelDelegate>
std::unique_ptr<content::ZoomLevelDelegate>
CefBrowserContextImpl::CreateZoomLevelDelegate(
const base::FilePath& partition_path) {
if (cache_path_.empty())
return scoped_ptr<content::ZoomLevelDelegate>();
return std::unique_ptr<content::ZoomLevelDelegate>();
return make_scoped_ptr(new ChromeZoomLevelPrefs(
GetPrefs(), cache_path_, partition_path,
@ -362,12 +362,6 @@ net::URLRequestContextGetter* CefBrowserContextImpl::GetRequestContext() {
return GetDefaultStoragePartition(this)->GetURLRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextImpl::GetRequestContextForRenderProcess(
int renderer_child_id) {
return GetRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextImpl::GetMediaRequestContext() {
return GetRequestContext();
@ -442,10 +436,12 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
DCHECK(!url_request_getter_.get());
// Initialize the proxy configuration service.
scoped_ptr<net::ProxyConfigService> proxy_config_service(
std::unique_ptr<net::ProxyConfigService> proxy_config_service(
ProxyServiceFactory::CreateProxyConfigService(
pref_proxy_config_tracker_.get()));
CreateProtocolHandlers(protocol_handlers);
url_request_getter_ = new CefURLRequestContextGetterImpl(
settings_,
GetPrefs(),

View File

@ -12,7 +12,6 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "components/proxy_config/pref_proxy_config_tracker.h"
#include "components/visitedlink/browser/visitedlink_delegate.h"
@ -56,13 +55,11 @@ class CefBrowserContextImpl : public CefBrowserContext,
// BrowserContext methods.
base::FilePath GetPath() const override;
scoped_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override;
bool IsOffTheRecord() const override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
net::URLRequestContextGetter* GetRequestContext() override;
net::URLRequestContextGetter* GetRequestContextForRenderProcess(
int renderer_child_id) override;
net::URLRequestContextGetter* GetMediaRequestContext() override;
net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
int renderer_child_id) override;
@ -121,15 +118,15 @@ class CefBrowserContextImpl : public CefBrowserContext,
typedef std::vector<const CefBrowserContextProxy*> ProxyList;
ProxyList proxy_list_;
scoped_ptr<PrefService> pref_service_;
scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
std::unique_ptr<PrefService> pref_service_;
std::unique_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
scoped_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
std::unique_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
scoped_refptr<CefURLRequestContextGetterImpl> url_request_getter_;
scoped_ptr<content::PermissionManager> permission_manager_;
scoped_ptr<CefSSLHostStateDelegate> ssl_host_state_delegate_;
std::unique_ptr<content::PermissionManager> permission_manager_;
std::unique_ptr<CefSSLHostStateDelegate> ssl_host_state_delegate_;
scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_;
std::unique_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_;
// |visitedlink_listener_| is owned by visitedlink_master_.
CefVisitedLinkListener* visitedlink_listener_;

View File

@ -82,7 +82,7 @@ base::FilePath CefBrowserContextProxy::GetPath() const {
return parent_->GetPath();
}
scoped_ptr<content::ZoomLevelDelegate>
std::unique_ptr<content::ZoomLevelDelegate>
CefBrowserContextProxy::CreateZoomLevelDelegate(
const base::FilePath& partition_path) {
return parent_->CreateZoomLevelDelegate(partition_path);
@ -106,12 +106,6 @@ net::URLRequestContextGetter* CefBrowserContextProxy::GetRequestContext() {
return GetDefaultStoragePartition(this)->GetURLRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextProxy::GetRequestContextForRenderProcess(
int renderer_child_id) {
return GetRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContextProxy::GetMediaRequestContext() {
return GetRequestContext();
@ -179,6 +173,9 @@ net::URLRequestContextGetter* CefBrowserContextProxy::CreateRequestContext(
content::URLRequestInterceptorScopedVector request_interceptors) {
CEF_REQUIRE_UIT();
DCHECK(!url_request_getter_.get());
CreateProtocolHandlers(protocol_handlers);
url_request_getter_ =
new CefURLRequestContextGetterProxy(handler_, parent_->request_context());
resource_context()->set_url_request_context_getter(url_request_getter_.get());

View File

@ -11,7 +11,6 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
class CefDownloadManagerDelegate;
class CefURLRequestContextGetterProxy;
@ -31,13 +30,11 @@ class CefBrowserContextProxy : public CefBrowserContext {
// BrowserContext methods.
base::FilePath GetPath() const override;
scoped_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override;
bool IsOffTheRecord() const override;
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
net::URLRequestContextGetter* GetRequestContext() override;
net::URLRequestContextGetter* GetRequestContextForRenderProcess(
int renderer_child_id) override;
net::URLRequestContextGetter* GetMediaRequestContext() override;
net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
int renderer_child_id) override;
@ -88,7 +85,7 @@ class CefBrowserContextProxy : public CefBrowserContext {
CefRefPtr<CefRequestContextHandler> handler_;
scoped_refptr<CefBrowserContextImpl> parent_;
scoped_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
std::unique_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
scoped_refptr<CefURLRequestContextGetterProxy> url_request_getter_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserContextProxy);

View File

@ -42,7 +42,7 @@
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/common/view_messages.h"
#include "content/public/browser/download_manager.h"
@ -265,7 +265,7 @@ CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync(
// static
CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::Create(
CreateParams& create_params) {
scoped_ptr<CefBrowserPlatformDelegate> platform_delegate =
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate =
CefBrowserPlatformDelegate::Create(create_params);
CHECK(platform_delegate);
@ -331,7 +331,7 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::CreateInternal(
CefRefPtr<CefBrowserHostImpl> opener,
bool is_devtools_popup,
CefRefPtr<CefRequestContext> request_context,
scoped_ptr<CefBrowserPlatformDelegate> platform_delegate) {
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate) {
CEF_REQUIRE_UIT();
DCHECK(web_contents);
DCHECK(browser_info);
@ -600,22 +600,6 @@ void CefBrowserHostImpl::SetFocus(bool focus) {
platform_delegate_->SendFocusEvent(false);
}
void CefBrowserHostImpl::SetWindowVisibility(bool visible) {
#if defined(OS_MACOSX)
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::SetWindowVisibility,
this, visible));
return;
}
if (!web_contents())
return;
platform_delegate_->SetWindowVisibility(false);
#endif
}
CefWindowHandle CefBrowserHostImpl::GetWindowHandle() {
if (IsViewsHosted() && CEF_CURRENTLY_ON_UIT()) {
// Always return the most up-to-date window handle for a views-hosted
@ -710,7 +694,7 @@ void CefBrowserHostImpl::StartDownload(const CefString& url) {
if (!manager)
return;
scoped_ptr<content::DownloadUrlParameters> params(
std::unique_ptr<content::DownloadUrlParameters> params(
content::DownloadUrlParameters::FromWebContents(web_contents(), gurl));
manager->DownloadUrl(std::move(params));
}
@ -1206,7 +1190,7 @@ void CefBrowserHostImpl::ReloadIgnoreCache() {
}
if (web_contents_.get())
web_contents_->GetController().ReloadIgnoringCache(true);
web_contents_->GetController().ReloadBypassingCache(true);
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::ReloadIgnoreCache, this));
@ -2201,7 +2185,7 @@ void CefBrowserHostImpl::WebContentsCreated(
content::WebContents* new_contents) {
CefBrowserSettings settings;
CefRefPtr<CefClient> client;
scoped_ptr<CefBrowserPlatformDelegate> platform_delegate;
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate;
CefBrowserInfoManager::GetInstance()->WebContentsCreated(
source_contents, target_url, new_contents, settings, client,
@ -2285,7 +2269,7 @@ void CefBrowserHostImpl::RequestMediaAccessPermission(
if (!command_line->HasSwitch(switches::kEnableMediaStream)) {
// Cancel the request.
callback.Run(devices, content::MEDIA_DEVICE_PERMISSION_DENIED,
scoped_ptr<content::MediaStreamUI>());
std::unique_ptr<content::MediaStreamUI>());
return;
}
@ -2318,7 +2302,7 @@ void CefBrowserHostImpl::RequestMediaAccessPermission(
}
callback.Run(devices, content::MEDIA_DEVICE_OK,
scoped_ptr<content::MediaStreamUI>());
std::unique_ptr<content::MediaStreamUI>());
}
bool CefBrowserHostImpl::CheckMediaAccessPermission(
@ -2357,10 +2341,9 @@ void CefBrowserHostImpl::RenderViewCreated(
// The swapped out state of a RVH is determined by its main frame since
// subframes should have their own widgets. We should never recieve creation
// notifications for a RVH where the main frame is swapped out.
content::RenderFrameHostImpl* frame_host_impl =
static_cast<content::RenderFrameHostImpl*>(
render_view_host->GetMainFrame());
DCHECK(frame_host_impl && !frame_host_impl->is_swapped_out());
content::RenderViewHostImpl* render_view_host_impl =
static_cast<content::RenderViewHostImpl*>(render_view_host);
DCHECK(!render_view_host_impl->is_swapped_out());
const int render_process_id = render_view_host->GetProcess()->GetID();
const int render_routing_id = render_view_host->GetRoutingID();
@ -2384,10 +2367,9 @@ void CefBrowserHostImpl::RenderViewDeleted(
// subframes should have their own widgets. Ignore deletion notification for
// a RVH where the main frame host is swapped out. We probably shouldn't be
// getting these notifications to begin with.
content::RenderFrameHostImpl* frame_host_impl =
static_cast<content::RenderFrameHostImpl*>(
render_view_host->GetMainFrame());
if (!frame_host_impl || frame_host_impl->is_swapped_out())
content::RenderViewHostImpl* render_view_host_impl =
static_cast<content::RenderViewHostImpl*>(render_view_host);
if (render_view_host_impl->is_swapped_out())
return;
const int render_process_id = render_view_host->GetProcess()->GetID();
@ -2739,7 +2721,7 @@ CefBrowserHostImpl::CefBrowserHostImpl(
scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<CefBrowserHostImpl> opener,
CefRefPtr<CefRequestContext> request_context,
scoped_ptr<CefBrowserPlatformDelegate> platform_delegate)
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate)
: content::WebContentsObserver(web_contents),
settings_(settings),
client_(client),

View File

@ -23,7 +23,6 @@
#include "libcef/browser/menu_manager.h"
#include "libcef/common/response_manager.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
#include "base/synchronization/lock.h"
@ -96,7 +95,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
struct CreateParams {
// Platform-specific window creation info. Will be nullptr when creating a
// views-hosted browser.
scoped_ptr<CefWindowInfo> window_info;
std::unique_ptr<CefWindowInfo> window_info;
#if defined(USE_AURA)
// The BrowserView that will own a views-hosted browser. Will be nullptr for
@ -149,7 +148,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
void CloseBrowser(bool force_close) override;
bool TryCloseBrowser() override;
void SetFocus(bool focus) override;
void SetWindowVisibility(bool visible) override;
CefWindowHandle GetWindowHandle() override;
CefWindowHandle GetOpenerWindowHandle() override;
bool HasView() override;
@ -495,7 +493,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
CefRefPtr<CefBrowserHostImpl> opener,
bool is_devtools_popup,
CefRefPtr<CefRequestContext> request_context,
scoped_ptr<CefBrowserPlatformDelegate> platform_delegate);
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate);
// content::WebContentsObserver::OnMessageReceived() message handlers.
void OnFrameIdentified(int64 frame_id,
@ -523,7 +521,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<CefBrowserHostImpl> opener,
CefRefPtr<CefRequestContext> request_context,
scoped_ptr<CefBrowserPlatformDelegate> platform_delegate);
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate);
// Give the platform delegate an opportunity to create the host window.
bool CreateHostWindow();
@ -560,11 +558,11 @@ class CefBrowserHostImpl : public CefBrowserHost,
CefBrowserSettings settings_;
CefRefPtr<CefClient> client_;
scoped_ptr<content::WebContents> web_contents_;
std::unique_ptr<content::WebContents> web_contents_;
scoped_refptr<CefBrowserInfo> browser_info_;
CefWindowHandle opener_;
CefRefPtr<CefRequestContext> request_context_;
scoped_ptr<CefBrowserPlatformDelegate> platform_delegate_;
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate_;
const bool is_windowless_;
const bool is_views_hosted_;
CefWindowHandle host_window_handle_;
@ -617,23 +615,23 @@ class CefBrowserHostImpl : public CefBrowserHost,
bool mouse_cursor_change_disabled_;
// Used for managing notification subscriptions.
scoped_ptr<content::NotificationRegistrar> registrar_;
std::unique_ptr<content::NotificationRegistrar> registrar_;
// Manages response registrations.
scoped_ptr<CefResponseManager> response_manager_;
std::unique_ptr<CefResponseManager> response_manager_;
// Used for creating and managing file dialogs.
scoped_ptr<CefFileDialogManager> file_dialog_manager_;
std::unique_ptr<CefFileDialogManager> file_dialog_manager_;
// Used for creating and managing JavaScript dialogs.
scoped_ptr<CefJavaScriptDialogManager> javascript_dialog_manager_;
std::unique_ptr<CefJavaScriptDialogManager> javascript_dialog_manager_;
// Used for creating and managing context menus.
scoped_ptr<CefMenuManager> menu_manager_;
std::unique_ptr<CefMenuManager> menu_manager_;
// Track the lifespan of the frontend WebContents associated with this
// browser.
scoped_ptr<DevToolsWebContentsObserver> devtools_observer_;
std::unique_ptr<DevToolsWebContentsObserver> devtools_observer_;
// CefDevToolsFrontend will delete itself when the frontend WebContents is
// destroyed.
CefDevToolsFrontend* devtools_frontend_;

View File

@ -142,7 +142,7 @@ void CefBrowserInfoManager::OnCreateWindow(
DCHECK_GT(params.opener_id, 0);
DCHECK_GT(params.opener_render_frame_id, 0);
scoped_ptr<CefBrowserInfoManager::PendingPopup> pending_popup(
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup(
new CefBrowserInfoManager::PendingPopup);
pending_popup->step = CefBrowserInfoManager::PendingPopup::ON_CREATE_WINDOW;
pending_popup->opener_process_id = host->GetID();
@ -164,7 +164,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
int opener_render_view_id,
int opener_render_frame_id,
bool* no_javascript_access) {
scoped_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
PopPendingPopup(CefBrowserInfoManager::PendingPopup::ON_CREATE_WINDOW,
render_process_id, opener_render_view_id, target_url);
DCHECK(pending_popup.get());
@ -202,7 +202,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
CefRefPtr<CefClient> client = browser->GetClient();
bool allow = true;
scoped_ptr<CefWindowInfo> window_info(new CefWindowInfo);
std::unique_ptr<CefWindowInfo> window_info(new CefWindowInfo);
#if defined(OS_WIN)
window_info->SetAsPopup(NULL, CefString());
@ -277,7 +277,7 @@ void CefBrowserInfoManager::ShouldCreateWebContents(
const GURL& target_url,
content::WebContentsView** view,
content::RenderViewHostDelegateView** delegate_view) {
scoped_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
PopPendingPopup(CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW,
web_contents->GetRenderViewHost()->GetProcess()->GetID(),
web_contents->GetRenderViewHost()->GetRoutingID(),
@ -301,11 +301,11 @@ void CefBrowserInfoManager::WebContentsCreated(
content::WebContents* new_contents,
CefBrowserSettings& settings,
CefRefPtr<CefClient>& client,
scoped_ptr<CefBrowserPlatformDelegate>& platform_delegate) {
std::unique_ptr<CefBrowserPlatformDelegate>& platform_delegate) {
DCHECK(source_contents);
DCHECK(new_contents);
scoped_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
PopPendingPopup(
CefBrowserInfoManager::PendingPopup::SHOULD_CREATE_WEB_CONTENTS,
source_contents->GetRenderViewHost()->GetProcess()->GetID(),
@ -363,7 +363,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
#endif
// Queue the request.
scoped_ptr<PendingNewBrowserInfo> pending(new PendingNewBrowserInfo());
std::unique_ptr<PendingNewBrowserInfo> pending(new PendingNewBrowserInfo());
pending->host = host;
pending->render_view_routing_id = render_view_routing_id;
pending->render_frame_routing_id = render_frame_routing_id;
@ -452,7 +452,7 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
void CefBrowserInfoManager::FilterPendingPopupURL(
int render_process_id,
scoped_ptr<CefBrowserInfoManager::PendingPopup> pending_popup) {
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup) {
content::RenderProcessHost* rph =
content::RenderProcessHost::FromID(render_process_id);
DCHECK(rph);
@ -461,12 +461,12 @@ void CefBrowserInfoManager::FilterPendingPopupURL(
GetInstance()->PushPendingPopup(std::move(pending_popup));
}
void CefBrowserInfoManager::PushPendingPopup(scoped_ptr<PendingPopup> popup) {
void CefBrowserInfoManager::PushPendingPopup(std::unique_ptr<PendingPopup> popup) {
base::AutoLock lock_scope(pending_popup_lock_);
pending_popup_list_.push_back(std::move(popup));
}
scoped_ptr<CefBrowserInfoManager::PendingPopup>
std::unique_ptr<CefBrowserInfoManager::PendingPopup>
CefBrowserInfoManager::PopPendingPopup(
PendingPopup::Step step,
int opener_process_id,

View File

@ -93,7 +93,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
content::WebContents* new_contents,
CefBrowserSettings& settings,
CefRefPtr<CefClient>& client,
scoped_ptr<CefBrowserPlatformDelegate>& platform_delegate);
std::unique_ptr<CefBrowserPlatformDelegate>& platform_delegate);
// Called from CefBrowserMessageFilter::OnGetNewBrowserInfo for delivering
// browser info to the renderer process. If the browser info already exists
@ -172,7 +172,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
CefRefPtr<CefClient> client;
// Platform delegate specific to the new popup.
scoped_ptr<CefBrowserPlatformDelegate> platform_delegate;
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate;
};
// Between the calls to CanCreateWindow and ShouldCreateWebContents
@ -182,11 +182,11 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// otherwise ShouldCreateWebContents will fail to retrieve the PopupInfo.
static void FilterPendingPopupURL(
int render_process_id,
scoped_ptr<PendingPopup> pending_popup);
std::unique_ptr<PendingPopup> pending_popup);
// Manage pending popups.
void PushPendingPopup(scoped_ptr<PendingPopup> popup);
scoped_ptr<PendingPopup> PopPendingPopup(
void PushPendingPopup(std::unique_ptr<PendingPopup> popup);
std::unique_ptr<PendingPopup> PopPendingPopup(
PendingPopup::Step step,
int opener_process_id,
int opener_view_id,

View File

@ -164,10 +164,6 @@ void CefBrowserMainParts::PreMainMessageLoopRun() {
// Triggers initialization of the singleton instance on UI thread.
PluginFinder::GetInstance()->Init();
#if defined(OS_WIN)
PlatformPreMainMessageLoopRun();
#endif
}
void CefBrowserMainParts::PostMainMessageLoopRun() {

View File

@ -10,7 +10,6 @@
#include "libcef/browser/net/url_request_context_getter_impl.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/strings/string_piece.h"
#include "build/build_config.h"
@ -58,15 +57,14 @@ class CefBrowserMainParts : public content::BrowserMainParts {
private:
#if defined(OS_WIN)
void PlatformInitialize();
void PlatformPreMainMessageLoopRun();
#endif // defined(OS_WIN)
scoped_refptr<CefBrowserContextImpl> global_browser_context_;
CefDevToolsDelegate* devtools_delegate_; // Deletes itself.
scoped_ptr<base::MessageLoop> message_loop_;
std::unique_ptr<base::MessageLoop> message_loop_;
scoped_ptr<extensions::ExtensionsClient> extensions_client_;
scoped_ptr<extensions::ExtensionsBrowserClient> extensions_browser_client_;
std::unique_ptr<extensions::ExtensionsClient> extensions_client_;
std::unique_ptr<extensions::ExtensionsBrowserClient> extensions_browser_client_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserMainParts);
};

View File

@ -11,25 +11,10 @@
#include "chrome/common/chrome_utility_messages.h"
#include "content/public/browser/utility_process_host.h"
#include "content/public/browser/utility_process_host_client.h"
#include "content/public/common/dwrite_font_platform_win.h"
#include "grit/cef_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/win/direct_write.h"
namespace {
void ExecuteFontCacheBuildTask(const base::FilePath& path) {
base::WeakPtr<content::UtilityProcessHost> utility_process_host(
content::UtilityProcessHost::Create(NULL, NULL)->AsWeakPtr());
utility_process_host->SetName(l10n_util::GetStringUTF16(
IDS_UTILITY_PROCESS_FONT_CACHE_BUILDER_NAME));
utility_process_host->DisableSandbox();
utility_process_host->Send(
new ChromeUtilityHostMsg_BuildDirectWriteFontCache(path));
}
} // namespace
void CefBrowserMainParts::PlatformInitialize() {
HRESULT res;
@ -45,39 +30,3 @@ void CefBrowserMainParts::PlatformInitialize() {
res = OleInitialize(NULL);
DCHECK(SUCCEEDED(res));
}
void CefBrowserMainParts::PlatformPreMainMessageLoopRun() {
// From ChromeBrowserMainPartsWin::PostProfileInit().
// DirectWrite support is mainly available on Windows 7 and up.
if (gfx::win::ShouldUseDirectWrite()) {
const base::FilePath& cache_path = global_browser_context_->GetPath();
if (cache_path.empty())
return;
const base::FilePath& font_cache_path =
cache_path.AppendASCII(content::kFontCacheSharedSectionName);
// This function will create a read only section if cache file exists
// otherwise it will spawn utility process to build cache file, which will
// be used during next browser start/postprofileinit.
if (!content::LoadFontCache(font_cache_path)) {
// We delay building of font cache until first startup page loads.
// During first renderer start there are lot of things happening
// simultaneously some of them are:
// - Renderer is going through all font files on the system to create
// a font collection.
// - Renderer loading up startup URL, accessing HTML/JS File cache,
// net activity etc.
// - Extension initialization.
// We delay building of cache mainly to avoid parallel font file
// loading along with Renderer. Some systems have significant number of
// font files which takes long time to process.
// Related information is at http://crbug.com/436195.
const int kBuildFontCacheDelaySec = 30;
content::BrowserThread::PostDelayedTask(
content::BrowserThread::IO,
FROM_HERE,
base::Bind(ExecuteFontCacheBuildTask, font_cache_path),
base::TimeDelta::FromSeconds(kBuildFontCacheDelaySec));
}
}
}

View File

@ -108,21 +108,12 @@ void CefBrowserPlatformDelegate::SizeTo(int width, int height) {
}
#endif
#if defined(OS_MACOSX)
void CefBrowserPlatformDelegate::SetWindowVisibility(bool visible) {
content::RenderWidgetHostView* view =
browser_->web_contents()->GetRenderWidgetHostView();
if (view)
view->SetWindowVisibility(visible);
}
#endif
scoped_ptr<CefFileDialogRunner>
std::unique_ptr<CefFileDialogRunner>
CefBrowserPlatformDelegate::CreateFileDialogRunner() {
return nullptr;
}
scoped_ptr<CefJavaScriptDialogRunner>
std::unique_ptr<CefJavaScriptDialogRunner>
CefBrowserPlatformDelegate::CreateJavaScriptDialogRunner() {
return nullptr;
}

View File

@ -49,7 +49,7 @@ class CefBrowserPlatformDelegate {
public:
// Create a new CefBrowserPlatformDelegate instance. May be called on multiple
// threads.
static scoped_ptr<CefBrowserPlatformDelegate> Create(
static std::unique_ptr<CefBrowserPlatformDelegate> Create(
CefBrowserHostImpl::CreateParams& create_params);
// Called to create the view objects for a new WebContents. Will only be
@ -159,11 +159,6 @@ class CefBrowserPlatformDelegate {
virtual void SizeTo(int width, int height);
#endif
#if defined(OS_MACOSX)
// Set or remove host window visibility. Only used on OS X.
virtual void SetWindowVisibility(bool visible);
#endif
// Convert from view coordinates to screen coordinates. Potential display
// scaling will be applied to the result.
virtual gfx::Point GetScreenPoint(const gfx::Point& view) const = 0;
@ -198,13 +193,13 @@ class CefBrowserPlatformDelegate {
const content::NativeWebKeyboardEvent& event) const = 0;
// Create the platform-specific file dialog runner.
virtual scoped_ptr<CefFileDialogRunner> CreateFileDialogRunner();
virtual std::unique_ptr<CefFileDialogRunner> CreateFileDialogRunner();
// Create the platform-specific JavaScript dialog runner.
virtual scoped_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner();
virtual std::unique_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner();
// Create the platform-specific menu runner.
virtual scoped_ptr<CefMenuRunner> CreateMenuRunner() = 0;
virtual std::unique_ptr<CefMenuRunner> CreateMenuRunner() = 0;
// Returns true if this delegate implements windowless rendering. May be
// called on multiple threads.

View File

@ -27,7 +27,7 @@
namespace {
scoped_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
const CefWindowInfo& window_info) {
#if defined(OS_WIN)
return make_scoped_ptr(new CefBrowserPlatformDelegateNativeWin(window_info));
@ -39,8 +39,8 @@ scoped_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
#endif
}
scoped_ptr<CefBrowserPlatformDelegateOsr> CreateOSRDelegate(
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate) {
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)));
@ -56,10 +56,10 @@ scoped_ptr<CefBrowserPlatformDelegateOsr> CreateOSRDelegate(
} // namespace
// static
scoped_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
CefBrowserHostImpl::CreateParams& create_params) {
if (create_params.window_info) {
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate =
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
CreateNativeDelegate(*create_params.window_info.get());
if (create_params.window_info->windowless_rendering_enabled &&
create_params.client &&
@ -71,7 +71,7 @@ scoped_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
#if defined(USE_AURA)
else {
// CefWindowInfo is not used in this case.
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate =
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
CreateNativeDelegate(CefWindowInfo());
return make_scoped_ptr(new CefBrowserPlatformDelegateViews(
std::move(native_delegate),

View File

@ -222,7 +222,7 @@ class CefBrowserURLRequest::Context
CefURLRequestUserData::kUserDataKey,
base::Bind(&CreateURLRequestUserData, client_));
scoped_ptr<net::URLFetcherResponseWriter> response_writer;
std::unique_ptr<net::URLFetcherResponseWriter> response_writer;
if (request_flags & UR_FLAG_NO_DOWNLOAD_DATA) {
response_writer.reset(new CefURLFetcherResponseWriter(NULL, NULL));
} else {
@ -301,7 +301,7 @@ class CefBrowserURLRequest::Context
client_->OnDownloadProgress(url_request_.get(), current, total);
}
void OnDownloadData(scoped_ptr<std::string> download_data) {
void OnDownloadData(std::unique_ptr<std::string> download_data) {
DCHECK(CalledOnValidThread());
DCHECK(url_request_.get());
@ -367,8 +367,8 @@ class CefBrowserURLRequest::Context
CefRefPtr<CefURLRequestClient> client_;
CefRefPtr<CefRequestContext> request_context_;
scoped_refptr<base::SequencedTaskRunner> task_runner_;
scoped_ptr<net::URLFetcher> fetcher_;
scoped_ptr<CefURLFetcherDelegate> fetcher_delegate_;
std::unique_ptr<net::URLFetcher> fetcher_;
std::unique_ptr<CefURLFetcherDelegate> fetcher_delegate_;
CefURLRequest::Status status_;
CefURLRequest::ErrorCode error_code_;
CefRefPtr<CefResponse> response_;

View File

@ -6,7 +6,6 @@
#include "libcef/browser/chrome_browser_process_stub.h"
#include "libcef/browser/context.h"
#include "base/memory/scoped_ptr.h"
#include "ui/message_center/message_center.h"
ChromeBrowserProcessStub::ChromeBrowserProcessStub()
@ -136,16 +135,6 @@ void ChromeBrowserProcessStub::CreateDevToolsAutoOpener() {
NOTIMPLEMENTED();
}
unsigned int ChromeBrowserProcessStub::AddRefModule() {
NOTIMPLEMENTED();
return 0;
}
unsigned int ChromeBrowserProcessStub::ReleaseModule() {
NOTIMPLEMENTED();
return 0;
}
bool ChromeBrowserProcessStub::IsShuttingDown() {
NOTIMPLEMENTED();
return false;
@ -198,7 +187,7 @@ BackgroundModeManager* ChromeBrowserProcessStub::background_mode_manager() {
}
void ChromeBrowserProcessStub::set_background_mode_manager_for_test(
scoped_ptr<BackgroundModeManager> manager) {
std::unique_ptr<BackgroundModeManager> manager) {
NOTIMPLEMENTED();
}

View File

@ -10,7 +10,6 @@
#include "chrome/browser/browser_process.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
// This file provides a stub implementation of Chrome's BrowserProcess object
// for use as an interop layer between CEF and files that live in chrome/.
@ -55,8 +54,6 @@ class ChromeBrowserProcessStub : public BrowserProcess {
void CreateDevToolsHttpProtocolHandler(const std::string& ip,
uint16_t port) override;
void CreateDevToolsAutoOpener() override;
unsigned int AddRefModule() override;
unsigned int ReleaseModule() override;
bool IsShuttingDown() override;
printing::PrintJobManager* print_job_manager() override;
printing::PrintPreviewDialogController*
@ -70,7 +67,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
DownloadRequestLimiter* download_request_limiter() override;
BackgroundModeManager* background_mode_manager() override;
void set_background_mode_manager_for_test(
scoped_ptr<BackgroundModeManager> manager) override;
std::unique_ptr<BackgroundModeManager> manager) override;
StatusTray* status_tray() override;
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
safe_browsing::ClientSideDetectionService*

View File

@ -92,7 +92,7 @@ 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);
int InitialDelay() const override;
int NextCheckDelay() const override;
@ -103,6 +103,7 @@ class CefConfigurator : public Configurator {
std::vector<GURL> PingUrl() const override;
base::Version GetBrowserVersion() const override;
std::string GetChannel() const override;
std::string GetBrand() const override;
std::string GetLang() const override;
std::string GetOSLongName() const override;
std::string ExtraRequestParams() const override;
@ -214,6 +215,10 @@ std::string CefConfigurator::GetChannel() const {
return "";
}
std::string CefConfigurator::GetBrand() const {
return "";
}
std::string CefConfigurator::GetLang() const {
return "";
}

View File

@ -64,7 +64,6 @@
#include "content/public/common/storage_quota_params.h"
#include "content/public/common/web_preferences.h"
#include "extensions/browser/extension_message_filter.h"
#include "extensions/browser/extension_protocols.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
#include "extensions/browser/io_thread_extension_message_filter.h"
@ -316,13 +315,6 @@ int GetCrashSignalFD(const base::CommandLine& command_line) {
return crash_handler->GetDeathSignalSocket();
}
if (process_type == switches::kPluginProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = NULL;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket();
}
if (process_type == switches::kPpapiPluginProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = NULL;
if (!crash_handler)
@ -494,46 +486,6 @@ bool CefContentBrowserClient::ShouldUseProcessPerSite(
return true;
}
net::URLRequestContextGetter* CefContentBrowserClient::CreateRequestContext(
content::BrowserContext* content_browser_context,
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) {
scoped_refptr<CefBrowserContext> context =
static_cast<CefBrowserContext*>(content_browser_context);
if (extensions::ExtensionsEnabled()) {
// Handle only chrome-extension:// requests. CEF does not support
// chrome-extension-resource:// requests (it does not store shared extension
// data in its installation directory).
extensions::InfoMap* extension_info_map =
context->extension_system()->info_map();
(*protocol_handlers)[extensions::kExtensionScheme] =
linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
extensions::CreateExtensionProtocolHandler(
context->IsOffTheRecord(), extension_info_map).release());
}
return context->CreateRequestContext(
protocol_handlers,
std::move(request_interceptors));
}
net::URLRequestContextGetter*
CefContentBrowserClient::CreateRequestContextForStoragePartition(
content::BrowserContext* content_browser_context,
const base::FilePath& partition_path,
bool in_memory,
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) {
scoped_refptr<CefBrowserContext> context =
static_cast<CefBrowserContext*>(content_browser_context);
return context->CreateRequestContextForStoragePartition(
partition_path,
in_memory,
protocol_handlers,
std::move(request_interceptors));
}
bool CefContentBrowserClient::IsHandledURL(const GURL& url) {
if (!url.is_valid())
return false;
@ -546,16 +498,6 @@ bool CefContentBrowserClient::IsHandledURL(const GURL& url) {
return CefContentClient::Get()->HasCustomScheme(scheme);
}
bool CefContentBrowserClient::IsNPAPIEnabled() {
#if defined(OS_WIN) || defined(OS_MACOSX)
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
return command_line->HasSwitch(switches::kEnableNPAPI);
#else
return false;
#endif
}
void CefContentBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line, int child_process_id) {
const base::CommandLine* browser_cmd =
@ -725,7 +667,7 @@ void CefContentBrowserClient::AllowCertificateError(
void CefContentBrowserClient::SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
scoped_ptr<content::ClientCertificateDelegate> delegate) {
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
if (!cert_request_info->client_certs.empty()) {
// Use the first certificate.
delegate->ContinueWithCertificate(cert_request_info->client_certs[0].get());
@ -794,7 +736,7 @@ std::string CefContentBrowserClient::GetDefaultDownloadName() {
void CefContentBrowserClient::DidCreatePpapiPlugin(
content::BrowserPpapiHost* browser_host) {
browser_host->GetPpapiHost()->AddHostFactoryFilter(
scoped_ptr<ppapi::host::HostFactory>(
std::unique_ptr<ppapi::host::HostFactory>(
new CefBrowserPepperHostFactory(browser_host)));
}

View File

@ -15,7 +15,6 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
#include "content/public/browser/content_browser_client.h"
#include "third_party/skia/include/core/SkColor.h"
@ -44,20 +43,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::RenderProcessHost* host) override;
bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
const GURL& effective_url) override;
net::URLRequestContextGetter* CreateRequestContext(
content::BrowserContext* browser_context,
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors)
override;
net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
content::BrowserContext* browser_context,
const base::FilePath& partition_path,
bool in_memory,
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors)
override;
bool IsHandledURL(const GURL& url) override;
bool IsNPAPIEnabled() override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
content::QuotaPermissionContext*
@ -79,7 +65,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
void SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
scoped_ptr<content::ClientCertificateDelegate> delegate) override;
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
content::AccessTokenStore* CreateAccessTokenStore() override;
bool CanCreateWindow(const GURL& opener_url,
const GURL& opener_top_level_frame_url,
@ -129,8 +115,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
private:
CefBrowserMainParts* browser_main_parts_;
scoped_ptr<content::PluginServiceFilter> plugin_service_filter_;
scoped_ptr<CefResourceDispatcherHostDelegate>
std::unique_ptr<content::PluginServiceFilter> plugin_service_filter_;
std::unique_ptr<CefResourceDispatcherHostDelegate>
resource_dispatcher_host_delegate_;
};

View File

@ -12,7 +12,6 @@
#include "include/cef_app.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/platform_thread.h"
namespace base {
@ -95,16 +94,16 @@ class CefContext {
CefSettings settings_;
scoped_ptr<CefMainDelegate> main_delegate_;
scoped_ptr<content::ContentMainRunner> main_runner_;
scoped_ptr<CefTraceSubscriber> trace_subscriber_;
scoped_ptr<CefBrowserInfoManager> browser_info_manager_;
std::unique_ptr<CefMainDelegate> main_delegate_;
std::unique_ptr<content::ContentMainRunner> main_runner_;
std::unique_ptr<CefTraceSubscriber> trace_subscriber_;
std::unique_ptr<CefBrowserInfoManager> browser_info_manager_;
// Only accessed on the UI Thread.
scoped_ptr<printing::PrintJobManager> print_job_manager_;
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
// Initially only for Widevine components.
scoped_ptr<component_updater::ComponentUpdateService> component_updater_;
std::unique_ptr<component_updater::ComponentUpdateService> component_updater_;
};
// Helper macro that returns true if the global context is in a valid state.

View File

@ -124,7 +124,7 @@ class CefCookieManagerImpl : public CefCookieManager {
// Used for cookie monsters owned by this object.
base::FilePath storage_path_;
std::vector<std::string> supported_schemes_;
scoped_ptr<net::CookieMonster> cookie_store_;
std::unique_ptr<net::CookieMonster> cookie_store_;
IMPLEMENT_REFCOUNTING_DELETE_ON_IOT(CefCookieManagerImpl);
};

View File

@ -48,11 +48,11 @@ class TCPServerSocketFactory
private:
// DevToolsHttpHandler::ServerSocketFactory.
scoped_ptr<net::ServerSocket> CreateForHttpServer() override {
scoped_ptr<net::ServerSocket> socket(
std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
std::unique_ptr<net::ServerSocket> socket(
new net::TCPServerSocket(nullptr, net::NetLog::Source()));
if (socket->ListenWithAddressAndPort(address_, port_, kBackLog) != net::OK)
return scoped_ptr<net::ServerSocket>();
return std::unique_ptr<net::ServerSocket>();
return socket;
}
@ -63,9 +63,9 @@ class TCPServerSocketFactory
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
};
scoped_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>
std::unique_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>
CreateSocketFactory(uint16_t port) {
return scoped_ptr<
return std::unique_ptr<
devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>(
new TCPServerSocketFactory("127.0.0.1", port));
}

View File

@ -12,7 +12,6 @@
#include <vector>
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "components/devtools_http_handler/devtools_http_handler.h"
#include "components/devtools_http_handler/devtools_http_handler_delegate.h"
#include "content/public/browser/devtools_agent_host.h"
@ -42,7 +41,7 @@ class CefDevToolsDelegate :
std::string GetChromeDevToolsURL();
private:
scoped_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_;
std::unique_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsDelegate);
};

View File

@ -220,7 +220,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
std::string method;
base::ListValue* params = NULL;
base::DictionaryValue* dict = NULL;
scoped_ptr<base::Value> parsed_message = base::JSONReader::Read(message);
std::unique_ptr<base::Value> parsed_message = base::JSONReader::Read(message);
if (!parsed_message ||
!parsed_message->GetAsDictionary(&dict) ||
!dict->GetString("method", &method)) {
@ -264,7 +264,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
fetcher->SetRequestContext(web_contents()->GetBrowserContext()->
GetRequestContext());
fetcher->SetExtraRequestHeaders(headers);
fetcher->SaveResponseWithWriter(scoped_ptr<net::URLFetcherResponseWriter>(
fetcher->SaveResponseWithWriter(std::unique_ptr<net::URLFetcherResponseWriter>(
new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id)));
fetcher->Start();
return;

View File

@ -9,7 +9,6 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "content/public/browser/devtools_agent_host.h"
@ -81,7 +80,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
CefRefPtr<CefBrowserHostImpl> frontend_browser_;
content::WebContents* inspected_contents_;
scoped_refptr<content::DevToolsAgentHost> agent_host_;
scoped_ptr<content::DevToolsFrontendHost> frontend_host_;
std::unique_ptr<content::DevToolsFrontendHost> frontend_host_;
using PendingRequestsMap = std::map<const net::URLFetcher*, int>;
PendingRequestsMap pending_requests_;
base::DictionaryValue preferences_;

View File

@ -65,7 +65,7 @@ StreamsPrivateAPI::~StreamsPrivateAPI() {
void StreamsPrivateAPI::ExecuteMimeTypeHandler(
const std::string& extension_id,
int tab_id,
scoped_ptr<content::StreamInfo> stream,
std::unique_ptr<content::StreamInfo> stream,
const std::string& view_id,
int64_t expected_content_size,
bool embedded,
@ -84,7 +84,7 @@ void StreamsPrivateAPI::ExecuteMimeTypeHandler(
if (handler->HasPlugin()) {
GURL handler_url(Extension::GetBaseURLFromExtensionId(extension_id).spec() +
handler->handler_url());
scoped_ptr<StreamContainer> stream_container(new StreamContainer(
std::unique_ptr<StreamContainer> stream_container(new StreamContainer(
std::move(stream), tab_id, embedded, handler_url, extension_id));
MimeHandlerStreamManager::Get(browser_context_)
->AddStream(view_id, std::move(stream_container), render_process_id,
@ -111,7 +111,7 @@ void StreamsPrivateAPI::ExecuteMimeTypeHandler(
CreateResponseHeadersDictionary(stream->response_headers.get(),
&info.response_headers.additional_properties);
scoped_ptr<Event> event(
std::unique_ptr<Event> event(
new Event(events::STREAMS_PRIVATE_ON_EXECUTE_MIME_TYPE_HANDLER,
streams_private::OnExecuteMimeTypeHandler::kEventName,
streams_private::OnExecuteMimeTypeHandler::Create(info)));

View File

@ -41,7 +41,7 @@ class StreamsPrivateAPI : public BrowserContextKeyedAPI,
// should be set to whether the document is embedded within another document.
void ExecuteMimeTypeHandler(const std::string& extension_id,
int tab_id,
scoped_ptr<content::StreamInfo> stream,
std::unique_ptr<content::StreamInfo> stream,
const std::string& view_id,
int64_t expected_content_size,
bool embedded,

View File

@ -29,7 +29,7 @@ EventRouterForwarder::~EventRouterForwarder() {
void EventRouterForwarder::BroadcastEventToRenderers(
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
const GURL& event_url) {
HandleEvent(std::string(), histogram_value, event_name, std::move(event_args),
0, true, event_url);
@ -38,7 +38,7 @@ void EventRouterForwarder::BroadcastEventToRenderers(
void EventRouterForwarder::DispatchEventToRenderers(
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
void* profile,
bool use_profile_to_restrict_events,
const GURL& event_url) {
@ -52,7 +52,7 @@ void EventRouterForwarder::BroadcastEventToExtension(
const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
const GURL& event_url) {
HandleEvent(extension_id, histogram_value, event_name, std::move(event_args),
0, true, event_url);
@ -62,7 +62,7 @@ void EventRouterForwarder::DispatchEventToExtension(
const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
void* profile,
bool use_profile_to_restrict_events,
const GURL& event_url) {
@ -72,13 +72,14 @@ void EventRouterForwarder::DispatchEventToExtension(
profile, use_profile_to_restrict_events, event_url);
}
void EventRouterForwarder::HandleEvent(const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile_ptr,
bool use_profile_to_restrict_events,
const GURL& event_url) {
void EventRouterForwarder::HandleEvent(
const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
std::unique_ptr<base::ListValue> event_args,
void* profile_ptr,
bool use_profile_to_restrict_events,
const GURL& event_url) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@ -102,7 +103,7 @@ void EventRouterForwarder::HandleEvent(const std::string& extension_id,
std::vector<CefBrowserContextImpl*> profiles(
CefBrowserContextImpl::GetAll());
for (size_t i = 0; i < profiles.size(); ++i) {
scoped_ptr<base::ListValue> per_profile_event_args(
std::unique_ptr<base::ListValue> per_profile_event_args(
event_args->DeepCopy());
CallEventRouter(profiles[i], extension_id, histogram_value, event_name,
std::move(per_profile_event_args),
@ -117,10 +118,10 @@ void EventRouterForwarder::CallEventRouter(
const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
content::BrowserContext* restrict_to_profile,
const GURL& event_url) {
scoped_ptr<Event> event(
std::unique_ptr<Event> event(
new Event(histogram_value, event_name, std::move(event_args)));
event->restrict_to_browser_context = restrict_to_profile;
event->event_url = event_url;

View File

@ -40,7 +40,7 @@ class EventRouterForwarder
// May be called on any thread.
void BroadcastEventToRenderers(events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
const GURL& event_url);
// Calls
@ -51,7 +51,7 @@ class EventRouterForwarder
void BroadcastEventToExtension(const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
const GURL& event_url);
// Calls
@ -60,7 +60,7 @@ class EventRouterForwarder
// on |profile|'s EventRouter. May be called on any thread.
void DispatchEventToRenderers(events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
void* profile,
bool use_profile_to_restrict_events,
const GURL& event_url);
@ -72,7 +72,7 @@ class EventRouterForwarder
void DispatchEventToExtension(const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
void* profile,
bool use_profile_to_restrict_events,
const GURL& event_url);
@ -86,7 +86,7 @@ class EventRouterForwarder
virtual void HandleEvent(const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
void* profile,
bool use_profile_to_restrict_events,
const GURL& event_url);
@ -99,7 +99,7 @@ class EventRouterForwarder
const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
std::unique_ptr<base::ListValue> event_args,
content::BrowserContext* restrict_to_profile,
const GURL& event_url);

View File

@ -36,6 +36,7 @@
#include "extensions/browser/quota_service.h"
#include "extensions/browser/runtime_data.h"
#include "extensions/browser/service_worker_manager.h"
#include "extensions/browser/value_store/value_store_factory.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/file_util.h"
@ -65,7 +66,7 @@ std::string GenerateId(const base::DictionaryValue* manifest,
base::DictionaryValue* ParseManifest(
const std::string& manifest_contents) {
JSONStringValueDeserializer deserializer(manifest_contents);
scoped_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL));
std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL));
if (!manifest.get() || !manifest->IsType(base::Value::TYPE_DICTIONARY)) {
LOG(ERROR) << "Failed to parse extension manifest.";
@ -204,6 +205,10 @@ StateStore* CefExtensionSystem::rules_store() {
return nullptr;
}
scoped_refptr<ValueStoreFactory> CefExtensionSystem::store_factory() {
return nullptr;
}
InfoMap* CefExtensionSystem::info_map() {
if (!info_map_.get())
info_map_ = new InfoMap;
@ -230,7 +235,7 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts(
FROM_HERE,
base::Bind(&InfoMap::AddExtension,
info_map(),
make_scoped_refptr(extension),
base::RetainedRef(extension),
base::Time::Now(),
true, // incognito_enabled
false), // notifications_disabled
@ -256,7 +261,7 @@ ContentVerifier* CefExtensionSystem::content_verifier() {
return nullptr;
}
scoped_ptr<ExtensionSet> CefExtensionSystem::GetDependentExtensions(
std::unique_ptr<ExtensionSet> CefExtensionSystem::GetDependentExtensions(
const Extension* extension) {
return make_scoped_ptr(new ExtensionSet());
}
@ -451,7 +456,6 @@ void CefExtensionSystem::NotifyExtensionUnloaded(
content::PluginService* plugin_service =
content::PluginService::GetInstance();
plugin_service->UnregisterInternalPlugin(path);
plugin_service->ForcePluginShutdown(path);
plugin_service->RefreshPlugins();
}

View File

@ -30,6 +30,7 @@ class InfoMap;
class ProcessManager;
class RendererStartupHelper;
class SharedUserScriptMaster;
class ValueStoreFactory;
// Used to manage extensions.
class CefExtensionSystem : public ExtensionSystem {
@ -60,6 +61,7 @@ class CefExtensionSystem : public ExtensionSystem {
SharedUserScriptMaster* shared_user_script_master() override;
StateStore* state_store() override;
StateStore* rules_store() override;
scoped_refptr<ValueStoreFactory> store_factory() override;
InfoMap* info_map() override;
QuotaService* quota_service() override;
AppSorting* app_sorting() override;
@ -71,7 +73,7 @@ class CefExtensionSystem : public ExtensionSystem {
const UnloadedExtensionInfo::Reason reason) override;
const OneShotEvent& ready() const override;
ContentVerifier* content_verifier() override;
scoped_ptr<ExtensionSet> GetDependentExtensions(
std::unique_ptr<ExtensionSet> GetDependentExtensions(
const Extension* extension) override;
void InstallUpdate(const std::string& extension_id,
const base::FilePath& temp_dir) override;
@ -121,10 +123,10 @@ class CefExtensionSystem : public ExtensionSystem {
// Data to be accessed on the IO thread. Must outlive process_manager_.
scoped_refptr<InfoMap> info_map_;
scoped_ptr<ServiceWorkerManager> service_worker_manager_;
scoped_ptr<RuntimeData> runtime_data_;
scoped_ptr<QuotaService> quota_service_;
scoped_ptr<AppSorting> app_sorting_;
std::unique_ptr<ServiceWorkerManager> service_worker_manager_;
std::unique_ptr<RuntimeData> runtime_data_;
std::unique_ptr<QuotaService> quota_service_;
std::unique_ptr<AppSorting> app_sorting_;
// Signaled when the extension system has completed its startup tasks.
OneShotEvent ready_;

View File

@ -28,7 +28,7 @@ AppViewGuestDelegate* CefExtensionsAPIClient::CreateAppViewGuestDelegate()
return NULL;
}
scoped_ptr<guest_view::GuestViewManagerDelegate>
std::unique_ptr<guest_view::GuestViewManagerDelegate>
CefExtensionsAPIClient::CreateGuestViewManagerDelegate(
content::BrowserContext* context) const {
// The GuestViewManager instance associated with the returned Delegate, which
@ -44,7 +44,7 @@ CefExtensionsAPIClient::CreateGuestViewManagerDelegate(
CefBrowserContextImpl::GetForContext(context).get()));
}
scoped_ptr<MimeHandlerViewGuestDelegate>
std::unique_ptr<MimeHandlerViewGuestDelegate>
CefExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate(
MimeHandlerViewGuest* guest) const {
return make_scoped_ptr(new CefMimeHandlerViewGuestDelegate(guest));
@ -56,7 +56,7 @@ void CefExtensionsAPIClient::AttachWebContentsHelpers(
printing::PrintViewManager::CreateForWebContents(web_contents);
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
web_contents,
scoped_ptr<pdf::PDFWebContentsHelperClient>(
std::unique_ptr<pdf::PDFWebContentsHelperClient>(
new CefPDFWebContentsHelperClient()));
CefExtensionWebContentsObserver::CreateForWebContents(web_contents);
}

View File

@ -16,10 +16,10 @@ class CefExtensionsAPIClient : public ExtensionsAPIClient {
// ExtensionsAPIClient implementation.
AppViewGuestDelegate* CreateAppViewGuestDelegate() const override;
scoped_ptr<guest_view::GuestViewManagerDelegate>
std::unique_ptr<guest_view::GuestViewManagerDelegate>
CreateGuestViewManagerDelegate(
content::BrowserContext* context) const override;
scoped_ptr<MimeHandlerViewGuestDelegate>
std::unique_ptr<MimeHandlerViewGuestDelegate>
CreateMimeHandlerViewGuestDelegate(
MimeHandlerViewGuest* guest) const override;
void AttachWebContentsHelpers(content::WebContents* web_contents) const

View File

@ -139,11 +139,11 @@ CefExtensionsBrowserClient::GetProcessManagerDelegate() const {
return NULL;
}
scoped_ptr<ExtensionHostDelegate>
std::unique_ptr<ExtensionHostDelegate>
CefExtensionsBrowserClient::CreateExtensionHostDelegate() {
// TODO(extensions): Implement to support Apps.
NOTREACHED();
return scoped_ptr<ExtensionHostDelegate>();
return std::unique_ptr<ExtensionHostDelegate>();
}
bool CefExtensionsBrowserClient::DidVersionUpdate(BrowserContext* context) {
@ -188,12 +188,12 @@ void CefExtensionsBrowserClient::RegisterMojoServices(
RegisterServicesForFrame(render_frame_host, extension);
}
scoped_ptr<RuntimeAPIDelegate>
std::unique_ptr<RuntimeAPIDelegate>
CefExtensionsBrowserClient::CreateRuntimeAPIDelegate(
content::BrowserContext* context) const {
// TODO(extensions): Implement to support Apps.
NOTREACHED();
return scoped_ptr<RuntimeAPIDelegate>();
return std::unique_ptr<RuntimeAPIDelegate>();
}
const ComponentExtensionResourceManager*
@ -204,7 +204,7 @@ CefExtensionsBrowserClient::GetComponentExtensionResourceManager() {
void CefExtensionsBrowserClient::BroadcastEventToRenderers(
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> args) {
std::unique_ptr<base::ListValue> args) {
event_router_forwarder_->BroadcastEventToRenderers(
histogram_value, event_name, std::move(args), GURL());
}

View File

@ -58,7 +58,7 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
std::vector<ExtensionPrefsObserver*>* observers) const
override;
ProcessManagerDelegate* GetProcessManagerDelegate() const override;
scoped_ptr<ExtensionHostDelegate>
std::unique_ptr<ExtensionHostDelegate>
CreateExtensionHostDelegate() override;
bool DidVersionUpdate(content::BrowserContext* context) override;
void PermitExternalProtocolHandler() override;
@ -71,13 +71,13 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
ExtensionFunctionRegistry* registry) const override;
void RegisterMojoServices(content::RenderFrameHost* render_frame_host,
const Extension* extension) const override;
scoped_ptr<RuntimeAPIDelegate> CreateRuntimeAPIDelegate(
std::unique_ptr<RuntimeAPIDelegate> CreateRuntimeAPIDelegate(
content::BrowserContext* context) const override;
const ComponentExtensionResourceManager*
GetComponentExtensionResourceManager() override;
void BroadcastEventToRenderers(events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> args) override;
std::unique_ptr<base::ListValue> args) override;
net::NetLog* GetNetLog() override;
ExtensionCache* GetExtensionCache() override;
bool IsBackgroundUpdateAllowed() override;
@ -90,10 +90,10 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
private:
// Support for extension APIs.
scoped_ptr<ExtensionsAPIClient> api_client_;
std::unique_ptr<ExtensionsAPIClient> api_client_;
// Resource manager used to supply resources from pak files.
scoped_ptr<ComponentExtensionResourceManager> resource_manager_;
std::unique_ptr<ComponentExtensionResourceManager> resource_manager_;
scoped_refptr<EventRouterForwarder> event_router_forwarder_;

View File

@ -153,7 +153,7 @@ class UploadFolderHelper :
CefFileDialogManager::CefFileDialogManager(
CefBrowserHostImpl* browser,
scoped_ptr<CefFileDialogRunner> runner)
std::unique_ptr<CefFileDialogRunner> runner)
: content::WebContentsObserver(browser->web_contents()),
browser_(browser),
runner_(std::move(runner)),

View File

@ -11,7 +11,6 @@
#include "libcef/browser/file_dialog_runner.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/web_contents_observer.h"
@ -30,7 +29,7 @@ class CefFileDialogManager : public content::WebContentsObserver {
// |runner| may be NULL if the platform doesn't implement dialogs.
CefFileDialogManager(
CefBrowserHostImpl* browser,
scoped_ptr<CefFileDialogRunner> runner);
std::unique_ptr<CefFileDialogRunner> runner);
~CefFileDialogManager() override;
// Delete the runner to free any platform constructs.
@ -82,13 +81,13 @@ class CefFileDialogManager : public content::WebContentsObserver {
// CefBrowserHostImpl pointer is guaranteed to outlive this object.
CefBrowserHostImpl* browser_;
scoped_ptr<CefFileDialogRunner> runner_;
std::unique_ptr<CefFileDialogRunner> runner_;
// True if a file chooser is currently pending.
bool file_chooser_pending_;
// Used for asynchronously listing directory contents.
scoped_ptr<net::DirectoryLister> lister_;
std::unique_ptr<net::DirectoryLister> lister_;
// Must be the last member.
base::WeakPtrFactory<CefFileDialogManager> weak_ptr_factory_;

View File

@ -11,7 +11,6 @@
#include "base/files/file_path.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/common/file_chooser_params.h"
class CefBrowserHostImpl;

View File

@ -72,7 +72,7 @@ class CefLocationRequest :
CefRefPtr<CefGetGeolocationCallback> callback_;
content::GeolocationProvider::LocationUpdateCallback geo_callback_;
scoped_ptr<content::GeolocationProvider::Subscription> subscription_;
std::unique_ptr<content::GeolocationProvider::Subscription> subscription_;
DISALLOW_COPY_AND_ASSIGN(CefLocationRequest);
};

View File

@ -166,7 +166,7 @@ bool CefImageImpl::AddJPEG(float scale_factor,
size_t jpeg_data_size) {
CEF_REQUIRE_UIT_RETURN(false);
scoped_ptr<SkBitmap> bitmap(
std::unique_ptr<SkBitmap> bitmap(
gfx::JPEGCodec::Decode(static_cast<const unsigned char*>(jpeg_data),
jpeg_data_size));
if (!bitmap.get())

View File

@ -70,7 +70,7 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback {
CefJavaScriptDialogManager::CefJavaScriptDialogManager(
CefBrowserHostImpl* browser,
scoped_ptr<CefJavaScriptDialogRunner> runner)
std::unique_ptr<CefJavaScriptDialogRunner> runner)
: browser_(browser),
runner_(std::move(runner)),
dialog_running_(false),
@ -90,7 +90,6 @@ void CefJavaScriptDialogManager::Destroy() {
void CefJavaScriptDialogManager::RunJavaScriptDialog(
content::WebContents* web_contents,
const GURL& origin_url,
const std::string& accept_lang,
content::JavaScriptMessageType message_type,
const base::string16& message_text,
const base::string16& default_prompt_text,
@ -107,7 +106,6 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog(
// Execute the user callback.
bool handled = handler->OnJSDialog(browser_, origin_url.spec(),
accept_lang,
static_cast<cef_jsdialog_type_t>(message_type),
message_text, default_prompt_text, callbackPtr.get(),
*did_suppress_message);
@ -136,8 +134,8 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog(
dialog_running_ = true;
base::string16 display_url =
url_formatter::FormatUrlForSecurityDisplay(origin_url, accept_lang);
const base::string16& display_url =
url_formatter::FormatUrlForSecurityDisplay(origin_url);
runner_->Run(browser_, message_type, display_url, message_text,
default_prompt_text,

View File

@ -12,7 +12,6 @@
#include "libcef/browser/javascript_dialog_runner.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/javascript_dialog_manager.h"
@ -23,7 +22,7 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
// |runner| may be NULL if the platform doesn't implement dialogs.
CefJavaScriptDialogManager(
CefBrowserHostImpl* browser,
scoped_ptr<CefJavaScriptDialogRunner> runner);
std::unique_ptr<CefJavaScriptDialogRunner> runner);
~CefJavaScriptDialogManager() override;
// Delete the runner to free any platform constructs.
@ -33,7 +32,6 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
void RunJavaScriptDialog(
content::WebContents* web_contents,
const GURL& origin_url,
const std::string& accept_lang,
content::JavaScriptMessageType message_type,
const base::string16& message_text,
const base::string16& default_prompt_text,
@ -57,7 +55,7 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
// CefBrowserHostImpl pointer is guaranteed to outlive this object.
CefBrowserHostImpl* browser_;
scoped_ptr<CefJavaScriptDialogRunner> runner_;
std::unique_ptr<CefJavaScriptDialogRunner> runner_;
// True if a dialog is currently running.
bool dialog_running_;

View File

@ -8,7 +8,6 @@
#pragma once
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "content/public/common/javascript_message_type.h"

View File

@ -90,7 +90,7 @@ class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback {
} // namespace
CefMenuManager::CefMenuManager(CefBrowserHostImpl* browser,
scoped_ptr<CefMenuRunner> runner)
std::unique_ptr<CefMenuRunner> runner)
: content::WebContentsObserver(browser->web_contents()),
browser_(browser),
runner_(std::move(runner)),

View File

@ -10,7 +10,6 @@
#include "libcef/browser/menu_runner.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/context_menu_params.h"
@ -27,7 +26,7 @@ class CefMenuManager : public CefMenuModelImpl::Delegate,
public content::WebContentsObserver {
public:
CefMenuManager(CefBrowserHostImpl* browser,
scoped_ptr<CefMenuRunner> runner);
std::unique_ptr<CefMenuRunner> runner);
~CefMenuManager() override;
// Delete the runner to free any platform constructs.
@ -63,7 +62,7 @@ class CefMenuManager : public CefMenuModelImpl::Delegate,
// CefBrowserHostImpl pointer is guaranteed to outlive this object.
CefBrowserHostImpl* browser_;
scoped_ptr<CefMenuRunner> runner_;
std::unique_ptr<CefMenuRunner> runner_;
CefRefPtr<CefMenuModelImpl> model_;
content::ContextMenuParams params_;

View File

@ -12,7 +12,6 @@
#include "include/cef_menu_model.h"
#include "include/cef_menu_model_delegate.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/threading/platform_thread.h"
#include "ui/base/models/menu_model.h"
@ -172,7 +171,7 @@ class CefMenuModelImpl : public CefMenuModel {
CefRefPtr<CefMenuModelDelegate> menu_model_delegate_;
ItemVector items_;
scoped_ptr<ui::MenuModel> model_;
std::unique_ptr<ui::MenuModel> model_;
// Observers that want to be notified of changes to this object.
base::ObserverList<Observer> observers_;

View File

@ -5,7 +5,9 @@
#ifndef CEF_LIBCEF_BROWSER_MENU_RUNNER_H_
#define CEF_LIBCEF_BROWSER_MENU_RUNNER_H_
#include "base/memory/scoped_ptr.h"
#include <memory>
#include "base/macros.h"
#include "base/strings/string16.h"
namespace content {

View File

@ -367,7 +367,7 @@ CefEventHandle CefBrowserPlatformDelegateNativeLinux::GetEventHandle(
return const_cast<CefEventHandle>(event.os_event->native_event());
}
scoped_ptr<CefMenuRunner>
std::unique_ptr<CefMenuRunner>
CefBrowserPlatformDelegateNativeLinux::CreateMenuRunner() {
return make_scoped_ptr(new CefMenuRunnerLinux);
}

View File

@ -44,7 +44,7 @@ class CefBrowserPlatformDelegateNativeLinux :
int deltaX, int deltaY) const override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
scoped_ptr<CefMenuRunner> CreateMenuRunner() override;
std::unique_ptr<CefMenuRunner> CreateMenuRunner() override;
private:
void TranslateMouseEvent(blink::WebMouseEvent& result,

View File

@ -39,9 +39,9 @@ class CefBrowserPlatformDelegateNativeMac :
int deltaX, int deltaY) const override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
scoped_ptr<CefFileDialogRunner> CreateFileDialogRunner() override;
scoped_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner() override;
scoped_ptr<CefMenuRunner> CreateMenuRunner() override;
std::unique_ptr<CefFileDialogRunner> CreateFileDialogRunner() override;
std::unique_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner() override;
std::unique_ptr<CefMenuRunner> CreateMenuRunner() override;
private:
void TranslateMouseEvent(blink::WebMouseEvent& result,

View File

@ -20,6 +20,7 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#import "ui/base/cocoa/cocoa_base_utils.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
#include "ui/gfx/geometry/rect.h"
@ -102,36 +103,6 @@
browser_->SetFocus(false);
}
// Called when we have been minimized.
- (void)windowDidMiniaturize:(NSNotification *)notification {
if (browser_)
browser_->SetWindowVisibility(false);
}
// Called when we have been unminimized.
- (void)windowDidDeminiaturize:(NSNotification *)notification {
if (browser_)
browser_->SetWindowVisibility(true);
}
// Called when the application has been hidden.
- (void)applicationDidHide:(NSNotification *)notification {
// If the window is miniaturized then nothing has really changed.
if (![window_ isMiniaturized]) {
if (browser_)
browser_->SetWindowVisibility(false);
}
}
// Called when the application has been unhidden.
- (void)applicationDidUnhide:(NSNotification *)notification {
// If the window is miniaturized then nothing has really changed.
if (![window_ isMiniaturized]) {
if (browser_)
browser_->SetWindowVisibility(true);
}
}
- (BOOL)windowShouldClose:(id)window {
if (browser_ && !browser_->TryCloseBrowser()) {
// Cancel the close.
@ -325,7 +296,8 @@ gfx::Point CefBrowserPlatformDelegateNativeMac::GetScreenPoint(
NSRect bounds = [nsview bounds];
NSPoint view_pt = {view.x(), bounds.size.height - view.y()};
NSPoint window_pt = [nsview convertPoint:view_pt toView:nil];
NSPoint screen_pt = [[nsview window] convertBaseToScreen:window_pt];
NSPoint screen_pt =
ui::ConvertPointFromWindowToScreen([nsview window], window_pt);
return gfx::Point(screen_pt.x, screen_pt.y);
}
return gfx::Point();
@ -491,17 +463,17 @@ CefEventHandle CefBrowserPlatformDelegateNativeMac::GetEventHandle(
return event.os_event;
}
scoped_ptr<CefFileDialogRunner>
std::unique_ptr<CefFileDialogRunner>
CefBrowserPlatformDelegateNativeMac::CreateFileDialogRunner() {
return make_scoped_ptr(new CefFileDialogRunnerMac);
}
scoped_ptr<CefJavaScriptDialogRunner>
std::unique_ptr<CefJavaScriptDialogRunner>
CefBrowserPlatformDelegateNativeMac::CreateJavaScriptDialogRunner() {
return make_scoped_ptr(new CefJavaScriptDialogRunnerMac);
}
scoped_ptr<CefMenuRunner>
std::unique_ptr<CefMenuRunner>
CefBrowserPlatformDelegateNativeMac::CreateMenuRunner() {
return make_scoped_ptr(new CefMenuRunnerMac);
}

View File

@ -497,17 +497,17 @@ CefEventHandle CefBrowserPlatformDelegateNativeWin::GetEventHandle(
return const_cast<CefEventHandle>(&event.os_event->native_event());
}
scoped_ptr<CefFileDialogRunner>
std::unique_ptr<CefFileDialogRunner>
CefBrowserPlatformDelegateNativeWin::CreateFileDialogRunner() {
return make_scoped_ptr(new CefFileDialogRunnerWin);
}
scoped_ptr<CefJavaScriptDialogRunner>
std::unique_ptr<CefJavaScriptDialogRunner>
CefBrowserPlatformDelegateNativeWin::CreateJavaScriptDialogRunner() {
return make_scoped_ptr(new CefJavaScriptDialogRunnerWin);
}
scoped_ptr<CefMenuRunner>
std::unique_ptr<CefMenuRunner>
CefBrowserPlatformDelegateNativeWin::CreateMenuRunner() {
return make_scoped_ptr(new CefMenuRunnerWin);
}

View File

@ -44,9 +44,9 @@ class CefBrowserPlatformDelegateNativeWin :
int deltaX, int deltaY) const override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
scoped_ptr<CefFileDialogRunner> CreateFileDialogRunner() override;
scoped_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner() override;
scoped_ptr<CefMenuRunner> CreateMenuRunner() override;
std::unique_ptr<CefFileDialogRunner> CreateFileDialogRunner() override;
std::unique_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner() override;
std::unique_ptr<CefMenuRunner> CreateMenuRunner() override;
private:
void TranslateMouseEvent(blink::WebMouseEvent& result,

View File

@ -280,7 +280,7 @@ bool RunOpenMultiFileDialog(
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = owner;
scoped_ptr<wchar_t[]> filename(new wchar_t[UNICODE_STRING_MAX_CHARS]);
std::unique_ptr<wchar_t[]> filename(new wchar_t[UNICODE_STRING_MAX_CHARS]);
filename[0] = 0;
ofn.lpstrFile = filename.get();

View File

@ -5,10 +5,11 @@
#ifndef CEF_LIBCEF_BROWSER_NATIVE_MENU_2_H_
#define CEF_LIBCEF_BROWSER_NATIVE_MENU_2_H_
#include <memory>
#include "libcef/browser/native/menu_wrapper.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/native_widget_types.h"
namespace gfx {
@ -86,7 +87,7 @@ class Menu2 {
ui::MenuModel* model_;
// The object that actually implements the menu.
scoped_ptr<MenuWrapper> wrapper_;
std::unique_ptr<MenuWrapper> wrapper_;
DISALLOW_COPY_AND_ASSIGN(Menu2);
};

View File

@ -8,7 +8,6 @@
#include "libcef/browser/menu_runner.h"
#include "base/memory/scoped_ptr.h"
#include "ui/views/controls/menu/menu_runner.h"
class CefMenuRunnerLinux: public CefMenuRunner {
@ -23,7 +22,7 @@ class CefMenuRunnerLinux: public CefMenuRunner {
bool FormatLabel(base::string16& label) override;
private:
scoped_ptr<views::MenuRunner> menu_;
std::unique_ptr<views::MenuRunner> menu_;
};
#endif // CEF_LIBCEF_BROWSER_NATIVE_MENU_RUNNER_LINUX_H_

View File

@ -10,7 +10,6 @@
#include "libcef/browser/native/native_menu_win.h"
#include "base/memory/scoped_ptr.h"
class CefMenuRunnerWin : public CefMenuRunner {
public:
@ -22,7 +21,7 @@ class CefMenuRunnerWin : public CefMenuRunner {
const content::ContextMenuParams& params) override;
private:
scoped_ptr<views::NativeMenuWin> menu_;
std::unique_ptr<views::NativeMenuWin> menu_;
};
#endif // CEF_LIBCEF_BROWSER_NATIVE_MENU_RUNNER_WIN_H_

View File

@ -54,7 +54,7 @@ struct NativeMenuWin::ItemData {
base::string16 label;
// Someone needs to own submenus, it may as well be us.
scoped_ptr<Menu2> submenu;
std::unique_ptr<Menu2> submenu;
// We need a pointer back to the containing menu in various circumstances.
NativeMenuWin* native_menu_win;

View File

@ -11,7 +11,6 @@
#include "base/macros.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
@ -124,7 +123,7 @@ class NativeMenuWin : public MenuWrapper {
// The window that receives notifications from the menu.
class MenuHostWindow;
friend MenuHostWindow;
scoped_ptr<MenuHostWindow> host_window_;
std::unique_ptr<MenuHostWindow> host_window_;
// The HWND this menu is the system menu for, or NULL if the menu is not a
// system menu.

View File

@ -20,6 +20,7 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@ -413,7 +414,7 @@ class ChromeProtocolHandlerWrapper :
public:
ChromeProtocolHandlerWrapper(
CefURLRequestManager* request_manager,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_protocol_handler)
: request_manager_(request_manager),
chrome_protocol_handler_(std::move(chrome_protocol_handler)) {
@ -441,7 +442,7 @@ class ChromeProtocolHandlerWrapper :
private:
CefURLRequestManager* request_manager_;
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_protocol_handler_;
};
@ -451,8 +452,7 @@ void RegisterChromeHandler(CefURLRequestManager* request_manager) {
request_manager->AddFactory(
content::kChromeUIScheme,
std::string(),
CreateInternalHandlerFactory(
make_scoped_ptr<InternalHandlerDelegate>(new Delegate())));
CreateInternalHandlerFactory(base::WrapUnique(new Delegate())));
}
bool WillHandleBrowserAboutURL(GURL* url,
@ -478,12 +478,12 @@ void DidFinishChromeLoad(CefRefPtr<CefFrame> frame,
}
}
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>
WrapChromeProtocolHandler(
CefURLRequestManager* request_manager,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_protocol_handler) {
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> ret(
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler> ret(
new ChromeProtocolHandlerWrapper(request_manager,
std::move(chrome_protocol_handler)));
return ret;

View File

@ -12,7 +12,6 @@
#include "include/cef_frame.h"
#include "include/cef_process_message.h"
#include "base/memory/scoped_ptr.h"
#include "net/url_request/url_request_job_factory.h"
#include "url/gurl.h"
@ -43,10 +42,10 @@ void DidFinishChromeLoad(CefRefPtr<CefFrame> frame,
// Create a new ProtocolHandler that will filter the URLs passed to the default
// "chrome" protocol handler and forward the rest to CEF's handler.
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>
WrapChromeProtocolHandler(
CefURLRequestManager* request_manager,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_protocol_handler);
} // namespace scheme

View File

@ -140,7 +140,7 @@ void CefCookieStoreProxy::FlushStore(const base::Closure& callback) {
cookie_store->FlushStore(callback);
}
scoped_ptr<net::CookieStore::CookieChangedSubscription>
std::unique_ptr<net::CookieStore::CookieChangedSubscription>
CefCookieStoreProxy::AddCallbackForCookie(
const GURL& url,
const std::string& name,

View File

@ -66,7 +66,7 @@ class CefCookieStoreProxy : public net::CookieStore {
const DeleteCallback& callback) override;
void DeleteSessionCookiesAsync(const DeleteCallback& callback) override;
void FlushStore(const base::Closure& callback) override;
scoped_ptr<CookieChangedSubscription> AddCallbackForCookie(
std::unique_ptr<CookieChangedSubscription> AddCallbackForCookie(
const GURL& url,
const std::string& name,
const CookieChangedCallback& callback) override;

View File

@ -9,6 +9,7 @@
#include "libcef/browser/net/internal_scheme_handler.h"
#include "libcef/browser/net/url_request_manager.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "content/public/common/url_constants.h"
#include "grit/devtools_resources_map.h"
@ -49,8 +50,7 @@ void RegisterChromeDevToolsHandler(CefURLRequestManager* request_manager) {
request_manager->AddFactory(
content::kChromeDevToolsScheme,
kChromeDevToolsHost,
CreateInternalHandlerFactory(
make_scoped_ptr<InternalHandlerDelegate>(new Delegate())));
CreateInternalHandlerFactory(base::WrapUnique(new Delegate())));
}
} // namespace scheme

View File

@ -130,7 +130,7 @@ class InternalHandler : public CefResourceHandler {
class InternalHandlerFactory : public CefSchemeHandlerFactory {
public:
explicit InternalHandlerFactory(
scoped_ptr<InternalHandlerDelegate> delegate)
std::unique_ptr<InternalHandlerDelegate> delegate)
: delegate_(std::move(delegate)) {
}
@ -174,7 +174,7 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
}
private:
scoped_ptr<InternalHandlerDelegate> delegate_;
std::unique_ptr<InternalHandlerDelegate> delegate_;
IMPLEMENT_REFCOUNTING(InternalHandlerFactory);
};
@ -187,7 +187,7 @@ InternalHandlerDelegate::Action::Action()
}
CefRefPtr<CefSchemeHandlerFactory> CreateInternalHandlerFactory(
scoped_ptr<InternalHandlerDelegate> delegate) {
std::unique_ptr<InternalHandlerDelegate> delegate) {
DCHECK(delegate.get());
return new InternalHandlerFactory(std::move(delegate));
}

View File

@ -8,7 +8,6 @@
#include <string>
#include "include/cef_scheme.h"
#include "base/memory/scoped_ptr.h"
#include "url/gurl.h"
namespace scheme {
@ -47,7 +46,7 @@ class InternalHandlerDelegate {
// Create an internal scheme handler factory. The factory will take ownership of
// |delegate|.
CefRefPtr<CefSchemeHandlerFactory> CreateInternalHandlerFactory(
scoped_ptr<InternalHandlerDelegate> delegate);
std::unique_ptr<InternalHandlerDelegate> delegate);
} // namespace scheme

View File

@ -450,7 +450,7 @@ net::Filter* CefNetworkDelegate::SetupFilter(net::URLRequest* request,
}
if (cef_filter.get() && cef_filter->InitFilter()) {
scoped_ptr<CefResponseFilterWrapper> wrapper(
std::unique_ptr<CefResponseFilterWrapper> wrapper(
new CefResponseFilterWrapper(cef_filter, filter_list != nullptr));
wrapper->InitBuffer(kFilterBufSize);

View File

@ -49,7 +49,7 @@ void InstallInternalProtectedHandlers(
it != protocol_handlers->end();
++it) {
const std::string& scheme = it->first;
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> protocol_handler;
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler> protocol_handler;
if (scheme == content::kChromeDevToolsScheme) {
// Don't use the default "chrome-devtools" handler.

View File

@ -8,7 +8,7 @@
#include "include/cef_frame.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/browser_context.h"
#include "url/gurl.h"
namespace net {

View File

@ -19,6 +19,7 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
@ -107,7 +108,7 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
content::ProtocolHandlerMap* protocol_handlers,
scoped_ptr<net::ProxyConfigService> proxy_config_service,
std::unique_ptr<net::ProxyConfigService> proxy_config_service,
content::URLRequestInterceptorScopedVector request_interceptors)
: settings_(settings),
io_task_runner_(std::move(io_task_runner)),
@ -151,8 +152,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
SetCookieStoragePath(cache_path,
settings_.persist_session_cookies ? true : false);
storage_->set_network_delegate(
make_scoped_ptr<net::NetworkDelegate>(new CefNetworkDelegate));
storage_->set_network_delegate(base::WrapUnique(new CefNetworkDelegate));
storage_->set_channel_id_service(make_scoped_ptr(
new net::ChannelIDService(
@ -162,16 +162,15 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
const std::string& accept_language =
settings_.accept_language_list.length > 0 ?
CefString(&settings_.accept_language_list): "en-US,en";
storage_->set_http_user_agent_settings(
make_scoped_ptr<net::HttpUserAgentSettings>(
new CefHttpUserAgentSettings(accept_language)));
storage_->set_http_user_agent_settings(base::WrapUnique(
new CefHttpUserAgentSettings(accept_language)));
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));
scoped_ptr<net::ProxyService> system_proxy_service =
std::unique_ptr<net::ProxyService> system_proxy_service =
ProxyServiceFactory::CreateProxyService(
NULL,
url_request_context_.get(),
@ -200,11 +199,10 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
net::HttpAuthHandlerRegistryFactory::Create(
http_auth_preferences_.get(),
url_request_context_->host_resolver()));
storage_->set_http_server_properties(
make_scoped_ptr<net::HttpServerProperties>(
new net::HttpServerPropertiesImpl));
storage_->set_http_server_properties(base::WrapUnique(
new net::HttpServerPropertiesImpl));
scoped_ptr<net::HttpCache::DefaultBackend> main_backend(
std::unique_ptr<net::HttpCache::DefaultBackend> main_backend(
new net::HttpCache::DefaultBackend(
cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE,
net::CACHE_BACKEND_DEFAULT,
@ -228,8 +226,6 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
url_request_context_->ssl_config_service();
network_session_params.http_auth_handler_factory =
url_request_context_->http_auth_handler_factory();
network_session_params.network_delegate =
url_request_context_->network_delegate();
network_session_params.http_server_properties =
url_request_context_->http_server_properties();
network_session_params.ignore_certificate_errors =
@ -247,7 +243,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
new net::FtpNetworkLayer(network_session_params.host_resolver));
#endif
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
url_request_manager_.reset(new CefURLRequestManager(job_factory.get()));
@ -264,7 +260,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
request_interceptors_.push_back(new CefRequestInterceptor());
// Set up interceptors in the reverse order.
scoped_ptr<net::URLRequestJobFactory> top_job_factory =
std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
std::move(job_factory);
for (content::URLRequestInterceptorScopedVector::reverse_iterator i =
request_interceptors_.rbegin();
@ -334,7 +330,7 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath(
// Set the new cookie store that will be used for all new requests. The old
// cookie store, if any, will be automatically flushed and closed when no
// longer referenced.
scoped_ptr<net::CookieMonster> cookie_monster(
std::unique_ptr<net::CookieMonster> cookie_monster(
new net::CookieMonster(persistent_store.get(), NULL));
if (persistent_store.get() && persist_session_cookies)
cookie_monster->SetPersistSessionCookies(true);

View File

@ -17,8 +17,7 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/browser_context.h"
#include "net/url_request/url_request_job_factory.h"
class PrefService;
@ -49,7 +48,7 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
content::ProtocolHandlerMap* protocol_handlers,
scoped_ptr<net::ProxyConfigService> proxy_config_service,
std::unique_ptr<net::ProxyConfigService> proxy_config_service,
content::URLRequestInterceptorScopedVector request_interceptors);
~CefURLRequestContextGetterImpl() override;
@ -89,12 +88,12 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
std::string gsapi_library_name_;
#endif
scoped_ptr<net::ProxyConfigService> proxy_config_service_;
scoped_ptr<net::URLRequestContextStorage> storage_;
scoped_ptr<net::HttpAuthPreferences> http_auth_preferences_;
scoped_ptr<CefURLRequestContextImpl> url_request_context_;
scoped_ptr<CefURLRequestManager> url_request_manager_;
scoped_ptr<net::FtpTransactionFactory> ftp_transaction_factory_;
std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
std::unique_ptr<net::URLRequestContextStorage> storage_;
std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences_;
std::unique_ptr<CefURLRequestContextImpl> url_request_context_;
std::unique_ptr<CefURLRequestManager> url_request_manager_;
std::unique_ptr<net::FtpTransactionFactory> ftp_transaction_factory_;
content::ProtocolHandlerMap protocol_handlers_;
content::URLRequestInterceptorScopedVector request_interceptors_;

View File

@ -10,7 +10,6 @@
#include "libcef/browser/net/url_request_context_getter.h"
#include "libcef/browser/net/url_request_context_getter_impl.h"
#include "base/memory/scoped_ptr.h"
class CefURLRequestContextProxy;
@ -43,7 +42,7 @@ class CefURLRequestContextGetterProxy : public CefURLRequestContextGetter {
// necessary to keep it alive.
scoped_refptr<CefURLRequestContextGetterImpl> parent_;
scoped_ptr<CefURLRequestContextProxy> context_proxy_;
std::unique_ptr<CefURLRequestContextProxy> context_proxy_;
DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextGetterProxy);
};

View File

@ -9,7 +9,6 @@
#include "include/cef_request_context_handler.h"
#include "libcef/browser/net/url_request_context.h"
#include "base/memory/scoped_ptr.h"
class CefBrowserHostImpl;
class CefCookieStoreProxy;
@ -28,7 +27,7 @@ class CefURLRequestContextProxy : public CefURLRequestContext {
~CefURLRequestContextProxy() override;
private:
scoped_ptr<CefCookieStoreProxy> cookie_store_proxy_;
std::unique_ptr<CefCookieStoreProxy> cookie_store_proxy_;
DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextProxy);
};

View File

@ -14,7 +14,7 @@
#include "content/public/browser/render_view_host.h"
CefBrowserPlatformDelegateOsr::CefBrowserPlatformDelegateOsr(
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate)
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate)
: native_delegate_(std::move(native_delegate)),
view_osr_(nullptr) {
native_delegate_->set_windowless_handler(this);
@ -159,17 +159,17 @@ CefEventHandle CefBrowserPlatformDelegateOsr::GetEventHandle(
return native_delegate_->GetEventHandle(event);
}
scoped_ptr<CefFileDialogRunner>
std::unique_ptr<CefFileDialogRunner>
CefBrowserPlatformDelegateOsr::CreateFileDialogRunner() {
return native_delegate_->CreateFileDialogRunner();
}
scoped_ptr<CefJavaScriptDialogRunner>
std::unique_ptr<CefJavaScriptDialogRunner>
CefBrowserPlatformDelegateOsr::CreateJavaScriptDialogRunner() {
return native_delegate_->CreateJavaScriptDialogRunner();
}
scoped_ptr<CefMenuRunner> CefBrowserPlatformDelegateOsr::CreateMenuRunner() {
std::unique_ptr<CefMenuRunner> CefBrowserPlatformDelegateOsr::CreateMenuRunner() {
return native_delegate_->CreateMenuRunner();
}

View File

@ -47,9 +47,9 @@ class CefBrowserPlatformDelegateOsr :
int deltaX, int deltaY) const override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
scoped_ptr<CefFileDialogRunner> CreateFileDialogRunner() override;
scoped_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner() override;
scoped_ptr<CefMenuRunner> CreateMenuRunner() override;
std::unique_ptr<CefFileDialogRunner> CreateFileDialogRunner() override;
std::unique_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner() override;
std::unique_ptr<CefMenuRunner> CreateMenuRunner() override;
bool IsWindowless() const override;
bool IsViewsHosted() const override;
void WasHidden(bool hidden) override;
@ -74,14 +74,14 @@ class CefBrowserPlatformDelegateOsr :
protected:
// Platform-specific behaviors will be delegated to |native_delegate|.
explicit CefBrowserPlatformDelegateOsr(
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate);
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate);
// Returns the primary OSR host view for the underlying browser. If a
// full-screen host view currently exists then it will be returned. Otherwise,
// the main host view will be returned.
CefRenderWidgetHostViewOSR* GetOSRHostView() const;
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate_;
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate_;
CefWebContentsViewOSR* view_osr_; // Not owned by this class.
};

View File

@ -9,7 +9,7 @@
#include "libcef/browser/browser_host_impl.h"
CefBrowserPlatformDelegateOsrLinux::CefBrowserPlatformDelegateOsrLinux(
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate)
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate)
: CefBrowserPlatformDelegateOsr(std::move(native_delegate)) {
}

View File

@ -12,7 +12,7 @@ class CefBrowserPlatformDelegateOsrLinux :
public CefBrowserPlatformDelegateOsr {
public:
explicit CefBrowserPlatformDelegateOsrLinux(
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate);
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate);
// CefBrowserPlatformDelegate methods:
CefWindowHandle GetHostWindowHandle() const override;

View File

@ -11,7 +11,7 @@
class CefBrowserPlatformDelegateOsrMac : public CefBrowserPlatformDelegateOsr {
public:
explicit CefBrowserPlatformDelegateOsrMac(
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate);
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate);
// CefBrowserPlatformDelegate methods:
CefWindowHandle GetHostWindowHandle() const override;

View File

@ -10,7 +10,7 @@
#include "libcef/browser/osr/render_widget_host_view_osr.h"
CefBrowserPlatformDelegateOsrMac::CefBrowserPlatformDelegateOsrMac(
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate)
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate)
: CefBrowserPlatformDelegateOsr(std::move(native_delegate)) {
}

View File

@ -9,7 +9,7 @@
#include "libcef/browser/browser_host_impl.h"
CefBrowserPlatformDelegateOsrWin::CefBrowserPlatformDelegateOsrWin(
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate)
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate)
: CefBrowserPlatformDelegateOsr(std::move(native_delegate)) {
}

View File

@ -11,7 +11,7 @@
class CefBrowserPlatformDelegateOsrWin : public CefBrowserPlatformDelegateOsr {
public:
explicit CefBrowserPlatformDelegateOsrWin(
scoped_ptr<CefBrowserPlatformDelegateNative> native_delegate);
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate);
// CefBrowserPlatformDelegate methods:
CefWindowHandle GetHostWindowHandle() const override;

View File

@ -16,15 +16,16 @@
#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "cc/base/switches.h"
#include "cc/output/copy_output_request.h"
#include "cc/scheduler/delay_based_time_source.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/compositor/resize_lock.h"
#include "content/browser/renderer_host/dip_util.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/gpu/client/gl_helper.h"
#include "content/browser/renderer_host/resize_lock.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/context_factory.h"
@ -193,7 +194,7 @@ class CefCopyFrameGenerator {
// The below code is similar in functionality to
// DelegatedFrameHost::CopyFromCompositingSurface but we reuse the same
// SkBitmap in the GPU codepath and avoid scaling where possible.
scoped_ptr<cc::CopyOutputRequest> request =
std::unique_ptr<cc::CopyOutputRequest> request =
cc::CopyOutputRequest::CreateRequest(base::Bind(
&CefCopyFrameGenerator::CopyFromCompositingSurfaceHasResult,
weak_ptr_factory_.GetWeakPtr(),
@ -206,7 +207,7 @@ class CefCopyFrameGenerator {
void CopyFromCompositingSurfaceHasResult(
const gfx::Rect& damage_rect,
scoped_ptr<cc::CopyOutputResult> result) {
std::unique_ptr<cc::CopyOutputResult> result) {
if (result->IsEmpty() || result->size().IsEmpty() ||
!view_->render_widget_host()) {
OnCopyFrameCaptureFailure(damage_rect);
@ -224,7 +225,7 @@ class CefCopyFrameGenerator {
void PrepareTextureCopyOutputResult(
const gfx::Rect& damage_rect,
scoped_ptr<cc::CopyOutputResult> result) {
std::unique_ptr<cc::CopyOutputResult> result) {
DCHECK(result->HasTexture());
base::ScopedClosureRunner scoped_callback_runner(
base::Bind(&CefCopyFrameGenerator::OnCopyFrameCaptureFailure,
@ -254,12 +255,12 @@ class CefCopyFrameGenerator {
if (!gl_helper)
return;
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock(
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock(
new SkAutoLockPixels(*bitmap_));
uint8_t* pixels = static_cast<uint8_t*>(bitmap_->getPixels());
cc::TextureMailbox texture_mailbox;
scoped_ptr<cc::SingleReleaseCallback> release_callback;
std::unique_ptr<cc::SingleReleaseCallback> release_callback;
result->TakeTexture(&texture_mailbox, &release_callback);
DCHECK(texture_mailbox.IsTexture());
if (!texture_mailbox.IsTexture())
@ -287,10 +288,10 @@ class CefCopyFrameGenerator {
static void CopyFromCompositingSurfaceFinishedProxy(
base::WeakPtr<CefCopyFrameGenerator> generator,
scoped_ptr<cc::SingleReleaseCallback> release_callback,
std::unique_ptr<cc::SingleReleaseCallback> release_callback,
const gfx::Rect& damage_rect,
scoped_ptr<SkBitmap> bitmap,
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock,
std::unique_ptr<SkBitmap> bitmap,
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock,
bool result) {
// This method may be called after the view has been deleted.
gpu::SyncToken sync_token;
@ -315,8 +316,8 @@ class CefCopyFrameGenerator {
void CopyFromCompositingSurfaceFinished(
const gfx::Rect& damage_rect,
scoped_ptr<SkBitmap> bitmap,
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock,
std::unique_ptr<SkBitmap> bitmap,
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock,
bool result) {
// Restore ownership of the bitmap to the view.
DCHECK(!bitmap_);
@ -333,12 +334,12 @@ class CefCopyFrameGenerator {
void PrepareBitmapCopyOutputResult(
const gfx::Rect& damage_rect,
scoped_ptr<cc::CopyOutputResult> result) {
std::unique_ptr<cc::CopyOutputResult> result) {
DCHECK(result->HasBitmap());
scoped_ptr<SkBitmap> source = result->TakeBitmap();
std::unique_ptr<SkBitmap> source = result->TakeBitmap();
DCHECK(source);
if (source) {
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock(
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock(
new SkAutoLockPixels(*source));
OnCopyFrameCaptureSuccess(damage_rect, *source,
std::move(bitmap_pixels_lock));
@ -359,7 +360,7 @@ class CefCopyFrameGenerator {
void OnCopyFrameCaptureSuccess(
const gfx::Rect& damage_rect,
const SkBitmap& bitmap,
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock) {
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock) {
view_->OnPaint(damage_rect, bitmap.width(), bitmap.height(),
bitmap.getPixels());
bitmap_pixels_lock.reset();
@ -392,7 +393,7 @@ class CefCopyFrameGenerator {
bool frame_pending_;
bool frame_in_progress_;
int frame_retry_count_;
scoped_ptr<SkBitmap> bitmap_;
std::unique_ptr<SkBitmap> bitmap_;
gfx::Rect pending_damage_rect_;
base::WeakPtrFactory<CefCopyFrameGenerator> weak_ptr_factory_;
@ -434,7 +435,7 @@ class CefBeginFrameTimer : public cc::DelayBasedTimeSourceClient {
}
const base::Closure callback_;
scoped_ptr<cc::DelayBasedTimeSource> time_source_;
std::unique_ptr<cc::DelayBasedTimeSource> time_source_;
DISALLOW_COPY_AND_ASSIGN(CefBeginFrameTimer);
};
@ -639,7 +640,7 @@ void CefRenderWidgetHostViewOSR::UnlockMouse() {
void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame(
uint32_t output_surface_id,
scoped_ptr<cc::CompositorFrame> frame) {
std::unique_ptr<cc::CompositorFrame> frame) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnSwapCompositorFrame");
if (frame->metadata.root_scroll_offset != last_scroll_offset_) {
@ -731,10 +732,6 @@ void CefRenderWidgetHostViewOSR::InitAsFullscreen(
NOTREACHED() << "Fullscreen widgets are not supported in OSR";
}
void CefRenderWidgetHostViewOSR::MovePluginWindows(
const std::vector<content::WebPluginGeometry>& moves) {
}
void CefRenderWidgetHostViewOSR::UpdateCursor(
const content::WebCursor& cursor) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::UpdateCursor");
@ -791,8 +788,8 @@ void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) {
}
#if !defined(OS_MACOSX)
void CefRenderWidgetHostViewOSR::TextInputStateChanged(
const ViewHostMsg_TextInputState_Params& params) {
void CefRenderWidgetHostViewOSR::UpdateInputMethodIfNecessary(
bool text_input_state_changed) {
}
void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
@ -874,7 +871,7 @@ bool CefRenderWidgetHostViewOSR::CanCopyToVideoFrame() const {
}
void CefRenderWidgetHostViewOSR::BeginFrameSubscription(
scoped_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber) {
std::unique_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber) {
delegated_frame_host_->BeginFrameSubscription(std::move(subscriber));
}
@ -946,7 +943,8 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
content::BrowserAccessibilityManager*
CefRenderWidgetHostViewOSR::CreateBrowserAccessibilityManager(
content::BrowserAccessibilityDelegate* delegate) {
content::BrowserAccessibilityDelegate* delegate,
bool for_root_frame) {
return NULL;
}
@ -998,7 +996,7 @@ void CefRenderWidgetHostViewOSR::OnSetNeedsBeginFrames(bool enabled) {
}
}
scoped_ptr<cc::SoftwareOutputDevice>
std::unique_ptr<cc::SoftwareOutputDevice>
CefRenderWidgetHostViewOSR::CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
DCHECK_EQ(compositor_.get(), compositor);
@ -1008,7 +1006,7 @@ CefRenderWidgetHostViewOSR::CreateSoftwareOutputDevice(
compositor, transparent_,
base::Bind(&CefRenderWidgetHostViewOSR::OnPaint,
weak_ptr_factory_.GetWeakPtr()));
return make_scoped_ptr<cc::SoftwareOutputDevice>(software_output_device_);
return base::WrapUnique(software_output_device_);
}
ui::Layer* CefRenderWidgetHostViewOSR::DelegatedFrameHostGetLayer() const {
@ -1028,11 +1026,11 @@ bool CefRenderWidgetHostViewOSR::DelegatedFrameCanCreateResizeLock() const {
return !render_widget_host_->auto_resize_enabled();
}
scoped_ptr<content::ResizeLock>
std::unique_ptr<content::ResizeLock>
CefRenderWidgetHostViewOSR::DelegatedFrameHostCreateResizeLock(
bool defer_compositor_lock) {
const gfx::Size& desired_size = root_layer_->bounds().size();
return scoped_ptr<content::ResizeLock>(new CefResizeLock(
return std::unique_ptr<content::ResizeLock>(new CefResizeLock(
this,
desired_size,
defer_compositor_lock,

View File

@ -15,7 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "content/browser/compositor/delegated_frame_host.h"
#include "content/browser/renderer_host/delegated_frame_host.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "ui/compositor/compositor.h"
@ -24,7 +24,7 @@
#endif
#if defined(OS_MACOSX)
#include "content/browser/compositor/browser_compositor_view_mac.h"
#include "content/browser/renderer_host/browser_compositor_view_mac.h"
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
#endif
@ -112,8 +112,6 @@ class CefRenderWidgetHostViewOSR
#if defined(OS_MACOSX)
void SetActive(bool active) override;
void SetWindowVisibility(bool visible) override;
void WindowFrameChanged() override;
void ShowDefinitionForSelection() override;
bool SupportsSpeech() const override;
void SpeakSelection() override;
@ -124,18 +122,15 @@ class CefRenderWidgetHostViewOSR
// RenderWidgetHostViewBase implementation.
void OnSwapCompositorFrame(
uint32_t output_surface_id,
scoped_ptr<cc::CompositorFrame> frame) override;
std::unique_ptr<cc::CompositorFrame> frame) override;
void ClearCompositorFrame() override;
void InitAsPopup(content::RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) override;
void InitAsFullscreen(
content::RenderWidgetHostView* reference_host_view) override;
void MovePluginWindows(
const std::vector<content::WebPluginGeometry>& moves) override;
void UpdateCursor(const content::WebCursor& cursor) override;
void SetIsLoading(bool is_loading) override;
void TextInputStateChanged(
const ViewHostMsg_TextInputState_Params& params) override;
void UpdateInputMethodIfNecessary(bool text_input_state_changed) override;
void ImeCancelComposition() override;
void RenderProcessGone(base::TerminationStatus status,
int error_code) override;
@ -163,7 +158,7 @@ class CefRenderWidgetHostViewOSR
const base::Callback<void(const gfx::Rect&, bool)>& callback) override;
bool CanCopyToVideoFrame() const override;
void BeginFrameSubscription(
scoped_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber)
std::unique_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber)
override;
void EndFrameSubscription() override;
bool HasAcceleratedSurface(const gfx::Size& desired_size) override;
@ -172,7 +167,8 @@ class CefRenderWidgetHostViewOSR
gfx::Rect GetBoundsInRootWindow() override;
content::BrowserAccessibilityManager*
CreateBrowserAccessibilityManager(
content::BrowserAccessibilityDelegate* delegate) override;
content::BrowserAccessibilityDelegate* delegate,
bool for_root_frame) override;
void LockCompositingSurface() override;
void UnlockCompositingSurface() override;
@ -181,23 +177,12 @@ class CefRenderWidgetHostViewOSR
const SkBitmap& zoomed_bitmap) override;
#endif
#if defined(OS_MACOSX)
bool PostProcessEventForPluginIme(
const content::NativeWebKeyboardEvent& event) override;
#endif
#if defined(OS_MACOSX) || defined(USE_AURA)
void ImeCompositionRangeChanged(
const gfx::Range& range,
const std::vector<gfx::Rect>& character_bounds) override;
#endif
#if defined(OS_WIN)
void SetParentNativeViewAccessible(
gfx::NativeViewAccessible accessible_parent) override;
gfx::NativeViewId GetParentForWindowlessPlugin() const override;
#endif
#if defined(OS_MACOSX)
// AcceleratedWidgetMacNSView implementation.
NSView* AcceleratedWidgetGetNSView() const override;
@ -212,7 +197,7 @@ class CefRenderWidgetHostViewOSR
void OnSetNeedsBeginFrames(bool enabled);
// ui::CompositorDelegate implementation.
scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
ui::Compositor* compositor) override;
// DelegatedFrameHostClient implementation.
@ -220,7 +205,7 @@ class CefRenderWidgetHostViewOSR
bool DelegatedFrameHostIsVisible() const override;
gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override;
bool DelegatedFrameCanCreateResizeLock() const override;
scoped_ptr<content::ResizeLock> DelegatedFrameHostCreateResizeLock(
std::unique_ptr<content::ResizeLock> DelegatedFrameHostCreateResizeLock(
bool defer_compositor_lock) override;
void DelegatedFrameHostResizeLockWasReleased() override;
void DelegatedFrameHostSendCompositorSwapAck(
@ -341,32 +326,32 @@ class CefRenderWidgetHostViewOSR
float scale_factor_;
int frame_rate_threshold_ms_;
scoped_ptr<content::DelegatedFrameHost> delegated_frame_host_;
scoped_ptr<ui::Compositor> compositor_;
std::unique_ptr<content::DelegatedFrameHost> delegated_frame_host_;
std::unique_ptr<ui::Compositor> compositor_;
gfx::AcceleratedWidget compositor_widget_;
scoped_ptr<ui::Layer> root_layer_;
std::unique_ptr<ui::Layer> root_layer_;
#if defined(OS_WIN)
scoped_ptr<gfx::WindowImpl> window_;
std::unique_ptr<gfx::WindowImpl> window_;
#elif defined(OS_MACOSX)
NSWindow* window_;
CALayer* background_layer_;
scoped_ptr<content::BrowserCompositorMac> browser_compositor_;
std::unique_ptr<content::BrowserCompositorMac> browser_compositor_;
#elif defined(USE_X11)
CefWindowX11* window_;
scoped_ptr<ui::XScopedCursor> invisible_cursor_;
std::unique_ptr<ui::XScopedCursor> invisible_cursor_;
#endif
// Used to control the VSync rate in subprocesses when BeginFrame scheduling
// is enabled.
scoped_ptr<CefBeginFrameTimer> begin_frame_timer_;
std::unique_ptr<CefBeginFrameTimer> begin_frame_timer_;
// Used for direct rendering from the compositor when GPU compositing is
// disabled. This object is owned by the compositor.
CefSoftwareOutputDeviceOSR* software_output_device_;
// Used for managing copy requests when GPU compositing is enabled.
scoped_ptr<CefCopyFrameGenerator> copy_frame_generator_;
std::unique_ptr<CefCopyFrameGenerator> copy_frame_generator_;
bool hold_resize_;
bool pending_resize_;

View File

@ -33,16 +33,6 @@ CefTextInputClientOSRMac* GetInputClientFromContext(
void CefRenderWidgetHostViewOSR::SetActive(bool active) {
}
void CefRenderWidgetHostViewOSR::SetWindowVisibility(bool visible) {
if (visible)
Hide();
else
Show();
}
void CefRenderWidgetHostViewOSR::WindowFrameChanged() {
}
void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {
}
@ -60,8 +50,8 @@ bool CefRenderWidgetHostViewOSR::IsSpeaking() const {
void CefRenderWidgetHostViewOSR::StopSpeaking() {
}
void CefRenderWidgetHostViewOSR::TextInputStateChanged(
const ViewHostMsg_TextInputState_Params& params) {
void CefRenderWidgetHostViewOSR::UpdateInputMethodIfNecessary(
bool text_input_state_changed) {
[NSApp updateWindows];
}
@ -72,11 +62,6 @@ void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
[client cancelComposition];
}
bool CefRenderWidgetHostViewOSR::PostProcessEventForPluginIme(
const content::NativeWebKeyboardEvent& event) {
return false;
}
void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged(
const gfx::Range& range,
const std::vector<gfx::Rect>& character_bounds) {

View File

@ -143,19 +143,6 @@ bool IsSystemCursorID(LPCWSTR cursor_id) {
} // namespace
void CefRenderWidgetHostViewOSR::SetParentNativeViewAccessible(
gfx::NativeViewAccessible accessible_parent) {
}
gfx::NativeViewId
CefRenderWidgetHostViewOSR::GetParentForWindowlessPlugin() const {
if (browser_impl_.get()) {
return reinterpret_cast<gfx::NativeViewId>(
browser_impl_->GetWindowHandle());
}
return NULL;
}
void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
DCHECK(!window_);
window_.reset(new CefCompositorHostWin());

View File

@ -7,7 +7,6 @@
#define CEF_LIBCEF_BROWSER_OSR_SOFTWARE_OUTPUT_DEVICE_OSR_H_
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "cc/output/software_output_device.h"
namespace ui {
@ -45,8 +44,8 @@ class CefSoftwareOutputDeviceOSR : public cc::SoftwareOutputDevice {
const OnPaintCallback callback_;
bool active_;
scoped_ptr<SkCanvas> canvas_;
scoped_ptr<SkBitmap> bitmap_;
std::unique_ptr<SkCanvas> canvas_;
std::unique_ptr<SkBitmap> bitmap_;
gfx::Rect pending_damage_rect_;
DISALLOW_COPY_AND_ASSIGN(CefSoftwareOutputDeviceOSR);

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