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

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

Issue 10689076: Disable bundled PPAPI Flash on Linux ia32 when SSE2 is not available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | no next file » | 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/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/cpu.h"
8 #include "base/file_util.h" 9 #include "base/file_util.h"
9 #include "base/path_service.h" 10 #include "base/path_service.h"
10 #include "base/process_util.h" 11 #include "base/process_util.h"
11 #include "base/string_number_conversions.h" 12 #include "base/string_number_conversions.h"
12 #include "base/string_split.h" 13 #include "base/string_split.h"
13 #include "base/string_util.h" 14 #include "base/string_util.h"
14 #include "base/stringprintf.h" 15 #include "base/stringprintf.h"
15 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "build/build_config.h"
16 #include "chrome/common/child_process_logging.h" 18 #include "chrome/common/child_process_logging.h"
17 #include "chrome/common/chrome_paths.h" 19 #include "chrome/common/chrome_paths.h"
18 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
19 #include "chrome/common/chrome_version_info.h" 21 #include "chrome/common/chrome_version_info.h"
20 #include "chrome/common/pepper_flash.h" 22 #include "chrome/common/pepper_flash.h"
21 #include "chrome/common/render_messages.h" 23 #include "chrome/common/render_messages.h"
22 #include "chrome/common/url_constants.h" 24 #include "chrome/common/url_constants.h"
23 #include "content/public/common/content_switches.h" 25 #include "content/public/common/content_switches.h"
24 #include "content/public/common/pepper_plugin_info.h" 26 #include "content/public/common/pepper_plugin_info.h"
25 #include "content/public/common/url_constants.h" 27 #include "content/public/common/url_constants.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the 253 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the
252 // command-line. 254 // command-line.
253 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kPpapiFlashPath)) 255 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kPpapiFlashPath))
254 return false; 256 return false;
255 257
256 bool force_disable = CommandLine::ForCurrentProcess()->HasSwitch( 258 bool force_disable = CommandLine::ForCurrentProcess()->HasSwitch(
257 switches::kDisableBundledPpapiFlash); 259 switches::kDisableBundledPpapiFlash);
258 if (force_disable) 260 if (force_disable)
259 return false; 261 return false;
260 262
263 // For Linux ia32, Flapper requires SSE2.
264 #if defined(OS_LINUX) && defined(ARCH_CPU_X86)
265 if (!base::CPU()::has_sse2())
266 return false;
267 #endif // ARCH_CPU_X86
268
261 FilePath flash_path; 269 FilePath flash_path;
262 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) 270 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path))
263 return false; 271 return false;
264 // It is an error to have FLAPPER_AVAILABLE defined but then not having the 272 // It is an error to have FLAPPER_AVAILABLE defined but then not having the
265 // plugin file in place, but this happens in Chrome OS builds. 273 // plugin file in place, but this happens in Chrome OS builds.
266 // Use --disable-bundled-ppapi-flash to skip this. 274 // Use --disable-bundled-ppapi-flash to skip this.
267 DCHECK(file_util::PathExists(flash_path)); 275 DCHECK(file_util::PathExists(flash_path));
268 276
269 bool force_enable = CommandLine::ForCurrentProcess()->HasSwitch( 277 bool force_enable = CommandLine::ForCurrentProcess()->HasSwitch(
270 switches::kEnableBundledPpapiFlash); 278 switches::kEnableBundledPpapiFlash);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 514
507 bool ChromeContentClient::GetBundledFieldTrialPepperFlash( 515 bool ChromeContentClient::GetBundledFieldTrialPepperFlash(
508 content::PepperPluginInfo* plugin, 516 content::PepperPluginInfo* plugin,
509 bool* override_npapi_flash) { 517 bool* override_npapi_flash) {
510 if (!ConductingPepperFlashFieldTrial()) 518 if (!ConductingPepperFlashFieldTrial())
511 return false; 519 return false;
512 return GetBundledPepperFlash(plugin, override_npapi_flash); 520 return GetBundledPepperFlash(plugin, override_npapi_flash);
513 } 521 }
514 522
515 } // namespace chrome 523 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698