- 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:
Marshall Greenblatt
2009-08-21 17:41:09 +00:00
parent b821811c08
commit 2b7e69d200
34 changed files with 1592 additions and 516 deletions

View File

@ -12,6 +12,38 @@
#include "../precompiled_libcef.h"
#include "cpptoc/stream_writer_cpptoc.h"
#include "ctocpp/write_handler_ctocpp.h"
// GLOBAL FUNCTIONS - Body may be edited by hand.
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file(
const wchar_t* fileName)
{
DCHECK(fileName);
if(!fileName)
return NULL;
std::wstring fileNameStr = fileName;
CefRefPtr<CefStreamWriter> impl = CefStreamWriter::CreateForFile(fileName);
if(impl.get())
return CefStreamWriterCppToC::Wrap(impl);
return NULL;
}
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler(
cef_write_handler_t* handler)
{
DCHECK(handler);
if(!handler)
return NULL;
CefRefPtr<CefStreamWriter> impl =
CefStreamWriter::CreateForHandler(CefWriteHandlerCToCpp::Wrap(handler));
if(impl.get())
return CefStreamWriterCppToC::Wrap(impl);
return NULL;
}
// MEMBER FUNCTIONS - Body may be edited by hand.