cef/libcef/request_impl.h
Marshall Greenblatt 35e21da884 Add DLL build support and wrapper that allows clients to transparently switch between static and dynamic CEF builds.
- The libcef project now builds libcef_static.lib instead of libcef.lib.
- The libcef_dll project builds libcef.lib and libcef.dll.  This DLL exports the new CEF C API defined in cef_capi.h, cef_nplugin_capi.h, cef_string.h and cef_string_map.h.
- The libcef_dll_wrapper project builds libcef_dll_wrapper.lib.  This static library wraps the new C API calls with an implementation of the CEF C++ interface as defined in cef.h and cef_nplugin.h.
- The cefclient project now uses the DLL instead of the static library.
- Type definitions have been moved from cef.h to cef_types.h so that they can be shared by both cef.h and cef_capi.h.  This change required some enumeration member name modifications throughout the code base.
- Fixed variable naming inconsistencies.
- Added CefVariant::GetArraySize() method and _NPN_ArrayObjectGetVectorSize() function.
- Remove the ProjectSection(WebsiteProperties) sections from cef.sln to improve VS2005 performance.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@16 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2009-03-05 01:10:06 +00:00

97 lines
2.7 KiB
C++

// Copyright (c) 2008 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 _REQUEST_IMPL_H
#define _REQUEST_IMPL_H
#include "../include/cef.h"
#include "net/base/upload_data.h"
#include "webkit/glue/weburlrequest.h"
// Implementation of CefRequest
class CefRequestImpl : public CefThreadSafeBase<CefRequest>
{
public:
CefRequestImpl();
~CefRequestImpl();
virtual std::wstring GetURL();
virtual void SetURL(const std::wstring& url);
virtual std::wstring GetFrame();
virtual void SetFrame(const std::wstring& frame);
virtual std::wstring GetMethod();
virtual void SetMethod(const std::wstring& method);
virtual CefRefPtr<CefPostData> GetPostData();
virtual void SetPostData(CefRefPtr<CefPostData> postData);
virtual void GetHeaderMap(HeaderMap& headerMap);
virtual void SetHeaderMap(const HeaderMap& headerMap);
virtual void Set(const std::wstring& url,
const std::wstring& frame,
const std::wstring& method,
CefRefPtr<CefPostData> postData,
const HeaderMap& headerMap);
void SetHeaderMap(const WebRequest::HeaderMap& map);
void GetHeaderMap(WebRequest::HeaderMap& map);
protected:
std::wstring url_;
std::wstring frame_;
std::wstring method_;
CefRefPtr<CefPostData> postdata_;
HeaderMap headermap_;
};
// Implementation of CefPostData
class CefPostDataImpl : public CefThreadSafeBase<CefPostData>
{
public:
CefPostDataImpl();
~CefPostDataImpl();
virtual size_t GetElementCount();
virtual void GetElements(ElementVector& elements);
virtual bool RemoveElement(CefRefPtr<CefPostDataElement> element);
virtual bool AddElement(CefRefPtr<CefPostDataElement> element);
virtual void RemoveElements();
void Set(const net::UploadData& data);
void Get(net::UploadData& data);
protected:
ElementVector elements_;
};
// Implementation of CefPostDataElement
class CefPostDataElementImpl : public CefThreadSafeBase<CefPostDataElement>
{
public:
CefPostDataElementImpl();
~CefPostDataElementImpl();
virtual void SetToEmpty();
virtual void SetToFile(const std::wstring& fileName);
virtual void SetToBytes(size_t size, const void* bytes);
virtual Type GetType();
virtual std::wstring GetFile();
virtual size_t GetBytesCount();
virtual size_t GetBytes(size_t size, void *bytes);
void Set(const net::UploadData::Element& element);
void Get(net::UploadData::Element& element);
protected:
Type type_;
union {
struct {
void* bytes;
size_t size;
} bytes;
wchar_t* filename;
} data_;
};
#endif // _REQUEST_IMPL_H