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

Side by Side Diff: headless/public/util/expedited_dispatcher.h

Issue 2260793002: Headless utility classes for making deterministic protocol handlers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 4 years, 4 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
OLDNEW
(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 // immediately sacrificing determinism for performance.
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_
OLDNEW
« no previous file with comments | « headless/public/util/deterministic_dispatcher_test.cc ('k') | headless/public/util/expedited_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698