| OLD | NEW |
| 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 Loading... |
| 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) { } |
| 47 virtual void OnResponseStarted(URLRequest* request); | 49 virtual void OnResponseStarted(URLRequest* request); |
| 48 virtual void OnReadCompleted(URLRequest* request, int bytes_read); | 50 virtual void OnReadCompleted(URLRequest* request, int bytes_read); |
| 49 | 51 |
| 50 URLFetcher::Delegate* delegate() const { return delegate_; } | 52 URLFetcher::Delegate* delegate() const { return delegate_; } |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 // Wrapper functions that allow us to ensure actions happen on the right | 55 // Wrapper functions that allow us to ensure actions happen on the right |
| 54 // thread. | 56 // thread. |
| 55 void StartURLRequest(); | 57 void StartURLRequest(); |
| 56 void CancelURLRequest(); | 58 void CancelURLRequest(); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 core_->Start(); | 306 core_->Start(); |
| 305 } | 307 } |
| 306 | 308 |
| 307 const GURL& URLFetcher::url() const { | 309 const GURL& URLFetcher::url() const { |
| 308 return core_->url_; | 310 return core_->url_; |
| 309 } | 311 } |
| 310 | 312 |
| 311 URLFetcher::Delegate* URLFetcher::delegate() const { | 313 URLFetcher::Delegate* URLFetcher::delegate() const { |
| 312 return core_->delegate(); | 314 return core_->delegate(); |
| 313 } | 315 } |
| OLD | NEW |