diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index 465cbce43904..88c41957ae9f 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -75,7 +75,7 @@ net::URLRequestContextGetter* BrowserClient::CreateRequestContext( auto context = static_cast(browser_context); return context->CreateRequestContext(static_cast(GetNetLog()), protocol_handlers, - protocol_interceptors.Pass()); + std::move(protocol_interceptors)); } content::MediaObserver* BrowserClient::GetMediaObserver() { diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 67ad5c8d540a..e082b4ac5c17 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -148,7 +148,7 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext( BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), protocol_handlers, - protocol_interceptors.Pass()); + std::move(protocol_interceptors)); resource_context_->set_url_request_context_getter(url_request_getter_.get()); return url_request_getter_.get(); } diff --git a/brightray/browser/mac/cocoa_notification.mm b/brightray/browser/mac/cocoa_notification.mm index 68f22d336370..fefae3978808 100644 --- a/brightray/browser/mac/cocoa_notification.mm +++ b/brightray/browser/mac/cocoa_notification.mm @@ -39,11 +39,11 @@ void CocoaNotification::Show(const base::string16& title, if ([notification_ respondsToSelector:@selector(setContentImage:)] && !icon.drawsNothing()) { - NSImage* image = gfx::SkBitmapToNSImageWithColorSpace( + NSImage* image = skia::SkBitmapToNSImageWithColorSpace( icon, base::mac::GetGenericRGBColorSpace()); [notification_ setContentImage:image]; } - + if (silent) { [notification_ setSoundName:nil]; } else { diff --git a/brightray/browser/net/devtools_network_controller.cc b/brightray/browser/net/devtools_network_controller.cc index 42ebf06471fe..71eae70af3ca 100644 --- a/brightray/browser/net/devtools_network_controller.cc +++ b/brightray/browser/net/devtools_network_controller.cc @@ -30,7 +30,7 @@ void DevToolsNetworkController::SetNetworkState( if (client_id.empty()) { if (!conditions) return; - default_interceptor_->UpdateConditions(conditions.Pass()); + default_interceptor_->UpdateConditions(std::move(conditions)); return; } @@ -40,16 +40,16 @@ void DevToolsNetworkController::SetNetworkState( return; scoped_ptr new_interceptor( new DevToolsNetworkInterceptor); - new_interceptor->UpdateConditions(conditions.Pass()); - interceptors_.set(client_id, new_interceptor.Pass()); + new_interceptor->UpdateConditions(std::move(conditions)); + interceptors_.set(client_id, std::move(new_interceptor)); } else { if (!conditions) { scoped_ptr online_conditions( new DevToolsNetworkConditions(false)); - interceptor->UpdateConditions(online_conditions.Pass()); + interceptor->UpdateConditions(std::move(online_conditions)); interceptors_.erase(client_id); } else { - interceptor->UpdateConditions(conditions.Pass()); + interceptor->UpdateConditions(std::move(conditions)); } } } diff --git a/brightray/browser/net/devtools_network_interceptor.cc b/brightray/browser/net/devtools_network_interceptor.cc index 2535ed74bd3c..ed89fc1b54c0 100644 --- a/brightray/browser/net/devtools_network_interceptor.cc +++ b/brightray/browser/net/devtools_network_interceptor.cc @@ -40,7 +40,7 @@ void DevToolsNetworkInterceptor::UpdateConditions( if (conditions_->IsThrottling()) UpdateThrottledTransactions(now); - conditions_ = conditions.Pass(); + conditions_ = std::move(conditions); if (conditions_->offline()) { timer_.Stop(); diff --git a/brightray/browser/net/devtools_network_protocol_handler.cc b/brightray/browser/net/devtools_network_protocol_handler.cc index b94a04132897..b06678fe92de 100644 --- a/brightray/browser/net/devtools_network_protocol_handler.cc +++ b/brightray/browser/net/devtools_network_protocol_handler.cc @@ -64,7 +64,7 @@ CreateSuccessResponse(int id, scoped_ptr result) { scoped_ptr response(new base::DictionaryValue); response->SetInteger(kId, id); response->Set(params::kResult, result.release()); - return response.Pass(); + return response; } scoped_ptr @@ -75,14 +75,14 @@ CreateFailureResponse(int id, const std::string& param) { error_object->SetInteger(params::kErrorCode, kErrorInvalidParams); error_object->SetString(params::kErrorMessage, base::StringPrintf("Missing or Invalid '%s' parameter", param.c_str())); - return response.Pass(); + return response; } void UpdateNetworkStateInIO(brightray::DevToolsNetworkController* controller, const std::string& client_id, scoped_ptr conditions) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - controller->SetNetworkState(client_id, conditions.Pass()); + controller->SetNetworkState(client_id, std::move(conditions)); } } // namespace @@ -119,7 +119,7 @@ DevToolsNetworkProtocolHandler::CanEmulateNetworkConditions( const base::DictionaryValue* params) { scoped_ptr result(new base::DictionaryValue); result->SetBoolean(params::kResult, true); - return CreateSuccessResponse(id, result.Pass()); + return CreateSuccessResponse(id, std::move(result)); } scoped_ptr @@ -154,7 +154,7 @@ DevToolsNetworkProtocolHandler::EmulateNetworkConditions( latency, download_throughput, upload_throughput)); - UpdateNetworkState(agent_host, conditions.Pass()); + UpdateNetworkState(agent_host, std::move(conditions)); return scoped_ptr(); } diff --git a/brightray/browser/net/devtools_network_transaction.cc b/brightray/browser/net/devtools_network_transaction.cc index c65230d6f5aa..f0d66a047bb4 100644 --- a/brightray/browser/net/devtools_network_transaction.cc +++ b/brightray/browser/net/devtools_network_transaction.cc @@ -24,7 +24,7 @@ DevToolsNetworkTransaction::DevToolsNetworkTransaction( DevToolsNetworkController* controller, scoped_ptr transaction) : controller_(controller), - transaction_(transaction.Pass()), + transaction_(std::move(transaction)), request_(nullptr), failed_(false), throttled_byte_count_(0), diff --git a/brightray/browser/net/devtools_network_transaction_factory.cc b/brightray/browser/net/devtools_network_transaction_factory.cc index d1676a34d56e..d3fb4cfb08b5 100644 --- a/brightray/browser/net/devtools_network_transaction_factory.cc +++ b/brightray/browser/net/devtools_network_transaction_factory.cc @@ -35,7 +35,8 @@ int DevToolsNetworkTransactionFactory::CreateTransaction( int rv = network_layer_->CreateTransaction(priority, &new_transaction); if (rv != net::OK) return rv; - transaction->reset(new DevToolsNetworkTransaction(controller_, new_transaction.Pass())); + transaction->reset( + new DevToolsNetworkTransaction(controller_, std::move(new_transaction))); return net::OK; } diff --git a/brightray/browser/net_log.cc b/brightray/browser/net_log.cc index 7d781a22e7b7..b0b06483f9b7 100644 --- a/brightray/browser/net_log.cc +++ b/brightray/browser/net_log.cc @@ -55,7 +55,7 @@ void NetLog::StartLogging(net::URLRequestContext* url_request_context) { scoped_ptr constants(GetConstants()); write_to_file_observer_.StartObserving(this, - log_file_.Pass(), + std::move(log_file_), constants.get(), url_request_context); } diff --git a/brightray/browser/notification_delegate_adapter.cc b/brightray/browser/notification_delegate_adapter.cc index da9a70aab391..1a4853723b51 100644 --- a/brightray/browser/notification_delegate_adapter.cc +++ b/brightray/browser/notification_delegate_adapter.cc @@ -8,7 +8,7 @@ namespace brightray { NotificationDelegateAdapter::NotificationDelegateAdapter( scoped_ptr delegate) - : delegate_(delegate.Pass()) { + : delegate_(std::move(delegate)) { } NotificationDelegateAdapter::~NotificationDelegateAdapter() { diff --git a/brightray/browser/platform_notification_service.cc b/brightray/browser/platform_notification_service.cc index 5ce667625085..7971f2810016 100644 --- a/brightray/browser/platform_notification_service.cc +++ b/brightray/browser/platform_notification_service.cc @@ -33,7 +33,7 @@ void OnWebNotificationAllowed( if (!presenter) return; scoped_ptr adapter( - new NotificationDelegateAdapter(delegate.Pass())); + new NotificationDelegateAdapter(std::move(delegate))); auto notification = presenter->CreateNotification(adapter.get()); if (notification) { ignore_result(adapter.release()); // it will release itself automatically. diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index d585b1d12b7c..1779170136e4 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -23,6 +23,7 @@ #include "net/cookies/cookie_monster.h" #include "net/dns/mapped_host_resolver.h" #include "net/http/http_auth_handler_factory.h" +#include "net/http/http_auth_preferences.h" #include "net/http/http_server_properties_impl.h" #include "net/log/net_log.h" #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" @@ -139,14 +140,14 @@ URLRequestContextGetter::Delegate::CreateURLRequestJobFactory( base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); // Set up interceptors in the reverse order. - scoped_ptr top_job_factory = job_factory.Pass(); + scoped_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( - top_job_factory.Pass(), make_scoped_ptr(*i))); + std::move(top_job_factory), make_scoped_ptr(*i))); protocol_interceptors->weak_clear(); - return top_job_factory.Pass(); + return top_job_factory; } net::HttpCache::BackendFactory* @@ -195,8 +196,7 @@ URLRequestContextGetter::URLRequestContextGetter( in_memory_(in_memory), io_loop_(io_loop), file_loop_(file_loop), - url_sec_mgr_(new URLRequestContextGetter::DelegateURLSecurityManager(delegate)), - protocol_interceptors_(protocol_interceptors.Pass()) { + protocol_interceptors_(std::move(protocol_interceptors)) { // Must first be created on the UI thread. DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -265,10 +265,10 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { // --host-resolver-rules if (command_line.HasSwitch(switches::kHostResolverRules)) { scoped_ptr remapped_resolver( - new net::MappedHostResolver(host_resolver.Pass())); + new net::MappedHostResolver(std::move(host_resolver))); remapped_resolver->SetRulesFromString( command_line.GetSwitchValueASCII(switches::kHostResolverRules)); - host_resolver = remapped_resolver.Pass(); + host_resolver = std::move(remapped_resolver); } // --proxy-server @@ -291,7 +291,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { } else { storage_->set_proxy_service( net::CreateProxyServiceUsingV8ProxyResolver( - proxy_config_service_.Pass(), + std::move(proxy_config_service_), new net::ProxyScriptFetcherImpl(url_request_context_.get()), dhcp_factory.Create(url_request_context_.get()), host_resolver.get(), @@ -304,16 +304,15 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { schemes.push_back(std::string("digest")); schemes.push_back(std::string("ntlm")); schemes.push_back(std::string("negotiate")); - +#if defined(OS_POSIX) + http_auth_preferences_.reset(new net::HttpAuthPreferences(schemes, + std::string())); +#else + http_auth_preferences_.reset(new net::HttpAuthPreferences(schemes)); +#endif auto auth_handler_factory = make_scoped_ptr( net::HttpAuthHandlerRegistryFactory::Create( - schemes, - url_sec_mgr_.get(), - host_resolver.get(), - std::string(), // gssapi_library_name - std::string(), // gssapi_library_nam - false, // auth_android_negotiate_account_type - true)); // negotiate_enable_port + http_auth_preferences_.get(), host_resolver.get())); storage_->set_cert_verifier(delegate_->CreateCertVerifier()); storage_->set_transport_security_state( @@ -322,7 +321,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { storage_->set_http_auth_handler_factory(auth_handler_factory.Pass()); scoped_ptr server_properties( new net::HttpServerPropertiesImpl); - storage_->set_http_server_properties(server_properties.Pass()); + storage_->set_http_server_properties(std::move(server_properties)); net::HttpNetworkSession::Params network_session_params; network_session_params.cert_verifier = url_request_context_->cert_verifier(); @@ -355,21 +354,23 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { } // Give |storage_| ownership at the end in case it's |mapped_host_resolver|. - storage_->set_host_resolver(host_resolver.Pass()); + storage_->set_host_resolver(std::move(host_resolver)); network_session_params.host_resolver = url_request_context_->host_resolver(); - net::HttpNetworkSession* session = new net::HttpNetworkSession(network_session_params); - net::HttpCache::BackendFactory* backend = nullptr; + http_network_session_.reset( + new net::HttpNetworkSession(network_session_params)); + scoped_ptr backend; if (in_memory_) { backend = net::HttpCache::DefaultBackend::InMemory(0); } else { - backend = delegate_->CreateHttpCacheBackendFactory(base_path_); + backend.reset(delegate_->CreateHttpCacheBackendFactory(base_path_)); } storage_->set_http_transaction_factory(make_scoped_ptr( new net::HttpCache( - new DevToolsNetworkTransactionFactory(controller_, session), + new DevToolsNetworkTransactionFactory(controller_, + http_network_session_.get()), url_request_context_->net_log(), - backend))); + std::move(backend)))); storage_->set_job_factory(delegate_->CreateURLRequestJobFactory( &protocol_handlers_, &protocol_interceptors_)); diff --git a/brightray/browser/url_request_context_getter.h b/brightray/browser/url_request_context_getter.h index cb9af8c6f7f2..aaf9855d2a59 100644 --- a/brightray/browser/url_request_context_getter.h +++ b/brightray/browser/url_request_context_getter.h @@ -19,6 +19,7 @@ class MessageLoop; namespace net { class HostMappingRules; class HostResolver; +class HttpAuthPreferences; class NetworkDelegate; class ProxyConfigService; class URLRequestContextStorage; @@ -103,7 +104,8 @@ class URLRequestContextGetter : public net::URLRequestContextGetter { scoped_ptr storage_; scoped_ptr url_request_context_; scoped_ptr host_mapping_rules_; - scoped_ptr url_sec_mgr_; + scoped_ptr http_auth_preferences_; + scoped_ptr http_network_session_; content::ProtocolHandlerMap protocol_handlers_; content::URLRequestInterceptorScopedVector protocol_interceptors_; diff --git a/brightray/common/main_delegate.cc b/brightray/common/main_delegate.cc index 74ec88791b96..6516111aedd0 100644 --- a/brightray/common/main_delegate.cc +++ b/brightray/common/main_delegate.cc @@ -81,11 +81,11 @@ MainDelegate::~MainDelegate() { } scoped_ptr MainDelegate::CreateContentClient() { - return make_scoped_ptr(new ContentClient).Pass(); + return make_scoped_ptr(new ContentClient); } bool MainDelegate::BasicStartupComplete(int* exit_code) { - content_client_ = CreateContentClient().Pass(); + content_client_ = CreateContentClient(); SetContentClient(content_client_.get()); #if defined(OS_MACOSX) OverrideChildProcessPath(); @@ -108,12 +108,12 @@ void MainDelegate::PreSandboxStartup() { } content::ContentBrowserClient* MainDelegate::CreateContentBrowserClient() { - browser_client_ = CreateBrowserClient().Pass(); + browser_client_ = CreateBrowserClient(); return browser_client_.get(); } scoped_ptr MainDelegate::CreateBrowserClient() { - return make_scoped_ptr(new BrowserClient).Pass(); + return make_scoped_ptr(new BrowserClient); } } // namespace brightray