| 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 <deque> | 5 #include <deque> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 class ChannelDestructionWatcher { | 143 class ChannelDestructionWatcher { |
| 144 public: | 144 public: |
| 145 ChannelDestructionWatcher() : channel_destroyed_(false), | 145 ChannelDestructionWatcher() : channel_destroyed_(false), |
| 146 waiting_for_channel_destruction_(false) { | 146 waiting_for_channel_destruction_(false) { |
| 147 } | 147 } |
| 148 | 148 |
| 149 ~ChannelDestructionWatcher() { | 149 ~ChannelDestructionWatcher() { |
| 150 } | 150 } |
| 151 | 151 |
| 152 void WatchChannel(content::RenderProcessHost* host) { | 152 void WatchChannel(content::RenderProcessHost* host) { |
| 153 host->GetChannel()->AddFilter(new DestructionMessageFilter(this)); | 153 host->AddFilter(new DestructionMessageFilter(this)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void WaitForChannelClose() { | 156 void WaitForChannelClose() { |
| 157 ASSERT_FALSE(waiting_for_channel_destruction_); | 157 ASSERT_FALSE(waiting_for_channel_destruction_); |
| 158 | 158 |
| 159 if (channel_destroyed_) | 159 if (channel_destroyed_) |
| 160 return; | 160 return; |
| 161 waiting_for_channel_destruction_ = true; | 161 waiting_for_channel_destruction_ = true; |
| 162 content::RunMessageLoop(); | 162 content::RunMessageLoop(); |
| 163 | 163 |
| (...skipping 2895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3059 PrerenderTestURL("files/prerender/prerender_page.html", | 3059 PrerenderTestURL("files/prerender/prerender_page.html", |
| 3060 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); | 3060 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); |
| 3061 WebContents* web_contents = | 3061 WebContents* web_contents = |
| 3062 current_browser()->tab_strip_model()->GetActiveWebContents(); | 3062 current_browser()->tab_strip_model()->GetActiveWebContents(); |
| 3063 web_contents->IncrementCapturerCount(); | 3063 web_contents->IncrementCapturerCount(); |
| 3064 NavigateToDestURLWithDisposition(CURRENT_TAB, false); | 3064 NavigateToDestURLWithDisposition(CURRENT_TAB, false); |
| 3065 web_contents->DecrementCapturerCount(); | 3065 web_contents->DecrementCapturerCount(); |
| 3066 } | 3066 } |
| 3067 | 3067 |
| 3068 } // namespace prerender | 3068 } // namespace prerender |
| OLD | NEW |