Merge pull request #11230 from electron/upgrade-to-chromium-62
Upgrade to Chromium 62
This commit is contained in:
commit
f7786a9e48
108 changed files with 486 additions and 626 deletions
11
.gitignore
vendored
11
.gitignore
vendored
|
@ -28,14 +28,11 @@
|
||||||
/external_binaries/
|
/external_binaries/
|
||||||
/out/
|
/out/
|
||||||
/vendor/.gclient
|
/vendor/.gclient
|
||||||
/vendor/debian_jessie_amd64-sysroot/
|
|
||||||
/vendor/debian_jessie_arm-sysroot/
|
|
||||||
/vendor/debian_jessie_arm64-sysroot/
|
|
||||||
/vendor/debian_jessie_i386-sysroot/
|
|
||||||
/vendor/debian_jessie_mips64-sysroot/
|
/vendor/debian_jessie_mips64-sysroot/
|
||||||
/vendor/debian_wheezy_amd64-sysroot/
|
/vendor/debian_stretch_amd64-sysroot/
|
||||||
/vendor/debian_wheezy_arm-sysroot/
|
/vendor/debian_stretch_arm-sysroot/
|
||||||
/vendor/debian_wheezy_i386-sysroot/
|
/vendor/debian_stretch_arm64-sysroot/
|
||||||
|
/vendor/debian_stretch_i386-sysroot/
|
||||||
/vendor/gcc-4.8.3-d197-n64-loongson/
|
/vendor/gcc-4.8.3-d197-n64-loongson/
|
||||||
/vendor/readme-gcc483-loongson.txt
|
/vendor/readme-gcc483-loongson.txt
|
||||||
/vendor/download/
|
/vendor/download/
|
||||||
|
|
|
@ -19,13 +19,14 @@
|
||||||
#include "content/public/common/content_constants.h"
|
#include "content/public/common/content_constants.h"
|
||||||
#include "content/public/common/pepper_plugin_info.h"
|
#include "content/public/common/pepper_plugin_info.h"
|
||||||
#include "content/public/common/user_agent.h"
|
#include "content/public/common/user_agent.h"
|
||||||
|
#include "media/media_features.h"
|
||||||
#include "pdf/pdf.h"
|
#include "pdf/pdf.h"
|
||||||
#include "ppapi/shared_impl/ppapi_permissions.h"
|
#include "ppapi/shared_impl/ppapi_permissions.h"
|
||||||
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
|
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
|
||||||
#include "ui/base/l10n/l10n_util.h"
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
#include "url/url_constants.h"
|
#include "url/url_constants.h"
|
||||||
|
|
||||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
#include "chrome/common/widevine_cdm_constants.h"
|
#include "chrome/common/widevine_cdm_constants.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
|
content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
|
||||||
const std::string& version) {
|
const std::string& version) {
|
||||||
content::PepperPluginInfo widevine_cdm;
|
content::PepperPluginInfo widevine_cdm;
|
||||||
|
@ -108,7 +109,7 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
|
||||||
|
|
||||||
return widevine_cdm;
|
return widevine_cdm;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
|
|
||||||
void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
|
void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
|
||||||
content::PepperPluginInfo pdf_info;
|
content::PepperPluginInfo pdf_info;
|
||||||
|
@ -156,7 +157,7 @@ void AddPepperFlashFromCommandLine(
|
||||||
plugins->push_back(CreatePepperFlashInfo(flash_path, flash_version));
|
plugins->push_back(CreatePepperFlashInfo(flash_path, flash_version));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
void AddWidevineCdmFromCommandLine(
|
void AddWidevineCdmFromCommandLine(
|
||||||
std::vector<content::PepperPluginInfo>* plugins) {
|
std::vector<content::PepperPluginInfo>* plugins) {
|
||||||
auto command_line = base::CommandLine::ForCurrentProcess();
|
auto command_line = base::CommandLine::ForCurrentProcess();
|
||||||
|
@ -176,7 +177,7 @@ void AddWidevineCdmFromCommandLine(
|
||||||
plugins->push_back(CreateWidevineCdmInfo(widevine_cdm_path,
|
plugins->push_back(CreateWidevineCdmInfo(widevine_cdm_path,
|
||||||
widevine_cdm_version));
|
widevine_cdm_version));
|
||||||
}
|
}
|
||||||
#endif
|
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
|
|
||||||
AtomContentClient::AtomContentClient() {
|
AtomContentClient::AtomContentClient() {
|
||||||
}
|
}
|
||||||
|
@ -216,9 +217,9 @@ void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) {
|
||||||
void AtomContentClient::AddPepperPlugins(
|
void AtomContentClient::AddPepperPlugins(
|
||||||
std::vector<content::PepperPluginInfo>* plugins) {
|
std::vector<content::PepperPluginInfo>* plugins) {
|
||||||
AddPepperFlashFromCommandLine(plugins);
|
AddPepperFlashFromCommandLine(plugins);
|
||||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
AddWidevineCdmFromCommandLine(plugins);
|
AddWidevineCdmFromCommandLine(plugins);
|
||||||
#endif
|
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
ComputeBuiltInPlugins(plugins);
|
ComputeBuiltInPlugins(plugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,11 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
|
||||||
bool enable_stack_dumping = true;
|
bool enable_stack_dumping = true;
|
||||||
#else
|
#else
|
||||||
bool enable_stack_dumping = env->HasVar("ELECTRON_ENABLE_STACK_DUMPING");
|
bool enable_stack_dumping = env->HasVar("ELECTRON_ENABLE_STACK_DUMPING");
|
||||||
|
#endif
|
||||||
|
#if defined(ARCH_CPU_ARM_FAMILY) && defined(ARCH_CPU_32_BITS)
|
||||||
|
// For 32bit ARM enabling stack printing would end up crashing.
|
||||||
|
// https://github.com/electron/electron/pull/11230#issuecomment-363232482
|
||||||
|
enable_stack_dumping = false;
|
||||||
#endif
|
#endif
|
||||||
if (enable_stack_dumping)
|
if (enable_stack_dumping)
|
||||||
base::debug::EnableInProcessStackDumping();
|
base::debug::EnableInProcessStackDumping();
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "atom/common/api/atom_bindings.h"
|
#include "atom/common/api/atom_bindings.h"
|
||||||
#include "atom/common/crash_reporter/crash_reporter.h"
|
#include "atom/common/crash_reporter/crash_reporter.h"
|
||||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||||
|
#include "atom/common/node_bindings.h"
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/feature_list.h"
|
#include "base/feature_list.h"
|
||||||
#include "base/task_scheduler/task_scheduler.h"
|
#include "base/task_scheduler/task_scheduler.h"
|
||||||
|
@ -50,14 +51,16 @@ int NodeMain(int argc, char *argv[]) {
|
||||||
// Initialize gin::IsolateHolder.
|
// Initialize gin::IsolateHolder.
|
||||||
JavascriptEnvironment gin_env;
|
JavascriptEnvironment gin_env;
|
||||||
|
|
||||||
|
// Explicitly register electron's builtin modules.
|
||||||
|
NodeBindings::RegisterBuiltinModules();
|
||||||
|
|
||||||
int exec_argc;
|
int exec_argc;
|
||||||
const char** exec_argv;
|
const char** exec_argv;
|
||||||
node::Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
|
node::Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
|
||||||
|
|
||||||
node::IsolateData isolate_data(gin_env.isolate(), loop);
|
|
||||||
node::Environment* env = node::CreateEnvironment(
|
node::Environment* env = node::CreateEnvironment(
|
||||||
&isolate_data, gin_env.context(), argc, argv,
|
node::CreateIsolateData(gin_env.isolate(), loop, gin_env.platform()),
|
||||||
exec_argc, exec_argv);
|
gin_env.context(), argc, argv, exec_argc, exec_argv);
|
||||||
|
|
||||||
// Enable support for v8 inspector.
|
// Enable support for v8 inspector.
|
||||||
NodeDebugger node_debugger(env);
|
NodeDebugger node_debugger(env);
|
||||||
|
@ -79,6 +82,7 @@ int NodeMain(int argc, char *argv[]) {
|
||||||
bool more;
|
bool more;
|
||||||
do {
|
do {
|
||||||
more = uv_run(env->event_loop(), UV_RUN_ONCE);
|
more = uv_run(env->event_loop(), UV_RUN_ONCE);
|
||||||
|
gin_env.platform()->DrainBackgroundTasks(env->isolate());
|
||||||
if (more == false) {
|
if (more == false) {
|
||||||
node::EmitBeforeExit(env);
|
node::EmitBeforeExit(env);
|
||||||
|
|
||||||
|
@ -92,6 +96,8 @@ int NodeMain(int argc, char *argv[]) {
|
||||||
|
|
||||||
exit_code = node::EmitExit(env);
|
exit_code = node::EmitExit(env);
|
||||||
node::RunAtExit(env);
|
node::RunAtExit(env);
|
||||||
|
gin_env.platform()->DrainBackgroundTasks(env->isolate());
|
||||||
|
gin_env.platform()->CancelPendingDelayedTasks(env->isolate());
|
||||||
|
|
||||||
node::FreeEnvironment(env);
|
node::FreeEnvironment(env);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1133,8 +1133,8 @@ std::vector<mate::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {
|
||||||
|
|
||||||
v8::Local<v8::Value> App::GetGPUFeatureStatus(v8::Isolate* isolate) {
|
v8::Local<v8::Value> App::GetGPUFeatureStatus(v8::Isolate* isolate) {
|
||||||
auto status = content::GetFeatureStatus();
|
auto status = content::GetFeatureStatus();
|
||||||
return mate::ConvertToV8(isolate,
|
base::DictionaryValue temp;
|
||||||
status ? *status : base::DictionaryValue());
|
return mate::ConvertToV8(isolate, status ? *status : temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::EnableMixedSandbox(mate::Arguments* args) {
|
void App::EnableMixedSandbox(mate::Arguments* args) {
|
||||||
|
@ -1342,4 +1342,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_app, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_app, Initialize)
|
||||||
|
|
|
@ -150,4 +150,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_auto_updater, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_auto_updater, Initialize)
|
||||||
|
|
|
@ -162,4 +162,4 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_browser_view, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_browser_view, Initialize)
|
||||||
|
|
|
@ -1332,4 +1332,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_window, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_window, Initialize)
|
||||||
|
|
|
@ -73,4 +73,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_content_tracing, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_content_tracing, Initialize)
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include "net/url_request/url_request_context.h"
|
#include "net/url_request/url_request_context.h"
|
||||||
#include "net/url_request/url_request_context_getter.h"
|
#include "net/url_request/url_request_context_getter.h"
|
||||||
|
|
||||||
using atom::AtomCookieDelegate;
|
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
@ -238,17 +237,15 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Cookies::Cookies(v8::Isolate* isolate,
|
Cookies::Cookies(v8::Isolate* isolate, AtomBrowserContext* browser_context)
|
||||||
AtomBrowserContext* browser_context)
|
: browser_context_(browser_context),
|
||||||
: request_context_getter_(browser_context->url_request_context_getter()),
|
request_context_getter_(browser_context->url_request_context_getter()) {
|
||||||
cookie_delegate_(browser_context->cookie_delegate()) {
|
|
||||||
Init(isolate);
|
Init(isolate);
|
||||||
cookie_delegate_->AddObserver(this);
|
cookie_change_subscription_ = browser_context->RegisterCookieChangeCallback(
|
||||||
|
base::Bind(&Cookies::OnCookieChanged, base::Unretained(this)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Cookies::~Cookies() {
|
Cookies::~Cookies() {}
|
||||||
cookie_delegate_->RemoveObserver(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cookies::Get(const base::DictionaryValue& filter,
|
void Cookies::Get(const base::DictionaryValue& filter,
|
||||||
const GetCallback& callback) {
|
const GetCallback& callback) {
|
||||||
|
@ -283,10 +280,8 @@ void Cookies::FlushStore(const base::Closure& callback) {
|
||||||
base::Bind(FlushCookieStoreOnIOThread, getter, callback));
|
base::Bind(FlushCookieStoreOnIOThread, getter, callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cookies::OnCookieChanged(const net::CanonicalCookie& cookie,
|
void Cookies::OnCookieChanged(const CookieDetails* details) {
|
||||||
bool removed,
|
Emit("changed", *(details->cookie), details->cause, details->removed);
|
||||||
net::CookieStore::ChangeCause cause) {
|
|
||||||
Emit("changed", cookie, cause, removed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "atom/browser/api/trackable_object.h"
|
#include "atom/browser/api/trackable_object.h"
|
||||||
#include "atom/browser/net/atom_cookie_delegate.h"
|
#include "atom/browser/net/cookie_details.h"
|
||||||
#include "base/callback.h"
|
#include "base/callback.h"
|
||||||
#include "native_mate/handle.h"
|
#include "native_mate/handle.h"
|
||||||
#include "net/cookies/canonical_cookie.h"
|
#include "net/cookies/canonical_cookie.h"
|
||||||
|
@ -27,8 +27,7 @@ class AtomBrowserContext;
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
class Cookies : public mate::TrackableObject<Cookies>,
|
class Cookies : public mate::TrackableObject<Cookies> {
|
||||||
public AtomCookieDelegate::Observer {
|
|
||||||
public:
|
public:
|
||||||
enum Error {
|
enum Error {
|
||||||
SUCCESS,
|
SUCCESS,
|
||||||
|
@ -55,14 +54,16 @@ class Cookies : public mate::TrackableObject<Cookies>,
|
||||||
void Set(const base::DictionaryValue& details, const SetCallback& callback);
|
void Set(const base::DictionaryValue& details, const SetCallback& callback);
|
||||||
void FlushStore(const base::Closure& callback);
|
void FlushStore(const base::Closure& callback);
|
||||||
|
|
||||||
// AtomCookieDelegate::Observer:
|
// AtomBrowserContext::RegisterCookieChangeCallback subscription:
|
||||||
void OnCookieChanged(const net::CanonicalCookie& cookie,
|
void OnCookieChanged(const CookieDetails*);
|
||||||
bool removed,
|
|
||||||
net::CookieStore::ChangeCause cause) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Store a reference to ensure this class gets destroyed before the context.
|
||||||
|
scoped_refptr<AtomBrowserContext> browser_context_;
|
||||||
|
std::unique_ptr<base::CallbackList<void(const CookieDetails*)>::Subscription>
|
||||||
|
cookie_change_subscription_;
|
||||||
|
|
||||||
net::URLRequestContextGetter* request_context_getter_;
|
net::URLRequestContextGetter* request_context_getter_;
|
||||||
scoped_refptr<AtomCookieDelegate> cookie_delegate_;
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Cookies);
|
DISALLOW_COPY_AND_ASSIGN(Cookies);
|
||||||
};
|
};
|
||||||
|
|
|
@ -178,4 +178,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_debugger, Initialize);
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_debugger, Initialize);
|
||||||
|
|
|
@ -114,4 +114,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_desktop_capturer, Initialize);
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_desktop_capturer, Initialize);
|
||||||
|
|
|
@ -140,4 +140,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_dialog, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_dialog, Initialize)
|
||||||
|
|
|
@ -236,4 +236,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_download_item, Initialize);
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_download_item, Initialize);
|
||||||
|
|
|
@ -98,4 +98,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_global_shortcut, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_global_shortcut, Initialize)
|
||||||
|
|
|
@ -112,4 +112,4 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_in_app_purchase, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_in_app_purchase, Initialize)
|
||||||
|
|
|
@ -228,4 +228,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_menu, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_menu, Initialize)
|
||||||
|
|
|
@ -58,4 +58,4 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_net, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_net, Initialize)
|
||||||
|
|
|
@ -270,4 +270,4 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_notification, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_notification, Initialize)
|
||||||
|
|
|
@ -103,4 +103,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_power_monitor, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_power_monitor, Initialize)
|
||||||
|
|
|
@ -133,4 +133,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_power_save_blocker, Initialize);
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_power_save_blocker, Initialize);
|
||||||
|
|
|
@ -253,4 +253,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_protocol, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_protocol, Initialize)
|
||||||
|
|
|
@ -86,5 +86,5 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_render_process_preferences,
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_render_process_preferences,
|
||||||
Initialize)
|
Initialize)
|
||||||
|
|
|
@ -144,4 +144,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_screen, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_screen, Initialize)
|
||||||
|
|
|
@ -839,4 +839,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_session, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_session, Initialize)
|
||||||
|
|
|
@ -96,4 +96,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_system_preferences, Initialize);
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_system_preferences, Initialize);
|
||||||
|
|
|
@ -250,4 +250,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_tray, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_tray, Initialize)
|
||||||
|
|
|
@ -811,8 +811,7 @@ void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
|
||||||
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
|
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
int error_code,
|
int error_code,
|
||||||
const base::string16& error_description,
|
const base::string16& error_description) {
|
||||||
bool was_ignored_by_handler) {
|
|
||||||
bool is_main_frame = !render_frame_host->GetParent();
|
bool is_main_frame = !render_frame_host->GetParent();
|
||||||
Emit("did-fail-load", error_code, error_description, url, is_main_frame);
|
Emit("did-fail-load", error_code, error_description, url, is_main_frame);
|
||||||
}
|
}
|
||||||
|
@ -2035,4 +2034,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_web_contents, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_web_contents, Initialize)
|
||||||
|
|
|
@ -343,8 +343,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
void DidFailLoad(content::RenderFrameHost* render_frame_host,
|
void DidFailLoad(content::RenderFrameHost* render_frame_host,
|
||||||
const GURL& validated_url,
|
const GURL& validated_url,
|
||||||
int error_code,
|
int error_code,
|
||||||
const base::string16& error_description,
|
const base::string16& error_description) override;
|
||||||
bool was_ignored_by_handler) override;
|
|
||||||
void DidStartLoading() override;
|
void DidStartLoading() override;
|
||||||
void DidStopLoading() override;
|
void DidStopLoading() override;
|
||||||
void DidGetResourceResponseStart(
|
void DidGetResourceResponseStart(
|
||||||
|
|
|
@ -52,4 +52,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_web_view_manager, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_web_view_manager, Initialize)
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "atom/browser/net/atom_cert_verifier.h"
|
#include "atom/browser/net/atom_cert_verifier.h"
|
||||||
#include "atom/browser/net/atom_network_delegate.h"
|
#include "atom/browser/net/atom_network_delegate.h"
|
||||||
#include "atom/browser/net/atom_url_request_job_factory.h"
|
#include "atom/browser/net/atom_url_request_job_factory.h"
|
||||||
|
#include "atom/browser/net/cookie_details.h"
|
||||||
#include "atom/browser/net/http_protocol_handler.h"
|
#include "atom/browser/net/http_protocol_handler.h"
|
||||||
#include "atom/browser/web_view_manager.h"
|
#include "atom/browser/web_view_manager.h"
|
||||||
#include "atom/common/atom_version.h"
|
#include "atom/common/atom_version.h"
|
||||||
|
@ -70,8 +71,7 @@ std::string RemoveWhitespace(const std::string& str) {
|
||||||
AtomBrowserContext::AtomBrowserContext(const std::string& partition,
|
AtomBrowserContext::AtomBrowserContext(const std::string& partition,
|
||||||
bool in_memory,
|
bool in_memory,
|
||||||
const base::DictionaryValue& options)
|
const base::DictionaryValue& options)
|
||||||
: brightray::BrowserContext(partition, in_memory),
|
: brightray::BrowserContext(partition, in_memory) {
|
||||||
cookie_delegate_(new AtomCookieDelegate) {
|
|
||||||
// Construct user agent string.
|
// Construct user agent string.
|
||||||
Browser* browser = Browser::Get();
|
Browser* browser = Browser::Get();
|
||||||
std::string name = RemoveWhitespace(browser->GetName());
|
std::string name = RemoveWhitespace(browser->GetName());
|
||||||
|
@ -103,15 +103,17 @@ void AtomBrowserContext::SetUserAgent(const std::string& user_agent) {
|
||||||
user_agent_ = user_agent;
|
user_agent_ = user_agent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<base::CallbackList<void(const CookieDetails*)>::Subscription>
|
||||||
|
AtomBrowserContext::RegisterCookieChangeCallback(
|
||||||
|
const base::Callback<void(const CookieDetails*)>& cb) {
|
||||||
|
return cookie_change_sub_list_.Add(cb);
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<net::NetworkDelegate>
|
std::unique_ptr<net::NetworkDelegate>
|
||||||
AtomBrowserContext::CreateNetworkDelegate() {
|
AtomBrowserContext::CreateNetworkDelegate() {
|
||||||
return base::MakeUnique<AtomNetworkDelegate>();
|
return base::MakeUnique<AtomNetworkDelegate>();
|
||||||
}
|
}
|
||||||
|
|
||||||
net::CookieMonsterDelegate* AtomBrowserContext::CreateCookieDelegate() {
|
|
||||||
return cookie_delegate();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string AtomBrowserContext::GetUserAgent() {
|
std::string AtomBrowserContext::GetUserAgent() {
|
||||||
return user_agent_;
|
return user_agent_;
|
||||||
}
|
}
|
||||||
|
@ -203,6 +205,14 @@ std::vector<std::string> AtomBrowserContext::GetCookieableSchemes() {
|
||||||
return default_schemes;
|
return default_schemes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AtomBrowserContext::NotifyCookieChange(
|
||||||
|
const net::CanonicalCookie& cookie,
|
||||||
|
bool removed,
|
||||||
|
net::CookieStore::ChangeCause cause) {
|
||||||
|
CookieDetails cookie_details(&cookie, removed, cause);
|
||||||
|
cookie_change_sub_list_.Notify(&cookie_details);
|
||||||
|
}
|
||||||
|
|
||||||
void AtomBrowserContext::RegisterPrefs(PrefRegistrySimple* pref_registry) {
|
void AtomBrowserContext::RegisterPrefs(PrefRegistrySimple* pref_registry) {
|
||||||
pref_registry->RegisterFilePathPref(prefs::kSelectFileLastDirectory,
|
pref_registry->RegisterFilePathPref(prefs::kSelectFileLastDirectory,
|
||||||
base::FilePath());
|
base::FilePath());
|
||||||
|
|
|
@ -8,9 +8,8 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "atom/browser/net/atom_cookie_delegate.h"
|
#include "base/callback_list.h"
|
||||||
#include "brightray/browser/browser_context.h"
|
#include "brightray/browser/browser_context.h"
|
||||||
#include "net/cookies/cookie_monster.h"
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -19,6 +18,7 @@ class AtomDownloadManagerDelegate;
|
||||||
class AtomNetworkDelegate;
|
class AtomNetworkDelegate;
|
||||||
class AtomPermissionManager;
|
class AtomPermissionManager;
|
||||||
class WebViewManager;
|
class WebViewManager;
|
||||||
|
struct CookieDetails;
|
||||||
|
|
||||||
class AtomBrowserContext : public brightray::BrowserContext {
|
class AtomBrowserContext : public brightray::BrowserContext {
|
||||||
public:
|
public:
|
||||||
|
@ -30,10 +30,13 @@ class AtomBrowserContext : public brightray::BrowserContext {
|
||||||
const base::DictionaryValue& options = base::DictionaryValue());
|
const base::DictionaryValue& options = base::DictionaryValue());
|
||||||
|
|
||||||
void SetUserAgent(const std::string& user_agent);
|
void SetUserAgent(const std::string& user_agent);
|
||||||
|
// Register callbacks that needs to notified on any cookie store changes.
|
||||||
|
std::unique_ptr<base::CallbackList<void(const CookieDetails*)>::Subscription>
|
||||||
|
RegisterCookieChangeCallback(
|
||||||
|
const base::Callback<void(const CookieDetails*)>& cb);
|
||||||
|
|
||||||
// brightray::URLRequestContextGetter::Delegate:
|
// brightray::URLRequestContextGetter::Delegate:
|
||||||
std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate() override;
|
std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate() override;
|
||||||
net::CookieMonsterDelegate* CreateCookieDelegate() override;
|
|
||||||
std::string GetUserAgent() override;
|
std::string GetUserAgent() override;
|
||||||
std::unique_ptr<net::URLRequestJobFactory> CreateURLRequestJobFactory(
|
std::unique_ptr<net::URLRequestJobFactory> CreateURLRequestJobFactory(
|
||||||
content::ProtocolHandlerMap* protocol_handlers) override;
|
content::ProtocolHandlerMap* protocol_handlers) override;
|
||||||
|
@ -42,6 +45,9 @@ class AtomBrowserContext : public brightray::BrowserContext {
|
||||||
std::unique_ptr<net::CertVerifier> CreateCertVerifier(
|
std::unique_ptr<net::CertVerifier> CreateCertVerifier(
|
||||||
brightray::RequireCTDelegate* ct_delegate) override;
|
brightray::RequireCTDelegate* ct_delegate) override;
|
||||||
std::vector<std::string> GetCookieableSchemes() override;
|
std::vector<std::string> GetCookieableSchemes() override;
|
||||||
|
void NotifyCookieChange(const net::CanonicalCookie& cookie,
|
||||||
|
bool removed,
|
||||||
|
net::CookieStore::ChangeCause cause) override;
|
||||||
|
|
||||||
// content::BrowserContext:
|
// content::BrowserContext:
|
||||||
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
|
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
|
||||||
|
@ -52,9 +58,6 @@ class AtomBrowserContext : public brightray::BrowserContext {
|
||||||
void RegisterPrefs(PrefRegistrySimple* pref_registry) override;
|
void RegisterPrefs(PrefRegistrySimple* pref_registry) override;
|
||||||
|
|
||||||
AtomBlobReader* GetBlobReader();
|
AtomBlobReader* GetBlobReader();
|
||||||
AtomCookieDelegate* cookie_delegate() const {
|
|
||||||
return cookie_delegate_.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AtomBrowserContext(const std::string& partition, bool in_memory,
|
AtomBrowserContext(const std::string& partition, bool in_memory,
|
||||||
|
@ -69,7 +72,7 @@ class AtomBrowserContext : public brightray::BrowserContext {
|
||||||
std::string user_agent_;
|
std::string user_agent_;
|
||||||
bool use_cache_;
|
bool use_cache_;
|
||||||
|
|
||||||
scoped_refptr<AtomCookieDelegate> cookie_delegate_;
|
base::CallbackList<void(const CookieDetails*)> cookie_change_sub_list_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomBrowserContext);
|
DISALLOW_COPY_AND_ASSIGN(AtomBrowserContext);
|
||||||
};
|
};
|
||||||
|
|
|
@ -135,8 +135,8 @@ void AtomBrowserMainParts::PostEarlyInitialization() {
|
||||||
node_bindings_->Initialize();
|
node_bindings_->Initialize();
|
||||||
|
|
||||||
// Create the global environment.
|
// Create the global environment.
|
||||||
node::Environment* env =
|
node::Environment* env = node_bindings_->CreateEnvironment(
|
||||||
node_bindings_->CreateEnvironment(js_env_->context());
|
js_env_->context(), js_env_->platform());
|
||||||
node_env_.reset(new NodeEnvironment(env));
|
node_env_.reset(new NodeEnvironment(env));
|
||||||
|
|
||||||
// Enable support for v8 inspector
|
// Enable support for v8 inspector
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/callback.h"
|
#include "base/callback.h"
|
||||||
#include "base/id_map.h"
|
#include "base/containers/id_map.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "content/public/browser/permission_manager.h"
|
#include "content/public/browser/permission_manager.h"
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ class AtomPermissionManager : public content::PermissionManager {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class PendingRequest;
|
class PendingRequest;
|
||||||
using PendingRequestsMap = IDMap<std::unique_ptr<PendingRequest>>;
|
using PendingRequestsMap = base::IDMap<std::unique_ptr<PendingRequest>>;
|
||||||
|
|
||||||
RequestHandler request_handler_;
|
RequestHandler request_handler_;
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,7 @@ bool LaunchXdgUtility(const std::vector<std::string>& argv, int* exit_code) {
|
||||||
if (devnull < 0) return false;
|
if (devnull < 0) return false;
|
||||||
|
|
||||||
base::LaunchOptions options;
|
base::LaunchOptions options;
|
||||||
|
options.fds_to_remap.push_back(std::make_pair(devnull, STDIN_FILENO));
|
||||||
base::FileHandleMappingVector remap;
|
|
||||||
remap.push_back(std::make_pair(devnull, STDIN_FILENO));
|
|
||||||
options.fds_to_remap = &remap;
|
|
||||||
|
|
||||||
base::Process process = base::LaunchProcess(argv, options);
|
base::Process process = base::LaunchProcess(argv, options);
|
||||||
close(devnull);
|
close(devnull);
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "gin/v8_initializer.h"
|
#include "gin/v8_initializer.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
|
#include "vendor/node/src/tracing/trace_event.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -48,10 +49,10 @@ bool JavascriptEnvironment::Initialize() {
|
||||||
// The V8Platform of gin relies on Chromium's task schedule, which has not
|
// The V8Platform of gin relies on Chromium's task schedule, which has not
|
||||||
// been started at this point, so we have to rely on Node's V8Platform.
|
// been started at this point, so we have to rely on Node's V8Platform.
|
||||||
platform_ = node::CreatePlatform(
|
platform_ = node::CreatePlatform(
|
||||||
base::RecommendedMaxNumberOfThreadsInPool(3, 8, 0.1, 0),
|
base::RecommendedMaxNumberOfThreadsInPool(3, 8, 0.1, 0), nullptr);
|
||||||
uv_default_loop(), nullptr);
|
|
||||||
v8::V8::InitializePlatform(platform_);
|
v8::V8::InitializePlatform(platform_);
|
||||||
|
node::tracing::TraceEventHelper::SetTracingController(
|
||||||
|
new v8::TracingController());
|
||||||
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
|
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
|
||||||
gin::IsolateHolder::kStableV8Extras,
|
gin::IsolateHolder::kStableV8Extras,
|
||||||
gin::ArrayBufferAllocator::SharedInstance(),
|
gin::ArrayBufferAllocator::SharedInstance(),
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
namespace node {
|
namespace node {
|
||||||
class Environment;
|
class Environment;
|
||||||
class NodePlatform;
|
class MultiIsolatePlatform;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
@ -23,7 +23,7 @@ class JavascriptEnvironment {
|
||||||
void OnMessageLoopCreated();
|
void OnMessageLoopCreated();
|
||||||
void OnMessageLoopDestroying();
|
void OnMessageLoopDestroying();
|
||||||
|
|
||||||
node::NodePlatform* platform() const { return platform_; }
|
node::MultiIsolatePlatform* platform() const { return platform_; }
|
||||||
v8::Isolate* isolate() const { return isolate_; }
|
v8::Isolate* isolate() const { return isolate_; }
|
||||||
v8::Local<v8::Context> context() const {
|
v8::Local<v8::Context> context() const {
|
||||||
return v8::Local<v8::Context>::New(isolate_, context_);
|
return v8::Local<v8::Context>::New(isolate_, context_);
|
||||||
|
@ -33,7 +33,7 @@ class JavascriptEnvironment {
|
||||||
bool Initialize();
|
bool Initialize();
|
||||||
|
|
||||||
// Leaked on exit.
|
// Leaked on exit.
|
||||||
node::NodePlatform* platform_;
|
node::MultiIsolatePlatform* platform_;
|
||||||
|
|
||||||
bool initialized_;
|
bool initialized_;
|
||||||
gin::IsolateHolder isolate_holder_;
|
gin::IsolateHolder isolate_holder_;
|
||||||
|
|
|
@ -87,18 +87,17 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
||||||
|
|
||||||
id value = [dict objectForKey:key];
|
id value = [dict objectForKey:key];
|
||||||
if ([value isKindOfClass:[NSString class]]) {
|
if ([value isKindOfClass:[NSString class]]) {
|
||||||
result->SetStringWithoutPathExpansion(
|
result->SetKey(str_key, base::Value(base::SysNSStringToUTF8(value)));
|
||||||
str_key, base::SysNSStringToUTF8(value));
|
|
||||||
} else if ([value isKindOfClass:[NSNumber class]]) {
|
} else if ([value isKindOfClass:[NSNumber class]]) {
|
||||||
const char* objc_type = [value objCType];
|
const char* objc_type = [value objCType];
|
||||||
if (strcmp(objc_type, @encode(BOOL)) == 0 ||
|
if (strcmp(objc_type, @encode(BOOL)) == 0 ||
|
||||||
strcmp(objc_type, @encode(char)) == 0)
|
strcmp(objc_type, @encode(char)) == 0)
|
||||||
result->SetBooleanWithoutPathExpansion(str_key, [value boolValue]);
|
result->SetKey(str_key, base::Value([value boolValue]));
|
||||||
else if (strcmp(objc_type, @encode(double)) == 0 ||
|
else if (strcmp(objc_type, @encode(double)) == 0 ||
|
||||||
strcmp(objc_type, @encode(float)) == 0)
|
strcmp(objc_type, @encode(float)) == 0)
|
||||||
result->SetDoubleWithoutPathExpansion(str_key, [value doubleValue]);
|
result->SetKey(str_key, base::Value([value doubleValue]));
|
||||||
else
|
else
|
||||||
result->SetIntegerWithoutPathExpansion(str_key, [value intValue]);
|
result->SetKey(str_key, base::Value([value intValue]));
|
||||||
} else if ([value isKindOfClass:[NSArray class]]) {
|
} else if ([value isKindOfClass:[NSArray class]]) {
|
||||||
std::unique_ptr<base::ListValue> sub_arr = NSArrayToListValue(value);
|
std::unique_ptr<base::ListValue> sub_arr = NSArrayToListValue(value);
|
||||||
if (sub_arr)
|
if (sub_arr)
|
||||||
|
@ -115,9 +114,8 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
||||||
result->SetWithoutPathExpansion(str_key,
|
result->SetWithoutPathExpansion(str_key,
|
||||||
base::MakeUnique<base::Value>());
|
base::MakeUnique<base::Value>());
|
||||||
} else {
|
} else {
|
||||||
result->SetStringWithoutPathExpansion(
|
result->SetKey(str_key,
|
||||||
str_key,
|
base::Value(base::SysNSStringToUTF8([value description])));
|
||||||
base::SysNSStringToUTF8([value description]));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
// Copyright (c) 2016 GitHub, Inc.
|
|
||||||
// Use of this source code is governed by the MIT license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#include "atom/browser/net/atom_cookie_delegate.h"
|
|
||||||
|
|
||||||
#include "content/public/browser/browser_thread.h"
|
|
||||||
|
|
||||||
namespace atom {
|
|
||||||
|
|
||||||
AtomCookieDelegate::AtomCookieDelegate() {
|
|
||||||
}
|
|
||||||
|
|
||||||
AtomCookieDelegate::~AtomCookieDelegate() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void AtomCookieDelegate::AddObserver(Observer* observer) {
|
|
||||||
observers_.AddObserver(observer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AtomCookieDelegate::RemoveObserver(Observer* observer) {
|
|
||||||
observers_.RemoveObserver(observer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AtomCookieDelegate::NotifyObservers(
|
|
||||||
const net::CanonicalCookie& cookie,
|
|
||||||
bool removed,
|
|
||||||
net::CookieStore::ChangeCause cause) {
|
|
||||||
for (Observer& observer : observers_)
|
|
||||||
observer.OnCookieChanged(cookie, removed, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AtomCookieDelegate::OnCookieChanged(
|
|
||||||
const net::CanonicalCookie& cookie,
|
|
||||||
bool removed,
|
|
||||||
net::CookieStore::ChangeCause cause) {
|
|
||||||
content::BrowserThread::PostTask(
|
|
||||||
content::BrowserThread::UI,
|
|
||||||
FROM_HERE,
|
|
||||||
base::Bind(&AtomCookieDelegate::NotifyObservers,
|
|
||||||
this, cookie, removed, cause));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace atom
|
|
|
@ -1,48 +0,0 @@
|
||||||
// Copyright (c) 2016 GitHub, Inc.
|
|
||||||
// Use of this source code is governed by the MIT license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef ATOM_BROWSER_NET_ATOM_COOKIE_DELEGATE_H_
|
|
||||||
#define ATOM_BROWSER_NET_ATOM_COOKIE_DELEGATE_H_
|
|
||||||
|
|
||||||
#include "base/observer_list.h"
|
|
||||||
#include "net/cookies/cookie_monster.h"
|
|
||||||
|
|
||||||
namespace atom {
|
|
||||||
|
|
||||||
class AtomCookieDelegate : public net::CookieMonsterDelegate {
|
|
||||||
public:
|
|
||||||
AtomCookieDelegate();
|
|
||||||
~AtomCookieDelegate() override;
|
|
||||||
|
|
||||||
class Observer {
|
|
||||||
public:
|
|
||||||
virtual void OnCookieChanged(const net::CanonicalCookie& cookie,
|
|
||||||
bool removed,
|
|
||||||
net::CookieStore::ChangeCause cause) {}
|
|
||||||
protected:
|
|
||||||
virtual ~Observer() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
void AddObserver(Observer* observer);
|
|
||||||
void RemoveObserver(Observer* observer);
|
|
||||||
|
|
||||||
// net::CookieMonsterDelegate:
|
|
||||||
void OnCookieChanged(const net::CanonicalCookie& cookie,
|
|
||||||
bool removed,
|
|
||||||
net::CookieStore::ChangeCause cause) override;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
base::ObserverList<Observer> observers_;
|
|
||||||
|
|
||||||
void NotifyObservers(const net::CanonicalCookie& cookie,
|
|
||||||
bool removed,
|
|
||||||
net::CookieStore::ChangeCause cause);
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomCookieDelegate);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace atom
|
|
||||||
|
|
||||||
#endif // ATOM_BROWSER_NET_ATOM_COOKIE_DELEGATE_H_
|
|
|
@ -108,7 +108,7 @@ void ToDictionary(base::DictionaryValue* details,
|
||||||
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
||||||
net::HttpRequestHeaders::Iterator it(headers);
|
net::HttpRequestHeaders::Iterator it(headers);
|
||||||
while (it.GetNext())
|
while (it.GetNext())
|
||||||
dict->SetStringWithoutPathExpansion(it.name(), it.value());
|
dict->SetKey(it.name(), base::Value(it.value()));
|
||||||
details->Set("requestHeaders", std::move(dict));
|
details->Set("requestHeaders", std::move(dict));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
27
atom/browser/net/cookie_details.h
Normal file
27
atom/browser/net/cookie_details.h
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright (c) 2017 GitHub, Inc.
|
||||||
|
// Use of this source code is governed by the MIT license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef ATOM_BROWSER_NET_COOKIE_DETAILS_H_
|
||||||
|
#define ATOM_BROWSER_NET_COOKIE_DETAILS_H_
|
||||||
|
|
||||||
|
#include "base/macros.h"
|
||||||
|
#include "net/cookies/cookie_store.h"
|
||||||
|
|
||||||
|
namespace atom {
|
||||||
|
|
||||||
|
struct CookieDetails {
|
||||||
|
public:
|
||||||
|
CookieDetails(const net::CanonicalCookie* cookie_copy,
|
||||||
|
bool is_removed,
|
||||||
|
net::CookieStore::ChangeCause cause)
|
||||||
|
: cookie(cookie_copy), removed(is_removed), cause(cause) {}
|
||||||
|
|
||||||
|
const net::CanonicalCookie* cookie;
|
||||||
|
bool removed;
|
||||||
|
net::CookieStore::ChangeCause cause;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace atom
|
||||||
|
|
||||||
|
#endif // ATOM_BROWSER_NET_COOKIE_DETAILS_H_
|
|
@ -20,7 +20,7 @@ NodeDebugger::NodeDebugger(node::Environment* env)
|
||||||
NodeDebugger::~NodeDebugger() {
|
NodeDebugger::~NodeDebugger() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeDebugger::Start(node::NodePlatform* platform) {
|
void NodeDebugger::Start(node::MultiIsolatePlatform* platform) {
|
||||||
auto inspector = env_->inspector_agent();
|
auto inspector = env_->inspector_agent();
|
||||||
if (inspector == nullptr)
|
if (inspector == nullptr)
|
||||||
return;
|
return;
|
||||||
|
@ -34,16 +34,16 @@ void NodeDebugger::Start(node::NodePlatform* platform) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.inspector_enabled()) {
|
// Set process._debugWaitConnect if --inspect-brk was specified to stop
|
||||||
// Set process._debugWaitConnect if --inspect-brk was specified to stop
|
// the debugger on the first line
|
||||||
// the debugger on the first line
|
if (options.wait_for_connect()) {
|
||||||
if (options.wait_for_connect()) {
|
mate::Dictionary process(env_->isolate(), env_->process_object());
|
||||||
mate::Dictionary process(env_->isolate(), env_->process_object());
|
process.Set("_breakFirstLine", true);
|
||||||
process.Set("_breakFirstLine", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
inspector->Start(platform, nullptr, options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inspector->Start(static_cast<node::NodePlatform*>(platform), nullptr,
|
||||||
|
options);
|
||||||
|
DCHECK(env_->inspector_agent()->IsStarted());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
namespace node {
|
namespace node {
|
||||||
class Environment;
|
class Environment;
|
||||||
class NodePlatform;
|
class MultiIsolatePlatform;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
@ -20,7 +20,7 @@ class NodeDebugger {
|
||||||
explicit NodeDebugger(node::Environment* env);
|
explicit NodeDebugger(node::Environment* env);
|
||||||
~NodeDebugger();
|
~NodeDebugger();
|
||||||
|
|
||||||
void Start(node::NodePlatform* platform);
|
void Start(node::MultiIsolatePlatform* platform);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
node::Environment* env_;
|
node::Environment* env_;
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
#include "base/memory/ptr_util.h"
|
#include "base/memory/ptr_util.h"
|
||||||
#include "base/single_thread_task_runner.h"
|
#include "base/single_thread_task_runner.h"
|
||||||
#include "base/time/time.h"
|
#include "base/time/time.h"
|
||||||
#include "cc/output/copy_output_request.h"
|
#include "components/viz/common/frame_sinks/delay_based_time_source.h"
|
||||||
#include "cc/scheduler/delay_based_time_source.h"
|
|
||||||
#include "components/viz/common/gl_helper.h"
|
#include "components/viz/common/gl_helper.h"
|
||||||
|
#include "components/viz/common/quads/copy_output_request.h"
|
||||||
#include "content/browser/renderer_host/compositor_resize_lock.h"
|
#include "content/browser/renderer_host/compositor_resize_lock.h"
|
||||||
#include "content/browser/renderer_host/render_widget_host_delegate.h"
|
#include "content/browser/renderer_host/render_widget_host_delegate.h"
|
||||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||||
|
@ -127,11 +127,11 @@ class AtomCopyFrameGenerator {
|
||||||
if (!view_->render_widget_host() || !view_->IsPainting())
|
if (!view_->render_widget_host() || !view_->IsPainting())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::unique_ptr<cc::CopyOutputRequest> request =
|
std::unique_ptr<viz::CopyOutputRequest> request =
|
||||||
cc::CopyOutputRequest::CreateBitmapRequest(base::Bind(
|
viz::CopyOutputRequest::CreateBitmapRequest(base::Bind(
|
||||||
&AtomCopyFrameGenerator::CopyFromCompositingSurfaceHasResult,
|
&AtomCopyFrameGenerator::CopyFromCompositingSurfaceHasResult,
|
||||||
weak_ptr_factory_.GetWeakPtr(),
|
weak_ptr_factory_.GetWeakPtr(),
|
||||||
damage_rect));
|
damage_rect));
|
||||||
|
|
||||||
request->set_area(gfx::Rect(view_->GetPhysicalBackingSize()));
|
request->set_area(gfx::Rect(view_->GetPhysicalBackingSize()));
|
||||||
view_->GetRootLayer()->RequestCopyOfOutput(std::move(request));
|
view_->GetRootLayer()->RequestCopyOfOutput(std::move(request));
|
||||||
|
@ -145,7 +145,7 @@ class AtomCopyFrameGenerator {
|
||||||
private:
|
private:
|
||||||
void CopyFromCompositingSurfaceHasResult(
|
void CopyFromCompositingSurfaceHasResult(
|
||||||
const gfx::Rect& damage_rect,
|
const gfx::Rect& damage_rect,
|
||||||
std::unique_ptr<cc::CopyOutputResult> result) {
|
std::unique_ptr<viz::CopyOutputResult> result) {
|
||||||
if (result->IsEmpty() || result->size().IsEmpty() ||
|
if (result->IsEmpty() || result->size().IsEmpty() ||
|
||||||
!view_->render_widget_host()) {
|
!view_->render_widget_host()) {
|
||||||
OnCopyFrameCaptureFailure(damage_rect);
|
OnCopyFrameCaptureFailure(damage_rect);
|
||||||
|
@ -214,12 +214,12 @@ class AtomCopyFrameGenerator {
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomCopyFrameGenerator);
|
DISALLOW_COPY_AND_ASSIGN(AtomCopyFrameGenerator);
|
||||||
};
|
};
|
||||||
|
|
||||||
class AtomBeginFrameTimer : public cc::DelayBasedTimeSourceClient {
|
class AtomBeginFrameTimer : public viz::DelayBasedTimeSourceClient {
|
||||||
public:
|
public:
|
||||||
AtomBeginFrameTimer(int frame_rate_threshold_us,
|
AtomBeginFrameTimer(int frame_rate_threshold_us,
|
||||||
const base::Closure& callback)
|
const base::Closure& callback)
|
||||||
: callback_(callback) {
|
: callback_(callback) {
|
||||||
time_source_.reset(new cc::DelayBasedTimeSource(
|
time_source_.reset(new viz::DelayBasedTimeSource(
|
||||||
content::BrowserThread::GetTaskRunnerForThread(
|
content::BrowserThread::GetTaskRunnerForThread(
|
||||||
content::BrowserThread::UI).get()));
|
content::BrowserThread::UI).get()));
|
||||||
time_source_->SetTimebaseAndInterval(
|
time_source_->SetTimebaseAndInterval(
|
||||||
|
@ -248,7 +248,7 @@ class AtomBeginFrameTimer : public cc::DelayBasedTimeSourceClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
const base::Closure callback_;
|
const base::Closure callback_;
|
||||||
std::unique_ptr<cc::DelayBasedTimeSource> time_source_;
|
std::unique_ptr<viz::DelayBasedTimeSource> time_source_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomBeginFrameTimer);
|
DISALLOW_COPY_AND_ASSIGN(AtomBeginFrameTimer);
|
||||||
};
|
};
|
||||||
|
@ -303,9 +303,13 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
|
||||||
ui::ContextFactoryPrivate* context_factory_private =
|
ui::ContextFactoryPrivate* context_factory_private =
|
||||||
factory->GetContextFactoryPrivate();
|
factory->GetContextFactoryPrivate();
|
||||||
compositor_.reset(
|
compositor_.reset(
|
||||||
new ui::Compositor(context_factory_private->AllocateFrameSinkId(),
|
new ui::Compositor(
|
||||||
content::GetContextFactory(), context_factory_private,
|
context_factory_private->AllocateFrameSinkId(),
|
||||||
base::ThreadTaskRunnerHandle::Get(), false));
|
content::GetContextFactory(),
|
||||||
|
context_factory_private,
|
||||||
|
base::ThreadTaskRunnerHandle::Get(),
|
||||||
|
false /* enable_surface_synchronization */,
|
||||||
|
false /* enable_pixel_canvas */));
|
||||||
compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
|
compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
|
||||||
compositor_->SetRootLayer(root_layer_.get());
|
compositor_->SetRootLayer(root_layer_.get());
|
||||||
#endif
|
#endif
|
||||||
|
@ -373,11 +377,11 @@ void OffScreenRenderWidgetHostView::SendBeginFrame(
|
||||||
|
|
||||||
base::TimeTicks deadline = display_time - estimated_browser_composite_time;
|
base::TimeTicks deadline = display_time - estimated_browser_composite_time;
|
||||||
|
|
||||||
const cc::BeginFrameArgs& begin_frame_args =
|
const viz::BeginFrameArgs& begin_frame_args =
|
||||||
cc::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE,
|
viz::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE,
|
||||||
begin_frame_source_.source_id(),
|
begin_frame_source_.source_id(),
|
||||||
begin_frame_number_, frame_time, deadline,
|
begin_frame_number_, frame_time, deadline,
|
||||||
vsync_period, cc::BeginFrameArgs::NORMAL);
|
vsync_period, viz::BeginFrameArgs::NORMAL);
|
||||||
DCHECK(begin_frame_args.IsValid());
|
DCHECK(begin_frame_args.IsValid());
|
||||||
begin_frame_number_++;
|
begin_frame_number_++;
|
||||||
|
|
||||||
|
@ -530,7 +534,7 @@ void OffScreenRenderWidgetHostView::UnlockMouse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OffScreenRenderWidgetHostView::DidCreateNewRendererCompositorFrameSink(
|
void OffScreenRenderWidgetHostView::DidCreateNewRendererCompositorFrameSink(
|
||||||
cc::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) {
|
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) {
|
||||||
renderer_compositor_frame_sink_ = renderer_compositor_frame_sink;
|
renderer_compositor_frame_sink_ = renderer_compositor_frame_sink;
|
||||||
if (GetDelegatedFrameHost()) {
|
if (GetDelegatedFrameHost()) {
|
||||||
GetDelegatedFrameHost()->DidCreateNewRendererCompositorFrameSink(
|
GetDelegatedFrameHost()->DidCreateNewRendererCompositorFrameSink(
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
#include "base/threading/thread.h"
|
#include "base/threading/thread.h"
|
||||||
#include "base/time/time.h"
|
#include "base/time/time.h"
|
||||||
#include "cc/output/compositor_frame.h"
|
#include "cc/output/compositor_frame.h"
|
||||||
#include "cc/scheduler/begin_frame_source.h"
|
#include "components/viz/common/frame_sinks/begin_frame_args.h"
|
||||||
|
#include "components/viz/common/frame_sinks/begin_frame_source.h"
|
||||||
#include "content/browser/frame_host/render_widget_host_view_guest.h"
|
#include "content/browser/frame_host/render_widget_host_view_guest.h"
|
||||||
#include "content/browser/renderer_host/compositor_resize_lock.h"
|
#include "content/browser/renderer_host/compositor_resize_lock.h"
|
||||||
#include "content/browser/renderer_host/delegated_frame_host.h"
|
#include "content/browser/renderer_host/delegated_frame_host.h"
|
||||||
|
@ -118,7 +119,7 @@ class OffScreenRenderWidgetHostView
|
||||||
|
|
||||||
// content::RenderWidgetHostViewBase:
|
// content::RenderWidgetHostViewBase:
|
||||||
void DidCreateNewRendererCompositorFrameSink(
|
void DidCreateNewRendererCompositorFrameSink(
|
||||||
cc::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink)
|
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink)
|
||||||
override;
|
override;
|
||||||
void SubmitCompositorFrame(const viz::LocalSurfaceId& local_surface_id,
|
void SubmitCompositorFrame(const viz::LocalSurfaceId& local_surface_id,
|
||||||
cc::CompositorFrame frame) override;
|
cc::CompositorFrame frame) override;
|
||||||
|
@ -327,8 +328,8 @@ class OffScreenRenderWidgetHostView
|
||||||
std::unique_ptr<AtomBeginFrameTimer> begin_frame_timer_;
|
std::unique_ptr<AtomBeginFrameTimer> begin_frame_timer_;
|
||||||
|
|
||||||
// Provides |source_id| for BeginFrameArgs that we create.
|
// Provides |source_id| for BeginFrameArgs that we create.
|
||||||
cc::StubBeginFrameSource begin_frame_source_;
|
viz::StubBeginFrameSource begin_frame_source_;
|
||||||
uint64_t begin_frame_number_ = cc::BeginFrameArgs::kStartingFrameNumber;
|
uint64_t begin_frame_number_ = viz::BeginFrameArgs::kStartingFrameNumber;
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
CALayer* background_layer_;
|
CALayer* background_layer_;
|
||||||
|
@ -342,7 +343,7 @@ class OffScreenRenderWidgetHostView
|
||||||
std::string selected_text_;
|
std::string selected_text_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cc::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_;
|
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_;
|
||||||
|
|
||||||
SkColor background_color_;
|
SkColor background_color_;
|
||||||
|
|
||||||
|
|
|
@ -87,15 +87,12 @@ bool RelaunchAppWithHelper(const base::FilePath& helper,
|
||||||
internal::kRelauncherSyncFD != STDOUT_FILENO &&
|
internal::kRelauncherSyncFD != STDOUT_FILENO &&
|
||||||
internal::kRelauncherSyncFD != STDERR_FILENO,
|
internal::kRelauncherSyncFD != STDERR_FILENO,
|
||||||
"kRelauncherSyncFD must not conflict with stdio fds");
|
"kRelauncherSyncFD must not conflict with stdio fds");
|
||||||
|
|
||||||
base::FileHandleMappingVector fd_map;
|
|
||||||
fd_map.push_back(
|
|
||||||
std::make_pair(pipe_write_fd.get(), internal::kRelauncherSyncFD));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
base::LaunchOptions options;
|
base::LaunchOptions options;
|
||||||
#if defined(OS_POSIX)
|
#if defined(OS_POSIX)
|
||||||
options.fds_to_remap = &fd_map;
|
options.fds_to_remap.push_back(
|
||||||
|
std::make_pair(pipe_write_fd.get(), internal::kRelauncherSyncFD));
|
||||||
base::Process process = base::LaunchProcess(relaunch_argv, options);
|
base::Process process = base::LaunchProcess(relaunch_argv, options);
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
base::Process process = base::LaunchProcess(
|
base::Process process = base::LaunchProcess(
|
||||||
|
|
|
@ -60,14 +60,13 @@ int LaunchProgram(const StringVector& relauncher_args,
|
||||||
// Redirect the stdout of child process to /dev/null, otherwise after
|
// Redirect the stdout of child process to /dev/null, otherwise after
|
||||||
// relaunch the child process will raise exception when writing to stdout.
|
// relaunch the child process will raise exception when writing to stdout.
|
||||||
base::ScopedFD devnull(HANDLE_EINTR(open("/dev/null", O_WRONLY)));
|
base::ScopedFD devnull(HANDLE_EINTR(open("/dev/null", O_WRONLY)));
|
||||||
base::FileHandleMappingVector no_stdout;
|
|
||||||
no_stdout.push_back(std::make_pair(devnull.get(), STDERR_FILENO));
|
|
||||||
no_stdout.push_back(std::make_pair(devnull.get(), STDOUT_FILENO));
|
|
||||||
|
|
||||||
base::LaunchOptions options;
|
base::LaunchOptions options;
|
||||||
options.allow_new_privs = true;
|
options.allow_new_privs = true;
|
||||||
options.new_process_group = true; // detach
|
options.new_process_group = true; // detach
|
||||||
options.fds_to_remap = &no_stdout;
|
options.fds_to_remap.push_back(std::make_pair(devnull.get(), STDERR_FILENO));
|
||||||
|
options.fds_to_remap.push_back(std::make_pair(devnull.get(), STDOUT_FILENO));
|
||||||
|
|
||||||
base::Process process = base::LaunchProcess(argv, options);
|
base::Process process = base::LaunchProcess(argv, options);
|
||||||
return process.IsValid() ? 0 : 1;
|
return process.IsValid() ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,13 +82,12 @@ int LaunchProgram(const StringVector& relauncher_args,
|
||||||
// Redirect the stdout of child process to /dev/null, otherwise after
|
// Redirect the stdout of child process to /dev/null, otherwise after
|
||||||
// relaunch the child process will raise exception when writing to stdout.
|
// relaunch the child process will raise exception when writing to stdout.
|
||||||
base::ScopedFD devnull(HANDLE_EINTR(open("/dev/null", O_WRONLY)));
|
base::ScopedFD devnull(HANDLE_EINTR(open("/dev/null", O_WRONLY)));
|
||||||
base::FileHandleMappingVector no_stdout;
|
|
||||||
no_stdout.push_back(std::make_pair(devnull.get(), STDERR_FILENO));
|
|
||||||
no_stdout.push_back(std::make_pair(devnull.get(), STDOUT_FILENO));
|
|
||||||
|
|
||||||
base::LaunchOptions options;
|
base::LaunchOptions options;
|
||||||
options.new_process_group = true; // detach
|
options.new_process_group = true; // detach
|
||||||
options.fds_to_remap = &no_stdout;
|
options.fds_to_remap.push_back(std::make_pair(devnull.get(), STDERR_FILENO));
|
||||||
|
options.fds_to_remap.push_back(std::make_pair(devnull.get(), STDOUT_FILENO));
|
||||||
|
|
||||||
base::Process process = base::LaunchProcess(argv, options);
|
base::Process process = base::LaunchProcess(argv, options);
|
||||||
return process.IsValid() ? 0 : 1;
|
return process.IsValid() ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ std::unique_ptr<views::InkDropRipple> SubmenuButton::CreateInkDropRipple()
|
||||||
|
|
||||||
std::unique_ptr<views::InkDrop> SubmenuButton::CreateInkDrop() {
|
std::unique_ptr<views::InkDrop> SubmenuButton::CreateInkDrop() {
|
||||||
std::unique_ptr<views::InkDropImpl> ink_drop =
|
std::unique_ptr<views::InkDropImpl> ink_drop =
|
||||||
CustomButton::CreateDefaultInkDropImpl();
|
views::Button::CreateDefaultInkDropImpl();
|
||||||
ink_drop->SetShowHighlightOnHover(false);
|
ink_drop->SetShowHighlightOnHover(false);
|
||||||
return std::move(ink_drop);
|
return std::move(ink_drop);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
#include "atom/browser/atom_browser_context.h"
|
#include "atom/browser/atom_browser_context.h"
|
||||||
#include "atom/browser/loader/layered_resource_handler.h"
|
#include "atom/browser/loader/layered_resource_handler.h"
|
||||||
#include "atom/browser/ui/webui/pdf_viewer_handler.h"
|
#include "atom/browser/ui/webui/pdf_viewer_handler.h"
|
||||||
|
#include "atom/common/api/api_messages.h"
|
||||||
#include "atom/common/atom_constants.h"
|
#include "atom/common/atom_constants.h"
|
||||||
#include "base/sequenced_task_runner_helpers.h"
|
#include "base/sequenced_task_runner_helpers.h"
|
||||||
#include "components/pdf/common/pdf_messages.h"
|
|
||||||
#include "content/browser/loader/resource_dispatcher_host_impl.h"
|
#include "content/browser/loader/resource_dispatcher_host_impl.h"
|
||||||
#include "content/browser/loader/resource_request_info_impl.h"
|
#include "content/browser/loader/resource_request_info_impl.h"
|
||||||
#include "content/browser/loader/stream_resource_handler.h"
|
#include "content/browser/loader/stream_resource_handler.h"
|
||||||
|
@ -217,7 +217,7 @@ bool PdfViewerUI::OnMessageReceived(
|
||||||
content::RenderFrameHost* render_frame_host) {
|
content::RenderFrameHost* render_frame_host) {
|
||||||
bool handled = true;
|
bool handled = true;
|
||||||
IPC_BEGIN_MESSAGE_MAP(PdfViewerUI, message)
|
IPC_BEGIN_MESSAGE_MAP(PdfViewerUI, message)
|
||||||
IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnSaveURLAs)
|
IPC_MESSAGE_HANDLER(AtomFrameHostMsg_PDFSaveURLAs, OnSaveURLAs)
|
||||||
IPC_MESSAGE_UNHANDLED(handled = false)
|
IPC_MESSAGE_UNHANDLED(handled = false)
|
||||||
IPC_END_MESSAGE_MAP()
|
IPC_END_MESSAGE_MAP()
|
||||||
return handled;
|
return handled;
|
||||||
|
|
|
@ -8,9 +8,11 @@
|
||||||
#include "base/strings/string16.h"
|
#include "base/strings/string16.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "content/public/common/common_param_traits.h"
|
#include "content/public/common/common_param_traits.h"
|
||||||
|
#include "content/public/common/referrer.h"
|
||||||
#include "ipc/ipc_message_macros.h"
|
#include "ipc/ipc_message_macros.h"
|
||||||
#include "ui/gfx/geometry/rect_f.h"
|
#include "ui/gfx/geometry/rect_f.h"
|
||||||
#include "ui/gfx/ipc/gfx_param_traits.h"
|
#include "ui/gfx/ipc/gfx_param_traits.h"
|
||||||
|
#include "url/gurl.h"
|
||||||
|
|
||||||
// The message starter should be declared in ipc/ipc_message_start.h. Since
|
// The message starter should be declared in ipc/ipc_message_start.h. Since
|
||||||
// we don't want to patch Chromium, we just pretend to be Content Shell.
|
// we don't want to patch Chromium, we just pretend to be Content Shell.
|
||||||
|
@ -62,3 +64,8 @@ IPC_SYNC_MESSAGE_ROUTED1_1(AtomViewHostMsg_SetTemporaryZoomLevel,
|
||||||
|
|
||||||
// Sent by renderer to get the zoom level.
|
// Sent by renderer to get the zoom level.
|
||||||
IPC_SYNC_MESSAGE_ROUTED0_1(AtomViewHostMsg_GetZoomLevel, double /* result */)
|
IPC_SYNC_MESSAGE_ROUTED0_1(AtomViewHostMsg_GetZoomLevel, double /* result */)
|
||||||
|
|
||||||
|
// Brings up SaveAs... dialog to save specified URL.
|
||||||
|
IPC_MESSAGE_ROUTED2(AtomFrameHostMsg_PDFSaveURLAs,
|
||||||
|
GURL /* url */,
|
||||||
|
content::Referrer /* referrer */)
|
||||||
|
|
|
@ -163,4 +163,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_asar, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_asar, Initialize)
|
||||||
|
|
|
@ -255,4 +255,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_clipboard, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_clipboard, Initialize)
|
||||||
|
|
|
@ -61,4 +61,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_crash_reporter, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_crash_reporter, Initialize)
|
||||||
|
|
|
@ -456,7 +456,7 @@ void NativeImage::AddRepresentation(const mate::Dictionary& options) {
|
||||||
// Re-initialize image when first representation is added to an empty image
|
// Re-initialize image when first representation is added to an empty image
|
||||||
if (skia_rep_added && IsEmpty()) {
|
if (skia_rep_added && IsEmpty()) {
|
||||||
gfx::Image image(image_skia);
|
gfx::Image image(image_skia);
|
||||||
image_.SwapRepresentations(&image);
|
image_ = std::move(image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -636,4 +636,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_native_image, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_native_image, Initialize)
|
||||||
|
|
|
@ -151,4 +151,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_shell, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_shell, Initialize)
|
||||||
|
|
|
@ -123,4 +123,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_v8_util, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_v8_util, Initialize)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#ifndef ATOM_COMMON_CHROME_VERSION_H_
|
#ifndef ATOM_COMMON_CHROME_VERSION_H_
|
||||||
#define ATOM_COMMON_CHROME_VERSION_H_
|
#define ATOM_COMMON_CHROME_VERSION_H_
|
||||||
|
|
||||||
#define CHROME_VERSION_STRING "61.0.3163.100"
|
#define CHROME_VERSION_STRING "62.0.3202.94"
|
||||||
#define CHROME_VERSION "v" CHROME_VERSION_STRING
|
#define CHROME_VERSION "v" CHROME_VERSION_STRING
|
||||||
|
|
||||||
#endif // ATOM_COMMON_CHROME_VERSION_H_
|
#endif // ATOM_COMMON_CHROME_VERSION_H_
|
||||||
|
|
|
@ -8,6 +8,4 @@
|
||||||
#include "chrome/common/print_messages.h"
|
#include "chrome/common/print_messages.h"
|
||||||
#include "chrome/common/tts_messages.h"
|
#include "chrome/common/tts_messages.h"
|
||||||
#include "chrome/common/widevine_cdm_messages.h"
|
#include "chrome/common/widevine_cdm_messages.h"
|
||||||
#include "chrome/common/chrome_utility_messages.h"
|
|
||||||
#include "chrome/common/chrome_utility_printing_messages.h"
|
#include "chrome/common/chrome_utility_printing_messages.h"
|
||||||
#include "components/pdf/common/pdf_messages.h"
|
|
||||||
|
|
|
@ -221,16 +221,16 @@ Converter<scoped_refptr<ResourceRequestBody>>::ToV8(
|
||||||
post_data_dict->Set("bytes", std::move(bytes));
|
post_data_dict->Set("bytes", std::move(bytes));
|
||||||
} else if (type == ResourceRequestBody::Element::TYPE_FILE) {
|
} else if (type == ResourceRequestBody::Element::TYPE_FILE) {
|
||||||
post_data_dict->SetString("type", "file");
|
post_data_dict->SetString("type", "file");
|
||||||
post_data_dict->SetStringWithoutPathExpansion(
|
post_data_dict->SetKey("filePath",
|
||||||
"filePath", element.path().AsUTF8Unsafe());
|
base::Value(element.path().AsUTF8Unsafe()));
|
||||||
post_data_dict->SetInteger("offset", static_cast<int>(element.offset()));
|
post_data_dict->SetInteger("offset", static_cast<int>(element.offset()));
|
||||||
post_data_dict->SetInteger("length", static_cast<int>(element.length()));
|
post_data_dict->SetInteger("length", static_cast<int>(element.length()));
|
||||||
post_data_dict->SetDouble(
|
post_data_dict->SetDouble(
|
||||||
"modificationTime", element.expected_modification_time().ToDoubleT());
|
"modificationTime", element.expected_modification_time().ToDoubleT());
|
||||||
} else if (type == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) {
|
} else if (type == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) {
|
||||||
post_data_dict->SetString("type", "fileSystem");
|
post_data_dict->SetString("type", "fileSystem");
|
||||||
post_data_dict->SetStringWithoutPathExpansion(
|
post_data_dict->SetKey("fileSystemURL",
|
||||||
"fileSystemURL", element.filesystem_url().spec());
|
base::Value(element.filesystem_url().spec()));
|
||||||
post_data_dict->SetInteger("offset", static_cast<int>(element.offset()));
|
post_data_dict->SetInteger("offset", static_cast<int>(element.offset()));
|
||||||
post_data_dict->SetInteger("length", static_cast<int>(element.length()));
|
post_data_dict->SetInteger("length", static_cast<int>(element.length()));
|
||||||
post_data_dict->SetDouble(
|
post_data_dict->SetDouble(
|
||||||
|
|
|
@ -203,7 +203,7 @@ void FillRequestDetails(base::DictionaryValue* details,
|
||||||
details->SetString("method", request->method());
|
details->SetString("method", request->method());
|
||||||
std::string url;
|
std::string url;
|
||||||
if (!request->url_chain().empty()) url = request->url().spec();
|
if (!request->url_chain().empty()) url = request->url().spec();
|
||||||
details->SetStringWithoutPathExpansion("url", url);
|
details->SetKey("url", base::Value(url));
|
||||||
details->SetString("referrer", request->referrer());
|
details->SetString("referrer", request->referrer());
|
||||||
std::unique_ptr<base::ListValue> list(new base::ListValue);
|
std::unique_ptr<base::ListValue> list(new base::ListValue);
|
||||||
GetUploadData(list.get(), request);
|
GetUploadData(list.get(), request);
|
||||||
|
@ -239,7 +239,7 @@ void GetUploadData(base::ListValue* upload_data_list,
|
||||||
const net::UploadFileElementReader* file_reader =
|
const net::UploadFileElementReader* file_reader =
|
||||||
reader->AsFileReader();
|
reader->AsFileReader();
|
||||||
auto file_path = file_reader->path().AsUTF8Unsafe();
|
auto file_path = file_reader->path().AsUTF8Unsafe();
|
||||||
upload_data_dict->SetStringWithoutPathExpansion("file", file_path);
|
upload_data_dict->SetKey("file", base::Value(file_path));
|
||||||
} else {
|
} else {
|
||||||
const storage::UploadBlobElementReader* blob_reader =
|
const storage::UploadBlobElementReader* blob_reader =
|
||||||
static_cast<storage::UploadBlobElementReader*>(reader.get());
|
static_cast<storage::UploadBlobElementReader*>(reader.get());
|
||||||
|
|
|
@ -27,45 +27,48 @@
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
|
|
||||||
// Force all builtin modules to be referenced so they can actually run their
|
#define ELECTRON_BUILTIN_MODULES(V) \
|
||||||
// DSO constructors, see http://git.io/DRIqCg.
|
V(atom_browser_app) \
|
||||||
#define REFERENCE_MODULE(name) \
|
V(atom_browser_auto_updater) \
|
||||||
extern "C" void _register_ ## name(void); \
|
V(atom_browser_browser_view) \
|
||||||
void (*fp_register_ ## name)(void) = _register_ ## name
|
V(atom_browser_content_tracing) \
|
||||||
// Electron's builtin modules.
|
V(atom_browser_debugger) \
|
||||||
REFERENCE_MODULE(atom_browser_app);
|
V(atom_browser_desktop_capturer) \
|
||||||
REFERENCE_MODULE(atom_browser_auto_updater);
|
V(atom_browser_dialog) \
|
||||||
REFERENCE_MODULE(atom_browser_browser_view);
|
V(atom_browser_download_item) \
|
||||||
REFERENCE_MODULE(atom_browser_content_tracing);
|
V(atom_browser_global_shortcut) \
|
||||||
REFERENCE_MODULE(atom_browser_debugger);
|
V(atom_browser_in_app_purchase) \
|
||||||
REFERENCE_MODULE(atom_browser_desktop_capturer);
|
V(atom_browser_menu) \
|
||||||
REFERENCE_MODULE(atom_browser_dialog);
|
V(atom_browser_net) \
|
||||||
REFERENCE_MODULE(atom_browser_download_item);
|
V(atom_browser_power_monitor) \
|
||||||
REFERENCE_MODULE(atom_browser_global_shortcut);
|
V(atom_browser_power_save_blocker) \
|
||||||
REFERENCE_MODULE(atom_browser_in_app_purchase);
|
V(atom_browser_protocol) \
|
||||||
REFERENCE_MODULE(atom_browser_menu);
|
V(atom_browser_render_process_preferences) \
|
||||||
REFERENCE_MODULE(atom_browser_net);
|
V(atom_browser_session) \
|
||||||
REFERENCE_MODULE(atom_browser_power_monitor);
|
V(atom_browser_system_preferences) \
|
||||||
REFERENCE_MODULE(atom_browser_power_save_blocker);
|
V(atom_browser_tray) \
|
||||||
REFERENCE_MODULE(atom_browser_protocol);
|
V(atom_browser_web_contents) \
|
||||||
REFERENCE_MODULE(atom_browser_render_process_preferences);
|
V(atom_browser_web_view_manager) \
|
||||||
REFERENCE_MODULE(atom_browser_session);
|
V(atom_browser_window) \
|
||||||
REFERENCE_MODULE(atom_browser_system_preferences);
|
V(atom_common_asar) \
|
||||||
REFERENCE_MODULE(atom_browser_tray);
|
V(atom_common_clipboard) \
|
||||||
REFERENCE_MODULE(atom_browser_web_contents);
|
V(atom_common_crash_reporter) \
|
||||||
REFERENCE_MODULE(atom_browser_web_view_manager);
|
V(atom_common_native_image) \
|
||||||
REFERENCE_MODULE(atom_browser_window);
|
V(atom_common_notification) \
|
||||||
REFERENCE_MODULE(atom_common_asar);
|
V(atom_common_screen) \
|
||||||
REFERENCE_MODULE(atom_common_clipboard);
|
V(atom_common_shell) \
|
||||||
REFERENCE_MODULE(atom_common_crash_reporter);
|
V(atom_common_v8_util) \
|
||||||
REFERENCE_MODULE(atom_common_native_image);
|
V(atom_renderer_ipc) \
|
||||||
REFERENCE_MODULE(atom_common_notification);
|
V(atom_renderer_web_frame)
|
||||||
REFERENCE_MODULE(atom_common_screen);
|
|
||||||
REFERENCE_MODULE(atom_common_shell);
|
// This is used to load built-in modules. Instead of using
|
||||||
REFERENCE_MODULE(atom_common_v8_util);
|
// __attribute__((constructor)), we call the _register_<modname>
|
||||||
REFERENCE_MODULE(atom_renderer_ipc);
|
// function for each built-in modules explicitly. This is only
|
||||||
REFERENCE_MODULE(atom_renderer_web_frame);
|
// forward declaration. The definitions are in each module's
|
||||||
#undef REFERENCE_MODULE
|
// implementation when calling the NODE_BUILTIN_MODULE_CONTEXT_AWARE.
|
||||||
|
#define V(modname) void _register_##modname();
|
||||||
|
ELECTRON_BUILTIN_MODULES(V)
|
||||||
|
#undef V
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -155,6 +158,12 @@ NodeBindings::~NodeBindings() {
|
||||||
stop_and_close_uv_loop(uv_loop_);
|
stop_and_close_uv_loop(uv_loop_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NodeBindings::RegisterBuiltinModules() {
|
||||||
|
#define V(modname) _register_##modname();
|
||||||
|
ELECTRON_BUILTIN_MODULES(V)
|
||||||
|
#undef V
|
||||||
|
}
|
||||||
|
|
||||||
void NodeBindings::Initialize() {
|
void NodeBindings::Initialize() {
|
||||||
// Open node's error reporting system for browser process.
|
// Open node's error reporting system for browser process.
|
||||||
node::g_standalone_mode = browser_env_ == BROWSER;
|
node::g_standalone_mode = browser_env_ == BROWSER;
|
||||||
|
@ -166,6 +175,9 @@ void NodeBindings::Initialize() {
|
||||||
AtomCommandLine::InitializeFromCommandLine();
|
AtomCommandLine::InitializeFromCommandLine();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Explicitly register electron's builtin modules.
|
||||||
|
RegisterBuiltinModules();
|
||||||
|
|
||||||
// Init node.
|
// Init node.
|
||||||
// (we assume node::Init would not modify the parameters under embedded mode).
|
// (we assume node::Init would not modify the parameters under embedded mode).
|
||||||
node::Init(nullptr, nullptr, nullptr, nullptr);
|
node::Init(nullptr, nullptr, nullptr, nullptr);
|
||||||
|
@ -180,7 +192,8 @@ void NodeBindings::Initialize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
node::Environment* NodeBindings::CreateEnvironment(
|
node::Environment* NodeBindings::CreateEnvironment(
|
||||||
v8::Handle<v8::Context> context) {
|
v8::Handle<v8::Context> context,
|
||||||
|
node::MultiIsolatePlatform* platform) {
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
auto& atom_args = AtomCommandLine::argv();
|
auto& atom_args = AtomCommandLine::argv();
|
||||||
std::vector<std::string> args(atom_args.size());
|
std::vector<std::string> args(atom_args.size());
|
||||||
|
@ -212,8 +225,8 @@ node::Environment* NodeBindings::CreateEnvironment(
|
||||||
|
|
||||||
std::unique_ptr<const char*[]> c_argv = StringVectorToArgArray(args);
|
std::unique_ptr<const char*[]> c_argv = StringVectorToArgArray(args);
|
||||||
node::Environment* env = node::CreateEnvironment(
|
node::Environment* env = node::CreateEnvironment(
|
||||||
new node::IsolateData(context->GetIsolate(), uv_loop_), context,
|
node::CreateIsolateData(context->GetIsolate(), uv_loop_, platform),
|
||||||
args.size(), c_argv.get(), 0, nullptr);
|
context, args.size(), c_argv.get(), 0, nullptr);
|
||||||
|
|
||||||
if (browser_env_ == BROWSER) {
|
if (browser_env_ == BROWSER) {
|
||||||
// SetAutorunMicrotasks is no longer called in node::CreateEnvironment
|
// SetAutorunMicrotasks is no longer called in node::CreateEnvironment
|
||||||
|
|
|
@ -17,6 +17,7 @@ class MessageLoop;
|
||||||
|
|
||||||
namespace node {
|
namespace node {
|
||||||
class Environment;
|
class Environment;
|
||||||
|
class MultiIsolatePlatform;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
@ -30,6 +31,7 @@ class NodeBindings {
|
||||||
};
|
};
|
||||||
|
|
||||||
static NodeBindings* Create(BrowserEnvironment browser_env);
|
static NodeBindings* Create(BrowserEnvironment browser_env);
|
||||||
|
static void RegisterBuiltinModules();
|
||||||
|
|
||||||
virtual ~NodeBindings();
|
virtual ~NodeBindings();
|
||||||
|
|
||||||
|
@ -37,7 +39,9 @@ class NodeBindings {
|
||||||
void Initialize();
|
void Initialize();
|
||||||
|
|
||||||
// Create the environment and load node.js.
|
// Create the environment and load node.js.
|
||||||
node::Environment* CreateEnvironment(v8::Handle<v8::Context> context);
|
node::Environment* CreateEnvironment(
|
||||||
|
v8::Handle<v8::Context> context,
|
||||||
|
node::MultiIsolatePlatform* platform = nullptr);
|
||||||
|
|
||||||
// Load node.js in the environment.
|
// Load node.js in the environment.
|
||||||
void LoadEnvironment(node::Environment* env);
|
void LoadEnvironment(node::Environment* env);
|
||||||
|
|
|
@ -76,4 +76,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_renderer_ipc, atom::api::Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_renderer_ipc, atom::api::Initialize)
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "third_party/WebKit/public/platform/WebCache.h"
|
#include "third_party/WebKit/public/platform/WebCache.h"
|
||||||
#include "third_party/WebKit/public/web/WebDocument.h"
|
#include "third_party/WebKit/public/web/WebDocument.h"
|
||||||
#include "third_party/WebKit/public/web/WebFrameWidget.h"
|
#include "third_party/WebKit/public/web/WebFrameWidget.h"
|
||||||
|
#include "third_party/WebKit/public/web/WebImeTextSpan.h"
|
||||||
#include "third_party/WebKit/public/web/WebInputMethodController.h"
|
#include "third_party/WebKit/public/web/WebInputMethodController.h"
|
||||||
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
||||||
#include "third_party/WebKit/public/web/WebScriptExecutionCallback.h"
|
#include "third_party/WebKit/public/web/WebScriptExecutionCallback.h"
|
||||||
|
@ -263,7 +264,7 @@ void WebFrame::InsertText(const std::string& text) {
|
||||||
web_frame_->FrameWidget()
|
web_frame_->FrameWidget()
|
||||||
->GetActiveWebInputMethodController()
|
->GetActiveWebInputMethodController()
|
||||||
->CommitText(blink::WebString::FromUTF8(text),
|
->CommitText(blink::WebString::FromUTF8(text),
|
||||||
blink::WebVector<blink::WebCompositionUnderline>(),
|
blink::WebVector<blink::WebImeTextSpan>(),
|
||||||
blink::WebRange(),
|
blink::WebRange(),
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
@ -428,4 +429,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_renderer_web_frame, Initialize)
|
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_renderer_web_frame, Initialize)
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
#include "atom_natives.h" // NOLINT: This file is generated with js2c
|
#include "atom_natives.h" // NOLINT: This file is generated with js2c
|
||||||
|
#include "vendor/node/src/tracing/trace_event.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -95,6 +96,11 @@ void AtomRendererClient::DidCreateScriptContext(
|
||||||
node_bindings_->PrepareMessageLoop();
|
node_bindings_->PrepareMessageLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Setup node tracing controller.
|
||||||
|
if (!node::tracing::TraceEventHelper::GetTracingController())
|
||||||
|
node::tracing::TraceEventHelper::SetTracingController(
|
||||||
|
new v8::TracingController());
|
||||||
|
|
||||||
// Setup node environment for each window.
|
// Setup node environment for each window.
|
||||||
node::Environment* env = node_bindings_->CreateEnvironment(context);
|
node::Environment* env = node_bindings_->CreateEnvironment(context);
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||||
#include "atom/common/native_mate_converters/v8_value_converter.h"
|
#include "atom/common/native_mate_converters/v8_value_converter.h"
|
||||||
#include "atom/common/native_mate_converters/value_converter.h"
|
#include "atom/common/native_mate_converters/value_converter.h"
|
||||||
|
#include "atom/common/node_bindings.h"
|
||||||
#include "atom/common/options_switches.h"
|
#include "atom/common/options_switches.h"
|
||||||
#include "atom/renderer/api/atom_api_renderer_ipc.h"
|
#include "atom/renderer/api/atom_api_renderer_ipc.h"
|
||||||
#include "atom/renderer/atom_render_view_observer.h"
|
#include "atom/renderer/atom_render_view_observer.h"
|
||||||
|
@ -136,6 +137,8 @@ class AtomSandboxedRenderViewObserver : public AtomRenderViewObserver {
|
||||||
|
|
||||||
|
|
||||||
AtomSandboxedRendererClient::AtomSandboxedRendererClient() {
|
AtomSandboxedRendererClient::AtomSandboxedRendererClient() {
|
||||||
|
// Explicitly register electron's builtin modules.
|
||||||
|
NodeBindings::RegisterBuiltinModules();
|
||||||
}
|
}
|
||||||
|
|
||||||
AtomSandboxedRendererClient::~AtomSandboxedRendererClient() {
|
AtomSandboxedRendererClient::~AtomSandboxedRendererClient() {
|
||||||
|
|
|
@ -21,8 +21,10 @@
|
||||||
'<(libchromiumcontent_src_dir)/skia/config',
|
'<(libchromiumcontent_src_dir)/skia/config',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
|
'<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
||||||
|
'<(libchromiumcontent_src_dir)/third_party/skia/include/gpu',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
|
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/WebKit',
|
'<(libchromiumcontent_src_dir)/third_party/WebKit',
|
||||||
|
'<(libchromiumcontent_src_dir)/third_party/khronos',
|
||||||
'<(libchromiumcontent_dir)/gen',
|
'<(libchromiumcontent_dir)/gen',
|
||||||
],
|
],
|
||||||
'direct_dependent_settings': {
|
'direct_dependent_settings': {
|
||||||
|
@ -33,6 +35,7 @@
|
||||||
'<(libchromiumcontent_src_dir)/skia/config',
|
'<(libchromiumcontent_src_dir)/skia/config',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
|
'<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
||||||
|
'<(libchromiumcontent_src_dir)/third_party/skia/include/gpu',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/skia/include/config',
|
'<(libchromiumcontent_src_dir)/third_party/skia/include/config',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/icu/source/common',
|
'<(libchromiumcontent_src_dir)/third_party/icu/source/common',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
|
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
|
||||||
|
@ -69,6 +72,7 @@
|
||||||
],
|
],
|
||||||
'libraries': [
|
'libraries': [
|
||||||
'-lpthread',
|
'-lpthread',
|
||||||
|
'-latomic',
|
||||||
'<!@(<(pkg-config) --libs-only-l <(linux_system_libraries))',
|
'<!@(<(pkg-config) --libs-only-l <(linux_system_libraries))',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -109,6 +113,7 @@
|
||||||
'<(libchromiumcontent_dir)/librtc_base.a',
|
'<(libchromiumcontent_dir)/librtc_base.a',
|
||||||
'<(libchromiumcontent_dir)/librtc_base_approved.a',
|
'<(libchromiumcontent_dir)/librtc_base_approved.a',
|
||||||
'<(libchromiumcontent_dir)/libwebrtc_common.a',
|
'<(libchromiumcontent_dir)/libwebrtc_common.a',
|
||||||
|
'<(libchromiumcontent_dir)/libinit_webrtc.a',
|
||||||
'<(libchromiumcontent_dir)/libyuv.a',
|
'<(libchromiumcontent_dir)/libyuv.a',
|
||||||
'<(libchromiumcontent_dir)/librenderer.a',
|
'<(libchromiumcontent_dir)/librenderer.a',
|
||||||
'<(libchromiumcontent_dir)/libsecurity_state.a',
|
'<(libchromiumcontent_dir)/libsecurity_state.a',
|
||||||
|
@ -132,11 +137,10 @@
|
||||||
'<(libchromiumcontent_dir)/libfpdfdoc.a',
|
'<(libchromiumcontent_dir)/libfpdfdoc.a',
|
||||||
'<(libchromiumcontent_dir)/libfpdftext.a',
|
'<(libchromiumcontent_dir)/libfpdftext.a',
|
||||||
'<(libchromiumcontent_dir)/libfxcodec.a',
|
'<(libchromiumcontent_dir)/libfxcodec.a',
|
||||||
'<(libchromiumcontent_dir)/libfxedit.a',
|
|
||||||
'<(libchromiumcontent_dir)/libfxge.a',
|
'<(libchromiumcontent_dir)/libfxge.a',
|
||||||
'<(libchromiumcontent_dir)/libfxjs.a',
|
'<(libchromiumcontent_dir)/libfxjs.a',
|
||||||
'<(libchromiumcontent_dir)/libjavascript.a',
|
'<(libchromiumcontent_dir)/libjavascript.a',
|
||||||
'<(libchromiumcontent_dir)/libpdfwindow.a',
|
'<(libchromiumcontent_dir)/libpwl.a',
|
||||||
'<(libchromiumcontent_dir)/libfx_agg.a',
|
'<(libchromiumcontent_dir)/libfx_agg.a',
|
||||||
'<(libchromiumcontent_dir)/libfx_lcms2.a',
|
'<(libchromiumcontent_dir)/libfx_lcms2.a',
|
||||||
'<(libchromiumcontent_dir)/libfx_libopenjpeg.a',
|
'<(libchromiumcontent_dir)/libfx_libopenjpeg.a',
|
||||||
|
@ -202,6 +206,7 @@
|
||||||
'<(libchromiumcontent_dir)/librtc_base_approved.a',
|
'<(libchromiumcontent_dir)/librtc_base_approved.a',
|
||||||
'<(libchromiumcontent_dir)/libsystem_wrappers.a',
|
'<(libchromiumcontent_dir)/libsystem_wrappers.a',
|
||||||
'<(libchromiumcontent_dir)/libwebrtc_common.a',
|
'<(libchromiumcontent_dir)/libwebrtc_common.a',
|
||||||
|
'<(libchromiumcontent_dir)/libinit_webrtc.a',
|
||||||
'<(libchromiumcontent_dir)/libyuv.a',
|
'<(libchromiumcontent_dir)/libyuv.a',
|
||||||
'<(libchromiumcontent_dir)/librenderer.a',
|
'<(libchromiumcontent_dir)/librenderer.a',
|
||||||
'<(libchromiumcontent_dir)/libsecurity_state.a',
|
'<(libchromiumcontent_dir)/libsecurity_state.a',
|
||||||
|
@ -222,11 +227,10 @@
|
||||||
'<(libchromiumcontent_dir)/libfpdftext.a',
|
'<(libchromiumcontent_dir)/libfpdftext.a',
|
||||||
'<(libchromiumcontent_dir)/libfxcodec.a',
|
'<(libchromiumcontent_dir)/libfxcodec.a',
|
||||||
'<(libchromiumcontent_dir)/libfxcrt.a',
|
'<(libchromiumcontent_dir)/libfxcrt.a',
|
||||||
'<(libchromiumcontent_dir)/libfxedit.a',
|
|
||||||
'<(libchromiumcontent_dir)/libfxge.a',
|
'<(libchromiumcontent_dir)/libfxge.a',
|
||||||
'<(libchromiumcontent_dir)/libfxjs.a',
|
'<(libchromiumcontent_dir)/libfxjs.a',
|
||||||
'<(libchromiumcontent_dir)/libjavascript.a',
|
'<(libchromiumcontent_dir)/libjavascript.a',
|
||||||
'<(libchromiumcontent_dir)/libpdfwindow.a',
|
'<(libchromiumcontent_dir)/libpwl.a',
|
||||||
'<(libchromiumcontent_dir)/libfx_agg.a',
|
'<(libchromiumcontent_dir)/libfx_agg.a',
|
||||||
'<(libchromiumcontent_dir)/libfx_lcms2.a',
|
'<(libchromiumcontent_dir)/libfx_lcms2.a',
|
||||||
'<(libchromiumcontent_dir)/libfx_libopenjpeg.a',
|
'<(libchromiumcontent_dir)/libfx_libopenjpeg.a',
|
||||||
|
@ -298,6 +302,7 @@
|
||||||
'<(libchromiumcontent_dir)/rtc_base_approved.lib',
|
'<(libchromiumcontent_dir)/rtc_base_approved.lib',
|
||||||
'<(libchromiumcontent_dir)/system_wrappers.lib',
|
'<(libchromiumcontent_dir)/system_wrappers.lib',
|
||||||
'<(libchromiumcontent_dir)/webrtc_common.lib',
|
'<(libchromiumcontent_dir)/webrtc_common.lib',
|
||||||
|
'<(libchromiumcontent_dir)/init_webrtc.lib',
|
||||||
'<(libchromiumcontent_dir)/libyuv.lib',
|
'<(libchromiumcontent_dir)/libyuv.lib',
|
||||||
'<(libchromiumcontent_dir)/renderer.lib',
|
'<(libchromiumcontent_dir)/renderer.lib',
|
||||||
'<(libchromiumcontent_dir)/security_state.lib',
|
'<(libchromiumcontent_dir)/security_state.lib',
|
||||||
|
@ -319,11 +324,10 @@
|
||||||
'<(libchromiumcontent_dir)/fpdftext.lib',
|
'<(libchromiumcontent_dir)/fpdftext.lib',
|
||||||
'<(libchromiumcontent_dir)/fxcodec.lib',
|
'<(libchromiumcontent_dir)/fxcodec.lib',
|
||||||
'<(libchromiumcontent_dir)/fxcrt.lib',
|
'<(libchromiumcontent_dir)/fxcrt.lib',
|
||||||
'<(libchromiumcontent_dir)/fxedit.lib',
|
|
||||||
'<(libchromiumcontent_dir)/fxge.lib',
|
'<(libchromiumcontent_dir)/fxge.lib',
|
||||||
'<(libchromiumcontent_dir)/fxjs.lib',
|
'<(libchromiumcontent_dir)/fxjs.lib',
|
||||||
'<(libchromiumcontent_dir)/javascript.lib',
|
'<(libchromiumcontent_dir)/javascript.lib',
|
||||||
'<(libchromiumcontent_dir)/pdfwindow.lib',
|
'<(libchromiumcontent_dir)/pwl.lib',
|
||||||
'<(libchromiumcontent_dir)/fx_agg.lib',
|
'<(libchromiumcontent_dir)/fx_agg.lib',
|
||||||
'<(libchromiumcontent_dir)/fx_lcms2.lib',
|
'<(libchromiumcontent_dir)/fx_lcms2.lib',
|
||||||
'<(libchromiumcontent_dir)/fx_libopenjpeg.lib',
|
'<(libchromiumcontent_dir)/fx_libopenjpeg.lib',
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
|
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
|
||||||
'GCC_ENABLE_CPP_RTTI': 'NO',
|
'GCC_ENABLE_CPP_RTTI': 'NO',
|
||||||
'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',
|
'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',
|
||||||
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
|
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14',
|
||||||
'MACOSX_DEPLOYMENT_TARGET': '10.9',
|
'MACOSX_DEPLOYMENT_TARGET': '10.9',
|
||||||
'RUN_CLANG_STATIC_ANALYZER': 'YES',
|
'RUN_CLANG_STATIC_ANALYZER': 'YES',
|
||||||
'USE_HEADER_MAP': 'NO',
|
'USE_HEADER_MAP': 'NO',
|
||||||
|
@ -404,6 +404,7 @@
|
||||||
4702, # unreachable code
|
4702, # unreachable code
|
||||||
4715, # not all control paths return a value
|
4715, # not all control paths return a value
|
||||||
4819, # The file contains a character that cannot be represented in the current code page
|
4819, # The file contains a character that cannot be represented in the current code page
|
||||||
|
4275, # non dll-interface class used as base for dll-interface class
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
], # conditions
|
], # conditions
|
||||||
|
|
|
@ -97,6 +97,11 @@ void BrowserClient::GetAdditionalAllowedSchemesForFileSystem(
|
||||||
additional_schemes->push_back(content::kChromeUIScheme);
|
additional_schemes->push_back(content::kChromeUIScheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BrowserClient::GetAdditionalWebUISchemes(
|
||||||
|
std::vector<std::string>* additional_schemes) {
|
||||||
|
additional_schemes->push_back(content::kChromeDevToolsScheme);
|
||||||
|
}
|
||||||
|
|
||||||
net::NetLog* BrowserClient::GetNetLog() {
|
net::NetLog* BrowserClient::GetNetLog() {
|
||||||
return &net_log_;
|
return &net_log_;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,8 @@ class BrowserClient : public content::ContentBrowserClient {
|
||||||
override;
|
override;
|
||||||
void GetAdditionalAllowedSchemesForFileSystem(
|
void GetAdditionalAllowedSchemesForFileSystem(
|
||||||
std::vector<std::string>* additional_schemes) override;
|
std::vector<std::string>* additional_schemes) override;
|
||||||
|
void GetAdditionalWebUISchemes(
|
||||||
|
std::vector<std::string>* additional_schemes) override;
|
||||||
net::NetLog* GetNetLog() override;
|
net::NetLog* GetNetLog() override;
|
||||||
base::FilePath GetDefaultDownloadDirectory() override;
|
base::FilePath GetDefaultDownloadDirectory() override;
|
||||||
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
|
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
|
||||||
|
|
|
@ -105,7 +105,7 @@ void OverrideLinuxAppDataPath() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) {
|
int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) {
|
||||||
if (!g_in_x11_io_error_handler) {
|
if (!g_in_x11_io_error_handler && base::ThreadTaskRunnerHandle::IsSet()) {
|
||||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||||
FROM_HERE, base::Bind(&ui::LogErrorEventDescription, d, *error));
|
FROM_HERE, base::Bind(&ui::LogErrorEventDescription, d, *error));
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,9 +90,7 @@ void DevToolsManagerDelegate::StartHttpHandler() {
|
||||||
CreateSocketFactory(),
|
CreateSocketFactory(),
|
||||||
std::string(),
|
std::string(),
|
||||||
base::FilePath(),
|
base::FilePath(),
|
||||||
base::FilePath(),
|
base::FilePath());
|
||||||
std::string(),
|
|
||||||
GetBrightrayUserAgent());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DevToolsManagerDelegate::DevToolsManagerDelegate()
|
DevToolsManagerDelegate::DevToolsManagerDelegate()
|
||||||
|
|
|
@ -608,7 +608,7 @@ void InspectableWebContentsImpl::GetPreferences(
|
||||||
void InspectableWebContentsImpl::SetPreference(const std::string& name,
|
void InspectableWebContentsImpl::SetPreference(const std::string& name,
|
||||||
const std::string& value) {
|
const std::string& value) {
|
||||||
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
|
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
|
||||||
update.Get()->SetStringWithoutPathExpansion(name, value);
|
update.Get()->SetKey(name, base::Value(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InspectableWebContentsImpl::RemovePreference(const std::string& name) {
|
void InspectableWebContentsImpl::RemovePreference(const std::string& name) {
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "net/base/completion_callback.h"
|
#include "net/base/completion_callback.h"
|
||||||
#include "net/base/load_states.h"
|
#include "net/base/load_states.h"
|
||||||
#include "net/base/request_priority.h"
|
#include "net/base/request_priority.h"
|
||||||
|
#include "net/http/http_raw_request_headers.h"
|
||||||
#include "net/http/http_transaction.h"
|
#include "net/http/http_transaction.h"
|
||||||
|
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
|
@ -66,6 +67,10 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
|
||||||
int ResumeNetworkStart() override;
|
int ResumeNetworkStart() override;
|
||||||
void GetConnectionAttempts(net::ConnectionAttempts* out) const override;
|
void GetConnectionAttempts(net::ConnectionAttempts* out) const override;
|
||||||
|
|
||||||
|
// FIXME(torycl) Implement these methods properly
|
||||||
|
void SetRequestHeadersCallback(net::RequestHeadersCallback callback) {}
|
||||||
|
void SetResponseHeadersCallback(net::ResponseHeadersCallback callback) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Fail();
|
void Fail();
|
||||||
bool CheckFailed();
|
bool CheckFailed();
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "net/cert/ct_log_verifier.h"
|
#include "net/cert/ct_log_verifier.h"
|
||||||
#include "net/cert/ct_policy_enforcer.h"
|
#include "net/cert/ct_policy_enforcer.h"
|
||||||
#include "net/cert/multi_log_ct_verifier.h"
|
#include "net/cert/multi_log_ct_verifier.h"
|
||||||
#include "net/cookies/cookie_monster.h"
|
|
||||||
#include "net/dns/mapped_host_resolver.h"
|
#include "net/dns/mapped_host_resolver.h"
|
||||||
#include "net/http/http_auth_filter.h"
|
#include "net/http/http_auth_filter.h"
|
||||||
#include "net/http/http_auth_handler_factory.h"
|
#include "net/http/http_auth_handler_factory.h"
|
||||||
|
@ -100,8 +99,7 @@ URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory(
|
||||||
net::DISK_CACHE,
|
net::DISK_CACHE,
|
||||||
net::CACHE_BACKEND_DEFAULT,
|
net::CACHE_BACKEND_DEFAULT,
|
||||||
cache_path,
|
cache_path,
|
||||||
max_size,
|
max_size);
|
||||||
BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<net::CertVerifier>
|
std::unique_ptr<net::CertVerifier>
|
||||||
|
@ -156,6 +154,21 @@ URLRequestContextGetter::URLRequestContextGetter(
|
||||||
URLRequestContextGetter::~URLRequestContextGetter() {
|
URLRequestContextGetter::~URLRequestContextGetter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void URLRequestContextGetter::OnCookieChanged(
|
||||||
|
const net::CanonicalCookie& cookie,
|
||||||
|
net::CookieStore::ChangeCause cause) {
|
||||||
|
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
||||||
|
|
||||||
|
if (!delegate_)
|
||||||
|
return;
|
||||||
|
|
||||||
|
content::BrowserThread::PostTask(
|
||||||
|
content::BrowserThread::UI, FROM_HERE,
|
||||||
|
base::BindOnce(
|
||||||
|
&Delegate::NotifyCookieChange, base::Unretained(delegate_), cookie,
|
||||||
|
!(cause == net::CookieStore::ChangeCause::INSERTED), cause));
|
||||||
|
}
|
||||||
|
|
||||||
net::HostResolver* URLRequestContextGetter::host_resolver() {
|
net::HostResolver* URLRequestContextGetter::host_resolver() {
|
||||||
return url_request_context_->host_resolver();
|
return url_request_context_->host_resolver();
|
||||||
}
|
}
|
||||||
|
@ -184,12 +197,17 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
|
||||||
auto cookie_config = content::CookieStoreConfig(
|
auto cookie_config = content::CookieStoreConfig(
|
||||||
cookie_path,
|
cookie_path,
|
||||||
content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
|
content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
|
||||||
nullptr,
|
nullptr);
|
||||||
delegate_->CreateCookieDelegate());
|
|
||||||
cookie_config.cookieable_schemes = delegate_->GetCookieableSchemes();
|
cookie_config.cookieable_schemes = delegate_->GetCookieableSchemes();
|
||||||
std::unique_ptr<net::CookieStore> cookie_store =
|
std::unique_ptr<net::CookieStore> cookie_store =
|
||||||
content::CreateCookieStore(cookie_config);
|
content::CreateCookieStore(cookie_config);
|
||||||
storage_->set_cookie_store(std::move(cookie_store));
|
storage_->set_cookie_store(std::move(cookie_store));
|
||||||
|
// Cookie store will outlive notifier by order of declaration
|
||||||
|
// in the header.
|
||||||
|
cookie_change_sub_ =
|
||||||
|
url_request_context_->cookie_store()->AddCallbackForAllChanges(
|
||||||
|
base::Bind(&URLRequestContextGetter::OnCookieChanged, this));
|
||||||
|
|
||||||
storage_->set_channel_id_service(base::MakeUnique<net::ChannelIDService>(
|
storage_->set_channel_id_service(base::MakeUnique<net::ChannelIDService>(
|
||||||
new net::DefaultChannelIDStore(nullptr)));
|
new net::DefaultChannelIDStore(nullptr)));
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
#include "content/public/browser/browser_context.h"
|
#include "content/public/browser/browser_context.h"
|
||||||
#include "content/public/browser/content_browser_client.h"
|
#include "content/public/browser/content_browser_client.h"
|
||||||
#include "net/cookies/cookie_monster.h"
|
#include "net/cookies/cookie_store.h"
|
||||||
#include "net/http/http_cache.h"
|
#include "net/http/http_cache.h"
|
||||||
#include "net/http/transport_security_state.h"
|
#include "net/http/transport_security_state.h"
|
||||||
#include "net/http/url_security_manager.h"
|
#include "net/http/url_security_manager.h"
|
||||||
|
@ -48,9 +48,6 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
||||||
virtual std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate() {
|
virtual std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
virtual net::CookieMonsterDelegate* CreateCookieDelegate() {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
virtual std::string GetUserAgent();
|
virtual std::string GetUserAgent();
|
||||||
virtual std::unique_ptr<net::URLRequestJobFactory>
|
virtual std::unique_ptr<net::URLRequestJobFactory>
|
||||||
CreateURLRequestJobFactory(content::ProtocolHandlerMap* protocol_handlers);
|
CreateURLRequestJobFactory(content::ProtocolHandlerMap* protocol_handlers);
|
||||||
|
@ -60,6 +57,9 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
||||||
RequireCTDelegate* ct_delegate);
|
RequireCTDelegate* ct_delegate);
|
||||||
virtual net::SSLConfigService* CreateSSLConfigService();
|
virtual net::SSLConfigService* CreateSSLConfigService();
|
||||||
virtual std::vector<std::string> GetCookieableSchemes();
|
virtual std::vector<std::string> GetCookieableSchemes();
|
||||||
|
virtual void NotifyCookieChange(const net::CanonicalCookie& cookie,
|
||||||
|
bool removed,
|
||||||
|
net::CookieStore::ChangeCause cause) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
URLRequestContextGetter(
|
URLRequestContextGetter(
|
||||||
|
@ -73,6 +73,10 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
||||||
content::URLRequestInterceptorScopedVector protocol_interceptors);
|
content::URLRequestInterceptorScopedVector protocol_interceptors);
|
||||||
virtual ~URLRequestContextGetter();
|
virtual ~URLRequestContextGetter();
|
||||||
|
|
||||||
|
// net::CookieStore::CookieChangedCallback implementation.
|
||||||
|
void OnCookieChanged(const net::CanonicalCookie& cookie,
|
||||||
|
net::CookieStore::ChangeCause cause);
|
||||||
|
|
||||||
// net::URLRequestContextGetter:
|
// net::URLRequestContextGetter:
|
||||||
net::URLRequestContext* GetURLRequestContext() override;
|
net::URLRequestContext* GetURLRequestContext() override;
|
||||||
scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
|
scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
|
||||||
|
@ -104,6 +108,8 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
||||||
std::unique_ptr<net::HostMappingRules> host_mapping_rules_;
|
std::unique_ptr<net::HostMappingRules> host_mapping_rules_;
|
||||||
std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences_;
|
std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences_;
|
||||||
std::unique_ptr<net::HttpNetworkSession> http_network_session_;
|
std::unique_ptr<net::HttpNetworkSession> http_network_session_;
|
||||||
|
std::unique_ptr<net::CookieStore::CookieChangedSubscription>
|
||||||
|
cookie_change_sub_;
|
||||||
content::ProtocolHandlerMap protocol_handlers_;
|
content::ProtocolHandlerMap protocol_handlers_;
|
||||||
content::URLRequestInterceptorScopedVector protocol_interceptors_;
|
content::URLRequestInterceptorScopedVector protocol_interceptors_;
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
|
||||||
if (modification_is_removal)
|
if (modification_is_removal)
|
||||||
host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, nullptr);
|
host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, nullptr);
|
||||||
else
|
else
|
||||||
host_zoom_dictionary->SetDoubleWithoutPathExpansion(change.host, level);
|
host_zoom_dictionary->SetKey(change.host, base::Value(level));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoomLevelDelegate::ExtractPerHostZoomLevels(
|
void ZoomLevelDelegate::ExtractPerHostZoomLevels(
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/memory/ptr_util.h"
|
#include "base/memory/ptr_util.h"
|
||||||
#include "base/threading/thread_task_runner_handle.h"
|
#include "base/threading/thread_task_runner_handle.h"
|
||||||
#include "chrome/common/chrome_utility_messages.h"
|
|
||||||
#include "chrome/common/chrome_utility_printing_messages.h"
|
#include "chrome/common/chrome_utility_printing_messages.h"
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "content/public/browser/child_process_data.h"
|
#include "content/public/browser/child_process_data.h"
|
||||||
|
|
|
@ -459,7 +459,7 @@ void PrintJob::HoldUntilStopIsCalled() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintJob::Quit() {
|
void PrintJob::Quit() {
|
||||||
base::MessageLoop::current()->QuitWhenIdle();
|
base::RunLoop::QuitCurrentWhenIdleDeprecated();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Takes settings_ ownership and will be deleted in the receiving thread.
|
// Takes settings_ ownership and will be deleted in the receiving thread.
|
||||||
|
|
|
@ -143,7 +143,7 @@ void PrintViewManagerBase::OnDidPrintPage(
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<PdfMetafileSkia> metafile(
|
std::unique_ptr<PdfMetafileSkia> metafile(
|
||||||
new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
|
new PdfMetafileSkia(SkiaDocumentType::PDF));
|
||||||
if (metafile_must_be_valid) {
|
if (metafile_must_be_valid) {
|
||||||
if (!metafile->InitFromData(shared_buf.memory(), params.data_size)) {
|
if (!metafile->InitFromData(shared_buf.memory(), params.data_size)) {
|
||||||
NOTREACHED() << "Invalid metafile header";
|
NOTREACHED() << "Invalid metafile header";
|
||||||
|
@ -324,7 +324,7 @@ void PrintViewManagerBase::ShouldQuitFromInnerMessageLoop() {
|
||||||
inside_inner_message_loop_) {
|
inside_inner_message_loop_) {
|
||||||
// We are in a message loop created by RenderAllMissingPagesNow. Quit from
|
// We are in a message loop created by RenderAllMissingPagesNow. Quit from
|
||||||
// it.
|
// it.
|
||||||
base::MessageLoop::current()->QuitWhenIdle();
|
base::RunLoop::QuitCurrentWhenIdleDeprecated();
|
||||||
inside_inner_message_loop_ = false;
|
inside_inner_message_loop_ = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -433,9 +433,10 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||||
// memory-bound.
|
// memory-bound.
|
||||||
static const int kPrinterSettingsTimeout = 60000;
|
static const int kPrinterSettingsTimeout = 60000;
|
||||||
base::OneShotTimer quit_timer;
|
base::OneShotTimer quit_timer;
|
||||||
quit_timer.Start(
|
base::RunLoop run_loop;
|
||||||
FROM_HERE, TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
|
quit_timer.Start(FROM_HERE,
|
||||||
base::MessageLoop::current(), &base::MessageLoop::QuitWhenIdle);
|
TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
|
||||||
|
run_loop.QuitWhenIdleClosure());
|
||||||
|
|
||||||
inside_inner_message_loop_ = true;
|
inside_inner_message_loop_ = true;
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
#include "content/public/common/webplugininfo.h"
|
#include "content/public/common/webplugininfo.h"
|
||||||
#include "content/public/browser/plugin_service.h"
|
#include "content/public/browser/plugin_service.h"
|
||||||
|
#include "media/media_features.h"
|
||||||
|
|
||||||
using content::PluginService;
|
using content::PluginService;
|
||||||
using content::WebPluginInfo;
|
using content::WebPluginInfo;
|
||||||
|
@ -24,17 +25,17 @@ WidevineCdmMessageFilter::WidevineCdmMessageFilter(
|
||||||
|
|
||||||
bool WidevineCdmMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
bool WidevineCdmMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
||||||
IPC_BEGIN_MESSAGE_MAP(WidevineCdmMessageFilter, message)
|
IPC_BEGIN_MESSAGE_MAP(WidevineCdmMessageFilter, message)
|
||||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
IPC_MESSAGE_HANDLER(
|
IPC_MESSAGE_HANDLER(
|
||||||
ChromeViewHostMsg_IsInternalPluginAvailableForMimeType,
|
ChromeViewHostMsg_IsInternalPluginAvailableForMimeType,
|
||||||
OnIsInternalPluginAvailableForMimeType)
|
OnIsInternalPluginAvailableForMimeType)
|
||||||
#endif
|
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
IPC_MESSAGE_UNHANDLED(return false)
|
IPC_MESSAGE_UNHANDLED(return false)
|
||||||
IPC_END_MESSAGE_MAP()
|
IPC_END_MESSAGE_MAP()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
|
void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
|
||||||
const std::string& mime_type,
|
const std::string& mime_type,
|
||||||
bool* is_available,
|
bool* is_available,
|
||||||
|
@ -60,7 +61,7 @@ void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
|
||||||
|
|
||||||
*is_available = false;
|
*is_available = false;
|
||||||
}
|
}
|
||||||
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
|
|
||||||
void WidevineCdmMessageFilter::OnDestruct() const {
|
void WidevineCdmMessageFilter::OnDestruct() const {
|
||||||
BrowserThread::DeleteOnUIThread::Destruct(this);
|
BrowserThread::DeleteOnUIThread::Destruct(this);
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "chrome/common/widevine_cdm_messages.h"
|
#include "chrome/common/widevine_cdm_messages.h"
|
||||||
#include "content/public/browser/browser_message_filter.h"
|
#include "content/public/browser/browser_message_filter.h"
|
||||||
|
#include "media/media_features.h"
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
class BrowserContext;
|
class BrowserContext;
|
||||||
|
@ -25,7 +26,7 @@ class WidevineCdmMessageFilter : public content::BrowserMessageFilter {
|
||||||
|
|
||||||
virtual ~WidevineCdmMessageFilter();
|
virtual ~WidevineCdmMessageFilter();
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
// Returns whether any internal plugin supporting |mime_type| is registered
|
// Returns whether any internal plugin supporting |mime_type| is registered
|
||||||
// and enabled. Does not determine whether the plugin can actually be
|
// and enabled. Does not determine whether the plugin can actually be
|
||||||
// instantiated (e.g. whether it has all its dependencies).
|
// instantiated (e.g. whether it has all its dependencies).
|
||||||
|
@ -38,7 +39,7 @@ class WidevineCdmMessageFilter : public content::BrowserMessageFilter {
|
||||||
bool* is_available,
|
bool* is_available,
|
||||||
std::vector<base::string16>* additional_param_names,
|
std::vector<base::string16>* additional_param_names,
|
||||||
std::vector<base::string16>* additional_param_values);
|
std::vector<base::string16>* additional_param_values);
|
||||||
#endif
|
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
|
|
||||||
int render_process_id_;
|
int render_process_id_;
|
||||||
content::BrowserContext* browser_context_;
|
content::BrowserContext* browser_context_;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "chrome/common/chrome_constants.h"
|
#include "chrome/common/chrome_constants.h"
|
||||||
#include "chrome/common/chrome_paths_internal.h"
|
#include "chrome/common/chrome_paths_internal.h"
|
||||||
#include "chrome/common/widevine_cdm_constants.h"
|
#include "chrome/common/widevine_cdm_constants.h"
|
||||||
|
#include "media/media_features.h"
|
||||||
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
|
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
|
||||||
#include "third_party/widevine/cdm/widevine_cdm_common.h"
|
#include "third_party/widevine/cdm/widevine_cdm_common.h"
|
||||||
|
|
||||||
|
@ -360,7 +361,7 @@ bool PathProvider(int key, base::FilePath* result) {
|
||||||
#endif
|
#endif
|
||||||
cur = cur.Append(FILE_PATH_LITERAL("pnacl"));
|
cur = cur.Append(FILE_PATH_LITERAL("pnacl"));
|
||||||
break;
|
break;
|
||||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
#if defined(WIDEVINE_CDM_IS_COMPONENT)
|
#if defined(WIDEVINE_CDM_IS_COMPONENT)
|
||||||
case chrome::DIR_COMPONENT_WIDEVINE_CDM:
|
case chrome::DIR_COMPONENT_WIDEVINE_CDM:
|
||||||
if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
|
if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
|
||||||
|
@ -376,7 +377,7 @@ bool PathProvider(int key, base::FilePath* result) {
|
||||||
return false;
|
return false;
|
||||||
cur = cur.AppendASCII(kWidevineCdmAdapterFileName);
|
cur = cur.AppendASCII(kWidevineCdmAdapterFileName);
|
||||||
break;
|
break;
|
||||||
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
case chrome::FILE_RESOURCES_PACK:
|
case chrome::FILE_RESOURCES_PACK:
|
||||||
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
||||||
if (base::mac::AmIBundled()) {
|
if (base::mac::AmIBundled()) {
|
||||||
|
|
|
@ -1,163 +0,0 @@
|
||||||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
// Multiply-included message file, so no include guard.
|
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
#include <Windows.h>
|
|
||||||
#endif // defined(OS_WIN)
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <tuple>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "base/files/file_path.h"
|
|
||||||
#include "base/strings/string16.h"
|
|
||||||
#include "base/values.h"
|
|
||||||
#include "ipc/ipc_message_macros.h"
|
|
||||||
#include "ipc/ipc_platform_file.h"
|
|
||||||
#include "third_party/skia/include/core/SkBitmap.h"
|
|
||||||
#include "ui/gfx/ipc/gfx_param_traits.h"
|
|
||||||
|
|
||||||
// Singly-included section for typedefs.
|
|
||||||
#ifndef CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_
|
|
||||||
#define CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_
|
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
// A vector of filters, each being a tuple containing a display string (i.e.
|
|
||||||
// "Text Files") and a filter pattern (i.e. "*.txt").
|
|
||||||
typedef std::vector<std::tuple<base::string16, base::string16>>
|
|
||||||
GetOpenFileNameFilter;
|
|
||||||
#endif // OS_WIN
|
|
||||||
|
|
||||||
#endif // CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_
|
|
||||||
|
|
||||||
#define IPC_MESSAGE_START ChromeUtilityMsgStart
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
IPC_STRUCT_BEGIN(ChromeUtilityMsg_GetSaveFileName_Params)
|
|
||||||
IPC_STRUCT_MEMBER(HWND, owner)
|
|
||||||
IPC_STRUCT_MEMBER(DWORD, flags)
|
|
||||||
IPC_STRUCT_MEMBER(GetOpenFileNameFilter, filters)
|
|
||||||
IPC_STRUCT_MEMBER(int, one_based_filter_index)
|
|
||||||
IPC_STRUCT_MEMBER(base::FilePath, suggested_filename)
|
|
||||||
IPC_STRUCT_MEMBER(base::FilePath, initial_directory)
|
|
||||||
IPC_STRUCT_MEMBER(base::string16, default_extension)
|
|
||||||
IPC_STRUCT_END()
|
|
||||||
#endif // OS_WIN
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// Utility process messages:
|
|
||||||
// These are messages from the browser to the utility process.
|
|
||||||
|
|
||||||
// Tell the utility process to parse a JSON string into a Value object.
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_ParseJSON,
|
|
||||||
std::string /* JSON to parse */)
|
|
||||||
|
|
||||||
// Tell the utility process to decode the given image data.
|
|
||||||
IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_DecodeImage,
|
|
||||||
std::vector<unsigned char> /* encoded image contents */,
|
|
||||||
bool /* shrink image if needed for IPC msg limit */)
|
|
||||||
|
|
||||||
// Tell the utility process to decode the given JPEG image data with a robust
|
|
||||||
// libjpeg codec.
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_RobustJPEGDecodeImage,
|
|
||||||
std::vector<unsigned char>) // encoded image contents
|
|
||||||
|
|
||||||
// Tell the utility process to patch the given |input_file| using |patch_file|
|
|
||||||
// and place the output in |output_file|. The patch should use the bsdiff
|
|
||||||
// algorithm (Courgette's version).
|
|
||||||
IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_PatchFileBsdiff,
|
|
||||||
base::FilePath /* input_file */,
|
|
||||||
base::FilePath /* patch_file */,
|
|
||||||
base::FilePath /* output_file */)
|
|
||||||
|
|
||||||
// Tell the utility process to patch the given |input_file| using |patch_file|
|
|
||||||
// and place the output in |output_file|. The patch should use the Courgette
|
|
||||||
// algorithm.
|
|
||||||
IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_PatchFileCourgette,
|
|
||||||
base::FilePath /* input_file */,
|
|
||||||
base::FilePath /* patch_file */,
|
|
||||||
base::FilePath /* output_file */)
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
// Invokes ui::base::win::OpenFileViaShell from the utility process.
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_OpenFileViaShell,
|
|
||||||
base::FilePath /* full_path */)
|
|
||||||
|
|
||||||
// Invokes ui::base::win::OpenFolderViaShell from the utility process.
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_OpenFolderViaShell,
|
|
||||||
base::FilePath /* full_path */)
|
|
||||||
|
|
||||||
// Instructs the utility process to invoke GetOpenFileName. |owner| is the
|
|
||||||
// parent of the modal dialog, |flags| are OFN_* flags. |filter| constrains the
|
|
||||||
// user's file choices. |initial_directory| and |filename| select the directory
|
|
||||||
// to be displayed and the file to be initially selected.
|
|
||||||
//
|
|
||||||
// Either ChromeUtilityHostMsg_GetOpenFileName_Failed or
|
|
||||||
// ChromeUtilityHostMsg_GetOpenFileName_Result will be returned when the
|
|
||||||
// operation completes whether due to error or user action.
|
|
||||||
IPC_MESSAGE_CONTROL5(ChromeUtilityMsg_GetOpenFileName,
|
|
||||||
HWND /* owner */,
|
|
||||||
DWORD /* flags */,
|
|
||||||
GetOpenFileNameFilter /* filter */,
|
|
||||||
base::FilePath /* initial_directory */,
|
|
||||||
base::FilePath /* filename */)
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetSaveFileName,
|
|
||||||
ChromeUtilityMsg_GetSaveFileName_Params /* params */)
|
|
||||||
#endif // defined(OS_WIN)
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// Utility process host messages:
|
|
||||||
// These are messages from the utility process to the browser.
|
|
||||||
|
|
||||||
// Reply when the utility process successfully parsed a JSON string.
|
|
||||||
//
|
|
||||||
// WARNING: The result can be of any Value subclass type, but we can't easily
|
|
||||||
// pass indeterminate value types by const object reference with our IPC macros,
|
|
||||||
// so we put the result Value into a ListValue. Handlers should examine the
|
|
||||||
// first (and only) element of the ListValue for the actual result.
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Succeeded,
|
|
||||||
base::ListValue)
|
|
||||||
|
|
||||||
// Reply when the utility process failed in parsing a JSON string.
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Failed,
|
|
||||||
std::string /* error message, if any*/)
|
|
||||||
|
|
||||||
// Reply when the utility process has failed while unpacking and parsing a
|
|
||||||
// web resource. |error_message| is a user-readable explanation of what
|
|
||||||
// went wrong.
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_UnpackWebResource_Failed,
|
|
||||||
std::string /* error_message, if any */)
|
|
||||||
|
|
||||||
// Reply when the utility process has succeeded in decoding the image.
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_DecodeImage_Succeeded,
|
|
||||||
SkBitmap) // decoded image
|
|
||||||
|
|
||||||
// Reply when an error occurred decoding the image.
|
|
||||||
IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_DecodeImage_Failed)
|
|
||||||
|
|
||||||
// Reply when a file has been patched.
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_PatchFile_Finished, int /* result */)
|
|
||||||
|
|
||||||
|
|
||||||
// Reply when the utility process has started.
|
|
||||||
IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_ProcessStarted)
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_GetOpenFileName_Failed)
|
|
||||||
IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetOpenFileName_Result,
|
|
||||||
base::FilePath /* directory */,
|
|
||||||
std::vector<base::FilePath> /* filenames */)
|
|
||||||
IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_GetSaveFileName_Failed)
|
|
||||||
IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetSaveFileName_Result,
|
|
||||||
base::FilePath /* path */,
|
|
||||||
int /* one_based_filter_index */)
|
|
||||||
IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_BuildDirectWriteFontCache,
|
|
||||||
base::FilePath /* cache file path */)
|
|
||||||
#endif // defined(OS_WIN)
|
|
|
@ -7,13 +7,13 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "ipc/ipc_message_macros.h"
|
#include "ipc/ipc_message_macros.h"
|
||||||
#include "ppapi/features/features.h"
|
#include "media/media_features.h"
|
||||||
|
|
||||||
#define IPC_MESSAGE_START ChromeMsgStart
|
#define IPC_MESSAGE_START ChromeMsgStart
|
||||||
|
|
||||||
// Renderer -> Browser messages.
|
// Renderer -> Browser messages.
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
// Returns whether any internal plugin supporting |mime_type| is registered and
|
// Returns whether any internal plugin supporting |mime_type| is registered and
|
||||||
// enabled. Does not determine whether the plugin can actually be instantiated
|
// enabled. Does not determine whether the plugin can actually be instantiated
|
||||||
// (e.g. whether it has all its dependencies).
|
// (e.g. whether it has all its dependencies).
|
||||||
|
@ -26,6 +26,6 @@ IPC_SYNC_MESSAGE_CONTROL1_3(
|
||||||
bool /* is_available */,
|
bool /* is_available */,
|
||||||
std::vector<base::string16> /* additional_param_names */,
|
std::vector<base::string16> /* additional_param_names */,
|
||||||
std::vector<base::string16> /* additional_param_values */)
|
std::vector<base::string16> /* additional_param_values */)
|
||||||
#endif
|
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
|
|
||||||
// Browser -> Renderer messages.
|
// Browser -> Renderer messages.
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "content/public/renderer/render_thread.h"
|
#include "content/public/renderer/render_thread.h"
|
||||||
#include "media/base/eme_constants.h"
|
#include "media/base/eme_constants.h"
|
||||||
#include "media/base/key_system_properties.h"
|
#include "media/base/key_system_properties.h"
|
||||||
|
#include "media/media_features.h"
|
||||||
|
|
||||||
// #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
|
// #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
|
||||||
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
|
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
|
||||||
|
@ -32,7 +33,7 @@
|
||||||
using media::KeySystemProperties;
|
using media::KeySystemProperties;
|
||||||
using media::SupportedCodecs;
|
using media::SupportedCodecs;
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
static const char kExternalClearKeyPepperType[] =
|
static const char kExternalClearKeyPepperType[] =
|
||||||
"application/x-ppapi-clearkey-cdm";
|
"application/x-ppapi-clearkey-cdm";
|
||||||
|
|
||||||
|
@ -264,15 +265,15 @@ static void AddPepperBasedWidevine(
|
||||||
#endif // defined(OS_CHROMEOS)
|
#endif // defined(OS_CHROMEOS)
|
||||||
}
|
}
|
||||||
#endif // defined(WIDEVINE_CDM_AVAILABLE)
|
#endif // defined(WIDEVINE_CDM_AVAILABLE)
|
||||||
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
|
|
||||||
void AddChromeKeySystems(
|
void AddChromeKeySystems(
|
||||||
std::vector<std::unique_ptr<KeySystemProperties>>* key_systems_properties) {
|
std::vector<std::unique_ptr<KeySystemProperties>>* key_systems_properties) {
|
||||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
AddExternalClearKey(key_systems_properties);
|
AddExternalClearKey(key_systems_properties);
|
||||||
|
|
||||||
#if defined(WIDEVINE_CDM_AVAILABLE)
|
#if defined(WIDEVINE_CDM_AVAILABLE)
|
||||||
AddPepperBasedWidevine(key_systems_properties);
|
AddPepperBasedWidevine(key_systems_properties);
|
||||||
#endif // defined(WIDEVINE_CDM_AVAILABLE)
|
#endif // defined(WIDEVINE_CDM_AVAILABLE)
|
||||||
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
|
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1254,7 +1254,7 @@ bool PrintWebViewHelper::PrintPreviewContext::CreatePreviewDocument(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
metafile_.reset(new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
|
metafile_.reset(new PdfMetafileSkia(SkiaDocumentType::PDF));
|
||||||
CHECK(metafile_->Init());
|
CHECK(metafile_->Init());
|
||||||
|
|
||||||
current_page_index_ = 0;
|
current_page_index_ = 0;
|
||||||
|
|
|
@ -33,7 +33,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||||
std::unique_ptr<PdfMetafileSkia> draft_metafile;
|
std::unique_ptr<PdfMetafileSkia> draft_metafile;
|
||||||
PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
|
PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
|
||||||
if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
|
if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
|
||||||
draft_metafile.reset(new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
|
draft_metafile.reset(new PdfMetafileSkia(SkiaDocumentType::PDF));
|
||||||
initial_render_metafile = draft_metafile.get();
|
initial_render_metafile = draft_metafile.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||||
DCHECK(!draft_metafile.get());
|
DCHECK(!draft_metafile.get());
|
||||||
draft_metafile =
|
draft_metafile =
|
||||||
print_preview_context_.metafile()->GetMetafileForCurrentPage(
|
print_preview_context_.metafile()->GetMetafileForCurrentPage(
|
||||||
PDF_SKIA_DOCUMENT_TYPE);
|
SkiaDocumentType::PDF);
|
||||||
|
|
||||||
}
|
}
|
||||||
return PreviewPageRendered(page_number, draft_metafile.get());
|
return PreviewPageRendered(page_number, draft_metafile.get());
|
||||||
|
@ -58,7 +58,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||||
|
|
||||||
bool PrintWebViewHelper::PrintPagesNative(blink::WebLocalFrame* frame,
|
bool PrintWebViewHelper::PrintPagesNative(blink::WebLocalFrame* frame,
|
||||||
int page_count) {
|
int page_count) {
|
||||||
PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
|
PdfMetafileSkia metafile(SkiaDocumentType::PDF);
|
||||||
if (!metafile.Init())
|
if (!metafile.Init())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ using blink::WebLocalFrame;
|
||||||
void PrintWebViewHelper::PrintPageInternal(
|
void PrintWebViewHelper::PrintPageInternal(
|
||||||
const PrintMsg_PrintPage_Params& params,
|
const PrintMsg_PrintPage_Params& params,
|
||||||
WebLocalFrame* frame) {
|
WebLocalFrame* frame) {
|
||||||
PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
|
PdfMetafileSkia metafile(SkiaDocumentType::PDF);
|
||||||
CHECK(metafile.Init());
|
CHECK(metafile.Init());
|
||||||
|
|
||||||
int page_number = params.page_number;
|
int page_number = params.page_number;
|
||||||
|
@ -60,7 +60,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||||
is_print_ready_metafile_sent_;
|
is_print_ready_metafile_sent_;
|
||||||
|
|
||||||
if (render_to_draft) {
|
if (render_to_draft) {
|
||||||
draft_metafile.reset(new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
|
draft_metafile.reset(new PdfMetafileSkia(SkiaDocumentType::PDF));
|
||||||
CHECK(draft_metafile->Init());
|
CHECK(draft_metafile->Init());
|
||||||
initial_render_metafile = draft_metafile.get();
|
initial_render_metafile = draft_metafile.get();
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||||
DCHECK(!draft_metafile.get());
|
DCHECK(!draft_metafile.get());
|
||||||
draft_metafile =
|
draft_metafile =
|
||||||
print_preview_context_.metafile()->GetMetafileForCurrentPage(
|
print_preview_context_.metafile()->GetMetafileForCurrentPage(
|
||||||
PDF_SKIA_DOCUMENT_TYPE);
|
SkiaDocumentType::PDF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return PreviewPageRendered(page_number, draft_metafile.get());
|
return PreviewPageRendered(page_number, draft_metafile.get());
|
||||||
|
|
|
@ -30,7 +30,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||||
std::unique_ptr<PdfMetafileSkia> draft_metafile;
|
std::unique_ptr<PdfMetafileSkia> draft_metafile;
|
||||||
PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
|
PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
|
||||||
if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
|
if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
|
||||||
draft_metafile.reset(new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
|
draft_metafile.reset(new PdfMetafileSkia(SkiaDocumentType::PDF));
|
||||||
initial_render_metafile = draft_metafile.get();
|
initial_render_metafile = draft_metafile.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,14 +49,14 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||||
DCHECK(!draft_metafile.get());
|
DCHECK(!draft_metafile.get());
|
||||||
draft_metafile =
|
draft_metafile =
|
||||||
print_preview_context_.metafile()->GetMetafileForCurrentPage(
|
print_preview_context_.metafile()->GetMetafileForCurrentPage(
|
||||||
PDF_SKIA_DOCUMENT_TYPE);
|
SkiaDocumentType::PDF);
|
||||||
}
|
}
|
||||||
return PreviewPageRendered(page_number, draft_metafile.get());
|
return PreviewPageRendered(page_number, draft_metafile.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrintWebViewHelper::PrintPagesNative(blink::WebLocalFrame* frame,
|
bool PrintWebViewHelper::PrintPagesNative(blink::WebLocalFrame* frame,
|
||||||
int page_count) {
|
int page_count) {
|
||||||
PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
|
PdfMetafileSkia metafile(SkiaDocumentType::PDF);
|
||||||
if (!metafile.Init())
|
if (!metafile.Init())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include "chrome/common/tts_messages.h"
|
#include "chrome/common/tts_messages.h"
|
||||||
#include "chrome/common/tts_utterance_request.h"
|
#include "chrome/common/tts_utterance_request.h"
|
||||||
#include "content/public/renderer/render_thread.h"
|
#include "content/public/renderer/render_thread.h"
|
||||||
#include "third_party/WebKit/public/platform/WebCString.h"
|
|
||||||
#include "third_party/WebKit/public/platform/WebSpeechSynthesisUtterance.h"
|
#include "third_party/WebKit/public/platform/WebSpeechSynthesisUtterance.h"
|
||||||
#include "third_party/WebKit/public/platform/WebSpeechSynthesisVoice.h"
|
#include "third_party/WebKit/public/platform/WebSpeechSynthesisVoice.h"
|
||||||
#include "third_party/WebKit/public/platform/WebString.h"
|
#include "third_party/WebKit/public/platform/WebString.h"
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
// Multiply-included file, no traditional include guard.
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "content/public/common/common_param_traits_macros.h"
|
|
||||||
#include "content/public/common/referrer.h"
|
|
||||||
#include "ipc/ipc_message_macros.h"
|
|
||||||
#include "url/gurl.h"
|
|
||||||
#include "url/ipc/url_param_traits.h"
|
|
||||||
|
|
||||||
#define IPC_MESSAGE_START PDFMsgStart
|
|
||||||
|
|
||||||
// Brings up SaveAs... dialog to save specified URL.
|
|
||||||
IPC_MESSAGE_ROUTED2(PDFHostMsg_PDFSaveURLAs,
|
|
||||||
GURL /* url */,
|
|
||||||
content::Referrer /* referrer */)
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
#include "components/pdf/renderer/pepper_pdf_host.h"
|
#include "components/pdf/renderer/pepper_pdf_host.h"
|
||||||
|
|
||||||
|
#include "atom/common/api/api_messages.h"
|
||||||
#include "base/memory/ptr_util.h"
|
#include "base/memory/ptr_util.h"
|
||||||
#include "components/pdf/common/pdf_messages.h"
|
|
||||||
#include "content/public/common/referrer.h"
|
#include "content/public/common/referrer.h"
|
||||||
#include "content/public/renderer/pepper_plugin_instance.h"
|
#include "content/public/renderer/pepper_plugin_instance.h"
|
||||||
#include "content/public/renderer/render_frame.h"
|
#include "content/public/renderer/render_frame.h"
|
||||||
|
@ -77,8 +77,8 @@ int32_t PepperPDFHost::OnHostMsgSaveAs(
|
||||||
referrer.url = url;
|
referrer.url = url;
|
||||||
referrer.policy = blink::kWebReferrerPolicyDefault;
|
referrer.policy = blink::kWebReferrerPolicyDefault;
|
||||||
referrer = content::Referrer::SanitizeForRequest(url, referrer);
|
referrer = content::Referrer::SanitizeForRequest(url, referrer);
|
||||||
render_frame->Send(
|
render_frame->Send(new AtomFrameHostMsg_PDFSaveURLAs(
|
||||||
new PDFHostMsg_PDFSaveURLAs(render_frame->GetRoutingID(), url, referrer));
|
render_frame->GetRoutingID(), url, referrer));
|
||||||
return PP_OK;
|
return PP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
25
common.gypi
25
common.gypi
|
@ -13,6 +13,8 @@
|
||||||
'component%': 'static_library',
|
'component%': 'static_library',
|
||||||
'debug_http2': 'false',
|
'debug_http2': 'false',
|
||||||
'debug_nghttp2': 'false',
|
'debug_nghttp2': 'false',
|
||||||
|
# XXX(alexeykuzmin): Must match the clang version we use. See `clang -v`.
|
||||||
|
'llvm_version': '6.0',
|
||||||
'python': 'python',
|
'python': 'python',
|
||||||
'openssl_fips': '',
|
'openssl_fips': '',
|
||||||
'openssl_no_asm': 1,
|
'openssl_no_asm': 1,
|
||||||
|
@ -180,7 +182,9 @@
|
||||||
'-Wl,--no-whole-archive',
|
'-Wl,--no-whole-archive',
|
||||||
],
|
],
|
||||||
}, {
|
}, {
|
||||||
'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
|
'libraries': [
|
||||||
|
'<@(libchromiumcontent_v8_libraries)',
|
||||||
|
],
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
|
@ -241,6 +245,25 @@
|
||||||
}], # OS=="win"
|
}], # OS=="win"
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
|
['OS=="linux" and _toolset=="target" and _target_name in ["dump_syms", "node"]', {
|
||||||
|
'conditions': [
|
||||||
|
['libchromiumcontent_component==0', {
|
||||||
|
'libraries': [
|
||||||
|
'<(libchromiumcontent_dir)/libc++.a',
|
||||||
|
],
|
||||||
|
'ldflags': [
|
||||||
|
'-lpthread',
|
||||||
|
],
|
||||||
|
}, {
|
||||||
|
'libraries': [
|
||||||
|
'<(libchromiumcontent_dir)/libc++.so',
|
||||||
|
],
|
||||||
|
'ldflags': [
|
||||||
|
'-Wl,-rpath=\$$ORIGIN',
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
],
|
||||||
|
}]
|
||||||
],
|
],
|
||||||
'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail.
|
'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail.
|
||||||
'msvs_disabled_warnings': [
|
'msvs_disabled_warnings': [
|
||||||
|
|
|
@ -261,8 +261,6 @@
|
||||||
'atom/browser/net/asar/url_request_asar_job.h',
|
'atom/browser/net/asar/url_request_asar_job.h',
|
||||||
'atom/browser/net/atom_cert_verifier.cc',
|
'atom/browser/net/atom_cert_verifier.cc',
|
||||||
'atom/browser/net/atom_cert_verifier.h',
|
'atom/browser/net/atom_cert_verifier.h',
|
||||||
'atom/browser/net/atom_cookie_delegate.cc',
|
|
||||||
'atom/browser/net/atom_cookie_delegate.h',
|
|
||||||
'atom/browser/net/atom_network_delegate.cc',
|
'atom/browser/net/atom_network_delegate.cc',
|
||||||
'atom/browser/net/atom_network_delegate.h',
|
'atom/browser/net/atom_network_delegate.h',
|
||||||
'atom/browser/net/atom_url_request.cc',
|
'atom/browser/net/atom_url_request.cc',
|
||||||
|
@ -609,7 +607,6 @@
|
||||||
'chromium_src/chrome/common/chrome_paths_linux.cc',
|
'chromium_src/chrome/common/chrome_paths_linux.cc',
|
||||||
'chromium_src/chrome/common/chrome_paths_mac.mm',
|
'chromium_src/chrome/common/chrome_paths_mac.mm',
|
||||||
'chromium_src/chrome/common/chrome_paths_win.cc',
|
'chromium_src/chrome/common/chrome_paths_win.cc',
|
||||||
'chromium_src/chrome/common/chrome_utility_messages.h',
|
|
||||||
'chromium_src/chrome/common/pref_names.cc',
|
'chromium_src/chrome/common/pref_names.cc',
|
||||||
'chromium_src/chrome/common/pref_names.h',
|
'chromium_src/chrome/common/pref_names.h',
|
||||||
'chromium_src/chrome/common/print_messages.cc',
|
'chromium_src/chrome/common/print_messages.cc',
|
||||||
|
@ -646,7 +643,6 @@
|
||||||
'chromium_src/chrome/renderer/tts_dispatcher.cc',
|
'chromium_src/chrome/renderer/tts_dispatcher.cc',
|
||||||
'chromium_src/chrome/renderer/tts_dispatcher.h',
|
'chromium_src/chrome/renderer/tts_dispatcher.h',
|
||||||
'chromium_src/chrome/utility/utility_message_handler.h',
|
'chromium_src/chrome/utility/utility_message_handler.h',
|
||||||
'chromium_src/components/pdf/common/pdf_messages.h',
|
|
||||||
'chromium_src/components/pdf/renderer/pepper_pdf_host.cc',
|
'chromium_src/components/pdf/renderer/pepper_pdf_host.cc',
|
||||||
'chromium_src/components/pdf/renderer/pepper_pdf_host.h',
|
'chromium_src/components/pdf/renderer/pepper_pdf_host.h',
|
||||||
'chromium_src/extensions/browser/app_window/size_constraints.cc',
|
'chromium_src/extensions/browser/app_window/size_constraints.cc',
|
||||||
|
|
|
@ -85,11 +85,12 @@ def main(args):
|
||||||
def InstallDefaultSysrootForArch(target_arch):
|
def InstallDefaultSysrootForArch(target_arch):
|
||||||
if target_arch not in VALID_ARCHS:
|
if target_arch not in VALID_ARCHS:
|
||||||
raise Error('Unknown architecture: %s' % target_arch)
|
raise Error('Unknown architecture: %s' % target_arch)
|
||||||
InstallSysroot('Jessie', target_arch)
|
InstallSysroot('Stretch', target_arch)
|
||||||
|
|
||||||
|
|
||||||
def InstallSysroot(target_platform, target_arch):
|
def InstallSysroot(target_platform, target_arch):
|
||||||
# The sysroot directory should match the one specified in build/common.gypi.
|
# The sysroot directory should match the one specified in
|
||||||
|
# build/config/sysroot.gni.
|
||||||
# TODO(thestig) Consider putting this elsewhere to avoid having to recreate
|
# TODO(thestig) Consider putting this elsewhere to avoid having to recreate
|
||||||
# it on every build.
|
# it on every build.
|
||||||
linux_dir = os.path.dirname(SCRIPT_DIR)
|
linux_dir = os.path.dirname(SCRIPT_DIR)
|
||||||
|
@ -111,8 +112,6 @@ def InstallSysroot(target_platform, target_arch):
|
||||||
if os.path.exists(stamp):
|
if os.path.exists(stamp):
|
||||||
with open(stamp) as s:
|
with open(stamp) as s:
|
||||||
if s.read() == url:
|
if s.read() == url:
|
||||||
print '%s %s sysroot image already up to date: %s' % \
|
|
||||||
(target_platform, target_arch, sysroot)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
print 'Installing Debian %s %s root image: %s' % \
|
print 'Installing Debian %s %s root image: %s' % \
|
||||||
|
|
|
@ -1,56 +1,38 @@
|
||||||
{
|
{
|
||||||
"jessie_amd64": {
|
"stretch_amd64": {
|
||||||
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
|
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
|
||||||
"Sha1Sum": "8b2167b36f3cd85ebbec5c2a39a1842ef613f6a2",
|
"Sha1Sum": "69457fddca3500e2dde124f77f8382b0a18d765e",
|
||||||
"SysrootDir": "debian_jessie_amd64-sysroot",
|
"SysrootDir": "debian_stretch_amd64-sysroot",
|
||||||
"Tarball": "debian_jessie_amd64_sysroot.tgz"
|
"Tarball": "debian_stretch_amd64_sysroot.tgz"
|
||||||
},
|
},
|
||||||
"jessie_arm": {
|
"stretch_arm": {
|
||||||
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
|
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
|
||||||
"Sha1Sum": "3fa13635be0c6d8ed461715ad51cdb3809a19422",
|
"Sha1Sum": "3e880f69177992ce02b05deeac619f7591b30287",
|
||||||
"SysrootDir": "debian_jessie_arm-sysroot",
|
"SysrootDir": "debian_stretch_arm-sysroot",
|
||||||
"Tarball": "debian_jessie_arm_sysroot.tgz"
|
"Tarball": "debian_stretch_arm_sysroot.tgz"
|
||||||
},
|
},
|
||||||
"jessie_arm64": {
|
"stretch_arm64": {
|
||||||
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
|
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
|
||||||
"Sha1Sum": "bcf92ed2a033b4b2d1032df3b53eac4910c78fde",
|
"Sha1Sum": "8fd58c7d4b38fa3c6785573c6310cf6ca6c88312",
|
||||||
"SysrootDir": "debian_jessie_arm64-sysroot",
|
"SysrootDir": "debian_stretch_arm64-sysroot",
|
||||||
"Tarball": "debian_jessie_arm64_sysroot.tgz"
|
"Tarball": "debian_stretch_arm64_sysroot.tgz"
|
||||||
},
|
},
|
||||||
"jessie_i386": {
|
"stretch_i386": {
|
||||||
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
|
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
|
||||||
"Sha1Sum": "4e83ed9a1b457a1ca59512c3d4823e87e950deb4",
|
"Sha1Sum": "1bd14db5eb0466064659126d398b38220013fb38",
|
||||||
"SysrootDir": "debian_jessie_i386-sysroot",
|
"SysrootDir": "debian_stretch_i386-sysroot",
|
||||||
"Tarball": "debian_jessie_i386_sysroot.tgz"
|
"Tarball": "debian_stretch_i386_sysroot.tgz"
|
||||||
},
|
},
|
||||||
"jessie_mips": {
|
"stretch_mips": {
|
||||||
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
|
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
|
||||||
"Sha1Sum": "0f550cd150f077a6e749a629e2fda0f0a4348eae",
|
"Sha1Sum": "285751660ffab14e6d052c8ddb5c90752a51704d",
|
||||||
"SysrootDir": "debian_jessie_mips-sysroot",
|
"SysrootDir": "debian_stretch_mips-sysroot",
|
||||||
"Tarball": "debian_jessie_mips_sysroot.tgz"
|
"Tarball": "debian_stretch_mips_sysroot.tgz"
|
||||||
},
|
},
|
||||||
"wheezy_amd64": {
|
"stretch_mips64el": {
|
||||||
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
|
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
|
||||||
"Sha1Sum": "fe372c4394ece7fd1d853a205de8c13b46e2f45a",
|
"Sha1Sum": "23f51f29bc35a550092dde41dc823780fdb50f9e",
|
||||||
"SysrootDir": "debian_wheezy_amd64-sysroot",
|
"SysrootDir": "debian_stretch_mips64el-sysroot",
|
||||||
"Tarball": "debian_wheezy_amd64_sysroot.tgz"
|
"Tarball": "debian_stretch_mips64el_sysroot.tgz"
|
||||||
},
|
|
||||||
"wheezy_arm": {
|
|
||||||
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
|
|
||||||
"Sha1Sum": "73323fae0b5597398a38f0d7e64f48309da112fa",
|
|
||||||
"SysrootDir": "debian_wheezy_arm-sysroot",
|
|
||||||
"Tarball": "debian_wheezy_arm_sysroot.tgz"
|
|
||||||
},
|
|
||||||
"wheezy_i386": {
|
|
||||||
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
|
|
||||||
"Sha1Sum": "7e96584297a5c9916b3bed4b88abe332fc79a247",
|
|
||||||
"SysrootDir": "debian_wheezy_i386-sysroot",
|
|
||||||
"Tarball": "debian_wheezy_i386_sysroot.tgz"
|
|
||||||
},
|
|
||||||
"wheezy_mips": {
|
|
||||||
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
|
|
||||||
"Sha1Sum": "b2f173905a41ec9f23c329fe529508b4bdc76230",
|
|
||||||
"SysrootDir": "debian_wheezy_mips-sysroot",
|
|
||||||
"Tarball": "debian_wheezy_mips_sysroot.tgz"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue