@@ -132,13 +132,16 @@ cdef class Cookie:
132132 return CefToPyString(cefString)
133133
134134 cpdef py_void SetSecure(self , py_bool secure):
135- self .cefCookie.secure = secure
135+ # Need to wrap it with bool() to get rid of the C++ compiler
136+ # warnings: "cefpython.cpp(24740) : warning C4800: 'int' :
137+ # forcing value to bool 'true' or 'false' (performance warning)".
138+ self .cefCookie.secure = bool (secure)
136139
137140 cpdef py_bool GetSecure(self ):
138141 return self .cefCookie.secure
139142
140143 cpdef py_void SetHttpOnly(self , py_bool httpOnly):
141- self .cefCookie.httponly = httpOnly
144+ self .cefCookie.httponly = bool ( httpOnly)
142145
143146 cpdef py_bool GetHttpOnly(self ):
144147 return self .cefCookie.httponly
@@ -156,7 +159,7 @@ cdef class Cookie:
156159 return CefTimeTToDatetime(self .cefCookie.last_access)
157160
158161 cpdef py_void SetHasExpires(self , py_bool hasExpires):
159- self .cefCookie.has_expires = hasExpires
162+ self .cefCookie.has_expires = bool ( hasExpires)
160163
161164 cpdef py_bool GetHasExpires(self ):
162165 return self .cefCookie.has_expires
@@ -216,23 +219,25 @@ cdef class PyCookieManager:
216219 return True
217220 raise Exception (" CookieVisitor object is missing Visit() method" )
218221
219- cpdef cpp_bool VisitAllCookies(self , object userCookieVisitor) except * :
222+ cpdef py_bool VisitAllCookies(self , object userCookieVisitor):
220223 self .ValidateUserCookieVisitor(userCookieVisitor)
221224 cdef int cookieVisitorId = StoreUserCookieVisitor(userCookieVisitor)
222225 cdef CefRefPtr[CefCookieVisitor] cefCookieVisitor = (
223226 < CefRefPtr[CefCookieVisitor]?> new CookieVisitor(
224227 cookieVisitorId))
225- self .cefCookieManager.get().VisitAllCookies(cefCookieVisitor)
228+ return self .cefCookieManager.get().VisitAllCookies(
229+ cefCookieVisitor)
226230
227- cpdef cpp_bool VisitUrlCookies(self , py_string url,
228- py_bool includeHttpOnly, object userCookieVisitor) except * :
231+ cpdef py_bool VisitUrlCookies(self , py_string url,
232+ py_bool includeHttpOnly, object userCookieVisitor):
229233 self .ValidateUserCookieVisitor(userCookieVisitor)
230234 cdef int cookieVisitorId = StoreUserCookieVisitor(userCookieVisitor)
231235 cdef CefRefPtr[CefCookieVisitor] cefCookieVisitor = (
232236 < CefRefPtr[CefCookieVisitor]?> new CookieVisitor(
233237 cookieVisitorId))
234- self .cefCookieManager.get().VisitUrlCookies(PyToCefStringValue(url),
235- includeHttpOnly, cefCookieVisitor)
238+ return self .cefCookieManager.get().VisitUrlCookies(
239+ PyToCefStringValue(url), bool (includeHttpOnly),
240+ cefCookieVisitor)
236241
237242 cpdef py_void SetCookie(self , py_string url, PyCookie cookie):
238243 assert isinstance (cookie, Cookie), " cookie object is invalid"
@@ -245,7 +250,7 @@ cdef class PyCookieManager:
245250 & cef_cookie_manager_namespace.DeleteCookies,
246251 PyToCefStringValue(url), PyToCefStringValue(cookie_name)))
247252
248- cpdef cpp_bool SetStoragePath(self , py_string path) except * :
253+ cpdef py_bool SetStoragePath(self , py_string path):
249254 return self .cefCookieManager.get().SetStoragePath(
250255 PyToCefStringValue(path))
251256
0 commit comments