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

Unified Diff: net/url_request/url_request_intercepting_job_factory.cc

Issue 2406273002: [Cronet] Test the libcronet that's shipped, not libcronet_test (Closed)
Patch Set: fix shutdown race Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_intercepting_job_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_intercepting_job_factory.cc
diff --git a/net/url_request/url_request_intercepting_job_factory.cc b/net/url_request/url_request_intercepting_job_factory.cc
index add05c9853d66f70809f664d64555f748a2963a7..45a13fca3fc81a0b9d0cddff01c065aa090a97c4 100644
--- a/net/url_request/url_request_intercepting_job_factory.cc
+++ b/net/url_request/url_request_intercepting_job_factory.cc
@@ -14,10 +14,21 @@ namespace net {
URLRequestInterceptingJobFactory::URLRequestInterceptingJobFactory(
std::unique_ptr<URLRequestJobFactory> job_factory,
std::unique_ptr<URLRequestInterceptor> interceptor)
- : job_factory_(std::move(job_factory)),
- interceptor_(std::move(interceptor)) {}
+ : owning_(true),
+ job_factory_(job_factory.release()),
+ interceptor_(interceptor.release()) {}
-URLRequestInterceptingJobFactory::~URLRequestInterceptingJobFactory() {}
+URLRequestInterceptingJobFactory::URLRequestInterceptingJobFactory(
+ URLRequestJobFactory* job_factory,
+ URLRequestInterceptor* interceptor)
+ : owning_(false), job_factory_(job_factory), interceptor_(interceptor) {}
+
+URLRequestInterceptingJobFactory::~URLRequestInterceptingJobFactory() {
+ if (owning_) {
+ delete job_factory_;
+ delete interceptor_;
+ }
+}
URLRequestJob* URLRequestInterceptingJobFactory::
MaybeCreateJobWithProtocolHandler(
« no previous file with comments | « net/url_request/url_request_intercepting_job_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698