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

Side by Side Diff: content/common/pepper_plugin_list.cc

Issue 791923003: replace COMPILE_ASSERT with static_assert in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixups Created 5 years, 11 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
« no previous file with comments | « content/common/input/web_input_event_traits.cc ('k') | content/common/sandbox_mac.mm » ('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 "content/common/pepper_plugin_list.h" 5 #include "content/common/pepper_plugin_list.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 13 matching lines...) Expand all
24 // Appends any plugins from the command line to the given vector. 24 // Appends any plugins from the command line to the given vector.
25 void ComputePluginsFromCommandLine(std::vector<PepperPluginInfo>* plugins) { 25 void ComputePluginsFromCommandLine(std::vector<PepperPluginInfo>* plugins) {
26 // On Linux, once we're sandboxed, we can't know if a plugin is available or 26 // On Linux, once we're sandboxed, we can't know if a plugin is available or
27 // not. But (on Linux) this function is always called once before we're 27 // not. But (on Linux) this function is always called once before we're
28 // sandboxed. So when this function is called for the first time we set a 28 // sandboxed. So when this function is called for the first time we set a
29 // flag if the plugin file is available. Then we can skip the check on file 29 // flag if the plugin file is available. Then we can skip the check on file
30 // existence in subsequent calls if the flag is set. 30 // existence in subsequent calls if the flag is set.
31 // NOTE: In theory we could have unlimited number of plugins registered in 31 // NOTE: In theory we could have unlimited number of plugins registered in
32 // command line. But in practice, 64 plugins should be more than enough. 32 // command line. But in practice, 64 plugins should be more than enough.
33 static uint64 skip_file_check_flags = 0; 33 static uint64 skip_file_check_flags = 0;
34 COMPILE_ASSERT( 34 static_assert(
35 kMaxPluginsToRegisterFromCommandLine <= sizeof(skip_file_check_flags) * 8, 35 kMaxPluginsToRegisterFromCommandLine <= sizeof(skip_file_check_flags) * 8,
36 max_plugins_to_register_from_command_line_exceeds_limit); 36 "max plugins to register from command line exceeds limit");
37 37
38 bool out_of_process = true; 38 bool out_of_process = true;
39 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 39 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
40 switches::kPpapiInProcess)) 40 switches::kPpapiInProcess))
41 out_of_process = false; 41 out_of_process = false;
42 42
43 const std::string value = 43 const std::string value =
44 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 44 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
45 switches::kRegisterPepperPlugins); 45 switches::kRegisterPepperPlugins);
46 if (value.empty()) 46 if (value.empty())
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 return true; 144 return true;
145 } 145 }
146 146
147 void ComputePepperPluginList(std::vector<PepperPluginInfo>* plugins) { 147 void ComputePepperPluginList(std::vector<PepperPluginInfo>* plugins) {
148 GetContentClient()->AddPepperPlugins(plugins); 148 GetContentClient()->AddPepperPlugins(plugins);
149 ComputePluginsFromCommandLine(plugins); 149 ComputePluginsFromCommandLine(plugins);
150 } 150 }
151 151
152 } // namespace content 152 } // namespace content
OLDNEW
« no previous file with comments | « content/common/input/web_input_event_traits.cc ('k') | content/common/sandbox_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698