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

Side by Side Diff: components/browsing_data/content/conditional_cache_deletion_helper.cc

Issue 2375663002: Replace MessageLoop::current()->task_runner() with ThreadTaskRunnerHandle::Get(). (Closed)
Patch Set: rebase Created 4 years, 2 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/browsing_data/content/conditional_cache_deletion_helper.h" 5 #include "components/browsing_data/content/conditional_cache_deletion_helper.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 if (previous_entry_) { 72 if (previous_entry_) {
73 if (condition_.Run(previous_entry_)) 73 if (condition_.Run(previous_entry_))
74 previous_entry_->Doom(); 74 previous_entry_->Doom();
75 previous_entry_->Close(); 75 previous_entry_->Close();
76 } 76 }
77 77
78 if (error == net::ERR_FAILED) { 78 if (error == net::ERR_FAILED) {
79 // The iteration finished successfuly or we can no longer iterate 79 // The iteration finished successfuly or we can no longer iterate
80 // (e.g. the cache was destroyed). We cannot distinguish between the two, 80 // (e.g. the cache was destroyed). We cannot distinguish between the two,
81 // but we know that there is nothing more that we can do, so we return OK. 81 // but we know that there is nothing more that we can do, so we return OK.
82 base::MessageLoop::current()->task_runner()->PostTask( 82 base::ThreadTaskRunnerHandle::Get()->PostTask(
83 FROM_HERE, base::Bind(completion_callback_, net::OK)); 83 FROM_HERE, base::Bind(completion_callback_, net::OK));
84 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); 84 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
85 return; 85 return;
86 } 86 }
87 87
88 previous_entry_ = current_entry_; 88 previous_entry_ = current_entry_;
89 error = iterator_->OpenNextEntry( 89 error = iterator_->OpenNextEntry(
90 &current_entry_, 90 &current_entry_,
91 base::Bind(&ConditionalCacheDeletionHelper::IterateOverEntries, 91 base::Bind(&ConditionalCacheDeletionHelper::IterateOverEntries,
92 base::Unretained(this))); 92 base::Unretained(this)));
93 } 93 }
94 } 94 }
95 95
96 } // namespace browsing_data 96 } // namespace browsing_data
OLDNEW
« no previous file with comments | « components/browser_watcher/window_hang_monitor_win.cc ('k') | components/favicon/core/large_icon_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698