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

Unified Diff: headless/public/util/expedited_dispatcher.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/public/util/expedited_dispatcher.h ('k') | headless/public/util/expedited_dispatcher_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/util/expedited_dispatcher.cc
diff --git a/headless/public/util/expedited_dispatcher.cc b/headless/public/util/expedited_dispatcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0120442dd0ec4ac04aeecc969faf1d4e55b11bdc
--- /dev/null
+++ b/headless/public/util/expedited_dispatcher.cc
@@ -0,0 +1,39 @@
+// 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.
+
+#include "headless/public/util/expedited_dispatcher.h"
+
+#include <utility>
+
+#include "base/bind.h"
+#include "headless/public/util/managed_dispatch_url_request_job.h"
+
+namespace headless {
+
+ExpeditedDispatcher::ExpeditedDispatcher(
+ scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner)
+ : io_thread_task_runner_(std::move(io_thread_task_runner)) {}
+
+ExpeditedDispatcher::~ExpeditedDispatcher() {}
+
+void ExpeditedDispatcher::JobCreated(ManagedDispatchURLRequestJob*) {}
+
+void ExpeditedDispatcher::JobKilled(ManagedDispatchURLRequestJob*) {}
+
+void ExpeditedDispatcher::JobFailed(ManagedDispatchURLRequestJob* job,
+ net::Error error) {
+ io_thread_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&ManagedDispatchURLRequestJob::OnStartError,
+ base::Unretained(job), error));
+}
+
+void ExpeditedDispatcher::DataReady(ManagedDispatchURLRequestJob* job) {
+ io_thread_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&ManagedDispatchURLRequestJob::OnHeadersComplete,
+ base::Unretained(job)));
+}
+
+void ExpeditedDispatcher::JobDeleted(ManagedDispatchURLRequestJob*) {}
+
+} // namespace headless
« no previous file with comments | « headless/public/util/expedited_dispatcher.h ('k') | headless/public/util/expedited_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698