2013-08-30 08:16:41 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2014-03-16 00:30:26 +00:00
|
|
|
#include "atom/browser/net/url_request_string_job.h"
|
2013-08-30 08:16:41 +00:00
|
|
|
|
2014-03-16 01:13:06 +00:00
|
|
|
#include <string>
|
|
|
|
|
2013-08-30 08:16:41 +00:00
|
|
|
#include "net/base/net_errors.h"
|
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
URLRequestStringJob::URLRequestStringJob(net::URLRequest* request,
|
|
|
|
net::NetworkDelegate* network_delegate,
|
|
|
|
const std::string& mime_type,
|
|
|
|
const std::string& charset,
|
|
|
|
const std::string& data)
|
|
|
|
: net::URLRequestSimpleJob(request, network_delegate),
|
|
|
|
mime_type_(mime_type),
|
|
|
|
charset_(charset),
|
|
|
|
data_(data) {
|
|
|
|
}
|
|
|
|
|
|
|
|
int URLRequestStringJob::GetData(
|
|
|
|
std::string* mime_type,
|
|
|
|
std::string* charset,
|
|
|
|
std::string* data,
|
|
|
|
const net::CompletionCallback& callback) const {
|
|
|
|
*mime_type = mime_type_;
|
|
|
|
*charset = charset_;
|
|
|
|
*data = data_;
|
|
|
|
return net::OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace atom
|