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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 8 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
9 #include "content/public/browser/navigation_entry.h" | 9 #include "content/public/browser/navigation_entry.h" |
10 #include "content/public/browser/resource_dispatcher_host_delegate.h" | 10 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 123 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
124 run_loop_quit_closure_); | 124 run_loop_quit_closure_); |
125 } | 125 } |
126 | 126 |
127 // These live on the IO thread. | 127 // These live on the IO thread. |
128 GURL tracked_url_; | 128 GURL tracked_url_; |
129 bool throttle_created_; | 129 bool throttle_created_; |
130 base::Closure run_loop_quit_closure_; | 130 base::Closure run_loop_quit_closure_; |
131 | 131 |
132 // This lives on the UI thread. | 132 // This lives on the UI thread. |
133 scoped_ptr<base::RunLoop> run_loop_; | 133 std::unique_ptr<base::RunLoop> run_loop_; |
134 | 134 |
135 // Set on the IO thread while |run_loop_| is non-nullptr, read on the UI | 135 // Set on the IO thread while |run_loop_| is non-nullptr, read on the UI |
136 // thread after deleting run_loop_. | 136 // thread after deleting run_loop_. |
137 bool tracked_request_completed_; | 137 bool tracked_request_completed_; |
138 | 138 |
139 DISALLOW_COPY_AND_ASSIGN(TrackingResourceDispatcherHostDelegate); | 139 DISALLOW_COPY_AND_ASSIGN(TrackingResourceDispatcherHostDelegate); |
140 }; | 140 }; |
141 | 141 |
142 // WebContentsDelegate that fails to open a URL when there's a request that | 142 // WebContentsDelegate that fails to open a URL when there's a request that |
143 // needs to be transferred between renderers. | 143 // needs to be transferred between renderers. |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); | 412 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); |
413 EXPECT_EQ(url1, controller.GetEntryAtIndex(0)->GetURL()); | 413 EXPECT_EQ(url1, controller.GetEntryAtIndex(0)->GetURL()); |
414 | 414 |
415 // Make sure the request for url2 did not complete. | 415 // Make sure the request for url2 did not complete. |
416 EXPECT_FALSE(tracking_delegate().WaitForTrackedURLAndGetCompleted()); | 416 EXPECT_FALSE(tracking_delegate().WaitForTrackedURLAndGetCompleted()); |
417 | 417 |
418 shell()->web_contents()->SetDelegate(old_delegate); | 418 shell()->web_contents()->SetDelegate(old_delegate); |
419 } | 419 } |
420 | 420 |
421 } // namespace content | 421 } // namespace content |
OLD | NEW |