From e7be3d0ef9025873b331006a20fbd4a57b9cc3f8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 22 May 2016 18:06:06 +0900 Subject: [PATCH 01/11] Update to Chrome 51 --- brightray/vendor/libchromiumcontent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index c9e6091e670b..31ff4384348b 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit c9e6091e670bfb7ec2cdee663300674e5727e7aa +Subproject commit 31ff4384348b139d9e138d4df41b85a11d1a4dbb From 851ef398fb6a423997880ee07ff6d5e2d6ede996 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 10:59:07 +0900 Subject: [PATCH 02/11] Adapt to changes of Chrome 51 API changes --- brightray/browser/browser_client.cc | 14 ------ brightray/browser/browser_client.h | 13 ++---- brightray/browser/browser_context.cc | 22 ++++----- brightray/browser/browser_context.h | 17 ++++--- brightray/browser/browser_main_parts.cc | 2 +- brightray/browser/browser_main_parts.h | 7 ++- .../browser/devtools_manager_delegate.cc | 10 ++-- brightray/browser/devtools_manager_delegate.h | 2 +- .../browser/inspectable_web_contents_impl.cc | 6 +-- .../browser/inspectable_web_contents_impl.h | 10 ++-- brightray/browser/mac/cocoa_notification.h | 1 - .../media/media_capture_devices_dispatcher.h | 1 - .../media/media_stream_devices_controller.cc | 8 ++-- .../net/devtools_network_controller.cc | 8 ++-- .../browser/net/devtools_network_controller.h | 7 ++- .../net/devtools_network_controller_handle.cc | 4 +- .../net/devtools_network_controller_handle.h | 7 ++- .../net/devtools_network_interceptor.cc | 2 +- .../net/devtools_network_interceptor.h | 5 +- .../net/devtools_network_protocol_handler.cc | 24 +++++----- .../net/devtools_network_protocol_handler.h | 7 ++- .../net/devtools_network_transaction.cc | 2 +- .../net/devtools_network_transaction.h | 9 ++-- .../devtools_network_transaction_factory.cc | 4 +- .../devtools_network_transaction_factory.h | 5 +- brightray/browser/net_log.cc | 6 +-- .../browser/notification_delegate_adapter.cc | 2 +- .../browser/notification_delegate_adapter.h | 8 ++-- brightray/browser/permission_manager.cc | 16 +++---- brightray/browser/permission_manager.h | 8 ++-- .../browser/platform_notification_service.cc | 6 +-- .../browser/platform_notification_service.h | 3 +- .../browser/url_request_context_getter.cc | 46 +++++++++---------- .../browser/url_request_context_getter.h | 26 +++++------ .../inspectable_web_contents_view_views.h | 2 +- .../browser/win/notification_presenter_win.cc | 2 +- brightray/common/application_info_win.cc | 5 +- brightray/common/main_delegate.cc | 15 +++--- brightray/common/main_delegate.h | 11 ++--- 39 files changed, 157 insertions(+), 196 deletions(-) diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index 88c41957ae9f..7a386c2d7ff8 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -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(browser_context); - return context->CreateRequestContext(static_cast(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; diff --git a/brightray/browser/browser_client.h b/brightray/browser/browser_client.h index 9b7cff7fe4cf..b5ee8a18940d 100644 --- a/brightray/browser/browser_client.h +++ b/brightray/browser/browser_client.h @@ -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* 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 notification_service_; - scoped_ptr notification_presenter_; + std::unique_ptr notification_service_; + std::unique_ptr notification_presenter_; DISALLOW_COPY_AND_ASSIGN(BrowserClient); }; diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 12d1d3577414..10132a7cd10c 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -64,16 +64,16 @@ class BrowserContext::ResourceContext : public content::ResourceContext { return getter_->GetURLRequestContext(); } - scoped_ptr CreateClientCertStore() override { + std::unique_ptr CreateClientCertStore() override { #if defined(USE_NSS_CERTS) - return scoped_ptr(new net::ClientCertStoreNSS( + return std::unique_ptr(new net::ClientCertStoreNSS( net::ClientCertStoreNSS::PasswordDelegateFactory())); #elif defined(OS_WIN) - return scoped_ptr(new net::ClientCertStoreWin()); + return std::unique_ptr(new net::ClientCertStoreWin()); #elif defined(OS_MACOSX) - return scoped_ptr(new net::ClientCertStoreMac()); + return std::unique_ptr(new net::ClientCertStoreMac()); #elif defined(USE_OPENSSL) - return scoped_ptr(); + return std::unique_ptr(); #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 BrowserContext::CreateZoomLevelDelegate( +std::unique_ptr BrowserContext::CreateZoomLevelDelegate( const base::FilePath& partition_path) { - return scoped_ptr(); + return std::unique_ptr(); } 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(); } diff --git a/brightray/browser/browser_context.h b/brightray/browser/browser_context.h index 5ec2b2bcedef..1604774440c9 100644 --- a/brightray/browser/browser_context.h +++ b/brightray/browser/browser_context.h @@ -7,6 +7,7 @@ #include +#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, @@ -39,12 +41,10 @@ class BrowserContext : public base::RefCounted, const std::string& partition, bool in_memory); // content::BrowserContext: - scoped_ptr CreateZoomLevelDelegate( + std::unique_ptr 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, 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, bool in_memory_; DevToolsNetworkControllerHandle network_controller_handle_; + NetLog net_log_; - scoped_ptr resource_context_; + std::unique_ptr resource_context_; scoped_refptr url_request_getter_; scoped_refptr storage_policy_; - scoped_ptr prefs_; - scoped_ptr permission_manager_; + std::unique_ptr prefs_; + std::unique_ptr permission_manager_; base::WeakPtrFactory weak_factory_; diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index 11bbe90c4977..bc6ecd88dbd7 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -76,7 +76,7 @@ void OverrideLinuxAppDataPath() { base::FilePath path; if (PathService::Get(DIR_APP_DATA, &path)) return; - scoped_ptr env(base::Environment::Create()); + std::unique_ptr env(base::Environment::Create()); path = base::nix::GetXDGDirectory(env.get(), base::nix::kXdgConfigHomeEnvVar, base::nix::kDotConfigDir); diff --git a/brightray/browser/browser_main_parts.h b/brightray/browser/browser_main_parts.h index 5b50516f7cc2..40adc027282d 100644 --- a/brightray/browser/browser_main_parts.h +++ b/brightray/browser/browser_main_parts.h @@ -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 browser_context_; - scoped_ptr devtools_http_handler_; + std::unique_ptr devtools_http_handler_; #if defined(TOOLKIT_VIEWS) - scoped_ptr views_delegate_; + std::unique_ptr views_delegate_; #endif #if defined(USE_AURA) && defined(USE_X11) - scoped_ptr wm_state_; + std::unique_ptr wm_state_; #endif DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); diff --git a/brightray/browser/devtools_manager_delegate.cc b/brightray/browser/devtools_manager_delegate.cc index b79c94f8140f..1464362f3ad7 100644 --- a/brightray/browser/devtools_manager_delegate.cc +++ b/brightray/browser/devtools_manager_delegate.cc @@ -45,11 +45,11 @@ class TCPServerSocketFactory private: // content::DevToolsHttpHandler::ServerSocketFactory. - scoped_ptr CreateForHttpServer() override { - scoped_ptr socket( + std::unique_ptr CreateForHttpServer() override { + std::unique_ptr socket( new net::TCPServerSocket(nullptr, net::NetLog::Source())); if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK) - return scoped_ptr(); + return std::unique_ptr(); return socket; } @@ -60,7 +60,7 @@ class TCPServerSocketFactory DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); }; -scoped_ptr +std::unique_ptr 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)); } diff --git a/brightray/browser/devtools_manager_delegate.h b/brightray/browser/devtools_manager_delegate.h index 34e6a6bd7047..23d28c74dbbf 100644 --- a/brightray/browser/devtools_manager_delegate.h +++ b/brightray/browser/devtools_manager_delegate.h @@ -34,7 +34,7 @@ class DevToolsManagerDelegate : public content::DevToolsManagerDelegate { base::DictionaryValue* command) override; private: - scoped_ptr handler_; + std::unique_ptr handler_; DISALLOW_COPY_AND_ASSIGN(DevToolsManagerDelegate); }; diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index be85d4a37d78..80429a1a1892 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -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( + fetcher->SaveResponseWithWriter(std::unique_ptr( 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 parsed_message(base::JSONReader::Read(message)); + std::unique_ptr parsed_message(base::JSONReader::Read(message)); if (!parsed_message || !parsed_message->GetAsDictionary(&dict) || !dict->GetString(kFrontendHostMethod, &method) || diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index b6e91a7d0f55..f9496a75398d 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -162,8 +162,8 @@ class InspectableWebContentsImpl : bool frontend_loaded_; scoped_refptr agent_host_; - scoped_ptr frontend_host_; - scoped_ptr embedder_message_dispatcher_; + std::unique_ptr frontend_host_; + std::unique_ptr embedder_message_dispatcher_; DevToolsContentsResizingStrategy contents_resizing_strategy_; gfx::Rect devtools_bounds_; @@ -176,9 +176,9 @@ class InspectableWebContentsImpl : PrefService* pref_service_; // weak reference. - scoped_ptr web_contents_; - scoped_ptr devtools_web_contents_; - scoped_ptr view_; + std::unique_ptr web_contents_; + std::unique_ptr devtools_web_contents_; + std::unique_ptr view_; base::WeakPtrFactory weak_factory_; diff --git a/brightray/browser/mac/cocoa_notification.h b/brightray/browser/mac/cocoa_notification.h index 7287f00f2456..f6ec9e9da6b0 100644 --- a/brightray/browser/mac/cocoa_notification.h +++ b/brightray/browser/mac/cocoa_notification.h @@ -8,7 +8,6 @@ #import #include "base/mac/scoped_nsobject.h" -#include "base/memory/scoped_ptr.h" #include "browser/notification.h" namespace brightray { diff --git a/brightray/browser/media/media_capture_devices_dispatcher.h b/brightray/browser/media/media_capture_devices_dispatcher.h index c62a917572d2..27fe67664694 100644 --- a/brightray/browser/media/media_capture_devices_dispatcher.h +++ b/brightray/browser/media/media_capture_devices_dispatcher.h @@ -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" diff --git a/brightray/browser/media/media_stream_devices_controller.cc b/brightray/browser/media/media_stream_devices_controller.cc index 1a205f1ed775..103feea369d1 100644 --- a/brightray/browser/media/media_stream_devices_controller.cc +++ b/brightray/browser/media/media_stream_devices_controller.cc @@ -43,7 +43,7 @@ MediaStreamDevicesController::~MediaStreamDevicesController() { if (!callback_.is_null()) { callback_.Run(content::MediaStreamDevices(), content::MEDIA_DEVICE_INVALID_STATE, - scoped_ptr()); + std::unique_ptr()); } } @@ -146,7 +146,7 @@ void MediaStreamDevicesController::Accept() { content::MediaResponseCallback cb = callback_; callback_.Reset(); - cb.Run(devices, content::MEDIA_DEVICE_OK, scoped_ptr()); + cb.Run(devices, content::MEDIA_DEVICE_OK, std::unique_ptr()); } 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()); + std::unique_ptr()); } 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()); + std::unique_ptr()); } } // namespace brightray diff --git a/brightray/browser/net/devtools_network_controller.cc b/brightray/browser/net/devtools_network_controller.cc index 7313a3784321..cb2f92ba222b 100644 --- a/brightray/browser/net/devtools_network_controller.cc +++ b/brightray/browser/net/devtools_network_controller.cc @@ -24,20 +24,20 @@ DevToolsNetworkController::~DevToolsNetworkController() { void DevToolsNetworkController::SetNetworkState( const std::string& client_id, - scoped_ptr conditions) { + std::unique_ptr conditions) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DevToolsNetworkInterceptor* interceptor = interceptors_.get(client_id); if (!interceptor) { if (!conditions) return; - scoped_ptr new_interceptor( + std::unique_ptr new_interceptor( new DevToolsNetworkInterceptor); new_interceptor->UpdateConditions(std::move(conditions)); interceptors_.set(client_id, std::move(new_interceptor)); } else { if (!conditions) { - scoped_ptr online_conditions( + std::unique_ptr 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 appcache_conditions( + std::unique_ptr appcache_conditions( new DevToolsNetworkConditions(has_offline_interceptors)); appcache_interceptor_->UpdateConditions(std::move(appcache_conditions)); } diff --git a/brightray/browser/net/devtools_network_controller.h b/brightray/browser/net/devtools_network_controller.h index 2e3ab419da4f..02bb69855941 100644 --- a/brightray/browser/net/devtools_network_controller.h +++ b/brightray/browser/net/devtools_network_controller.h @@ -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 conditions); + std::unique_ptr conditions); DevToolsNetworkInterceptor* GetInterceptor(const std::string& client_id); private: using InterceptorMap = base::ScopedPtrHashMap>; + std::unique_ptr>; - scoped_ptr appcache_interceptor_; + std::unique_ptr appcache_interceptor_; InterceptorMap interceptors_; DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkController); diff --git a/brightray/browser/net/devtools_network_controller_handle.cc b/brightray/browser/net/devtools_network_controller_handle.cc index efc53a23a178..44b7b9c6c14d 100644 --- a/brightray/browser/net/devtools_network_controller_handle.cc +++ b/brightray/browser/net/devtools_network_controller_handle.cc @@ -25,7 +25,7 @@ DevToolsNetworkControllerHandle::~DevToolsNetworkControllerHandle() { void DevToolsNetworkControllerHandle::SetNetworkState( const std::string& client_id, - scoped_ptr conditions) { + std::unique_ptr 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 conditions) { + std::unique_ptr conditions) { DCHECK_CURRENTLY_ON(BrowserThread::IO); LazyInitialize(); diff --git a/brightray/browser/net/devtools_network_controller_handle.h b/brightray/browser/net/devtools_network_controller_handle.h index f009d2732683..1eefa6244e58 100644 --- a/brightray/browser/net/devtools_network_controller_handle.h +++ b/brightray/browser/net/devtools_network_controller_handle.h @@ -8,7 +8,6 @@ #include #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 conditions); + std::unique_ptr 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 conditions); + std::unique_ptr conditions); - scoped_ptr controller_; + std::unique_ptr controller_; DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkControllerHandle); }; diff --git a/brightray/browser/net/devtools_network_interceptor.cc b/brightray/browser/net/devtools_network_interceptor.cc index f1f8c63ae556..fa866b4aa123 100644 --- a/brightray/browser/net/devtools_network_interceptor.cc +++ b/brightray/browser/net/devtools_network_interceptor.cc @@ -66,7 +66,7 @@ void DevToolsNetworkInterceptor::FinishRecords( } void DevToolsNetworkInterceptor::UpdateConditions( - scoped_ptr conditions) { + std::unique_ptr conditions) { DCHECK(conditions); base::TimeTicks now = base::TimeTicks::Now(); if (conditions_->IsThrottling()) diff --git a/brightray/browser/net/devtools_network_interceptor.h b/brightray/browser/net/devtools_network_interceptor.h index d1293e41acc8..4a04876b6f17 100644 --- a/brightray/browser/net/devtools_network_interceptor.h +++ b/brightray/browser/net/devtools_network_interceptor.h @@ -10,7 +10,6 @@ #include #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 GetWeakPtr(); // Applies network emulation configuration. - void UpdateConditions(scoped_ptr conditions); + void UpdateConditions(std::unique_ptr 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 conditions_; + std::unique_ptr conditions_; // Throttables suspended for a "latency" period. ThrottleRecords suspended_; diff --git a/brightray/browser/net/devtools_network_protocol_handler.cc b/brightray/browser/net/devtools_network_protocol_handler.cc index b5e723d06a6b..60a3a15a0a39 100644 --- a/brightray/browser/net/devtools_network_protocol_handler.cc +++ b/brightray/browser/net/devtools_network_protocol_handler.cc @@ -59,17 +59,17 @@ bool ParseCommand(const base::DictionaryValue* command, return true; } -scoped_ptr -CreateSuccessResponse(int id, scoped_ptr result) { - scoped_ptr response(new base::DictionaryValue); +std::unique_ptr +CreateSuccessResponse(int id, std::unique_ptr result) { + std::unique_ptr response(new base::DictionaryValue); response->SetInteger(kId, id); response->Set(params::kResult, result.release()); return response; } -scoped_ptr +std::unique_ptr CreateFailureResponse(int id, const std::string& param) { - scoped_ptr response(new base::DictionaryValue); + std::unique_ptr 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 conditions; + std::unique_ptr conditions; if (attached) conditions.reset(new DevToolsNetworkConditions(false)); UpdateNetworkState(agent_host, std::move(conditions)); } -scoped_ptr +std::unique_ptr DevToolsNetworkProtocolHandler::CanEmulateNetworkConditions( content::DevToolsAgentHost* agent_host, int id, const base::DictionaryValue* params) { - scoped_ptr result(new base::DictionaryValue); + std::unique_ptr result(new base::DictionaryValue); result->SetBoolean(params::kResult, true); return CreateSuccessResponse(id, std::move(result)); } -scoped_ptr +std::unique_ptr 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 conditions( + std::unique_ptr conditions( new DevToolsNetworkConditions(offline, latency, download_throughput, upload_throughput)); UpdateNetworkState(agent_host, std::move(conditions)); - return scoped_ptr(); + return std::unique_ptr(); } void DevToolsNetworkProtocolHandler::UpdateNetworkState( content::DevToolsAgentHost* agent_host, - scoped_ptr conditions) { + std::unique_ptr conditions) { auto browser_context = static_cast(agent_host->GetBrowserContext()); browser_context->network_controller_handle()->SetNetworkState( diff --git a/brightray/browser/net/devtools_network_protocol_handler.h b/brightray/browser/net/devtools_network_protocol_handler.h index fd9c996cdc1c..9ec577814c37 100644 --- a/brightray/browser/net/devtools_network_protocol_handler.h +++ b/brightray/browser/net/devtools_network_protocol_handler.h @@ -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 CanEmulateNetworkConditions( + std::unique_ptr CanEmulateNetworkConditions( content::DevToolsAgentHost* agent_host, int command_id, const base::DictionaryValue* params); - scoped_ptr EmulateNetworkConditions( + std::unique_ptr EmulateNetworkConditions( content::DevToolsAgentHost* agent_host, int command_id, const base::DictionaryValue* params); void UpdateNetworkState( content::DevToolsAgentHost* agent_host, - scoped_ptr conditions); + std::unique_ptr conditions); DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkProtocolHandler); }; diff --git a/brightray/browser/net/devtools_network_transaction.cc b/brightray/browser/net/devtools_network_transaction.cc index 48ed4232db80..e4c057b289df 100644 --- a/brightray/browser/net/devtools_network_transaction.cc +++ b/brightray/browser/net/devtools_network_transaction.cc @@ -22,7 +22,7 @@ const char DevToolsNetworkTransaction::DevToolsNetworkTransaction( DevToolsNetworkController* controller, - scoped_ptr transaction) + std::unique_ptr transaction) : throttled_byte_count_(0), controller_(controller), transaction_(std::move(transaction)), diff --git a/brightray/browser/net/devtools_network_transaction.h b/brightray/browser/net/devtools_network_transaction.h index a7f08651f656..3de3a1587676 100644 --- a/brightray/browser/net/devtools_network_transaction.h +++ b/brightray/browser/net/devtools_network_transaction.h @@ -7,7 +7,6 @@ #include -#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 network_transaction); + std::unique_ptr network_transaction); ~DevToolsNetworkTransaction() override; // HttpTransaction methods: @@ -89,13 +88,13 @@ class DevToolsNetworkTransaction : public net::HttpTransaction { base::WeakPtr interceptor_; // Modified upload data stream. Should be destructed after |custom_request_|. - scoped_ptr custom_upload_data_stream_; + std::unique_ptr custom_upload_data_stream_; // Modified request. Should be destructed after |transaction_|. - scoped_ptr custom_request_; + std::unique_ptr custom_request_; // Original network transaction. - scoped_ptr transaction_; + std::unique_ptr transaction_; const net::HttpRequestInfo* request_; diff --git a/brightray/browser/net/devtools_network_transaction_factory.cc b/brightray/browser/net/devtools_network_transaction_factory.cc index d3fb4cfb08b5..7373c14ddeff 100644 --- a/brightray/browser/net/devtools_network_transaction_factory.cc +++ b/brightray/browser/net/devtools_network_transaction_factory.cc @@ -30,8 +30,8 @@ DevToolsNetworkTransactionFactory::~DevToolsNetworkTransactionFactory() { int DevToolsNetworkTransactionFactory::CreateTransaction( net::RequestPriority priority, - scoped_ptr* transaction) { - scoped_ptr new_transaction; + std::unique_ptr* transaction) { + std::unique_ptr new_transaction; int rv = network_layer_->CreateTransaction(priority, &new_transaction); if (rv != net::OK) return rv; diff --git a/brightray/browser/net/devtools_network_transaction_factory.h b/brightray/browser/net/devtools_network_transaction_factory.h index a14d97c1d131..a6c8f6a3c2dd 100644 --- a/brightray/browser/net/devtools_network_transaction_factory.h +++ b/brightray/browser/net/devtools_network_transaction_factory.h @@ -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* transaction) override; + std::unique_ptr* transaction) override; net::HttpCache* GetCache() override; net::HttpNetworkSession* GetSession() override; private: DevToolsNetworkController* controller_; - scoped_ptr network_layer_; + std::unique_ptr network_layer_; DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransactionFactory); }; diff --git a/brightray/browser/net_log.cc b/brightray/browser/net_log.cc index b0b06483f9b7..9876b49418b3 100644 --- a/brightray/browser/net_log.cc +++ b/brightray/browser/net_log.cc @@ -14,8 +14,8 @@ namespace brightray { namespace { -scoped_ptr GetConstants() { - scoped_ptr constants = net::GetNetConstants(); +std::unique_ptr GetConstants() { + std::unique_ptr 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 constants(GetConstants()); + std::unique_ptr constants(GetConstants()); write_to_file_observer_.StartObserving(this, std::move(log_file_), constants.get(), diff --git a/brightray/browser/notification_delegate_adapter.cc b/brightray/browser/notification_delegate_adapter.cc index 1a4853723b51..c0ad3d03f066 100644 --- a/brightray/browser/notification_delegate_adapter.cc +++ b/brightray/browser/notification_delegate_adapter.cc @@ -7,7 +7,7 @@ namespace brightray { NotificationDelegateAdapter::NotificationDelegateAdapter( - scoped_ptr delegate) + std::unique_ptr delegate) : delegate_(std::move(delegate)) { } diff --git a/brightray/browser/notification_delegate_adapter.h b/brightray/browser/notification_delegate_adapter.h index b48c7376cb00..01f3284e2b85 100644 --- a/brightray/browser/notification_delegate_adapter.h +++ b/brightray/browser/notification_delegate_adapter.h @@ -5,7 +5,9 @@ #ifndef BROWSER_NOTIFICATION_DELEGATE_ADAPTER_H_ #define BROWSER_NOTIFICATION_DELEGATE_ADAPTER_H_ -#include "base/memory/scoped_ptr.h" +#include + +#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 delegate); + std::unique_ptr delegate); ~NotificationDelegateAdapter() override; // NotificationDelegate: @@ -26,7 +28,7 @@ class NotificationDelegateAdapter : public NotificationDelegate { void NotificationClick() override; private: - scoped_ptr delegate_; + std::unique_ptr delegate_; DISALLOW_COPY_AND_ASSIGN(NotificationDelegateAdapter); }; diff --git a/brightray/browser/permission_manager.cc b/brightray/browser/permission_manager.cc index 8936678a4f7e..5431035561a5 100644 --- a/brightray/browser/permission_manager.cc +++ b/brightray/browser/permission_manager.cc @@ -22,12 +22,12 @@ int PermissionManager::RequestPermission( content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - const base::Callback& callback) { + const base::Callback& 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&)>& callback) { - std::vector permissionStatuses; + const std::vector&)>& callback) { + std::vector 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& callback) { + const base::Callback& callback) { return -1; } diff --git a/brightray/browser/permission_manager.h b/brightray/browser/permission_manager.h index d53fe763ce5e..3f6001c18bf4 100644 --- a/brightray/browser/permission_manager.h +++ b/brightray/browser/permission_manager.h @@ -21,18 +21,18 @@ class PermissionManager : public content::PermissionManager { content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - const base::Callback& callback) override; + const base::Callback& callback) override; int RequestPermissions( const std::vector& permissions, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, const base::Callback&)>& callback) override; + const std::vector&)>& 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& callback) override; + const base::Callback& callback) override; void UnsubscribePermissionStatusChange(int subscription_id) override; private: diff --git a/brightray/browser/platform_notification_service.cc b/brightray/browser/platform_notification_service.cc index ce539cad8d41..023f0a2a131c 100644 --- a/brightray/browser/platform_notification_service.cc +++ b/brightray/browser/platform_notification_service.cc @@ -25,7 +25,7 @@ void OnWebNotificationAllowed( brightray::BrowserClient* browser_client, const SkBitmap& icon, const content::PlatformNotificationData& data, - scoped_ptr delegate, + std::unique_ptr 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 adapter( + std::unique_ptr 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 delegate, + std::unique_ptr delegate, base::Closure* cancel_callback) { browser_client_->WebNotificationAllowed( render_process_id_, diff --git a/brightray/browser/platform_notification_service.h b/brightray/browser/platform_notification_service.h index 2f7663d588f5..1c4b53da94a6 100644 --- a/brightray/browser/platform_notification_service.h +++ b/brightray/browser/platform_notification_service.h @@ -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 delegate, + std::unique_ptr delegate, base::Closure* cancel_callback) override; void DisplayPersistentNotification( content::BrowserContext* browser_context, diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index a2f7032f6831..b547be53b1b6 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -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 whitelist_default) { + std::unique_ptr whitelist_default) { } void URLRequestContextGetter::DelegateURLSecurityManager::SetDelegateWhitelist( - scoped_ptr whitelist_delegate) { + std::unique_ptr whitelist_delegate) { } URLRequestContextGetter::Delegate::Delegate() : @@ -124,31 +125,31 @@ std::string URLRequestContextGetter::Delegate::GetUserAgent() { return base::EmptyString(); } -scoped_ptr +std::unique_ptr URLRequestContextGetter::Delegate::CreateURLRequestJobFactory( content::ProtocolHandlerMap* protocol_handlers, content::URLRequestInterceptorScopedVector* protocol_interceptors) { - scoped_ptr job_factory(new net::URLRequestJobFactoryImpl); + std::unique_ptr 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 top_job_factory = std::move(job_factory); + std::unique_ptr 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 +std::unique_ptr 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 cookie_store = nullptr; + std::unique_ptr 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 host_resolver(net::HostResolver::CreateDefaultResolver(nullptr)); + std::unique_ptr host_resolver(net::HostResolver::CreateDefaultResolver(nullptr)); // --host-resolver-rules if (command_line.HasSwitch(switches::kHostResolverRules)) { - scoped_ptr remapped_resolver( + std::unique_ptr 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 server_properties( + std::unique_ptr 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 backend; + std::unique_ptr 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))); diff --git a/brightray/browser/url_request_context_getter.h b/brightray/browser/url_request_context_getter.h index 3f06ba78ba2a..2643a91a70d0 100644 --- a/brightray/browser/url_request_context_getter.h +++ b/brightray/browser/url_request_context_getter.h @@ -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 CreateURLRequestJobFactory( + virtual std::unique_ptr CreateURLRequestJobFactory( content::ProtocolHandlerMap* protocol_handlers, content::URLRequestInterceptorScopedVector* protocol_interceptors); virtual net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory( const base::FilePath& base_path); - virtual scoped_ptr CreateCertVerifier(); + virtual std::unique_ptr CreateCertVerifier(); virtual net::SSLConfigService* CreateSSLConfigService(); virtual bool AllowNTLMCredentialsForDomain(const GURL& auth_origin); virtual bool CanDelegateURLSecurity(const GURL& auth_origin); private: - scoped_ptr orig_url_sec_mgr_; + std::unique_ptr 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 whitelist_default) override; + std::unique_ptr whitelist_default) override; void SetDelegateWhitelist( - scoped_ptr whitelist_delegate) override; + std::unique_ptr 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 proxy_config_service_; - scoped_ptr network_delegate_; - scoped_ptr storage_; - scoped_ptr url_request_context_; - scoped_ptr host_mapping_rules_; - scoped_ptr http_auth_preferences_; - scoped_ptr http_network_session_; + std::unique_ptr proxy_config_service_; + std::unique_ptr network_delegate_; + std::unique_ptr storage_; + std::unique_ptr url_request_context_; + std::unique_ptr host_mapping_rules_; + std::unique_ptr http_auth_preferences_; + std::unique_ptr http_network_session_; content::ProtocolHandlerMap protocol_handlers_; content::URLRequestInterceptorScopedVector protocol_interceptors_; diff --git a/brightray/browser/views/inspectable_web_contents_view_views.h b/brightray/browser/views/inspectable_web_contents_view_views.h index bcdbdb9518bb..e73ea187ff72 100644 --- a/brightray/browser/views/inspectable_web_contents_view_views.h +++ b/brightray/browser/views/inspectable_web_contents_view_views.h @@ -54,7 +54,7 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView, // Owns us. InspectableWebContentsImpl* inspectable_web_contents_; - scoped_ptr devtools_window_; + std::unique_ptr devtools_window_; views::WebView* devtools_window_web_view_; views::WebView* contents_web_view_; views::WebView* devtools_web_view_; diff --git a/brightray/browser/win/notification_presenter_win.cc b/brightray/browser/win/notification_presenter_win.cc index d3d4f7dc2432..107b62ea76b6 100644 --- a/brightray/browser/win/notification_presenter_win.cc +++ b/brightray/browser/win/notification_presenter_win.cc @@ -37,7 +37,7 @@ bool SaveIconToPath(const SkBitmap& bitmap, const base::FilePath& path) { NotificationPresenter* NotificationPresenter::Create() { if (!WindowsToastNotification::Initialize()) return nullptr; - scoped_ptr presenter(new NotificationPresenterWin); + std::unique_ptr presenter(new NotificationPresenterWin); if (!presenter->Init()) return nullptr; return presenter.release(); diff --git a/brightray/common/application_info_win.cc b/brightray/common/application_info_win.cc index fd18d54b0ca4..7c04617079da 100644 --- a/brightray/common/application_info_win.cc +++ b/brightray/common/application_info_win.cc @@ -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()); } diff --git a/brightray/common/main_delegate.cc b/brightray/common/main_delegate.cc index 6516111aedd0..7dd1d153f5d5 100644 --- a/brightray/common/main_delegate.cc +++ b/brightray/common/main_delegate.cc @@ -4,6 +4,8 @@ #include "common/main_delegate.h" +#include + #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 MainDelegate::CreateContentClient() { - return make_scoped_ptr(new ContentClient); +std::unique_ptr MainDelegate::CreateContentClient() { + return std::unique_ptr(new ContentClient); } bool MainDelegate::BasicStartupComplete(int* exit_code) { @@ -112,8 +109,8 @@ content::ContentBrowserClient* MainDelegate::CreateContentBrowserClient() { return browser_client_.get(); } -scoped_ptr MainDelegate::CreateBrowserClient() { - return make_scoped_ptr(new BrowserClient); +std::unique_ptr MainDelegate::CreateBrowserClient() { + return std::unique_ptr(new BrowserClient); } } // namespace brightray diff --git a/brightray/common/main_delegate.h b/brightray/common/main_delegate.h index 2082a5228822..1eb1366f32e2 100644 --- a/brightray/common/main_delegate.h +++ b/brightray/common/main_delegate.h @@ -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 CreateContentClient(); + virtual std::unique_ptr CreateContentClient(); // Subclasses can override this to provide their own BrowserClient // implementation. - virtual scoped_ptr CreateBrowserClient(); + virtual std::unique_ptr 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 content_client_; - scoped_ptr browser_client_; + std::unique_ptr content_client_; + std::unique_ptr browser_client_; DISALLOW_COPY_AND_ASSIGN(MainDelegate); }; From 76d180a80dff2499380616cd7cb986e9ab446cf8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 12:28:41 +0900 Subject: [PATCH 03/11] Adapt to changes of Chrome 51 API changes (Part 2) --- brightray/browser/browser_context.cc | 11 ++++++++++- brightray/browser/browser_context.h | 5 +++++ brightray/browser/inspectable_web_contents_impl.cc | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 10132a7cd10c..dac47ccba6ab 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -143,7 +143,7 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext( url_request_getter_ = new URLRequestContextGetter( this, network_controller_handle(), - net_log_, + &net_log_, GetPath(), in_memory_, BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), @@ -226,4 +226,13 @@ content::BackgroundSyncController* BrowserContext::GetBackgroundSyncController() return nullptr; } +net::URLRequestContextGetter* +BrowserContext::CreateRequestContextForStoragePartition( + const base::FilePath& partition_path, + bool in_memory, + content::ProtocolHandlerMap* protocol_handlers, + content::URLRequestInterceptorScopedVector request_interceptors) { + return nullptr; +} + } // namespace brightray diff --git a/brightray/browser/browser_context.h b/brightray/browser/browser_context.h index 1604774440c9..00cf4d51f4d2 100644 --- a/brightray/browser/browser_context.h +++ b/brightray/browser/browser_context.h @@ -61,6 +61,11 @@ class BrowserContext : public base::RefCounted, net::URLRequestContextGetter* CreateRequestContext( content::ProtocolHandlerMap* protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors) override; + net::URLRequestContextGetter* CreateRequestContextForStoragePartition( + const base::FilePath& partition_path, + bool in_memory, + content::ProtocolHandlerMap* protocol_handlers, + content::URLRequestInterceptorScopedVector request_interceptors) override; net::URLRequestContextGetter* url_request_context_getter() const { return url_request_getter_.get(); diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 80429a1a1892..99efcd3984c8 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -190,7 +190,7 @@ InspectableWebContentsView* CreateInspectableContentsView( InspectableWebContentsImpl* inspectable_web_contents_impl); void InspectableWebContentsImpl::RegisterPrefs(PrefRegistrySimple* registry) { - auto bounds_dict = make_std::unique_ptr(new base::DictionaryValue); + std::unique_ptr bounds_dict(new base::DictionaryValue); RectToDictionary(gfx::Rect(0, 0, 800, 600), bounds_dict.get()); registry->RegisterDictionaryPref(kDevToolsBoundsPref, bounds_dict.release()); registry->RegisterDoublePref(kDevToolsZoomPref, 0.); From 7c39075c2c4d604707aebe0b23f75343fe1346bf Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 12:34:09 +0900 Subject: [PATCH 04/11] Initialize FeatureList --- brightray/browser/browser_main_parts.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index bc6ecd88dbd7..43c49de8d441 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -10,6 +10,7 @@ #include "common/main_delegate.h" #include "base/command_line.h" +#include "base/feature_list.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "components/devtools_http_handler/devtools_http_handler.h" @@ -153,6 +154,10 @@ BrowserMainParts::~BrowserMainParts() { } void BrowserMainParts::PreEarlyInitialization() { + std::unique_ptr feature_list(new base::FeatureList); + feature_list->InitializeFromCommandLine("", ""); + base::FeatureList::SetInstance(std::move(feature_list)); + #if defined(USE_X11) views::LinuxUI::SetInstance(BuildGtk2UI()); OverrideLinuxAppDataPath(); From 0a5c4b8ced5f6037fab6d4da81b039f411e03be0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 12:36:34 +0900 Subject: [PATCH 05/11] Call BrowserContext::Initialize --- brightray/browser/browser_context.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index dac47ccba6ab..9992f06eb0f1 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -110,6 +110,8 @@ BrowserContext::BrowserContext(const std::string& partition, bool in_memory) if (!in_memory_ && !partition.empty()) path_ = path_.Append(FILE_PATH_LITERAL("Partitions")) .Append(base::FilePath::FromUTF8Unsafe(MakePartitionName(partition))); + + content::BrowserContext::Initialize(this, path_); } void BrowserContext::InitPrefs() { From 4ccf4394d78f0e725dc18f11445727bc39bc0124 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 15:08:20 +0900 Subject: [PATCH 06/11] Fix compilation errors on Linux --- brightray/browser/net/devtools_network_controller_handle.h | 1 + brightray/common/application_info_win.cc | 6 ++++-- brightray/common/main_delegate.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/brightray/browser/net/devtools_network_controller_handle.h b/brightray/browser/net/devtools_network_controller_handle.h index 1eefa6244e58..b5c861f5cd6c 100644 --- a/brightray/browser/net/devtools_network_controller_handle.h +++ b/brightray/browser/net/devtools_network_controller_handle.h @@ -5,6 +5,7 @@ #ifndef BROWSER_DEVTOOLS_NETWORK_CONTROLLER_HANDLE_H_ #define BROWSER_DEVTOOLS_NETWORK_CONTROLLER_HANDLE_H_ +#include #include #include "base/macros.h" diff --git a/brightray/common/application_info_win.cc b/brightray/common/application_info_win.cc index 7c04617079da..22635711cb48 100644 --- a/brightray/common/application_info_win.cc +++ b/brightray/common/application_info_win.cc @@ -1,3 +1,5 @@ +#include + #include "common/application_info.h" #include "base/file_version_info.h" @@ -7,14 +9,14 @@ namespace brightray { std::string GetApplicationName() { auto module = GetModuleHandle(nullptr); - auto info = make_std::unique_ptr( + std::unique_ptr info( FileVersionInfo::CreateFileVersionInfoForModule(module)); return base::UTF16ToUTF8(info->product_name()); } std::string GetApplicationVersion() { auto module = GetModuleHandle(nullptr); - auto info = make_std::unique_ptr( + std::unique_ptr info( FileVersionInfo::CreateFileVersionInfoForModule(module)); return base::UTF16ToUTF8(info->product_version()); } diff --git a/brightray/common/main_delegate.h b/brightray/common/main_delegate.h index 1eb1366f32e2..058e553903c7 100644 --- a/brightray/common/main_delegate.h +++ b/brightray/common/main_delegate.h @@ -5,6 +5,8 @@ #ifndef BRIGHTRAY_COMMON_MAIN_DELEGATE_H_ #define BRIGHTRAY_COMMON_MAIN_DELEGATE_H_ +#include + #include "base/macros.h" #include "content/public/app/content_main_delegate.h" From f5bfbada97ccbf4b6190d70989852144925f385e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 19:02:13 +0900 Subject: [PATCH 07/11] NetLog should be managed by BrowserClient --- brightray/browser/browser_client.cc | 4 ++++ brightray/browser/browser_client.h | 19 +++++++++++-------- brightray/browser/browser_context.cc | 3 ++- brightray/browser/browser_context.h | 3 --- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index 7a386c2d7ff8..4ba0caa67d92 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -84,6 +84,10 @@ void BrowserClient::GetAdditionalAllowedSchemesForFileSystem( additional_schemes->push_back(content::kChromeUIScheme); } +net::NetLog* BrowserClient::GetNetLog() { + return &net_log_; +} + base::FilePath BrowserClient::GetDefaultDownloadDirectory() { // ~/Downloads base::FilePath path; diff --git a/brightray/browser/browser_client.h b/brightray/browser/browser_client.h index b5ee8a18940d..acb12b99708b 100644 --- a/brightray/browser/browser_client.h +++ b/brightray/browser/browser_client.h @@ -5,6 +5,7 @@ #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" @@ -33,13 +34,6 @@ class BrowserClient : public content::ContentBrowserClient { callback.Run(true); } - protected: - // Subclasses should override this to provide their own BrowserMainParts - // implementation. The lifetime of the returned instance is managed by the - // caller. - virtual BrowserMainParts* OverrideCreateBrowserMainParts( - const content::MainFunctionParams&); - // Subclasses that override this (e.g., to provide their own protocol // handlers) should call this implementation after doing their own work. content::BrowserMainParts* CreateBrowserMainParts( @@ -48,12 +42,21 @@ class BrowserClient : public content::ContentBrowserClient { content::PlatformNotificationService* GetPlatformNotificationService() override; void GetAdditionalAllowedSchemesForFileSystem( std::vector* additional_schemes) override; + net::NetLog* GetNetLog() override; base::FilePath GetDefaultDownloadDirectory() override; content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; - BrowserMainParts* browser_main_parts_; + protected: + // Subclasses should override this to provide their own BrowserMainParts + // implementation. The lifetime of the returned instance is managed by the + // caller. + virtual BrowserMainParts* OverrideCreateBrowserMainParts( + const content::MainFunctionParams&); private: + BrowserMainParts* browser_main_parts_; + NetLog net_log_; + std::unique_ptr notification_service_; std::unique_ptr notification_presenter_; diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 9992f06eb0f1..236a8f5c1f21 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -5,6 +5,7 @@ #include "browser/browser_context.h" #include "browser/brightray_paths.h" +#include "browser/browser_client.h" #include "browser/inspectable_web_contents_impl.h" #include "browser/network_delegate.h" #include "browser/permission_manager.h" @@ -145,7 +146,7 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext( url_request_getter_ = new URLRequestContextGetter( this, network_controller_handle(), - &net_log_, + static_cast(BrowserClient::Get()->GetNetLog()), GetPath(), in_memory_, BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), diff --git a/brightray/browser/browser_context.h b/brightray/browser/browser_context.h index 00cf4d51f4d2..31db2ce23f47 100644 --- a/brightray/browser/browser_context.h +++ b/brightray/browser/browser_context.h @@ -7,7 +7,6 @@ #include -#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" @@ -25,7 +24,6 @@ class SpecialStoragePolicy; namespace brightray { -class NetLog; class PermissionManager; class BrowserContext : public base::RefCounted, @@ -122,7 +120,6 @@ class BrowserContext : public base::RefCounted, bool in_memory_; DevToolsNetworkControllerHandle network_controller_handle_; - NetLog net_log_; std::unique_ptr resource_context_; scoped_refptr url_request_getter_; From 17064b483eec46059c0fd7317aadad0f2974a4c0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 19:44:09 +0900 Subject: [PATCH 08/11] Link with xscrnsaver --- brightray/brightray.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 3978a5e368d9..b14a7d0097c7 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -1,7 +1,7 @@ { 'variables': { # The libraries brightray will be compiled to. - 'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst gconf-2.0 gmodule-2.0 nss' + 'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss' }, 'includes': [ 'filenames.gypi', From 8250a66968f5c587be94051bd4435159deed2da4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 22:05:08 +0900 Subject: [PATCH 09/11] Link with AVFoundation and CoreMedia --- brightray/brightray.gyp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index b14a7d0097c7..610f67dd5289 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -169,7 +169,9 @@ # media.gyp: '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework', '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework', + '$(SDKROOT)/System/Library/Frameworks/AVFoundation.framework', '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreMedia.framework', '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework', '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework', # surface.gyp: From cbcd48257d59319f42533fb4763cc35d4435428e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 22:53:19 +0900 Subject: [PATCH 10/11] Link with necessary DLLs of Chrome 51 --- brightray/brightray.gyp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 610f67dd5289..40c76e14cd61 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -275,12 +275,27 @@ 'usp10.lib', 'version.lib', 'winspool.lib', + 'wtsapi32.lib', + # bluetooth.gyp: + 'Bthprops.lib', + 'BluetoothApis.lib', # base.gyp: + 'cfgmgr32.lib', 'powrprof.lib', + 'setupapi.lib', + # net_common.gypi: + 'crypt32.lib', + 'dhcpcsvc.lib', + 'rpcrt4.lib', + 'secur32.lib', + 'urlmon.lib', + 'winhttp.lib', ], 'DelayLoadDLLs': [ + 'wtsapi32.dll', # content_common.gypi: 'd3d9.dll', + 'd3d11.dll', 'dxva2.dll', # media.gyp: 'mf.dll', @@ -291,7 +306,16 @@ 'Bthprops.cpl', 'setupapi.dll', # base.gyp: + 'cfgmgr32.dll', 'powrprof.dll', + 'setupapi.dll', + # net_common.gypi: + 'crypt32.dll', + 'dhcpcsvc.dll', + 'rpcrt4.dll', + 'secur32.dll', + 'urlmon.dll', + 'winhttp.dll', # windows runtime 'API-MS-WIN-CORE-WINRT-L1-1-0.DLL', 'API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL', From f395b35b620747b71243f777399895e88e53b48c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 23:24:16 +0900 Subject: [PATCH 11/11] Add a few more media related libs --- brightray/brightray.gyp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 40c76e14cd61..b5fcbbd05c07 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -259,7 +259,9 @@ '-lmfplat.lib', '-lmfuuid.lib', # media.gyp: + '-ldxguid.lib', '-lmfreadwrite.lib', + '-lmfuuid.lib', ], 'msvs_settings': { 'VCLinkerTool': {