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

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

Issue 9721002: [net/dns] Removes locking from DnsConfigServiceWin and adds local computer name. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move lowercasing to ServeFromHosts, add test. Reorganize OnHostsRead. Created 8 years, 9 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 | « net/dns/file_path_watcher_wrapper.h ('k') | net/dns/serial_worker.cc » ('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 #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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 // Unless already scheduled, post |DoWork| to WorkerPool. 45 // Unless already scheduled, post |DoWork| to WorkerPool.
46 // Made virtual to allow mocking. 46 // Made virtual to allow mocking.
47 virtual void WorkNow(); 47 virtual void WorkNow();
48 48
49 // Stop scheduling jobs. 49 // Stop scheduling jobs.
50 void Cancel(); 50 void Cancel();
51 51
52 bool IsCancelled() const { return state_ == CANCELLED; } 52 bool IsCancelled() const { return state_ == CANCELLED; }
53 53
54 // Delay between calls to WorkerPool::PostTask
55 static const int kWorkerPoolRetryDelayMs = 100;
56
57 protected: 54 protected:
58 friend class base::RefCountedThreadSafe<SerialWorker>; 55 friend class base::RefCountedThreadSafe<SerialWorker>;
59 // protected to allow sub-classing, but prevent deleting 56 // protected to allow sub-classing, but prevent deleting
60 virtual ~SerialWorker(); 57 virtual ~SerialWorker();
61 58
62 // Executed on WorkerPool, at most once at a time. 59 // Executed on WorkerPool, at most once at a time.
63 virtual void DoWork() = 0; 60 virtual void DoWork() = 0;
64 61
65 // Executed on origin thread after |DoRead| completes. 62 // Executed on origin thread after |DoRead| completes.
66 virtual void OnWorkFinished() = 0; 63 virtual void OnWorkFinished() = 0;
(...skipping 26 matching lines...) Expand all
93 90
94 State state_; 91 State state_;
95 92
96 DISALLOW_COPY_AND_ASSIGN(SerialWorker); 93 DISALLOW_COPY_AND_ASSIGN(SerialWorker);
97 }; 94 };
98 95
99 } // namespace net 96 } // namespace net
100 97
101 #endif // NET_DNS_SERIAL_WORKER_H_ 98 #endif // NET_DNS_SERIAL_WORKER_H_
102 99
OLDNEW
« no previous file with comments | « net/dns/file_path_watcher_wrapper.h ('k') | net/dns/serial_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698