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

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

Issue 165333004: Revert "Allow MessageFilters to restrict listening to specific message classes" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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 3871 matching lines...) Expand 10 before | Expand all | Expand 10 after
4081 } 4080 }
4082 }; 4081 };
4083 4082
4084 // Checks that prerendering works in incognito mode. 4083 // Checks that prerendering works in incognito mode.
4085 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) { 4084 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) {
4086 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); 4085 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
4087 NavigateToDestURL(); 4086 NavigateToDestURL();
4088 } 4087 }
4089 4088
4090 } // namespace prerender 4089 } // 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