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

Side by Side Diff: chrome/browser/net/url_fetcher.cc

Issue 155897: Add support to URLRequest for deferring redirects.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/net/url_fetcher.h" 5 #include "chrome/browser/net/url_fetcher.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/thread.h" 9 #include "base/thread.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 26 matching lines...) Expand all
37 // reference, the IO thread could interrupt things, run a task, Release() 37 // reference, the IO thread could interrupt things, run a task, Release()
38 // us, and destroy us, leaving the caller with an already-destroyed object 38 // us, and destroy us, leaving the caller with an already-destroyed object
39 // when construction finishes. 39 // when construction finishes.
40 void Start(); 40 void Start();
41 41
42 // Stops any in-progress load and ensures no callback will happen. It is 42 // Stops any in-progress load and ensures no callback will happen. It is
43 // safe to call this multiple times. 43 // safe to call this multiple times.
44 void Stop(); 44 void Stop();
45 45
46 // URLRequest::Delegate implementations 46 // URLRequest::Delegate implementations
47 virtual void OnReceivedRedirect(URLRequest* request,
48 const GURL& new_url) { }
49 virtual void OnResponseStarted(URLRequest* request); 47 virtual void OnResponseStarted(URLRequest* request);
50 virtual void OnReadCompleted(URLRequest* request, int bytes_read); 48 virtual void OnReadCompleted(URLRequest* request, int bytes_read);
51 49
52 URLFetcher::Delegate* delegate() const { return delegate_; } 50 URLFetcher::Delegate* delegate() const { return delegate_; }
53 51
54 private: 52 private:
55 // Wrapper functions that allow us to ensure actions happen on the right 53 // Wrapper functions that allow us to ensure actions happen on the right
56 // thread. 54 // thread.
57 void StartURLRequest(); 55 void StartURLRequest();
58 void CancelURLRequest(); 56 void CancelURLRequest();
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 core_->Start(); 304 core_->Start();
307 } 305 }
308 306
309 const GURL& URLFetcher::url() const { 307 const GURL& URLFetcher::url() const {
310 return core_->url_; 308 return core_->url_;
311 } 309 }
312 310
313 URLFetcher::Delegate* URLFetcher::delegate() const { 311 URLFetcher::Delegate* URLFetcher::delegate() const {
314 return core_->delegate(); 312 return core_->delegate();
315 } 313 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698