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

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

Issue 1888963004: Add HttpProtocolHandler and convert everything to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-supports-scheme
Patch Set: even more rebase Created 4 years, 8 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
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 <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "android_webview/browser/aw_browser_context.h" 10 #include "android_webview/browser/aw_browser_context.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "net/http/http_auth_handler_factory.h" 42 #include "net/http/http_auth_handler_factory.h"
43 #include "net/http/http_auth_preferences.h" 43 #include "net/http/http_auth_preferences.h"
44 #include "net/http/http_cache.h" 44 #include "net/http/http_cache.h"
45 #include "net/http/http_stream_factory.h" 45 #include "net/http/http_stream_factory.h"
46 #include "net/log/net_log.h" 46 #include "net/log/net_log.h"
47 #include "net/proxy/proxy_service.h" 47 #include "net/proxy/proxy_service.h"
48 #include "net/socket/next_proto.h" 48 #include "net/socket/next_proto.h"
49 #include "net/ssl/channel_id_service.h" 49 #include "net/ssl/channel_id_service.h"
50 #include "net/url_request/data_protocol_handler.h" 50 #include "net/url_request/data_protocol_handler.h"
51 #include "net/url_request/file_protocol_handler.h" 51 #include "net/url_request/file_protocol_handler.h"
52 #include "net/url_request/http_protocol_handler.h"
52 #include "net/url_request/url_request_context.h" 53 #include "net/url_request/url_request_context.h"
53 #include "net/url_request/url_request_context_builder.h" 54 #include "net/url_request/url_request_context_builder.h"
54 #include "net/url_request/url_request_intercepting_job_factory.h" 55 #include "net/url_request/url_request_intercepting_job_factory.h"
55 #include "net/url_request/url_request_interceptor.h" 56 #include "net/url_request/url_request_interceptor.h"
56 57
57 using content::BrowserThread; 58 using content::BrowserThread;
58 59
59 namespace android_webview { 60 namespace android_webview {
60 61
61 62
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 98 }
98 99
99 std::unique_ptr<net::URLRequestJobFactory> CreateJobFactory( 100 std::unique_ptr<net::URLRequestJobFactory> CreateJobFactory(
100 content::ProtocolHandlerMap* protocol_handlers, 101 content::ProtocolHandlerMap* protocol_handlers,
101 content::URLRequestInterceptorScopedVector request_interceptors) { 102 content::URLRequestInterceptorScopedVector request_interceptors) {
102 std::unique_ptr<AwURLRequestJobFactory> aw_job_factory( 103 std::unique_ptr<AwURLRequestJobFactory> aw_job_factory(
103 new AwURLRequestJobFactory); 104 new AwURLRequestJobFactory);
104 // Note that the registered schemes must also be specified in 105 // Note that the registered schemes must also be specified in
105 // AwContentBrowserClient::IsHandledURL. 106 // AwContentBrowserClient::IsHandledURL.
106 bool set_protocol = aw_job_factory->SetProtocolHandler( 107 bool set_protocol = aw_job_factory->SetProtocolHandler(
108 url::kHttpScheme, base::WrapUnique(new net::HttpProtocolHandler));
109 DCHECK(set_protocol);
110 set_protocol = aw_job_factory->SetProtocolHandler(
111 url::kHttpsScheme, base::WrapUnique(new net::HttpProtocolHandler));
112 DCHECK(set_protocol);
113 set_protocol = aw_job_factory->SetProtocolHandler(
114 url::kWsScheme, base::WrapUnique(new net::HttpProtocolHandler));
115 DCHECK(set_protocol);
116 set_protocol = aw_job_factory->SetProtocolHandler(
117 url::kWssScheme, base::WrapUnique(new net::HttpProtocolHandler));
118 DCHECK(set_protocol);
mmenke 2016/04/22 18:37:52 Maybe make AwURLRequestJobFactory::AwURLRequestJob
mgersh 2016/04/22 20:27:15 Done.
119 set_protocol = aw_job_factory->SetProtocolHandler(
107 url::kFileScheme, 120 url::kFileScheme,
108 base::WrapUnique(new net::FileProtocolHandler( 121 base::WrapUnique(new net::FileProtocolHandler(
109 content::BrowserThread::GetBlockingPool() 122 content::BrowserThread::GetBlockingPool()
110 ->GetTaskRunnerWithShutdownBehavior( 123 ->GetTaskRunnerWithShutdownBehavior(
111 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); 124 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
112 DCHECK(set_protocol); 125 DCHECK(set_protocol);
113 set_protocol = aw_job_factory->SetProtocolHandler( 126 set_protocol = aw_job_factory->SetProtocolHandler(
114 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler())); 127 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler()));
115 DCHECK(set_protocol); 128 DCHECK(set_protocol);
116 set_protocol = aw_job_factory->SetProtocolHandler( 129 set_protocol = aw_job_factory->SetProtocolHandler(
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 http_auth_preferences_->set_server_whitelist( 343 http_auth_preferences_->set_server_whitelist(
331 auth_server_whitelist_.GetValue()); 344 auth_server_whitelist_.GetValue());
332 } 345 }
333 346
334 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { 347 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() {
335 http_auth_preferences_->set_auth_android_negotiate_account_type( 348 http_auth_preferences_->set_auth_android_negotiate_account_type(
336 auth_android_negotiate_account_type_.GetValue()); 349 auth_android_negotiate_account_type_.GetValue());
337 } 350 }
338 351
339 } // namespace android_webview 352 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698