OLD | NEW |
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/url_fetcher_impl.h" | 5 #include "net/url_request/url_fetcher_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 // URLFetcherDelegate: | 403 // URLFetcherDelegate: |
404 virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE; | 404 virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE; |
405 | 405 |
406 void CancelRequest(); | 406 void CancelRequest(); |
407 }; | 407 }; |
408 | 408 |
409 // Version of TestURLRequestContext that posts a Quit task to the IO | 409 // Version of TestURLRequestContext that posts a Quit task to the IO |
410 // thread once it is deleted. | 410 // thread once it is deleted. |
411 class CancelTestURLRequestContext : public ThrottlingTestURLRequestContext { | 411 class CancelTestURLRequestContext : public ThrottlingTestURLRequestContext { |
412 public: | 412 public: |
413 explicit CancelTestURLRequestContext() { | 413 CancelTestURLRequestContext() { |
414 } | 414 } |
415 | 415 |
416 private: | 416 private: |
417 virtual ~CancelTestURLRequestContext() { | 417 virtual ~CancelTestURLRequestContext() { |
418 // The d'tor should execute in the IO thread. Post the quit task to the | 418 // The d'tor should execute in the IO thread. Post the quit task to the |
419 // current thread. | 419 // current thread. |
420 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 420 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
421 } | 421 } |
422 }; | 422 }; |
423 | 423 |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit(). | 1551 MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit(). |
1552 | 1552 |
1553 MessageLoop::current()->RunUntilIdle(); | 1553 MessageLoop::current()->RunUntilIdle(); |
1554 ASSERT_FALSE(file_util::PathExists(file_path_)) | 1554 ASSERT_FALSE(file_util::PathExists(file_path_)) |
1555 << file_path_.value() << " not removed."; | 1555 << file_path_.value() << " not removed."; |
1556 } | 1556 } |
1557 | 1557 |
1558 } // namespace | 1558 } // namespace |
1559 | 1559 |
1560 } // namespace net | 1560 } // namespace net |
OLD | NEW |