mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- 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:
@@ -77,6 +77,19 @@ int CefReadHandlerCToCpp::Eof() {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
bool CefReadHandlerCToCpp::MayBlock() {
|
||||
if (CEF_MEMBER_MISSING(struct_, may_block))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->may_block(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefReadHandlerCToCpp, CefReadHandler,
|
||||
|
@@ -38,6 +38,7 @@ class CefReadHandlerCToCpp
|
||||
virtual int Seek(int64 offset, int whence) OVERRIDE;
|
||||
virtual int64 Tell() OVERRIDE;
|
||||
virtual int Eof() OVERRIDE;
|
||||
virtual bool MayBlock() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
|
@@ -133,6 +133,19 @@ int CefStreamReaderCToCpp::Eof() {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
bool CefStreamReaderCToCpp::MayBlock() {
|
||||
if (CEF_MEMBER_MISSING(struct_, may_block))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->may_block(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefStreamReaderCToCpp, CefStreamReader,
|
||||
|
@@ -38,6 +38,7 @@ class CefStreamReaderCToCpp
|
||||
virtual int Seek(int64 offset, int whence) OVERRIDE;
|
||||
virtual int64 Tell() OVERRIDE;
|
||||
virtual int Eof() OVERRIDE;
|
||||
virtual bool MayBlock() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
|
@@ -115,6 +115,19 @@ int CefStreamWriterCToCpp::Flush() {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
bool CefStreamWriterCToCpp::MayBlock() {
|
||||
if (CEF_MEMBER_MISSING(struct_, may_block))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->may_block(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefStreamWriterCToCpp, CefStreamWriter,
|
||||
|
@@ -38,6 +38,7 @@ class CefStreamWriterCToCpp
|
||||
virtual int Seek(int64 offset, int whence) OVERRIDE;
|
||||
virtual int64 Tell() OVERRIDE;
|
||||
virtual int Flush() OVERRIDE;
|
||||
virtual bool MayBlock() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
|
@@ -77,6 +77,19 @@ int CefWriteHandlerCToCpp::Flush() {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
bool CefWriteHandlerCToCpp::MayBlock() {
|
||||
if (CEF_MEMBER_MISSING(struct_, may_block))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->may_block(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefWriteHandlerCToCpp, CefWriteHandler,
|
||||
|
@@ -38,6 +38,7 @@ class CefWriteHandlerCToCpp
|
||||
virtual int Seek(int64 offset, int whence) OVERRIDE;
|
||||
virtual int64 Tell() OVERRIDE;
|
||||
virtual int Flush() OVERRIDE;
|
||||
virtual bool MayBlock() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
|
Reference in New Issue
Block a user