diff --git a/include/wx/webview_chromium.h b/include/wx/webview_chromium.h index d87d9e9ade..616a2b3724 100644 --- a/include/wx/webview_chromium.h +++ b/include/wx/webview_chromium.h @@ -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 diff --git a/src/common/webview_chromium.cpp b/src/common/webview_chromium.cpp index d200c23512..b977535bb1 100644 --- a/src/common/webview_chromium.cpp +++ b/src/common/webview_chromium.cpp @@ -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 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() ) {