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

Side by Side Diff: android_webview/browser/net/aw_url_request_context_getter.cc

Issue 11931024: Removed static factories for data, ftp, file, and about jobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync (r198785) Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | android_webview/browser/net/aw_url_request_job_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "android_webview/browser/net/aw_url_request_context_getter.h" 5 #include "android_webview/browser/net/aw_url_request_context_getter.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_content_browser_client.h" 10 #include "android_webview/browser/aw_content_browser_client.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 AwURLRequestContextGetter::~AwURLRequestContextGetter() { 46 AwURLRequestContextGetter::~AwURLRequestContextGetter() {
47 BrowserThread::SetDelegate(BrowserThread::IO, NULL); 47 BrowserThread::SetDelegate(BrowserThread::IO, NULL);
48 } 48 }
49 49
50 void AwURLRequestContextGetter::Init() { 50 void AwURLRequestContextGetter::Init() {
51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
52 52
53 net::URLRequestContextBuilder builder; 53 net::URLRequestContextBuilder builder;
54 builder.set_user_agent(content::GetUserAgent(GURL())); 54 builder.set_user_agent(content::GetUserAgent(GURL()));
55 builder.set_network_delegate(new AwNetworkDelegate()); 55 builder.set_network_delegate(new AwNetworkDelegate());
56 #if !defined(DISABLE_FTP_SUPPORT)
56 builder.set_ftp_enabled(false); // Android WebView does not support ftp yet. 57 builder.set_ftp_enabled(false); // Android WebView does not support ftp yet.
58 #endif
57 builder.set_proxy_config_service(proxy_config_service_.release()); 59 builder.set_proxy_config_service(proxy_config_service_.release());
58 builder.set_accept_language(net::HttpUtil::GenerateAcceptLanguageHeader( 60 builder.set_accept_language(net::HttpUtil::GenerateAcceptLanguageHeader(
59 AwContentBrowserClient::GetAcceptLangsImpl())); 61 AwContentBrowserClient::GetAcceptLangsImpl()));
60 62
61 url_request_context_.reset(builder.Build()); 63 url_request_context_.reset(builder.Build());
62 64
63 // TODO(mnaganov): Fix URLRequestContextBuilder to use proper threads. 65 // TODO(mnaganov): Fix URLRequestContextBuilder to use proper threads.
64 net::HttpNetworkSession::Params network_session_params; 66 net::HttpNetworkSession::Params network_session_params;
65 PopulateNetworkSessionParams(&network_session_params); 67 PopulateNetworkSessionParams(&network_session_params);
66 net::HttpCache* main_cache = new net::HttpCache( 68 net::HttpCache* main_cache = new net::HttpCache(
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 AwURLRequestContextGetter::GetNetworkTaskRunner() const { 168 AwURLRequestContextGetter::GetNetworkTaskRunner() const {
167 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 169 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
168 } 170 }
169 171
170 void AwURLRequestContextGetter::SetProtocolHandlers( 172 void AwURLRequestContextGetter::SetProtocolHandlers(
171 content::ProtocolHandlerMap* protocol_handlers) { 173 content::ProtocolHandlerMap* protocol_handlers) {
172 std::swap(protocol_handlers_, *protocol_handlers); 174 std::swap(protocol_handlers_, *protocol_handlers);
173 } 175 }
174 176
175 } // namespace android_webview 177 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/net/aw_url_request_job_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698