Improve thread safety and documentation and add support for thread-specific APIs (issue #175).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@174 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-01-29 01:42:59 +00:00
parent c89349cf5a
commit 7f1694fb68
20 changed files with 1207 additions and 1128 deletions

View File

@ -3,9 +3,10 @@
// can be found in the LICENSE file.
#include "include/cef_wrapper.h"
#include "resource_util.h"
#include "scheme_test.h"
#include "string_util.h"
#include "resource_util.h"
#include "util.h"
#ifdef _WIN32
#include "resource.h"
@ -30,6 +31,8 @@ public:
virtual bool ProcessRequest(CefRefPtr<CefRequest> request,
CefString& mime_type, int* response_length)
{
REQUIRE_IO_THREAD();
bool handled = false;
Lock();
@ -91,6 +94,7 @@ public:
// Cancel processing of the request.
virtual void Cancel()
{
REQUIRE_IO_THREAD();
}
// Copy up to |bytes_to_read| bytes into |data_out|. If the copy succeeds
@ -99,6 +103,8 @@ public:
virtual bool ReadResponse(void* data_out, int bytes_to_read,
int* bytes_read)
{
REQUIRE_IO_THREAD();
bool has_data = false;
*bytes_read = 0;
@ -134,6 +140,7 @@ public:
// Return a new scheme handler instance to handle the request.
virtual CefRefPtr<CefSchemeHandler> Create()
{
REQUIRE_IO_THREAD();
return new ClientSchemeHandler();
}
};