| 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 <list> | 5 #include <list> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Needs to be invoked on the IO thread. | 122 // Needs to be invoked on the IO thread. |
| 123 std::unique_ptr<content::ResourceThrottle> CreateResourceThrottle( | 123 std::unique_ptr<content::ResourceThrottle> CreateResourceThrottle( |
| 124 const GURL& url) { | 124 const GURL& url) { |
| 125 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 125 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 126 if (urls_to_delay_.find(url) == urls_to_delay_.end()) | 126 if (urls_to_delay_.find(url) == urls_to_delay_.end()) |
| 127 return NULL; | 127 return NULL; |
| 128 | 128 |
| 129 auto throttle = base::MakeUnique<Throttle>(); | 129 auto throttle = base::MakeUnique<Throttle>(); |
| 130 throttle->set_url(url); | 130 throttle->set_url(url); |
| 131 throttles_.push_back(throttle->AsWeakPtr()); | 131 throttles_.push_back(throttle->AsWeakPtr()); |
| 132 return throttle; | 132 return std::move(throttle); |
| 133 } | 133 } |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 friend class base::RefCountedThreadSafe<TestNavigationListener>; | 136 friend class base::RefCountedThreadSafe<TestNavigationListener>; |
| 137 | 137 |
| 138 virtual ~TestNavigationListener() {} | 138 virtual ~TestNavigationListener() {} |
| 139 | 139 |
| 140 // Stores a throttle per URL request that we have delayed. | 140 // Stores a throttle per URL request that we have delayed. |
| 141 class Throttle : public content::ResourceThrottle, | 141 class Throttle : public content::ResourceThrottle, |
| 142 public base::SupportsWeakPtr<Throttle> { | 142 public base::SupportsWeakPtr<Throttle> { |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 "extensions/api_test/webnavigation/crash/b.html", | 807 "extensions/api_test/webnavigation/crash/b.html", |
| 808 embedded_test_server()->port())); | 808 embedded_test_server()->port())); |
| 809 ui_test_utils::NavigateToURL(browser(), url); | 809 ui_test_utils::NavigateToURL(browser(), url); |
| 810 | 810 |
| 811 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 811 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 812 } | 812 } |
| 813 | 813 |
| 814 #endif | 814 #endif |
| 815 | 815 |
| 816 } // namespace extensions | 816 } // namespace extensions |
| OLD | NEW |