Don't fork renderer process for guest

This commit is contained in:
Cheng Zhao 2014-10-24 18:44:15 +08:00
parent 4ccb0cccf3
commit 58a38d90b8
10 changed files with 25 additions and 36 deletions

View file

@ -160,7 +160,7 @@ content::WebContents* WebContents::CreateNewGuestWindow(
void WebContents::DidAttach() {
base::ListValue args;
args.Append(extra_params_.release());
Emit("internal-did-attach", args);
Emit("did-attach", args);
}
int WebContents::GetGuestInstanceID() const {

View file

@ -26,10 +26,6 @@ module.exports.wrap = (webContents) ->
webContents.getId = -> "#{@getProcessId()}-#{@getRoutingId()}"
webContents.equal = (other) -> @getId() is other.getId()
# Set frame name of WebContents.
webContents.setName = (name) ->
@send 'ATOM_SHELL_WEB_CONTENTS_SET_NAME', name
# Tell the rpc server that a render view has been deleted and we need to
# release all objects owned by it.
webContents.on 'render-view-deleted', (event, processId, routingId) ->

View file

@ -11,6 +11,7 @@
#include "atom/browser/atom_speech_recognition_manager_delegate.h"
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
#include "base/command_line.h"
#include "chrome/browser/printing/printing_message_filter.h"
#include "chrome/browser/speech/tts_message_filter.h"
#include "content/public/browser/render_process_host.h"
@ -148,6 +149,9 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
if (window != NULL)
window->AppendExtraCommandLineSwitches(command_line, child_process_id);
else
// If we can not find a owner window then it is a guest web view.
command_line->AppendSwitch("guest");
dying_render_process_ = NULL;
}

View file

@ -26,7 +26,7 @@ createGuest = (embedder, params) ->
destroyGuest id
# Init guest web view after attached.
guest.once 'internal-did-attach', (event, params) ->
guest.once 'did-attach', (event, params) ->
min = width: params.minwidth, height: params.minheight
max = width: params.maxwidth, height: params.maxheight
@setAutoSize params.autosize, min, max