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

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

Issue 11293252: Change Interceptors into URLRequestJobFactory::ProtocolHandlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
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 "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_request_interceptor.h" 8 #include "android_webview/browser/aw_request_interceptor.h"
9 #include "android_webview/browser/net/aw_network_delegate.h" 9 #include "android_webview/browser/net/aw_network_delegate.h"
10 #include "android_webview/browser/net/aw_url_request_job_factory.h" 10 #include "android_webview/browser/net/aw_url_request_job_factory.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 url_request_context_.reset(builder.Build()); 102 url_request_context_.reset(builder.Build());
103 103
104 job_factory_.reset(new AwURLRequestJobFactory); 104 job_factory_.reset(new AwURLRequestJobFactory);
105 bool set_protocol = job_factory_->SetProtocolHandler( 105 bool set_protocol = job_factory_->SetProtocolHandler(
106 chrome::kFileScheme, new net::FileProtocolHandler()); 106 chrome::kFileScheme, new net::FileProtocolHandler());
107 DCHECK(set_protocol); 107 DCHECK(set_protocol);
108 set_protocol = job_factory_->SetProtocolHandler( 108 set_protocol = job_factory_->SetProtocolHandler(
109 chrome::kDataScheme, new net::DataProtocolHandler()); 109 chrome::kDataScheme, new net::DataProtocolHandler());
110 DCHECK(set_protocol); 110 DCHECK(set_protocol);
111 job_factory_->AddInterceptor(new AwRequestInterceptor()); 111 job_factory_->AddInterceptor(new AwRequestInterceptor());
112
113 job_factory_ = OnNetworkStackInitialized(url_request_context_.get(),
114 job_factory_.Pass());
112 url_request_context_->set_job_factory(job_factory_.get()); 115 url_request_context_->set_job_factory(job_factory_.get());
113
114 OnNetworkStackInitialized(url_request_context_.get(),
115 job_factory_.get());
116 } 116 }
117 117
118 content::ResourceContext* AwURLRequestContextGetter::GetResourceContext() { 118 content::ResourceContext* AwURLRequestContextGetter::GetResourceContext() {
119 DCHECK(url_request_context_); 119 DCHECK(url_request_context_);
120 if (!resource_context_) 120 if (!resource_context_)
121 resource_context_.reset(new AwResourceContext(url_request_context_.get())); 121 resource_context_.reset(new AwResourceContext(url_request_context_.get()));
122 return resource_context_.get(); 122 return resource_context_.get();
123 } 123 }
124 124
125 net::URLRequestContext* AwURLRequestContextGetter::GetURLRequestContext() { 125 net::URLRequestContext* AwURLRequestContextGetter::GetURLRequestContext() {
126 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 126 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
127 return url_request_context_.get(); 127 return url_request_context_.get();
128 } 128 }
129 129
130 scoped_refptr<base::SingleThreadTaskRunner> 130 scoped_refptr<base::SingleThreadTaskRunner>
131 AwURLRequestContextGetter::GetNetworkTaskRunner() const { 131 AwURLRequestContextGetter::GetNetworkTaskRunner() const {
132 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 132 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
133 } 133 }
134 134
135 } // namespace android_webview 135 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/net/init_native_callback.h » ('j') | net/url_request/protocol_intercept_job_factory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698