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

Side by Side Diff: chrome/common/plugin_utils.cc

Issue 2367553002: [HBD] Merge two identical ShouldUseJavaScriptSettingForPlugin impls (Closed)
Patch Set: merge origin/master Created 4 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/common/plugin_utils.h"
6
7 #include "base/strings/utf_string_conversions.h"
8 #include "content/public/common/webplugininfo.h"
9 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
10
11 #if !defined(DISABLE_NACL)
12 #include "components/nacl/common/nacl_constants.h"
13 #endif
14
15 // For certain sandboxed Pepper plugins, use the JavaScript Content Settings.
Lei Zhang 2016/09/23 05:00:51 Put this in the header?
tommycli 2016/09/23 16:46:45 Done.
16 bool ShouldUseJavaScriptSettingForPlugin(const content::WebPluginInfo& plugin) {
17 if (plugin.type != content::WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS &&
18 plugin.type !=
19 content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) {
20 return false;
21 }
22
23 #if !defined(DISABLE_NACL)
24 // Treat Native Client invocations like JavaScript.
25 if (plugin.name == base::ASCIIToUTF16(nacl::kNaClPluginName))
26 return true;
27 #endif
28
29 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
30 // Treat CDM invocations like JavaScript.
31 if (plugin.name == base::ASCIIToUTF16(kWidevineCdmDisplayName)) {
32 DCHECK_EQ(content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS,
33 plugin.type);
34 return true;
35 }
36 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
37
38 return false;
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698