Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / net / url_request / url_request_data_job.h
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.
4
5 #ifndef NET_URL_REQUEST_URL_REQUEST_DATA_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_DATA_JOB_H_
7
8 #include <string>
9
10 #include "net/url_request/url_request.h"
11 #include "net/url_request/url_request_simple_job.h"
12
13 class GURL;
14
15 namespace net {
16
17 class HttpResponseHeaders;
18 class URLRequest;
19
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);
29
30   URLRequestDataJob(URLRequest* request, NetworkDelegate* network_delegate);
31
32   // URLRequestSimpleJob
33   int GetData(std::string* mime_type,
34               std::string* charset,
35               std::string* data,
36               const CompletionCallback& callback) const override;
37
38  private:
39   ~URLRequestDataJob() override;
40
41   DISALLOW_COPY_AND_ASSIGN(URLRequestDataJob);
42 };
43
44 }  // namespace net
45
46 #endif  // NET_URL_REQUEST_URL_REQUEST_DATA_JOB_H_