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

Side by Side Diff: chrome/browser/renderer_host/plugin_info_message_filter.cc

Issue 10977003: Merge 158364 - Handle crashing Pepper plug-ins the same as crashing NPAPI plug-ins. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1229/src/
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/ppapi_plugin_process_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_host/plugin_info_message_filter.h" 5 #include "chrome/browser/renderer_host/plugin_info_message_filter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/content_settings/content_settings_utils.h" 10 #include "chrome/browser/content_settings/content_settings_utils.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 if (allow_outdated_plugins_.IsManaged()) { 178 if (allow_outdated_plugins_.IsManaged()) {
179 status->value = 179 status->value =
180 ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedDisallowed; 180 ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedDisallowed;
181 } else { 181 } else {
182 status->value = ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked; 182 status->value = ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked;
183 } 183 }
184 return; 184 return;
185 } 185 }
186 186
187 // Check if the plug-in requires authorization. 187 // Check if the plug-in requires authorization.
188 if ((plugin_status == 188 if (plugin_status ==
189 PluginInstaller::SECURITY_STATUS_REQUIRES_AUTHORIZATION || 189 PluginInstaller::SECURITY_STATUS_REQUIRES_AUTHORIZATION &&
190 PluginService::GetInstance()->IsPluginUnstable(plugin.path)) &&
191 plugin.type != WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS && 190 plugin.type != WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS &&
192 plugin.type != WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS && 191 plugin.type != WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS &&
193 !always_authorize_plugins_.GetValue() && 192 !always_authorize_plugins_.GetValue() &&
194 plugin_setting != CONTENT_SETTING_BLOCK && 193 plugin_setting != CONTENT_SETTING_BLOCK &&
195 uses_default_content_setting) { 194 uses_default_content_setting) {
196 status->value = ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized; 195 status->value = ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized;
197 return; 196 return;
198 } 197 }
198
199 // Check if the plug-in is crashing too much.
200 if (PluginService::GetInstance()->IsPluginUnstable(plugin.path) &&
201 !always_authorize_plugins_.GetValue() &&
202 plugin_setting != CONTENT_SETTING_BLOCK &&
203 uses_default_content_setting) {
204 status->value = ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized;
205 return;
206 }
199 #endif 207 #endif
200 208
201 if (plugin_setting == CONTENT_SETTING_ASK) 209 if (plugin_setting == CONTENT_SETTING_ASK)
202 status->value = ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay; 210 status->value = ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay;
203 else if (plugin_setting == CONTENT_SETTING_BLOCK) 211 else if (plugin_setting == CONTENT_SETTING_BLOCK)
204 status->value = ChromeViewHostMsg_GetPluginInfo_Status::kBlocked; 212 status->value = ChromeViewHostMsg_GetPluginInfo_Status::kBlocked;
205 } 213 }
206 214
207 bool PluginInfoMessageFilter::Context::FindEnabledPlugin( 215 bool PluginInfoMessageFilter::Context::FindEnabledPlugin(
208 int render_view_id, 216 int render_view_id,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 policy_url, plugin_url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string(), 288 policy_url, plugin_url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string(),
281 &info)); 289 &info));
282 } 290 }
283 } 291 }
284 *setting = content_settings::ValueToContentSetting(value.get()); 292 *setting = content_settings::ValueToContentSetting(value.get());
285 *uses_default_content_setting = 293 *uses_default_content_setting =
286 !uses_plugin_specific_setting && 294 !uses_plugin_specific_setting &&
287 info.primary_pattern == ContentSettingsPattern::Wildcard() && 295 info.primary_pattern == ContentSettingsPattern::Wildcard() &&
288 info.secondary_pattern == ContentSettingsPattern::Wildcard(); 296 info.secondary_pattern == ContentSettingsPattern::Wildcard();
289 } 297 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/ppapi_plugin_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698