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:
@ -11,7 +11,7 @@
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/app_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/proxy_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/render_process_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/command_line_ctocpp.h"
|
||||
@ -57,22 +57,6 @@ void CEF_CALLBACK app_on_register_custom_schemes(struct _cef_app_t* self,
|
||||
CefSchemeRegistrarCToCpp::Wrap(registrar));
|
||||
}
|
||||
|
||||
struct _cef_render_process_handler_t* CEF_CALLBACK app_get_render_process_handler(
|
||||
struct _cef_app_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefRenderProcessHandler> _retval = CefAppCppToC::Get(
|
||||
self)->GetRenderProcessHandler();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefRenderProcessHandlerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
struct _cef_resource_bundle_handler_t* CEF_CALLBACK app_get_resource_bundle_handler(
|
||||
struct _cef_app_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@ -89,7 +73,7 @@ struct _cef_resource_bundle_handler_t* CEF_CALLBACK app_get_resource_bundle_hand
|
||||
return CefResourceBundleHandlerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
struct _cef_proxy_handler_t* CEF_CALLBACK app_get_proxy_handler(
|
||||
struct _cef_browser_process_handler_t* CEF_CALLBACK app_get_browser_process_handler(
|
||||
struct _cef_app_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
@ -98,11 +82,27 @@ struct _cef_proxy_handler_t* CEF_CALLBACK app_get_proxy_handler(
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefProxyHandler> _retval = CefAppCppToC::Get(self)->GetProxyHandler(
|
||||
);
|
||||
CefRefPtr<CefBrowserProcessHandler> _retval = CefAppCppToC::Get(
|
||||
self)->GetBrowserProcessHandler();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefProxyHandlerCppToC::Wrap(_retval);
|
||||
return CefBrowserProcessHandlerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
struct _cef_render_process_handler_t* CEF_CALLBACK app_get_render_process_handler(
|
||||
struct _cef_app_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefRenderProcessHandler> _retval = CefAppCppToC::Get(
|
||||
self)->GetRenderProcessHandler();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefRenderProcessHandlerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
@ -113,9 +113,9 @@ CefAppCppToC::CefAppCppToC(CefApp* cls)
|
||||
struct_.struct_.on_before_command_line_processing =
|
||||
app_on_before_command_line_processing;
|
||||
struct_.struct_.on_register_custom_schemes = app_on_register_custom_schemes;
|
||||
struct_.struct_.get_render_process_handler = app_get_render_process_handler;
|
||||
struct_.struct_.get_resource_bundle_handler = app_get_resource_bundle_handler;
|
||||
struct_.struct_.get_proxy_handler = app_get_proxy_handler;
|
||||
struct_.struct_.get_browser_process_handler = app_get_browser_process_handler;
|
||||
struct_.struct_.get_render_process_handler = app_get_render_process_handler;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
63
libcef_dll/cpptoc/browser_process_handler_cpptoc.cc
Normal file
63
libcef_dll/cpptoc/browser_process_handler_cpptoc.cc
Normal file
@ -0,0 +1,63 @@
|
||||
// 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/browser_process_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/proxy_handler_cpptoc.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
struct _cef_proxy_handler_t* CEF_CALLBACK browser_process_handler_get_proxy_handler(
|
||||
struct _cef_browser_process_handler_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefProxyHandler> _retval = CefBrowserProcessHandlerCppToC::Get(
|
||||
self)->GetProxyHandler();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefProxyHandlerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK browser_process_handler_on_context_initialized(
|
||||
struct _cef_browser_process_handler_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefBrowserProcessHandlerCppToC::Get(self)->OnContextInitialized();
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC(
|
||||
CefBrowserProcessHandler* cls)
|
||||
: CefCppToC<CefBrowserProcessHandlerCppToC, CefBrowserProcessHandler,
|
||||
cef_browser_process_handler_t>(cls) {
|
||||
struct_.struct_.get_proxy_handler = browser_process_handler_get_proxy_handler;
|
||||
struct_.struct_.on_context_initialized =
|
||||
browser_process_handler_on_context_initialized;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCppToC<CefBrowserProcessHandlerCppToC,
|
||||
CefBrowserProcessHandler, cef_browser_process_handler_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
37
libcef_dll/cpptoc/browser_process_handler_cpptoc.h
Normal file
37
libcef_dll/cpptoc/browser_process_handler_cpptoc.h
Normal file
@ -0,0 +1,37 @@
|
||||
// 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_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/cef_browser_process_handler.h"
|
||||
#include "include/capi/cef_browser_process_handler_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefBrowserProcessHandlerCppToC
|
||||
: public CefCppToC<CefBrowserProcessHandlerCppToC, CefBrowserProcessHandler,
|
||||
cef_browser_process_handler_t> {
|
||||
public:
|
||||
explicit CefBrowserProcessHandlerCppToC(CefBrowserProcessHandler* cls);
|
||||
virtual ~CefBrowserProcessHandlerCppToC() {}
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_
|
||||
|
@ -63,9 +63,8 @@ void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self,
|
||||
}
|
||||
|
||||
void CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self,
|
||||
cef_browser_t* browser, cef_frame_t* frame,
|
||||
enum cef_handler_errorcode_t errorCode, const cef_string_t* errorText,
|
||||
const cef_string_t* failedUrl) {
|
||||
cef_browser_t* browser, cef_frame_t* frame, enum cef_errorcode_t errorCode,
|
||||
const cef_string_t* errorText, const cef_string_t* failedUrl) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
|
@ -20,7 +20,7 @@ CEF_EXPORT cef_post_data_t* cef_post_data_create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefPostData> _retval = CefPostData::CreatePostData();
|
||||
CefRefPtr<CefPostData> _retval = CefPostData::Create();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefPostDataCppToC::Wrap(_retval);
|
||||
@ -29,6 +29,20 @@ CEF_EXPORT cef_post_data_t* cef_post_data_create() {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK post_data_is_read_only(struct _cef_post_data_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefPostDataCppToC::Get(self)->IsReadOnly();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
size_t CEF_CALLBACK post_data_get_element_count(struct _cef_post_data_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
@ -134,6 +148,7 @@ void CEF_CALLBACK post_data_remove_elements(struct _cef_post_data_t* self) {
|
||||
|
||||
CefPostDataCppToC::CefPostDataCppToC(CefPostData* cls)
|
||||
: CefCppToC<CefPostDataCppToC, CefPostData, cef_post_data_t>(cls) {
|
||||
struct_.struct_.is_read_only = post_data_is_read_only;
|
||||
struct_.struct_.get_element_count = post_data_get_element_count;
|
||||
struct_.struct_.get_elements = post_data_get_elements;
|
||||
struct_.struct_.remove_element = post_data_remove_element;
|
||||
|
@ -19,8 +19,7 @@ CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefPostDataElement> _retval =
|
||||
CefPostDataElement::CreatePostDataElement();
|
||||
CefRefPtr<CefPostDataElement> _retval = CefPostDataElement::Create();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefPostDataElementCppToC::Wrap(_retval);
|
||||
@ -29,6 +28,21 @@ CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK post_data_element_is_read_only(
|
||||
struct _cef_post_data_element_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefPostDataElementCppToC::Get(self)->IsReadOnly();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK post_data_element_set_to_empty(
|
||||
struct _cef_post_data_element_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@ -149,6 +163,7 @@ size_t CEF_CALLBACK post_data_element_get_bytes(
|
||||
CefPostDataElementCppToC::CefPostDataElementCppToC(CefPostDataElement* cls)
|
||||
: CefCppToC<CefPostDataElementCppToC, CefPostDataElement,
|
||||
cef_post_data_element_t>(cls) {
|
||||
struct_.struct_.is_read_only = post_data_element_is_read_only;
|
||||
struct_.struct_.set_to_empty = post_data_element_set_to_empty;
|
||||
struct_.struct_.set_to_file = post_data_element_set_to_file;
|
||||
struct_.struct_.set_to_bytes = post_data_element_set_to_bytes;
|
||||
|
@ -21,7 +21,7 @@ CEF_EXPORT cef_request_t* cef_request_create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefRequest> _retval = CefRequest::CreateRequest();
|
||||
CefRefPtr<CefRequest> _retval = CefRequest::Create();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefRequestCppToC::Wrap(_retval);
|
||||
@ -30,6 +30,20 @@ CEF_EXPORT cef_request_t* cef_request_create() {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK request_is_read_only(struct _cef_request_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefRequestCppToC::Get(self)->IsReadOnly();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK request_get_url(
|
||||
struct _cef_request_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@ -206,23 +220,21 @@ void CEF_CALLBACK request_set(struct _cef_request_t* self,
|
||||
headerMapMultimap);
|
||||
}
|
||||
|
||||
enum cef_weburlrequest_flags_t CEF_CALLBACK request_get_flags(
|
||||
struct _cef_request_t* self) {
|
||||
int CEF_CALLBACK request_get_flags(struct _cef_request_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return WUR_FLAG_NONE;
|
||||
return UR_FLAG_NONE;
|
||||
|
||||
// Execute
|
||||
cef_weburlrequest_flags_t _retval = CefRequestCppToC::Get(self)->GetFlags();
|
||||
int _retval = CefRequestCppToC::Get(self)->GetFlags();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK request_set_flags(struct _cef_request_t* self,
|
||||
enum cef_weburlrequest_flags_t flags) {
|
||||
void CEF_CALLBACK request_set_flags(struct _cef_request_t* self, int flags) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
@ -271,6 +283,7 @@ void CEF_CALLBACK request_set_first_party_for_cookies(
|
||||
|
||||
CefRequestCppToC::CefRequestCppToC(CefRequest* cls)
|
||||
: CefCppToC<CefRequestCppToC, CefRequest, cef_request_t>(cls) {
|
||||
struct_.struct_.is_read_only = request_is_read_only;
|
||||
struct_.struct_.get_url = request_get_url;
|
||||
struct_.struct_.set_url = request_set_url;
|
||||
struct_.struct_.get_method = request_get_method;
|
||||
|
@ -120,6 +120,56 @@ int CEF_CALLBACK resource_handler_read_response(
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK resource_handler_can_get_cookie(
|
||||
struct _cef_resource_handler_t* self, const struct _cef_cookie_t* cookie) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: cookie; type: struct_byref_const
|
||||
DCHECK(cookie);
|
||||
if (!cookie)
|
||||
return 0;
|
||||
|
||||
// Translate param: cookie; type: struct_byref_const
|
||||
CefCookie cookieObj;
|
||||
if (cookie)
|
||||
cookieObj.Set(*cookie, false);
|
||||
|
||||
// Execute
|
||||
bool _retval = CefResourceHandlerCppToC::Get(self)->CanGetCookie(
|
||||
cookieObj);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK resource_handler_can_set_cookie(
|
||||
struct _cef_resource_handler_t* self, const struct _cef_cookie_t* cookie) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: cookie; type: struct_byref_const
|
||||
DCHECK(cookie);
|
||||
if (!cookie)
|
||||
return 0;
|
||||
|
||||
// Translate param: cookie; type: struct_byref_const
|
||||
CefCookie cookieObj;
|
||||
if (cookie)
|
||||
cookieObj.Set(*cookie, false);
|
||||
|
||||
// Execute
|
||||
bool _retval = CefResourceHandlerCppToC::Get(self)->CanSetCookie(
|
||||
cookieObj);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK resource_handler_cancel(
|
||||
struct _cef_resource_handler_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@ -141,6 +191,8 @@ CefResourceHandlerCppToC::CefResourceHandlerCppToC(CefResourceHandler* cls)
|
||||
struct_.struct_.process_request = resource_handler_process_request;
|
||||
struct_.struct_.get_response_headers = resource_handler_get_response_headers;
|
||||
struct_.struct_.read_response = resource_handler_read_response;
|
||||
struct_.struct_.can_get_cookie = resource_handler_can_get_cookie;
|
||||
struct_.struct_.can_set_cookie = resource_handler_can_set_cookie;
|
||||
struct_.struct_.cancel = resource_handler_cancel;
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,35 @@
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
CEF_EXPORT cef_response_t* cef_response_create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefResponse> _retval = CefResponse::Create();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefResponseCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK response_is_read_only(struct _cef_response_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefResponseCppToC::Get(self)->IsReadOnly();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK response_get_status(struct _cef_response_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
@ -178,6 +205,7 @@ void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self,
|
||||
|
||||
CefResponseCppToC::CefResponseCppToC(CefResponse* cls)
|
||||
: CefCppToC<CefResponseCppToC, CefResponse, cef_response_t>(cls) {
|
||||
struct_.struct_.is_read_only = response_is_read_only;
|
||||
struct_.struct_.get_status = response_get_status;
|
||||
struct_.struct_.set_status = response_set_status;
|
||||
struct_.struct_.get_status_text = response_get_status_text;
|
||||
|
@ -28,14 +28,6 @@ cef_resource_handler_t* CEF_CALLBACK scheme_handler_factory_create(
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return NULL;
|
||||
// Verify param: frame; type: refptr_diff
|
||||
DCHECK(frame);
|
||||
if (!frame)
|
||||
return NULL;
|
||||
// Verify param: scheme_name; type: string_byref_const
|
||||
DCHECK(scheme_name);
|
||||
if (!scheme_name)
|
||||
@ -44,6 +36,7 @@ cef_resource_handler_t* CEF_CALLBACK scheme_handler_factory_create(
|
||||
DCHECK(request);
|
||||
if (!request)
|
||||
return NULL;
|
||||
// Unverified params: browser, frame
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefResourceHandler> _retval = CefSchemeHandlerFactoryCppToC::Get(
|
||||
|
116
libcef_dll/cpptoc/urlrequest_client_cpptoc.cc
Normal file
116
libcef_dll/cpptoc/urlrequest_client_cpptoc.cc
Normal file
@ -0,0 +1,116 @@
|
||||
// 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/urlrequest_ctocpp.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK urlrequest_client_on_request_complete(
|
||||
struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: request; type: refptr_diff
|
||||
DCHECK(request);
|
||||
if (!request)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefURLRequestClientCppToC::Get(self)->OnRequestComplete(
|
||||
CefURLRequestCToCpp::Wrap(request));
|
||||
}
|
||||
|
||||
void CEF_CALLBACK urlrequest_client_on_upload_progress(
|
||||
struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request,
|
||||
uint64 current, uint64 total) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: request; type: refptr_diff
|
||||
DCHECK(request);
|
||||
if (!request)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefURLRequestClientCppToC::Get(self)->OnUploadProgress(
|
||||
CefURLRequestCToCpp::Wrap(request),
|
||||
current,
|
||||
total);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK urlrequest_client_on_download_progress(
|
||||
struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request,
|
||||
uint64 current, uint64 total) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: request; type: refptr_diff
|
||||
DCHECK(request);
|
||||
if (!request)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefURLRequestClientCppToC::Get(self)->OnDownloadProgress(
|
||||
CefURLRequestCToCpp::Wrap(request),
|
||||
current,
|
||||
total);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK urlrequest_client_on_download_data(
|
||||
struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request,
|
||||
const void* data, size_t data_length) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: request; type: refptr_diff
|
||||
DCHECK(request);
|
||||
if (!request)
|
||||
return;
|
||||
// Verify param: data; type: simple_byaddr
|
||||
DCHECK(data);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefURLRequestClientCppToC::Get(self)->OnDownloadData(
|
||||
CefURLRequestCToCpp::Wrap(request),
|
||||
data,
|
||||
data_length);
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefURLRequestClientCppToC::CefURLRequestClientCppToC(CefURLRequestClient* cls)
|
||||
: CefCppToC<CefURLRequestClientCppToC, CefURLRequestClient,
|
||||
cef_urlrequest_client_t>(cls) {
|
||||
struct_.struct_.on_request_complete = urlrequest_client_on_request_complete;
|
||||
struct_.struct_.on_upload_progress = urlrequest_client_on_upload_progress;
|
||||
struct_.struct_.on_download_progress = urlrequest_client_on_download_progress;
|
||||
struct_.struct_.on_download_data = urlrequest_client_on_download_data;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCppToC<CefURLRequestClientCppToC, CefURLRequestClient,
|
||||
cef_urlrequest_client_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
37
libcef_dll/cpptoc/urlrequest_client_cpptoc.h
Normal file
37
libcef_dll/cpptoc/urlrequest_client_cpptoc.h
Normal file
@ -0,0 +1,37 @@
|
||||
// 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_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_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/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefURLRequestClientCppToC
|
||||
: public CefCppToC<CefURLRequestClientCppToC, CefURLRequestClient,
|
||||
cef_urlrequest_client_t> {
|
||||
public:
|
||||
explicit CefURLRequestClientCppToC(CefURLRequestClient* cls);
|
||||
virtual ~CefURLRequestClientCppToC() {}
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_
|
||||
|
152
libcef_dll/cpptoc/urlrequest_cpptoc.cc
Normal file
152
libcef_dll/cpptoc/urlrequest_cpptoc.cc
Normal file
@ -0,0 +1,152 @@
|
||||
// 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/request_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/response_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/urlrequest_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h"
|
||||
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
CEF_EXPORT cef_urlrequest_t* cef_urlrequest_create(cef_request_t* request,
|
||||
struct _cef_urlrequest_client_t* client) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: request; type: refptr_same
|
||||
DCHECK(request);
|
||||
if (!request)
|
||||
return NULL;
|
||||
// Verify param: client; type: refptr_diff
|
||||
DCHECK(client);
|
||||
if (!client)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefURLRequest> _retval = CefURLRequest::Create(
|
||||
CefRequestCppToC::Unwrap(request),
|
||||
CefURLRequestClientCToCpp::Wrap(client));
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefURLRequestCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
cef_request_t* CEF_CALLBACK urlrequest_get_request(
|
||||
struct _cef_urlrequest_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefRequest> _retval = CefURLRequestCppToC::Get(self)->GetRequest();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefRequestCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
struct _cef_urlrequest_client_t* CEF_CALLBACK urlrequest_get_client(
|
||||
struct _cef_urlrequest_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefURLRequestClient> _retval = CefURLRequestCppToC::Get(
|
||||
self)->GetClient();
|
||||
|
||||
// Return type: refptr_diff
|
||||
return CefURLRequestClientCToCpp::Unwrap(_retval);
|
||||
}
|
||||
|
||||
enum cef_urlrequest_status_t CEF_CALLBACK urlrequest_get_request_status(
|
||||
struct _cef_urlrequest_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return UR_UNKNOWN;
|
||||
|
||||
// Execute
|
||||
cef_urlrequest_status_t _retval = CefURLRequestCppToC::Get(
|
||||
self)->GetRequestStatus();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
enum cef_errorcode_t CEF_CALLBACK urlrequest_get_request_error(
|
||||
struct _cef_urlrequest_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return ERR_NONE;
|
||||
|
||||
// Execute
|
||||
cef_errorcode_t _retval = CefURLRequestCppToC::Get(self)->GetRequestError();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
cef_response_t* CEF_CALLBACK urlrequest_get_response(
|
||||
struct _cef_urlrequest_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefResponse> _retval = CefURLRequestCppToC::Get(self)->GetResponse(
|
||||
);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefResponseCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK urlrequest_cancel(struct _cef_urlrequest_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefURLRequestCppToC::Get(self)->Cancel();
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefURLRequestCppToC::CefURLRequestCppToC(CefURLRequest* cls)
|
||||
: CefCppToC<CefURLRequestCppToC, CefURLRequest, cef_urlrequest_t>(cls) {
|
||||
struct_.struct_.get_request = urlrequest_get_request;
|
||||
struct_.struct_.get_client = urlrequest_get_client;
|
||||
struct_.struct_.get_request_status = urlrequest_get_request_status;
|
||||
struct_.struct_.get_request_error = urlrequest_get_request_error;
|
||||
struct_.struct_.get_response = urlrequest_get_response;
|
||||
struct_.struct_.cancel = urlrequest_cancel;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCppToC<CefURLRequestCppToC, CefURLRequest,
|
||||
cef_urlrequest_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
36
libcef_dll/cpptoc/urlrequest_cpptoc.h
Normal file
36
libcef_dll/cpptoc/urlrequest_cpptoc.h
Normal file
@ -0,0 +1,36 @@
|
||||
// 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_CPPTOC_URLREQUEST_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CPPTOC_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/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefURLRequestCppToC
|
||||
: public CefCppToC<CefURLRequestCppToC, CefURLRequest, cef_urlrequest_t> {
|
||||
public:
|
||||
explicit CefURLRequestCppToC(CefURLRequest* cls);
|
||||
virtual ~CefURLRequestCppToC() {}
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CPPTOC_H_
|
||||
|
Reference in New Issue
Block a user