diff options
author | Kristian Monsen <kristianm@google.com> | 2011-05-11 20:53:37 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-05-16 13:54:48 +0100 |
commit | 21d179b334e59e9a3bfcaed4c4430bef1bc5759d (patch) | |
tree | 64e2bb6da27af6a5c93ca34f6051584aafbfcb9e /chrome/browser/nacl_host | |
parent | 0c63f00edd6ed0482fd5cbcea937ca088baf7858 (diff) | |
download | external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.zip external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.tar.gz external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.tar.bz2 |
Merge Chromium at 10.0.621.0: Initial merge by git.
Change-Id: I070cc91c608dfa4a968a5a54c173260765ac8097
Diffstat (limited to 'chrome/browser/nacl_host')
-rw-r--r-- | chrome/browser/nacl_host/nacl_broker_host_win.cc | 12 | ||||
-rw-r--r-- | chrome/browser/nacl_host/nacl_broker_host_win.h | 9 | ||||
-rw-r--r-- | chrome/browser/nacl_host/nacl_broker_service_win.cc | 1 | ||||
-rw-r--r-- | chrome/browser/nacl_host/nacl_process_host.cc | 32 | ||||
-rw-r--r-- | chrome/browser/nacl_host/nacl_process_host.h | 19 |
5 files changed, 28 insertions, 45 deletions
diff --git a/chrome/browser/nacl_host/nacl_broker_host_win.cc b/chrome/browser/nacl_host/nacl_broker_host_win.cc index 7cd9bf2..7d0fbea 100644 --- a/chrome/browser/nacl_host/nacl_broker_host_win.cc +++ b/chrome/browser/nacl_host/nacl_broker_host_win.cc @@ -7,7 +7,6 @@ #include "base/command_line.h" #include "base/path_service.h" #include "ipc/ipc_switches.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/nacl_host/nacl_broker_service_win.h" #include "chrome/browser/nacl_host/nacl_process_host.h" #include "chrome/common/chrome_constants.h" @@ -24,12 +23,6 @@ NaClBrokerHost::NaClBrokerHost( NaClBrokerHost::~NaClBrokerHost() { } -URLRequestContext* NaClBrokerHost::GetRequestContext( - uint32 request_id, - const ViewHostMsg_Resource_Request& request_data) { - return NULL; -} - bool NaClBrokerHost::Init() { // Create the channel that will be used for communicating with the broker. if (!CreateChannel()) @@ -53,10 +46,13 @@ bool NaClBrokerHost::Init() { return true; } -void NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) { +bool NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) { + bool handled = true; IPC_BEGIN_MESSAGE_MAP(NaClBrokerHost, msg) IPC_MESSAGE_HANDLER(NaClProcessMsg_LoaderLaunched, OnLoaderLaunched) + IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() + return handled; } bool NaClBrokerHost::LaunchLoader( diff --git a/chrome/browser/nacl_host/nacl_broker_host_win.h b/chrome/browser/nacl_host/nacl_broker_host_win.h index 9e07e3e..27ceb24 100644 --- a/chrome/browser/nacl_host/nacl_broker_host_win.h +++ b/chrome/browser/nacl_host/nacl_broker_host_win.h @@ -7,9 +7,7 @@ #pragma once #include "base/basictypes.h" -#include "base/process.h" #include "chrome/browser/browser_child_process_host.h" -#include "ipc/ipc_message.h" class NaClBrokerHost : public BrowserChildProcessHost { public: @@ -28,11 +26,6 @@ class NaClBrokerHost : public BrowserChildProcessHost { void StopBroker(); private: - // ResourceDispatcherHost::Receiver implementation: - virtual URLRequestContext* GetRequestContext( - uint32 request_id, - const ViewHostMsg_Resource_Request& request_data); - virtual bool CanShutdown() { return true; } // Handler for NaClProcessMsg_LoaderLaunched message @@ -40,7 +33,7 @@ class NaClBrokerHost : public BrowserChildProcessHost { base::ProcessHandle handle); // IPC::Channel::Listener - virtual void OnMessageReceived(const IPC::Message& msg); + virtual bool OnMessageReceived(const IPC::Message& msg); bool stopping_; diff --git a/chrome/browser/nacl_host/nacl_broker_service_win.cc b/chrome/browser/nacl_host/nacl_broker_service_win.cc index d5524ad..602f98e 100644 --- a/chrome/browser/nacl_host/nacl_broker_service_win.cc +++ b/chrome/browser/nacl_host/nacl_broker_service_win.cc @@ -4,7 +4,6 @@ #include "chrome/browser/nacl_host/nacl_broker_service_win.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/nacl_host/nacl_process_host.h" #include "chrome/common/chrome_switches.h" diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc index 8200892..a009702 100644 --- a/chrome/browser/nacl_host/nacl_process_host.cc +++ b/chrome/browser/nacl_host/nacl_process_host.cc @@ -13,7 +13,7 @@ #include "base/command_line.h" #include "base/metrics/nacl_histogram.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/renderer_host/resource_message_filter.h" +#include "chrome/browser/renderer_host/render_message_filter.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "chrome/common/nacl_cmd_line.h" @@ -74,10 +74,10 @@ NaClProcessHost::~NaClProcessHost() { // OnProcessLaunched didn't get called because the process couldn't launch. // Don't keep the renderer hanging. reply_msg_->set_reply_error(); - resource_message_filter_->Send(reply_msg_); + render_message_filter_->Send(reply_msg_); } -bool NaClProcessHost::Launch(ResourceMessageFilter* resource_message_filter, +bool NaClProcessHost::Launch(RenderMessageFilter* render_message_filter, int socket_count, IPC::Message* reply_msg) { #ifdef DISABLE_NACL @@ -116,7 +116,7 @@ bool NaClProcessHost::Launch(ResourceMessageFilter* resource_message_filter, return false; } UmaNaclHistogramEnumeration(NACL_STARTED); - resource_message_filter_ = resource_message_filter; + render_message_filter_ = render_message_filter; reply_msg_ = reply_msg; return true; @@ -163,10 +163,11 @@ void NaClProcessHost::OnProcessLaunchedByBroker(base::ProcessHandle handle) { OnProcessLaunched(); } -bool NaClProcessHost::DidChildCrash() { +base::TerminationStatus NaClProcessHost::GetChildTerminationStatus( + int* exit_code) { if (running_on_wow64_) - return base::DidProcessCrash(NULL, handle()); - return BrowserChildProcessHost::DidChildCrash(); + return base::GetTerminationStatus(handle(), exit_code); + return BrowserChildProcessHost::GetChildTerminationStatus(exit_code); } void NaClProcessHost::OnChildDied() { @@ -186,7 +187,7 @@ void NaClProcessHost::OnProcessLaunched() { HANDLE handle_in_renderer; DuplicateHandle(base::GetCurrentProcessHandle(), reinterpret_cast<HANDLE>(sockets_for_renderer_[i]), - resource_message_filter_->handle(), + render_message_filter_->peer_handle(), &handle_in_renderer, GENERIC_READ | GENERIC_WRITE, FALSE, @@ -207,7 +208,7 @@ void NaClProcessHost::OnProcessLaunched() { // Copy the process handle into the renderer process. DuplicateHandle(base::GetCurrentProcessHandle(), handle(), - resource_message_filter_->handle(), + render_message_filter_->peer_handle(), &nacl_process_handle, PROCESS_DUP_HANDLE, FALSE, @@ -222,8 +223,8 @@ void NaClProcessHost::OnProcessLaunched() { ViewHostMsg_LaunchNaCl::WriteReplyParams( reply_msg_, handles_for_renderer, nacl_process_handle, nacl_process_id); - resource_message_filter_->Send(reply_msg_); - resource_message_filter_ = NULL; + render_message_filter_->Send(reply_msg_); + render_message_filter_ = NULL; reply_msg_ = NULL; sockets_for_renderer_.clear(); @@ -281,14 +282,13 @@ void NaClProcessHost::SendStartMessage() { sockets_for_sel_ldr_.clear(); } -void NaClProcessHost::OnMessageReceived(const IPC::Message& msg) { +bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) { NOTREACHED() << "Invalid message with type = " << msg.type(); + return false; } -URLRequestContext* NaClProcessHost::GetRequestContext( - uint32 request_id, - const ViewHostMsg_Resource_Request& request_data) { - return NULL; +bool NaClProcessHost::CanShutdown() { + return true; } #if defined(OS_WIN) diff --git a/chrome/browser/nacl_host/nacl_process_host.h b/chrome/browser/nacl_host/nacl_process_host.h index 618492a..c0d5731 100644 --- a/chrome/browser/nacl_host/nacl_process_host.h +++ b/chrome/browser/nacl_host/nacl_process_host.h @@ -13,7 +13,7 @@ #include "chrome/common/nacl_types.h" #include "native_client/src/shared/imc/nacl_imc.h" -class ResourceMessageFilter; +class RenderMessageFilter; // Represents the browser side of the browser <--> NaCl communication // channel. There will be one NaClProcessHost per NaCl process @@ -28,16 +28,16 @@ class NaClProcessHost : public BrowserChildProcessHost { ~NaClProcessHost(); // Initialize the new NaCl process, returning true on success. - bool Launch(ResourceMessageFilter* resource_message_filter, + bool Launch(RenderMessageFilter* render_message_filter, int socket_count, IPC::Message* reply_msg); - virtual void OnMessageReceived(const IPC::Message& msg); + virtual bool OnMessageReceived(const IPC::Message& msg); void OnProcessLaunchedByBroker(base::ProcessHandle handle); protected: - virtual bool DidChildCrash(); + virtual base::TerminationStatus GetChildTerminationStatus(int* exit_code); virtual void OnChildDied(); private: @@ -47,12 +47,7 @@ class NaClProcessHost : public BrowserChildProcessHost { virtual void OnProcessLaunched(); - // ResourceDispatcherHost::Receiver implementation: - virtual URLRequestContext* GetRequestContext( - uint32 request_id, - const ViewHostMsg_Resource_Request& request_data); - - virtual bool CanShutdown() { return true; } + virtual bool CanShutdown(); #if defined(OS_WIN) // Check whether the browser process is running on WOW64 - Windows only @@ -62,9 +57,9 @@ class NaClProcessHost : public BrowserChildProcessHost { private: ResourceDispatcherHost* resource_dispatcher_host_; - // The ResourceMessageFilter that requested this NaCl process. We use this + // The RenderMessageFilter that requested this NaCl process. We use this // for sending the reply once the process has started. - scoped_refptr<ResourceMessageFilter> resource_message_filter_; + scoped_refptr<RenderMessageFilter> render_message_filter_; // The reply message to send. IPC::Message* reply_msg_; |