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

Side by Side Diff: content/shell/android/linker_test_apk/chromium_linker_test_linker_tests.cc

Issue 1544273002: Switch to standard integer types in content/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/renderer/vr/vr_type_converters.cc ('k') | content/shell/android/shell_jni_registrar.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This file implements the native methods of 5 // This file implements the native methods of
6 // org.content.chromium.app.LinkerTests 6 // org.content.chromium.app.LinkerTests
7 // Unlike the content of linker_jni.cc, it is part of the content library and 7 // Unlike the content of linker_jni.cc, it is part of the content library and
8 // can thus use base/ and the C++ STL. 8 // can thus use base/ and the C++ STL.
9 9
10 #include "content/shell/android/linker_test_apk/chromium_linker_test_linker_test s.h" 10 #include "content/shell/android/linker_test_apk/chromium_linker_test_linker_test s.h"
11 11
12 #include <errno.h>
13 #include <stddef.h>
14 #include <stdint.h>
15 #include <stdio.h>
12 #include <sys/mman.h> 16 #include <sys/mman.h>
13 #include <errno.h>
14 #include <stdio.h>
15 #include <string> 17 #include <string>
16 #include <vector> 18 #include <vector>
17 19
18 #include "base/basictypes.h"
19 #include "base/debug/proc_maps_linux.h" 20 #include "base/debug/proc_maps_linux.h"
20 #include "base/logging.h" 21 #include "base/logging.h"
21 #include "base/strings/stringprintf.h" 22 #include "base/strings/stringprintf.h"
22 #include "jni/LinkerTests_jni.h" 23 #include "jni/LinkerTests_jni.h"
23 #include "third_party/re2/src/re2/re2.h" 24 #include "third_party/re2/src/re2/re2.h"
24 25
25 namespace content { 26 namespace content {
26 27
27 namespace { 28 namespace {
28 29
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Ignore any mapping that isn't a shared RELRO. 100 // Ignore any mapping that isn't a shared RELRO.
100 continue; 101 continue;
101 } 102 }
102 103
103 num_shared_relros++; 104 num_shared_relros++;
104 105
105 void* region_start = reinterpret_cast<void*>(region.start); 106 void* region_start = reinterpret_cast<void*>(region.start);
106 void* region_end = reinterpret_cast<void*>(region.end); 107 void* region_end = reinterpret_cast<void*>(region.end);
107 108
108 // Check that it is mapped read-only. 109 // Check that it is mapped read-only.
109 const uint8 expected_flags = MappedMemoryRegion::READ; 110 const uint8_t expected_flags = MappedMemoryRegion::READ;
110 const uint8 expected_mask = MappedMemoryRegion::READ | 111 const uint8_t expected_mask = MappedMemoryRegion::READ |
111 MappedMemoryRegion::WRITE | 112 MappedMemoryRegion::WRITE |
112 MappedMemoryRegion::EXECUTE; 113 MappedMemoryRegion::EXECUTE;
113 114
114 uint8 region_flags = region.permissions & expected_mask; 115 uint8_t region_flags = region.permissions & expected_mask;
115 if (region_flags != expected_flags) { 116 if (region_flags != expected_flags) {
116 LOG(ERROR) 117 LOG(ERROR)
117 << prefix 118 << prefix
118 << base::StringPrintf( 119 << base::StringPrintf(
119 "Shared RELRO section at %p-%p is not mapped read-only. " 120 "Shared RELRO section at %p-%p is not mapped read-only. "
120 "Protection flags are %d (%d expected)!", 121 "Protection flags are %d (%d expected)!",
121 region_start, 122 region_start,
122 region_end, 123 region_end,
123 region_flags, 124 region_flags,
124 expected_flags); 125 expected_flags);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 204
204 jboolean CheckForNoSharedRelros(JNIEnv* env, 205 jboolean CheckForNoSharedRelros(JNIEnv* env,
205 const JavaParamRef<jclass>& clazz, 206 const JavaParamRef<jclass>& clazz,
206 jboolean in_browser_process) { 207 jboolean in_browser_process) {
207 return RunChecks(in_browser_process, false); 208 return RunChecks(in_browser_process, false);
208 } 209 }
209 210
210 bool RegisterLinkerTestsJni(JNIEnv* env) { return RegisterNativesImpl(env); } 211 bool RegisterLinkerTestsJni(JNIEnv* env) { return RegisterNativesImpl(env); }
211 212
212 } // namespace content 213 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/vr/vr_type_converters.cc ('k') | content/shell/android/shell_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698