This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
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
Merged
swmitra
merged 6 commits into
adobe:master
from
g-217:jha-g/disable-remote-debugging-by-default
Nov 12, 2019
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2a172ef
Disabled remote-debugging by default and appshell.app.getRemoteDebugg…
g-217 76fc591
Addressing review comments
g-217 533c965
Addressing review comments
g-217 436bdb2
Updating error meesage for port validation
g-217 9b903fa
Addressing review comments from vickramdhawal, also it is not possibl…
g-217 de74633
More error message correction
g-217 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
#include <cstdlib> | ||
#include <sstream> | ||
#include <string> | ||
#include <errno.h> | ||
#include "include/cef_app.h" | ||
#include "include/cef_browser.h" | ||
#include "include/cef_command_line.h" | ||
|
@@ -19,6 +20,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 +97,28 @@ 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()) { | ||
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<int>(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(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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