2011-05-20 16:42:25 +02:00
|
|
|
// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
|
2010-10-03 23:04:50 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// A portion of this file was generated by the CEF translator tool. When
|
|
|
|
// making changes by hand only do so within the body of existing static and
|
|
|
|
// virtual method implementations. See the translator.README.txt file in the
|
|
|
|
// tools directory for more information.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/ctocpp/post_data_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/request_ctocpp.h"
|
|
|
|
#include "libcef_dll/transfer_util.h"
|
|
|
|
|
|
|
|
|
|
|
|
// STATIC METHODS - Body may be edited by hand.
|
|
|
|
|
|
|
|
CefRefPtr<CefRequest> CefRequest::CreateRequest()
|
|
|
|
{
|
|
|
|
cef_request_t* impl = cef_request_create();
|
|
|
|
if(impl)
|
|
|
|
return CefRequestCToCpp::Wrap(impl);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString CefRequestCToCpp::GetURL()
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString str;
|
2010-10-03 23:04:50 +02:00
|
|
|
if(CEF_MEMBER_MISSING(struct_, get_url))
|
|
|
|
return str;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
cef_string_userfree_t strPtr = struct_->get_url(struct_);
|
|
|
|
str.AttachToUserFree(strPtr);
|
2010-10-03 23:04:50 +02:00
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
void CefRequestCToCpp::SetURL(const CefString& url)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, set_url))
|
|
|
|
return;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
struct_->set_url(struct_, url.GetStruct());
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString CefRequestCToCpp::GetMethod()
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString str;
|
2010-10-03 23:04:50 +02:00
|
|
|
if(CEF_MEMBER_MISSING(struct_, get_method))
|
|
|
|
return str;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
cef_string_userfree_t strPtr = struct_->get_method(struct_);
|
|
|
|
str.AttachToUserFree(strPtr);
|
2010-10-03 23:04:50 +02:00
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
void CefRequestCToCpp::SetMethod(const CefString& method)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, set_method))
|
|
|
|
return;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
struct_->set_method(struct_, method.GetStruct());
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefPostData> CefRequestCToCpp::GetPostData()
|
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, get_post_data))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
cef_post_data_t* postDataStruct = struct_->get_post_data(struct_);
|
|
|
|
if(postDataStruct)
|
|
|
|
return CefPostDataCToCpp::Wrap(postDataStruct);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefRequestCToCpp::SetPostData(CefRefPtr<CefPostData> postData)
|
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, set_post_data))
|
|
|
|
return;
|
|
|
|
|
|
|
|
cef_post_data_t* postDataStruct = NULL;
|
|
|
|
if(postData.get())
|
|
|
|
postDataStruct = CefPostDataCToCpp::Unwrap(postData);
|
|
|
|
|
|
|
|
struct_->set_post_data(struct_, postDataStruct);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap)
|
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, get_header_map))
|
|
|
|
return;
|
|
|
|
|
|
|
|
cef_string_map_t map = cef_string_map_alloc();
|
|
|
|
if(!map)
|
|
|
|
return;
|
|
|
|
|
|
|
|
struct_->get_header_map(struct_, map);
|
|
|
|
transfer_string_map_contents(map, headerMap);
|
|
|
|
cef_string_map_free(map);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap)
|
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, set_header_map))
|
|
|
|
return;
|
|
|
|
|
|
|
|
cef_string_map_t map = NULL;
|
|
|
|
if(!headerMap.empty()) {
|
|
|
|
map = cef_string_map_alloc();
|
|
|
|
if(!map)
|
|
|
|
return;
|
|
|
|
transfer_string_map_contents(headerMap, map);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct_->set_header_map(struct_, map);
|
|
|
|
|
|
|
|
if(map)
|
|
|
|
cef_string_map_free(map);
|
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
void CefRequestCToCpp::Set(const CefString& url, const CefString& method,
|
2010-10-03 23:04:50 +02:00
|
|
|
CefRefPtr<CefPostData> postData, const HeaderMap& headerMap)
|
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, set))
|
|
|
|
return;
|
|
|
|
|
|
|
|
cef_post_data_t* postDataStruct = NULL;
|
|
|
|
if(postData.get())
|
|
|
|
postDataStruct = CefPostDataCToCpp::Unwrap(postData);
|
|
|
|
|
|
|
|
cef_string_map_t map = NULL;
|
|
|
|
if(!headerMap.empty()) {
|
|
|
|
map = cef_string_map_alloc();
|
|
|
|
if(!map)
|
|
|
|
return;
|
|
|
|
transfer_string_map_contents(headerMap, map);
|
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
struct_->set(struct_, url.GetStruct(), method.GetStruct(), postDataStruct,
|
|
|
|
map);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
if(map)
|
|
|
|
cef_string_map_free(map);
|
|
|
|
}
|
|
|
|
|
2011-02-09 23:04:35 +01:00
|
|
|
CefRequest::RequestFlags CefRequestCToCpp::GetFlags()
|
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, get_flags))
|
|
|
|
return WUR_FLAG_NONE;
|
|
|
|
|
|
|
|
return struct_->get_flags(struct_);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefRequestCToCpp::SetFlags(RequestFlags flags)
|
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, set_flags))
|
|
|
|
return;
|
|
|
|
|
|
|
|
struct_->set_flags(struct_, flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefString CefRequestCToCpp::GetFirstPartyForCookies()
|
|
|
|
{
|
|
|
|
CefString str;
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, get_first_party_for_cookies))
|
|
|
|
return str;
|
|
|
|
|
|
|
|
cef_string_userfree_t strPtr = struct_->get_first_party_for_cookies(struct_);
|
|
|
|
str.AttachToUserFree(strPtr);
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url)
|
|
|
|
{
|
|
|
|
if(CEF_MEMBER_MISSING(struct_, set_first_party_for_cookies))
|
|
|
|
return;
|
|
|
|
|
|
|
|
struct_->set_first_party_for_cookies(struct_, url.GetStruct());
|
|
|
|
}
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#ifndef NDEBUG
|
2010-12-07 02:30:26 +01:00
|
|
|
template<> long CefCToCpp<CefRequestCToCpp, CefRequest,
|
|
|
|
cef_request_t>::DebugObjCt = 0;
|
2010-10-03 23:04:50 +02:00
|
|
|
#endif
|
|
|
|
|