70 lines
2.0 KiB
C++
70 lines
2.0 KiB
C++
// Copyright (c) 2011 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.
|
|
//
|
|
// ---------------------------------------------------------------------------
|
|
//
|
|
// 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 function
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
// for more information.
|
|
//
|
|
|
|
#include "libcef_dll/cpptoc/content_filter_cpptoc.h"
|
|
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
void CEF_CALLBACK content_filter_process_data(
|
|
struct _cef_content_filter_t* self, const void* data, int data_size,
|
|
cef_stream_reader_t** substitute_data)
|
|
{
|
|
DCHECK(self);
|
|
DCHECK(data);
|
|
DCHECK(substitute_data);
|
|
if (!self || !data || !substitute_data)
|
|
return;
|
|
|
|
CefRefPtr<CefStreamReader> substituteDataPtr;
|
|
|
|
CefContentFilterCppToC::Get(self)->ProcessData(data, data_size,
|
|
substituteDataPtr);
|
|
|
|
if(substituteDataPtr.get())
|
|
*substitute_data = CefStreamReaderCToCpp::Unwrap(substituteDataPtr);
|
|
}
|
|
|
|
void CEF_CALLBACK content_filter_drain(struct _cef_content_filter_t* self,
|
|
cef_stream_reader_t** remainder)
|
|
{
|
|
DCHECK(self);
|
|
DCHECK(remainder);
|
|
if (!self || !remainder)
|
|
return;
|
|
|
|
CefRefPtr<CefStreamReader> remainderPtr;
|
|
|
|
CefContentFilterCppToC::Get(self)->Drain(remainderPtr);
|
|
|
|
if(remainderPtr.get())
|
|
*remainder = CefStreamReaderCToCpp::Unwrap(remainderPtr);
|
|
}
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
CefContentFilterCppToC::CefContentFilterCppToC(CefContentFilter* cls)
|
|
: CefCppToC<CefContentFilterCppToC, CefContentFilter, cef_content_filter_t>(
|
|
cls)
|
|
{
|
|
struct_.struct_.process_data = content_filter_process_data;
|
|
struct_.struct_.drain = content_filter_drain;
|
|
}
|
|
|
|
#ifndef NDEBUG
|
|
template<> long CefCppToC<CefContentFilterCppToC, CefContentFilter,
|
|
cef_content_filter_t>::DebugObjCt = 0;
|
|
#endif
|
|
|