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

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

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 6 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
« no previous file with comments | « net/dns/mock_host_resolver.cc ('k') | net/ftp/ftp_network_layer.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 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 friend class base::RefCountedThreadSafe<SerialWorker>; 54 friend class base::RefCountedThreadSafe<SerialWorker>;
55 // protected to allow sub-classing, but prevent deleting 55 // protected to allow sub-classing, but prevent deleting
56 virtual ~SerialWorker(); 56 virtual ~SerialWorker();
57 57
58 // Executed on WorkerPool, at most once at a time. 58 // Executed on WorkerPool, at most once at a time.
59 virtual void DoWork() = 0; 59 virtual void DoWork() = 0;
60 60
61 // Executed on origin thread after |DoRead| completes. 61 // Executed on origin thread after |DoRead| completes.
62 virtual void OnWorkFinished() = 0; 62 virtual void OnWorkFinished() = 0;
63 63
64 base::MessageLoopProxy* loop() { 64 base::MessageLoopProxy* loop() { return message_loop_.get(); }
65 return message_loop_;
66 }
67 65
68 private: 66 private:
69 enum State { 67 enum State {
70 CANCELLED = -1, 68 CANCELLED = -1,
71 IDLE = 0, 69 IDLE = 0,
72 WORKING, // |DoWorkJob| posted on WorkerPool, until |OnWorkJobFinished| 70 WORKING, // |DoWorkJob| posted on WorkerPool, until |OnWorkJobFinished|
73 PENDING, // |WorkNow| while WORKING, must re-do work 71 PENDING, // |WorkNow| while WORKING, must re-do work
74 WAITING, // WorkerPool is busy, |RetryWork| is posted 72 WAITING, // WorkerPool is busy, |RetryWork| is posted
75 }; 73 };
76 74
(...skipping 12 matching lines...) Expand all
89 87
90 State state_; 88 State state_;
91 89
92 DISALLOW_COPY_AND_ASSIGN(SerialWorker); 90 DISALLOW_COPY_AND_ASSIGN(SerialWorker);
93 }; 91 };
94 92
95 } // namespace net 93 } // namespace net
96 94
97 #endif // NET_DNS_SERIAL_WORKER_H_ 95 #endif // NET_DNS_SERIAL_WORKER_H_
98 96
OLDNEW
« no previous file with comments | « net/dns/mock_host_resolver.cc ('k') | net/ftp/ftp_network_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698