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:
@@ -13,7 +13,7 @@
|
||||
#include "libcef_dll/cpptoc/command_line_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/app_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/proxy_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/render_process_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h"
|
||||
|
||||
@@ -56,20 +56,6 @@ void CefAppCToCpp::OnRegisterCustomSchemes(
|
||||
CefSchemeRegistrarCppToC::Wrap(registrar));
|
||||
}
|
||||
|
||||
CefRefPtr<CefRenderProcessHandler> CefAppCToCpp::GetRenderProcessHandler() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_render_process_handler))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_render_process_handler_t* _retval = struct_->get_render_process_handler(
|
||||
struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefRenderProcessHandlerCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefResourceBundleHandler> CefAppCToCpp::GetResourceBundleHandler() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_resource_bundle_handler))
|
||||
return NULL;
|
||||
@@ -84,17 +70,32 @@ CefRefPtr<CefResourceBundleHandler> CefAppCToCpp::GetResourceBundleHandler() {
|
||||
return CefResourceBundleHandlerCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefProxyHandler> CefAppCToCpp::GetProxyHandler() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_proxy_handler))
|
||||
CefRefPtr<CefBrowserProcessHandler> CefAppCToCpp::GetBrowserProcessHandler() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_browser_process_handler))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_proxy_handler_t* _retval = struct_->get_proxy_handler(struct_);
|
||||
cef_browser_process_handler_t* _retval = struct_->get_browser_process_handler(
|
||||
struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefProxyHandlerCToCpp::Wrap(_retval);
|
||||
return CefBrowserProcessHandlerCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefRenderProcessHandler> CefAppCToCpp::GetRenderProcessHandler() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_render_process_handler))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_render_process_handler_t* _retval = struct_->get_render_process_handler(
|
||||
struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefRenderProcessHandlerCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -36,10 +36,11 @@ class CefAppCToCpp
|
||||
CefRefPtr<CefCommandLine> command_line) OVERRIDE;
|
||||
virtual void OnRegisterCustomSchemes(
|
||||
CefRefPtr<CefSchemeRegistrar> registrar) OVERRIDE;
|
||||
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() OVERRIDE;
|
||||
virtual CefRefPtr<CefResourceBundleHandler> GetResourceBundleHandler(
|
||||
) OVERRIDE;
|
||||
virtual CefRefPtr<CefProxyHandler> GetProxyHandler() OVERRIDE;
|
||||
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler(
|
||||
) OVERRIDE;
|
||||
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
|
47
libcef_dll/ctocpp/browser_process_handler_ctocpp.cc
Normal file
47
libcef_dll/ctocpp/browser_process_handler_ctocpp.cc
Normal file
@@ -0,0 +1,47 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/proxy_handler_ctocpp.h"
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefProxyHandler> CefBrowserProcessHandlerCToCpp::GetProxyHandler() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_proxy_handler))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_proxy_handler_t* _retval = struct_->get_proxy_handler(struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefProxyHandlerCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
void CefBrowserProcessHandlerCToCpp::OnContextInitialized() {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_context_initialized))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
struct_->on_context_initialized(struct_);
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefBrowserProcessHandlerCToCpp,
|
||||
CefBrowserProcessHandler, cef_browser_process_handler_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
43
libcef_dll/ctocpp/browser_process_handler_ctocpp.h
Normal file
43
libcef_dll/ctocpp/browser_process_handler_ctocpp.h
Normal file
@@ -0,0 +1,43 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef_browser_process_handler.h"
|
||||
#include "include/capi/cef_browser_process_handler_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefBrowserProcessHandlerCToCpp
|
||||
: public CefCToCpp<CefBrowserProcessHandlerCToCpp, CefBrowserProcessHandler,
|
||||
cef_browser_process_handler_t> {
|
||||
public:
|
||||
explicit CefBrowserProcessHandlerCToCpp(cef_browser_process_handler_t* str)
|
||||
: CefCToCpp<CefBrowserProcessHandlerCToCpp, CefBrowserProcessHandler,
|
||||
cef_browser_process_handler_t>(str) {}
|
||||
virtual ~CefBrowserProcessHandlerCToCpp() {}
|
||||
|
||||
// CefBrowserProcessHandler methods
|
||||
virtual CefRefPtr<CefProxyHandler> GetProxyHandler() OVERRIDE;
|
||||
virtual void OnContextInitialized() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefPostData> CefPostData::CreatePostData() {
|
||||
CefRefPtr<CefPostData> CefPostData::Create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
@@ -29,6 +29,19 @@ CefRefPtr<CefPostData> CefPostData::CreatePostData() {
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
bool CefPostDataCToCpp::IsReadOnly() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_read_only))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_read_only(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
size_t CefPostDataCToCpp::GetElementCount() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_element_count))
|
||||
return 0;
|
||||
|
@@ -32,6 +32,7 @@ class CefPostDataCToCpp
|
||||
virtual ~CefPostDataCToCpp() {}
|
||||
|
||||
// CefPostData methods
|
||||
virtual bool IsReadOnly() OVERRIDE;
|
||||
virtual size_t GetElementCount() OVERRIDE;
|
||||
virtual void GetElements(ElementVector& elements) OVERRIDE;
|
||||
virtual bool RemoveElement(CefRefPtr<CefPostDataElement> element) OVERRIDE;
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefPostDataElement> CefPostDataElement::CreatePostDataElement() {
|
||||
CefRefPtr<CefPostDataElement> CefPostDataElement::Create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
@@ -28,6 +28,19 @@ CefRefPtr<CefPostDataElement> CefPostDataElement::CreatePostDataElement() {
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
bool CefPostDataElementCToCpp::IsReadOnly() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_read_only))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_read_only(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
void CefPostDataElementCToCpp::SetToEmpty() {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_to_empty))
|
||||
return;
|
||||
|
@@ -34,6 +34,7 @@ class CefPostDataElementCToCpp
|
||||
virtual ~CefPostDataElementCToCpp() {}
|
||||
|
||||
// CefPostDataElement methods
|
||||
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;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefRequest> CefRequest::CreateRequest() {
|
||||
CefRefPtr<CefRequest> CefRequest::Create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
@@ -30,6 +30,19 @@ CefRefPtr<CefRequest> CefRequest::CreateRequest() {
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
bool CefRequestCToCpp::IsReadOnly() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_read_only))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_read_only(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
CefString CefRequestCToCpp::GetURL() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_url))
|
||||
return CefString();
|
||||
@@ -201,20 +214,20 @@ void CefRequestCToCpp::Set(const CefString& url, const CefString& method,
|
||||
cef_string_multimap_free(headerMapMultimap);
|
||||
}
|
||||
|
||||
CefRequest::RequestFlags CefRequestCToCpp::GetFlags() {
|
||||
int CefRequestCToCpp::GetFlags() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_flags))
|
||||
return WUR_FLAG_NONE;
|
||||
return UR_FLAG_NONE;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_weburlrequest_flags_t _retval = struct_->get_flags(struct_);
|
||||
int _retval = struct_->get_flags(struct_);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CefRequestCToCpp::SetFlags(RequestFlags flags) {
|
||||
void CefRequestCToCpp::SetFlags(int flags) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_flags))
|
||||
return;
|
||||
|
||||
|
@@ -32,6 +32,7 @@ class CefRequestCToCpp
|
||||
virtual ~CefRequestCToCpp() {}
|
||||
|
||||
// CefRequest methods
|
||||
virtual bool IsReadOnly() OVERRIDE;
|
||||
virtual CefString GetURL() OVERRIDE;
|
||||
virtual void SetURL(const CefString& url) OVERRIDE;
|
||||
virtual CefString GetMethod() OVERRIDE;
|
||||
@@ -42,8 +43,8 @@ class CefRequestCToCpp
|
||||
virtual void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE;
|
||||
virtual void Set(const CefString& url, 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;
|
||||
};
|
||||
|
@@ -90,6 +90,34 @@ bool CefResourceHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read,
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefResourceHandlerCToCpp::CanGetCookie(const CefCookie& cookie) {
|
||||
if (CEF_MEMBER_MISSING(struct_, can_get_cookie))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->can_get_cookie(struct_,
|
||||
&cookie);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefResourceHandlerCToCpp::CanSetCookie(const CefCookie& cookie) {
|
||||
if (CEF_MEMBER_MISSING(struct_, can_set_cookie))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->can_set_cookie(struct_,
|
||||
&cookie);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
void CefResourceHandlerCToCpp::Cancel() {
|
||||
if (CEF_MEMBER_MISSING(struct_, cancel))
|
||||
return;
|
||||
|
@@ -40,6 +40,8 @@ class CefResourceHandlerCToCpp
|
||||
int64& response_length, CefString& redirectUrl) OVERRIDE;
|
||||
virtual bool ReadResponse(void* data_out, int bytes_to_read, int& bytes_read,
|
||||
CefRefPtr<CefCallback> callback) OVERRIDE;
|
||||
virtual bool CanGetCookie(const CefCookie& cookie) OVERRIDE;
|
||||
virtual bool CanSetCookie(const CefCookie& cookie) OVERRIDE;
|
||||
virtual void Cancel() OVERRIDE;
|
||||
};
|
||||
|
||||
|
@@ -14,8 +14,34 @@
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefResponse> CefResponse::Create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_response_t* _retval = cef_response_create();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefResponseCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
bool CefResponseCToCpp::IsReadOnly() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_read_only))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_read_only(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
int CefResponseCToCpp::GetStatus() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_status))
|
||||
return 0;
|
||||
|
@@ -32,6 +32,7 @@ class CefResponseCToCpp
|
||||
virtual ~CefResponseCToCpp() {}
|
||||
|
||||
// CefResponse methods
|
||||
virtual bool IsReadOnly() OVERRIDE;
|
||||
virtual int GetStatus() OVERRIDE;
|
||||
virtual void SetStatus(int status) OVERRIDE;
|
||||
virtual CefString GetStatusText() OVERRIDE;
|
||||
|
@@ -27,14 +27,6 @@ CefRefPtr<CefResourceHandler> CefSchemeHandlerFactoryCToCpp::Create(
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return NULL;
|
||||
// Verify param: frame; type: refptr_diff
|
||||
DCHECK(frame.get());
|
||||
if (!frame.get())
|
||||
return NULL;
|
||||
// Verify param: scheme_name; type: string_byref_const
|
||||
DCHECK(!scheme_name.empty());
|
||||
if (scheme_name.empty())
|
||||
@@ -43,6 +35,7 @@ CefRefPtr<CefResourceHandler> CefSchemeHandlerFactoryCToCpp::Create(
|
||||
DCHECK(request.get());
|
||||
if (!request.get())
|
||||
return NULL;
|
||||
// Unverified params: browser, frame
|
||||
|
||||
// Execute
|
||||
cef_resource_handler_t* _retval = struct_->create(struct_,
|
||||
|
102
libcef_dll/ctocpp/urlrequest_client_ctocpp.cc
Normal file
102
libcef_dll/ctocpp/urlrequest_client_ctocpp.cc
Normal file
@@ -0,0 +1,102 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/urlrequest_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h"
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
void CefURLRequestClientCToCpp::OnRequestComplete(
|
||||
CefRefPtr<CefURLRequest> request) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_request_complete))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: request; type: refptr_diff
|
||||
DCHECK(request.get());
|
||||
if (!request.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
struct_->on_request_complete(struct_,
|
||||
CefURLRequestCppToC::Wrap(request));
|
||||
}
|
||||
|
||||
void CefURLRequestClientCToCpp::OnUploadProgress(
|
||||
CefRefPtr<CefURLRequest> request, uint64 current, uint64 total) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_upload_progress))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: request; type: refptr_diff
|
||||
DCHECK(request.get());
|
||||
if (!request.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
struct_->on_upload_progress(struct_,
|
||||
CefURLRequestCppToC::Wrap(request),
|
||||
current,
|
||||
total);
|
||||
}
|
||||
|
||||
void CefURLRequestClientCToCpp::OnDownloadProgress(
|
||||
CefRefPtr<CefURLRequest> request, uint64 current, uint64 total) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_download_progress))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: request; type: refptr_diff
|
||||
DCHECK(request.get());
|
||||
if (!request.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
struct_->on_download_progress(struct_,
|
||||
CefURLRequestCppToC::Wrap(request),
|
||||
current,
|
||||
total);
|
||||
}
|
||||
|
||||
void CefURLRequestClientCToCpp::OnDownloadData(CefRefPtr<CefURLRequest> request,
|
||||
const void* data, size_t data_length) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_download_data))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: request; type: refptr_diff
|
||||
DCHECK(request.get());
|
||||
if (!request.get())
|
||||
return;
|
||||
// Verify param: data; type: simple_byaddr
|
||||
DCHECK(data);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
struct_->on_download_data(struct_,
|
||||
CefURLRequestCppToC::Wrap(request),
|
||||
data,
|
||||
data_length);
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefURLRequestClientCToCpp, CefURLRequestClient,
|
||||
cef_urlrequest_client_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
48
libcef_dll/ctocpp/urlrequest_client_ctocpp.h
Normal file
48
libcef_dll/ctocpp/urlrequest_client_ctocpp.h
Normal file
@@ -0,0 +1,48 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CLIENT_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CLIENT_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef_urlrequest.h"
|
||||
#include "include/capi/cef_urlrequest_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefURLRequestClientCToCpp
|
||||
: public CefCToCpp<CefURLRequestClientCToCpp, CefURLRequestClient,
|
||||
cef_urlrequest_client_t> {
|
||||
public:
|
||||
explicit CefURLRequestClientCToCpp(cef_urlrequest_client_t* str)
|
||||
: CefCToCpp<CefURLRequestClientCToCpp, CefURLRequestClient,
|
||||
cef_urlrequest_client_t>(str) {}
|
||||
virtual ~CefURLRequestClientCToCpp() {}
|
||||
|
||||
// CefURLRequestClient methods
|
||||
virtual void OnRequestComplete(CefRefPtr<CefURLRequest> request) OVERRIDE;
|
||||
virtual void OnUploadProgress(CefRefPtr<CefURLRequest> request,
|
||||
uint64 current, uint64 total) OVERRIDE;
|
||||
virtual void OnDownloadProgress(CefRefPtr<CefURLRequest> request,
|
||||
uint64 current, uint64 total) OVERRIDE;
|
||||
virtual void OnDownloadData(CefRefPtr<CefURLRequest> request,
|
||||
const void* data, size_t data_length) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CLIENT_CTOCPP_H_
|
||||
|
126
libcef_dll/ctocpp/urlrequest_ctocpp.cc
Normal file
126
libcef_dll/ctocpp/urlrequest_ctocpp.cc
Normal file
@@ -0,0 +1,126 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/request_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/response_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/urlrequest_ctocpp.h"
|
||||
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefURLRequest> CefURLRequest::Create(CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefURLRequestClient> client) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: request; type: refptr_same
|
||||
DCHECK(request.get());
|
||||
if (!request.get())
|
||||
return NULL;
|
||||
// Verify param: client; type: refptr_diff
|
||||
DCHECK(client.get());
|
||||
if (!client.get())
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
cef_urlrequest_t* _retval = cef_urlrequest_create(
|
||||
CefRequestCToCpp::Unwrap(request),
|
||||
CefURLRequestClientCppToC::Wrap(client));
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefURLRequestCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefRequest> CefURLRequestCToCpp::GetRequest() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_request))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_request_t* _retval = struct_->get_request(struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefRequestCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefURLRequestClient> CefURLRequestCToCpp::GetClient() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_client))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_urlrequest_client_t* _retval = struct_->get_client(struct_);
|
||||
|
||||
// Return type: refptr_diff
|
||||
return CefURLRequestClientCppToC::Unwrap(_retval);
|
||||
}
|
||||
|
||||
CefURLRequest::Status CefURLRequestCToCpp::GetRequestStatus() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_request_status))
|
||||
return UR_UNKNOWN;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_urlrequest_status_t _retval = struct_->get_request_status(struct_);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
CefURLRequest::ErrorCode CefURLRequestCToCpp::GetRequestError() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_request_error))
|
||||
return ERR_NONE;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_errorcode_t _retval = struct_->get_request_error(struct_);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
CefRefPtr<CefResponse> CefURLRequestCToCpp::GetResponse() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_response))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_response_t* _retval = struct_->get_response(struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefResponseCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
void CefURLRequestCToCpp::Cancel() {
|
||||
if (CEF_MEMBER_MISSING(struct_, cancel))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
struct_->cancel(struct_);
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefURLRequestCToCpp, CefURLRequest,
|
||||
cef_urlrequest_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
45
libcef_dll/ctocpp/urlrequest_ctocpp.h
Normal file
45
libcef_dll/ctocpp/urlrequest_ctocpp.h
Normal file
@@ -0,0 +1,45 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/cef_urlrequest.h"
|
||||
#include "include/capi/cef_urlrequest_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefURLRequestCToCpp
|
||||
: public CefCToCpp<CefURLRequestCToCpp, CefURLRequest, cef_urlrequest_t> {
|
||||
public:
|
||||
explicit CefURLRequestCToCpp(cef_urlrequest_t* str)
|
||||
: CefCToCpp<CefURLRequestCToCpp, CefURLRequest, cef_urlrequest_t>(str) {}
|
||||
virtual ~CefURLRequestCToCpp() {}
|
||||
|
||||
// CefURLRequest methods
|
||||
virtual CefRefPtr<CefRequest> GetRequest() OVERRIDE;
|
||||
virtual CefRefPtr<CefURLRequestClient> GetClient() OVERRIDE;
|
||||
virtual Status GetRequestStatus() OVERRIDE;
|
||||
virtual ErrorCode GetRequestError() OVERRIDE;
|
||||
virtual CefRefPtr<CefResponse> GetResponse() OVERRIDE;
|
||||
virtual void Cancel() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_
|
||||
|
Reference in New Issue
Block a user