From 2612904a3352dc8ec62ca6b1bff2fb526fdb60b4 Mon Sep 17 00:00:00 2001 From: Shubham Yadav Date: Thu, 2 May 2019 13:47:44 +0530 Subject: [PATCH 1/3] Update brackets version on master --- appshell/mac/Info.plist | 4 ++-- appshell/version.rc | 4 ++-- appshell/version_linux.h | 2 +- installer/mac/buildInstaller.sh | 2 +- installer/win/brackets-win-install-build.xml | 2 +- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/appshell/mac/Info.plist b/appshell/mac/Info.plist index 6cc3f9896..0f4626b6b 100644 --- a/appshell/mac/Info.plist +++ b/appshell/mac/Info.plist @@ -19,9 +19,9 @@ CFBundleSignature ???? CFBundleVersion - 1.14.0 + 1.15.0 CFBundleShortVersionString - 1.14.0 + 1.15.0 NSMainNibFile MainMenu NSPrincipalClass diff --git a/appshell/version.rc b/appshell/version.rc index 7b727e683..8c7a81673 100644 --- a/appshell/version.rc +++ b/appshell/version.rc @@ -31,7 +31,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO -FILEVERSION 1,14,0,0 +FILEVERSION 1,15,0,0 /* PRODUCTVERSION 1,0,0,0 */ FILEOS VOS__WINDOWS32 FILETYPE VFT_APP @@ -42,7 +42,7 @@ BEGIN BEGIN VALUE "CompanyName", "brackets.io\0" VALUE "FileDescription", "\0" - VALUE "FileVersion", "Release 1.14.0\0" + VALUE "FileVersion", "Release 1.15.0\0" VALUE "ProductName", APP_NAME "\0" VALUE "ProductVersion", "\0" VALUE "LegalCopyright", "(c) 2012 Adobe Systems, Inc.\0" diff --git a/appshell/version_linux.h b/appshell/version_linux.h index 126e2ca9b..1741edc8c 100644 --- a/appshell/version_linux.h +++ b/appshell/version_linux.h @@ -1 +1 @@ -#define APP_VERSION "1.14.0.0" +#define APP_VERSION "1.15.0.0" diff --git a/installer/mac/buildInstaller.sh b/installer/mac/buildInstaller.sh index 63a2ce1c3..fb4df8386 100755 --- a/installer/mac/buildInstaller.sh +++ b/installer/mac/buildInstaller.sh @@ -2,7 +2,7 @@ # config releaseName="Brackets" -version="1.14" +version="1.15" dmgName="${releaseName} Release ${version}" format="bzip2" encryption="none" diff --git a/installer/win/brackets-win-install-build.xml b/installer/win/brackets-win-install-build.xml index 2b4ee9454..f1c6a0127 100644 --- a/installer/win/brackets-win-install-build.xml +++ b/installer/win/brackets-win-install-build.xml @@ -12,7 +12,7 @@ default="build.mul"> - + diff --git a/package.json b/package.json index b4af707fe..05922e838 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Brackets-Shell", - "version": "1.14.0-0", + "version": "1.15.0-0", "homepage": "http://brackets.io", "issues": { "url": "http://github.com/adobe/brackets-shell/issues" From fd8fce79c323ba4ed2db1cf37ba84728ea7050b3 Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Tue, 12 Nov 2019 20:13:04 +0530 Subject: [PATCH 2/3] Disabled remote-debugging by default and appshell.app.getRemoteDebuggingPort() needs a callback argument to work (#668) * Disabled remote-debugging by default and appshell.app.getRemoteDebuggingPort() needs a callback argument to work * Addressing review comments * Addressing review comments * Updating error meesage for port validation * Addressing review comments from vickramdhawal, also it is not possible to use g_handler to hold remote-debugging-port as g_handler does not get initialized while we are parsing command line * More error message correction --- appshell/appshell_extension_handler.h | 4 +--- appshell/appshell_extensions.cpp | 3 +++ appshell/appshell_extensions.js | 4 ++-- appshell/cefclient.cpp | 25 ++++++++++++++++++++++++- appshell/config.h | 2 -- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/appshell/appshell_extension_handler.h b/appshell/appshell_extension_handler.h index 588f42bbf..0df32e42f 100644 --- a/appshell/appshell_extension_handler.h +++ b/appshell/appshell_extension_handler.h @@ -160,7 +160,7 @@ class AppShellExtensionHandler : public CefV8Handler { CefString& exception) { // The only messages that are handled here is getElapsedMilliseconds(), - // GetCurrentLanguage(), GetApplicationSupportDirectory(), and GetRemoteDebuggingPort(). + // GetCurrentLanguage(), and GetApplicationSupportDirectory(). // All other messages are passed to the browser process. if (name == "GetElapsedMilliseconds") { retval = CefV8Value::CreateDouble(GetElapsedMilliseconds()); @@ -170,8 +170,6 @@ class AppShellExtensionHandler : public CefV8Handler { retval = CefV8Value::CreateString(AppGetSupportDirectory()); } else if (name == "GetUserDocumentsDirectory") { retval = CefV8Value::CreateString(AppGetDocumentsDirectory()); - } else if (name == "GetRemoteDebuggingPort") { - retval = CefV8Value::CreateInt(REMOTE_DEBUGGING_PORT); } else { // Pass all messages to the browser process. Look in appshell_extensions.cpp for implementation. CefRefPtr browser = CefV8Context::GetCurrentContext()->GetBrowser(); diff --git a/appshell/appshell_extensions.cpp b/appshell/appshell_extensions.cpp index c5ac80bd8..4723876d9 100644 --- a/appshell/appshell_extensions.cpp +++ b/appshell/appshell_extensions.cpp @@ -37,6 +37,7 @@ #include "update.h" extern std::vector gDroppedFiles; +extern int g_remote_debugging_port; namespace appshell_extensions { @@ -842,6 +843,8 @@ class ProcessMessageDelegate : public ClientHandler::ProcessMessageDelegate { uberDict->SetList(0, dirContents); uberDict->SetList(1, allStats); responseArgs->SetList(2, uberDict); + } else if (message_name == "GetRemoteDebuggingPort") { + responseArgs->SetInt(2, g_remote_debugging_port); } else { diff --git a/appshell/appshell_extensions.js b/appshell/appshell_extensions.js index fc161e6e4..379420d27 100644 --- a/appshell/appshell_extensions.js +++ b/appshell/appshell_extensions.js @@ -640,8 +640,8 @@ if (!brackets) { * @return int. The remote debugging port used by the appshell. */ native function GetRemoteDebuggingPort(); - appshell.app.getRemoteDebuggingPort = function () { - return GetRemoteDebuggingPort(); + appshell.app.getRemoteDebuggingPort = function (callback) { + GetRemoteDebuggingPort(callback || _dummyCallback); }; diff --git a/appshell/cefclient.cpp b/appshell/cefclient.cpp index a6bf5aca8..5d84d930b 100644 --- a/appshell/cefclient.cpp +++ b/appshell/cefclient.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "include/cef_app.h" #include "include/cef_browser.h" #include "include/cef_command_line.h" @@ -19,6 +20,7 @@ #include "config.h" CefRefPtr g_handler; +int g_remote_debugging_port = 0; #ifdef OS_WIN bool g_force_enable_acc = false; @@ -95,7 +97,28 @@ void AppGetSettings(CefSettings& settings, CefRefPtr command_lin command_line->GetSwitchValue(client::switches::kJavascriptFlags); // Enable dev tools - settings.remote_debugging_port = REMOTE_DEBUGGING_PORT; + CefString debugger_port = command_line->GetSwitchValue("remote-debugging-port"); + if (!debugger_port.empty()) { + const long port = strtol(debugger_port.ToString().c_str(), NULL, 10); + if (errno == ERANGE || port == 0) { + LOG(ERROR) << "Could not enable Remote debugging."; + LOG(ERROR) << "Error while parsing remote-debugging-port arg: "<< debugger_port.ToString(); + errno = 0; + } + else { + static const long max_port_num = 65535; + static const long max_reserved_port_num = 1024; + if (port > max_reserved_port_num && port < max_port_num) { + g_remote_debugging_port = static_cast(port); + settings.remote_debugging_port = g_remote_debugging_port; + } + else { + LOG(ERROR) << "Could not enable Remote debugging on port: "<< port + << ". Port number must be greater than "<< max_reserved_port_num + << " and less than " << max_port_num << "."; + } + } + } std::wstring versionStr = appshell::AppGetProductVersionString(); diff --git a/appshell/config.h b/appshell/config.h index 2e1d5d397..9744e1973 100644 --- a/appshell/config.h +++ b/appshell/config.h @@ -82,8 +82,6 @@ #endif -#define REMOTE_DEBUGGING_PORT 9234 - // Comment out this line to enable OS themed drawing #define DARK_UI #define DARK_AERO_GLASS From cc285217159597689bd6ddbd52b7743583337417 Mon Sep 17 00:00:00 2001 From: Gautam Jha Date: Mon, 18 Nov 2019 13:49:50 +0530 Subject: [PATCH 3/3] Improved console error messages (#669) --- appshell/cefclient.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/appshell/cefclient.cpp b/appshell/cefclient.cpp index 5d84d930b..f0f875658 100644 --- a/appshell/cefclient.cpp +++ b/appshell/cefclient.cpp @@ -101,21 +101,21 @@ void AppGetSettings(CefSettings& settings, CefRefPtr command_lin if (!debugger_port.empty()) { const long port = strtol(debugger_port.ToString().c_str(), NULL, 10); if (errno == ERANGE || port == 0) { - LOG(ERROR) << "Could not enable Remote debugging."; - LOG(ERROR) << "Error while parsing remote-debugging-port arg: "<< debugger_port.ToString(); + LOG(ERROR) << "Could not enable remote debugging." + << " Error while parsing remote-debugging-port arg: "<< debugger_port.ToString(); errno = 0; } else { - static const long max_port_num = 65535; - static const long max_reserved_port_num = 1024; - if (port > max_reserved_port_num && port < max_port_num) { + static const long max_port_num = 65534; + static const long max_reserved_port_num = 1025; + if (port >= max_reserved_port_num && port <= max_port_num) { g_remote_debugging_port = static_cast(port); settings.remote_debugging_port = g_remote_debugging_port; } else { - LOG(ERROR) << "Could not enable Remote debugging on port: "<< port - << ". Port number must be greater than "<< max_reserved_port_num - << " and less than " << max_port_num << "."; + LOG(ERROR) << "Cannot enable remote debugging on port "<< port + << ". Port numbers should be between "<< max_reserved_port_num + << " and " << max_port_num << "."; } } }