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

Unified Diff: chrome/service/net/service_url_request_context.cc

Issue 2001009: Created a new process type called the service process to host background task... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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 | « chrome/service/net/service_url_request_context.h ('k') | chrome/service/service_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/net/service_url_request_context.cc
===================================================================
--- chrome/service/net/service_url_request_context.cc (revision 0)
+++ chrome/service/net/service_url_request_context.cc (revision 0)
@@ -0,0 +1,55 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/service/net/service_url_request_context.h"
+
+#include "chrome/service/service_process.h"
+#include "net/base/cookie_monster.h"
+#include "net/base/cookie_policy.h"
+#include "net/base/host_resolver.h"
+#include "net/base/ssl_config_service_defaults.h"
+#include "net/ftp/ftp_network_layer.h"
+#include "net/http/http_auth_handler_factory.h"
+#include "net/http/http_cache.h"
+#include "net/http/http_network_layer.h"
+#include "net/proxy/proxy_service.h"
+
+ServiceURLRequestContextGetter::ServiceURLRequestContextGetter()
+ : io_message_loop_proxy_(
+ g_service_process->io_thread()->message_loop_proxy()) {
+}
+
+ServiceURLRequestContext::ServiceURLRequestContext() {
+ host_resolver_ = net::CreateSystemHostResolver(NULL);
+ DCHECK(g_service_process);
+ // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a
+ // MessageLoopProxy* instead of MessageLoop*.
+ // Also this needs to be created on the UI thread on Linux. Fix this.
+ net::ProxyConfigService * proxy_config_service =
+ net::ProxyService::CreateSystemProxyConfigService(
+ g_service_process->io_thread()->message_loop(),
+ g_service_process->file_thread()->message_loop());
+ proxy_service_ = net::ProxyService::Create(proxy_config_service, false, this,
+ NULL, NULL, NULL);
+ ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_);
+ ssl_config_service_ = new net::SSLConfigServiceDefaults;
+ http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault();
+ http_transaction_factory_ = new net::HttpCache(
+ net::HttpNetworkLayer::CreateFactory(NULL, host_resolver_,
+ proxy_service_,
+ ssl_config_service_,
+ http_auth_handler_factory_),
+ disk_cache::CreateInMemoryCacheBackend(0));
+ // In-memory cookie store.
+ cookie_store_ = new net::CookieMonster(NULL, NULL);
+ accept_language_ = "en-us,fr";
+ accept_charset_ = "iso-8859-1,*,utf-8";
+}
+
+ServiceURLRequestContext::~ServiceURLRequestContext() {
+ delete ftp_transaction_factory_;
+ delete http_transaction_factory_;
+ delete http_auth_handler_factory_;
+}
+
Property changes on: chrome\service\net\service_url_request_context.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/service/net/service_url_request_context.h ('k') | chrome/service/service_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698