Append --iframe-security to renderer process.
This commit is contained in:
parent
9a58706e1f
commit
a0b15661ed
6 changed files with 39 additions and 4 deletions
|
@ -4,9 +4,15 @@
|
|||
|
||||
#include "browser/atom_browser_client.h"
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "browser/atom_browser_context.h"
|
||||
#include "browser/atom_browser_main_parts.h"
|
||||
#include "browser/native_window.h"
|
||||
#include "browser/net/atom_url_request_context_getter.h"
|
||||
#include "browser/window_list.h"
|
||||
#include "common/options_switches.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "webkit/common/webpreferences.h"
|
||||
|
||||
namespace atom {
|
||||
|
@ -54,6 +60,23 @@ bool AtomBrowserClient::ShouldSwapProcessesForNavigation(
|
|||
return true;
|
||||
}
|
||||
|
||||
void AtomBrowserClient::AppendExtraCommandLineSwitches(
|
||||
CommandLine* command_line,
|
||||
int child_process_id) {
|
||||
// Append --iframe-security to renderer process.
|
||||
WindowList* list = WindowList::GetInstance();
|
||||
for (WindowList::const_iterator iter = list->begin(); iter != list->end();
|
||||
++iter) {
|
||||
NativeWindow* window = *iter;
|
||||
int id = window->GetWebContents()->GetRenderProcessHost()->GetID();
|
||||
if (id == child_process_id) {
|
||||
command_line->AppendSwitchASCII(switches::kIframeSecurity,
|
||||
window->iframe_security());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
|
||||
const content::MainFunctionParams&) {
|
||||
return new AtomBrowserMainParts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue