diff --git a/Gruntfile.js b/Gruntfile.js
index b0ad7825c..bb63728b1 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -29,7 +29,7 @@ module.exports = function (grunt) {
resolve = common.resolve,
platform = common.platform(),
staging;
-
+
if (platform === "mac") {
staging = "installer/mac/staging/<%= build.name %>.app/Contents";
} else if (platform === "win") {
@@ -63,7 +63,7 @@ module.exports = function (grunt) {
/* mac */
"cef-mac": {
"dest" : "<%= downloads %>",
- "src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_macosx.zip"
+ "src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_macosx32.zip"
},
"cef-mac-symbols": {
"src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_macosx32_release_symbols.zip",
@@ -76,7 +76,7 @@ module.exports = function (grunt) {
/* win */
"cef-win": {
"dest" : "<%= downloads %>",
- "src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_windows.zip"
+ "src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_windows32.zip"
},
"cef-win-symbols": {
"src" : ["<%= cef.url %>/cef_binary_<%= cef.version %>_windows32_debug_symbols.zip", "<%= cef.url %>/cef_binary_<%= cef.version %>_windows32_release_symbols.zip"],
@@ -110,8 +110,10 @@ module.exports = function (grunt) {
"Brackets.exe",
"node.exe",
"cef.pak",
+ "cef_100_percent.pak",
+ "cef_200_percent.pak",
"devtools_resources.pak",
- "icudt.dll",
+ "icudtl.dat",
"libcef.dll"
],
"dest" : "installer/win/staging/"
@@ -218,7 +220,7 @@ module.exports = function (grunt) {
},
"cef": {
"url" : "http://s3.amazonaws.com/files.brackets.io/cef",
- "version" : "3.1547.1459"
+ "version" : "3.2171.1902"
},
"node": {
"version" : "0.10.24"
diff --git a/appshell.exe.manifest b/appshell.exe.manifest
new file mode 100644
index 000000000..d36f084b6
--- /dev/null
+++ b/appshell.exe.manifest
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/appshell.gyp b/appshell.gyp
index 81e4d4133..44d4ff9ec 100755
--- a/appshell.gyp
+++ b/appshell.gyp
@@ -1,4 +1,4 @@
- # Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
+# Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
@@ -7,11 +7,17 @@
'pkg-config': 'pkg-config',
'target_arch%': 'environment',
'chromium_code': 1,
+ 'framework_name': 'Chromium Embedded Framework',
+ 'linux_use_gold_binary': 0,
+ 'linux_use_gold_flags': 0,
'conditions': [
[ 'OS=="mac"', {
# Don't use clang with CEF binary releases due to Chromium tree structure dependency.
'clang': 0,
- }]
+ }],
+ [ 'OS=="win"', {
+ 'multi_threaded_dll%': 0,
+ }],
]
},
'includes': [
@@ -27,7 +33,11 @@
'SDKROOT': '',
'CLANG_CXX_LANGUAGE_STANDARD' : 'c++0x',
'COMBINE_HIDPI_IMAGES': 'YES',
- 'ARCHS': "$(ARCHS_STANDARD_32_BIT)"
+ 'ARCHS': "$(ARCHS_STANDARD_32_BIT)",
+ 'FRAMEWORK_SEARCH_PATHS': [
+ '$(inherited)',
+ '$(CONFIGURATION)'
+ ]
},
},
'targets': [
@@ -78,11 +88,34 @@
},
},
},
+ 'variables': {
+ 'win_exe_compatibility_manifest': 'compatibility.manifest',
+ 'xparams': "/efy",
+ },
+ 'actions': [
+ {
+ 'action_name': 'copy_resources',
+ 'msvs_cygwin_shell': 0,
+ 'inputs': [],
+ 'outputs': [
+ '<(PRODUCT_DIR)/copy_resources.stamp',
+ ],
+ 'action': [
+ 'xcopy <(xparams)',
+ 'Resources\*',
+ '$(OutDir)',
+ ],
+ },
+ ],
'msvs_settings': {
'VCLinkerTool': {
# Set /SUBSYSTEM:WINDOWS.
'SubSystem': '2',
- 'EntryPointSymbol' : 'wWinMainCRTStartup',
+ },
+ 'VCManifestTool': {
+ 'AdditionalManifestFiles': [
+ 'appshell.exe.manifest',
+ ],
},
},
'link_settings': {
@@ -92,9 +125,13 @@
'-lrpcrt4.lib',
'-lopengl32.lib',
'-lglu32.lib',
- '-l$(ConfigurationName)/libcef.lib'
+ '-l$(ConfigurationName)/libcef.lib',
],
},
+ 'library_dirs': [
+ # Needed to find cef_sandbox.lib using #pragma comment(lib, ...).
+ '$(ConfigurationName)',
+ ],
'sources': [
'<@(includes_win)',
'<@(appshell_sources_win)',
@@ -125,6 +162,26 @@
}
],
}],
+ [ 'OS=="win" and multi_threaded_dll', {
+ 'configurations': {
+ 'Debug': {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'RuntimeLibrary': 3,
+ 'WarnAsError': 'false',
+ },
+ },
+ },
+ 'Release': {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'RuntimeLibrary': 2,
+ 'WarnAsError': 'false',
+ },
+ },
+ }
+ }
+ }],
[ 'OS=="mac"', {
'product_name': '<(appname)',
'dependencies': [
@@ -133,20 +190,6 @@
'copies': [
{
# Add library dependencies to the bundle.
- 'destination': '<(PRODUCT_DIR)/<(appname).app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/',
- 'files': [
- '$(CONFIGURATION)/libcef.dylib',
- ],
- },
- {
- # Add other resources to the bundle.
- 'destination': '<(PRODUCT_DIR)/<(appname).app/Contents/Frameworks/Chromium Embedded Framework.framework/',
- 'files': [
- 'Resources/',
- ],
- },
- {
- # Add the helper app.
'destination': '<(PRODUCT_DIR)/<(appname).app/Contents/Frameworks',
'files': [
'<(PRODUCT_DIR)/<(appname) Helper.app',
@@ -154,13 +197,22 @@
},
],
'postbuilds': [
+ {
+ 'postbuild_name': 'Add framework',
+ 'action': [
+ 'cp',
+ '-Rf',
+ '${CONFIGURATION}/<(framework_name).framework',
+ '${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks/'
+ ],
+ },
{
'postbuild_name': 'Fix Framework Link',
'action': [
'install_name_tool',
'-change',
- '@executable_path/libcef.dylib',
- '@executable_path/../Frameworks/Chromium Embedded Framework.framework/Libraries/libcef.dylib',
+ '@executable_path/<(framework_name)',
+ '@executable_path/../Frameworks/<(framework_name).framework/<(framework_name)',
'${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
],
},
@@ -206,7 +258,7 @@
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
'$(SDKROOT)/System/Library/Frameworks/ScriptingBridge.framework',
- '$(CONFIGURATION)/libcef.dylib',
+ '$(CONFIGURATION)/<(framework_name).framework/<(framework_name)',
],
},
'sources': [
@@ -239,7 +291,7 @@
}
],
'cflags': [
- 'ShowDevTools(browser);
-
- ExtensionString url(browser->GetHost()->GetDevToolsURL(true));
- OpenLiveBrowser(url, false);
+ CefWindowInfo wi;
+ CefBrowserSettings settings;
+
+#if defined(OS_WIN)
+ wi.SetAsPopup(NULL, "DevTools");
+#endif
+ browser->GetHost()->ShowDevTools(wi, browser->GetHost()->GetClient(), settings, CefPoint());
+
} else if (message_name == "GetNodeState") {
// Parameters:
// 0: int32 - callback id
diff --git a/appshell/appshell_extensions_mac.mm b/appshell/appshell_extensions_mac.mm
index 53cefc5ee..dea83066f 100644
--- a/appshell/appshell_extensions_mac.mm
+++ b/appshell/appshell_extensions_mac.mm
@@ -973,8 +973,8 @@ int32 AddMenu(CefRefPtr browser, ExtensionString itemTitle, Extensio
relativeId = "window";
}
- NSInteger positionIdx = -1;
- int32 errCode = getNewMenuPosition(browser, nil, position, relativeId, positionIdx);
+ int32 positionIdx = -1;
+ int32 errCode = ::getNewMenuPosition(browser, nil, position, relativeId, positionIdx);
// Another position hack. If position is "first" we will change positionIdx to 1
// since we can't allow user to put anything before the Mac OS default application menu.
@@ -1101,8 +1101,8 @@ int32 AddMenuItem(CefRefPtr browser, ExtensionString parentCommand,
}
NativeMenuModel::getInstance(getMenuParent(browser)).setOsItem(tag, (void*)newItem);
- NSInteger positionIdx = -1;
- int32 errCode = getNewMenuPosition(browser, subMenu, position, relativeId, positionIdx);
+ int32 positionIdx = -1;
+ int32 errCode = ::getNewMenuPosition(browser, subMenu, position, relativeId, positionIdx);
if (positionIdx > -1) {
[subMenu insertItem:newItem atIndex:positionIdx];
} else {
diff --git a/appshell/cef_dark_aero_window.cpp b/appshell/cef_dark_aero_window.cpp
index 5b318e61d..37cc707f4 100644
--- a/appshell/cef_dark_aero_window.cpp
+++ b/appshell/cef_dark_aero_window.cpp
@@ -802,7 +802,7 @@ LRESULT cef_dark_aero_window::WindowProc(UINT message, WPARAM wParam, LPARAM lPa
break;
}
- // First let the DesktopWindowManager handler the message and tell us if
+ // First let the DesktopWindowManager handle the message and tell us if
// we should pass the message to the default window proc
LRESULT lr = DwpCustomFrameProc(message, wParam, lParam, &callDefWindowProc);
diff --git a/appshell/cef_main_window.cpp b/appshell/cef_main_window.cpp
index 4f448e8d4..1909b55c8 100644
--- a/appshell/cef_main_window.cpp
+++ b/appshell/cef_main_window.cpp
@@ -174,7 +174,7 @@ BOOL cef_main_window::HandleCreate()
// Creat the new child browser window
CefBrowserHost::CreateBrowser(info,
static_cast >(g_handler),
- ::AppGetInitialURL(), settings);
+ ::AppGetInitialURL(), settings, NULL);
return TRUE;
}
@@ -220,13 +220,6 @@ BOOL cef_main_window::HandleGetMinMaxInfo(LPMINMAXINFO mmi)
return TRUE;
}
-// WM_DESTROY handler
-BOOL cef_main_window::HandleDestroy()
-{
- ::PostQuitMessage(0);
- return TRUE;
-}
-
// WM_CLOSE handler
BOOL cef_main_window::HandleClose()
{
@@ -238,6 +231,10 @@ BOOL cef_main_window::HandleClose()
BOOL closing = (BOOL)::GetProp(hwnd, ::kCefWindowClosingPropName);
if (closing)
{
+ if (!g_handler->CanCloseBrowser(GetBrowser())) {
+ PostMessage(WM_CLOSE, 0 ,0);
+ return TRUE;
+ }
::RemoveProp(hwnd, ::kCefWindowClosingPropName);
}
else
@@ -501,8 +498,7 @@ LRESULT cef_main_window::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
return 0L;
break;
case WM_DESTROY:
- if (HandleDestroy())
- return 0L;
+ return 0L; // Do not handle the destroy here.
break;
case WM_CLOSE:
if (HandleClose())
diff --git a/appshell/cef_main_window.h b/appshell/cef_main_window.h
index 2f441d8fa..a23f798c0 100644
--- a/appshell/cef_main_window.h
+++ b/appshell/cef_main_window.h
@@ -52,7 +52,6 @@ class cef_main_window : public cef_host_window
BOOL HandleEraseBackground(HDC hdc);
BOOL HandleCreate();
BOOL HandleSetFocus(HWND hLosingFocus);
- BOOL HandleDestroy();
BOOL HandleClose();
BOOL HandleInitMenuPopup(HMENU hMenuPopup);
BOOL HandleCommand(UINT commandId);
diff --git a/appshell/cefclient.cpp b/appshell/cefclient.cpp
index e96faddf5..4058b297b 100644
--- a/appshell/cefclient.cpp
+++ b/appshell/cefclient.cpp
@@ -80,8 +80,6 @@ void AppGetSettings(CefSettings& settings, CefRefPtr app) {
settings.log_severity = LOGSEVERITY_WARNING;
else if (str == cefclient::kLogSeverity_Error)
settings.log_severity = LOGSEVERITY_ERROR;
- else if (str == cefclient::kLogSeverity_ErrorReport)
- settings.log_severity = LOGSEVERITY_ERROR_REPORT;
else if (str == cefclient::kLogSeverity_Disable)
settings.log_severity = LOGSEVERITY_DISABLE;
}
diff --git a/appshell/cefclient_gtk.cpp b/appshell/cefclient_gtk.cpp
index 1cefa4143..ca8630dd9 100644
--- a/appshell/cefclient_gtk.cpp
+++ b/appshell/cefclient_gtk.cpp
@@ -147,7 +147,7 @@ int main(int argc, char* argv[]) {
CefRefPtr app(new ClientApp);
// Execute the secondary process, if any.
- int exit_code = CefExecuteProcess(main_args, app.get());
+ int exit_code = CefExecuteProcess(main_args, app.get(), NULL);
if (exit_code >= 0)
return exit_code;
@@ -165,6 +165,8 @@ int main(int argc, char* argv[]) {
// Populate the settings based on command line arguments.
AppGetSettings(settings, app);
+ settings.no_sandbox = TRUE;
+
// Check cache_path setting
if (CefString(&settings.cache_path).length() == 0) {
CefString(&settings.cache_path) = AppGetCachePath();
@@ -190,7 +192,7 @@ int main(int argc, char* argv[]) {
}
// Initialize CEF.
- CefInitialize(main_args, settings, app.get());
+ CefInitialize(main_args, settings, app.get(), NULL);
// Set window icon
std::vector icons(APPICONS, APPICONS + sizeof(APPICONS) / sizeof(APPICONS[0]) );
@@ -247,7 +249,7 @@ int main(int argc, char* argv[]) {
CefBrowserHost::CreateBrowser(
window_info,
static_cast >(g_handler),
- "file://"+szInitialUrl, browserSettings);
+ "file://"+szInitialUrl, browserSettings, NULL);
gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show_all(GTK_WIDGET(window));
diff --git a/appshell/cefclient_mac.mm b/appshell/cefclient_mac.mm
index f1d1edbed..e9577d48b 100644
--- a/appshell/cefclient_mac.mm
+++ b/appshell/cefclient_mac.mm
@@ -655,9 +655,6 @@ - (void)createApp:(id)object {
settings.web_security = STATE_DISABLED;
CefRefPtr cmdLine = AppGetCommandLine();
- if (cmdLine->HasSwitch(cefclient::kAcceleratedCompositingDisabled)) {
- settings.accelerated_compositing = STATE_DISABLED;
- }
#ifdef DARK_INITIAL_PAGE
// Avoid white flash at startup or refresh by making this the default
@@ -673,7 +670,7 @@ - (void)createApp:(id)object {
NSString* str = [[startupUrl absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
CefBrowserHost::CreateBrowserSync(window_info, g_handler.get(),
- [str UTF8String], settings);
+ [str UTF8String], settings, nil);
[self.delegate initUI:mainWnd];
@@ -788,7 +785,7 @@ int main(int argc, char* argv[]) {
CefRefPtr app(new ClientApp);
// Execute the secondary process, if any.
- int exit_code = CefExecuteProcess(main_args, app.get());
+ int exit_code = CefExecuteProcess(main_args, app.get(), NULL);
if (exit_code >= 0)
return exit_code;
@@ -805,16 +802,18 @@ int main(int argc, char* argv[]) {
CefSettings settings;
- // Populate the settings based on command line arguments.
+ // Populate the settings based on command line arguments.
AppGetSettings(settings, app);
+ settings.no_sandbox = YES;
+
// Check command
if (CefString(&settings.cache_path).length() == 0) {
CefString(&settings.cache_path) = AppGetCachePath();
}
// Initialize CEF.
- CefInitialize(main_args, settings, app.get());
+ CefInitialize(main_args, settings, app.get(), NULL);
// Load the startup path from prefs
CGEventRef event = CGEventCreate(NULL);
diff --git a/appshell/cefclient_win.cpp b/appshell/cefclient_win.cpp
index 723fd1cc8..89df728e5 100644
--- a/appshell/cefclient_win.cpp
+++ b/appshell/cefclient_win.cpp
@@ -126,7 +126,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
CefRefPtr app(new ClientApp);
// Execute the secondary process, if any.
- int exit_code = CefExecuteProcess(main_args, app.get());
+ int exit_code = CefExecuteProcess(main_args, app.get(), NULL);
if (exit_code >= 0)
return exit_code;
@@ -180,7 +180,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
}
// Initialize CEF.
- CefInitialize(main_args, settings, app.get());
+ CefInitialize(main_args, settings, app.get(), NULL);
CefRefPtr cmdLine = AppGetCommandLine();
if (cmdLine->HasSwitch(cefclient::kStartupPath)) {
diff --git a/appshell/client_app.cpp b/appshell/client_app.cpp
index d79c4c05f..b67ff4c34 100644
--- a/appshell/client_app.cpp
+++ b/appshell/client_app.cpp
@@ -238,6 +238,24 @@ void ClientApp::OnContextReleased(CefRefPtr browser,
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it)
(*it)->OnContextReleased(this, browser, frame, context);
+
+ // This is to fix the crash on quit(https://github.com/adobe/brackets/issues/7683)
+ // after integrating CEF 2171.
+
+ // On Destruction, callback_map_ was getting destroyed
+ // in the ClientApp::~ClientApp(). However while removing
+ // all the elements, it was trying to destroy some stale
+ // objects which were already deleted. So to fix this, we
+ // are now explicitly clearing the map here.
+
+ CallbackMap::iterator iCallBack = callback_map_.begin();
+ for (; iCallBack != callback_map_.end();) {
+ if (iCallBack->second.first->IsSame(context))
+ callback_map_.erase(iCallBack++);
+ else
+ ++iCallBack;
+ }
+
}
//Simple stack class to ensure calls to Enter and Exit are balanced
diff --git a/appshell/client_app_mac.mm b/appshell/client_app_mac.mm
index 51f20d290..7894b6703 100644
--- a/appshell/client_app_mac.mm
+++ b/appshell/client_app_mac.mm
@@ -94,4 +94,4 @@
CefString ClientApp::AppGetDocumentsDirectory() {
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
return CefString([documentsDirectory UTF8String]);
-}
\ No newline at end of file
+}
diff --git a/appshell/client_handler.cpp b/appshell/client_handler.cpp
index 1fdf6a527..50a0fe231 100644
--- a/appshell/client_handler.cpp
+++ b/appshell/client_handler.cpp
@@ -162,19 +162,6 @@ void ClientHandler::OnAfterCreated(CefRefPtr browser) {
browser_window_map_[browser->GetHost()->GetWindowHandle()] = browser;
}
-bool ClientHandler::DoClose(CefRefPtr browser) {
- REQUIRE_UI_THREAD();
-
- if (m_BrowserId == browser->GetIdentifier()) {
- // Notify the parent window that it will be closed.
- browser->GetHost()->ParentWindowWillClose();
- }
-
- // A popup browser window is not contained in another window, so we can let
- // these windows close by themselves.
- return false;
-}
-
void ClientHandler::OnBeforeClose(CefRefPtr browser) {
REQUIRE_UI_THREAD();
@@ -182,19 +169,18 @@ void ClientHandler::OnBeforeClose(CefRefPtr browser) {
if (m_BrowserId == browser->GetIdentifier()) {
// Free the browser pointer so that the browser can be destroyed
m_Browser = NULL;
- } else if (browser->IsPopup()) {
- // Remove the record for DevTools popup windows.
- std::set::iterator it =
- m_OpenDevToolsURLs.find(browser->GetMainFrame()->GetURL());
- if (it != m_OpenDevToolsURLs.end())
- m_OpenDevToolsURLs.erase(it);
}
browser_window_map_.erase(browser->GetHost()->GetWindowHandle());
}
if (m_quitting) {
- DispatchCloseToNextBrowser();
+ // Changed the logic to call CefQuitMesaageLoop()
+ // for windows as it was crashing with 2171 CEF.
+ if (HasWindows())
+ DispatchCloseToNextBrowser();
+ else
+ CefQuitMessageLoop();
}
}
@@ -334,13 +320,15 @@ bool ClientHandler::OnConsoleMessage(CefRefPtr browser,
return false;
}
-void ClientHandler::OnRequestGeolocationPermission(
+bool ClientHandler::OnRequestGeolocationPermission(
CefRefPtr browser,
const CefString& requesting_url,
int request_id,
CefRefPtr callback) {
// Allow geolocation access from all websites.
+ // TODO: What does ref app do?
callback->Continue(true);
+ return true;
}
void ClientHandler::OnBeforeContextMenu(
@@ -355,14 +343,6 @@ void ClientHandler::OnBeforeContextMenu(
// Add a "Show DevTools" item to all context menus.
model->AddItem(CLIENT_ID_SHOW_DEVTOOLS, "&Show DevTools");
-
- CefString devtools_url = browser->GetHost()->GetDevToolsURL(true);
- if (devtools_url.empty() ||
- m_OpenDevToolsURLs.find(devtools_url) != m_OpenDevToolsURLs.end()) {
- // Disable the menu option if DevTools isn't enabled or if a window is
- // already open for the current URL.
- model->SetEnabled(CLIENT_ID_SHOW_DEVTOOLS, false);
- }
}
}
@@ -418,13 +398,14 @@ std::string ClientHandler::GetLastDownloadFile() {
}
void ClientHandler::ShowDevTools(CefRefPtr browser) {
- std::string devtools_url = browser->GetHost()->GetDevToolsURL(true);
- if (!devtools_url.empty() &&
- m_OpenDevToolsURLs.find(devtools_url) == m_OpenDevToolsURLs.end()) {
- m_OpenDevToolsURLs.insert(devtools_url);
- browser->GetMainFrame()->ExecuteJavaScript(
- "window.open('" + devtools_url + "');", "about:blank", 0);
- }
+ CefWindowInfo wi;
+ CefBrowserSettings settings;
+
+#if defined(OS_WIN)
+ wi.SetAsPopup(NULL, "DevTools");
+#endif
+ browser->GetHost()->ShowDevTools(wi, browser->GetHost()->GetClient(), settings, CefPoint());
+
}
bool ClientHandler::SendJSCommand(CefRefPtr browser, const CefString& commandName, CefRefPtr callback)
diff --git a/appshell/client_handler.h b/appshell/client_handler.h
index 367922cd5..225c02cb8 100644
--- a/appshell/client_handler.h
+++ b/appshell/client_handler.h
@@ -9,6 +9,7 @@
#include