Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 174493005: Merge 252428 "Revert "Allow MessageFilters to restrict listening..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 run_loop_.Run(); 188 run_loop_.Run();
189 EXPECT_TRUE(channel_destroyed_); 189 EXPECT_TRUE(channel_destroyed_);
190 } 190 }
191 191
192 private: 192 private:
193 // When destroyed, calls ChannelDestructionWatcher::OnChannelDestroyed. 193 // When destroyed, calls ChannelDestructionWatcher::OnChannelDestroyed.
194 // Ignores all messages. 194 // Ignores all messages.
195 class DestructionMessageFilter : public content::BrowserMessageFilter { 195 class DestructionMessageFilter : public content::BrowserMessageFilter {
196 public: 196 public:
197 explicit DestructionMessageFilter(ChannelDestructionWatcher* watcher) 197 explicit DestructionMessageFilter(ChannelDestructionWatcher* watcher)
198 : BrowserMessageFilter(0), 198 : watcher_(watcher) {
199 watcher_(watcher) {
200 } 199 }
201 200
202 private: 201 private:
203 virtual ~DestructionMessageFilter() { 202 virtual ~DestructionMessageFilter() {
204 content::BrowserThread::PostTask( 203 content::BrowserThread::PostTask(
205 content::BrowserThread::UI, FROM_HERE, 204 content::BrowserThread::UI, FROM_HERE,
206 base::Bind(&ChannelDestructionWatcher::OnChannelDestroyed, 205 base::Bind(&ChannelDestructionWatcher::OnChannelDestroyed,
207 base::Unretained(watcher_))); 206 base::Unretained(watcher_)));
208 } 207 }
209 208
(...skipping 3858 matching lines...) Expand 10 before | Expand all | Expand 10 after
4068 } 4067 }
4069 }; 4068 };
4070 4069
4071 // Checks that prerendering works in incognito mode. 4070 // Checks that prerendering works in incognito mode.
4072 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) { 4071 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) {
4073 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); 4072 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
4074 NavigateToDestURL(); 4073 NavigateToDestURL();
4075 } 4074 }
4076 4075
4077 } // namespace prerender 4076 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_info_message_filter.cc ('k') | chrome/browser/prerender/prerender_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698