This reverts commit e012801420
.
This commit is contained in:
parent
e012801420
commit
b59e01bdb0
155 changed files with 8352 additions and 9131 deletions
|
@ -50,7 +50,6 @@
|
|||
#include "net/ssl/client_cert_identity.h"
|
||||
#include "net/ssl/ssl_cert_request_info.h"
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
#include "services/service_manager/sandbox/switches.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
|
@ -482,7 +481,7 @@ void OnClientCertificateSelected(
|
|||
if (!certs.empty()) {
|
||||
scoped_refptr<net::X509Certificate> cert(certs[0].get());
|
||||
for (size_t i = 0; i < identities->size(); ++i) {
|
||||
if (cert->EqualsExcludingChain((*identities)[i]->certificate())) {
|
||||
if (cert->Equals((*identities)[i]->certificate())) {
|
||||
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
|
||||
std::move((*identities)[i]),
|
||||
base::Bind(&GotPrivateKey, delegate, std::move(cert)));
|
||||
|
@ -787,21 +786,18 @@ void App::BrowserChildProcessHostDisconnected(
|
|||
ChildProcessDisconnected(base::GetProcId(data.handle));
|
||||
}
|
||||
|
||||
void App::BrowserChildProcessCrashed(
|
||||
const content::ChildProcessData& data,
|
||||
const content::ChildProcessTerminationInfo& info) {
|
||||
void App::BrowserChildProcessCrashed(const content::ChildProcessData& data,
|
||||
int exit_code) {
|
||||
ChildProcessDisconnected(base::GetProcId(data.handle));
|
||||
}
|
||||
|
||||
void App::BrowserChildProcessKilled(
|
||||
const content::ChildProcessData& data,
|
||||
const content::ChildProcessTerminationInfo& info) {
|
||||
void App::BrowserChildProcessKilled(const content::ChildProcessData& data,
|
||||
int exit_code) {
|
||||
ChildProcessDisconnected(base::GetProcId(data.handle));
|
||||
}
|
||||
|
||||
void App::RenderProcessReady(content::RenderProcessHost* host) {
|
||||
ChildProcessLaunched(content::PROCESS_TYPE_RENDERER,
|
||||
host->GetProcess().Handle());
|
||||
ChildProcessLaunched(content::PROCESS_TYPE_RENDERER, host->GetHandle());
|
||||
}
|
||||
|
||||
void App::RenderProcessDisconnected(base::ProcessId host_pid) {
|
||||
|
@ -840,7 +836,7 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
|
|||
base::FilePath path;
|
||||
int key = GetPathConstant(name);
|
||||
if (key >= 0)
|
||||
succeed = base::PathService::Get(key, &path);
|
||||
succeed = PathService::Get(key, &path);
|
||||
if (!succeed)
|
||||
args->ThrowError("Failed to get '" + name + "' path");
|
||||
return path;
|
||||
|
@ -857,8 +853,7 @@ void App::SetPath(mate::Arguments* args,
|
|||
bool succeed = false;
|
||||
int key = GetPathConstant(name);
|
||||
if (key >= 0)
|
||||
succeed =
|
||||
base::PathService::OverrideAndCreateIfNeeded(key, path, true, false);
|
||||
succeed = PathService::OverrideAndCreateIfNeeded(key, path, true, false);
|
||||
if (!succeed)
|
||||
args->ThrowError("Failed to set path");
|
||||
}
|
||||
|
@ -890,7 +885,7 @@ bool App::RequestSingleInstanceLock() {
|
|||
return true;
|
||||
|
||||
base::FilePath user_dir;
|
||||
base::PathService::Get(brightray::DIR_USER_DATA, &user_dir);
|
||||
PathService::Get(brightray::DIR_USER_DATA, &user_dir);
|
||||
|
||||
auto cb = base::Bind(&App::OnSecondInstance, base::Unretained(this));
|
||||
|
||||
|
@ -939,7 +934,7 @@ bool App::Relaunch(mate::Arguments* js_args) {
|
|||
|
||||
if (exec_path.empty()) {
|
||||
base::FilePath current_exe_path;
|
||||
base::PathService::Get(base::FILE_EXE, ¤t_exe_path);
|
||||
PathService::Get(base::FILE_EXE, ¤t_exe_path);
|
||||
argv.push_back(current_exe_path.value());
|
||||
} else {
|
||||
argv.push_back(exec_path.value());
|
||||
|
@ -1193,7 +1188,7 @@ void App::EnableMixedSandbox(mate::Arguments* args) {
|
|||
}
|
||||
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
if (command_line->HasSwitch(service_manager::switches::kNoSandbox)) {
|
||||
if (command_line->HasSwitch(::switches::kNoSandbox)) {
|
||||
#if defined(OS_WIN)
|
||||
const base::CommandLine::CharType* noSandboxArg = L"--no-sandbox";
|
||||
#else
|
||||
|
|
|
@ -162,12 +162,10 @@ class App : public AtomBrowserClient::Delegate,
|
|||
const content::ChildProcessData& data) override;
|
||||
void BrowserChildProcessHostDisconnected(
|
||||
const content::ChildProcessData& data) override;
|
||||
void BrowserChildProcessCrashed(
|
||||
const content::ChildProcessData& data,
|
||||
const content::ChildProcessTerminationInfo& info) override;
|
||||
void BrowserChildProcessKilled(
|
||||
const content::ChildProcessData& data,
|
||||
const content::ChildProcessTerminationInfo& info) override;
|
||||
void BrowserChildProcessCrashed(const content::ChildProcessData& data,
|
||||
int exit_code) override;
|
||||
void BrowserChildProcessKilled(const content::ChildProcessData& data,
|
||||
int exit_code) override;
|
||||
|
||||
private:
|
||||
void SetAppPath(const base::FilePath& app_path);
|
||||
|
|
|
@ -97,7 +97,8 @@ void MenuMac::PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
|
|||
|
||||
[popup_controllers_[window_id] setCloseCallback:close_callback];
|
||||
// Make sure events can be pumped while the menu is up.
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow;
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||
base::MessageLoop::current());
|
||||
|
||||
// One of the events that could be pumped is |window.close()|.
|
||||
// User-initiated event-tracking loops protect against this by
|
||||
|
|
|
@ -396,7 +396,7 @@ void ClearAuthCacheInIO(
|
|||
options.origin, options.realm, options.auth_scheme,
|
||||
net::AuthCredentials(options.username, options.password));
|
||||
} else {
|
||||
auth_cache->ClearAllEntries();
|
||||
auth_cache->ClearEntriesAddedWithin(base::TimeDelta::Max());
|
||||
}
|
||||
} else if (options.type == "clientCertificate") {
|
||||
auto* client_auth_cache = network_session->ssl_client_auth_cache();
|
||||
|
|
|
@ -362,7 +362,7 @@ WebContents::WebContents(v8::Isolate* isolate,
|
|||
}
|
||||
session_.Reset(isolate, session.ToV8());
|
||||
|
||||
std::unique_ptr<content::WebContents> web_contents;
|
||||
content::WebContents* web_contents;
|
||||
if (IsGuest()) {
|
||||
scoped_refptr<content::SiteInstance> site_instance =
|
||||
content::SiteInstance::CreateForURL(session->browser_context(),
|
||||
|
@ -405,7 +405,7 @@ WebContents::WebContents(v8::Isolate* isolate,
|
|||
web_contents = content::WebContents::Create(params);
|
||||
}
|
||||
|
||||
InitWithSessionAndOptions(isolate, web_contents.release(), session, options);
|
||||
InitWithSessionAndOptions(isolate, web_contents, session, options);
|
||||
}
|
||||
|
||||
void WebContents::InitZoomController(content::WebContents* web_contents,
|
||||
|
@ -537,17 +537,16 @@ void WebContents::WebContentsCreated(content::WebContents* source_contents,
|
|||
Emit("-web-contents-created", api_web_contents, target_url, frame_name);
|
||||
}
|
||||
|
||||
void WebContents::AddNewContents(
|
||||
content::WebContents* source,
|
||||
std::unique_ptr<content::WebContents> new_contents,
|
||||
WindowOpenDisposition disposition,
|
||||
const gfx::Rect& initial_rect,
|
||||
bool user_gesture,
|
||||
bool* was_blocked) {
|
||||
new ChildWebContentsTracker(new_contents.get());
|
||||
void WebContents::AddNewContents(content::WebContents* source,
|
||||
content::WebContents* new_contents,
|
||||
WindowOpenDisposition disposition,
|
||||
const gfx::Rect& initial_rect,
|
||||
bool user_gesture,
|
||||
bool* was_blocked) {
|
||||
new ChildWebContentsTracker(new_contents);
|
||||
v8::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
auto api_web_contents = CreateFrom(isolate(), new_contents.release());
|
||||
auto api_web_contents = CreateFrom(isolate(), new_contents);
|
||||
if (Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
|
||||
initial_rect.x(), initial_rect.y(), initial_rect.width(),
|
||||
initial_rect.height())) {
|
||||
|
@ -642,25 +641,21 @@ content::KeyboardEventProcessingResult WebContents::PreHandleKeyboardEvent(
|
|||
return content::KeyboardEventProcessingResult::NOT_HANDLED;
|
||||
}
|
||||
|
||||
void WebContents::EnterFullscreenModeForTab(
|
||||
content::WebContents* source,
|
||||
const GURL& origin,
|
||||
const blink::WebFullscreenOptions& options) {
|
||||
void WebContents::EnterFullscreenModeForTab(content::WebContents* source,
|
||||
const GURL& origin) {
|
||||
auto* permission_helper =
|
||||
WebContentsPermissionHelper::FromWebContents(source);
|
||||
auto callback = base::Bind(&WebContents::OnEnterFullscreenModeForTab,
|
||||
base::Unretained(this), source, origin, options);
|
||||
base::Unretained(this), source, origin);
|
||||
permission_helper->RequestFullscreenPermission(callback);
|
||||
}
|
||||
|
||||
void WebContents::OnEnterFullscreenModeForTab(
|
||||
content::WebContents* source,
|
||||
const GURL& origin,
|
||||
const blink::WebFullscreenOptions& options,
|
||||
bool allowed) {
|
||||
void WebContents::OnEnterFullscreenModeForTab(content::WebContents* source,
|
||||
const GURL& origin,
|
||||
bool allowed) {
|
||||
if (!allowed)
|
||||
return;
|
||||
CommonWebContentsDelegate::EnterFullscreenModeForTab(source, origin, options);
|
||||
CommonWebContentsDelegate::EnterFullscreenModeForTab(source, origin);
|
||||
Emit("enter-html-full-screen");
|
||||
}
|
||||
|
||||
|
@ -762,7 +757,8 @@ content::JavaScriptDialogManager* WebContents::GetJavaScriptDialogManager(
|
|||
return dialog_manager_.get();
|
||||
}
|
||||
|
||||
void WebContents::OnAudioStateChanged(bool audible) {
|
||||
void WebContents::OnAudioStateChanged(content::WebContents* web_contents,
|
||||
bool audible) {
|
||||
Emit("-audio-state-changed", audible);
|
||||
}
|
||||
|
||||
|
@ -1107,7 +1103,7 @@ int WebContents::GetProcessID() const {
|
|||
|
||||
base::ProcessId WebContents::GetOSProcessID() const {
|
||||
base::ProcessHandle process_handle =
|
||||
web_contents()->GetMainFrame()->GetProcess()->GetProcess().Handle();
|
||||
web_contents()->GetMainFrame()->GetProcess()->GetHandle();
|
||||
return base::GetProcId(process_handle);
|
||||
}
|
||||
|
||||
|
@ -1692,7 +1688,8 @@ void WebContents::StartDrag(const mate::Dictionary& item,
|
|||
|
||||
// Start dragging.
|
||||
if (!files.empty()) {
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow;
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||
base::MessageLoop::current());
|
||||
DragFileItems(files, icon->image(), web_contents()->GetNativeView());
|
||||
} else {
|
||||
args->ThrowError("Must specify either 'file' or 'files' option");
|
||||
|
|
|
@ -229,7 +229,6 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
// Callback triggered on permission response.
|
||||
void OnEnterFullscreenModeForTab(content::WebContents* source,
|
||||
const GURL& origin,
|
||||
const blink::WebFullscreenOptions& options,
|
||||
bool allowed);
|
||||
|
||||
// Create window with the given disposition.
|
||||
|
@ -301,7 +300,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
const GURL& target_url,
|
||||
content::WebContents* new_contents) override;
|
||||
void AddNewContents(content::WebContents* source,
|
||||
std::unique_ptr<content::WebContents> new_contents,
|
||||
content::WebContents* new_contents,
|
||||
WindowOpenDisposition disposition,
|
||||
const gfx::Rect& initial_rect,
|
||||
bool user_gesture,
|
||||
|
@ -324,10 +323,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
void EnterFullscreenModeForTab(
|
||||
content::WebContents* source,
|
||||
const GURL& origin,
|
||||
const blink::WebFullscreenOptions& options) override;
|
||||
void EnterFullscreenModeForTab(content::WebContents* source,
|
||||
const GURL& origin) override;
|
||||
void ExitFullscreenModeForTab(content::WebContents* source) override;
|
||||
void RendererUnresponsive(
|
||||
content::WebContents* source,
|
||||
|
@ -358,7 +355,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
const content::BluetoothChooser::EventHandler& handler) override;
|
||||
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
|
||||
content::WebContents* source) override;
|
||||
void OnAudioStateChanged(bool audible) override;
|
||||
void OnAudioStateChanged(content::WebContents* web_contents,
|
||||
bool audible) override;
|
||||
|
||||
// content::WebContentsObserver:
|
||||
void BeforeUnloadFired(const base::TimeTicks& proceed_time) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue