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/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void ResumeAll() { | 89 void ResumeAll() { |
90 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) { | 90 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) { |
91 content::BrowserThread::PostTask( | 91 content::BrowserThread::PostTask( |
92 content::BrowserThread::IO, | 92 content::BrowserThread::IO, |
93 FROM_HERE, | 93 FROM_HERE, |
94 base::Bind(&TestNavigationListener::ResumeAll, this)); | 94 base::Bind(&TestNavigationListener::ResumeAll, this)); |
95 return; | 95 return; |
96 } | 96 } |
97 WeakThrottleList::const_iterator it; | 97 WeakThrottleList::const_iterator it; |
98 for (it = throttles_.begin(); it != throttles_.end(); ++it) { | 98 for (it = throttles_.begin(); it != throttles_.end(); ++it) { |
99 if (*it) | 99 if (it->get()) |
100 (*it)->Resume(); | 100 (*it)->Resume(); |
101 } | 101 } |
102 throttles_.clear(); | 102 throttles_.clear(); |
103 } | 103 } |
104 | 104 |
105 // Constructs a ResourceThrottle if the request for |url| should be held. | 105 // Constructs a ResourceThrottle if the request for |url| should be held. |
106 // | 106 // |
107 // Needs to be invoked on the IO thread. | 107 // Needs to be invoked on the IO thread. |
108 content::ResourceThrottle* CreateResourceThrottle( | 108 content::ResourceThrottle* CreateResourceThrottle( |
109 const GURL& url, | 109 const GURL& url, |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 url = GURL(base::StringPrintf( | 751 url = GURL(base::StringPrintf( |
752 "http://www.a.com:%d/" | 752 "http://www.a.com:%d/" |
753 "files/extensions/api_test/webnavigation/crash/b.html", | 753 "files/extensions/api_test/webnavigation/crash/b.html", |
754 test_server()->host_port_pair().port())); | 754 test_server()->host_port_pair().port())); |
755 ui_test_utils::NavigateToURL(browser(), url); | 755 ui_test_utils::NavigateToURL(browser(), url); |
756 | 756 |
757 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 757 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
758 } | 758 } |
759 | 759 |
760 } // namespace extensions | 760 } // namespace extensions |
OLD | NEW |