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

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

Issue 10944013: Make original_response_headers parameter of NetworkDelegate::OnHeadersReceived const (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 8 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
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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #endif 10 #endif
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 const CompletionCallback& callback, 231 const CompletionCallback& callback,
232 GURL* new_url) OVERRIDE; 232 GURL* new_url) OVERRIDE;
233 233
234 virtual int OnBeforeSendHeaders(URLRequest* request, 234 virtual int OnBeforeSendHeaders(URLRequest* request,
235 const CompletionCallback& callback, 235 const CompletionCallback& callback,
236 HttpRequestHeaders* headers) OVERRIDE; 236 HttpRequestHeaders* headers) OVERRIDE;
237 237
238 virtual int OnHeadersReceived( 238 virtual int OnHeadersReceived(
239 URLRequest* request, 239 URLRequest* request,
240 const CompletionCallback& callback, 240 const CompletionCallback& callback,
241 HttpResponseHeaders* original_response_headers, 241 const HttpResponseHeaders* original_response_headers,
242 scoped_refptr<HttpResponseHeaders>* override_response_headers) OVERRIDE; 242 scoped_refptr<HttpResponseHeaders>* override_response_headers) OVERRIDE;
243 243
244 virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired( 244 virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
245 URLRequest* request, 245 URLRequest* request,
246 const AuthChallengeInfo& auth_info, 246 const AuthChallengeInfo& auth_info,
247 const AuthCallback& callback, 247 const AuthCallback& callback,
248 AuthCredentials* credentials) OVERRIDE; 248 AuthCredentials* credentials) OVERRIDE;
249 249
250 // Resets the callbacks and |stage_blocked_for_callback_|. 250 // Resets the callbacks and |stage_blocked_for_callback_|.
251 void Reset(); 251 void Reset();
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 const CompletionCallback& callback, 346 const CompletionCallback& callback,
347 HttpRequestHeaders* headers) { 347 HttpRequestHeaders* headers) {
348 TestNetworkDelegate::OnBeforeSendHeaders(request, callback, headers); 348 TestNetworkDelegate::OnBeforeSendHeaders(request, callback, headers);
349 349
350 return MaybeBlockStage(ON_BEFORE_SEND_HEADERS, callback); 350 return MaybeBlockStage(ON_BEFORE_SEND_HEADERS, callback);
351 } 351 }
352 352
353 int BlockingNetworkDelegate::OnHeadersReceived( 353 int BlockingNetworkDelegate::OnHeadersReceived(
354 URLRequest* request, 354 URLRequest* request,
355 const CompletionCallback& callback, 355 const CompletionCallback& callback,
356 HttpResponseHeaders* original_response_headers, 356 const HttpResponseHeaders* original_response_headers,
357 scoped_refptr<HttpResponseHeaders>* override_response_headers) { 357 scoped_refptr<HttpResponseHeaders>* override_response_headers) {
358 TestNetworkDelegate::OnHeadersReceived( 358 TestNetworkDelegate::OnHeadersReceived(
359 request, callback, original_response_headers, 359 request, callback, original_response_headers,
360 override_response_headers); 360 override_response_headers);
361 361
362 return MaybeBlockStage(ON_HEADERS_RECEIVED, callback); 362 return MaybeBlockStage(ON_HEADERS_RECEIVED, callback);
363 } 363 }
364 364
365 NetworkDelegate::AuthRequiredResponse BlockingNetworkDelegate::OnAuthRequired( 365 NetworkDelegate::AuthRequiredResponse BlockingNetworkDelegate::OnAuthRequired(
366 URLRequest* request, 366 URLRequest* request,
(...skipping 4466 matching lines...) Expand 10 before | Expand all | Expand 10 after
4833 4833
4834 EXPECT_FALSE(r.is_pending()); 4834 EXPECT_FALSE(r.is_pending());
4835 EXPECT_EQ(1, d->response_started_count()); 4835 EXPECT_EQ(1, d->response_started_count());
4836 EXPECT_FALSE(d->received_data_before_response()); 4836 EXPECT_FALSE(d->received_data_before_response());
4837 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); 4837 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size));
4838 } 4838 }
4839 } 4839 }
4840 #endif // !defined(DISABLE_FTP_SUPPORT) 4840 #endif // !defined(DISABLE_FTP_SUPPORT)
4841 4841
4842 } // namespace net 4842 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698