Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client_handler/cookie_visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
class CookieVisitor : public CefCookieVisitor
{
public:
int cookieVisitorId_;
int64_t cookieVisitorId_;
public:
CookieVisitor(int cookieVisitorId)
CookieVisitor(int64_t cookieVisitorId)
: cookieVisitorId_(cookieVisitorId) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/client_handler/resource_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
class ResourceHandler : public CefResourceHandler
{
public:
int resourceHandlerId_;
int64_t resourceHandlerId_;
public:
ResourceHandler(int resourceHandlerId)
ResourceHandler(int64_t resourceHandlerId)
: resourceHandlerId_(resourceHandlerId) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/client_handler/string_visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
class StringVisitor : public CefStringVisitor
{
public:
int stringVisitorId_;
int64_t stringVisitorId_;
public:
StringVisitor(int stringVisitorId)
StringVisitor(int64_t stringVisitorId)
: stringVisitorId_(stringVisitorId) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/client_handler/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"

void PostTaskWrapper(int threadId, int taskId) {
void PostTaskWrapper(int threadId, int64_t taskId) {
CefPostTask(
static_cast<CefThreadId>(threadId),
CefCreateClosureTask(base::BindOnce(
Expand All @@ -17,7 +17,7 @@ void PostTaskWrapper(int threadId, int taskId) {
);
}

void PostDelayedTaskWrapper(int threadId, int64_t delay_ms, int taskId) {
void PostDelayedTaskWrapper(int threadId, int64_t delay_ms, int64_t taskId) {
CefPostDelayedTask(
static_cast<CefThreadId>(threadId),
CefCreateClosureTask(base::BindOnce(
Expand Down
4 changes: 2 additions & 2 deletions src/client_handler/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "include/cef_cookie.h"
#include "include/cef_task.h"

void PostTaskWrapper(int threadId, int taskId);
void PostDelayedTaskWrapper(int threadId, int64_t delay_ms, int taskId);
void PostTaskWrapper(int threadId, int64_t taskId);
void PostDelayedTaskWrapper(int threadId, int64_t delay_ms, int64_t taskId);

CefRefPtr<CefTask> CreateTask_SetCookie(
CefCookieManager* obj,
Expand Down
4 changes: 2 additions & 2 deletions src/client_handler/web_request_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
class WebRequestClient : public CefURLRequestClient
{
public:
int webRequestId_;
int64_t webRequestId_;
public:
WebRequestClient(int webRequestId) :
WebRequestClient(int64_t webRequestId) :
webRequestId_(webRequestId) {
}
virtual ~WebRequestClient(){}
Expand Down
13 changes: 7 additions & 6 deletions src/cookie.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Project website: https://github.com/cztomczak/cefpython

include "cefpython.pyx"
from libc.stdint cimport int64_t

from task cimport *

Expand All @@ -28,7 +29,7 @@ cdef PyCookieManager g_globalCookieManager = None
# See StoreUserCookieVisitor().
import weakref
cdef object g_userCookieVisitors = weakref.WeakValueDictionary()
cdef int g_userCookieVisitorMaxId = 0
cdef int64_t g_userCookieVisitorMaxId = 0

# ------------------------------------------------------------------------------
# Cookie
Expand Down Expand Up @@ -232,7 +233,7 @@ cdef class PyCookieManager:

cpdef py_bool VisitAllCookies(self, object userCookieVisitor):
self.ValidateUserCookieVisitor(userCookieVisitor)
cdef int cookieVisitorId = StoreUserCookieVisitor(userCookieVisitor)
cdef int64_t cookieVisitorId = StoreUserCookieVisitor(userCookieVisitor)
cdef CefRefPtr[CefCookieVisitor] cefCookieVisitor = (
<CefRefPtr[CefCookieVisitor]?>new CookieVisitor(
cookieVisitorId))
Expand All @@ -242,7 +243,7 @@ cdef class PyCookieManager:
cpdef py_bool VisitUrlCookies(self, py_string url,
py_bool includeHttpOnly, object userCookieVisitor):
self.ValidateUserCookieVisitor(userCookieVisitor)
cdef int cookieVisitorId = StoreUserCookieVisitor(userCookieVisitor)
cdef int64_t cookieVisitorId = StoreUserCookieVisitor(userCookieVisitor)
cdef CefRefPtr[CefCookieVisitor] cefCookieVisitor = (
<CefRefPtr[CefCookieVisitor]?>new CookieVisitor(
cookieVisitorId))
Expand Down Expand Up @@ -272,14 +273,14 @@ cdef class PyCookieManager:
# PyCookieVisitor
# ------------------------------------------------------------------------------

cdef int StoreUserCookieVisitor(object userCookieVisitor) except *:
cdef int64_t StoreUserCookieVisitor(object userCookieVisitor) except *:
global g_userCookieVisitorMaxId
global g_userCookieVisitors
g_userCookieVisitorMaxId += 1
g_userCookieVisitors[g_userCookieVisitorMaxId] = userCookieVisitor
return g_userCookieVisitorMaxId

cdef PyCookieVisitor GetPyCookieVisitor(int cookieVisitorId):
cdef PyCookieVisitor GetPyCookieVisitor(int64_t cookieVisitorId):
global g_userCookieVisitors
cdef object userCookieVisitor
cdef PyCookieVisitor pyCookieVisitor
Expand All @@ -305,7 +306,7 @@ cdef class PyCookieVisitor:
# ------------------------------------------------------------------------------

cdef public cpp_bool CookieVisitor_Visit(
int cookieVisitorId,
int64_t cookieVisitorId,
const CefCookie& cookie,
int count,
int total,
Expand Down
4 changes: 3 additions & 1 deletion src/extern/cookie_visitor.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# All rights reserved. Licensed under BSD 3-clause license.
# Project website: https://github.com/cztomczak/cefpython

from libc.stdint cimport int64_t

cdef extern from "client_handler/cookie_visitor.h":

cdef cppclass CookieVisitor:
CookieVisitor(int cookieVisitorId)
CookieVisitor(int64_t cookieVisitorId)
4 changes: 3 additions & 1 deletion src/extern/resource_handler.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# All rights reserved. Licensed under BSD 3-clause license.
# Project website: https://github.com/cztomczak/cefpython

from libc.stdint cimport int64_t

cdef extern from "client_handler/resource_handler.h":

cdef cppclass ResourceHandler:
ResourceHandler(int resourceHandlerId)
ResourceHandler(int64_t resourceHandlerId)
4 changes: 3 additions & 1 deletion src/extern/string_visitor.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# All rights reserved. Licensed under BSD 3-clause license.
# Project website: https://github.com/cztomczak/cefpython

from libc.stdint cimport int64_t

cdef extern from "client_handler/string_visitor.h":

cdef cppclass StringVisitor:
StringVisitor(int stringVisitorId)
StringVisitor(int64_t stringVisitorId)
4 changes: 2 additions & 2 deletions src/extern/task.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ from libc.stdint cimport int64_t

cdef extern from "client_handler/task.h":

void PostTaskWrapper(int threadId, int taskId) nogil
void PostDelayedTaskWrapper(int threadId, int64_t delay_ms, int taskId) nogil
void PostTaskWrapper(int threadId, int64_t taskId) nogil
void PostDelayedTaskWrapper(int threadId, int64_t delay_ms, int64_t taskId) nogil

cdef CefRefPtr[CefTask] CreateTask_SetCookie(
CefCookieManager* obj,
Expand Down
4 changes: 3 additions & 1 deletion src/extern/web_request_client.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# All rights reserved. Licensed under BSD 3-clause license.
# Project website: https://github.com/cztomczak/cefpython

from libc.stdint cimport int64_t

cdef extern from "client_handler/web_request_client.h":

cdef cppclass WebRequestClient:
WebRequestClient(int webRequestId)
WebRequestClient(int64_t webRequestId)
16 changes: 8 additions & 8 deletions src/handlers/resource_handler.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import weakref

# See StoreUserCookieVisitor().
cdef object g_userResourceHandler = weakref.WeakValueDictionary()
cdef int g_userResourceHandlerMaxId = 0
cdef int64_t g_userResourceHandlerMaxId = 0


# -----------------------------------------------------------------------------
Expand All @@ -34,20 +34,20 @@ cdef py_void ValidateUserResourceHandler(object userResourceHandler):
cdef CefRefPtr[CefResourceHandler] CreateResourceHandler(
object userResourceHandler) except *:
ValidateUserResourceHandler(userResourceHandler)
cdef int resourceHandlerId = StoreUserResourceHandler(userResourceHandler)
cdef int64_t resourceHandlerId = StoreUserResourceHandler(userResourceHandler)
cdef CefRefPtr[CefResourceHandler] resourceHandler =\
<CefRefPtr[CefResourceHandler]?>new ResourceHandler(
resourceHandlerId)
return resourceHandler

cdef int StoreUserResourceHandler(object userResourceHandler) except *:
cdef int64_t StoreUserResourceHandler(object userResourceHandler) except *:
global g_userResourceHandlerMaxId
global g_userResourceHandler
g_userResourceHandlerMaxId += 1
g_userResourceHandler[g_userResourceHandlerMaxId] = userResourceHandler
return g_userResourceHandlerMaxId

cdef PyResourceHandler GetPyResourceHandler(int resourceHandlerId):
cdef PyResourceHandler GetPyResourceHandler(int64_t resourceHandlerId):
global g_userResourceHandler
cdef object userResourceHandler
cdef PyResourceHandler pyResourceHandler
Expand All @@ -73,7 +73,7 @@ cdef class PyResourceHandler:
# ------------------------------------------------------------------------------

cdef public cpp_bool ResourceHandler_ProcessRequest(
int resourceHandlerId,
int64_t resourceHandlerId,
CefRefPtr[CefRequest] cefRequest,
CefRefPtr[CefCallback] cefCallback
) noexcept with gil:
Expand All @@ -100,7 +100,7 @@ cdef public cpp_bool ResourceHandler_ProcessRequest(
sys.excepthook(exc_type, exc_value, exc_trace)

cdef public void ResourceHandler_GetResponseHeaders(
int resourceHandlerId,
int64_t resourceHandlerId,
CefRefPtr[CefResponse] cefResponse,
int64_t& cefResponseLength,
CefString& cefRedirectUrl
Expand Down Expand Up @@ -132,7 +132,7 @@ cdef public void ResourceHandler_GetResponseHeaders(
sys.excepthook(exc_type, exc_value, exc_trace)

cdef public cpp_bool ResourceHandler_ReadResponse(
int resourceHandlerId,
int64_t resourceHandlerId,
void* cefDataOut,
int bytesToRead,
int& cefBytesRead,
Expand Down Expand Up @@ -183,7 +183,7 @@ cdef public cpp_bool ResourceHandler_ReadResponse(
sys.excepthook(exc_type, exc_value, exc_trace)

cdef public void ResourceHandler_Cancel(
int resourceHandlerId
int64_t resourceHandlerId
) noexcept with gil:
cdef PyResourceHandler pyResourceHandler
cdef object userCallback
Expand Down
11 changes: 6 additions & 5 deletions src/string_visitor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Project website: https://github.com/cztomczak/cefpython

include "cefpython.pyx"
from libc.stdint cimport int64_t

import weakref

Expand All @@ -11,16 +12,16 @@ import weakref
# -----------------------------------------------------------------------------

cdef object g_userStringVisitors = weakref.WeakValueDictionary()
cdef int g_userStringVisitorMaxId = 0
cdef int64_t g_userStringVisitorMaxId = 0

cdef int StoreUserStringVisitor(object userStringVisitor) except *:
cdef int64_t StoreUserStringVisitor(object userStringVisitor) except *:
global g_userStringVisitorMaxId
global g_userStringVisitors
g_userStringVisitorMaxId += 1
g_userStringVisitors[g_userStringVisitorMaxId] = userStringVisitor
return g_userStringVisitorMaxId

cdef PyStringVisitor GetUserStringVisitor(int stringVisitorId):
cdef PyStringVisitor GetUserStringVisitor(int64_t stringVisitorId):
global g_userStringVisitors
cdef object userStringVisitor
cdef PyStringVisitor pyStringVisitor
Expand Down Expand Up @@ -51,13 +52,13 @@ cdef CefRefPtr[CefStringVisitor] CreateStringVisitor(
raise Exception("userStringVisitor object missing")
if not hasattr(userStringVisitor, "Visit"):
raise Exception("userStringVisitor object is missing Visit() method")
cdef int stringVisitorId = StoreUserStringVisitor(userStringVisitor)
cdef int64_t stringVisitorId = StoreUserStringVisitor(userStringVisitor)
cdef CefRefPtr[CefStringVisitor] cefStringVisitor = (
<CefRefPtr[CefStringVisitor]?>new StringVisitor(stringVisitorId))
return cefStringVisitor

cdef public void StringVisitor_Visit(
int stringVisitorId,
int64_t stringVisitorId,
const CefString& string
) noexcept with gil:
cdef str pyString
Expand Down
7 changes: 4 additions & 3 deletions src/task.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Project website: https://github.com/cztomczak/cefpython

include "cefpython.pyx"
from libc.stdint cimport int64_t

g_taskMaxId = 0
g_tasks = {}
Expand All @@ -29,7 +30,7 @@ def PostTask(int thread, object func, *args):
}

# Call C++ wrapper.
cdef int cTaskId = int(g_taskMaxId)
cdef int64_t cTaskId = int(g_taskMaxId)
with nogil:
PostTaskWrapper(thread, cTaskId)

Expand All @@ -56,12 +57,12 @@ def PostDelayedTask(int thread, int delay_ms, object func, *args):
}

# Call C++ wrapper.
cdef int cTaskId = int(g_taskMaxId)
cdef int64_t cTaskId = int(g_taskMaxId)
with nogil:
PostDelayedTaskWrapper(thread, delay_ms, cTaskId)


cdef public void PyTaskRunnable(int taskId) noexcept with gil:
cdef public void PyTaskRunnable(int64_t taskId) noexcept with gil:
cdef object func
cdef list params
cdef object task
Expand Down
Loading