- Add MayBlock() method to stream classes which is used as a hint when determining the thread to access the stream from (issue #1187).

- In cases where MayBlock() returns true have CefStreamResourceReader perform the reads on the FILE thread (issue #1187).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1582 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2014-01-30 23:15:55 +00:00
parent 89a8832550
commit 2534b67365
23 changed files with 541 additions and 18 deletions

View File

@ -77,6 +77,13 @@ typedef struct _cef_read_handler_t {
// Return non-zero if at end of file.
///
int (CEF_CALLBACK *eof)(struct _cef_read_handler_t* self);
///
// Return true (1) if this handler performs work like accessing the file
// system which may block. Used as a hint for determining the thread to access
// the handler from.
///
int (CEF_CALLBACK *may_block)(struct _cef_read_handler_t* self);
} cef_read_handler_t;
@ -112,6 +119,13 @@ typedef struct _cef_stream_reader_t {
// Return non-zero if at end of file.
///
int (CEF_CALLBACK *eof)(struct _cef_stream_reader_t* self);
///
// Returns true (1) if this reader performs work like accessing the file
// system which may block. Used as a hint for determining the thread to access
// the reader from.
///
int (CEF_CALLBACK *may_block)(struct _cef_stream_reader_t* self);
} cef_stream_reader_t;
@ -166,6 +180,13 @@ typedef struct _cef_write_handler_t {
// Flush the stream.
///
int (CEF_CALLBACK *flush)(struct _cef_write_handler_t* self);
///
// Return true (1) if this handler performs work like accessing the file
// system which may block. Used as a hint for determining the thread to access
// the handler from.
///
int (CEF_CALLBACK *may_block)(struct _cef_write_handler_t* self);
} cef_write_handler_t;
@ -201,6 +222,13 @@ typedef struct _cef_stream_writer_t {
// Flush the stream.
///
int (CEF_CALLBACK *flush)(struct _cef_stream_writer_t* self);
///
// Returns true (1) if this writer performs work like accessing the file
// system which may block. Used as a hint for determining the thread to access
// the writer from.
///
int (CEF_CALLBACK *may_block)(struct _cef_stream_writer_t* self);
} cef_stream_writer_t;