Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef HEADLESS_PUBLIC_UTIL_EXPEDITED_DISPATCHER_H_ | |
| 6 #define HEADLESS_PUBLIC_UTIL_EXPEDITED_DISPATCHER_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/single_thread_task_runner.h" | |
| 11 #include "headless/public/util/url_request_dispatcher.h" | |
| 12 #include "net/base/net_errors.h" | |
| 13 | |
| 14 namespace headless { | |
| 15 | |
| 16 class ManagedDispatchURLRequestJob; | |
| 17 | |
| 18 // This class dispatches calls to OnHeadersComplete and OnStartError | |
| 19 // immediatly sacrificing determinism for performance. | |
|
Sami
2016/08/19 11:54:00
typo: immediately
alex clarke (OOO till 29th)
2016/08/19 12:48:57
Done.
| |
| 20 class ExpeditedDispatcher : public URLRequestDispatcher { | |
| 21 public: | |
| 22 explicit ExpeditedDispatcher( | |
| 23 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner); | |
| 24 ~ExpeditedDispatcher() override; | |
| 25 | |
| 26 // UrlRequestDispatcher implementation: | |
| 27 void JobCreated(ManagedDispatchURLRequestJob* job) override; | |
| 28 void JobKilled(ManagedDispatchURLRequestJob* job) override; | |
| 29 void JobFailed(ManagedDispatchURLRequestJob* job, net::Error error) override; | |
| 30 void DataReady(ManagedDispatchURLRequestJob* job) override; | |
| 31 void JobDeleted(ManagedDispatchURLRequestJob* job) override; | |
| 32 | |
| 33 private: | |
| 34 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(ExpeditedDispatcher); | |
| 37 }; | |
| 38 | |
| 39 } // namespace headless | |
| 40 | |
| 41 #endif // HEADLESS_PUBLIC_UTIL_EXPEDITED_DISPATCHER_H_ | |
| OLD | NEW |