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

Unified Diff: chromecast/shell/browser/url_request_context_factory.cc

Issue 598303002: Chromecast: adds CastNetworkDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removes gyp dep Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/shell/browser/url_request_context_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/shell/browser/url_request_context_factory.cc
diff --git a/chromecast/shell/browser/url_request_context_factory.cc b/chromecast/shell/browser/url_request_context_factory.cc
index e61bc6a914e9ae91f41fc0ce67cd859c85e4be8c..b7ff5764c0a540d20bda12d76127ab997c5370e5 100644
--- a/chromecast/shell/browser/url_request_context_factory.cc
+++ b/chromecast/shell/browser/url_request_context_factory.cc
@@ -10,6 +10,7 @@
#include "base/path_service.h"
#include "base/threading/worker_pool.h"
#include "chromecast/shell/browser/cast_http_user_agent_settings.h"
+#include "chromecast/shell/browser/cast_network_delegate.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cookie_store_factory.h"
@@ -133,7 +134,9 @@ class URLRequestContextFactory::MainURLRequestContextGetter
};
URLRequestContextFactory::URLRequestContextFactory()
- : system_dependencies_initialized_(false),
+ : app_network_delegate_(CastNetworkDelegate::Create()),
+ system_network_delegate_(CastNetworkDelegate::Create()),
+ system_dependencies_initialized_(false),
main_dependencies_initialized_(false),
media_dependencies_initialized_(false) {
}
@@ -324,6 +327,7 @@ net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() {
system_context->set_job_factory(system_job_factory_.get());
system_context->set_cookie_store(
content::CreateCookieStore(content::CookieStoreConfig()));
+ system_context->set_network_delegate(system_network_delegate_.get());
return system_context;
}
@@ -396,8 +400,16 @@ net::URLRequestContext* URLRequestContextFactory::CreateMainRequestContext(
main_context->set_http_transaction_factory(
main_transaction_factory_.get());
main_context->set_job_factory(main_job_factory_.get());
+ main_context->set_network_delegate(app_network_delegate_.get());
return main_context;
}
+void URLRequestContextFactory::InitializeNetworkDelegates() {
+ app_network_delegate_->Initialize(false);
+ LOG(INFO) << "Initialized app network delegate.";
+ system_network_delegate_->Initialize(false);
+ LOG(INFO) << "Initialized system network delegate.";
+}
+
} // namespace shell
} // namespace chromecast
« no previous file with comments | « chromecast/shell/browser/url_request_context_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698