Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

[CEF 2623] Upgrade to latest CEF #544

Merged
merged 9 commits into from
May 13, 2016
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = function (grunt) {
/* mac */
"cef-mac": {
"dest" : "<%= downloads %>",
"src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_macosx32.zip"
"src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_macosx64.zip"
},
"cef-mac-symbols": {
"src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_macosx32_release_symbols.zip",
Expand Down Expand Up @@ -224,7 +224,7 @@ module.exports = function (grunt) {
},
"cef": {
"url" : "http://s3.amazonaws.com/files.brackets.io/cef",
"version" : "3.2171.1902"
"version" : "3.2623.1397"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nethip cefbuilds.com has a link to 3.2623.1399. why is this difference? this has a mention to 3.2623.1397.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cefbuilds.com is still churning out builds out of 2623 branch and the branch would have moved by some commits by now. The build date is showing 2016-05-11 so this must have got built yesterday. That reminds me if I have to update 2623 to the latest commit. Let me go check CEF branch to see if anything important has been merged.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified all the recent commits. Here is the list

b90a3be (Call RenderProcessHost::Send from correct thread (issue #1881))
5b27df3
64e2fe1
93f8103

Out of these, b90a3be seems to be whole lot changes relating to using render process id for identification. I kind of backtracked and looks like these are OSR related bugs. So I am not sure if we want to refresh the binaries.

},
"node": {
"version" : "0.10.24"
Expand Down
5 changes: 4 additions & 1 deletion appshell.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'SDKROOT': '',
'CLANG_CXX_LANGUAGE_STANDARD' : 'c++0x',
'COMBINE_HIDPI_IMAGES': 'YES',
'ARCHS': "$(ARCHS_STANDARD_32_BIT)",
'ARCHS': "$(ARCHS_STANDARD_64_BIT)",
'FRAMEWORK_SEARCH_PATHS': [
'$(inherited)',
'$(CONFIGURATION)'
Expand Down Expand Up @@ -77,6 +77,7 @@
# Target build path.
'SYMROOT': 'xcodebuild',
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
},
'conditions': [
Expand Down Expand Up @@ -381,6 +382,7 @@
# Target build path.
'SYMROOT': 'xcodebuild',
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
},
'conditions': [
Expand Down Expand Up @@ -472,6 +474,7 @@
'OTHER_LDFLAGS': ['-Wl,-headerpad_max_install_names'],
'SYMROOT': 'xcodebuild',
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'FRAMEWORK_SEARCH_PATHS': [
'$(inherited)',
Expand Down
10 changes: 1 addition & 9 deletions appshell/FullScreenButton.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,7 @@
#import "FullScreenButton.h"

//these are defined in MainMainu.xib file
@implementation FullScreenButton {
NSImage *inactive;
NSImage *active;
NSImage *hover;
NSImage *pressed;
BOOL activeState;
BOOL hoverState;
BOOL pressedState;
}
@implementation FullScreenButton

-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
Expand Down
16 changes: 1 addition & 15 deletions appshell/TrafficLightButton.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,7 @@
static const int MINIMIZE_BUTTON_TAG = 1001;
static const int ZOOM_BUTTON_TAG = 1002;

@implementation TrafficLightButton {
NSImage *inactive;
NSImage *active;
NSImage *hover;
NSImage *pressed;
NSImage *dirtyInactive;
NSImage *dirtyActive;
NSImage *dirtyHover;
NSImage *dirtyPressed;
BOOL activeState;
BOOL hoverState;
BOOL pressedState;
BOOL dirtyState;
BOOL closeButton;
}
@implementation TrafficLightButton

-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
Expand Down
17 changes: 14 additions & 3 deletions appshell/cefclient_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,15 @@ - (void)windowWillEnterFullScreen:(NSNotification *)notification {
}
if (customTitlebar) {
[customTitlebar setHidden:YES];
NSWindow *window = [notification object];

// Since we have nuked the title, we will have
// to set the string back as we are hiding the
// custom title bar.
[window setTitle:[customTitlebar titleString]];
Copy link

@abhijitapte abhijitapte May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nethip I did run into a console message viz., the following. Was that happening earlier also?

2016-05-12 22:52:11.306 Brackets[2370:84493] NSWindow warning: adding an unknown subview: <CustomTitlebarView: 0x608000131440>. Break on NSLog to debug.
2016-05-12 22:52:11.351 Brackets[2370:84493] Call stack:
(
0 AppKit 0x00007fff851c88bb -[NSThemeFrame addSubview:] + 107
1 AppKit 0x00007fff851c8600 -[NSView addSubview:positioned:relativeTo:] + 211
2 Brackets 0x00000001000588bb -[ClientWindowDelegate windowDidBecomeKey:] + 603
3 CoreFoundation 0x00007fff9768ebbc CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 12
4 CoreFoundation 0x00007fff9768eb4f ___CFXRegistrationPost_block_invoke + 63
5 CoreFoundation 0x00007fff9768eac7 _CFXRegistrationPost + 407
6 CoreFoundation 0x00007fff9768e832 ___CFXNotificationPost_block_invoke + 50
7 CoreFoundation 0x00007fff9764b5e2 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
8 CoreFoundation 0x00007fff9764a835 _CFXNotificationPost + 693
9 Foundation 0x00007fff88399fda -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
10 AppKit 0x00007fff852e6048 -[NSWindow becomeKeyWindow] + 1425
11 AppKit 0x00007fff852e5a75 _NXSendWindowNotification + 252
12 AppKit 0x00007fff852e5378 -[NSWindow _changeKeyAndMainLimitedOK:] + 868
13 AppKit 0x00007fff853af173 -[NSWindow _makeKeyRegardlessOfVisibility] + 98
14 AppKit 0x00007fff852e8429 NSPerformVisuallyAtomicChange + 147
15 AppKit 0x00007fff853af0af -[NSWindow makeKeyAndOrderFront:] + 79
16 Brackets 0x0000000100059a5f -[ClientAppDelegate createApp:] + 2575
17 Foundation 0x00007fff883c7f4e -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 1115
18 Foundation 0x00007fff883c7a75 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 131
19 Brackets 0x000000010005b276 main + 3030
20 Brackets 0x0000000100003d54 start + 52
21 ??? 0x0000000000000003 0x0 + 3
)
Got xpc error message: Connection interrupted
2016-05-12 22:54:16.043 Brackets[2370:85805] Communications error: <OS_xpc_error: <error: 0x7fff76257b90> { count = 1, contents =
"XPCErrorDescription" => <string: 0x7fff76257f40> { length = 22, contents = "Connection interrupted" }
}>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was happening earlier with 10.11 sdk. Please refer to my comment https://github.com/adobe/brackets-shell/pull/544/files/d3cd41c8fb964cd5634b3babdeec9dd25e681861#r63060349

for more explanation on this,

Copy link

@abhijitapte abhijitapte May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nethip
There seems to be an issue with custom title bar view in case "Debug > New Brackets Window" is selected and the same is maximized and/or restored. See screenshot below -
screen shot 2016-05-12 at 11 04 14 pm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which SDK are you on? I have built this using 10.11 sdk and it seems to work fine.
screen shot 2016-05-12 at 11 22 00 pm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see that you are using OS dark theme. Let me give that a try.

Copy link

@abhijitapte abhijitapte May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on the latest SDK 10.11.
image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And on OSX 10.11.4
image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nethip
I also see that

OS X Deployment Target is 10.6.

Shouldn't that be updated? Changing that causes appshell build to fail. The errors and deprecations should be fixed.
Also npm install for Brackets throws these deprecations -

npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated npmconf@2.1.1: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated graceful-fs@1.1.14: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird. can you bring your laptop to the office tomorrow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the deprecation and 10.6 target, I think that is something we can work on post 1.7. Agree with you updating the target as well as the removing the npm deprecation warnings.

}



if ([self needsFullScreenActivateHack]) {
[NSApp activateIgnoringOtherApps:YES];
[NSApp unhide:nil];
Expand Down Expand Up @@ -424,6 +431,11 @@ -(void)windowWillExitFullScreen:(NSNotification *)notification {
// transition from fullscreen back to normal
if (customTitlebar) {
[customTitlebar setHidden:NO];

// Nuke the OS title as the title string is going to
// drawn by customTitleBar.
NSWindow *window = [notification object];
[window setTitle:@""];
}
if (trafficLightsView) {
[trafficLightsView setHidden:NO];
Expand Down Expand Up @@ -601,7 +613,7 @@ - (void)createApp:(id)object {
NSClosableWindowMask |
NSMiniaturizableWindowMask |
NSResizableWindowMask |
NSTexturedBackgroundWindowMask );
NSUnifiedTitleAndToolbarWindowMask );

// Get the available screen space
NSRect screen_rect = [[NSScreen mainScreen] visibleFrame];
Expand Down Expand Up @@ -650,7 +662,6 @@ - (void)createApp:(id)object {
content_rect = [mainWnd contentRectForFrameRect:[mainWnd frame]];

// Configure the rest of the window
[mainWnd setTitle:WINDOW_TITLE];
[mainWnd setDelegate:self.delegate];
[mainWnd setCollectionBehavior: (1 << 7) /* NSWindowCollectionBehaviorFullScreenPrimary */];

Expand Down
14 changes: 11 additions & 3 deletions appshell/client_colors_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
*/

//title bar background
static const float fillComp[4] = {0.23137255f, 0.24705882f, 0.25490196f, 1.0};

#ifndef CLIENT_COLORS
#define CLIENT_COLORS

static CGFloat fillComp[4] = {0.23137255f, 0.24705882f, 0.25490196f, 1.0};

//title text color
static const float activeComp[4] = {0.77254902f, 0.77254902f, 0.77254902f, 1.0};
static const float inactiveComp[4] = {0.50f, 0.50f, 0.50f, 1.0};
static CGFloat activeComp[4] = {0.77254902f, 0.77254902f, 0.77254902f, 1.0};
static CGFloat inactiveComp[4] = {0.50f, 0.50f, 0.50f, 1.0};

#endif

18 changes: 10 additions & 8 deletions appshell/client_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,16 @@ static void ParseParams(const std::string& params, CefWindowInfo& windowInfo) {
#endif

bool ClientHandler::OnBeforePopup(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& target_url,
const CefString& target_frame_name,
const CefPopupFeatures& popupFeatures,
CefWindowInfo& windowInfo,
CefRefPtr<CefClient>& client,
CefBrowserSettings& settings,
bool* no_javascript_access) {
CefRefPtr<CefFrame> frame,
const CefString& target_url,
const CefString& target_frame_name,
CefLifeSpanHandler::WindowOpenDisposition target_disposition,
bool user_gesture,
const CefPopupFeatures& popupFeatures,
CefWindowInfo& windowInfo,
CefRefPtr<CefClient>& client,
CefBrowserSettings& settings,
bool* no_javascript_access){
#ifndef OS_LINUX
std::string address = target_url.ToString();
std::string url;
Expand Down
20 changes: 11 additions & 9 deletions appshell/client_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,17 @@ class ClientHandler : public CefClient,
}

// CefLifeSpanHandler methods
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& target_url,
const CefString& target_frame_name,
const CefPopupFeatures& popupFeatures,
CefWindowInfo& windowInfo,
CefRefPtr<CefClient>& client,
CefBrowserSettings& settings,
bool* no_javascript_access) OVERRIDE;
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& target_url,
const CefString& target_frame_name,
CefLifeSpanHandler::WindowOpenDisposition target_disposition,
bool user_gesture,
const CefPopupFeatures& popupFeatures,
CefWindowInfo& windowInfo,
CefRefPtr<CefClient>& client,
CefBrowserSettings& settings,
bool* no_javascript_access) OVERRIDE;
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) OVERRIDE;
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) OVERRIDE;

Expand Down
23 changes: 20 additions & 3 deletions appshell/client_handler_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@
NSWindow* window = [view window];
std::string titleStr(title);
NSString* str = [NSString stringWithUTF8String:titleStr.c_str()];
[window setTitle:str];


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nethip
Title disappeared while working with two windows (via Debug > New Brackets Window).
Both windows had two separate projects open. Getting Started folder in one window and some other folder in the other window. Entered full screen mode in both windows. This is what happened thereafter.
screen shot 2016-05-12 at 11 19 29 pm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message in XCode console -
2016-05-12 23:14:31.524 Brackets Helper[2782:100768] Couldn't set selectedTextBackgroundColor from default ()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you able to repro this scenario? I will check with you tomorrow in the office.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is on my personal laptop.

Copy link

@abhijitapte abhijitapte May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't able to reproduce the error message :(

But reproducing the title disappearance is very straight forward.

Copy link
Contributor Author

@nethip nethip May 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you missed telling me you were in full screen mode 😄 But that is fine as I figured that out from the video that you had posted.

NSObject* delegate = [window delegate];
if ([window styleMask] & NSFullScreenWindowMask) {
[window setTitle:str];
}

[delegate performSelectorOnMainThread:@selector(windowTitleDidChange:) withObject:str waitUntilDone:NO];
}

Expand Down Expand Up @@ -323,6 +326,13 @@ -(void)windowWillExitFullScreen:(NSNotification *)notification {
// transforms from full screen back to normal
if (customTitlebar) {
[customTitlebar setHidden:NO];

NSWindow *popUpWindow = [notification object];

// Since we have nuked the title, we will have
// to set the string back as we are hiding the
// custom title bar.
[popUpWindow setTitle:@""];
}
if (trafficLightsView) {
[trafficLightsView setHidden:NO];
Expand Down Expand Up @@ -352,6 +362,13 @@ - (void)windowWillEnterFullScreen:(NSNotification *)notification {
}
if (customTitlebar) {
[customTitlebar setHidden:YES];

NSWindow *popUpWindow = [notification object];

// Since we have nuked the title, we will have
// to set the string back as we are hiding the
// custom title bar.
[popUpWindow setTitle:[customTitlebar titleString]];
}
if ([self needsFullScreenActivateHack]) {
// HACK to make sure that window is activate
Expand Down Expand Up @@ -520,7 +537,7 @@ - (void)windowDidResignKey:(NSNotification *)notification {


// CEF 1750 -- We need to not handle keys for the DevTools Window.
if (browser->GetFocusedFrame()->GetURL() == "chrome-devtools://devtools/devtools.html") {
if (browser->GetFocusedFrame()->GetURL() == "chrome-devtools://devtools/inspector.html") {
return false;
}

Expand Down
13 changes: 9 additions & 4 deletions appshell_paths.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
'include/wrapper/cef_closure_task.h',
'include/wrapper/cef_helpers.h',
'include/wrapper/cef_message_router.h',
'include/wrapper/cef_resource_manager.h',
'include/wrapper/cef_stream_resource_handler.h',
'include/wrapper/cef_xml_object.h',
'include/wrapper/cef_zip_archive.h',

],
'includes_win': [
'include/base/internal/cef_atomicops_x86_msvc.h',
Expand All @@ -96,12 +96,15 @@
],
'libcef_sources_common': [
'libcef_dll/cpptoc/cpptoc.h',
'libcef_dll/ctocpp/base_ctocpp.cc',
'libcef_dll/ctocpp/base_ctocpp.h',
'libcef_dll/ctocpp/ctocpp.h',
'libcef_dll/libcef_dll.cc',
'libcef_dll/libcef_dll2.cc',
'libcef_dll/resource.h',
'libcef_dll/transfer_util.cpp',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',
'<@(autogen_library_side)',
],
'libcef_dll_wrapper_sources_common': [
Expand All @@ -117,16 +120,18 @@
'libcef_dll/base/cef_thread_checker_impl.cc',
'libcef_dll/base/cef_thread_collision_warner.cc',
'libcef_dll/base/cef_weak_ptr.cc',
'libcef_dll/cpptoc/base_cpptoc.cc',
'libcef_dll/cpptoc/base_cpptoc.h',
'libcef_dll/cpptoc/cpptoc.h',
'libcef_dll/ctocpp/base_ctocpp.h',
'libcef_dll/ctocpp/ctocpp.h',
'libcef_dll/transfer_util.cpp',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',
'libcef_dll/wrapper/cef_browser_info_map.h',
'libcef_dll/wrapper/cef_byte_read_handler.cc',
'libcef_dll/wrapper/cef_closure_task.cc',
'libcef_dll/wrapper/cef_message_router.cc',
'libcef_dll/wrapper/cef_resource_manager.cc',
'libcef_dll/wrapper/cef_stream_resource_handler.cc',
'libcef_dll/wrapper/cef_xml_object.cc',
'libcef_dll/wrapper/cef_zip_archive.cc',
Expand Down