Adapt to changes of Chrome 51 API changes

This commit is contained in:
Cheng Zhao 2016-05-23 10:59:07 +09:00
parent e7be3d0ef9
commit 851ef398fb
39 changed files with 157 additions and 196 deletions

View file

@ -68,16 +68,6 @@ content::BrowserMainParts* BrowserClient::CreateBrowserMainParts(
return browser_main_parts_; return browser_main_parts_;
} }
net::URLRequestContextGetter* BrowserClient::CreateRequestContext(
content::BrowserContext* browser_context,
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector protocol_interceptors) {
auto context = static_cast<BrowserContext*>(browser_context);
return context->CreateRequestContext(static_cast<NetLog*>(GetNetLog()),
protocol_handlers,
std::move(protocol_interceptors));
}
content::MediaObserver* BrowserClient::GetMediaObserver() { content::MediaObserver* BrowserClient::GetMediaObserver() {
return MediaCaptureDevicesDispatcher::GetInstance(); return MediaCaptureDevicesDispatcher::GetInstance();
} }
@ -94,10 +84,6 @@ void BrowserClient::GetAdditionalAllowedSchemesForFileSystem(
additional_schemes->push_back(content::kChromeUIScheme); additional_schemes->push_back(content::kChromeUIScheme);
} }
net::NetLog* BrowserClient::GetNetLog() {
return &net_log_;
}
base::FilePath BrowserClient::GetDefaultDownloadDirectory() { base::FilePath BrowserClient::GetDefaultDownloadDirectory() {
// ~/Downloads // ~/Downloads
base::FilePath path; base::FilePath path;

View file

@ -5,14 +5,13 @@
#ifndef BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_ #ifndef BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_
#define BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_ #define BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_
#include "browser/net_log.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
namespace brightray { namespace brightray {
class BrowserContext; class BrowserContext;
class BrowserMainParts; class BrowserMainParts;
class NetLog;
class NotificationPresenter; class NotificationPresenter;
class PlatformNotificationService; class PlatformNotificationService;
@ -43,26 +42,20 @@ class BrowserClient : public content::ContentBrowserClient {
// Subclasses that override this (e.g., to provide their own protocol // Subclasses that override this (e.g., to provide their own protocol
// handlers) should call this implementation after doing their own work. // handlers) should call this implementation after doing their own work.
net::URLRequestContextGetter* CreateRequestContext(
content::BrowserContext* browser_context,
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector protocol_interceptors) override;
content::BrowserMainParts* CreateBrowserMainParts( content::BrowserMainParts* CreateBrowserMainParts(
const content::MainFunctionParams&) override; const content::MainFunctionParams&) override;
content::MediaObserver* GetMediaObserver() override; content::MediaObserver* GetMediaObserver() override;
content::PlatformNotificationService* GetPlatformNotificationService() override; content::PlatformNotificationService* GetPlatformNotificationService() override;
void GetAdditionalAllowedSchemesForFileSystem( void GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_schemes) override; std::vector<std::string>* additional_schemes) override;
net::NetLog* GetNetLog() override;
base::FilePath GetDefaultDownloadDirectory() override; base::FilePath GetDefaultDownloadDirectory() override;
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
BrowserMainParts* browser_main_parts_; BrowserMainParts* browser_main_parts_;
NetLog net_log_;
private: private:
scoped_ptr<PlatformNotificationService> notification_service_; std::unique_ptr<PlatformNotificationService> notification_service_;
scoped_ptr<NotificationPresenter> notification_presenter_; std::unique_ptr<NotificationPresenter> notification_presenter_;
DISALLOW_COPY_AND_ASSIGN(BrowserClient); DISALLOW_COPY_AND_ASSIGN(BrowserClient);
}; };

View file

@ -64,16 +64,16 @@ class BrowserContext::ResourceContext : public content::ResourceContext {
return getter_->GetURLRequestContext(); return getter_->GetURLRequestContext();
} }
scoped_ptr<net::ClientCertStore> CreateClientCertStore() override { std::unique_ptr<net::ClientCertStore> CreateClientCertStore() override {
#if defined(USE_NSS_CERTS) #if defined(USE_NSS_CERTS)
return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS( return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(
net::ClientCertStoreNSS::PasswordDelegateFactory())); net::ClientCertStoreNSS::PasswordDelegateFactory()));
#elif defined(OS_WIN) #elif defined(OS_WIN)
return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreWin()); return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreMac()); return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
#elif defined(USE_OPENSSL) #elif defined(USE_OPENSSL)
return scoped_ptr<net::ClientCertStore>(); return std::unique_ptr<net::ClientCertStore>();
#endif #endif
} }
@ -137,14 +137,13 @@ void BrowserContext::RegisterInternalPrefs(PrefRegistrySimple* registry) {
} }
net::URLRequestContextGetter* BrowserContext::CreateRequestContext( net::URLRequestContextGetter* BrowserContext::CreateRequestContext(
NetLog* net_log,
content::ProtocolHandlerMap* protocol_handlers, content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector protocol_interceptors) { content::URLRequestInterceptorScopedVector protocol_interceptors) {
DCHECK(!url_request_getter_.get()); DCHECK(!url_request_getter_.get());
url_request_getter_ = new URLRequestContextGetter( url_request_getter_ = new URLRequestContextGetter(
this, this,
network_controller_handle(), network_controller_handle(),
net_log, net_log_,
GetPath(), GetPath(),
in_memory_, in_memory_,
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
@ -163,9 +162,9 @@ base::FilePath BrowserContext::GetPath() const {
return path_; return path_;
} }
scoped_ptr<content::ZoomLevelDelegate> BrowserContext::CreateZoomLevelDelegate( std::unique_ptr<content::ZoomLevelDelegate> BrowserContext::CreateZoomLevelDelegate(
const base::FilePath& partition_path) { const base::FilePath& partition_path) {
return scoped_ptr<content::ZoomLevelDelegate>(); return std::unique_ptr<content::ZoomLevelDelegate>();
} }
bool BrowserContext::IsOffTheRecord() const { bool BrowserContext::IsOffTheRecord() const {
@ -176,11 +175,6 @@ net::URLRequestContextGetter* BrowserContext::GetRequestContext() {
return GetDefaultStoragePartition(this)->GetURLRequestContext(); return GetDefaultStoragePartition(this)->GetURLRequestContext();
} }
net::URLRequestContextGetter* BrowserContext::GetRequestContextForRenderProcess(
int renderer_child_id) {
return GetRequestContext();
}
net::URLRequestContextGetter* BrowserContext::GetMediaRequestContext() { net::URLRequestContextGetter* BrowserContext::GetMediaRequestContext() {
return GetRequestContext(); return GetRequestContext();
} }

View file

@ -7,6 +7,7 @@
#include <map> #include <map>
#include "browser/net_log.h"
#include "browser/net/devtools_network_controller_handle.h" #include "browser/net/devtools_network_controller_handle.h"
#include "browser/permission_manager.h" #include "browser/permission_manager.h"
#include "browser/url_request_context_getter.h" #include "browser/url_request_context_getter.h"
@ -24,6 +25,7 @@ class SpecialStoragePolicy;
namespace brightray { namespace brightray {
class NetLog;
class PermissionManager; class PermissionManager;
class BrowserContext : public base::RefCounted<BrowserContext>, class BrowserContext : public base::RefCounted<BrowserContext>,
@ -39,12 +41,10 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
const std::string& partition, bool in_memory); const std::string& partition, bool in_memory);
// content::BrowserContext: // content::BrowserContext:
scoped_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate( std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
const base::FilePath& partition_path) override; const base::FilePath& partition_path) override;
bool IsOffTheRecord() const override; bool IsOffTheRecord() const override;
net::URLRequestContextGetter* GetRequestContext() override; net::URLRequestContextGetter* GetRequestContext() override;
net::URLRequestContextGetter* GetRequestContextForRenderProcess(
int renderer_child_id) override;
net::URLRequestContextGetter* GetMediaRequestContext() override; net::URLRequestContextGetter* GetMediaRequestContext() override;
net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
int renderer_child_id) override; int renderer_child_id) override;
@ -58,11 +58,9 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
content::PermissionManager* GetPermissionManager() override; content::PermissionManager* GetPermissionManager() override;
content::BackgroundSyncController* GetBackgroundSyncController() override; content::BackgroundSyncController* GetBackgroundSyncController() override;
net::URLRequestContextGetter* CreateRequestContext( net::URLRequestContextGetter* CreateRequestContext(
NetLog* net_log,
content::ProtocolHandlerMap* protocol_handlers, content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector protocol_interceptors); content::URLRequestInterceptorScopedVector request_interceptors) override;
net::URLRequestContextGetter* url_request_context_getter() const { net::URLRequestContextGetter* url_request_context_getter() const {
return url_request_getter_.get(); return url_request_getter_.get();
@ -119,12 +117,13 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
bool in_memory_; bool in_memory_;
DevToolsNetworkControllerHandle network_controller_handle_; DevToolsNetworkControllerHandle network_controller_handle_;
NetLog net_log_;
scoped_ptr<ResourceContext> resource_context_; std::unique_ptr<ResourceContext> resource_context_;
scoped_refptr<URLRequestContextGetter> url_request_getter_; scoped_refptr<URLRequestContextGetter> url_request_getter_;
scoped_refptr<storage::SpecialStoragePolicy> storage_policy_; scoped_refptr<storage::SpecialStoragePolicy> storage_policy_;
scoped_ptr<PrefService> prefs_; std::unique_ptr<PrefService> prefs_;
scoped_ptr<PermissionManager> permission_manager_; std::unique_ptr<PermissionManager> permission_manager_;
base::WeakPtrFactory<BrowserContext> weak_factory_; base::WeakPtrFactory<BrowserContext> weak_factory_;

View file

@ -76,7 +76,7 @@ void OverrideLinuxAppDataPath() {
base::FilePath path; base::FilePath path;
if (PathService::Get(DIR_APP_DATA, &path)) if (PathService::Get(DIR_APP_DATA, &path))
return; return;
scoped_ptr<base::Environment> env(base::Environment::Create()); std::unique_ptr<base::Environment> env(base::Environment::Create());
path = base::nix::GetXDGDirectory(env.get(), path = base::nix::GetXDGDirectory(env.get(),
base::nix::kXdgConfigHomeEnvVar, base::nix::kXdgConfigHomeEnvVar,
base::nix::kDotConfigDir); base::nix::kDotConfigDir);

View file

@ -7,7 +7,6 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/browser_main_parts.h" #include "content/public/browser/browser_main_parts.h"
namespace devtools_http_handler { namespace devtools_http_handler {
@ -53,14 +52,14 @@ class BrowserMainParts : public content::BrowserMainParts {
#endif #endif
scoped_refptr<BrowserContext> browser_context_; scoped_refptr<BrowserContext> browser_context_;
scoped_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_; std::unique_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_;
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS)
scoped_ptr<ViewsDelegate> views_delegate_; std::unique_ptr<ViewsDelegate> views_delegate_;
#endif #endif
#if defined(USE_AURA) && defined(USE_X11) #if defined(USE_AURA) && defined(USE_X11)
scoped_ptr<wm::WMState> wm_state_; std::unique_ptr<wm::WMState> wm_state_;
#endif #endif
DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);

View file

@ -45,11 +45,11 @@ class TCPServerSocketFactory
private: private:
// content::DevToolsHttpHandler::ServerSocketFactory. // content::DevToolsHttpHandler::ServerSocketFactory.
scoped_ptr<net::ServerSocket> CreateForHttpServer() override { std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
scoped_ptr<net::ServerSocket> socket( std::unique_ptr<net::ServerSocket> socket(
new net::TCPServerSocket(nullptr, net::NetLog::Source())); new net::TCPServerSocket(nullptr, net::NetLog::Source()));
if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK) if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK)
return scoped_ptr<net::ServerSocket>(); return std::unique_ptr<net::ServerSocket>();
return socket; return socket;
} }
@ -60,7 +60,7 @@ class TCPServerSocketFactory
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
}; };
scoped_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory> std::unique_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>
CreateSocketFactory() { CreateSocketFactory() {
auto& command_line = *base::CommandLine::ForCurrentProcess(); auto& command_line = *base::CommandLine::ForCurrentProcess();
// See if the user specified a port on the command line (useful for // See if the user specified a port on the command line (useful for
@ -77,7 +77,7 @@ CreateSocketFactory() {
DLOG(WARNING) << "Invalid http debugger port number " << temp_port; DLOG(WARNING) << "Invalid http debugger port number " << temp_port;
} }
} }
return scoped_ptr< return std::unique_ptr<
devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>( devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>(
new TCPServerSocketFactory("127.0.0.1", port)); new TCPServerSocketFactory("127.0.0.1", port));
} }

View file

@ -34,7 +34,7 @@ class DevToolsManagerDelegate : public content::DevToolsManagerDelegate {
base::DictionaryValue* command) override; base::DictionaryValue* command) override;
private: private:
scoped_ptr<DevToolsNetworkProtocolHandler> handler_; std::unique_ptr<DevToolsNetworkProtocolHandler> handler_;
DISALLOW_COPY_AND_ASSIGN(DevToolsManagerDelegate); DISALLOW_COPY_AND_ASSIGN(DevToolsManagerDelegate);
}; };

View file

@ -190,7 +190,7 @@ InspectableWebContentsView* CreateInspectableContentsView(
InspectableWebContentsImpl* inspectable_web_contents_impl); InspectableWebContentsImpl* inspectable_web_contents_impl);
void InspectableWebContentsImpl::RegisterPrefs(PrefRegistrySimple* registry) { void InspectableWebContentsImpl::RegisterPrefs(PrefRegistrySimple* registry) {
auto bounds_dict = make_scoped_ptr(new base::DictionaryValue); auto bounds_dict = make_std::unique_ptr(new base::DictionaryValue);
RectToDictionary(gfx::Rect(0, 0, 800, 600), bounds_dict.get()); RectToDictionary(gfx::Rect(0, 0, 800, 600), bounds_dict.get());
registry->RegisterDictionaryPref(kDevToolsBoundsPref, bounds_dict.release()); registry->RegisterDictionaryPref(kDevToolsBoundsPref, bounds_dict.release());
registry->RegisterDoublePref(kDevToolsZoomPref, 0.); registry->RegisterDoublePref(kDevToolsZoomPref, 0.);
@ -412,7 +412,7 @@ void InspectableWebContentsImpl::LoadNetworkResource(
pending_requests_[fetcher] = callback; pending_requests_[fetcher] = callback;
fetcher->SetRequestContext(browser_context->url_request_context_getter()); fetcher->SetRequestContext(browser_context->url_request_context_getter());
fetcher->SetExtraRequestHeaders(headers); fetcher->SetExtraRequestHeaders(headers);
fetcher->SaveResponseWithWriter(scoped_ptr<net::URLFetcherResponseWriter>( fetcher->SaveResponseWithWriter(std::unique_ptr<net::URLFetcherResponseWriter>(
new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id)));
fetcher->Start(); fetcher->Start();
} }
@ -562,7 +562,7 @@ void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend(const std::st
base::ListValue* params = &empty_params; base::ListValue* params = &empty_params;
base::DictionaryValue* dict = nullptr; base::DictionaryValue* dict = nullptr;
scoped_ptr<base::Value> parsed_message(base::JSONReader::Read(message)); std::unique_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
if (!parsed_message || if (!parsed_message ||
!parsed_message->GetAsDictionary(&dict) || !parsed_message->GetAsDictionary(&dict) ||
!dict->GetString(kFrontendHostMethod, &method) || !dict->GetString(kFrontendHostMethod, &method) ||

View file

@ -162,8 +162,8 @@ class InspectableWebContentsImpl :
bool frontend_loaded_; bool frontend_loaded_;
scoped_refptr<content::DevToolsAgentHost> agent_host_; scoped_refptr<content::DevToolsAgentHost> agent_host_;
scoped_ptr<content::DevToolsFrontendHost> frontend_host_; std::unique_ptr<content::DevToolsFrontendHost> frontend_host_;
scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; std::unique_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_;
DevToolsContentsResizingStrategy contents_resizing_strategy_; DevToolsContentsResizingStrategy contents_resizing_strategy_;
gfx::Rect devtools_bounds_; gfx::Rect devtools_bounds_;
@ -176,9 +176,9 @@ class InspectableWebContentsImpl :
PrefService* pref_service_; // weak reference. PrefService* pref_service_; // weak reference.
scoped_ptr<content::WebContents> web_contents_; std::unique_ptr<content::WebContents> web_contents_;
scoped_ptr<content::WebContents> devtools_web_contents_; std::unique_ptr<content::WebContents> devtools_web_contents_;
scoped_ptr<InspectableWebContentsView> view_; std::unique_ptr<InspectableWebContentsView> view_;
base::WeakPtrFactory<InspectableWebContentsImpl> weak_factory_; base::WeakPtrFactory<InspectableWebContentsImpl> weak_factory_;

View file

@ -8,7 +8,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#include "browser/notification.h" #include "browser/notification.h"
namespace brightray { namespace brightray {

View file

@ -6,7 +6,6 @@
#define BRIGHTRAY_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ #define BRIGHTRAY_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
#include "base/callback.h" #include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "content/public/browser/media_observer.h" #include "content/public/browser/media_observer.h"
#include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_delegate.h"

View file

@ -43,7 +43,7 @@ MediaStreamDevicesController::~MediaStreamDevicesController() {
if (!callback_.is_null()) { if (!callback_.is_null()) {
callback_.Run(content::MediaStreamDevices(), callback_.Run(content::MediaStreamDevices(),
content::MEDIA_DEVICE_INVALID_STATE, content::MEDIA_DEVICE_INVALID_STATE,
scoped_ptr<content::MediaStreamUI>()); std::unique_ptr<content::MediaStreamUI>());
} }
} }
@ -146,7 +146,7 @@ void MediaStreamDevicesController::Accept() {
content::MediaResponseCallback cb = callback_; content::MediaResponseCallback cb = callback_;
callback_.Reset(); callback_.Reset();
cb.Run(devices, content::MEDIA_DEVICE_OK, scoped_ptr<content::MediaStreamUI>()); cb.Run(devices, content::MEDIA_DEVICE_OK, std::unique_ptr<content::MediaStreamUI>());
} }
void MediaStreamDevicesController::Deny(content::MediaStreamRequestResult result) { void MediaStreamDevicesController::Deny(content::MediaStreamRequestResult result) {
@ -154,7 +154,7 @@ void MediaStreamDevicesController::Deny(content::MediaStreamRequestResult result
callback_.Reset(); callback_.Reset();
cb.Run(content::MediaStreamDevices(), cb.Run(content::MediaStreamDevices(),
result, result,
scoped_ptr<content::MediaStreamUI>()); std::unique_ptr<content::MediaStreamUI>());
} }
void MediaStreamDevicesController::HandleUserMediaRequest() { void MediaStreamDevicesController::HandleUserMediaRequest() {
@ -194,7 +194,7 @@ void MediaStreamDevicesController::HandleUserMediaRequest() {
cb.Run(devices, cb.Run(devices,
devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE :
content::MEDIA_DEVICE_OK, content::MEDIA_DEVICE_OK,
scoped_ptr<content::MediaStreamUI>()); std::unique_ptr<content::MediaStreamUI>());
} }
} // namespace brightray } // namespace brightray

View file

@ -24,20 +24,20 @@ DevToolsNetworkController::~DevToolsNetworkController() {
void DevToolsNetworkController::SetNetworkState( void DevToolsNetworkController::SetNetworkState(
const std::string& client_id, const std::string& client_id,
scoped_ptr<DevToolsNetworkConditions> conditions) { std::unique_ptr<DevToolsNetworkConditions> conditions) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
DevToolsNetworkInterceptor* interceptor = interceptors_.get(client_id); DevToolsNetworkInterceptor* interceptor = interceptors_.get(client_id);
if (!interceptor) { if (!interceptor) {
if (!conditions) if (!conditions)
return; return;
scoped_ptr<DevToolsNetworkInterceptor> new_interceptor( std::unique_ptr<DevToolsNetworkInterceptor> new_interceptor(
new DevToolsNetworkInterceptor); new DevToolsNetworkInterceptor);
new_interceptor->UpdateConditions(std::move(conditions)); new_interceptor->UpdateConditions(std::move(conditions));
interceptors_.set(client_id, std::move(new_interceptor)); interceptors_.set(client_id, std::move(new_interceptor));
} else { } else {
if (!conditions) { if (!conditions) {
scoped_ptr<DevToolsNetworkConditions> online_conditions( std::unique_ptr<DevToolsNetworkConditions> online_conditions(
new DevToolsNetworkConditions(false)); new DevToolsNetworkConditions(false));
interceptor->UpdateConditions(std::move(online_conditions)); interceptor->UpdateConditions(std::move(online_conditions));
interceptors_.erase(client_id); interceptors_.erase(client_id);
@ -57,7 +57,7 @@ void DevToolsNetworkController::SetNetworkState(
bool is_appcache_offline = appcache_interceptor_->IsOffline(); bool is_appcache_offline = appcache_interceptor_->IsOffline();
if (is_appcache_offline != has_offline_interceptors) { if (is_appcache_offline != has_offline_interceptors) {
scoped_ptr<DevToolsNetworkConditions> appcache_conditions( std::unique_ptr<DevToolsNetworkConditions> appcache_conditions(
new DevToolsNetworkConditions(has_offline_interceptors)); new DevToolsNetworkConditions(has_offline_interceptors));
appcache_interceptor_->UpdateConditions(std::move(appcache_conditions)); appcache_interceptor_->UpdateConditions(std::move(appcache_conditions));
} }

View file

@ -7,7 +7,6 @@
#include "base/containers/scoped_ptr_hash_map.h" #include "base/containers/scoped_ptr_hash_map.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_ptr.h"
namespace brightray { namespace brightray {
@ -21,14 +20,14 @@ class DevToolsNetworkController {
virtual ~DevToolsNetworkController(); virtual ~DevToolsNetworkController();
void SetNetworkState(const std::string& client_id, void SetNetworkState(const std::string& client_id,
scoped_ptr<DevToolsNetworkConditions> conditions); std::unique_ptr<DevToolsNetworkConditions> conditions);
DevToolsNetworkInterceptor* GetInterceptor(const std::string& client_id); DevToolsNetworkInterceptor* GetInterceptor(const std::string& client_id);
private: private:
using InterceptorMap = base::ScopedPtrHashMap<std::string, using InterceptorMap = base::ScopedPtrHashMap<std::string,
scoped_ptr<DevToolsNetworkInterceptor>>; std::unique_ptr<DevToolsNetworkInterceptor>>;
scoped_ptr<DevToolsNetworkInterceptor> appcache_interceptor_; std::unique_ptr<DevToolsNetworkInterceptor> appcache_interceptor_;
InterceptorMap interceptors_; InterceptorMap interceptors_;
DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkController); DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkController);

View file

@ -25,7 +25,7 @@ DevToolsNetworkControllerHandle::~DevToolsNetworkControllerHandle() {
void DevToolsNetworkControllerHandle::SetNetworkState( void DevToolsNetworkControllerHandle::SetNetworkState(
const std::string& client_id, const std::string& client_id,
scoped_ptr<DevToolsNetworkConditions> conditions) { std::unique_ptr<DevToolsNetworkConditions> conditions) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BrowserThread::PostTask( BrowserThread::PostTask(
@ -50,7 +50,7 @@ void DevToolsNetworkControllerHandle::LazyInitialize() {
void DevToolsNetworkControllerHandle::SetNetworkStateOnIO( void DevToolsNetworkControllerHandle::SetNetworkStateOnIO(
const std::string& client_id, const std::string& client_id,
scoped_ptr<DevToolsNetworkConditions> conditions) { std::unique_ptr<DevToolsNetworkConditions> conditions) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
LazyInitialize(); LazyInitialize();

View file

@ -8,7 +8,6 @@
#include <string> #include <string>
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_ptr.h"
namespace brightray { namespace brightray {
@ -24,7 +23,7 @@ class DevToolsNetworkControllerHandle {
// Called on the UI thread. // Called on the UI thread.
void SetNetworkState(const std::string& client_id, void SetNetworkState(const std::string& client_id,
scoped_ptr<DevToolsNetworkConditions> conditions); std::unique_ptr<DevToolsNetworkConditions> conditions);
// Called on the IO thread. // Called on the IO thread.
DevToolsNetworkController* GetController(); DevToolsNetworkController* GetController();
@ -32,9 +31,9 @@ class DevToolsNetworkControllerHandle {
private: private:
void LazyInitialize(); void LazyInitialize();
void SetNetworkStateOnIO(const std::string& client_id, void SetNetworkStateOnIO(const std::string& client_id,
scoped_ptr<DevToolsNetworkConditions> conditions); std::unique_ptr<DevToolsNetworkConditions> conditions);
scoped_ptr<DevToolsNetworkController> controller_; std::unique_ptr<DevToolsNetworkController> controller_;
DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkControllerHandle); DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkControllerHandle);
}; };

View file

@ -66,7 +66,7 @@ void DevToolsNetworkInterceptor::FinishRecords(
} }
void DevToolsNetworkInterceptor::UpdateConditions( void DevToolsNetworkInterceptor::UpdateConditions(
scoped_ptr<DevToolsNetworkConditions> conditions) { std::unique_ptr<DevToolsNetworkConditions> conditions) {
DCHECK(conditions); DCHECK(conditions);
base::TimeTicks now = base::TimeTicks::Now(); base::TimeTicks now = base::TimeTicks::Now();
if (conditions_->IsThrottling()) if (conditions_->IsThrottling())

View file

@ -10,7 +10,6 @@
#include <vector> #include <vector>
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
namespace base { namespace base {
@ -33,7 +32,7 @@ class DevToolsNetworkInterceptor {
base::WeakPtr<DevToolsNetworkInterceptor> GetWeakPtr(); base::WeakPtr<DevToolsNetworkInterceptor> GetWeakPtr();
// Applies network emulation configuration. // Applies network emulation configuration.
void UpdateConditions(scoped_ptr<DevToolsNetworkConditions> conditions); void UpdateConditions(std::unique_ptr<DevToolsNetworkConditions> conditions);
// Throttles with |is_upload == true| always succeed, even in offline mode. // Throttles with |is_upload == true| always succeed, even in offline mode.
int StartThrottle(int result, int StartThrottle(int result,
@ -81,7 +80,7 @@ class DevToolsNetworkInterceptor {
void RemoveRecord(ThrottleRecords* records, const ThrottleCallback& callback); void RemoveRecord(ThrottleRecords* records, const ThrottleCallback& callback);
scoped_ptr<DevToolsNetworkConditions> conditions_; std::unique_ptr<DevToolsNetworkConditions> conditions_;
// Throttables suspended for a "latency" period. // Throttables suspended for a "latency" period.
ThrottleRecords suspended_; ThrottleRecords suspended_;

View file

@ -59,17 +59,17 @@ bool ParseCommand(const base::DictionaryValue* command,
return true; return true;
} }
scoped_ptr<base::DictionaryValue> std::unique_ptr<base::DictionaryValue>
CreateSuccessResponse(int id, scoped_ptr<base::DictionaryValue> result) { CreateSuccessResponse(int id, std::unique_ptr<base::DictionaryValue> result) {
scoped_ptr<base::DictionaryValue> response(new base::DictionaryValue); std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue);
response->SetInteger(kId, id); response->SetInteger(kId, id);
response->Set(params::kResult, result.release()); response->Set(params::kResult, result.release());
return response; return response;
} }
scoped_ptr<base::DictionaryValue> std::unique_ptr<base::DictionaryValue>
CreateFailureResponse(int id, const std::string& param) { CreateFailureResponse(int id, const std::string& param) {
scoped_ptr<base::DictionaryValue> response(new base::DictionaryValue); std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue);
auto error_object = new base::DictionaryValue; auto error_object = new base::DictionaryValue;
response->Set(kError, error_object); response->Set(kError, error_object);
error_object->SetInteger(params::kErrorCode, kErrorInvalidParams); error_object->SetInteger(params::kErrorCode, kErrorInvalidParams);
@ -108,23 +108,23 @@ base::DictionaryValue* DevToolsNetworkProtocolHandler::HandleCommand(
void DevToolsNetworkProtocolHandler::DevToolsAgentStateChanged( void DevToolsNetworkProtocolHandler::DevToolsAgentStateChanged(
content::DevToolsAgentHost* agent_host, content::DevToolsAgentHost* agent_host,
bool attached) { bool attached) {
scoped_ptr<DevToolsNetworkConditions> conditions; std::unique_ptr<DevToolsNetworkConditions> conditions;
if (attached) if (attached)
conditions.reset(new DevToolsNetworkConditions(false)); conditions.reset(new DevToolsNetworkConditions(false));
UpdateNetworkState(agent_host, std::move(conditions)); UpdateNetworkState(agent_host, std::move(conditions));
} }
scoped_ptr<base::DictionaryValue> std::unique_ptr<base::DictionaryValue>
DevToolsNetworkProtocolHandler::CanEmulateNetworkConditions( DevToolsNetworkProtocolHandler::CanEmulateNetworkConditions(
content::DevToolsAgentHost* agent_host, content::DevToolsAgentHost* agent_host,
int id, int id,
const base::DictionaryValue* params) { const base::DictionaryValue* params) {
scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue); std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue);
result->SetBoolean(params::kResult, true); result->SetBoolean(params::kResult, true);
return CreateSuccessResponse(id, std::move(result)); return CreateSuccessResponse(id, std::move(result));
} }
scoped_ptr<base::DictionaryValue> std::unique_ptr<base::DictionaryValue>
DevToolsNetworkProtocolHandler::EmulateNetworkConditions( DevToolsNetworkProtocolHandler::EmulateNetworkConditions(
content::DevToolsAgentHost* agent_host, content::DevToolsAgentHost* agent_host,
int id, int id,
@ -151,18 +151,18 @@ DevToolsNetworkProtocolHandler::EmulateNetworkConditions(
if (upload_throughput < 0.0) if (upload_throughput < 0.0)
upload_throughput = 0.0; upload_throughput = 0.0;
scoped_ptr<DevToolsNetworkConditions> conditions( std::unique_ptr<DevToolsNetworkConditions> conditions(
new DevToolsNetworkConditions(offline, new DevToolsNetworkConditions(offline,
latency, latency,
download_throughput, download_throughput,
upload_throughput)); upload_throughput));
UpdateNetworkState(agent_host, std::move(conditions)); UpdateNetworkState(agent_host, std::move(conditions));
return scoped_ptr<base::DictionaryValue>(); return std::unique_ptr<base::DictionaryValue>();
} }
void DevToolsNetworkProtocolHandler::UpdateNetworkState( void DevToolsNetworkProtocolHandler::UpdateNetworkState(
content::DevToolsAgentHost* agent_host, content::DevToolsAgentHost* agent_host,
scoped_ptr<DevToolsNetworkConditions> conditions) { std::unique_ptr<DevToolsNetworkConditions> conditions) {
auto browser_context = auto browser_context =
static_cast<brightray::BrowserContext*>(agent_host->GetBrowserContext()); static_cast<brightray::BrowserContext*>(agent_host->GetBrowserContext());
browser_context->network_controller_handle()->SetNetworkState( browser_context->network_controller_handle()->SetNetworkState(

View file

@ -6,7 +6,6 @@
#define BROWSER_DEVTOOLS_NETWORK_PROTOCOL_HANDLER_H_ #define BROWSER_DEVTOOLS_NETWORK_PROTOCOL_HANDLER_H_
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h" #include "base/values.h"
namespace content { namespace content {
@ -29,17 +28,17 @@ class DevToolsNetworkProtocolHandler {
bool attached); bool attached);
private: private:
scoped_ptr<base::DictionaryValue> CanEmulateNetworkConditions( std::unique_ptr<base::DictionaryValue> CanEmulateNetworkConditions(
content::DevToolsAgentHost* agent_host, content::DevToolsAgentHost* agent_host,
int command_id, int command_id,
const base::DictionaryValue* params); const base::DictionaryValue* params);
scoped_ptr<base::DictionaryValue> EmulateNetworkConditions( std::unique_ptr<base::DictionaryValue> EmulateNetworkConditions(
content::DevToolsAgentHost* agent_host, content::DevToolsAgentHost* agent_host,
int command_id, int command_id,
const base::DictionaryValue* params); const base::DictionaryValue* params);
void UpdateNetworkState( void UpdateNetworkState(
content::DevToolsAgentHost* agent_host, content::DevToolsAgentHost* agent_host,
scoped_ptr<DevToolsNetworkConditions> conditions); std::unique_ptr<DevToolsNetworkConditions> conditions);
DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkProtocolHandler); DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkProtocolHandler);
}; };

View file

@ -22,7 +22,7 @@ const char
DevToolsNetworkTransaction::DevToolsNetworkTransaction( DevToolsNetworkTransaction::DevToolsNetworkTransaction(
DevToolsNetworkController* controller, DevToolsNetworkController* controller,
scoped_ptr<net::HttpTransaction> transaction) std::unique_ptr<net::HttpTransaction> transaction)
: throttled_byte_count_(0), : throttled_byte_count_(0),
controller_(controller), controller_(controller),
transaction_(std::move(transaction)), transaction_(std::move(transaction)),

View file

@ -7,7 +7,6 @@
#include <stdint.h> #include <stdint.h>
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "browser/net/devtools_network_interceptor.h" #include "browser/net/devtools_network_interceptor.h"
#include "net/base/completion_callback.h" #include "net/base/completion_callback.h"
@ -27,7 +26,7 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
DevToolsNetworkTransaction( DevToolsNetworkTransaction(
DevToolsNetworkController* controller, DevToolsNetworkController* controller,
scoped_ptr<net::HttpTransaction> network_transaction); std::unique_ptr<net::HttpTransaction> network_transaction);
~DevToolsNetworkTransaction() override; ~DevToolsNetworkTransaction() override;
// HttpTransaction methods: // HttpTransaction methods:
@ -89,13 +88,13 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
base::WeakPtr<DevToolsNetworkInterceptor> interceptor_; base::WeakPtr<DevToolsNetworkInterceptor> interceptor_;
// Modified upload data stream. Should be destructed after |custom_request_|. // Modified upload data stream. Should be destructed after |custom_request_|.
scoped_ptr<DevToolsNetworkUploadDataStream> custom_upload_data_stream_; std::unique_ptr<DevToolsNetworkUploadDataStream> custom_upload_data_stream_;
// Modified request. Should be destructed after |transaction_|. // Modified request. Should be destructed after |transaction_|.
scoped_ptr<net::HttpRequestInfo> custom_request_; std::unique_ptr<net::HttpRequestInfo> custom_request_;
// Original network transaction. // Original network transaction.
scoped_ptr<net::HttpTransaction> transaction_; std::unique_ptr<net::HttpTransaction> transaction_;
const net::HttpRequestInfo* request_; const net::HttpRequestInfo* request_;

View file

@ -30,8 +30,8 @@ DevToolsNetworkTransactionFactory::~DevToolsNetworkTransactionFactory() {
int DevToolsNetworkTransactionFactory::CreateTransaction( int DevToolsNetworkTransactionFactory::CreateTransaction(
net::RequestPriority priority, net::RequestPriority priority,
scoped_ptr<net::HttpTransaction>* transaction) { std::unique_ptr<net::HttpTransaction>* transaction) {
scoped_ptr<net::HttpTransaction> new_transaction; std::unique_ptr<net::HttpTransaction> new_transaction;
int rv = network_layer_->CreateTransaction(priority, &new_transaction); int rv = network_layer_->CreateTransaction(priority, &new_transaction);
if (rv != net::OK) if (rv != net::OK)
return rv; return rv;

View file

@ -6,7 +6,6 @@
#define BROWSER_DEVTOOLS_NETWORK_TRANSACTION_FACTORY_H_ #define BROWSER_DEVTOOLS_NETWORK_TRANSACTION_FACTORY_H_
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/request_priority.h" #include "net/base/request_priority.h"
#include "net/http/http_transaction_factory.h" #include "net/http/http_transaction_factory.h"
@ -23,13 +22,13 @@ class DevToolsNetworkTransactionFactory : public net::HttpTransactionFactory {
// net::HttpTransactionFactory: // net::HttpTransactionFactory:
int CreateTransaction(net::RequestPriority priority, int CreateTransaction(net::RequestPriority priority,
scoped_ptr<net::HttpTransaction>* transaction) override; std::unique_ptr<net::HttpTransaction>* transaction) override;
net::HttpCache* GetCache() override; net::HttpCache* GetCache() override;
net::HttpNetworkSession* GetSession() override; net::HttpNetworkSession* GetSession() override;
private: private:
DevToolsNetworkController* controller_; DevToolsNetworkController* controller_;
scoped_ptr<net::HttpTransactionFactory> network_layer_; std::unique_ptr<net::HttpTransactionFactory> network_layer_;
DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransactionFactory); DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransactionFactory);
}; };

View file

@ -14,8 +14,8 @@ namespace brightray {
namespace { namespace {
scoped_ptr<base::DictionaryValue> GetConstants() { std::unique_ptr<base::DictionaryValue> GetConstants() {
scoped_ptr<base::DictionaryValue> constants = net::GetNetConstants(); std::unique_ptr<base::DictionaryValue> constants = net::GetNetConstants();
// Adding client information to constants dictionary. // Adding client information to constants dictionary.
base::DictionaryValue* client_info = new base::DictionaryValue(); base::DictionaryValue* client_info = new base::DictionaryValue();
@ -53,7 +53,7 @@ void NetLog::StartLogging(net::URLRequestContext* url_request_context) {
return; return;
} }
scoped_ptr<base::Value> constants(GetConstants()); std::unique_ptr<base::Value> constants(GetConstants());
write_to_file_observer_.StartObserving(this, write_to_file_observer_.StartObserving(this,
std::move(log_file_), std::move(log_file_),
constants.get(), constants.get(),

View file

@ -7,7 +7,7 @@
namespace brightray { namespace brightray {
NotificationDelegateAdapter::NotificationDelegateAdapter( NotificationDelegateAdapter::NotificationDelegateAdapter(
scoped_ptr<content::DesktopNotificationDelegate> delegate) std::unique_ptr<content::DesktopNotificationDelegate> delegate)
: delegate_(std::move(delegate)) { : delegate_(std::move(delegate)) {
} }

View file

@ -5,7 +5,9 @@
#ifndef BROWSER_NOTIFICATION_DELEGATE_ADAPTER_H_ #ifndef BROWSER_NOTIFICATION_DELEGATE_ADAPTER_H_
#define BROWSER_NOTIFICATION_DELEGATE_ADAPTER_H_ #define BROWSER_NOTIFICATION_DELEGATE_ADAPTER_H_
#include "base/memory/scoped_ptr.h" #include <memory>
#include "base/macros.h"
#include "browser/notification_delegate.h" #include "browser/notification_delegate.h"
namespace brightray { namespace brightray {
@ -14,7 +16,7 @@ namespace brightray {
class NotificationDelegateAdapter : public NotificationDelegate { class NotificationDelegateAdapter : public NotificationDelegate {
public: public:
explicit NotificationDelegateAdapter( explicit NotificationDelegateAdapter(
scoped_ptr<content::DesktopNotificationDelegate> delegate); std::unique_ptr<content::DesktopNotificationDelegate> delegate);
~NotificationDelegateAdapter() override; ~NotificationDelegateAdapter() override;
// NotificationDelegate: // NotificationDelegate:
@ -26,7 +28,7 @@ class NotificationDelegateAdapter : public NotificationDelegate {
void NotificationClick() override; void NotificationClick() override;
private: private:
scoped_ptr<content::DesktopNotificationDelegate> delegate_; std::unique_ptr<content::DesktopNotificationDelegate> delegate_;
DISALLOW_COPY_AND_ASSIGN(NotificationDelegateAdapter); DISALLOW_COPY_AND_ASSIGN(NotificationDelegateAdapter);
}; };

View file

@ -22,12 +22,12 @@ int PermissionManager::RequestPermission(
content::PermissionType permission, content::PermissionType permission,
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin, const GURL& requesting_origin,
const base::Callback<void(content::PermissionStatus)>& callback) { const base::Callback<void(blink::mojom::PermissionStatus)>& callback) {
if (permission == content::PermissionType::MIDI_SYSEX) { if (permission == content::PermissionType::MIDI_SYSEX) {
content::ChildProcessSecurityPolicy::GetInstance()-> content::ChildProcessSecurityPolicy::GetInstance()->
GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID()); GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
} }
callback.Run(content::PermissionStatus::GRANTED); callback.Run(blink::mojom::PermissionStatus::GRANTED);
return kNoPendingOperation; return kNoPendingOperation;
} }
@ -36,8 +36,8 @@ int PermissionManager::RequestPermissions(
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin, const GURL& requesting_origin,
const base::Callback<void( const base::Callback<void(
const std::vector<content::PermissionStatus>&)>& callback) { const std::vector<blink::mojom::PermissionStatus>&)>& callback) {
std::vector<content::PermissionStatus> permissionStatuses; std::vector<blink::mojom::PermissionStatus> permissionStatuses;
for (auto permission : permissions) { for (auto permission : permissions) {
if (permission == content::PermissionType::MIDI_SYSEX) { if (permission == content::PermissionType::MIDI_SYSEX) {
@ -45,7 +45,7 @@ int PermissionManager::RequestPermissions(
GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID()); GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
} }
permissionStatuses.push_back(content::PermissionStatus::GRANTED); permissionStatuses.push_back(blink::mojom::PermissionStatus::GRANTED);
} }
callback.Run(permissionStatuses); callback.Run(permissionStatuses);
@ -61,11 +61,11 @@ void PermissionManager::ResetPermission(
const GURL& embedding_origin) { const GURL& embedding_origin) {
} }
content::PermissionStatus PermissionManager::GetPermissionStatus( blink::mojom::PermissionStatus PermissionManager::GetPermissionStatus(
content::PermissionType permission, content::PermissionType permission,
const GURL& requesting_origin, const GURL& requesting_origin,
const GURL& embedding_origin) { const GURL& embedding_origin) {
return content::PermissionStatus::GRANTED; return blink::mojom::PermissionStatus::GRANTED;
} }
void PermissionManager::RegisterPermissionUsage( void PermissionManager::RegisterPermissionUsage(
@ -78,7 +78,7 @@ int PermissionManager::SubscribePermissionStatusChange(
content::PermissionType permission, content::PermissionType permission,
const GURL& requesting_origin, const GURL& requesting_origin,
const GURL& embedding_origin, const GURL& embedding_origin,
const base::Callback<void(content::PermissionStatus)>& callback) { const base::Callback<void(blink::mojom::PermissionStatus)>& callback) {
return -1; return -1;
} }

View file

@ -21,18 +21,18 @@ class PermissionManager : public content::PermissionManager {
content::PermissionType permission, content::PermissionType permission,
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin, const GURL& requesting_origin,
const base::Callback<void(content::PermissionStatus)>& callback) override; const base::Callback<void(blink::mojom::PermissionStatus)>& callback) override;
int RequestPermissions( int RequestPermissions(
const std::vector<content::PermissionType>& permissions, const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin, const GURL& requesting_origin,
const base::Callback<void( const base::Callback<void(
const std::vector<content::PermissionStatus>&)>& callback) override; const std::vector<blink::mojom::PermissionStatus>&)>& callback) override;
void CancelPermissionRequest(int request_id) override; void CancelPermissionRequest(int request_id) override;
void ResetPermission(content::PermissionType permission, void ResetPermission(content::PermissionType permission,
const GURL& requesting_origin, const GURL& requesting_origin,
const GURL& embedding_origin) override; const GURL& embedding_origin) override;
content::PermissionStatus GetPermissionStatus( blink::mojom::PermissionStatus GetPermissionStatus(
content::PermissionType permission, content::PermissionType permission,
const GURL& requesting_origin, const GURL& requesting_origin,
const GURL& embedding_origin) override; const GURL& embedding_origin) override;
@ -43,7 +43,7 @@ class PermissionManager : public content::PermissionManager {
content::PermissionType permission, content::PermissionType permission,
const GURL& requesting_origin, const GURL& requesting_origin,
const GURL& embedding_origin, const GURL& embedding_origin,
const base::Callback<void(content::PermissionStatus)>& callback) override; const base::Callback<void(blink::mojom::PermissionStatus)>& callback) override;
void UnsubscribePermissionStatusChange(int subscription_id) override; void UnsubscribePermissionStatusChange(int subscription_id) override;
private: private:

View file

@ -25,7 +25,7 @@ void OnWebNotificationAllowed(
brightray::BrowserClient* browser_client, brightray::BrowserClient* browser_client,
const SkBitmap& icon, const SkBitmap& icon,
const content::PlatformNotificationData& data, const content::PlatformNotificationData& data,
scoped_ptr<content::DesktopNotificationDelegate> delegate, std::unique_ptr<content::DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback, base::Closure* cancel_callback,
bool allowed) { bool allowed) {
if (!allowed) if (!allowed)
@ -33,7 +33,7 @@ void OnWebNotificationAllowed(
auto presenter = browser_client->GetNotificationPresenter(); auto presenter = browser_client->GetNotificationPresenter();
if (!presenter) if (!presenter)
return; return;
scoped_ptr<NotificationDelegateAdapter> adapter( std::unique_ptr<NotificationDelegateAdapter> adapter(
new NotificationDelegateAdapter(std::move(delegate))); new NotificationDelegateAdapter(std::move(delegate)));
auto notification = presenter->CreateNotification(adapter.get()); auto notification = presenter->CreateNotification(adapter.get());
if (notification) { if (notification) {
@ -73,7 +73,7 @@ void PlatformNotificationService::DisplayNotification(
const GURL& origin, const GURL& origin,
const content::PlatformNotificationData& notification_data, const content::PlatformNotificationData& notification_data,
const content::NotificationResources& notification_resources, const content::NotificationResources& notification_resources,
scoped_ptr<content::DesktopNotificationDelegate> delegate, std::unique_ptr<content::DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback) { base::Closure* cancel_callback) {
browser_client_->WebNotificationAllowed( browser_client_->WebNotificationAllowed(
render_process_id_, render_process_id_,

View file

@ -5,6 +5,7 @@
#ifndef BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ #ifndef BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
#define BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ #define BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
#include "content/public/browser/browser_context.h"
#include "content/public/browser/platform_notification_service.h" #include "content/public/browser/platform_notification_service.h"
namespace brightray { namespace brightray {
@ -31,7 +32,7 @@ class PlatformNotificationService
const GURL& origin, const GURL& origin,
const content::PlatformNotificationData& notification_data, const content::PlatformNotificationData& notification_data,
const content::NotificationResources& notification_resources, const content::NotificationResources& notification_resources,
scoped_ptr<content::DesktopNotificationDelegate> delegate, std::unique_ptr<content::DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback) override; base::Closure* cancel_callback) override;
void DisplayPersistentNotification( void DisplayPersistentNotification(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,

View file

@ -12,6 +12,7 @@
#include "browser/network_delegate.h" #include "browser/network_delegate.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/threading/sequenced_worker_pool.h" #include "base/threading/sequenced_worker_pool.h"
#include "base/threading/worker_pool.h" #include "base/threading/worker_pool.h"
@ -110,11 +111,11 @@ bool URLRequestContextGetter::DelegateURLSecurityManager::CanDelegate
} }
void URLRequestContextGetter::DelegateURLSecurityManager::SetDefaultWhitelist( void URLRequestContextGetter::DelegateURLSecurityManager::SetDefaultWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_default) { std::unique_ptr<net::HttpAuthFilter> whitelist_default) {
} }
void URLRequestContextGetter::DelegateURLSecurityManager::SetDelegateWhitelist( void URLRequestContextGetter::DelegateURLSecurityManager::SetDelegateWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_delegate) { std::unique_ptr<net::HttpAuthFilter> whitelist_delegate) {
} }
URLRequestContextGetter::Delegate::Delegate() : URLRequestContextGetter::Delegate::Delegate() :
@ -124,31 +125,31 @@ std::string URLRequestContextGetter::Delegate::GetUserAgent() {
return base::EmptyString(); return base::EmptyString();
} }
scoped_ptr<net::URLRequestJobFactory> std::unique_ptr<net::URLRequestJobFactory>
URLRequestContextGetter::Delegate::CreateURLRequestJobFactory( URLRequestContextGetter::Delegate::CreateURLRequestJobFactory(
content::ProtocolHandlerMap* protocol_handlers, content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector* protocol_interceptors) { content::URLRequestInterceptorScopedVector* protocol_interceptors) {
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(new net::URLRequestJobFactoryImpl); std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory(new net::URLRequestJobFactoryImpl);
for (auto it = protocol_handlers->begin(); it != protocol_handlers->end(); ++it) for (auto it = protocol_handlers->begin(); it != protocol_handlers->end(); ++it)
job_factory->SetProtocolHandler( job_factory->SetProtocolHandler(
it->first, make_scoped_ptr(it->second.release())); it->first, base::WrapUnique(it->second.release()));
protocol_handlers->clear(); protocol_handlers->clear();
job_factory->SetProtocolHandler( job_factory->SetProtocolHandler(
url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler)); url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler));
job_factory->SetProtocolHandler( job_factory->SetProtocolHandler(
url::kFileScheme, url::kFileScheme,
make_scoped_ptr(new net::FileProtocolHandler( base::WrapUnique(new net::FileProtocolHandler(
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
// Set up interceptors in the reverse order. // Set up interceptors in the reverse order.
scoped_ptr<net::URLRequestJobFactory> top_job_factory = std::move(job_factory); std::unique_ptr<net::URLRequestJobFactory> top_job_factory = std::move(job_factory);
content::URLRequestInterceptorScopedVector::reverse_iterator i; content::URLRequestInterceptorScopedVector::reverse_iterator i;
for (i = protocol_interceptors->rbegin(); i != protocol_interceptors->rend(); ++i) for (i = protocol_interceptors->rbegin(); i != protocol_interceptors->rend(); ++i)
top_job_factory.reset(new net::URLRequestInterceptingJobFactory( top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
std::move(top_job_factory), make_scoped_ptr(*i))); std::move(top_job_factory), base::WrapUnique(*i)));
protocol_interceptors->weak_clear(); protocol_interceptors->weak_clear();
return top_job_factory; return top_job_factory;
@ -165,7 +166,7 @@ URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory(const base::Fil
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
} }
scoped_ptr<net::CertVerifier> std::unique_ptr<net::CertVerifier>
URLRequestContextGetter::Delegate::CreateCertVerifier() { URLRequestContextGetter::Delegate::CreateCertVerifier() {
return net::CertVerifier::CreateDefault(); return net::CertVerifier::CreateDefault();
} }
@ -246,7 +247,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
storage_.reset(new net::URLRequestContextStorage(url_request_context_.get())); storage_.reset(new net::URLRequestContextStorage(url_request_context_.get()));
scoped_refptr<net::CookieStore> cookie_store = nullptr; std::unique_ptr<net::CookieStore> cookie_store = nullptr;
if (in_memory_) { if (in_memory_) {
cookie_store = content::CreateCookieStore(content::CookieStoreConfig()); cookie_store = content::CreateCookieStore(content::CookieStoreConfig());
} else { } else {
@ -256,22 +257,22 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
NULL, NULL); NULL, NULL);
cookie_store = content::CreateCookieStore(cookie_config); cookie_store = content::CreateCookieStore(cookie_config);
} }
storage_->set_cookie_store(cookie_store.get()); storage_->set_cookie_store(std::move(cookie_store));
storage_->set_channel_id_service(make_scoped_ptr( storage_->set_channel_id_service(base::WrapUnique(
new net::ChannelIDService(new net::DefaultChannelIDStore(NULL), new net::ChannelIDService(new net::DefaultChannelIDStore(NULL),
base::WorkerPool::GetTaskRunner(true)))); base::WorkerPool::GetTaskRunner(true))));
std::string accept_lang = l10n_util::GetApplicationLocale(""); std::string accept_lang = l10n_util::GetApplicationLocale("");
storage_->set_http_user_agent_settings(make_scoped_ptr( storage_->set_http_user_agent_settings(base::WrapUnique(
new net::StaticHttpUserAgentSettings( new net::StaticHttpUserAgentSettings(
net::HttpUtil::GenerateAcceptLanguageHeader(accept_lang), net::HttpUtil::GenerateAcceptLanguageHeader(accept_lang),
delegate_->GetUserAgent()))); delegate_->GetUserAgent())));
scoped_ptr<net::HostResolver> host_resolver(net::HostResolver::CreateDefaultResolver(nullptr)); std::unique_ptr<net::HostResolver> host_resolver(net::HostResolver::CreateDefaultResolver(nullptr));
// --host-resolver-rules // --host-resolver-rules
if (command_line.HasSwitch(switches::kHostResolverRules)) { if (command_line.HasSwitch(switches::kHostResolverRules)) {
scoped_ptr<net::MappedHostResolver> remapped_resolver( std::unique_ptr<net::MappedHostResolver> remapped_resolver(
new net::MappedHostResolver(std::move(host_resolver))); new net::MappedHostResolver(std::move(host_resolver)));
remapped_resolver->SetRulesFromString( remapped_resolver->SetRulesFromString(
command_line.GetSwitchValueASCII(switches::kHostResolverRules)); command_line.GetSwitchValueASCII(switches::kHostResolverRules));
@ -323,10 +324,10 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
storage_->set_cert_verifier(delegate_->CreateCertVerifier()); storage_->set_cert_verifier(delegate_->CreateCertVerifier());
storage_->set_transport_security_state( storage_->set_transport_security_state(
make_scoped_ptr(new net::TransportSecurityState)); base::WrapUnique(new net::TransportSecurityState));
storage_->set_ssl_config_service(delegate_->CreateSSLConfigService()); storage_->set_ssl_config_service(delegate_->CreateSSLConfigService());
storage_->set_http_auth_handler_factory(std::move(auth_handler_factory)); storage_->set_http_auth_handler_factory(std::move(auth_handler_factory));
scoped_ptr<net::HttpServerProperties> server_properties( std::unique_ptr<net::HttpServerProperties> server_properties(
new net::HttpServerPropertiesImpl); new net::HttpServerPropertiesImpl);
storage_->set_http_server_properties(std::move(server_properties)); storage_->set_http_server_properties(std::move(server_properties));
@ -334,7 +335,6 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
network_session_params.cert_verifier = url_request_context_->cert_verifier(); network_session_params.cert_verifier = url_request_context_->cert_verifier();
network_session_params.proxy_service = url_request_context_->proxy_service(); network_session_params.proxy_service = url_request_context_->proxy_service();
network_session_params.ssl_config_service = url_request_context_->ssl_config_service(); network_session_params.ssl_config_service = url_request_context_->ssl_config_service();
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.http_server_properties = url_request_context_->http_server_properties();
network_session_params.ignore_certificate_errors = false; network_session_params.ignore_certificate_errors = false;
network_session_params.transport_security_state = network_session_params.transport_security_state =
@ -368,7 +368,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
http_network_session_.reset( http_network_session_.reset(
new net::HttpNetworkSession(network_session_params)); new net::HttpNetworkSession(network_session_params));
scoped_ptr<net::HttpCache::BackendFactory> backend; std::unique_ptr<net::HttpCache::BackendFactory> backend;
if (in_memory_) { if (in_memory_) {
backend = net::HttpCache::DefaultBackend::InMemory(0); backend = net::HttpCache::DefaultBackend::InMemory(0);
} else { } else {
@ -376,14 +376,14 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
} }
if (network_controller_handle_) { if (network_controller_handle_) {
storage_->set_http_transaction_factory(make_scoped_ptr( storage_->set_http_transaction_factory(base::WrapUnique(
new net::HttpCache( new net::HttpCache(
make_scoped_ptr(new DevToolsNetworkTransactionFactory( base::WrapUnique(new DevToolsNetworkTransactionFactory(
network_controller_handle_->GetController(), http_network_session_.get())), network_controller_handle_->GetController(), http_network_session_.get())),
std::move(backend), std::move(backend),
false))); false)));
} else { } else {
storage_->set_http_transaction_factory(make_scoped_ptr( storage_->set_http_transaction_factory(base::WrapUnique(
new net::HttpCache(http_network_session_.get(), new net::HttpCache(http_network_session_.get(),
std::move(backend), std::move(backend),
false))); false)));

View file

@ -6,7 +6,7 @@
#define BRIGHTRAY_BROWSER_URL_REQUEST_CONTEXT_GETTER_H_ #define BRIGHTRAY_BROWSER_URL_REQUEST_CONTEXT_GETTER_H_
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
#include "net/http/http_cache.h" #include "net/http/http_cache.h"
#include "net/http/url_security_manager.h" #include "net/http/url_security_manager.h"
@ -40,18 +40,18 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
virtual net::NetworkDelegate* CreateNetworkDelegate() { return NULL; } virtual net::NetworkDelegate* CreateNetworkDelegate() { return NULL; }
virtual std::string GetUserAgent(); virtual std::string GetUserAgent();
virtual scoped_ptr<net::URLRequestJobFactory> CreateURLRequestJobFactory( virtual std::unique_ptr<net::URLRequestJobFactory> CreateURLRequestJobFactory(
content::ProtocolHandlerMap* protocol_handlers, content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector* protocol_interceptors); content::URLRequestInterceptorScopedVector* protocol_interceptors);
virtual net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory( virtual net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
const base::FilePath& base_path); const base::FilePath& base_path);
virtual scoped_ptr<net::CertVerifier> CreateCertVerifier(); virtual std::unique_ptr<net::CertVerifier> CreateCertVerifier();
virtual net::SSLConfigService* CreateSSLConfigService(); virtual net::SSLConfigService* CreateSSLConfigService();
virtual bool AllowNTLMCredentialsForDomain(const GURL& auth_origin); virtual bool AllowNTLMCredentialsForDomain(const GURL& auth_origin);
virtual bool CanDelegateURLSecurity(const GURL& auth_origin); virtual bool CanDelegateURLSecurity(const GURL& auth_origin);
private: private:
scoped_ptr<net::URLSecurityManager> orig_url_sec_mgr_; std::unique_ptr<net::URLSecurityManager> orig_url_sec_mgr_;
}; };
class DelegateURLSecurityManager : public net::URLSecurityManager { class DelegateURLSecurityManager : public net::URLSecurityManager {
@ -61,9 +61,9 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
bool CanUseDefaultCredentials(const GURL& auth_origin) const override; bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
bool CanDelegate(const GURL& auth_origin) const override; bool CanDelegate(const GURL& auth_origin) const override;
void SetDefaultWhitelist( void SetDefaultWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_default) override; std::unique_ptr<net::HttpAuthFilter> whitelist_default) override;
void SetDelegateWhitelist( void SetDelegateWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_delegate) override; std::unique_ptr<net::HttpAuthFilter> whitelist_delegate) override;
private: private:
URLRequestContextGetter::Delegate* delegate_; URLRequestContextGetter::Delegate* delegate_;
@ -99,13 +99,13 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
base::MessageLoop* io_loop_; base::MessageLoop* io_loop_;
base::MessageLoop* file_loop_; base::MessageLoop* file_loop_;
scoped_ptr<net::ProxyConfigService> proxy_config_service_; std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
scoped_ptr<net::NetworkDelegate> network_delegate_; std::unique_ptr<net::NetworkDelegate> network_delegate_;
scoped_ptr<net::URLRequestContextStorage> storage_; std::unique_ptr<net::URLRequestContextStorage> storage_;
scoped_ptr<net::URLRequestContext> url_request_context_; std::unique_ptr<net::URLRequestContext> url_request_context_;
scoped_ptr<net::HostMappingRules> host_mapping_rules_; std::unique_ptr<net::HostMappingRules> host_mapping_rules_;
scoped_ptr<net::HttpAuthPreferences> http_auth_preferences_; std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences_;
scoped_ptr<net::HttpNetworkSession> http_network_session_; std::unique_ptr<net::HttpNetworkSession> http_network_session_;
content::ProtocolHandlerMap protocol_handlers_; content::ProtocolHandlerMap protocol_handlers_;
content::URLRequestInterceptorScopedVector protocol_interceptors_; content::URLRequestInterceptorScopedVector protocol_interceptors_;

View file

@ -54,7 +54,7 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView,
// Owns us. // Owns us.
InspectableWebContentsImpl* inspectable_web_contents_; InspectableWebContentsImpl* inspectable_web_contents_;
scoped_ptr<views::Widget> devtools_window_; std::unique_ptr<views::Widget> devtools_window_;
views::WebView* devtools_window_web_view_; views::WebView* devtools_window_web_view_;
views::WebView* contents_web_view_; views::WebView* contents_web_view_;
views::WebView* devtools_web_view_; views::WebView* devtools_web_view_;

View file

@ -37,7 +37,7 @@ bool SaveIconToPath(const SkBitmap& bitmap, const base::FilePath& path) {
NotificationPresenter* NotificationPresenter::Create() { NotificationPresenter* NotificationPresenter::Create() {
if (!WindowsToastNotification::Initialize()) if (!WindowsToastNotification::Initialize())
return nullptr; return nullptr;
scoped_ptr<NotificationPresenterWin> presenter(new NotificationPresenterWin); std::unique_ptr<NotificationPresenterWin> presenter(new NotificationPresenterWin);
if (!presenter->Init()) if (!presenter->Init())
return nullptr; return nullptr;
return presenter.release(); return presenter.release();

View file

@ -1,21 +1,20 @@
#include "common/application_info.h" #include "common/application_info.h"
#include "base/file_version_info.h" #include "base/file_version_info.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
namespace brightray { namespace brightray {
std::string GetApplicationName() { std::string GetApplicationName() {
auto module = GetModuleHandle(nullptr); auto module = GetModuleHandle(nullptr);
auto info = make_scoped_ptr( auto info = make_std::unique_ptr(
FileVersionInfo::CreateFileVersionInfoForModule(module)); FileVersionInfo::CreateFileVersionInfoForModule(module));
return base::UTF16ToUTF8(info->product_name()); return base::UTF16ToUTF8(info->product_name());
} }
std::string GetApplicationVersion() { std::string GetApplicationVersion() {
auto module = GetModuleHandle(nullptr); auto module = GetModuleHandle(nullptr);
auto info = make_scoped_ptr( auto info = make_std::unique_ptr(
FileVersionInfo::CreateFileVersionInfoForModule(module)); FileVersionInfo::CreateFileVersionInfoForModule(module));
return base::UTF16ToUTF8(info->product_version()); return base::UTF16ToUTF8(info->product_version());
} }

View file

@ -4,6 +4,8 @@
#include "common/main_delegate.h" #include "common/main_delegate.h"
#include <memory>
#include "browser/browser_client.h" #include "browser/browser_client.h"
#include "common/content_client.h" #include "common/content_client.h"
@ -21,11 +23,6 @@ namespace {
// and resources loaded. // and resources loaded.
bool SubprocessNeedsResourceBundle(const std::string& process_type) { bool SubprocessNeedsResourceBundle(const std::string& process_type) {
return return
#if defined(OS_WIN) || defined(OS_MACOSX)
// Windows needs resources for the default/null plugin.
// Mac needs them for the plugin process name.
process_type == switches::kPluginProcess ||
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
// The zygote process opens the resources for the renderers. // The zygote process opens the resources for the renderers.
process_type == switches::kZygoteProcess || process_type == switches::kZygoteProcess ||
@ -80,8 +77,8 @@ MainDelegate::MainDelegate() {
MainDelegate::~MainDelegate() { MainDelegate::~MainDelegate() {
} }
scoped_ptr<ContentClient> MainDelegate::CreateContentClient() { std::unique_ptr<ContentClient> MainDelegate::CreateContentClient() {
return make_scoped_ptr(new ContentClient); return std::unique_ptr<ContentClient>(new ContentClient);
} }
bool MainDelegate::BasicStartupComplete(int* exit_code) { bool MainDelegate::BasicStartupComplete(int* exit_code) {
@ -112,8 +109,8 @@ content::ContentBrowserClient* MainDelegate::CreateContentBrowserClient() {
return browser_client_.get(); return browser_client_.get();
} }
scoped_ptr<BrowserClient> MainDelegate::CreateBrowserClient() { std::unique_ptr<BrowserClient> MainDelegate::CreateBrowserClient() {
return make_scoped_ptr(new BrowserClient); return std::unique_ptr<BrowserClient>(new BrowserClient);
} }
} // namespace brightray } // namespace brightray

View file

@ -5,8 +5,7 @@
#ifndef BRIGHTRAY_COMMON_MAIN_DELEGATE_H_ #ifndef BRIGHTRAY_COMMON_MAIN_DELEGATE_H_
#define BRIGHTRAY_COMMON_MAIN_DELEGATE_H_ #define BRIGHTRAY_COMMON_MAIN_DELEGATE_H_
#include "base/compiler_specific.h" #include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/app/content_main_delegate.h" #include "content/public/app/content_main_delegate.h"
namespace base { namespace base {
@ -33,11 +32,11 @@ class MainDelegate : public content::ContentMainDelegate {
protected: protected:
// Subclasses can override this to provide their own ContentClient // Subclasses can override this to provide their own ContentClient
// implementation. // implementation.
virtual scoped_ptr<ContentClient> CreateContentClient(); virtual std::unique_ptr<ContentClient> CreateContentClient();
// Subclasses can override this to provide their own BrowserClient // Subclasses can override this to provide their own BrowserClient
// implementation. // implementation.
virtual scoped_ptr<BrowserClient> CreateBrowserClient(); virtual std::unique_ptr<BrowserClient> CreateBrowserClient();
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Subclasses can override this to custom the paths of child process and // Subclasses can override this to custom the paths of child process and
@ -52,8 +51,8 @@ class MainDelegate : public content::ContentMainDelegate {
private: private:
content::ContentBrowserClient* CreateContentBrowserClient() override; content::ContentBrowserClient* CreateContentBrowserClient() override;
scoped_ptr<ContentClient> content_client_; std::unique_ptr<ContentClient> content_client_;
scoped_ptr<BrowserClient> browser_client_; std::unique_ptr<BrowserClient> browser_client_;
DISALLOW_COPY_AND_ASSIGN(MainDelegate); DISALLOW_COPY_AND_ASSIGN(MainDelegate);
}; };