| OLD | NEW |
| 1 #include <sys/time.h> | 1 #include <sys/time.h> |
| 2 #include <sys/resource.h> | 2 #include <sys/resource.h> |
| 3 | 3 |
| 4 #include "SkCanvas.h" | 4 #include "SkCanvas.h" |
| 5 #include "SkCommandLineFlags.h" | 5 #include "SkCommandLineFlags.h" |
| 6 #include "SkData.h" | 6 #include "SkData.h" |
| 7 #include "SkForceLinking.h" | 7 #include "SkForceLinking.h" |
| 8 #include "SkGraphics.h" | 8 #include "SkGraphics.h" |
| 9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
| 10 #include "SkImageEncoder.h" | 10 #include "SkImageEncoder.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 /* List allowed syscalls. */ | 31 /* List allowed syscalls. */ |
| 32 ALLOW_SYSCALL(exit_group), | 32 ALLOW_SYSCALL(exit_group), |
| 33 ALLOW_SYSCALL(exit), | 33 ALLOW_SYSCALL(exit), |
| 34 ALLOW_SYSCALL(fstat), | 34 ALLOW_SYSCALL(fstat), |
| 35 ALLOW_SYSCALL(read), | 35 ALLOW_SYSCALL(read), |
| 36 ALLOW_SYSCALL(write), | 36 ALLOW_SYSCALL(write), |
| 37 ALLOW_SYSCALL(close), | 37 ALLOW_SYSCALL(close), |
| 38 ALLOW_SYSCALL(mmap), | 38 ALLOW_SYSCALL(mmap), |
| 39 ALLOW_SYSCALL(munmap), | 39 ALLOW_SYSCALL(munmap), |
| 40 ALLOW_SYSCALL(brk), | 40 ALLOW_SYSCALL(brk), |
| 41 ALLOW_SYSCALL(futex), |
| 41 KILL_PROCESS, | 42 KILL_PROCESS, |
| 42 }; | 43 }; |
| 43 struct sock_fprog prog = { | 44 struct sock_fprog prog = { |
| 44 SK_ARRAY_COUNT(filter), | 45 SK_ARRAY_COUNT(filter), |
| 45 filter, | 46 filter, |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 // Lock down the app so that it can't get new privs, such as setuid. | 49 // Lock down the app so that it can't get new privs, such as setuid. |
| 49 // Calling this is a requirement for an unpriviledged process to use mode | 50 // Calling this is a requirement for an unpriviledged process to use mode |
| 50 // 2 seccomp filters, ala SECCOMP_MODE_FILTER, otherwise we'd have to be | 51 // 2 seccomp filters, ala SECCOMP_MODE_FILTER, otherwise we'd have to be |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 123 |
| 123 // Write out the image as a PNG. | 124 // Write out the image as a PNG. |
| 124 SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); | 125 SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); |
| 125 SkAutoTUnref<SkData> data(image->encode(SkImageEncoder::kPNG_Type, 100)); | 126 SkAutoTUnref<SkData> data(image->encode(SkImageEncoder::kPNG_Type, 100)); |
| 126 if (NULL == data.get()) { | 127 if (NULL == data.get()) { |
| 127 printf("Failed to encode\n"); | 128 printf("Failed to encode\n"); |
| 128 exit(1); | 129 exit(1); |
| 129 } | 130 } |
| 130 stream.write(data->data(), data->size()); | 131 stream.write(data->data(), data->size()); |
| 131 } | 132 } |
| OLD | NEW |