Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / net / url_request / url_request_data_job.h
blob0b3c7fad1e2317ff58d6d8c0baea5b01f0130d19
1 // Copyright (c) 2012 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.
5 #ifndef NET_URL_REQUEST_URL_REQUEST_DATA_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_DATA_JOB_H_
8 #include <string>
10 #include "net/url_request/url_request.h"
11 #include "net/url_request/url_request_simple_job.h"
13 class GURL;
15 namespace net {
17 class HttpResponseHeaders;
18 class URLRequest;
20 class NET_EXPORT URLRequestDataJob : public URLRequestSimpleJob {
21 public:
22 // Extracts info from a data scheme URL. Returns OK if successful. Returns
23 // ERR_INVALID_URL otherwise.
24 static int BuildResponse(const GURL& url,
25 std::string* mime_type,
26 std::string* charset,
27 std::string* data,
28 HttpResponseHeaders* headers);
30 URLRequestDataJob(URLRequest* request, NetworkDelegate* network_delegate);
32 // URLRequestSimpleJob
33 int GetData(std::string* mime_type,
34 std::string* charset,
35 std::string* data,
36 const CompletionCallback& callback) const override;
38 private:
39 ~URLRequestDataJob() override;
41 DISALLOW_COPY_AND_ASSIGN(URLRequestDataJob);
44 } // namespace net
46 #endif // NET_URL_REQUEST_URL_REQUEST_DATA_JOB_H_