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

Side by Side Diff: chrome/browser/favicon/content_favicon_driver_browsertest.cc

Issue 2825003002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/{a,b,c,d,e,f,g}* (Closed)
Patch Set: split rest of changes to 3 CLs Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/favicon/content/content_favicon_driver.h" 5 #include "components/favicon/content/content_favicon_driver.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 const gfx::Image& image) override { 140 const gfx::Image& image) override {
141 OnNotification(); 141 OnNotification();
142 } 142 }
143 143
144 void OnNotification() { 144 void OnNotification() {
145 if (!quit_closure_.is_null()) { 145 if (!quit_closure_.is_null()) {
146 // We stop waiting based on changes in state to FaviconHandler which occur 146 // We stop waiting based on changes in state to FaviconHandler which occur
147 // immediately after OnFaviconUpdated() is called. Post a task to check if 147 // immediately after OnFaviconUpdated() is called. Post a task to check if
148 // we can stop waiting. 148 // we can stop waiting.
149 base::ThreadTaskRunnerHandle::Get()->PostTask( 149 base::ThreadTaskRunnerHandle::Get()->PostTask(
150 FROM_HERE, base::Bind(&PendingTaskWaiter::EndLoopIfCanStopWaiting, 150 FROM_HERE, base::BindOnce(&PendingTaskWaiter::EndLoopIfCanStopWaiting,
151 weak_factory_.GetWeakPtr())); 151 weak_factory_.GetWeakPtr()));
152 } 152 }
153 } 153 }
154 154
155 void EndLoopIfCanStopWaiting() { 155 void EndLoopIfCanStopWaiting() {
156 if (!quit_closure_.is_null() && 156 if (!quit_closure_.is_null() &&
157 load_stopped_ && 157 load_stopped_ &&
158 !checker_->HasPendingTasks()) { 158 !checker_->HasPendingTasks()) {
159 quit_closure_.Run(); 159 quit_closure_.Run();
160 } 160 }
161 } 161 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 // A reload ignoring the cache should refetch the favicon from the website. 233 // A reload ignoring the cache should refetch the favicon from the website.
234 { 234 {
235 PendingTaskWaiter waiter(web_contents(), this); 235 PendingTaskWaiter waiter(web_contents(), this);
236 chrome::ExecuteCommand(browser(), IDC_RELOAD_BYPASSING_CACHE); 236 chrome::ExecuteCommand(browser(), IDC_RELOAD_BYPASSING_CACHE);
237 waiter.Wait(); 237 waiter.Wait();
238 } 238 }
239 ASSERT_TRUE(delegate->was_requested()); 239 ASSERT_TRUE(delegate->was_requested());
240 EXPECT_TRUE(delegate->bypassed_cache()); 240 EXPECT_TRUE(delegate->bypassed_cache());
241 } 241 }
OLDNEW
« no previous file with comments | « chrome/browser/experiments/memory_ablation_experiment.cc ('k') | chrome/browser/feedback/feedback_profile_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698