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

Side by Side Diff: content/browser/storage_partition_impl_unittest.cc

Issue 1398153002: Don't use base::MessageLoop::{Quit,QuitClosure} in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/files/file_util.h" 5 #include "base/files/file_util.h"
6 #include "base/location.h" 6 #include "base/location.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 base::MessageLoop::current()->Run(); 74 base::MessageLoop::current()->Run();
75 } else { 75 } else {
76 DCHECK(!start_); 76 DCHECK(!start_);
77 already_quit_ = false; 77 already_quit_ = false;
78 } 78 }
79 } 79 }
80 80
81 void Notify() { 81 void Notify() {
82 if (start_) { 82 if (start_) {
83 DCHECK(!already_quit_); 83 DCHECK(!already_quit_);
84 base::MessageLoop::current()->Quit(); 84 base::MessageLoop::current()->QuitWhenIdle();
85 start_ = false; 85 start_ = false;
86 } else { 86 } else {
87 DCHECK(!already_quit_); 87 DCHECK(!already_quit_);
88 already_quit_ = true; 88 already_quit_ = true;
89 } 89 }
90 } 90 }
91 91
92 private: 92 private:
93 // Helps prevent from running message_loop, if the callback invoked 93 // Helps prevent from running message_loop, if the callback invoked
94 // immediately. 94 // immediately.
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 &run_loop)); 914 &run_loop));
915 run_loop.Run(); 915 run_loop.Run();
916 916
917 // kOrigin1 and kOrigin2 do not have age more than a week. 917 // kOrigin1 and kOrigin2 do not have age more than a week.
918 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin1)); 918 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin1));
919 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin2)); 919 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin2));
920 EXPECT_TRUE(tester.DOMStorageExistsForOrigin(kOrigin3)); 920 EXPECT_TRUE(tester.DOMStorageExistsForOrigin(kOrigin3));
921 } 921 }
922 922
923 } // namespace content 923 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698