-
Notifications
You must be signed in to change notification settings - Fork 613
Disabled remote-debugging by default and appshell.app.getRemoteDebuggingPort() needs a callback argument to work #668
Changes from 4 commits
2a172ef
76fc591
533c965
436bdb2
9b903fa
de74633
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
#include "config.h" | ||
|
||
CefRefPtr<ClientHandler> g_handler; | ||
int g_remote_debugging_port = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since, we are going to use atom or strtol further, as suggested by you using int is better for comparisons. |
||
|
||
#ifdef OS_WIN | ||
bool g_force_enable_acc = false; | ||
|
@@ -95,7 +96,21 @@ void AppGetSettings(CefSettings& settings, CefRefPtr<CefCommandLine> 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()) { | ||
int port = atoi(debugger_port.ToString().c_str()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using atoi seems acceptable in this case since the string is coming from the CommandLine handler. Better would be to use strtol. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed parsing to use |
||
static const int max_port_num = 65535; | ||
static const int max_reserved_port_num = 1024; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use unsigned int. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
if (port > max_reserved_port_num && port < max_port_num) { | ||
g_remote_debugging_port = port; | ||
settings.remote_debugging_port = 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(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ | |
|
||
#endif | ||
|
||
#define REMOTE_DEBUGGING_PORT 9234 | ||
extern int g_remote_debugging_port; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this needed here ? use it in appshell_extensions.cpp There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
||
// Comment out this line to enable OS themed drawing | ||
#define DARK_UI | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're changing the normal function to one that takes callback? Does this have any impact on existing usages? This is a breaking change, though I guess no extensions will ideally use this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does impact one use case, and fixed that with commit: adobe/brackets@8677756