Home | History | Annotate | Download | only in proxy

Lines Matching refs:job

36 // An "executor" is a job-runner for PAC requests. It encapsulates a worker
51 // Submit a job to this executor.
52 void StartJob(Job* job);
54 // Callback for when a job has completed running on the executor's thread.
55 void OnJobCompleted(Job* job);
63 // Returns the outstanding job, or NULL.
64 Job* outstanding_job() const { return outstanding_job_.get(); }
77 // The currently active job for this executor (either a SetPacScript or
79 scoped_refptr<Job> outstanding_job_;
91 // MultiThreadedProxyResolver::Job ---------------------------------------------
93 class MultiThreadedProxyResolver::Job
94 : public base::RefCountedThreadSafe<MultiThreadedProxyResolver::Job> {
96 // Identifies the subclass of Job (only being used for debugging purposes).
103 Job(Type type, CompletionCallback* user_callback)
114 // The "executor" is the job runner that is scheduling this job. If
115 // this job has not been submitted to an executor yet, this will be
121 // Mark the job as having been cancelled.
131 // Returns true if this job still has a user callback. Some jobs
139 // This method is called when the job is inserted into a wait queue
143 // This method is called just before the job is posted to the work thread.
146 // This method is called on the worker thread to do the job's work. On
166 friend class base::RefCountedThreadSafe<MultiThreadedProxyResolver::Job>;
168 virtual ~Job() {}
181 : public MultiThreadedProxyResolver::Job {
185 : Job(callback ? TYPE_SET_PAC_SCRIPT : TYPE_SET_PAC_SCRIPT_INTERNAL,
217 : public MultiThreadedProxyResolver::Job {
225 : Job(TYPE_GET_PROXY_FOR_URL, callback),
270 // The Job may have been cancelled after it was started.
313 void MultiThreadedProxyResolver::Executor::StartJob(Job* job) {
315 outstanding_job_ = job;
317 // Run the job. Once it has completed (regardless of whether it was
319 job->set_executor(this);
320 job->FinishedWaitingForThread();
323 NewRunnableMethod(job, &Job::Run, MessageLoop::current()));
326 void MultiThreadedProxyResolver::Executor::OnJobCompleted(Job* job) {
327 DCHECK_EQ(job, outstanding_job_.get());
348 // Cancel any outstanding job.
351 // Orphan the job (since this executor may be deleted soon).
407 scoped_refptr<GetProxyForURLJob> job(
413 *request = reinterpret_cast<RequestHandle>(job.get());
419 executor->StartJob(job);
425 job->WaitingForThread();
426 pending_jobs_.push_back(job);
443 Job* job = reinterpret_cast<Job*>(req);
444 DCHECK_EQ(Job::TYPE_GET_PROXY_FOR_URL, job->type());
446 if (job->executor()) {
447 // If the job was already submitted to the executor, just mark it
449 job->Cancel();
451 // Otherwise the job is just sitting in a queue.
453 std::find(pending_jobs_.begin(), pending_jobs_.end(), job);
463 DCHECK_EQ(Job::TYPE_SET_PAC_SCRIPT,
512 Job* job = executor->outstanding_job();
517 // outstanding job AFTER the callback has been invoked, it is possible
519 CHECK(!job || job->was_cancelled() || !job->has_user_callback());
563 // Get the next job to process (FIFO). Transfer it from the pending queue
565 scoped_refptr<Job> job = pending_jobs_.front();
567 executor->StartJob(job);