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

Side by Side Diff: content/plugin/plugin_main_linux.cc

Issue 11231016: Move content's a plugin, ppapi_plugin, utility, and worker subdirectories to the content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac 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 | « content/plugin/plugin_main.cc ('k') | content/plugin/plugin_main_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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <signal.h> 5 #include <signal.h>
6 #include <string.h> 6 #include <string.h>
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <syscall.h> 8 #include <syscall.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 12
13 // This whole file is only useful on 64-bit architectures. 13 // This whole file is only useful on 64-bit architectures.
14 #if defined(ARCH_CPU_64_BITS) 14 #if defined(ARCH_CPU_64_BITS)
15 15
16 namespace content {
17
16 namespace { 18 namespace {
17 19
18 // Signal handler for SIGILL; see WorkaroundFlashLAHF(). 20 // Signal handler for SIGILL; see WorkaroundFlashLAHF().
19 void SignalHandler(int signum, siginfo_t* info, void* void_context) { 21 void SignalHandler(int signum, siginfo_t* info, void* void_context) {
20 const char kLAHFInstruction = 0x9f; 22 const char kLAHFInstruction = 0x9f;
21 ucontext_t* context = static_cast<ucontext_t*>(void_context); 23 ucontext_t* context = static_cast<ucontext_t*>(void_context);
22 greg_t* regs = context->uc_mcontext.gregs; 24 greg_t* regs = context->uc_mcontext.gregs;
23 char instruction = *reinterpret_cast<char*>(regs[REG_RIP]); 25 char instruction = *reinterpret_cast<char*>(regs[REG_RIP]);
24 26
25 // Check whether this is the kind of SIGILL we care about. 27 // Check whether this is the kind of SIGILL we care about.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // particular circumstance, emulating the instruction, and resuming. 62 // particular circumstance, emulating the instruction, and resuming.
61 // This function registers the signal handler. 63 // This function registers the signal handler.
62 void WorkaroundFlashLAHF() { 64 void WorkaroundFlashLAHF() {
63 struct sigaction action = { { NULL } }; 65 struct sigaction action = { { NULL } };
64 action.sa_flags = SA_SIGINFO; 66 action.sa_flags = SA_SIGINFO;
65 action.sa_sigaction = &SignalHandler; 67 action.sa_sigaction = &SignalHandler;
66 68
67 sigaction(SIGILL, &action, NULL); 69 sigaction(SIGILL, &action, NULL);
68 } 70 }
69 71
72 } // namespace content
73
70 #endif // defined(ARCH_CPU_64_BITS) 74 #endif // defined(ARCH_CPU_64_BITS)
OLDNEW
« no previous file with comments | « content/plugin/plugin_main.cc ('k') | content/plugin/plugin_main_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698