Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,5 @@ vs-chromium-project.txt
/win8/metro_driver/metro_driver_version_resources.xml
/x86-generic_out/
/xcodebuild
/content/nw

1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ group("gn_all") {

if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) {
deps += [
"//content/nw:nwjs",
"//chrome",
"//chrome/test:browser_tests",
"//chrome/test:interactive_ui_tests",
Expand Down
30 changes: 20 additions & 10 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ gclient_gn_args = [


vars = {
"buildspec_platforms": "win, linux64, mac64, win64",
# By default, we should check out everything needed to run on the main
# chromium waterfalls. This var can be also be set to "small", in order
# to skip things are not strictly needed to build chromium for development
Expand Down Expand Up @@ -84,6 +85,7 @@ vars = {
'android_git': 'https://android.googlesource.com',
'aomedia_git': 'https://aomedia.googlesource.com',
'chromium_git': 'https://chromium.googlesource.com',
'nwjs_git': 'https://github.com/nwjs',
'swiftshader_git': 'https://swiftshader.googlesource.com',
'pdfium_git': 'https://pdfium.googlesource.com',
'boringssl_git': 'https://boringssl.googlesource.com',
Expand All @@ -96,31 +98,31 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling Skia
# and whatever else without interference from each other.
'skia_revision': 'refs/heads/chrome/m68',
'skia_revision': '7d479192f0bf2a2f0e872d40e3fe3ce9978bf3cc',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling V8
# and whatever else without interference from each other.
'v8_revision': 'refs/heads/6.8-lkgr',
'v8_revision': '5b8126a8d6fa0c58c89c2d618264ee087d6795a1',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling swarming_client
# and whatever else without interference from each other.
'swarming_revision': '34f5f28603ebda484debc188fb9004db95a41451',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling ANGLE
# and whatever else without interference from each other.
'angle_revision': 'refs/heads/chromium/3440',
'angle_revision': 'ba16270867793da817417c722abe3a5d98d50fc0',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling build tools
# and whatever else without interference from each other.
'buildtools_revision': 'refs/heads/chromium/3440',
'buildtools_revision': '893eb86b02b2571894e328f05551112b96df1cce',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling SwiftShader
# and whatever else without interference from each other.
'swiftshader_revision': 'f398044f28a171ca7ab62858af35bf57b80c0b30',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling PDFium
# and whatever else without interference from each other.
'pdfium_revision': 'refs/heads/chromium/3440',
'pdfium_revision': 'a1c1c63d3454e51ec321cdaa6e3420db2ed6c957',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling openmax_dl
# and whatever else without interference from each other.
Expand Down Expand Up @@ -979,7 +981,7 @@ deps = {
Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '7c0541da63f571512c49758cbc0767117997a270',

'src/third_party/webrtc':
Var('webrtc_git') + '/src.git' + '@' + 'refs/branch-heads/68', # commit position 21742
Var('webrtc_git') + '/src.git' + '@' + '350e48ae5ad0e63f9d600dd87cc47799abab5278', # commit position 21742

'src/third_party/xdg-utils': {
'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d',
Expand Down Expand Up @@ -1009,11 +1011,11 @@ deps = {
'src/tools/swarming_client':
Var('chromium_git') + '/infra/luci/client-py.git' + '@' + Var('swarming_revision'),

'src/v8':
Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'),
#'src/v8':
# Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'),

'src-internal': {
'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@refs/heads/chromium/3440',
'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@f7ec728f7bbea50aaa63eeb31e3bedaa10ee6451',
'condition': 'checkout_src_internal',
},

Expand Down Expand Up @@ -1766,7 +1768,15 @@ hooks = [
'--no_auth',
'--bucket', 'chromium-nodejs/8.9.1',
'-s', 'src/third_party/node/linux/node-linux-x64.tar.gz.sha1',
],
],
},
{
'name': 'nw_patch',
'pattern': '.',
'action': [
'python',
'src/content/nw/tools/patcher.py'
],
},
{
'name': 'node_mac',
Expand Down
2 changes: 2 additions & 0 deletions apps/app_lifetime_monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ void AppLifetimeMonitor::OnAppWindowRemoved(AppWindow* app_window) {
}

void AppLifetimeMonitor::OnAppWindowHidden(AppWindow* app_window) {
#if 0
if (!HasOtherVisibleAppWindows(app_window))
NotifyAppDeactivated(app_window->extension_id());
#endif
}

void AppLifetimeMonitor::OnAppWindowShown(AppWindow* app_window,
Expand Down
7 changes: 5 additions & 2 deletions apps/launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ class PlatformAppPathLauncher
extension_id(app->id()),
entry_paths_(entry_paths),
mime_type_collector_(context),
is_directory_collector_(context) {}
is_directory_collector_(context) {
if (app->is_nwjs_app()) //NWJS#5097
entry_paths_.clear();
}

PlatformAppPathLauncher(content::BrowserContext* context,
const Extension* app,
Expand All @@ -113,7 +116,7 @@ class PlatformAppPathLauncher
extension_id(app->id()),
mime_type_collector_(context),
is_directory_collector_(context) {
if (!file_path.empty())
if (!file_path.empty() && !app->is_nwjs_app()) //NWJS#5097
entry_paths_.push_back(file_path);
}

Expand Down
2 changes: 2 additions & 0 deletions base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ jumbo_component("base") {
"message_loop/message_pump_io_ios.h",
"message_loop/message_pump_mac.h",
"message_loop/message_pump_mac.mm",
"message_loop/message_pump_uv.cc",
"message_loop/message_pump_uv.h",
"message_loop/message_pump_win.cc",
"message_loop/message_pump_win.h",
"message_loop/timer_slack.h",
Expand Down
1 change: 1 addition & 0 deletions base/base_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ const char kForceNativePrefetch[] = "force-native-prefetch";
const char kNativePrefetchOrderedOnly[] = "native-prefetch-ordered-only";
#endif

const char kNWJS[] = "nwjs";
} // namespace switches
1 change: 1 addition & 0 deletions base/base_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ extern const char kForceNativePrefetch[];
extern const char kNativePrefetchOrderedOnly[];
#endif

extern const char kNWJS[];
} // namespace switches

#endif // BASE_BASE_SWITCHES_H_
93 changes: 86 additions & 7 deletions base/command_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,32 +155,83 @@ string16 QuoteForCommandLineToArgvW(const string16& arg,

CommandLine::CommandLine(NoProgram no_program)
: argv_(1),
begin_args_(1) {
begin_args_(1),
argc0_(0), argv0_(NULL) {
}

CommandLine::CommandLine(const FilePath& program)
: argv_(1),
begin_args_(1) {
begin_args_(1),
argc0_(0), argv0_(NULL) {
SetProgram(program);
}

CommandLine::CommandLine(int argc, const CommandLine::CharType* const* argv)
: argv_(1),
begin_args_(1) {
begin_args_(1),
argc0_(0), argv0_(NULL) {
InitFromArgv(argc, argv);
}

CommandLine::CommandLine(const StringVector& argv)
: argv_(1),
begin_args_(1) {
begin_args_(1),
argc0_(0), argv0_(NULL) {
InitFromArgv(argv);
}

CommandLine::CommandLine(const CommandLine& other) = default;
CommandLine::CommandLine(const CommandLine& other)
: argv_(other.argv_),
original_argv_(other.original_argv_),
switches_(other.switches_),
begin_args_(other.begin_args_),
argc0_(other.argc0_), argv0_(nullptr) {

CommandLine& CommandLine::operator=(const CommandLine& other) = default;
#if defined(OS_WIN)
if (other.argv0_) {
argv0_ = new char*[argc0_ + 1];
for (int i = 0; i < argc0_; ++i) {
argv0_[i] = new char[strlen(other.argv0_[i]) + 1];
strcpy(argv0_[i], other.argv0_[i]);
}
argv0_[argc0_] = NULL;
}
#else
argv0_ = other.argv0_;
#endif
}

CommandLine& CommandLine::operator=(const CommandLine& other) {
argv_ = other.argv_;
original_argv_ = other.original_argv_;
switches_ = other.switches_;
begin_args_ = other.begin_args_;
#if defined(OS_WIN)
if (other.argv0_) {
argc0_ = other.argc0_;
argv0_ = new char*[argc0_ + 1];
for (int i = 0; i < argc0_; ++i) {
argv0_[i] = new char[strlen(other.argv0_[i]) + 1];
strcpy(argv0_[i], other.argv0_[i]);
}
argv0_[argc0_] = NULL;
}
#else
argv0_ = other.argv0_;
#endif
return *this;
}

CommandLine::~CommandLine() = default;
CommandLine::~CommandLine() {
#if defined(OS_WIN)
if (!argv0_)
return;
for (int i = 0; i < argc0_; i++) {
delete[] argv0_[i];
}
delete[] argv0_;
#endif
}

#if defined(OS_WIN)
// static
Expand Down Expand Up @@ -253,12 +304,34 @@ CommandLine CommandLine::FromString(const string16& command_line) {
void CommandLine::InitFromArgv(int argc,
const CommandLine::CharType* const* argv) {
StringVector new_argv;
argc0_ = argc;
#if !defined(OS_WIN)
argv0_ = (char**)argv;
#else
argv0_ = new char*[argc + 1];
for (int i = 0; i < argc; ++i) {
std::string str(base::WideToUTF8(argv[i]));
argv0_[i] = new char[str.length() + 1];
strcpy(argv0_[i], str.c_str());
}
argv0_[argc] = NULL;
#endif
for (int i = 0; i < argc; ++i)
new_argv.push_back(argv[i]);
InitFromArgv(new_argv);
}

void CommandLine::InitFromArgv(const StringVector& argv) {
#if !defined(OS_MACOSX)
original_argv_ = argv;
#else
for (size_t index = 0; index < argv.size(); ++index) {
if (argv[index].compare(0, strlen("--psn_"), "--psn_") != 0 &&
argv[index].compare(0, strlen("-psn_"), "-psn_") != 0) {
original_argv_.push_back(argv[index]);
}
}
#endif
argv_ = StringVector(1);
switches_.clear();
begin_args_ = 1;
Expand Down Expand Up @@ -397,6 +470,12 @@ void CommandLine::AppendArgNative(const CommandLine::StringType& value) {
argv_.push_back(value);
}

#if defined(OS_MACOSX)
void CommandLine::FixOrigArgv4Finder(const CommandLine::StringType& value) {
original_argv_.push_back(value);
}
#endif

void CommandLine::AppendArguments(const CommandLine& other,
bool include_program) {
if (include_program)
Expand Down
15 changes: 15 additions & 0 deletions base/command_line.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ class BASE_EXPORT CommandLine {

// Returns the original command line string as a vector of strings.
const StringVector& argv() const { return argv_; }
int argc0() { return argc0_; }
char** argv0() { return argv0_; }

// Returns the original command line string as a vector of strings (keeps precedence).
const StringVector& original_argv() const { return original_argv_; }

// Get and Set the program part of the command line string (the first item).
FilePath GetProgram() const;
Expand Down Expand Up @@ -199,6 +204,10 @@ class BASE_EXPORT CommandLine {
void AppendArgPath(const FilePath& value);
void AppendArgNative(const StringType& value);

#if defined(OS_MACOSX)
void FixOrigArgv4Finder(const StringType& value);
#endif

// Append the switches and arguments from another command line to this one.
// If |include_program| is true, include |other|'s program as well.
void AppendArguments(const CommandLine& other, bool include_program);
Expand Down Expand Up @@ -235,11 +244,17 @@ class BASE_EXPORT CommandLine {
// The argv array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* }
StringVector argv_;

// The argv array (precedence not messed).
StringVector original_argv_;

// Parsed-out switch keys and values.
SwitchMap switches_;

// The index after the program and switches, any arguments start here.
size_t begin_args_;

int argc0_;
char** argv0_;
};

} // namespace base
Expand Down
2 changes: 1 addition & 1 deletion base/files/file_util_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ std::string TempFileName() {
#if defined(GOOGLE_CHROME_BUILD)
return std::string(".com.google.Chrome.XXXXXX");
#else
return std::string(".org.chromium.Chromium.XXXXXX");
return std::string(".io.nwjs.XXXXXX");
#endif
}

Expand Down
3 changes: 3 additions & 0 deletions base/message_loop/message_loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ std::unique_ptr<MessagePump> MessageLoop::CreateMessagePumpForType(Type type) {
return std::unique_ptr<MessagePump>(new MessagePumpForUI());
#endif

if (type == MessageLoop::TYPE_NODE)
return std::unique_ptr<MessagePump>(new MessagePumpUV());

DCHECK_EQ(MessageLoop::TYPE_DEFAULT, type);
#if defined(OS_IOS)
// On iOS, a native runloop is always required to pump system work.
Expand Down
Loading