blob: 6c85b9a836dc02f476295f35bfd8a2c858a8e330 [file] [log] [blame]
// Copyright 2014 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SYZYGY_KASKO_HTTP_AGENT_IMPL_H_
#define SYZYGY_KASKO_HTTP_AGENT_IMPL_H_
#include "base/macros.h"
#include "base/strings/string16.h"
#include "syzygy/kasko/http_agent.h"
namespace kasko {
// Implements HttpAgent using WinHttp. Respects the user proxy settings if any.
class HttpAgentImpl : public HttpAgent {
public:
// Constructs an HttpAgentImpl.
// @param product_name The product name to include in the User-Agent header.
// @param product_version The product version to include in the User-Agent
// header.
HttpAgentImpl(const base::string16& product_name,
const base::string16& product_version);
~HttpAgentImpl() override;
// HttpAgent implementation
virtual std::unique_ptr<HttpResponse> Post(
const base::string16& host,
uint16_t port,
const base::string16& path,
bool secure,
const base::string16& extra_headers,
const std::string& body) override;
private:
base::string16 user_agent_;
DISALLOW_COPY_AND_ASSIGN(HttpAgentImpl);
};
} // namespace kasko
#endif // SYZYGY_KASKO_HTTP_AGENT_IMPL_H_