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

Side by Side Diff: net/dns/serial_worker.h

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 #ifndef NET_DNS_SERIAL_WORKER_H_ 5 #ifndef NET_DNS_SERIAL_WORKER_H_
6 #define NET_DNS_SERIAL_WORKER_H_ 6 #define NET_DNS_SERIAL_WORKER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 19 matching lines...) Expand all
30 // 30 //
31 // Derived classes should store results of work done in |DoWork| in dedicated 31 // Derived classes should store results of work done in |DoWork| in dedicated
32 // fields and read them in |OnWorkFinished| which is executed on the origin 32 // fields and read them in |OnWorkFinished| which is executed on the origin
33 // thread. This avoids the need to template this class. 33 // thread. This avoids the need to template this class.
34 // 34 //
35 // This implementation avoids locking by using the |state_| member to ensure 35 // This implementation avoids locking by using the |state_| member to ensure
36 // that |DoWork| and |OnWorkFinished| cannot execute in parallel. 36 // that |DoWork| and |OnWorkFinished| cannot execute in parallel.
37 // 37 //
38 // TODO(szym): update to WorkerPool::PostTaskAndReply once available. 38 // TODO(szym): update to WorkerPool::PostTaskAndReply once available.
39 class NET_EXPORT_PRIVATE SerialWorker 39 class NET_EXPORT_PRIVATE SerialWorker
40 : NON_EXPORTED_BASE(public base::RefCountedThreadSafe<SerialWorker>) { 40 : NON_EXPORTED_BASE(public base::RefCountedThreadSafe<SerialWorker>) {
41 public: 41 public:
42 SerialWorker(); 42 SerialWorker();
43 43
44 // Unless already scheduled, post |DoWork| to WorkerPool. 44 // Unless already scheduled, post |DoWork| to WorkerPool.
45 // Made virtual to allow mocking. 45 // Made virtual to allow mocking.
46 virtual void WorkNow(); 46 virtual void WorkNow();
47 47
48 // Stop scheduling jobs. 48 // Stop scheduling jobs.
49 void Cancel(); 49 void Cancel();
50 50
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 scoped_refptr<base::MessageLoopProxy> message_loop_; 86 scoped_refptr<base::MessageLoopProxy> message_loop_;
87 87
88 State state_; 88 State state_;
89 89
90 DISALLOW_COPY_AND_ASSIGN(SerialWorker); 90 DISALLOW_COPY_AND_ASSIGN(SerialWorker);
91 }; 91 };
92 92
93 } // namespace net 93 } // namespace net
94 94
95 #endif // NET_DNS_SERIAL_WORKER_H_ 95 #endif // NET_DNS_SERIAL_WORKER_H_
96
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698