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

Side by Side Diff: net/url_request/test_url_fetcher_factory.cc

Issue 26230003: net: Allow URLFetcher users to inject custom URLFetcherResponseWriter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win7_aura compile error Created 7 years, 2 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 | « net/url_request/test_url_fetcher_factory.h ('k') | net/url_request/url_fetcher.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 "net/url_request/test_url_fetcher_factory.h" 5 #include "net/url_request/test_url_fetcher_factory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "net/base/host_port_pair.h" 13 #include "net/base/host_port_pair.h"
14 #include "net/http/http_response_headers.h" 14 #include "net/http/http_response_headers.h"
15 #include "net/url_request/url_fetcher_delegate.h" 15 #include "net/url_request/url_fetcher_delegate.h"
16 #include "net/url_request/url_fetcher_impl.h" 16 #include "net/url_request/url_fetcher_impl.h"
17 #include "net/url_request/url_fetcher_response_writer.h"
17 #include "net/url_request/url_request_status.h" 18 #include "net/url_request/url_request_status.h"
18 19
19 namespace net { 20 namespace net {
20 21
21 ScopedURLFetcherFactory::ScopedURLFetcherFactory( 22 ScopedURLFetcherFactory::ScopedURLFetcherFactory(
22 URLFetcherFactory* factory) { 23 URLFetcherFactory* factory) {
23 DCHECK(!URLFetcherImpl::factory()); 24 DCHECK(!URLFetcherImpl::factory());
24 URLFetcherImpl::set_factory(factory); 25 URLFetcherImpl::set_factory(factory);
25 } 26 }
26 27
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 141
141 void TestURLFetcher::SaveResponseToFileAtPath( 142 void TestURLFetcher::SaveResponseToFileAtPath(
142 const base::FilePath& file_path, 143 const base::FilePath& file_path,
143 scoped_refptr<base::TaskRunner> file_task_runner) { 144 scoped_refptr<base::TaskRunner> file_task_runner) {
144 } 145 }
145 146
146 void TestURLFetcher::SaveResponseToTemporaryFile( 147 void TestURLFetcher::SaveResponseToTemporaryFile(
147 scoped_refptr<base::TaskRunner> file_task_runner) { 148 scoped_refptr<base::TaskRunner> file_task_runner) {
148 } 149 }
149 150
151 void TestURLFetcher::SaveResponseWithWriter(
152 scoped_ptr<URLFetcherResponseWriter> response_writer) {
153 }
154
150 HttpResponseHeaders* TestURLFetcher::GetResponseHeaders() const { 155 HttpResponseHeaders* TestURLFetcher::GetResponseHeaders() const {
151 return fake_response_headers_.get(); 156 return fake_response_headers_.get();
152 } 157 }
153 158
154 HostPortPair TestURLFetcher::GetSocketAddress() const { 159 HostPortPair TestURLFetcher::GetSocketAddress() const {
155 NOTIMPLEMENTED(); 160 NOTIMPLEMENTED();
156 return HostPortPair(); 161 return HostPortPair();
157 } 162 }
158 163
159 bool TestURLFetcher::WasFetchedViaProxy() const { 164 bool TestURLFetcher::WasFetchedViaProxy() const {
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 375
371 URLFetcher* URLFetcherImplFactory::CreateURLFetcher( 376 URLFetcher* URLFetcherImplFactory::CreateURLFetcher(
372 int id, 377 int id,
373 const GURL& url, 378 const GURL& url,
374 URLFetcher::RequestType request_type, 379 URLFetcher::RequestType request_type,
375 URLFetcherDelegate* d) { 380 URLFetcherDelegate* d) {
376 return new URLFetcherImpl(url, request_type, d); 381 return new URLFetcherImpl(url, request_type, d);
377 } 382 }
378 383
379 } // namespace net 384 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/test_url_fetcher_factory.h ('k') | net/url_request/url_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698