mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
libcef:
- Add CefReadHandler and CefWriteHandler classes for creating streams handled by the client. cefclient: - Add a CefReadHandler test. - Move tests out of cefclient.cpp and into separate implementation files. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@39 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -11,9 +11,42 @@
|
||||
//
|
||||
|
||||
#include "../precompiled_libcef.h"
|
||||
#include "cpptoc/write_handler_cpptoc.h"
|
||||
#include "ctocpp/stream_writer_ctocpp.h"
|
||||
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefStreamWriter> CefStreamWriter::CreateForFile(
|
||||
const std::wstring& fileName)
|
||||
{
|
||||
DCHECK(!fileName.empty());
|
||||
if(fileName.empty())
|
||||
return NULL;
|
||||
|
||||
cef_stream_writer_t* impl =
|
||||
cef_stream_writer_create_for_file(fileName.c_str());
|
||||
if(impl)
|
||||
return CefStreamWriterCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefStreamWriter> CefStreamWriter::CreateForHandler(
|
||||
CefRefPtr<CefWriteHandler> handler)
|
||||
{
|
||||
DCHECK(handler.get());
|
||||
if(!handler.get())
|
||||
return NULL;
|
||||
|
||||
cef_stream_writer_t* impl =
|
||||
cef_stream_writer_create_for_handler(
|
||||
CefWriteHandlerCppToC::Wrap(handler));
|
||||
if(impl)
|
||||
return CefStreamWriterCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n)
|
||||
|
Reference in New Issue
Block a user