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

Side by Side Diff: talk/app/webrtc/java/jni/jni_helpers.cc

Issue 1311753002: Make jni_helpers build on arm32. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 3 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 | « 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 1
2 /* 2 /*
3 * libjingle 3 * libjingle
4 * Copyright 2015 Google Inc. 4 * Copyright 2015 Google Inc.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met: 7 * modification, are permitted provided that the following conditions are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright notice, 9 * 1. Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer. 10 * this list of conditions and the following disclaimer.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 JNIEnv* jni = nullptr; 96 JNIEnv* jni = nullptr;
97 if (jvm->GetEnv(reinterpret_cast<void**>(&jni), JNI_VERSION_1_6) != JNI_OK) 97 if (jvm->GetEnv(reinterpret_cast<void**>(&jni), JNI_VERSION_1_6) != JNI_OK)
98 return -1; 98 return -1;
99 99
100 return JNI_VERSION_1_6; 100 return JNI_VERSION_1_6;
101 } 101 }
102 102
103 // Return thread ID as a string. 103 // Return thread ID as a string.
104 static std::string GetThreadId() { 104 static std::string GetThreadId() {
105 char buf[21]; // Big enough to hold a kuint64max plus terminating NULL. 105 char buf[21]; // Big enough to hold a kuint64max plus terminating NULL.
106 CHECK_LT(snprintf(buf, sizeof(buf), "%ld", syscall(__NR_gettid)), 106 CHECK_LT(snprintf(buf, sizeof(buf), "%ld",
107 static_cast<long>(syscall(__NR_gettid))),
107 sizeof(buf)) 108 sizeof(buf))
108 << "Thread id is bigger than uint64??"; 109 << "Thread id is bigger than uint64??";
109 return std::string(buf); 110 return std::string(buf);
110 } 111 }
111 112
112 // Return the current thread's name. 113 // Return the current thread's name.
113 static std::string GetThreadName() { 114 static std::string GetThreadName() {
114 char name[17] = {0}; 115 char name[17] = {0};
115 if (prctl(PR_GET_NAME, name) != 0) 116 if (prctl(PR_GET_NAME, name) != 0)
116 return std::string("<noname>"); 117 return std::string("<noname>");
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 // callbacks (i.e. entry points that don't originate in a Java callstack 289 // callbacks (i.e. entry points that don't originate in a Java callstack
289 // through a "native" method call). 290 // through a "native" method call).
290 ScopedLocalRefFrame::ScopedLocalRefFrame(JNIEnv* jni) : jni_(jni) { 291 ScopedLocalRefFrame::ScopedLocalRefFrame(JNIEnv* jni) : jni_(jni) {
291 CHECK(!jni_->PushLocalFrame(0)) << "Failed to PushLocalFrame"; 292 CHECK(!jni_->PushLocalFrame(0)) << "Failed to PushLocalFrame";
292 } 293 }
293 ScopedLocalRefFrame::~ScopedLocalRefFrame() { 294 ScopedLocalRefFrame::~ScopedLocalRefFrame() {
294 jni_->PopLocalFrame(NULL); 295 jni_->PopLocalFrame(NULL);
295 } 296 }
296 297
297 } // namespace webrtc_jni 298 } // namespace webrtc_jni
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