OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_PROXY_SINGLE_THREADED_PROXY_RESOLVER_H_ | 5 #ifndef NET_PROXY_SINGLE_THREADED_PROXY_RESOLVER_H_ |
6 #define NET_PROXY_SINGLE_THREADED_PROXY_RESOLVER_H_ | 6 #define NET_PROXY_SINGLE_THREADED_PROXY_RESOLVER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 friend class Job; | 51 friend class Job; |
52 class SetPacScriptTask; | 52 class SetPacScriptTask; |
53 friend class SetPacScriptTask; | 53 friend class SetPacScriptTask; |
54 // FIFO queue that contains the in-progress job, and any pending jobs. | 54 // FIFO queue that contains the in-progress job, and any pending jobs. |
55 typedef std::deque<scoped_refptr<Job> > PendingJobsQueue; | 55 typedef std::deque<scoped_refptr<Job> > PendingJobsQueue; |
56 | 56 |
57 base::Thread* thread() { return thread_.get(); } | 57 base::Thread* thread() { return thread_.get(); } |
58 | 58 |
59 // ProxyResolver implementation: | 59 // ProxyResolver implementation: |
60 virtual int SetPacScript(const GURL& pac_url, | 60 virtual int SetPacScript(const GURL& pac_url, |
61 const std::string& pac_bytes, | 61 const string16& pac_script, |
62 CompletionCallback* callback); | 62 CompletionCallback* callback); |
63 | 63 |
64 // Starts the worker thread if it isn't already running. | 64 // Starts the worker thread if it isn't already running. |
65 void EnsureThreadStarted(); | 65 void EnsureThreadStarted(); |
66 | 66 |
67 // Starts the next job from |pending_jobs_| if possible. | 67 // Starts the next job from |pending_jobs_| if possible. |
68 void ProcessPendingJobs(); | 68 void ProcessPendingJobs(); |
69 | 69 |
70 // Removes the front entry of the jobs queue. |expected_job| is our | 70 // Removes the front entry of the jobs queue. |expected_job| is our |
71 // expectation of what the front of the job queue is; it is only used by | 71 // expectation of what the front of the job queue is; it is only used by |
(...skipping 13 matching lines...) Expand all Loading... |
85 // executing on |thread_|. | 85 // executing on |thread_|. |
86 scoped_ptr<base::Thread> thread_; | 86 scoped_ptr<base::Thread> thread_; |
87 | 87 |
88 PendingJobsQueue pending_jobs_; | 88 PendingJobsQueue pending_jobs_; |
89 scoped_refptr<SetPacScriptTask> outstanding_set_pac_script_task_; | 89 scoped_refptr<SetPacScriptTask> outstanding_set_pac_script_task_; |
90 }; | 90 }; |
91 | 91 |
92 } // namespace net | 92 } // namespace net |
93 | 93 |
94 #endif // NET_PROXY_SINGLE_THREADED_PROXY_RESOLVER_H_ | 94 #endif // NET_PROXY_SINGLE_THREADED_PROXY_RESOLVER_H_ |
OLD | NEW |