When a render process is crashed, it might be reused
This commit is contained in:
parent
5d2452608d
commit
83f01096c0
2 changed files with 10 additions and 0 deletions
|
@ -140,6 +140,11 @@ void AtomBrowserClient::RemoveProcessPreferences(int process_id) {
|
||||||
process_preferences_.erase(process_id);
|
process_preferences_.erase(process_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AtomBrowserClient::IsProcessObserved(int process_id) {
|
||||||
|
base::AutoLock auto_lock(process_preferences_lock_);
|
||||||
|
return process_preferences_.find(process_id) != process_preferences_.end();
|
||||||
|
}
|
||||||
|
|
||||||
bool AtomBrowserClient::IsRendererSandboxed(int process_id) {
|
bool AtomBrowserClient::IsRendererSandboxed(int process_id) {
|
||||||
base::AutoLock auto_lock(process_preferences_lock_);
|
base::AutoLock auto_lock(process_preferences_lock_);
|
||||||
auto it = process_preferences_.find(process_id);
|
auto it = process_preferences_.find(process_id);
|
||||||
|
@ -160,7 +165,11 @@ bool AtomBrowserClient::RendererDisablesPopups(int process_id) {
|
||||||
|
|
||||||
void AtomBrowserClient::RenderProcessWillLaunch(
|
void AtomBrowserClient::RenderProcessWillLaunch(
|
||||||
content::RenderProcessHost* host) {
|
content::RenderProcessHost* host) {
|
||||||
|
// When a render process is crashed, it might be reused.
|
||||||
int process_id = host->GetID();
|
int process_id = host->GetID();
|
||||||
|
if (IsProcessObserved(process_id))
|
||||||
|
return;
|
||||||
|
|
||||||
host->AddFilter(new printing::PrintingMessageFilter(process_id));
|
host->AddFilter(new printing::PrintingMessageFilter(process_id));
|
||||||
host->AddFilter(new TtsMessageFilter(process_id, host->GetBrowserContext()));
|
host->AddFilter(new TtsMessageFilter(process_id, host->GetBrowserContext()));
|
||||||
host->AddFilter(
|
host->AddFilter(
|
||||||
|
|
|
@ -126,6 +126,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
||||||
};
|
};
|
||||||
void AddProcessPreferences(int process_id, ProcessPreferences prefs);
|
void AddProcessPreferences(int process_id, ProcessPreferences prefs);
|
||||||
void RemoveProcessPreferences(int process_id);
|
void RemoveProcessPreferences(int process_id);
|
||||||
|
bool IsProcessObserved(int process_id);
|
||||||
bool IsRendererSandboxed(int process_id);
|
bool IsRendererSandboxed(int process_id);
|
||||||
bool RendererUsesNativeWindowOpen(int process_id);
|
bool RendererUsesNativeWindowOpen(int process_id);
|
||||||
bool RendererDisablesPopups(int process_id);
|
bool RendererDisablesPopups(int process_id);
|
||||||
|
|
Loading…
Reference in a new issue