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

Unified Diff: headless/public/util/kv_map_request_job.h

Issue 2049363003: Adds support for headless chrome embedder mojo services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Abandon (for now) the concice bindings. Add BINDINGS_POLICY_HEADLESS and headless-mojo:// Created 4 years, 6 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
Index: headless/public/util/kv_map_request_job.h
diff --git a/headless/public/util/kv_map_request_job.h b/headless/public/util/kv_map_request_job.h
new file mode 100644
index 0000000000000000000000000000000000000000..4272ae37946a18f88bfe3a3f008bcea9036837d4
--- /dev/null
+++ b/headless/public/util/kv_map_request_job.h
@@ -0,0 +1,44 @@
+// 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_TEST_TEST_URL_REQUEST_JOB_H_
+#define HEADLESS_TEST_TEST_URL_REQUEST_JOB_H_
+
+#include "base/memory/weak_ptr.h"
+#include "headless/public/util/kv_map_protocol_handler.h"
+#include "net/url_request/url_request_job.h"
+
+namespace net {
+class StringIOBuffer;
+class DrainableIOBuffer;
+}
+
+namespace headless {
+class KVMapRequestJob : public net::URLRequestJob {
+ public:
+ KVMapRequestJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate,
+ const KVMapProtocolHandler::Response* response);
+
+ // net::URLRequestJob implementation:
+ void Start() override;
+ void Kill() override;
+ int ReadRawData(net::IOBuffer* buf, int buf_size) override;
+ bool GetMimeType(std::string* mime_type) const override;
+
+ private:
+ ~KVMapRequestJob() override;
+ void StartAsync();
+
+ const KVMapProtocolHandler::Response* response_; // NOT OWNED
+ size_t data_offset_;
+
+ base::WeakPtrFactory<KVMapRequestJob> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(KVMapRequestJob);
+};
+
+} // namespace headless
+
+#endif // HEADLESS_TEST_TEST_URL_REQUEST_JOB_H_

Powered by Google App Engine
This is Rietveld 408576698