| 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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 throttles_.clear(); | 86 throttles_.clear(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Constructs a ResourceThrottle if the request for |url| should be held. | 89 // Constructs a ResourceThrottle if the request for |url| should be held. |
| 90 // | 90 // |
| 91 // Needs to be invoked on the IO thread. | 91 // Needs to be invoked on the IO thread. |
| 92 content::ResourceThrottle* CreateResourceThrottle( | 92 content::ResourceThrottle* CreateResourceThrottle( |
| 93 const GURL& url, | 93 const GURL& url, |
| 94 ResourceType::Type resource_type) { | 94 ResourceType::Type resource_type) { |
| 95 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 95 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 96 if (urls_to_delay_.find(url) == urls_to_delay_.end()) | 96 if (urls_to_delay_.find(url) == urls_to_delay_.end()) |
| 97 return NULL; | 97 return NULL; |
| 98 | 98 |
| 99 Throttle* throttle = new Throttle(); | 99 Throttle* throttle = new Throttle(); |
| 100 throttles_.push_back(throttle->AsWeakPtr()); | 100 throttles_.push_back(throttle->AsWeakPtr()); |
| 101 return throttle; | 101 return throttle; |
| 102 } | 102 } |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 friend class base::RefCountedThreadSafe<TestNavigationListener>; | 105 friend class base::RefCountedThreadSafe<TestNavigationListener>; |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 "extensions/api_test/webnavigation/crash/b.html", | 628 "extensions/api_test/webnavigation/crash/b.html", |
| 629 embedded_test_server()->port())); | 629 embedded_test_server()->port())); |
| 630 ui_test_utils::NavigateToURL(browser(), url); | 630 ui_test_utils::NavigateToURL(browser(), url); |
| 631 | 631 |
| 632 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 632 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 633 } | 633 } |
| 634 | 634 |
| 635 #endif | 635 #endif |
| 636 | 636 |
| 637 } // namespace extensions | 637 } // namespace extensions |
| OLD | NEW |