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

Unified Diff: talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java

Issue 1309073004: Add JNI/java wrapper for the file rotating logging class. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: CR Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/app/webrtc/java/jni/peerconnection_jni.cc ('k') | talk/app/webrtc/java/src/org/webrtc/Logging.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java
diff --git a/talk/app/webrtc/java/src/org/webrtc/MediaSource.java b/talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java
similarity index 66%
copy from talk/app/webrtc/java/src/org/webrtc/MediaSource.java
copy to talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java
index d79b4628eb79506a69f59ea14651850d6979b20c..f7032a739bdbb24ac93dc000b9a42fb11223cc40 100644
--- a/talk/app/webrtc/java/src/org/webrtc/MediaSource.java
+++ b/talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java
@@ -1,6 +1,6 @@
/*
* libjingle
- * Copyright 2013 Google Inc.
+ * Copyright 2015 Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -25,31 +25,33 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
package org.webrtc;
-/** Java wrapper for a C++ MediaSourceInterface. */
-public class MediaSource {
- /** Tracks MediaSourceInterface.SourceState */
- public enum State {
- INITIALIZING, LIVE, ENDED, MUTED
+public class CallSessionFileRotatingLogSink {
+ static {
+ System.loadLibrary("jingle_peerconnection_so");
}
- final long nativeSource; // Package-protected for PeerConnectionFactory.
+ private long nativeSink;
- public MediaSource(long nativeSource) {
- this.nativeSource = nativeSource;
+ public static byte[] getLogData(String dirPath) {
+ return nativeGetLogData(dirPath);
}
- public State state() {
- return nativeState(nativeSource);
+ public CallSessionFileRotatingLogSink(
+ String dirPath, int maxFileSize, Logging.Severity severity) {
+ nativeSink = nativeAddSink(dirPath, maxFileSize, severity.ordinal());
}
public void dispose() {
- free(nativeSource);
+ if (nativeSink != 0) {
+ nativeDeleteSink(nativeSink);
+ nativeSink = 0;
+ }
}
- private static native State nativeState(long pointer);
-
- private static native void free(long nativeSource);
+ private static native long nativeAddSink(
+ String dirPath, int maxFileSize, int severity);
+ private static native void nativeDeleteSink(long nativeSink);
+ private static native byte[] nativeGetLogData(String dirPath);
}
« no previous file with comments | « talk/app/webrtc/java/jni/peerconnection_jni.cc ('k') | talk/app/webrtc/java/src/org/webrtc/Logging.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698