2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_COMMON_RESPONSE_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_COMMON_RESPONSE_IMPL_H_
|
|
|
|
#pragma once
|
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
#include "base/synchronization/lock.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
#include "cef/include/cef_response.h"
|
2014-07-15 00:18:51 +02:00
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
namespace net {
|
|
|
|
class HttpResponseHeaders;
|
2018-04-10 19:04:57 +02:00
|
|
|
} // namespace net
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2013-11-08 22:28:56 +01:00
|
|
|
namespace blink {
|
2012-06-19 18:29:49 +02:00
|
|
|
class WebURLResponse;
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Implementation of CefResponse.
|
|
|
|
class CefResponseImpl : public CefResponse {
|
|
|
|
public:
|
|
|
|
CefResponseImpl();
|
|
|
|
|
2012-06-19 18:29:49 +02:00
|
|
|
// CefResponse methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsReadOnly() override;
|
2016-05-11 20:20:07 +02:00
|
|
|
cef_errorcode_t GetError() override;
|
|
|
|
void SetError(cef_errorcode_t error) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
int GetStatus() override;
|
|
|
|
void SetStatus(int status) override;
|
|
|
|
CefString GetStatusText() override;
|
|
|
|
void SetStatusText(const CefString& statusText) override;
|
|
|
|
CefString GetMimeType() override;
|
|
|
|
void SetMimeType(const CefString& mimeType) override;
|
2019-04-24 04:50:25 +02:00
|
|
|
CefString GetCharset() override;
|
|
|
|
void SetCharset(const CefString& charset) override;
|
2019-10-14 13:32:38 +02:00
|
|
|
CefString GetHeaderByName(const CefString& name) override;
|
|
|
|
void SetHeaderByName(const CefString& name,
|
|
|
|
const CefString& value,
|
|
|
|
bool overwrite) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void GetHeaderMap(HeaderMap& headerMap) override;
|
|
|
|
void SetHeaderMap(const HeaderMap& headerMap) override;
|
2018-04-10 19:04:57 +02:00
|
|
|
CefString GetURL() override;
|
|
|
|
void SetURL(const CefString& url) override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2020-03-04 01:29:39 +01:00
|
|
|
scoped_refptr<net::HttpResponseHeaders> GetResponseHeaders();
|
2012-06-19 18:29:49 +02:00
|
|
|
void SetResponseHeaders(const net::HttpResponseHeaders& headers);
|
|
|
|
|
2013-11-08 22:28:56 +01:00
|
|
|
void Set(const blink::WebURLResponse& response);
|
2012-06-19 18:29:49 +02:00
|
|
|
|
|
|
|
void SetReadOnly(bool read_only);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
protected:
|
2024-01-20 23:48:57 +01:00
|
|
|
cef_errorcode_t error_code_ = ERR_NONE;
|
|
|
|
int status_code_ = 0;
|
2012-04-03 03:34:16 +02:00
|
|
|
CefString status_text_;
|
|
|
|
CefString mime_type_;
|
2019-04-24 04:50:25 +02:00
|
|
|
CefString charset_;
|
2018-04-10 19:04:57 +02:00
|
|
|
CefString url_;
|
2012-04-03 03:34:16 +02:00
|
|
|
HeaderMap header_map_;
|
2024-01-20 23:48:57 +01:00
|
|
|
bool read_only_ = false;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
base::Lock lock_;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
IMPLEMENT_REFCOUNTING(CefResponseImpl);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_RESPONSE_IMPL_H_
|