Commit e6633ca7 authored by tommycli's avatar tommycli Committed by Commit bot

Add some missing ENABLE_PLUGINS ifdefs.

This is a spinoff from: https://codereview.chromium.org/680193002/

BUG=NONE

Review URL: https://codereview.chromium.org/688343003

Cr-Commit-Position: refs/heads/master@{#302199}
parent 45e87e9d
......@@ -550,6 +550,7 @@ TEST_F(RenderFrameHostManagerTest, FilterMessagesWhileSwappedOut) {
EXPECT_FALSE(observer.favicon_received());
}
#if defined(ENABLE_PLUGINS)
// The same logic should apply to RenderFrameHosts as well and routing through
// swapped out RFH shouldn't be allowed. Use a PluginCrashObserver to check
// if the IPC message is allowed through or not.
......@@ -560,6 +561,7 @@ TEST_F(RenderFrameHostManagerTest, FilterMessagesWhileSwappedOut) {
ntp_rfh->GetRoutingID(), base::FilePath(), 0)));
EXPECT_FALSE(observer.plugin_crashed());
}
#endif
// We cannot filter out synchronous IPC messages, because the renderer would
// be left waiting for a reply. We pick RunBeforeUnloadConfirm as an example
......
......@@ -493,8 +493,6 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebContentsImpl, message)
IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung)
IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed)
IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse,
OnDomOperationResponse)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeThemeColor,
......@@ -533,6 +531,8 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed)
IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend)
#if defined(ENABLE_PLUGINS)
IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung)
IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed)
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission,
OnRequestPpapiBrokerPermission)
IPC_MESSAGE_HANDLER_GENERIC(BrowserPluginHostMsg_Attach,
......@@ -2885,24 +2885,8 @@ void WebContentsImpl::OnOpenDateTimeDialog(
value.step,
value.suggestions);
}
#endif
void WebContentsImpl::OnPepperPluginHung(int plugin_child_id,
const base::FilePath& path,
bool is_hung) {
UMA_HISTOGRAM_COUNTS("Pepper.PluginHung", 1);
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
PluginHungStatusChanged(plugin_child_id, path, is_hung));
}
void WebContentsImpl::OnPluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
PluginCrashed(plugin_path, plugin_pid));
}
void WebContentsImpl::OnDomOperationResponse(const std::string& json_string,
int automation_id) {
DomOperationNotificationDetails details(json_string, automation_id);
......@@ -2961,6 +2945,21 @@ void WebContentsImpl::OnWebUISend(const GURL& source_url,
}
#if defined(ENABLE_PLUGINS)
void WebContentsImpl::OnPepperPluginHung(int plugin_child_id,
const base::FilePath& path,
bool is_hung) {
UMA_HISTOGRAM_COUNTS("Pepper.PluginHung", 1);
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
PluginHungStatusChanged(plugin_child_id, path, is_hung));
}
void WebContentsImpl::OnPluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
PluginCrashed(plugin_path, plugin_pid));
}
void WebContentsImpl::OnRequestPpapiBrokerPermission(
int routing_id,
const GURL& url,
......@@ -2994,7 +2993,7 @@ void WebContentsImpl::OnBrowserPluginMessage(const IPC::Message& message) {
browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this));
browser_plugin_embedder_->OnMessageReceived(message);
}
#endif
#endif // defined(ENABLE_PLUGINS)
void WebContentsImpl::OnDidDownloadImage(
int id,
......
......@@ -724,10 +724,6 @@ class CONTENT_EXPORT WebContentsImpl
bool success,
const base::string16& user_input);
// Callback function when requesting permission to access the PPAPI broker.
// |result| is true if permission was granted.
void OnPpapiBrokerPermissionResult(int routing_id, bool result);
bool OnMessageReceived(RenderViewHost* render_view_host,
RenderFrameHost* render_frame_host,
const IPC::Message& message);
......@@ -772,11 +768,6 @@ class CONTENT_EXPORT WebContentsImpl
void OnOpenDateTimeDialog(
const ViewHostMsg_DateTimeDialogValue_Params& value);
#endif
void OnPepperPluginHung(int plugin_child_id,
const base::FilePath& path,
bool is_hung);
void OnPluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid);
void OnDomOperationResponse(const std::string& json_string,
int automation_id);
void OnAppCacheAccessed(const GURL& manifest_url, bool blocked_by_policy);
......@@ -788,10 +779,22 @@ class CONTENT_EXPORT WebContentsImpl
void OnWebUISend(const GURL& source_url,
const std::string& name,
const base::ListValue& args);
#if defined(ENABLE_PLUGINS)
void OnPepperPluginHung(int plugin_child_id,
const base::FilePath& path,
bool is_hung);
void OnPluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid);
void OnRequestPpapiBrokerPermission(int routing_id,
const GURL& url,
const base::FilePath& plugin_path);
// Callback function when requesting permission to access the PPAPI broker.
// |result| is true if permission was granted.
void OnPpapiBrokerPermissionResult(int routing_id, bool result);
void OnBrowserPluginMessage(const IPC::Message& message);
#endif // defined(ENABLE_PLUGINS)
void OnDidDownloadImage(int id,
int http_status_code,
const GURL& image_url,
......
......@@ -603,6 +603,7 @@ IPC_MESSAGE_ROUTED2(FrameHostMsg_DomOperationResponse,
std::string /* json_string */,
int /* automation_id */)
#if defined(ENABLE_PLUGINS)
// Sent to the browser when the renderer detects it is blocked on a pepper
// plugin message for too long. This is also sent when it becomes unhung
// (according to the value of is_hung). The browser can give the user the
......@@ -633,6 +634,7 @@ IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo,
bool /* found */,
content::WebPluginInfo /* plugin info */,
std::string /* actual_mime_type */)
#endif // defined(ENABLE_PLUGINS)
// A renderer sends this to the browser process when it wants to
// create a plugin. The browser will create the plugin process if
......
......@@ -748,7 +748,6 @@ void RenderFrameImpl::SimulateImeConfirmComposition(
render_view_->OnImeConfirmComposition(text, replacement_range, false);
}
void RenderFrameImpl::OnImeSetComposition(
const base::string16& text,
const std::vector<blink::WebCompositionUnderline>& underlines,
......@@ -828,7 +827,7 @@ void RenderFrameImpl::OnImeConfirmComposition(
pepper_composition_text_.clear();
}
#endif // ENABLE_PLUGINS
#endif // defined(ENABLE_PLUGINS)
MediaStreamDispatcher* RenderFrameImpl::GetMediaStreamDispatcher() {
if (!web_user_media_client_)
......
......@@ -235,15 +235,14 @@ class CONTENT_EXPORT RenderFrameImpl
// TODO(jam): remove these once the IPC handler moves from RenderView to
// RenderFrame.
void OnImeSetComposition(
const base::string16& text,
const std::vector<blink::WebCompositionUnderline>& underlines,
int selection_start,
int selection_end);
void OnImeConfirmComposition(
const base::string16& text,
const gfx::Range& replacement_range,
bool keep_selection);
#endif // ENABLE_PLUGINS
const base::string16& text,
const std::vector<blink::WebCompositionUnderline>& underlines,
int selection_start,
int selection_end);
void OnImeConfirmComposition(const base::string16& text,
const gfx::Range& replacement_range,
bool keep_selection);
#endif // defined(ENABLE_PLUGINS)
// May return NULL in some cases, especially if userMediaClient() returns
// NULL.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment