Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc

Issue 2762513002: Remove keep-alive impulse IPCs from NaCl modules. (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc
diff --git a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc
index 64d53dbb370fd7cab6fde7069cf52dac8149c437..c6894b053d5928537fcc2cc64c585103ce9a43fa 100644
--- a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc
+++ b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc
@@ -137,11 +137,6 @@ GURL BrowserPpapiHostImpl::GetPluginURLForInstance(PP_Instance instance) {
return it->second->renderer_data.plugin_url;
}
-void BrowserPpapiHostImpl::SetOnKeepaliveCallback(
- const BrowserPpapiHost::OnKeepaliveCallback& callback) {
- on_keepalive_callback_ = callback;
-}
-
bool BrowserPpapiHostImpl::IsPotentiallySecurePluginContext(
PP_Instance instance) {
auto it = instance_map_.find(instance);
@@ -208,7 +203,6 @@ bool BrowserPpapiHostImpl::HostMessageFilter::OnMessageReceived(
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(BrowserPpapiHostImpl::HostMessageFilter, msg)
// Add necessary message handlers here.
- IPC_MESSAGE_HANDLER(PpapiHostMsg_Keepalive, OnKeepalive)
IPC_MESSAGE_HANDLER(PpapiHostMsg_LogInterfaceUsage,
OnHostMsgLogInterfaceUsage)
IPC_MESSAGE_UNHANDLED(handled = ppapi_host_->OnMessageReceived(msg))
@@ -224,11 +218,6 @@ void BrowserPpapiHostImpl::HostMessageFilter::OnHostDestroyed() {
BrowserPpapiHostImpl::HostMessageFilter::~HostMessageFilter() {}
-void BrowserPpapiHostImpl::HostMessageFilter::OnKeepalive() {
- if (browser_ppapi_host_impl_)
- browser_ppapi_host_impl_->OnKeepalive();
-}
-
void BrowserPpapiHostImpl::HostMessageFilter::OnHostMsgLogInterfaceUsage(
int hash) const {
UMA_HISTOGRAM_SPARSE_SLOWLY("Pepper.InterfaceUsed", hash);
@@ -242,33 +231,4 @@ BrowserPpapiHostImpl::InstanceData::InstanceData(
BrowserPpapiHostImpl::InstanceData::~InstanceData() {
}
-void BrowserPpapiHostImpl::OnKeepalive() {
- // An instance has been active. The on_keepalive_callback_ will be
- // used to permit the content embedder to handle this, e.g. by tracking
- // activity and shutting down processes that go idle.
- //
- // Currently embedders do not need to distinguish between instances having
- // different idle state, and thus this implementation handles all instances
- // for this module together.
-
- if (on_keepalive_callback_.is_null())
- return;
-
- BrowserPpapiHost::OnKeepaliveInstanceData instance_data(instance_map_.size());
-
- auto instance = instance_map_.begin();
- int i = 0;
- while (instance != instance_map_.end()) {
- instance_data[i].render_process_id =
- instance->second->renderer_data.render_process_id;
- instance_data[i].render_frame_id =
- instance->second->renderer_data.render_frame_id;
- instance_data[i].document_url =
- instance->second->renderer_data.document_url;
- ++instance;
- ++i;
- }
- on_keepalive_callback_.Run(instance_data, profile_data_directory_);
-}
-
} // namespace content
« no previous file with comments | « content/browser/renderer_host/pepper/browser_ppapi_host_impl.h ('k') | content/public/browser/browser_ppapi_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698