Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #634 from brave/C68-master
Browse files Browse the repository at this point in the history
Merge C68 into master
  • Loading branch information
bridiver committed Aug 9, 2018
2 parents 61b9651 + 2b7e67d commit 7eccb60
Show file tree
Hide file tree
Showing 100 changed files with 1,256 additions and 802 deletions.
3 changes: 2 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ mojom("mojo_bindings") {

public_deps = [
"//mojo/public/mojom/base",
"//services/service_manager/public/mojom",
]
}

Expand Down Expand Up @@ -575,7 +576,7 @@ if (is_win) {
chromedriver = "$chromedriver.exe"
}

chromedriver_version = "2.37"
chromedriver_version = "2.38"

copy("electron_chromedriver_dist_resources") {
sources = [
Expand Down
7 changes: 4 additions & 3 deletions atom/app/atom_content_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) {
// TODO(kalman): See what happens with a service worker.
schemes->cors_enabled_schemes.push_back(extensions::kExtensionScheme);
#endif
schemes->local_schemes.push_back("brave");
}

bool AtomContentClient::AllowScriptExtensionForServiceWorker(
Expand All @@ -123,7 +124,7 @@ bool AtomContentClient::AllowScriptExtensionForServiceWorker(
#endif
}

content::OriginTrialPolicy* AtomContentClient::GetOriginTrialPolicy() {
blink::OriginTrialPolicy* AtomContentClient::GetOriginTrialPolicy() {
if (!origin_trial_policy_) {
origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy());
}
Expand Down Expand Up @@ -181,10 +182,10 @@ void AtomContentClient::AddContentDecryptionModules(
if (cdm_host_file_paths) {
#if defined(OS_WIN)
base::FilePath brave_exe_dir;
if (!PathService::Get(base::DIR_EXE, &brave_exe_dir))
if (!base::PathService::Get(base::DIR_EXE, &brave_exe_dir))
NOTREACHED();
base::FilePath file_path;
if (!PathService::Get(base::FILE_EXE, &file_path))
if (!base::PathService::Get(base::FILE_EXE, &file_path))
NOTREACHED();
cdm_host_file_paths->reserve(1);

Expand Down
4 changes: 2 additions & 2 deletions atom/app/atom_content_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class AtomContentClient : public brightray::ContentClient {
void SetActiveURL(const GURL& url, std::string top_origin) override;
std::string GetProduct() const override;
std::string GetUserAgent() const override;
void SetGpuInfo(const gpu::GPUInfo& gpu_info);
void SetGpuInfo(const gpu::GPUInfo& gpu_info) override;
void AddAdditionalSchemes(Schemes* schemes) override;
void AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) override;
bool AllowScriptExtensionForServiceWorker(const GURL& script_url) override;
content::OriginTrialPolicy* GetOriginTrialPolicy() override;
blink::OriginTrialPolicy* GetOriginTrialPolicy() override;

void AddContentDecryptionModules(
std::vector<content::CdmInfo>* cdms,
Expand Down
8 changes: 5 additions & 3 deletions atom/app/atom_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "chrome/common/chrome_switches.h"
#include "content/public/app/content_main.h"
#include "content/public/common/content_switches.h"
#include "services/service_manager/sandbox/switches.h"

#if defined(OS_MACOSX)
#include "chrome/common/chrome_paths_internal.h"
Expand Down Expand Up @@ -133,7 +134,7 @@ int main(int argc, const char* argv[]) {
user_data_dir = command_line->GetSwitchValuePath(switches::kUserDataDir);
} else {
#if defined(OS_WIN) || defined(OS_MACOSX)
PathService::Get(base::DIR_APP_DATA, &user_data_dir);
base::PathService::Get(base::DIR_APP_DATA, &user_data_dir);
#else
user_data_dir = base::nix::GetXDGDirectory(environment.get(),
base::nix::kXdgConfigHomeEnvVar,
Expand All @@ -151,7 +152,7 @@ int main(int argc, const char* argv[]) {
#endif
}
}
PathService::Override(chrome::DIR_CRASH_DUMPS,
base::PathService::Override(chrome::DIR_CRASH_DUMPS,
user_data_dir.Append(FILE_PATH_LITERAL("CrashPad")));
environment->SetVar("CHROME_USER_DATA_DIR", user_data_dir.AsUTF8Unsafe());

Expand Down Expand Up @@ -183,7 +184,8 @@ int main(int argc, const char* argv[]) {
// Initialize the sandbox services.
sandbox::SandboxInterfaceInfo sandbox_info = {0};
const bool is_browser = process_type.empty();
const bool is_sandboxed = !command_line->HasSwitch(switches::kNoSandbox);
const bool is_sandboxed =
!command_line->HasSwitch(service_manager::switches::kNoSandbox);
if (is_browser || is_sandboxed) {
// For child processes that are running as --no-sandbox, don't initialize
// the sandbox info, otherwise they'll be treated as brokers (as if they
Expand Down
13 changes: 7 additions & 6 deletions atom/app/atom_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "extensions/common/constants.h"
#include "muon/app/muon_crash_reporter_client.h"
#include "printing/buildflags/buildflags.h"
#include "services/service_manager/embedder/switches.h"
#include "services/service_manager/sandbox/switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
Expand Down Expand Up @@ -171,7 +172,7 @@ base::FilePath InitializeUserDataDir() {

// Warn and fail early if the process fails to get a user data directory.
if (user_data_dir.empty() ||
!PathService::OverrideAndCreateIfNeeded(chrome::DIR_USER_DATA,
!base::PathService::OverrideAndCreateIfNeeded(chrome::DIR_USER_DATA,
user_data_dir, false, true)) {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
Expand All @@ -187,7 +188,7 @@ base::FilePath InitializeUserDataDir() {
base::FilePath chrome_user_data_dir;
base::FilePath native_messaging_dir;
#if defined(OS_MACOSX)
PathService::Get(base::DIR_APP_DATA, &chrome_user_data_dir);
base::PathService::Get(base::DIR_APP_DATA, &chrome_user_data_dir);
chrome_user_data_dir = chrome_user_data_dir.Append("Google/Chrome");
native_messaging_dir = base::FilePath(FILE_PATH_LITERAL(
"/Library/Google/Chrome/NativeMessagingHosts"));
Expand All @@ -196,11 +197,11 @@ base::FilePath InitializeUserDataDir() {
native_messaging_dir = base::FilePath(FILE_PATH_LITERAL(
"/etc/opt/chrome/native-messaging-hosts"));
#endif // defined(OS_MACOSX)
PathService::OverrideAndCreateIfNeeded(
base::PathService::OverrideAndCreateIfNeeded(
chrome::DIR_USER_NATIVE_MESSAGING,
chrome_user_data_dir.Append(FILE_PATH_LITERAL("NativeMessagingHosts")),
false, true);
PathService::OverrideAndCreateIfNeeded(chrome::DIR_NATIVE_MESSAGING,
base::PathService::OverrideAndCreateIfNeeded(chrome::DIR_NATIVE_MESSAGING,
native_messaging_dir, false, true);
#endif // OS_POSIX
return user_data_dir;
Expand Down Expand Up @@ -296,7 +297,7 @@ void AtomMainDelegate::PreSandboxStartup() {
if (path.empty()) {
LOG(ERROR) << "Could not create user data dir";
} else {
PathService::OverrideAndCreateIfNeeded(
base::PathService::OverrideAndCreateIfNeeded(
component_updater::DIR_COMPONENT_USER,
path.Append(FILE_PATH_LITERAL("Extensions")), false, true);
}
Expand All @@ -306,7 +307,7 @@ void AtomMainDelegate::PreSandboxStartup() {

#if !defined(CHROME_MULTIPLE_DLL_BROWSER)
if (process_type == switches::kUtilityProcess ||
process_type == switches::kZygoteProcess) {
process_type == service_manager::switches::kZygoteProcess) {
AtomContentUtilityClient::PreSandboxStartup();
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion atom/app/atom_main_delegate_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
brightray::GetApplicationName());
if (!base::PathExists(helper_path))
LOG(FATAL) << "Unable to find helper app";
PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
base::PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
}

void AtomMainDelegate::SetUpBundleOverrides() {
Expand Down
1 change: 1 addition & 0 deletions atom/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ source_set("browser") {
"//electron/chromium_src:menu_bar",
"//chrome/browser/ui/libgtkui:libgtkui",
"//electron/build:gtk3",
"//ui/events/platform/x11",
]
}

Expand Down
9 changes: 5 additions & 4 deletions atom/browser/api/atom_api_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
base::FilePath path;
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::Get(key, &path);
succeed = base::PathService::Get(key, &path);
if (!succeed)
args->ThrowError("Failed to get path");
return path;
Expand All @@ -693,7 +693,8 @@ void App::SetPath(mate::Arguments* args,
bool succeed = false;
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::OverrideAndCreateIfNeeded(key, path, true, false);
succeed =
base::PathService::OverrideAndCreateIfNeeded(key, path, true, false);
if (!succeed)
args->ThrowError("Failed to set path");
}
Expand Down Expand Up @@ -728,7 +729,7 @@ bool App::MakeSingleInstance(
return false;

base::FilePath user_dir;
PathService::Get(chrome::DIR_USER_DATA, &user_dir);
base::PathService::Get(chrome::DIR_USER_DATA, &user_dir);
process_singleton_.reset(new ProcessSingleton(
user_dir, base::Bind(NotificationCallbackWrapper, callback)));

Expand Down Expand Up @@ -773,7 +774,7 @@ bool App::Relaunch(mate::Arguments* js_args) {

if (exec_path.empty()) {
base::FilePath current_exe_path;
PathService::Get(base::FILE_EXE, &current_exe_path);
base::PathService::Get(base::FILE_EXE, &current_exe_path);
argv.push_back(current_exe_path.value());
} else {
argv.push_back(exec_path.value());
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/api/atom_api_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void ShowDialog(const file_dialog::DialogSettings& settings,

base::FilePath default_path = settings.default_path;
if (default_path.empty()) {
if (!PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &default_path)) {
if (!base::PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &default_path)) {
NOTREACHED();
}
}
Expand Down
3 changes: 1 addition & 2 deletions atom/browser/api/atom_api_menu_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@

[popup_controllers_[window_id] setCloseCallback:close_callback];
// Make sure events can be pumped while the menu is up.
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;

// One of the events that could be pumped is |window.close()|.
// User-initiated event-tracking loops protect against this by
Expand Down
Loading

0 comments on commit 7eccb60

Please sign in to comment.