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

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: uploads CastNetworkDelegate :) 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
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 9ab7c7d8b8ac79962e4f03a3f4f446b8058a5707..5f5960484c6cacd0e541b773c1aaacbd181d65d9 100644
--- a/chromecast/shell/browser/url_request_context_factory.cc
+++ b/chromecast/shell/browser/url_request_context_factory.cc
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/path_service.h"
#include "base/threading/worker_pool.h"
+#include "chromecast/service/cast_network_delegate.h"
#include "chromecast/shell/browser/cast_http_user_agent_settings.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.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) {
}
@@ -322,6 +325,7 @@ net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() {
http_user_agent_settings_.get());
system_context->set_cookie_store(
content::CreateCookieStore(content::CookieStoreConfig()));
+ system_context->set_network_delegate(system_network_delegate_.get());
return system_context;
}
@@ -394,8 +398,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

Powered by Google App Engine
This is Rietveld 408576698