Chromium Code Reviews| Index: headless/public/util/expedited_dispatcher.h |
| diff --git a/headless/public/util/expedited_dispatcher.h b/headless/public/util/expedited_dispatcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cbe47a05e301cc913fda561b15c0925f2ad2358d |
| --- /dev/null |
| +++ b/headless/public/util/expedited_dispatcher.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef HEADLESS_PUBLIC_UTIL_EXPEDITED_DISPATCHER_H_ |
| +#define HEADLESS_PUBLIC_UTIL_EXPEDITED_DISPATCHER_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/single_thread_task_runner.h" |
| +#include "headless/public/util/url_request_dispatcher.h" |
| +#include "net/base/net_errors.h" |
| + |
| +namespace headless { |
| + |
| +class ManagedDispatchURLRequestJob; |
| + |
| +// This class dispatches calls to OnHeadersComplete and OnStartError |
| +// 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.
|
| +class ExpeditedDispatcher : public URLRequestDispatcher { |
| + public: |
| + explicit ExpeditedDispatcher( |
| + scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner); |
| + ~ExpeditedDispatcher() override; |
| + |
| + // UrlRequestDispatcher implementation: |
| + void JobCreated(ManagedDispatchURLRequestJob* job) override; |
| + void JobKilled(ManagedDispatchURLRequestJob* job) override; |
| + void JobFailed(ManagedDispatchURLRequestJob* job, net::Error error) override; |
| + void DataReady(ManagedDispatchURLRequestJob* job) override; |
| + void JobDeleted(ManagedDispatchURLRequestJob* job) override; |
| + |
| + private: |
| + scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ExpeditedDispatcher); |
| +}; |
| + |
| +} // namespace headless |
| + |
| +#endif // HEADLESS_PUBLIC_UTIL_EXPEDITED_DISPATCHER_H_ |