mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Add CefURLRequest support (issue #517).
- Add CefBrowserProcessHandler interface (issue #650). - Internally re-register supported schemes with CefCookieManager after changing the storage path (issue #651). - Add CefResourceHandler callbacks for blocking cookie loading and saving (issue #652). - Allow custom scheme handlers for requests that do not originate from browser content (issue #653). - Use 'int' instead of 'RequestFlags' for CefRequest::GetFlags and SetFlags (issue #654). - Rename cef_request.h CreateObject methods to Create (issue #655). - Add #ifdef guards to cef_tuple.h to allow the use of both cef_runnable.h and base/bind.h in the same unit test source file. - Retrieve cookieable schemes as part of ClientApp::RegisterCustomSchemes and register with the global cookie manager. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@697 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -9,17 +9,23 @@
|
||||
#include "include/cef_request.h"
|
||||
#include "net/base/upload_data.h"
|
||||
#include "net/http/http_request_headers.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPBody.h"
|
||||
|
||||
namespace net {
|
||||
class URLRequest;
|
||||
};
|
||||
|
||||
namespace WebKit {
|
||||
class WebURLRequest;
|
||||
}
|
||||
|
||||
// Implementation of CefRequest
|
||||
class CefRequestImpl : public CefRequest {
|
||||
public:
|
||||
CefRequestImpl();
|
||||
~CefRequestImpl() {}
|
||||
|
||||
virtual bool IsReadOnly() OVERRIDE;
|
||||
virtual CefString GetURL() OVERRIDE;
|
||||
virtual void SetURL(const CefString& url) OVERRIDE;
|
||||
virtual CefString GetMethod() OVERRIDE;
|
||||
@ -32,8 +38,8 @@ class CefRequestImpl : public CefRequest {
|
||||
const CefString& method,
|
||||
CefRefPtr<CefPostData> postData,
|
||||
const HeaderMap& headerMap) OVERRIDE;
|
||||
virtual RequestFlags GetFlags() OVERRIDE;
|
||||
virtual void SetFlags(RequestFlags flags) OVERRIDE;
|
||||
virtual int GetFlags() OVERRIDE;
|
||||
virtual void SetFlags(int flags) OVERRIDE;
|
||||
virtual CefString GetFirstPartyForCookies() OVERRIDE;
|
||||
virtual void SetFirstPartyForCookies(const CefString& url) OVERRIDE;
|
||||
|
||||
@ -43,8 +49,20 @@ class CefRequestImpl : public CefRequest {
|
||||
// Populate the URLRequest object from this object.
|
||||
void Get(net::URLRequest* request);
|
||||
|
||||
// Populate this object from a WebURLRequest object.
|
||||
void Set(const WebKit::WebURLRequest& request);
|
||||
|
||||
// Populate the WebURLRequest object from this object.
|
||||
void Get(WebKit::WebURLRequest& request);
|
||||
|
||||
void SetReadOnly(bool read_only);
|
||||
|
||||
static void GetHeaderMap(const net::HttpRequestHeaders& headers,
|
||||
HeaderMap& map);
|
||||
static void GetHeaderMap(const WebKit::WebURLRequest& request,
|
||||
HeaderMap& map);
|
||||
static void SetHeaderMap(const HeaderMap& map,
|
||||
WebKit::WebURLRequest& request);
|
||||
|
||||
protected:
|
||||
CefString url_;
|
||||
@ -52,10 +70,13 @@ class CefRequestImpl : public CefRequest {
|
||||
CefRefPtr<CefPostData> postdata_;
|
||||
HeaderMap headermap_;
|
||||
|
||||
// The below methods are used by WebURLRequest.
|
||||
RequestFlags flags_;
|
||||
// The below members are used by CefURLRequest.
|
||||
int flags_;
|
||||
CefString first_party_for_cookies_;
|
||||
|
||||
// True if this object is read-only.
|
||||
bool read_only_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefRequestImpl);
|
||||
IMPLEMENT_LOCKING(CefRequestImpl);
|
||||
};
|
||||
@ -66,6 +87,7 @@ class CefPostDataImpl : public CefPostData {
|
||||
CefPostDataImpl();
|
||||
~CefPostDataImpl() {}
|
||||
|
||||
virtual bool IsReadOnly() OVERRIDE;
|
||||
virtual size_t GetElementCount() OVERRIDE;
|
||||
virtual void GetElements(ElementVector& elements) OVERRIDE;
|
||||
virtual bool RemoveElement(CefRefPtr<CefPostDataElement> element) OVERRIDE;
|
||||
@ -74,10 +96,17 @@ class CefPostDataImpl : public CefPostData {
|
||||
|
||||
void Set(net::UploadData& data);
|
||||
void Get(net::UploadData& data);
|
||||
void Set(const WebKit::WebHTTPBody& data);
|
||||
void Get(WebKit::WebHTTPBody& data);
|
||||
|
||||
void SetReadOnly(bool read_only);
|
||||
|
||||
protected:
|
||||
ElementVector elements_;
|
||||
|
||||
// True if this object is read-only.
|
||||
bool read_only_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefPostDataImpl);
|
||||
IMPLEMENT_LOCKING(CefPostDataImpl);
|
||||
};
|
||||
@ -88,6 +117,7 @@ class CefPostDataElementImpl : public CefPostDataElement {
|
||||
CefPostDataElementImpl();
|
||||
~CefPostDataElementImpl();
|
||||
|
||||
virtual bool IsReadOnly() OVERRIDE;
|
||||
virtual void SetToEmpty() OVERRIDE;
|
||||
virtual void SetToFile(const CefString& fileName) OVERRIDE;
|
||||
virtual void SetToBytes(size_t size, const void* bytes) OVERRIDE;
|
||||
@ -100,8 +130,14 @@ class CefPostDataElementImpl : public CefPostDataElement {
|
||||
|
||||
void Set(const net::UploadData::Element& element);
|
||||
void Get(net::UploadData::Element& element);
|
||||
void Set(const WebKit::WebHTTPBody::Element& element);
|
||||
void Get(WebKit::WebHTTPBody::Element& element);
|
||||
|
||||
void SetReadOnly(bool read_only);
|
||||
|
||||
protected:
|
||||
void Cleanup();
|
||||
|
||||
Type type_;
|
||||
union {
|
||||
struct {
|
||||
@ -111,6 +147,9 @@ class CefPostDataElementImpl : public CefPostDataElement {
|
||||
cef_string_t filename;
|
||||
} data_;
|
||||
|
||||
// True if this object is read-only.
|
||||
bool read_only_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefPostDataElementImpl);
|
||||
IMPLEMENT_LOCKING(CefPostDataElementImpl);
|
||||
};
|
||||
|
Reference in New Issue
Block a user