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

Side by Side Diff: content/public/test/test_utils.cc

Issue 671663002: Standardize usage of virtual/override/final in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « content/public/test/test_utils.h ('k') | content/public/utility/utility_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/public/test/test_utils.h" 5 #include "content/public/test/test_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void ScriptCallback::ResultCallback(const base::Value* result) { 67 void ScriptCallback::ResultCallback(const base::Value* result) {
68 if (result) 68 if (result)
69 result_.reset(result->DeepCopy()); 69 result_.reset(result->DeepCopy());
70 base::MessageLoop::current()->Quit(); 70 base::MessageLoop::current()->Quit();
71 } 71 }
72 72
73 // Monitors if any task is processed by the message loop. 73 // Monitors if any task is processed by the message loop.
74 class TaskObserver : public base::MessageLoop::TaskObserver { 74 class TaskObserver : public base::MessageLoop::TaskObserver {
75 public: 75 public:
76 TaskObserver() : processed_(false) {} 76 TaskObserver() : processed_(false) {}
77 virtual ~TaskObserver() {} 77 ~TaskObserver() override {}
78 78
79 // MessageLoop::TaskObserver overrides. 79 // MessageLoop::TaskObserver overrides.
80 virtual void WillProcessTask(const base::PendingTask& pending_task) override { 80 void WillProcessTask(const base::PendingTask& pending_task) override {}
81 } 81 void DidProcessTask(const base::PendingTask& pending_task) override {
82 virtual void DidProcessTask(const base::PendingTask& pending_task) override {
83 processed_ = true; 82 processed_ = true;
84 } 83 }
85 84
86 // Returns true if any task was processed. 85 // Returns true if any task was processed.
87 bool processed() const { return processed_; } 86 bool processed() const { return processed_; }
88 87
89 private: 88 private:
90 bool processed_; 89 bool processed_;
91 DISALLOW_COPY_AND_ASSIGN(TaskObserver); 90 DISALLOW_COPY_AND_ASSIGN(TaskObserver);
92 }; 91 };
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 void InProcessUtilityThreadHelper::BrowserChildProcessHostDisconnected( 302 void InProcessUtilityThreadHelper::BrowserChildProcessHostDisconnected(
304 const ChildProcessData& data) { 303 const ChildProcessData& data) {
305 if (--child_thread_count_) 304 if (--child_thread_count_)
306 return; 305 return;
307 306
308 if (runner_.get()) 307 if (runner_.get())
309 runner_->Quit(); 308 runner_->Quit();
310 } 309 }
311 310
312 } // namespace content 311 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/test_utils.h ('k') | content/public/utility/utility_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698