2014-10-31 11:17:05 -07:00
|
|
|
// Copyright (c) 2013 GitHub, Inc.
|
2014-04-25 17:49:37 +08:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
2013-08-30 16:16:41 +08:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_BROWSER_NET_URL_REQUEST_STRING_JOB_H_
|
|
|
|
#define ATOM_BROWSER_NET_URL_REQUEST_STRING_JOB_H_
|
|
|
|
|
2015-08-12 21:32:52 +08:00
|
|
|
#include <string>
|
|
|
|
|
2015-08-12 13:30:19 +08:00
|
|
|
#include "atom/browser/net/js_asker.h"
|
2013-08-30 20:02:17 +08:00
|
|
|
#include "net/url_request/url_request_simple_job.h"
|
|
|
|
|
2013-08-30 16:16:41 +08:00
|
|
|
namespace atom {
|
|
|
|
|
2015-08-12 13:30:19 +08:00
|
|
|
class URLRequestStringJob : public JsAsker<net::URLRequestSimpleJob> {
|
2013-08-30 16:16:41 +08:00
|
|
|
public:
|
2015-08-12 22:57:25 +08:00
|
|
|
URLRequestStringJob(net::URLRequest*, net::NetworkDelegate*);
|
2015-08-12 13:30:19 +08:00
|
|
|
|
|
|
|
// JsAsker:
|
2016-05-23 10:59:39 +09:00
|
|
|
void StartAsync(std::unique_ptr<base::Value> options) override;
|
2013-08-30 16:16:41 +08:00
|
|
|
|
2015-09-15 19:54:16 +05:30
|
|
|
// URLRequestJob:
|
|
|
|
void GetResponseInfo(net::HttpResponseInfo* info) override;
|
|
|
|
|
2013-08-30 16:16:41 +08:00
|
|
|
// URLRequestSimpleJob:
|
2015-01-09 17:24:36 -08:00
|
|
|
int GetData(std::string* mime_type,
|
|
|
|
std::string* charset,
|
|
|
|
std::string* data,
|
|
|
|
const net::CompletionCallback& callback) const override;
|
2013-08-30 16:16:41 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string mime_type_;
|
|
|
|
std::string charset_;
|
|
|
|
std::string data_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(URLRequestStringJob);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
|
|
|
#endif // ATOM_BROWSER_NET_URL_REQUEST_STRING_JOB_H_
|