Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc

Issue 1290243007: Shift URLRequestContextStorage over to taking scoped_ptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Paul_BuilderGrab
Patch Set: Lots of fixes driven by try jobs. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test _utils.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test _utils.h"
6 6
7 #include "base/prefs/testing_pref_service.h" 7 #include "base/prefs/testing_pref_service.h"
8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h" 8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h"
9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_service_client.h" 9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_service_client.h"
10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_test_utils.h" 10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_test_utils.h"
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 task_runner_, task_runner_, task_runner_, base::TimeDelta())); 520 task_runner_, task_runner_, task_runner_, base::TimeDelta()));
521 } 521 }
522 } 522 }
523 523
524 void DataReductionProxyTestContext::AttachToURLRequestContext( 524 void DataReductionProxyTestContext::AttachToURLRequestContext(
525 net::URLRequestContextStorage* request_context_storage) const { 525 net::URLRequestContextStorage* request_context_storage) const {
526 DCHECK(request_context_storage); 526 DCHECK(request_context_storage);
527 527
528 // |request_context_storage| takes ownership of the network delegate. 528 // |request_context_storage| takes ownership of the network delegate.
529 request_context_storage->set_network_delegate( 529 request_context_storage->set_network_delegate(
530 io_data()->CreateNetworkDelegate( 530 io_data()
Deprecated (see juliatuttle) 2015/09/08 15:39:42 Is this what git cl format does? Separating the io
Randy Smith (Not in Mondays) 2015/09/08 16:33:17 Yeah, that's git cl format (changed back, re-ran,
531 scoped_ptr<net::NetworkDelegate>(new net::TestNetworkDelegate()), 531 ->CreateNetworkDelegate(
532 true).release()); 532 scoped_ptr<net::NetworkDelegate>(new net::TestNetworkDelegate()),
pauljensen 2015/08/28 13:38:02 I see lots of places in this CL where you've added
Randy Smith (Not in Mondays) 2015/09/02 23:42:19 So "Done", with the exception of places where I'm
533 true)
534 .Pass());
533 535
534 // |request_context_storage| takes ownership of the job factory.
535 request_context_storage->set_job_factory( 536 request_context_storage->set_job_factory(
536 new net::URLRequestInterceptingJobFactory( 537 make_scoped_ptr(new net::URLRequestInterceptingJobFactory(
537 scoped_ptr<net::URLRequestJobFactory>( 538 scoped_ptr<net::URLRequestJobFactory>(
538 new net::URLRequestJobFactoryImpl()), 539 new net::URLRequestJobFactoryImpl()),
539 io_data()->CreateInterceptor().Pass())); 540 io_data()->CreateInterceptor().Pass())));
540 } 541 }
541 542
542 void DataReductionProxyTestContext:: 543 void DataReductionProxyTestContext::
543 EnableDataReductionProxyWithSecureProxyCheckSuccess() { 544 EnableDataReductionProxyWithSecureProxyCheckSuccess() {
544 DCHECK(mock_socket_factory_); 545 DCHECK(mock_socket_factory_);
545 // This won't actually update the proxy config when using a test configurator. 546 // This won't actually update the proxy config when using a test configurator.
546 DCHECK(!(test_context_flags_ & 547 DCHECK(!(test_context_flags_ &
547 DataReductionProxyTestContext::USE_TEST_CONFIGURATOR)); 548 DataReductionProxyTestContext::USE_TEST_CONFIGURATOR));
548 // |settings_| needs to have been initialized, since a 549 // |settings_| needs to have been initialized, since a
549 // |DataReductionProxyService| is needed in order to issue the secure proxy 550 // |DataReductionProxyService| is needed in order to issue the secure proxy
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 : prefs_(prefs) { 635 : prefs_(prefs) {
635 DCHECK(prefs); 636 DCHECK(prefs);
636 } 637 }
637 638
638 void DataReductionProxyTestContext::TestConfigStorer::StoreSerializedConfig( 639 void DataReductionProxyTestContext::TestConfigStorer::StoreSerializedConfig(
639 const std::string& serialized_config) { 640 const std::string& serialized_config) {
640 prefs_->SetString(prefs::kDataReductionProxyConfig, serialized_config); 641 prefs_->SetString(prefs::kDataReductionProxyConfig, serialized_config);
641 } 642 }
642 643
643 } // namespace data_reduction_proxy 644 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698