Skip to content

Commit

Permalink
Update to Chromium v58 on Linux (#354).
Browse files Browse the repository at this point in the history
CEF version: 3.3029.1602.g19201cd
Chromium version: 58.0.3029.33

Only Linux src/versions/ was updated.
Following update instructions from Issue #264.
Update patches.
Update docs.

Fix PaintBuffer deprecated methods.

Add --make-distrib flag in automate.py to re-make CEF binary distrib.

Update run_examples.py to run gtk3.py example.
  • Loading branch information
cztomczak committed Apr 24, 2017
1 parent 6261d4c commit 460ce99
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 82 deletions.
49 changes: 27 additions & 22 deletions api/LoadHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,24 @@ calls to OnLoadError and/or OnLoadEnd.
| frame | [Frame](Frame.md) |
| __Return__ | void |

Description from upstream CEF:
> Called after a navigation has been committed and before the browser begins
> loading contents in the frame. The |frame| value will never be empty --
> call the IsMain() method to check if this frame is the main frame.
> |transition_type| provides information about the source of the navigation
> and an accurate value is only available in the browser process. Multiple
> frames may be loading at the same time. Sub-frames may start or continue
> loading after the main frame load has ended. This method will not be called
> for same page navigations (fragments, history state, etc.) or for
> navigations that fail or are canceled before commit. For notification of
> overall browser load status use OnLoadingStateChange instead.
This callback is called for a number of different reasons, including when
history.pushState or history.replaceState changes the reference fragment
for the currently loaded page. In most cases you want to use
OnLoadingStateChange. In newer CEF there is |transition_type| arg that
provides information about the source of the navigation.

Description from upstream CEF:
> Called when the browser begins loading a frame. The |frame| value will
> never be empty -- call the IsMain() method to check if this frame is the
> main frame. |transition_type| provides information about the source of the
> navigation and an accurate value is only available in the browser process.
> Multiple frames may be loading at the same time. Sub-frames may
> start or continue loading after the main frame load has ended. This method
> will always be called for all frames irrespective of whether the request
> completes successfully. For notification of overall browser load status use
> [DisplayHandler](DisplayHandler.md).`OnLoadingStateChange` instead.

### OnDomReady

Expand All @@ -81,13 +82,15 @@ Not yet implemented. See [Issue #32](../issues/32).
| http_code | int |
| __Return__ | void |

Called when the browser is done loading a frame. The |frame| value will
never be empty -- call the IsMain() method to check if this frame is the
main frame. Multiple frames may be loading at the same time. Sub-frames may
start or continue loading after the main frame load has ended. This method
will always be called for all frames irrespective of whether the request
completes successfully. For notification of overall browser load status use
OnLoadingStateChange instead.
Description from upstream CEF:
> Called when the browser is done loading a frame. The |frame| value will
> never be empty -- call the IsMain() method to check if this frame is the
> main frame. Multiple frames may be loading at the same time. Sub-frames may
> start or continue loading after the main frame load has ended. This method
> will not be called for same page navigations (fragments, history state,
> etc.) or for navigations that fail or are canceled before commit. For
> notification of overall browser load status use OnLoadingStateChange
> instead.
This event behaves like window.onload, it waits for all the content
to load (e.g. images), there is currently no callback for
Expand All @@ -108,10 +111,12 @@ topic: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10906
| failed_url | string |
| __Return__ | void |

Called when the resource load for a navigation fails or is canceled.
|errorCode| is the error code number, |error_text_out[0]| is the error
text and |failed_url| is the URL that failed to load. See
net\base\net_error_list.h for complete descriptions of the error codes.
Description from upstream CEF:
> Called when a navigation fails or is canceled. This method may be called
> by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
> after commit. |errorCode| is the error code number, |errorText| is the
> error text and |failedUrl| is the URL that failed to load.
> See net\base\net_error_list.h for complete descriptions of the error codes.
This callback may get called when [Browser](Browser.md).`StopLoad`
is called, or when file download is aborted (see DownloadHandler).
4 changes: 2 additions & 2 deletions patches/issue125.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git http_cache_transaction.cc http_cache_transaction.cc
index 24002d75215d..2a44a6368558 100644
index ede3541aa401..138977424d02 100644
--- http_cache_transaction.cc
+++ http_cache_transaction.cc
@@ -2601,7 +2601,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
@@ -2609,7 +2609,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
// blocking page is shown. An alternative would be to reverse-map the cert
// status to a net error and replay the net error.
if ((response_.headers->HasHeaderValue("cache-control", "no-store")) ||
Expand Down
12 changes: 6 additions & 6 deletions patches/issue251.patch
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ index 29b85e84..e3c9c2df 100644

#endif // CEF_INCLUDE_CEF_DRAG_DATA_H_
diff --git libcef/browser/osr/browser_platform_delegate_osr.cc libcef/browser/osr/browser_platform_delegate_osr.cc
index 2cf44f6d..2e6b8c32 100644
index 148ef49c..59cfae97 100644
--- libcef/browser/osr/browser_platform_delegate_osr.cc
+++ libcef/browser/osr/browser_platform_delegate_osr.cc
@@ -7,6 +7,7 @@
Expand All @@ -82,7 +82,7 @@ index 2cf44f6d..2e6b8c32 100644
#include "libcef/browser/osr/render_widget_host_view_osr.h"
#include "libcef/browser/osr/web_contents_view_osr.h"
#include "libcef/common/drag_data_impl.h"
@@ -393,7 +394,9 @@ void CefBrowserPlatformDelegateOsr::StartDragging(
@@ -432,7 +433,9 @@ void CefBrowserPlatformDelegateOsr::StartDragging(
CefRefPtr<CefRenderHandler> handler =
browser_->GetClient()->GetRenderHandler();
if (handler.get()) {
Expand All @@ -94,10 +94,10 @@ index 2cf44f6d..2e6b8c32 100644
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
diff --git libcef/common/drag_data_impl.cc libcef/common/drag_data_impl.cc
index 6b632ab2..2f12b928 100644
index a8e2c8e1..b0c47e8e 100644
--- libcef/common/drag_data_impl.cc
+++ libcef/common/drag_data_impl.cc
@@ -20,6 +20,13 @@ CefDragDataImpl::CefDragDataImpl(const content::DropData& data)
@@ -19,6 +19,13 @@ CefDragDataImpl::CefDragDataImpl(const content::DropData& data)
read_only_(false) {
}

Expand All @@ -111,7 +111,7 @@ index 6b632ab2..2f12b928 100644
CefDragDataImpl::CefDragDataImpl()
: read_only_(false) {
}
@@ -32,7 +39,7 @@ CefRefPtr<CefDragData> CefDragDataImpl::Clone() {
@@ -31,7 +38,7 @@ CefRefPtr<CefDragData> CefDragDataImpl::Clone() {
CefDragDataImpl* drag_data = NULL;
{
base::AutoLock lock_scope(lock_);
Expand All @@ -120,7 +120,7 @@ index 6b632ab2..2f12b928 100644
}
return drag_data;
}
@@ -191,3 +198,20 @@ void CefDragDataImpl::SetReadOnly(bool read_only) {
@@ -187,3 +194,20 @@ void CefDragDataImpl::SetReadOnly(bool read_only) {

read_only_ = read_only;
}
Expand Down
35 changes: 19 additions & 16 deletions src/include/cef_load_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ class CefLoadHandler : public virtual CefBaseRefCounted {
bool canGoForward) {}

///
// Called when the browser begins loading a frame. The |frame| value will
// never be empty -- call the IsMain() method to check if this frame is the
// main frame. |transition_type| provides information about the source of the
// navigation and an accurate value is only available in the browser process.
// Multiple frames may be loading at the same time. Sub-frames may start or
// continue loading after the main frame load has ended. This method will
// always be called for all frames irrespective of whether the request
// completes successfully. For notification of overall browser load status use
// OnLoadingStateChange instead.
// Called after a navigation has been committed and before the browser begins
// loading contents in the frame. The |frame| value will never be empty --
// call the IsMain() method to check if this frame is the main frame.
// |transition_type| provides information about the source of the navigation
// and an accurate value is only available in the browser process. Multiple
// frames may be loading at the same time. Sub-frames may start or continue
// loading after the main frame load has ended. This method will not be called
// for same page navigations (fragments, history state, etc.) or for
// navigations that fail or are canceled before commit. For notification of
// overall browser load status use OnLoadingStateChange instead.
///
/*--cef()--*/
virtual void OnLoadStart(CefRefPtr<CefBrowser> browser,
Expand All @@ -87,20 +88,22 @@ class CefLoadHandler : public virtual CefBaseRefCounted {
// never be empty -- call the IsMain() method to check if this frame is the
// main frame. Multiple frames may be loading at the same time. Sub-frames may
// start or continue loading after the main frame load has ended. This method
// will always be called for all frames irrespective of whether the request
// completes successfully. For notification of overall browser load status use
// OnLoadingStateChange instead.
// will not be called for same page navigations (fragments, history state,
// etc.) or for navigations that fail or are canceled before commit. For
// notification of overall browser load status use OnLoadingStateChange
// instead.
///
/*--cef()--*/
virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int httpStatusCode) {}

///
// Called when the resource load for a navigation fails or is canceled.
// |errorCode| is the error code number, |errorText| is the error text and
// |failedUrl| is the URL that failed to load. See net\base\net_error_list.h
// for complete descriptions of the error codes.
// Called when a navigation fails or is canceled. This method may be called
// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
// after commit. |errorCode| is the error code number, |errorText| is the
// error text and |failedUrl| is the URL that failed to load.
// See net\base\net_error_list.h for complete descriptions of the error codes.
///
/*--cef(optional_param=errorText)--*/
virtual void OnLoadError(CefRefPtr<CefBrowser> browser,
Expand Down
11 changes: 8 additions & 3 deletions src/include/cef_scheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ class CefSchemeRegistrar : public CefBaseScoped {
// rules as those applied to "https" URLs. For example, loading this scheme
// from other secure schemes will not trigger mixed content warnings.
//
// If |is_cors_enabled| is true the scheme that can be sent CORS requests.
// This value should be true in most cases where |is_standard| is true.
// If |is_cors_enabled| is true the scheme can be sent CORS requests. This
// value should be true in most cases where |is_standard| is true.
//
// If |is_csp_bypassing| is true the scheme can bypass Content-Security-Policy
// (CSP) checks. This value should be false in most cases where |is_standard|
// is true.
//
// This function may be called on any thread. It should only be called once
// per unique |scheme_name| value. If |scheme_name| is already registered or
Expand All @@ -145,7 +149,8 @@ class CefSchemeRegistrar : public CefBaseScoped {
bool is_local,
bool is_display_isolated,
bool is_secure,
bool is_cors_enabled) =0;
bool is_cors_enabled,
bool is_csp_bypassing) =0;
};


Expand Down
1 change: 0 additions & 1 deletion src/include/internal/cef_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,6 @@ typedef struct _cef_popup_features_t {

int fullscreen;
int dialog;
cef_string_list_t additionalFeatures;
} cef_popup_features_t;

///
Expand Down
10 changes: 1 addition & 9 deletions src/include/internal/cef_types_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -509,18 +509,10 @@ struct CefPopupFeaturesTraits {
s->resizable = true;
}

static inline void clear(struct_type* s) {
if (s->additionalFeatures)
cef_string_list_free(s->additionalFeatures);
}
static inline void clear(struct_type* s) {}

static inline void set(const struct_type* src, struct_type* target,
bool copy) {
if (target->additionalFeatures)
cef_string_list_free(target->additionalFeatures);
target->additionalFeatures = src->additionalFeatures ?
cef_string_list_copy(src->additionalFeatures) : NULL;

target->x = src->x;
target->xSet = src->xSet;
target->y = src->y;
Expand Down
3 changes: 3 additions & 0 deletions src/linux/binaries_64bit/kivy_.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ def start_cef(self):

# Initialize CEF

# To shutdown all CEF processes on error
sys.excepthook = cef.ExceptHook

# noinspection PyArgumentList
cef.WindowUtils.InstallX11ErrorHandlers()

Expand Down
54 changes: 48 additions & 6 deletions src/paint_buffer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,58 @@ cdef class PaintBuffer:
cdef int height
cdef Py_ssize_t length

def __init__(self):
# TODO: Remove deprecated methods below from API reference
# and update examples during next release
self.GetIntPointer = self.GetPointer
self.GetString = self.GetBytes

cpdef uintptr_t GetPointer(self) except *:
# BEFORE MODIFYING CODE:
# There is an exact copy of this method named "GetIntPointer"
# (deprecated).
return <uintptr_t>self.buffer

cpdef object GetBytes(self, str mode="bgra", str origin="top-left"):
# BEFORE MODIFYING CODE:
# There is an exact copy of this method named "GetString" (deprecated).
cdef void* dest
cdef py_bool dest_alloced = False
cdef object ret

origin = origin.lower()
mode = mode.lower()
assert origin in ("top-left", "bottom-left"), "Invalid origin"
assert mode in ("bgra", "rgba"), "Invalid mode"

# To get rid of a Cython warning:
# | '__pyx_v_dest' may be used uninitialized in this function
dest = <void*>malloc(0)

if mode == "rgba":
if not dest_alloced:
dest = <void*>malloc(self.length)
dest_alloced = True
SwapBufferFromBgraToRgba(dest, self.buffer, self.width,
self.height)

if origin == "bottom-left":
if not dest_alloced:
dest = <void*>malloc(self.length)
dest_alloced = True
FlipBufferUpsideDown(dest, self.buffer, self.width, self.height)

if dest_alloced:
ret = (<char*>dest)[:self.length]
free(dest)
return ret
else:
return (<char*>self.buffer)[:self.length]

# ---- DEPRECATED ---------------------------------------------------------
# TODO: remove deprecated methods from API reference during next release.
# TODO: remove deprecated methods after users had time to update code.

cpdef uintptr_t GetIntPointer(self) except *:
"""@deprecated."""
return <uintptr_t>self.buffer

cpdef object GetString(self, str mode="bgra", str origin="top-left"):
"""@deprecated."""
cdef void* dest
cdef py_bool dest_alloced = False
cdef object ret
Expand Down
20 changes: 10 additions & 10 deletions src/version/cef_version_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
#ifndef CEF_INCLUDE_CEF_VERSION_H_
#define CEF_INCLUDE_CEF_VERSION_H_

#define CEF_VERSION "3.2987.1601.gf035232"
#define CEF_VERSION "3.3029.1602.g19201cd"
#define CEF_VERSION_MAJOR 3
#define CEF_COMMIT_NUMBER 1601
#define CEF_COMMIT_HASH "f035232c082f837d2b85bd7821a93a54fc742775"
#define CEF_COMMIT_NUMBER 1602
#define CEF_COMMIT_HASH "19201cdc7f399be63eca2ddd0ff1343f92389d82"
#define COPYRIGHT_YEAR 2017

#define CHROME_VERSION_MAJOR 57
#define CHROME_VERSION_MAJOR 58
#define CHROME_VERSION_MINOR 0
#define CHROME_VERSION_BUILD 2987
#define CHROME_VERSION_PATCH 133
#define CHROME_VERSION_BUILD 3029
#define CHROME_VERSION_PATCH 33

#define DO_MAKE_STRING(p) #p
#define MAKE_STRING(p) DO_MAKE_STRING(p)
Expand All @@ -63,13 +63,13 @@ extern "C" {
// universal hash value will change if any platform is affected whereas the
// platform hash values will change only if that particular platform is
// affected.
#define CEF_API_HASH_UNIVERSAL "b0a24e3e202f3d8b72f2fbc1ebc5864f96ec16ae"
#define CEF_API_HASH_UNIVERSAL "f0e835273a00acd02a699af272fc8f6ff9c5645c"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "1c6a27f840ac87c8c971350c907edbe2c5fa0387"
#define CEF_API_HASH_PLATFORM "3cf7ac2b9aa61adfb9e5decdf0d32fbf78813355"
#elif defined(OS_MACOSX)
#define CEF_API_HASH_PLATFORM "1567db600ee83cc2a59bb8c17ca416d11a7c9b8a"
#define CEF_API_HASH_PLATFORM "f1d2ed00ab93e03a215fd787e6da9127e2949fd8"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "1f9f9e15bf7cf13de2557ddd411dfc9f694503b0"
#define CEF_API_HASH_PLATFORM "698e69c4297cc63b9893558a8591e7bd7aeeb0d4"
#endif

// Returns CEF version information for the libcef library. The |entry|
Expand Down
Loading

0 comments on commit 460ce99

Please sign in to comment.