Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/jni/Utils.cpp

Issue 29347315: Issue 4231 - Fix unstable FilterEngineTest.testSetRemoveFilterChangeCallback (Closed)
Patch Set: made helper methods static, fixed 'remove' for fs callback Created Dec. 13, 2016, 9:32 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libadblockplus-android/jni/Utils.cpp
diff --git a/libadblockplus-android/jni/Utils.cpp b/libadblockplus-android/jni/Utils.cpp
index 6c1b9274c417a4cfa8f93b37314d858bae94c188..bb0db640fdf125766621345e9e6c46ee5a8656c5 100644
--- a/libadblockplus-android/jni/Utils.cpp
+++ b/libadblockplus-android/jni/Utils.cpp
@@ -16,6 +16,8 @@
*/
#include <string>
+#include <sstream>
+#include <iostream>
#include "Utils.h"
@@ -122,3 +124,13 @@ jobject NewJniNotification(JNIEnv* env,
{
return NewJniObject(env, notification, PKG("Notification"));
}
+
+std::string JniStdStreamToStdString(std::istream *in)
+{
+ std::string ret;
+ char buffer[1024];
+ while (in->read(buffer, sizeof(buffer)))
+ ret.append(buffer, sizeof(buffer));
+ ret.append(buffer, in->gcount());
+ return ret;
+}

Powered by Google App Engine
This is Rietveld