Adapt to changes of Chrome 51 API changes

This commit is contained in:
Cheng Zhao 2016-05-23 10:59:07 +09:00
Родитель e7be3d0ef9
Коммит 851ef398fb
39 изменённых файлов: 157 добавлений и 196 удалений

Просмотреть файл

@ -68,16 +68,6 @@ content::BrowserMainParts* BrowserClient::CreateBrowserMainParts(
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() {
return MediaCaptureDevicesDispatcher::GetInstance();
}
@ -94,10 +84,6 @@ void BrowserClient::GetAdditionalAllowedSchemesForFileSystem(
additional_schemes->push_back(content::kChromeUIScheme);
}
net::NetLog* BrowserClient::GetNetLog() {
return &net_log_;
}
base::FilePath BrowserClient::GetDefaultDownloadDirectory() {
// ~/Downloads
base::FilePath path;

Просмотреть файл

@ -5,14 +5,13 @@
#ifndef 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"
namespace brightray {
class BrowserContext;
class BrowserMainParts;
class NetLog;
class NotificationPresenter;
class PlatformNotificationService;
@ -43,26 +42,20 @@ class BrowserClient : public content::ContentBrowserClient {
// Subclasses that override this (e.g., to provide their own protocol
// 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(
const content::MainFunctionParams&) override;
content::MediaObserver* GetMediaObserver() override;
content::PlatformNotificationService* GetPlatformNotificationService() override;
void GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_schemes) override;
net::NetLog* GetNetLog() override;
base::FilePath GetDefaultDownloadDirectory() override;
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
BrowserMainParts* browser_main_parts_;
NetLog net_log_;
private:
scoped_ptr<PlatformNotificationService> notification_service_;
scoped_ptr<NotificationPresenter> notification_presenter_;
std::unique_ptr<PlatformNotificationService> notification_service_;
std::unique_ptr<NotificationPresenter> notification_presenter_;
DISALLOW_COPY_AND_ASSIGN(BrowserClient);
};

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -45,11 +45,11 @@ class TCPServerSocketFactory
private:
// content::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_, 10) != net::OK)
return scoped_ptr<net::ServerSocket>();
return std::unique_ptr<net::ServerSocket>();
return socket;
}
@ -60,7 +60,7 @@ class TCPServerSocketFactory
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
};
scoped_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>
std::unique_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>
CreateSocketFactory() {
auto& command_line = *base::CommandLine::ForCurrentProcess();
// 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;
}
}
return scoped_ptr<
return std::unique_ptr<
devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>(
new TCPServerSocketFactory("127.0.0.1", port));
}

Просмотреть файл

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

Просмотреть файл

@ -190,7 +190,7 @@ InspectableWebContentsView* CreateInspectableContentsView(
InspectableWebContentsImpl* inspectable_web_contents_impl);
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());
registry->RegisterDictionaryPref(kDevToolsBoundsPref, bounds_dict.release());
registry->RegisterDoublePref(kDevToolsZoomPref, 0.);
@ -412,7 +412,7 @@ void InspectableWebContentsImpl::LoadNetworkResource(
pending_requests_[fetcher] = callback;
fetcher->SetRequestContext(browser_context->url_request_context_getter());
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();
}
@ -562,7 +562,7 @@ void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend(const std::st
base::ListValue* params = &empty_params;
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 ||
!parsed_message->GetAsDictionary(&dict) ||
!dict->GetString(kFrontendHostMethod, &method) ||

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -10,7 +10,6 @@
#include <vector>
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/timer/timer.h"
namespace base {
@ -33,7 +32,7 @@ class DevToolsNetworkInterceptor {
base::WeakPtr<DevToolsNetworkInterceptor> GetWeakPtr();
// 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.
int StartThrottle(int result,
@ -81,7 +80,7 @@ class DevToolsNetworkInterceptor {
void RemoveRecord(ThrottleRecords* records, const ThrottleCallback& callback);
scoped_ptr<DevToolsNetworkConditions> conditions_;
std::unique_ptr<DevToolsNetworkConditions> conditions_;
// Throttables suspended for a "latency" period.
ThrottleRecords suspended_;

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -7,7 +7,6 @@
#include <stdint.h>
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "browser/net/devtools_network_interceptor.h"
#include "net/base/completion_callback.h"
@ -27,7 +26,7 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
DevToolsNetworkTransaction(
DevToolsNetworkController* controller,
scoped_ptr<net::HttpTransaction> network_transaction);
std::unique_ptr<net::HttpTransaction> network_transaction);
~DevToolsNetworkTransaction() override;
// HttpTransaction methods:
@ -89,13 +88,13 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
base::WeakPtr<DevToolsNetworkInterceptor> interceptor_;
// 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_|.
scoped_ptr<net::HttpRequestInfo> custom_request_;
std::unique_ptr<net::HttpRequestInfo> custom_request_;
// Original network transaction.
scoped_ptr<net::HttpTransaction> transaction_;
std::unique_ptr<net::HttpTransaction> transaction_;
const net::HttpRequestInfo* request_;

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -5,7 +5,9 @@
#ifndef 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"
namespace brightray {
@ -14,7 +16,7 @@ namespace brightray {
class NotificationDelegateAdapter : public NotificationDelegate {
public:
explicit NotificationDelegateAdapter(
scoped_ptr<content::DesktopNotificationDelegate> delegate);
std::unique_ptr<content::DesktopNotificationDelegate> delegate);
~NotificationDelegateAdapter() override;
// NotificationDelegate:
@ -26,7 +28,7 @@ class NotificationDelegateAdapter : public NotificationDelegate {
void NotificationClick() override;
private:
scoped_ptr<content::DesktopNotificationDelegate> delegate_;
std::unique_ptr<content::DesktopNotificationDelegate> delegate_;
DISALLOW_COPY_AND_ASSIGN(NotificationDelegateAdapter);
};

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -5,6 +5,7 @@
#ifndef 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"
namespace brightray {
@ -31,7 +32,7 @@ class PlatformNotificationService
const GURL& origin,
const content::PlatformNotificationData& notification_data,
const content::NotificationResources& notification_resources,
scoped_ptr<content::DesktopNotificationDelegate> delegate,
std::unique_ptr<content::DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback) override;
void DisplayPersistentNotification(
content::BrowserContext* browser_context,

Просмотреть файл

@ -12,6 +12,7 @@
#include "browser/network_delegate.h"
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/worker_pool.h"
@ -110,11 +111,11 @@ bool URLRequestContextGetter::DelegateURLSecurityManager::CanDelegate
}
void URLRequestContextGetter::DelegateURLSecurityManager::SetDefaultWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_default) {
std::unique_ptr<net::HttpAuthFilter> whitelist_default) {
}
void URLRequestContextGetter::DelegateURLSecurityManager::SetDelegateWhitelist(
scoped_ptr<net::HttpAuthFilter> whitelist_delegate) {
std::unique_ptr<net::HttpAuthFilter> whitelist_delegate) {
}
URLRequestContextGetter::Delegate::Delegate() :
@ -124,31 +125,31 @@ std::string URLRequestContextGetter::Delegate::GetUserAgent() {
return base::EmptyString();
}
scoped_ptr<net::URLRequestJobFactory>
std::unique_ptr<net::URLRequestJobFactory>
URLRequestContextGetter::Delegate::CreateURLRequestJobFactory(
content::ProtocolHandlerMap* protocol_handlers,
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)
job_factory->SetProtocolHandler(
it->first, make_scoped_ptr(it->second.release()));
it->first, base::WrapUnique(it->second.release()));
protocol_handlers->clear();
job_factory->SetProtocolHandler(
url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler));
url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler));
job_factory->SetProtocolHandler(
url::kFileScheme,
make_scoped_ptr(new net::FileProtocolHandler(
base::WrapUnique(new net::FileProtocolHandler(
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
// 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;
for (i = protocol_interceptors->rbegin(); i != protocol_interceptors->rend(); ++i)
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
std::move(top_job_factory), make_scoped_ptr(*i)));
std::move(top_job_factory), base::WrapUnique(*i)));
protocol_interceptors->weak_clear();
return top_job_factory;
@ -165,7 +166,7 @@ URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory(const base::Fil
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
}
scoped_ptr<net::CertVerifier>
std::unique_ptr<net::CertVerifier>
URLRequestContextGetter::Delegate::CreateCertVerifier() {
return net::CertVerifier::CreateDefault();
}
@ -246,7 +247,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
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_) {
cookie_store = content::CreateCookieStore(content::CookieStoreConfig());
} else {
@ -256,22 +257,22 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
NULL, NULL);
cookie_store = content::CreateCookieStore(cookie_config);
}
storage_->set_cookie_store(cookie_store.get());
storage_->set_channel_id_service(make_scoped_ptr(
storage_->set_cookie_store(std::move(cookie_store));
storage_->set_channel_id_service(base::WrapUnique(
new net::ChannelIDService(new net::DefaultChannelIDStore(NULL),
base::WorkerPool::GetTaskRunner(true))));
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(
net::HttpUtil::GenerateAcceptLanguageHeader(accept_lang),
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
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)));
remapped_resolver->SetRulesFromString(
command_line.GetSwitchValueASCII(switches::kHostResolverRules));
@ -323,10 +324,10 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
storage_->set_cert_verifier(delegate_->CreateCertVerifier());
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_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);
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.proxy_service = url_request_context_->proxy_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.ignore_certificate_errors = false;
network_session_params.transport_security_state =
@ -368,7 +368,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
http_network_session_.reset(
new net::HttpNetworkSession(network_session_params));
scoped_ptr<net::HttpCache::BackendFactory> backend;
std::unique_ptr<net::HttpCache::BackendFactory> backend;
if (in_memory_) {
backend = net::HttpCache::DefaultBackend::InMemory(0);
} else {
@ -376,14 +376,14 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
}
if (network_controller_handle_) {
storage_->set_http_transaction_factory(make_scoped_ptr(
storage_->set_http_transaction_factory(base::WrapUnique(
new net::HttpCache(
make_scoped_ptr(new DevToolsNetworkTransactionFactory(
base::WrapUnique(new DevToolsNetworkTransactionFactory(
network_controller_handle_->GetController(), http_network_session_.get())),
std::move(backend),
false)));
} else {
storage_->set_http_transaction_factory(make_scoped_ptr(
storage_->set_http_transaction_factory(base::WrapUnique(
new net::HttpCache(http_network_session_.get(),
std::move(backend),
false)));

Просмотреть файл

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

Просмотреть файл

@ -54,7 +54,7 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView,
// Owns us.
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* contents_web_view_;
views::WebView* devtools_web_view_;

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -4,6 +4,8 @@
#include "common/main_delegate.h"
#include <memory>
#include "browser/browser_client.h"
#include "common/content_client.h"
@ -21,11 +23,6 @@ namespace {
// and resources loaded.
bool SubprocessNeedsResourceBundle(const std::string& process_type) {
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)
// The zygote process opens the resources for the renderers.
process_type == switches::kZygoteProcess ||
@ -80,8 +77,8 @@ MainDelegate::MainDelegate() {
MainDelegate::~MainDelegate() {
}
scoped_ptr<ContentClient> MainDelegate::CreateContentClient() {
return make_scoped_ptr(new ContentClient);
std::unique_ptr<ContentClient> MainDelegate::CreateContentClient() {
return std::unique_ptr<ContentClient>(new ContentClient);
}
bool MainDelegate::BasicStartupComplete(int* exit_code) {
@ -112,8 +109,8 @@ content::ContentBrowserClient* MainDelegate::CreateContentBrowserClient() {
return browser_client_.get();
}
scoped_ptr<BrowserClient> MainDelegate::CreateBrowserClient() {
return make_scoped_ptr(new BrowserClient);
std::unique_ptr<BrowserClient> MainDelegate::CreateBrowserClient() {
return std::unique_ptr<BrowserClient>(new BrowserClient);
}
} // namespace brightray

Просмотреть файл

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