Add support for CEF 2062.

This commit is contained in:
Steven Lamerton 2015-02-01 10:24:23 +00:00 committed by Tobias Taschner
parent ace8f9259c
commit 5101c8ed66
No known key found for this signature in database
GPG key ID: AE6ECD71294F87FD
2 changed files with 18 additions and 3 deletions

View file

@ -24,6 +24,10 @@
#include "include/cef_browser.h"
#include "include/cef_client.h"
#include "include/cef_scheme.h"
#include "include/cef_version.h"
#if CHROME_VERSION_BUILD >= 2062
#include "include/base/cef_lock.h"
#endif
#ifdef __VISUALC__
#pragma warning(pop)
@ -140,7 +144,11 @@ private:
size_t m_offset;
IMPLEMENT_REFCOUNTING(SchemeHandler);
#if CHROME_VERSION_BUILD >= 2062
base::Lock m_lock;
#else
IMPLEMENT_LOCKING(SchemeHandler);
#endif
};
class SchemeHandlerFactory : public CefSchemeHandlerFactory

View file

@ -25,7 +25,6 @@
#include "include/cef_app.h"
#include "include/cef_browser.h"
#include "include/cef_string_visitor.h"
#include "include/cef_version.h"
#ifdef __VISUALC__
#pragma warning(pop)
@ -735,7 +734,11 @@ bool SchemeHandler::ProcessRequest(CefRefPtr<CefRequest> request,
{
bool handled = false;
AutoLock lock_scope( this );
#if CHROME_VERSION_BUILD >= 2062
base::AutoLock lock_scope(m_lock);
#else
AutoLock lock_scope(this);
#endif
std::string url = request->GetURL();
wxFSFile* file = m_handler->GetFile( url );
@ -782,7 +785,11 @@ bool SchemeHandler::ReadResponse(void* data_out,
bool has_data = false;
bytes_read = 0;
AutoLock lock_scope( this );
#if CHROME_VERSION_BUILD >= 2062
base::AutoLock lock_scope(m_lock);
#else
AutoLock lock_scope(this);
#endif
if ( m_offset < m_data.length() )
{