Merge pull request #11230 from electron/upgrade-to-chromium-62

Upgrade to Chromium 62
This commit is contained in:
Cheng Zhao 2018-02-26 14:20:21 +09:00 committed by GitHub
commit f7786a9e48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 486 additions and 626 deletions

11
.gitignore vendored
View file

@ -28,14 +28,11 @@
/external_binaries/
/out/
/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_wheezy_amd64-sysroot/
/vendor/debian_wheezy_arm-sysroot/
/vendor/debian_wheezy_i386-sysroot/
/vendor/debian_stretch_amd64-sysroot/
/vendor/debian_stretch_arm-sysroot/
/vendor/debian_stretch_arm64-sysroot/
/vendor/debian_stretch_i386-sysroot/
/vendor/gcc-4.8.3-d197-n64-loongson/
/vendor/readme-gcc483-loongson.txt
/vendor/download/

View file

@ -19,13 +19,14 @@
#include "content/public/common/content_constants.h"
#include "content/public/common/pepper_plugin_info.h"
#include "content/public/common/user_agent.h"
#include "media/media_features.h"
#include "pdf/pdf.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
#include "ui/base/l10n/l10n_util.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"
#endif
@ -73,7 +74,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
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,
const std::string& version) {
content::PepperPluginInfo widevine_cdm;
@ -108,7 +109,7 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
return widevine_cdm;
}
#endif
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
content::PepperPluginInfo pdf_info;
@ -156,7 +157,7 @@ void AddPepperFlashFromCommandLine(
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(
std::vector<content::PepperPluginInfo>* plugins) {
auto command_line = base::CommandLine::ForCurrentProcess();
@ -176,7 +177,7 @@ void AddWidevineCdmFromCommandLine(
plugins->push_back(CreateWidevineCdmInfo(widevine_cdm_path,
widevine_cdm_version));
}
#endif
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
AtomContentClient::AtomContentClient() {
}
@ -216,9 +217,9 @@ void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) {
void AtomContentClient::AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) {
AddPepperFlashFromCommandLine(plugins);
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
AddWidevineCdmFromCommandLine(plugins);
#endif
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
ComputeBuiltInPlugins(plugins);
}

View file

@ -99,6 +99,11 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
bool enable_stack_dumping = true;
#else
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
if (enable_stack_dumping)
base::debug::EnableInProcessStackDumping();

View file

@ -12,6 +12,7 @@
#include "atom/common/api/atom_bindings.h"
#include "atom/common/crash_reporter/crash_reporter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/node_bindings.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/task_scheduler/task_scheduler.h"
@ -50,14 +51,16 @@ int NodeMain(int argc, char *argv[]) {
// Initialize gin::IsolateHolder.
JavascriptEnvironment gin_env;
// Explicitly register electron's builtin modules.
NodeBindings::RegisterBuiltinModules();
int exec_argc;
const char** 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(
&isolate_data, gin_env.context(), argc, argv,
exec_argc, exec_argv);
node::CreateIsolateData(gin_env.isolate(), loop, gin_env.platform()),
gin_env.context(), argc, argv, exec_argc, exec_argv);
// Enable support for v8 inspector.
NodeDebugger node_debugger(env);
@ -79,6 +82,7 @@ int NodeMain(int argc, char *argv[]) {
bool more;
do {
more = uv_run(env->event_loop(), UV_RUN_ONCE);
gin_env.platform()->DrainBackgroundTasks(env->isolate());
if (more == false) {
node::EmitBeforeExit(env);
@ -92,6 +96,8 @@ int NodeMain(int argc, char *argv[]) {
exit_code = node::EmitExit(env);
node::RunAtExit(env);
gin_env.platform()->DrainBackgroundTasks(env->isolate());
gin_env.platform()->CancelPendingDelayedTasks(env->isolate());
node::FreeEnvironment(env);
}

View file

@ -1133,8 +1133,8 @@ std::vector<mate::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {
v8::Local<v8::Value> App::GetGPUFeatureStatus(v8::Isolate* isolate) {
auto status = content::GetFeatureStatus();
return mate::ConvertToV8(isolate,
status ? *status : base::DictionaryValue());
base::DictionaryValue temp;
return mate::ConvertToV8(isolate, status ? *status : temp);
}
void App::EnableMixedSandbox(mate::Arguments* args) {
@ -1342,4 +1342,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_app, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_app, Initialize)

View file

@ -150,4 +150,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_auto_updater, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_auto_updater, Initialize)

View file

@ -162,4 +162,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_browser_view, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_browser_view, Initialize)

View file

@ -1332,4 +1332,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_window, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_window, Initialize)

View file

@ -73,4 +73,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_content_tracing, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_content_tracing, Initialize)

View file

@ -20,7 +20,6 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
using atom::AtomCookieDelegate;
using content::BrowserThread;
namespace mate {
@ -238,17 +237,15 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
} // namespace
Cookies::Cookies(v8::Isolate* isolate,
AtomBrowserContext* browser_context)
: request_context_getter_(browser_context->url_request_context_getter()),
cookie_delegate_(browser_context->cookie_delegate()) {
Cookies::Cookies(v8::Isolate* isolate, AtomBrowserContext* browser_context)
: browser_context_(browser_context),
request_context_getter_(browser_context->url_request_context_getter()) {
Init(isolate);
cookie_delegate_->AddObserver(this);
cookie_change_subscription_ = browser_context->RegisterCookieChangeCallback(
base::Bind(&Cookies::OnCookieChanged, base::Unretained(this)));
}
Cookies::~Cookies() {
cookie_delegate_->RemoveObserver(this);
}
Cookies::~Cookies() {}
void Cookies::Get(const base::DictionaryValue& filter,
const GetCallback& callback) {
@ -283,10 +280,8 @@ void Cookies::FlushStore(const base::Closure& callback) {
base::Bind(FlushCookieStoreOnIOThread, getter, callback));
}
void Cookies::OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) {
Emit("changed", cookie, cause, removed);
void Cookies::OnCookieChanged(const CookieDetails* details) {
Emit("changed", *(details->cookie), details->cause, details->removed);
}

View file

@ -8,7 +8,7 @@
#include <string>
#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 "native_mate/handle.h"
#include "net/cookies/canonical_cookie.h"
@ -27,8 +27,7 @@ class AtomBrowserContext;
namespace api {
class Cookies : public mate::TrackableObject<Cookies>,
public AtomCookieDelegate::Observer {
class Cookies : public mate::TrackableObject<Cookies> {
public:
enum Error {
SUCCESS,
@ -55,14 +54,16 @@ class Cookies : public mate::TrackableObject<Cookies>,
void Set(const base::DictionaryValue& details, const SetCallback& callback);
void FlushStore(const base::Closure& callback);
// AtomCookieDelegate::Observer:
void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) override;
// AtomBrowserContext::RegisterCookieChangeCallback subscription:
void OnCookieChanged(const CookieDetails*);
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_;
scoped_refptr<AtomCookieDelegate> cookie_delegate_;
DISALLOW_COPY_AND_ASSIGN(Cookies);
};

View file

@ -178,4 +178,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_debugger, Initialize);
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_debugger, Initialize);

View file

@ -114,4 +114,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_desktop_capturer, Initialize);
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_desktop_capturer, Initialize);

View file

@ -140,4 +140,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_dialog, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_dialog, Initialize)

View file

@ -236,4 +236,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_download_item, Initialize);
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_download_item, Initialize);

View file

@ -98,4 +98,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_global_shortcut, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_global_shortcut, Initialize)

View file

@ -112,4 +112,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_in_app_purchase, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_in_app_purchase, Initialize)

View file

@ -228,4 +228,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_menu, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_menu, Initialize)

View file

@ -58,4 +58,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_net, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_net, Initialize)

View file

@ -270,4 +270,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_notification, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_notification, Initialize)

View file

@ -103,4 +103,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_power_monitor, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_power_monitor, Initialize)

View file

@ -133,4 +133,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_power_save_blocker, Initialize);
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_power_save_blocker, Initialize);

View file

@ -253,4 +253,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_protocol, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_protocol, Initialize)

View file

@ -86,5 +86,5 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_render_process_preferences,
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_render_process_preferences,
Initialize)

View file

@ -144,4 +144,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_screen, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_screen, Initialize)

View file

@ -839,4 +839,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_session, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_session, Initialize)

View file

@ -96,4 +96,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_system_preferences, Initialize);
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_system_preferences, Initialize);

View file

@ -250,4 +250,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_tray, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_tray, Initialize)

View file

@ -811,8 +811,7 @@ void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
const GURL& url,
int error_code,
const base::string16& error_description,
bool was_ignored_by_handler) {
const base::string16& error_description) {
bool is_main_frame = !render_frame_host->GetParent();
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
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_web_contents, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_web_contents, Initialize)

View file

@ -343,8 +343,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
void DidFailLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description,
bool was_ignored_by_handler) override;
const base::string16& error_description) override;
void DidStartLoading() override;
void DidStopLoading() override;
void DidGetResourceResponseStart(

View file

@ -52,4 +52,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_web_view_manager, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_browser_web_view_manager, Initialize)

View file

@ -15,6 +15,7 @@
#include "atom/browser/net/atom_cert_verifier.h"
#include "atom/browser/net/atom_network_delegate.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/web_view_manager.h"
#include "atom/common/atom_version.h"
@ -70,8 +71,7 @@ std::string RemoveWhitespace(const std::string& str) {
AtomBrowserContext::AtomBrowserContext(const std::string& partition,
bool in_memory,
const base::DictionaryValue& options)
: brightray::BrowserContext(partition, in_memory),
cookie_delegate_(new AtomCookieDelegate) {
: brightray::BrowserContext(partition, in_memory) {
// Construct user agent string.
Browser* browser = Browser::Get();
std::string name = RemoveWhitespace(browser->GetName());
@ -103,15 +103,17 @@ void AtomBrowserContext::SetUserAgent(const std::string& 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>
AtomBrowserContext::CreateNetworkDelegate() {
return base::MakeUnique<AtomNetworkDelegate>();
}
net::CookieMonsterDelegate* AtomBrowserContext::CreateCookieDelegate() {
return cookie_delegate();
}
std::string AtomBrowserContext::GetUserAgent() {
return user_agent_;
}
@ -203,6 +205,14 @@ std::vector<std::string> AtomBrowserContext::GetCookieableSchemes() {
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) {
pref_registry->RegisterFilePathPref(prefs::kSelectFileLastDirectory,
base::FilePath());

View file

@ -8,9 +8,8 @@
#include <string>
#include <vector>
#include "atom/browser/net/atom_cookie_delegate.h"
#include "base/callback_list.h"
#include "brightray/browser/browser_context.h"
#include "net/cookies/cookie_monster.h"
namespace atom {
@ -19,6 +18,7 @@ class AtomDownloadManagerDelegate;
class AtomNetworkDelegate;
class AtomPermissionManager;
class WebViewManager;
struct CookieDetails;
class AtomBrowserContext : public brightray::BrowserContext {
public:
@ -30,10 +30,13 @@ class AtomBrowserContext : public brightray::BrowserContext {
const base::DictionaryValue& options = base::DictionaryValue());
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:
std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate() override;
net::CookieMonsterDelegate* CreateCookieDelegate() override;
std::string GetUserAgent() override;
std::unique_ptr<net::URLRequestJobFactory> CreateURLRequestJobFactory(
content::ProtocolHandlerMap* protocol_handlers) override;
@ -42,6 +45,9 @@ class AtomBrowserContext : public brightray::BrowserContext {
std::unique_ptr<net::CertVerifier> CreateCertVerifier(
brightray::RequireCTDelegate* ct_delegate) override;
std::vector<std::string> GetCookieableSchemes() override;
void NotifyCookieChange(const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) override;
// content::BrowserContext:
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
@ -52,9 +58,6 @@ class AtomBrowserContext : public brightray::BrowserContext {
void RegisterPrefs(PrefRegistrySimple* pref_registry) override;
AtomBlobReader* GetBlobReader();
AtomCookieDelegate* cookie_delegate() const {
return cookie_delegate_.get();
}
protected:
AtomBrowserContext(const std::string& partition, bool in_memory,
@ -69,7 +72,7 @@ class AtomBrowserContext : public brightray::BrowserContext {
std::string user_agent_;
bool use_cache_;
scoped_refptr<AtomCookieDelegate> cookie_delegate_;
base::CallbackList<void(const CookieDetails*)> cookie_change_sub_list_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserContext);
};

View file

@ -135,8 +135,8 @@ void AtomBrowserMainParts::PostEarlyInitialization() {
node_bindings_->Initialize();
// Create the global environment.
node::Environment* env =
node_bindings_->CreateEnvironment(js_env_->context());
node::Environment* env = node_bindings_->CreateEnvironment(
js_env_->context(), js_env_->platform());
node_env_.reset(new NodeEnvironment(env));
// Enable support for v8 inspector

View file

@ -9,7 +9,7 @@
#include <vector>
#include "base/callback.h"
#include "base/id_map.h"
#include "base/containers/id_map.h"
#include "base/values.h"
#include "content/public/browser/permission_manager.h"
@ -93,7 +93,7 @@ class AtomPermissionManager : public content::PermissionManager {
private:
class PendingRequest;
using PendingRequestsMap = IDMap<std::unique_ptr<PendingRequest>>;
using PendingRequestsMap = base::IDMap<std::unique_ptr<PendingRequest>>;
RequestHandler request_handler_;

View file

@ -31,10 +31,7 @@ bool LaunchXdgUtility(const std::vector<std::string>& argv, int* exit_code) {
if (devnull < 0) return false;
base::LaunchOptions options;
base::FileHandleMappingVector remap;
remap.push_back(std::make_pair(devnull, STDIN_FILENO));
options.fds_to_remap = &remap;
options.fds_to_remap.push_back(std::make_pair(devnull, STDIN_FILENO));
base::Process process = base::LaunchProcess(argv, options);
close(devnull);

View file

@ -15,6 +15,7 @@
#include "gin/v8_initializer.h"
#include "atom/common/node_includes.h"
#include "vendor/node/src/tracing/trace_event.h"
namespace atom {
@ -48,10 +49,10 @@ bool JavascriptEnvironment::Initialize() {
// 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.
platform_ = node::CreatePlatform(
base::RecommendedMaxNumberOfThreadsInPool(3, 8, 0.1, 0),
uv_default_loop(), nullptr);
base::RecommendedMaxNumberOfThreadsInPool(3, 8, 0.1, 0), nullptr);
v8::V8::InitializePlatform(platform_);
node::tracing::TraceEventHelper::SetTracingController(
new v8::TracingController());
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance(),

View file

@ -10,7 +10,7 @@
namespace node {
class Environment;
class NodePlatform;
class MultiIsolatePlatform;
}
namespace atom {
@ -23,7 +23,7 @@ class JavascriptEnvironment {
void OnMessageLoopCreated();
void OnMessageLoopDestroying();
node::NodePlatform* platform() const { return platform_; }
node::MultiIsolatePlatform* platform() const { return platform_; }
v8::Isolate* isolate() const { return isolate_; }
v8::Local<v8::Context> context() const {
return v8::Local<v8::Context>::New(isolate_, context_);
@ -33,7 +33,7 @@ class JavascriptEnvironment {
bool Initialize();
// Leaked on exit.
node::NodePlatform* platform_;
node::MultiIsolatePlatform* platform_;
bool initialized_;
gin::IsolateHolder isolate_holder_;

View file

@ -87,18 +87,17 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
id value = [dict objectForKey:key];
if ([value isKindOfClass:[NSString class]]) {
result->SetStringWithoutPathExpansion(
str_key, base::SysNSStringToUTF8(value));
result->SetKey(str_key, base::Value(base::SysNSStringToUTF8(value)));
} else if ([value isKindOfClass:[NSNumber class]]) {
const char* objc_type = [value objCType];
if (strcmp(objc_type, @encode(BOOL)) == 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 ||
strcmp(objc_type, @encode(float)) == 0)
result->SetDoubleWithoutPathExpansion(str_key, [value doubleValue]);
result->SetKey(str_key, base::Value([value doubleValue]));
else
result->SetIntegerWithoutPathExpansion(str_key, [value intValue]);
result->SetKey(str_key, base::Value([value intValue]));
} else if ([value isKindOfClass:[NSArray class]]) {
std::unique_ptr<base::ListValue> sub_arr = NSArrayToListValue(value);
if (sub_arr)
@ -115,9 +114,8 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
result->SetWithoutPathExpansion(str_key,
base::MakeUnique<base::Value>());
} else {
result->SetStringWithoutPathExpansion(
str_key,
base::SysNSStringToUTF8([value description]));
result->SetKey(str_key,
base::Value(base::SysNSStringToUTF8([value description])));
}
}

View file

@ -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

View file

@ -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_

View file

@ -108,7 +108,7 @@ void ToDictionary(base::DictionaryValue* details,
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
net::HttpRequestHeaders::Iterator it(headers);
while (it.GetNext())
dict->SetStringWithoutPathExpansion(it.name(), it.value());
dict->SetKey(it.name(), base::Value(it.value()));
details->Set("requestHeaders", std::move(dict));
}

View 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_

View file

@ -20,7 +20,7 @@ NodeDebugger::NodeDebugger(node::Environment* env)
NodeDebugger::~NodeDebugger() {
}
void NodeDebugger::Start(node::NodePlatform* platform) {
void NodeDebugger::Start(node::MultiIsolatePlatform* platform) {
auto inspector = env_->inspector_agent();
if (inspector == nullptr)
return;
@ -34,16 +34,16 @@ void NodeDebugger::Start(node::NodePlatform* platform) {
#endif
}
if (options.inspector_enabled()) {
// Set process._debugWaitConnect if --inspect-brk was specified to stop
// the debugger on the first line
if (options.wait_for_connect()) {
mate::Dictionary process(env_->isolate(), env_->process_object());
process.Set("_breakFirstLine", true);
}
inspector->Start(platform, nullptr, options);
// Set process._debugWaitConnect if --inspect-brk was specified to stop
// the debugger on the first line
if (options.wait_for_connect()) {
mate::Dictionary process(env_->isolate(), env_->process_object());
process.Set("_breakFirstLine", true);
}
inspector->Start(static_cast<node::NodePlatform*>(platform), nullptr,
options);
DCHECK(env_->inspector_agent()->IsStarted());
}
} // namespace atom

View file

@ -9,7 +9,7 @@
namespace node {
class Environment;
class NodePlatform;
class MultiIsolatePlatform;
}
namespace atom {
@ -20,7 +20,7 @@ class NodeDebugger {
explicit NodeDebugger(node::Environment* env);
~NodeDebugger();
void Start(node::NodePlatform* platform);
void Start(node::MultiIsolatePlatform* platform);
private:
node::Environment* env_;

View file

@ -14,9 +14,9 @@
#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
#include "cc/output/copy_output_request.h"
#include "cc/scheduler/delay_based_time_source.h"
#include "components/viz/common/frame_sinks/delay_based_time_source.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/render_widget_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
@ -127,11 +127,11 @@ class AtomCopyFrameGenerator {
if (!view_->render_widget_host() || !view_->IsPainting())
return;
std::unique_ptr<cc::CopyOutputRequest> request =
cc::CopyOutputRequest::CreateBitmapRequest(base::Bind(
&AtomCopyFrameGenerator::CopyFromCompositingSurfaceHasResult,
weak_ptr_factory_.GetWeakPtr(),
damage_rect));
std::unique_ptr<viz::CopyOutputRequest> request =
viz::CopyOutputRequest::CreateBitmapRequest(base::Bind(
&AtomCopyFrameGenerator::CopyFromCompositingSurfaceHasResult,
weak_ptr_factory_.GetWeakPtr(),
damage_rect));
request->set_area(gfx::Rect(view_->GetPhysicalBackingSize()));
view_->GetRootLayer()->RequestCopyOfOutput(std::move(request));
@ -145,7 +145,7 @@ class AtomCopyFrameGenerator {
private:
void CopyFromCompositingSurfaceHasResult(
const gfx::Rect& damage_rect,
std::unique_ptr<cc::CopyOutputResult> result) {
std::unique_ptr<viz::CopyOutputResult> result) {
if (result->IsEmpty() || result->size().IsEmpty() ||
!view_->render_widget_host()) {
OnCopyFrameCaptureFailure(damage_rect);
@ -214,12 +214,12 @@ class AtomCopyFrameGenerator {
DISALLOW_COPY_AND_ASSIGN(AtomCopyFrameGenerator);
};
class AtomBeginFrameTimer : public cc::DelayBasedTimeSourceClient {
class AtomBeginFrameTimer : public viz::DelayBasedTimeSourceClient {
public:
AtomBeginFrameTimer(int frame_rate_threshold_us,
const base::Closure& callback)
: callback_(callback) {
time_source_.reset(new cc::DelayBasedTimeSource(
time_source_.reset(new viz::DelayBasedTimeSource(
content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::UI).get()));
time_source_->SetTimebaseAndInterval(
@ -248,7 +248,7 @@ class AtomBeginFrameTimer : public cc::DelayBasedTimeSourceClient {
}
const base::Closure callback_;
std::unique_ptr<cc::DelayBasedTimeSource> time_source_;
std::unique_ptr<viz::DelayBasedTimeSource> time_source_;
DISALLOW_COPY_AND_ASSIGN(AtomBeginFrameTimer);
};
@ -303,9 +303,13 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
ui::ContextFactoryPrivate* context_factory_private =
factory->GetContextFactoryPrivate();
compositor_.reset(
new ui::Compositor(context_factory_private->AllocateFrameSinkId(),
content::GetContextFactory(), context_factory_private,
base::ThreadTaskRunnerHandle::Get(), false));
new ui::Compositor(
context_factory_private->AllocateFrameSinkId(),
content::GetContextFactory(),
context_factory_private,
base::ThreadTaskRunnerHandle::Get(),
false /* enable_surface_synchronization */,
false /* enable_pixel_canvas */));
compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
compositor_->SetRootLayer(root_layer_.get());
#endif
@ -373,11 +377,11 @@ void OffScreenRenderWidgetHostView::SendBeginFrame(
base::TimeTicks deadline = display_time - estimated_browser_composite_time;
const cc::BeginFrameArgs& begin_frame_args =
cc::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE,
begin_frame_source_.source_id(),
begin_frame_number_, frame_time, deadline,
vsync_period, cc::BeginFrameArgs::NORMAL);
const viz::BeginFrameArgs& begin_frame_args =
viz::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE,
begin_frame_source_.source_id(),
begin_frame_number_, frame_time, deadline,
vsync_period, viz::BeginFrameArgs::NORMAL);
DCHECK(begin_frame_args.IsValid());
begin_frame_number_++;
@ -530,7 +534,7 @@ void OffScreenRenderWidgetHostView::UnlockMouse() {
}
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;
if (GetDelegatedFrameHost()) {
GetDelegatedFrameHost()->DidCreateNewRendererCompositorFrameSink(

View file

@ -21,7 +21,8 @@
#include "base/threading/thread.h"
#include "base/time/time.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/renderer_host/compositor_resize_lock.h"
#include "content/browser/renderer_host/delegated_frame_host.h"
@ -118,7 +119,7 @@ class OffScreenRenderWidgetHostView
// content::RenderWidgetHostViewBase:
void DidCreateNewRendererCompositorFrameSink(
cc::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink)
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink)
override;
void SubmitCompositorFrame(const viz::LocalSurfaceId& local_surface_id,
cc::CompositorFrame frame) override;
@ -327,8 +328,8 @@ class OffScreenRenderWidgetHostView
std::unique_ptr<AtomBeginFrameTimer> begin_frame_timer_;
// Provides |source_id| for BeginFrameArgs that we create.
cc::StubBeginFrameSource begin_frame_source_;
uint64_t begin_frame_number_ = cc::BeginFrameArgs::kStartingFrameNumber;
viz::StubBeginFrameSource begin_frame_source_;
uint64_t begin_frame_number_ = viz::BeginFrameArgs::kStartingFrameNumber;
#if defined(OS_MACOSX)
CALayer* background_layer_;
@ -342,7 +343,7 @@ class OffScreenRenderWidgetHostView
std::string selected_text_;
#endif
cc::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_;
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_;
SkColor background_color_;

View file

@ -87,15 +87,12 @@ bool RelaunchAppWithHelper(const base::FilePath& helper,
internal::kRelauncherSyncFD != STDOUT_FILENO &&
internal::kRelauncherSyncFD != STDERR_FILENO,
"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
base::LaunchOptions options;
#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);
#elif defined(OS_WIN)
base::Process process = base::LaunchProcess(

View file

@ -60,14 +60,13 @@ int LaunchProgram(const StringVector& relauncher_args,
// Redirect the stdout of child process to /dev/null, otherwise after
// relaunch the child process will raise exception when writing to stdout.
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;
options.allow_new_privs = true;
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);
return process.IsValid() ? 0 : 1;
}

View file

@ -82,13 +82,12 @@ int LaunchProgram(const StringVector& relauncher_args,
// Redirect the stdout of child process to /dev/null, otherwise after
// relaunch the child process will raise exception when writing to stdout.
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;
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);
return process.IsValid() ? 0 : 1;
}

View file

@ -60,7 +60,7 @@ std::unique_ptr<views::InkDropRipple> SubmenuButton::CreateInkDropRipple()
std::unique_ptr<views::InkDrop> SubmenuButton::CreateInkDrop() {
std::unique_ptr<views::InkDropImpl> ink_drop =
CustomButton::CreateDefaultInkDropImpl();
views::Button::CreateDefaultInkDropImpl();
ink_drop->SetShowHighlightOnHover(false);
return std::move(ink_drop);
}

View file

@ -9,9 +9,9 @@
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/loader/layered_resource_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 "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_request_info_impl.h"
#include "content/browser/loader/stream_resource_handler.h"
@ -217,7 +217,7 @@ bool PdfViewerUI::OnMessageReceived(
content::RenderFrameHost* render_frame_host) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PdfViewerUI, message)
IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnSaveURLAs)
IPC_MESSAGE_HANDLER(AtomFrameHostMsg_PDFSaveURLAs, OnSaveURLAs)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;

View file

@ -8,9 +8,11 @@
#include "base/strings/string16.h"
#include "base/values.h"
#include "content/public/common/common_param_traits.h"
#include "content/public/common/referrer.h"
#include "ipc/ipc_message_macros.h"
#include "ui/gfx/geometry/rect_f.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
// 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.
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 */)

View file

@ -163,4 +163,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_asar, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_asar, Initialize)

View file

@ -255,4 +255,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_clipboard, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_clipboard, Initialize)

View file

@ -61,4 +61,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_crash_reporter, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_crash_reporter, Initialize)

View file

@ -456,7 +456,7 @@ void NativeImage::AddRepresentation(const mate::Dictionary& options) {
// Re-initialize image when first representation is added to an empty image
if (skia_rep_added && IsEmpty()) {
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
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_native_image, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_native_image, Initialize)

View file

@ -151,4 +151,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_shell, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_shell, Initialize)

View file

@ -123,4 +123,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_v8_util, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_v8_util, Initialize)

View file

@ -8,7 +8,7 @@
#ifndef 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
#endif // ATOM_COMMON_CHROME_VERSION_H_

View file

@ -8,6 +8,4 @@
#include "chrome/common/print_messages.h"
#include "chrome/common/tts_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 "components/pdf/common/pdf_messages.h"

View file

@ -221,16 +221,16 @@ Converter<scoped_refptr<ResourceRequestBody>>::ToV8(
post_data_dict->Set("bytes", std::move(bytes));
} else if (type == ResourceRequestBody::Element::TYPE_FILE) {
post_data_dict->SetString("type", "file");
post_data_dict->SetStringWithoutPathExpansion(
"filePath", element.path().AsUTF8Unsafe());
post_data_dict->SetKey("filePath",
base::Value(element.path().AsUTF8Unsafe()));
post_data_dict->SetInteger("offset", static_cast<int>(element.offset()));
post_data_dict->SetInteger("length", static_cast<int>(element.length()));
post_data_dict->SetDouble(
"modificationTime", element.expected_modification_time().ToDoubleT());
} else if (type == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) {
post_data_dict->SetString("type", "fileSystem");
post_data_dict->SetStringWithoutPathExpansion(
"fileSystemURL", element.filesystem_url().spec());
post_data_dict->SetKey("fileSystemURL",
base::Value(element.filesystem_url().spec()));
post_data_dict->SetInteger("offset", static_cast<int>(element.offset()));
post_data_dict->SetInteger("length", static_cast<int>(element.length()));
post_data_dict->SetDouble(

View file

@ -203,7 +203,7 @@ void FillRequestDetails(base::DictionaryValue* details,
details->SetString("method", request->method());
std::string url;
if (!request->url_chain().empty()) url = request->url().spec();
details->SetStringWithoutPathExpansion("url", url);
details->SetKey("url", base::Value(url));
details->SetString("referrer", request->referrer());
std::unique_ptr<base::ListValue> list(new base::ListValue);
GetUploadData(list.get(), request);
@ -239,7 +239,7 @@ void GetUploadData(base::ListValue* upload_data_list,
const net::UploadFileElementReader* file_reader =
reader->AsFileReader();
auto file_path = file_reader->path().AsUTF8Unsafe();
upload_data_dict->SetStringWithoutPathExpansion("file", file_path);
upload_data_dict->SetKey("file", base::Value(file_path));
} else {
const storage::UploadBlobElementReader* blob_reader =
static_cast<storage::UploadBlobElementReader*>(reader.get());

View file

@ -27,45 +27,48 @@
#include "atom/common/node_includes.h"
// Force all builtin modules to be referenced so they can actually run their
// DSO constructors, see http://git.io/DRIqCg.
#define REFERENCE_MODULE(name) \
extern "C" void _register_ ## name(void); \
void (*fp_register_ ## name)(void) = _register_ ## name
// Electron's builtin modules.
REFERENCE_MODULE(atom_browser_app);
REFERENCE_MODULE(atom_browser_auto_updater);
REFERENCE_MODULE(atom_browser_browser_view);
REFERENCE_MODULE(atom_browser_content_tracing);
REFERENCE_MODULE(atom_browser_debugger);
REFERENCE_MODULE(atom_browser_desktop_capturer);
REFERENCE_MODULE(atom_browser_dialog);
REFERENCE_MODULE(atom_browser_download_item);
REFERENCE_MODULE(atom_browser_global_shortcut);
REFERENCE_MODULE(atom_browser_in_app_purchase);
REFERENCE_MODULE(atom_browser_menu);
REFERENCE_MODULE(atom_browser_net);
REFERENCE_MODULE(atom_browser_power_monitor);
REFERENCE_MODULE(atom_browser_power_save_blocker);
REFERENCE_MODULE(atom_browser_protocol);
REFERENCE_MODULE(atom_browser_render_process_preferences);
REFERENCE_MODULE(atom_browser_session);
REFERENCE_MODULE(atom_browser_system_preferences);
REFERENCE_MODULE(atom_browser_tray);
REFERENCE_MODULE(atom_browser_web_contents);
REFERENCE_MODULE(atom_browser_web_view_manager);
REFERENCE_MODULE(atom_browser_window);
REFERENCE_MODULE(atom_common_asar);
REFERENCE_MODULE(atom_common_clipboard);
REFERENCE_MODULE(atom_common_crash_reporter);
REFERENCE_MODULE(atom_common_native_image);
REFERENCE_MODULE(atom_common_notification);
REFERENCE_MODULE(atom_common_screen);
REFERENCE_MODULE(atom_common_shell);
REFERENCE_MODULE(atom_common_v8_util);
REFERENCE_MODULE(atom_renderer_ipc);
REFERENCE_MODULE(atom_renderer_web_frame);
#undef REFERENCE_MODULE
#define ELECTRON_BUILTIN_MODULES(V) \
V(atom_browser_app) \
V(atom_browser_auto_updater) \
V(atom_browser_browser_view) \
V(atom_browser_content_tracing) \
V(atom_browser_debugger) \
V(atom_browser_desktop_capturer) \
V(atom_browser_dialog) \
V(atom_browser_download_item) \
V(atom_browser_global_shortcut) \
V(atom_browser_in_app_purchase) \
V(atom_browser_menu) \
V(atom_browser_net) \
V(atom_browser_power_monitor) \
V(atom_browser_power_save_blocker) \
V(atom_browser_protocol) \
V(atom_browser_render_process_preferences) \
V(atom_browser_session) \
V(atom_browser_system_preferences) \
V(atom_browser_tray) \
V(atom_browser_web_contents) \
V(atom_browser_web_view_manager) \
V(atom_browser_window) \
V(atom_common_asar) \
V(atom_common_clipboard) \
V(atom_common_crash_reporter) \
V(atom_common_native_image) \
V(atom_common_notification) \
V(atom_common_screen) \
V(atom_common_shell) \
V(atom_common_v8_util) \
V(atom_renderer_ipc) \
V(atom_renderer_web_frame)
// This is used to load built-in modules. Instead of using
// __attribute__((constructor)), we call the _register_<modname>
// function for each built-in modules explicitly. This is only
// forward declaration. The definitions are in each module's
// implementation when calling the NODE_BUILTIN_MODULE_CONTEXT_AWARE.
#define V(modname) void _register_##modname();
ELECTRON_BUILTIN_MODULES(V)
#undef V
namespace {
@ -155,6 +158,12 @@ NodeBindings::~NodeBindings() {
stop_and_close_uv_loop(uv_loop_);
}
void NodeBindings::RegisterBuiltinModules() {
#define V(modname) _register_##modname();
ELECTRON_BUILTIN_MODULES(V)
#undef V
}
void NodeBindings::Initialize() {
// Open node's error reporting system for browser process.
node::g_standalone_mode = browser_env_ == BROWSER;
@ -166,6 +175,9 @@ void NodeBindings::Initialize() {
AtomCommandLine::InitializeFromCommandLine();
#endif
// Explicitly register electron's builtin modules.
RegisterBuiltinModules();
// Init node.
// (we assume node::Init would not modify the parameters under embedded mode).
node::Init(nullptr, nullptr, nullptr, nullptr);
@ -180,7 +192,8 @@ void NodeBindings::Initialize() {
}
node::Environment* NodeBindings::CreateEnvironment(
v8::Handle<v8::Context> context) {
v8::Handle<v8::Context> context,
node::MultiIsolatePlatform* platform) {
#if defined(OS_WIN)
auto& atom_args = AtomCommandLine::argv();
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);
node::Environment* env = node::CreateEnvironment(
new node::IsolateData(context->GetIsolate(), uv_loop_), context,
args.size(), c_argv.get(), 0, nullptr);
node::CreateIsolateData(context->GetIsolate(), uv_loop_, platform),
context, args.size(), c_argv.get(), 0, nullptr);
if (browser_env_ == BROWSER) {
// SetAutorunMicrotasks is no longer called in node::CreateEnvironment

View file

@ -17,6 +17,7 @@ class MessageLoop;
namespace node {
class Environment;
class MultiIsolatePlatform;
}
namespace atom {
@ -30,6 +31,7 @@ class NodeBindings {
};
static NodeBindings* Create(BrowserEnvironment browser_env);
static void RegisterBuiltinModules();
virtual ~NodeBindings();
@ -37,7 +39,9 @@ class NodeBindings {
void Initialize();
// 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.
void LoadEnvironment(node::Environment* env);

View file

@ -76,4 +76,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace atom
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_renderer_ipc, atom::api::Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_renderer_ipc, atom::api::Initialize)

View file

@ -20,6 +20,7 @@
#include "third_party/WebKit/public/platform/WebCache.h"
#include "third_party/WebKit/public/web/WebDocument.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/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebScriptExecutionCallback.h"
@ -263,7 +264,7 @@ void WebFrame::InsertText(const std::string& text) {
web_frame_->FrameWidget()
->GetActiveWebInputMethodController()
->CommitText(blink::WebString::FromUTF8(text),
blink::WebVector<blink::WebCompositionUnderline>(),
blink::WebVector<blink::WebImeTextSpan>(),
blink::WebRange(),
0);
}
@ -428,4 +429,4 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_renderer_web_frame, Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_renderer_web_frame, Initialize)

View file

@ -25,6 +25,7 @@
#include "atom/common/node_includes.h"
#include "atom_natives.h" // NOLINT: This file is generated with js2c
#include "vendor/node/src/tracing/trace_event.h"
namespace atom {
@ -95,6 +96,11 @@ void AtomRendererClient::DidCreateScriptContext(
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.
node::Environment* env = node_bindings_->CreateEnvironment(context);

View file

@ -11,6 +11,7 @@
#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/value_converter.h"
#include "atom/common/node_bindings.h"
#include "atom/common/options_switches.h"
#include "atom/renderer/api/atom_api_renderer_ipc.h"
#include "atom/renderer/atom_render_view_observer.h"
@ -136,6 +137,8 @@ class AtomSandboxedRenderViewObserver : public AtomRenderViewObserver {
AtomSandboxedRendererClient::AtomSandboxedRendererClient() {
// Explicitly register electron's builtin modules.
NodeBindings::RegisterBuiltinModules();
}
AtomSandboxedRendererClient::~AtomSandboxedRendererClient() {

View file

@ -21,8 +21,10 @@
'<(libchromiumcontent_src_dir)/skia/config',
'<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
'<(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/WebKit',
'<(libchromiumcontent_src_dir)/third_party/khronos',
'<(libchromiumcontent_dir)/gen',
],
'direct_dependent_settings': {
@ -33,6 +35,7 @@
'<(libchromiumcontent_src_dir)/skia/config',
'<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
'<(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/icu/source/common',
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
@ -69,6 +72,7 @@
],
'libraries': [
'-lpthread',
'-latomic',
'<!@(<(pkg-config) --libs-only-l <(linux_system_libraries))',
],
},
@ -109,6 +113,7 @@
'<(libchromiumcontent_dir)/librtc_base.a',
'<(libchromiumcontent_dir)/librtc_base_approved.a',
'<(libchromiumcontent_dir)/libwebrtc_common.a',
'<(libchromiumcontent_dir)/libinit_webrtc.a',
'<(libchromiumcontent_dir)/libyuv.a',
'<(libchromiumcontent_dir)/librenderer.a',
'<(libchromiumcontent_dir)/libsecurity_state.a',
@ -132,11 +137,10 @@
'<(libchromiumcontent_dir)/libfpdfdoc.a',
'<(libchromiumcontent_dir)/libfpdftext.a',
'<(libchromiumcontent_dir)/libfxcodec.a',
'<(libchromiumcontent_dir)/libfxedit.a',
'<(libchromiumcontent_dir)/libfxge.a',
'<(libchromiumcontent_dir)/libfxjs.a',
'<(libchromiumcontent_dir)/libjavascript.a',
'<(libchromiumcontent_dir)/libpdfwindow.a',
'<(libchromiumcontent_dir)/libpwl.a',
'<(libchromiumcontent_dir)/libfx_agg.a',
'<(libchromiumcontent_dir)/libfx_lcms2.a',
'<(libchromiumcontent_dir)/libfx_libopenjpeg.a',
@ -202,6 +206,7 @@
'<(libchromiumcontent_dir)/librtc_base_approved.a',
'<(libchromiumcontent_dir)/libsystem_wrappers.a',
'<(libchromiumcontent_dir)/libwebrtc_common.a',
'<(libchromiumcontent_dir)/libinit_webrtc.a',
'<(libchromiumcontent_dir)/libyuv.a',
'<(libchromiumcontent_dir)/librenderer.a',
'<(libchromiumcontent_dir)/libsecurity_state.a',
@ -222,11 +227,10 @@
'<(libchromiumcontent_dir)/libfpdftext.a',
'<(libchromiumcontent_dir)/libfxcodec.a',
'<(libchromiumcontent_dir)/libfxcrt.a',
'<(libchromiumcontent_dir)/libfxedit.a',
'<(libchromiumcontent_dir)/libfxge.a',
'<(libchromiumcontent_dir)/libfxjs.a',
'<(libchromiumcontent_dir)/libjavascript.a',
'<(libchromiumcontent_dir)/libpdfwindow.a',
'<(libchromiumcontent_dir)/libpwl.a',
'<(libchromiumcontent_dir)/libfx_agg.a',
'<(libchromiumcontent_dir)/libfx_lcms2.a',
'<(libchromiumcontent_dir)/libfx_libopenjpeg.a',
@ -298,6 +302,7 @@
'<(libchromiumcontent_dir)/rtc_base_approved.lib',
'<(libchromiumcontent_dir)/system_wrappers.lib',
'<(libchromiumcontent_dir)/webrtc_common.lib',
'<(libchromiumcontent_dir)/init_webrtc.lib',
'<(libchromiumcontent_dir)/libyuv.lib',
'<(libchromiumcontent_dir)/renderer.lib',
'<(libchromiumcontent_dir)/security_state.lib',
@ -319,11 +324,10 @@
'<(libchromiumcontent_dir)/fpdftext.lib',
'<(libchromiumcontent_dir)/fxcodec.lib',
'<(libchromiumcontent_dir)/fxcrt.lib',
'<(libchromiumcontent_dir)/fxedit.lib',
'<(libchromiumcontent_dir)/fxge.lib',
'<(libchromiumcontent_dir)/fxjs.lib',
'<(libchromiumcontent_dir)/javascript.lib',
'<(libchromiumcontent_dir)/pdfwindow.lib',
'<(libchromiumcontent_dir)/pwl.lib',
'<(libchromiumcontent_dir)/fx_agg.lib',
'<(libchromiumcontent_dir)/fx_lcms2.lib',
'<(libchromiumcontent_dir)/fx_libopenjpeg.lib',

View file

@ -31,7 +31,7 @@
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
'GCC_ENABLE_CPP_RTTI': 'NO',
'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14',
'MACOSX_DEPLOYMENT_TARGET': '10.9',
'RUN_CLANG_STATIC_ANALYZER': 'YES',
'USE_HEADER_MAP': 'NO',
@ -404,6 +404,7 @@
4702, # unreachable code
4715, # not all control paths return a value
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

View file

@ -97,6 +97,11 @@ void BrowserClient::GetAdditionalAllowedSchemesForFileSystem(
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() {
return &net_log_;
}

View file

@ -45,6 +45,8 @@ class BrowserClient : public content::ContentBrowserClient {
override;
void GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_schemes) override;
void GetAdditionalWebUISchemes(
std::vector<std::string>* additional_schemes) override;
net::NetLog* GetNetLog() override;
base::FilePath GetDefaultDownloadDirectory() override;
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;

View file

@ -105,7 +105,7 @@ void OverrideLinuxAppDataPath() {
}
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(
FROM_HERE, base::Bind(&ui::LogErrorEventDescription, d, *error));
}

View file

@ -90,9 +90,7 @@ void DevToolsManagerDelegate::StartHttpHandler() {
CreateSocketFactory(),
std::string(),
base::FilePath(),
base::FilePath(),
std::string(),
GetBrightrayUserAgent());
base::FilePath());
}
DevToolsManagerDelegate::DevToolsManagerDelegate()

View file

@ -608,7 +608,7 @@ void InspectableWebContentsImpl::GetPreferences(
void InspectableWebContentsImpl::SetPreference(const std::string& name,
const std::string& value) {
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
update.Get()->SetStringWithoutPathExpansion(name, value);
update.Get()->SetKey(name, base::Value(value));
}
void InspectableWebContentsImpl::RemovePreference(const std::string& name) {

View file

@ -12,6 +12,7 @@
#include "net/base/completion_callback.h"
#include "net/base/load_states.h"
#include "net/base/request_priority.h"
#include "net/http/http_raw_request_headers.h"
#include "net/http/http_transaction.h"
namespace brightray {
@ -66,6 +67,10 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
int ResumeNetworkStart() 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:
void Fail();
bool CheckFailed();

View file

@ -29,7 +29,6 @@
#include "net/cert/ct_log_verifier.h"
#include "net/cert/ct_policy_enforcer.h"
#include "net/cert/multi_log_ct_verifier.h"
#include "net/cookies/cookie_monster.h"
#include "net/dns/mapped_host_resolver.h"
#include "net/http/http_auth_filter.h"
#include "net/http/http_auth_handler_factory.h"
@ -100,8 +99,7 @@ URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory(
net::DISK_CACHE,
net::CACHE_BACKEND_DEFAULT,
cache_path,
max_size,
BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE));
max_size);
}
std::unique_ptr<net::CertVerifier>
@ -156,6 +154,21 @@ 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() {
return url_request_context_->host_resolver();
}
@ -184,12 +197,17 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
auto cookie_config = content::CookieStoreConfig(
cookie_path,
content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
nullptr,
delegate_->CreateCookieDelegate());
nullptr);
cookie_config.cookieable_schemes = delegate_->GetCookieableSchemes();
std::unique_ptr<net::CookieStore> cookie_store =
content::CreateCookieStore(cookie_config);
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>(
new net::DefaultChannelIDStore(nullptr)));

View file

@ -11,7 +11,7 @@
#include "base/files/file_path.h"
#include "content/public/browser/browser_context.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/transport_security_state.h"
#include "net/http/url_security_manager.h"
@ -48,9 +48,6 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
virtual std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate() {
return nullptr;
}
virtual net::CookieMonsterDelegate* CreateCookieDelegate() {
return nullptr;
}
virtual std::string GetUserAgent();
virtual std::unique_ptr<net::URLRequestJobFactory>
CreateURLRequestJobFactory(content::ProtocolHandlerMap* protocol_handlers);
@ -60,6 +57,9 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
RequireCTDelegate* ct_delegate);
virtual net::SSLConfigService* CreateSSLConfigService();
virtual std::vector<std::string> GetCookieableSchemes();
virtual void NotifyCookieChange(const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) {}
};
URLRequestContextGetter(
@ -73,6 +73,10 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
content::URLRequestInterceptorScopedVector protocol_interceptors);
virtual ~URLRequestContextGetter();
// net::CookieStore::CookieChangedCallback implementation.
void OnCookieChanged(const net::CanonicalCookie& cookie,
net::CookieStore::ChangeCause cause);
// net::URLRequestContextGetter:
net::URLRequestContext* GetURLRequestContext() override;
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::HttpAuthPreferences> http_auth_preferences_;
std::unique_ptr<net::HttpNetworkSession> http_network_session_;
std::unique_ptr<net::CookieStore::CookieChangedSubscription>
cookie_change_sub_;
content::ProtocolHandlerMap protocol_handlers_;
content::URLRequestInterceptorScopedVector protocol_interceptors_;

View file

@ -95,7 +95,7 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
if (modification_is_removal)
host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, nullptr);
else
host_zoom_dictionary->SetDoubleWithoutPathExpansion(change.host, level);
host_zoom_dictionary->SetKey(change.host, base::Value(level));
}
void ZoomLevelDelegate::ExtractPerHostZoomLevels(

View file

@ -19,7 +19,6 @@
#include "base/macros.h"
#include "base/memory/ptr_util.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 "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"

View file

@ -459,7 +459,7 @@ void PrintJob::HoldUntilStopIsCalled() {
}
void PrintJob::Quit() {
base::MessageLoop::current()->QuitWhenIdle();
base::RunLoop::QuitCurrentWhenIdleDeprecated();
}
// Takes settings_ ownership and will be deleted in the receiving thread.

View file

@ -143,7 +143,7 @@ void PrintViewManagerBase::OnDidPrintPage(
}
std::unique_ptr<PdfMetafileSkia> metafile(
new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
new PdfMetafileSkia(SkiaDocumentType::PDF));
if (metafile_must_be_valid) {
if (!metafile->InitFromData(shared_buf.memory(), params.data_size)) {
NOTREACHED() << "Invalid metafile header";
@ -324,7 +324,7 @@ void PrintViewManagerBase::ShouldQuitFromInnerMessageLoop() {
inside_inner_message_loop_) {
// We are in a message loop created by RenderAllMissingPagesNow. Quit from
// it.
base::MessageLoop::current()->QuitWhenIdle();
base::RunLoop::QuitCurrentWhenIdleDeprecated();
inside_inner_message_loop_ = false;
}
}
@ -433,9 +433,10 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
// memory-bound.
static const int kPrinterSettingsTimeout = 60000;
base::OneShotTimer quit_timer;
quit_timer.Start(
FROM_HERE, TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
base::MessageLoop::current(), &base::MessageLoop::QuitWhenIdle);
base::RunLoop run_loop;
quit_timer.Start(FROM_HERE,
TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
run_loop.QuitWhenIdleClosure());
inside_inner_message_loop_ = true;

View file

@ -9,6 +9,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/common/webplugininfo.h"
#include "content/public/browser/plugin_service.h"
#include "media/media_features.h"
using content::PluginService;
using content::WebPluginInfo;
@ -24,17 +25,17 @@ WidevineCdmMessageFilter::WidevineCdmMessageFilter(
bool WidevineCdmMessageFilter::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(WidevineCdmMessageFilter, message)
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
IPC_MESSAGE_HANDLER(
ChromeViewHostMsg_IsInternalPluginAvailableForMimeType,
OnIsInternalPluginAvailableForMimeType)
#endif
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
IPC_MESSAGE_UNHANDLED(return false)
IPC_END_MESSAGE_MAP()
return true;
}
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
const std::string& mime_type,
bool* is_available,
@ -60,7 +61,7 @@ void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
*is_available = false;
}
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
void WidevineCdmMessageFilter::OnDestruct() const {
BrowserThread::DeleteOnUIThread::Destruct(this);

View file

@ -7,6 +7,7 @@
#include "chrome/common/widevine_cdm_messages.h"
#include "content/public/browser/browser_message_filter.h"
#include "media/media_features.h"
namespace content {
class BrowserContext;
@ -25,7 +26,7 @@ class WidevineCdmMessageFilter : public content::BrowserMessageFilter {
virtual ~WidevineCdmMessageFilter();
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
// Returns whether any internal plugin supporting |mime_type| is registered
// and enabled. Does not determine whether the plugin can actually be
// instantiated (e.g. whether it has all its dependencies).
@ -38,7 +39,7 @@ class WidevineCdmMessageFilter : public content::BrowserMessageFilter {
bool* is_available,
std::vector<base::string16>* additional_param_names,
std::vector<base::string16>* additional_param_values);
#endif
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
int render_process_id_;
content::BrowserContext* browser_context_;

View file

@ -16,6 +16,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths_internal.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/widevine_cdm_common.h"
@ -360,7 +361,7 @@ bool PathProvider(int key, base::FilePath* result) {
#endif
cur = cur.Append(FILE_PATH_LITERAL("pnacl"));
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)
case chrome::DIR_COMPONENT_WIDEVINE_CDM:
if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
@ -376,7 +377,7 @@ bool PathProvider(int key, base::FilePath* result) {
return false;
cur = cur.AppendASCII(kWidevineCdmAdapterFileName);
break;
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
case chrome::FILE_RESOURCES_PACK:
#if defined(OS_MACOSX) && !defined(OS_IOS)
if (base::mac::AmIBundled()) {

View file

@ -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)

View file

@ -7,13 +7,13 @@
#include <vector>
#include "ipc/ipc_message_macros.h"
#include "ppapi/features/features.h"
#include "media/media_features.h"
#define IPC_MESSAGE_START ChromeMsgStart
// Renderer -> Browser messages.
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
// Returns whether any internal plugin supporting |mime_type| is registered and
// enabled. Does not determine whether the plugin can actually be instantiated
// (e.g. whether it has all its dependencies).
@ -26,6 +26,6 @@ IPC_SYNC_MESSAGE_CONTROL1_3(
bool /* is_available */,
std::vector<base::string16> /* additional_param_names */,
std::vector<base::string16> /* additional_param_values */)
#endif
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
// Browser -> Renderer messages.

View file

@ -18,6 +18,7 @@
#include "content/public/renderer/render_thread.h"
#include "media/base/eme_constants.h"
#include "media/base/key_system_properties.h"
#include "media/media_features.h"
// #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
@ -32,7 +33,7 @@
using media::KeySystemProperties;
using media::SupportedCodecs;
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
static const char kExternalClearKeyPepperType[] =
"application/x-ppapi-clearkey-cdm";
@ -264,15 +265,15 @@ static void AddPepperBasedWidevine(
#endif // defined(OS_CHROMEOS)
}
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
void AddChromeKeySystems(
std::vector<std::unique_ptr<KeySystemProperties>>* key_systems_properties) {
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
AddExternalClearKey(key_systems_properties);
#if defined(WIDEVINE_CDM_AVAILABLE)
AddPepperBasedWidevine(key_systems_properties);
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
}

View file

@ -1254,7 +1254,7 @@ bool PrintWebViewHelper::PrintPreviewContext::CreatePreviewDocument(
return false;
}
metafile_.reset(new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
metafile_.reset(new PdfMetafileSkia(SkiaDocumentType::PDF));
CHECK(metafile_->Init());
current_page_index_ = 0;

View file

@ -33,7 +33,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
std::unique_ptr<PdfMetafileSkia> draft_metafile;
PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
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();
}
@ -50,7 +50,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
DCHECK(!draft_metafile.get());
draft_metafile =
print_preview_context_.metafile()->GetMetafileForCurrentPage(
PDF_SKIA_DOCUMENT_TYPE);
SkiaDocumentType::PDF);
}
return PreviewPageRendered(page_number, draft_metafile.get());
@ -58,7 +58,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
bool PrintWebViewHelper::PrintPagesNative(blink::WebLocalFrame* frame,
int page_count) {
PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
PdfMetafileSkia metafile(SkiaDocumentType::PDF);
if (!metafile.Init())
return false;

View file

@ -22,7 +22,7 @@ using blink::WebLocalFrame;
void PrintWebViewHelper::PrintPageInternal(
const PrintMsg_PrintPage_Params& params,
WebLocalFrame* frame) {
PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
PdfMetafileSkia metafile(SkiaDocumentType::PDF);
CHECK(metafile.Init());
int page_number = params.page_number;
@ -60,7 +60,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
is_print_ready_metafile_sent_;
if (render_to_draft) {
draft_metafile.reset(new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
draft_metafile.reset(new PdfMetafileSkia(SkiaDocumentType::PDF));
CHECK(draft_metafile->Init());
initial_render_metafile = draft_metafile.get();
}
@ -80,7 +80,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
DCHECK(!draft_metafile.get());
draft_metafile =
print_preview_context_.metafile()->GetMetafileForCurrentPage(
PDF_SKIA_DOCUMENT_TYPE);
SkiaDocumentType::PDF);
}
}
return PreviewPageRendered(page_number, draft_metafile.get());

View file

@ -30,7 +30,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
std::unique_ptr<PdfMetafileSkia> draft_metafile;
PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
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();
}
@ -49,14 +49,14 @@ bool PrintWebViewHelper::RenderPreviewPage(
DCHECK(!draft_metafile.get());
draft_metafile =
print_preview_context_.metafile()->GetMetafileForCurrentPage(
PDF_SKIA_DOCUMENT_TYPE);
SkiaDocumentType::PDF);
}
return PreviewPageRendered(page_number, draft_metafile.get());
}
bool PrintWebViewHelper::PrintPagesNative(blink::WebLocalFrame* frame,
int page_count) {
PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
PdfMetafileSkia metafile(SkiaDocumentType::PDF);
if (!metafile.Init())
return false;

View file

@ -8,7 +8,6 @@
#include "chrome/common/tts_messages.h"
#include "chrome/common/tts_utterance_request.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/WebSpeechSynthesisVoice.h"
#include "third_party/WebKit/public/platform/WebString.h"

View file

@ -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 */)

View file

@ -4,8 +4,8 @@
#include "components/pdf/renderer/pepper_pdf_host.h"
#include "atom/common/api/api_messages.h"
#include "base/memory/ptr_util.h"
#include "components/pdf/common/pdf_messages.h"
#include "content/public/common/referrer.h"
#include "content/public/renderer/pepper_plugin_instance.h"
#include "content/public/renderer/render_frame.h"
@ -77,8 +77,8 @@ int32_t PepperPDFHost::OnHostMsgSaveAs(
referrer.url = url;
referrer.policy = blink::kWebReferrerPolicyDefault;
referrer = content::Referrer::SanitizeForRequest(url, referrer);
render_frame->Send(
new PDFHostMsg_PDFSaveURLAs(render_frame->GetRoutingID(), url, referrer));
render_frame->Send(new AtomFrameHostMsg_PDFSaveURLAs(
render_frame->GetRoutingID(), url, referrer));
return PP_OK;
}

View file

@ -13,6 +13,8 @@
'component%': 'static_library',
'debug_http2': 'false',
'debug_nghttp2': 'false',
# XXX(alexeykuzmin): Must match the clang version we use. See `clang -v`.
'llvm_version': '6.0',
'python': 'python',
'openssl_fips': '',
'openssl_no_asm': 1,
@ -180,7 +182,9 @@
'-Wl,--no-whole-archive',
],
}, {
'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
'libraries': [
'<@(libchromiumcontent_v8_libraries)',
],
}],
],
}],
@ -241,6 +245,25 @@
}], # 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_disabled_warnings': [

View file

@ -261,8 +261,6 @@
'atom/browser/net/asar/url_request_asar_job.h',
'atom/browser/net/atom_cert_verifier.cc',
'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.h',
'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_mac.mm',
'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.h',
'chromium_src/chrome/common/print_messages.cc',
@ -646,7 +643,6 @@
'chromium_src/chrome/renderer/tts_dispatcher.cc',
'chromium_src/chrome/renderer/tts_dispatcher.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.h',
'chromium_src/extensions/browser/app_window/size_constraints.cc',

View file

@ -85,11 +85,12 @@ def main(args):
def InstallDefaultSysrootForArch(target_arch):
if target_arch not in VALID_ARCHS:
raise Error('Unknown architecture: %s' % target_arch)
InstallSysroot('Jessie', target_arch)
InstallSysroot('Stretch', 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
# it on every build.
linux_dir = os.path.dirname(SCRIPT_DIR)
@ -111,8 +112,6 @@ def InstallSysroot(target_platform, target_arch):
if os.path.exists(stamp):
with open(stamp) as s:
if s.read() == url:
print '%s %s sysroot image already up to date: %s' % \
(target_platform, target_arch, sysroot)
return
print 'Installing Debian %s %s root image: %s' % \

View file

@ -1,56 +1,38 @@
{
"jessie_amd64": {
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
"Sha1Sum": "8b2167b36f3cd85ebbec5c2a39a1842ef613f6a2",
"SysrootDir": "debian_jessie_amd64-sysroot",
"Tarball": "debian_jessie_amd64_sysroot.tgz"
"stretch_amd64": {
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
"Sha1Sum": "69457fddca3500e2dde124f77f8382b0a18d765e",
"SysrootDir": "debian_stretch_amd64-sysroot",
"Tarball": "debian_stretch_amd64_sysroot.tgz"
},
"jessie_arm": {
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
"Sha1Sum": "3fa13635be0c6d8ed461715ad51cdb3809a19422",
"SysrootDir": "debian_jessie_arm-sysroot",
"Tarball": "debian_jessie_arm_sysroot.tgz"
"stretch_arm": {
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
"Sha1Sum": "3e880f69177992ce02b05deeac619f7591b30287",
"SysrootDir": "debian_stretch_arm-sysroot",
"Tarball": "debian_stretch_arm_sysroot.tgz"
},
"jessie_arm64": {
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
"Sha1Sum": "bcf92ed2a033b4b2d1032df3b53eac4910c78fde",
"SysrootDir": "debian_jessie_arm64-sysroot",
"Tarball": "debian_jessie_arm64_sysroot.tgz"
"stretch_arm64": {
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
"Sha1Sum": "8fd58c7d4b38fa3c6785573c6310cf6ca6c88312",
"SysrootDir": "debian_stretch_arm64-sysroot",
"Tarball": "debian_stretch_arm64_sysroot.tgz"
},
"jessie_i386": {
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
"Sha1Sum": "4e83ed9a1b457a1ca59512c3d4823e87e950deb4",
"SysrootDir": "debian_jessie_i386-sysroot",
"Tarball": "debian_jessie_i386_sysroot.tgz"
"stretch_i386": {
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
"Sha1Sum": "1bd14db5eb0466064659126d398b38220013fb38",
"SysrootDir": "debian_stretch_i386-sysroot",
"Tarball": "debian_stretch_i386_sysroot.tgz"
},
"jessie_mips": {
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
"Sha1Sum": "0f550cd150f077a6e749a629e2fda0f0a4348eae",
"SysrootDir": "debian_jessie_mips-sysroot",
"Tarball": "debian_jessie_mips_sysroot.tgz"
"stretch_mips": {
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
"Sha1Sum": "285751660ffab14e6d052c8ddb5c90752a51704d",
"SysrootDir": "debian_stretch_mips-sysroot",
"Tarball": "debian_stretch_mips_sysroot.tgz"
},
"wheezy_amd64": {
"Revision": "d65c31e063bab0486665e087a1b4c5bb7bc7423c",
"Sha1Sum": "fe372c4394ece7fd1d853a205de8c13b46e2f45a",
"SysrootDir": "debian_wheezy_amd64-sysroot",
"Tarball": "debian_wheezy_amd64_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"
"stretch_mips64el": {
"Revision": "02772eaba5440a79c6bd2d9cb7e42fa836950366",
"Sha1Sum": "23f51f29bc35a550092dde41dc823780fdb50f9e",
"SysrootDir": "debian_stretch_mips64el-sysroot",
"Tarball": "debian_stretch_mips64el_sysroot.tgz"
}
}

Some files were not shown because too many files have changed in this diff Show more