OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "blimp/client/app/android/blimp_client_session_android.h" | 5 #include "blimp/client/app/android/blimp_client_session_android.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 assignment.engine_endpoint.address(), assignment.engine_endpoint.port()); | 107 assignment.engine_endpoint.address(), assignment.engine_endpoint.port()); |
108 JNIEnv* env = base::android::AttachCurrentThread(); | 108 JNIEnv* env = base::android::AttachCurrentThread(); |
109 Java_BlimpClientSession_onAssignmentReceived( | 109 Java_BlimpClientSession_onAssignmentReceived( |
110 env, java_obj_.obj(), static_cast<jint>(result), | 110 env, java_obj_.obj(), static_cast<jint>(result), |
111 base::android::ConvertUTF8ToJavaString(env, engine_ip).obj(), | 111 base::android::ConvertUTF8ToJavaString(env, engine_ip).obj(), |
112 base::android::ConvertUTF8ToJavaString(env, blimp::kEngineVersion).obj()); | 112 base::android::ConvertUTF8ToJavaString(env, blimp::kEngineVersion).obj()); |
113 | 113 |
114 BlimpClientSession::OnAssignmentConnectionAttempted(result, assignment); | 114 BlimpClientSession::OnAssignmentConnectionAttempted(result, assignment); |
115 } | 115 } |
116 | 116 |
117 base::android::ScopedJavaLocalRef<jintArray> | |
118 BlimpClientSessionAndroid::GetDebugInfo( | |
119 JNIEnv* env, | |
120 const base::android::JavaParamRef<jobject>& jobj) { | |
121 BlimpConnectionStatistics* stats = | |
122 BlimpClientSession::GetBlimpConnectionStatistics(); | |
123 int metrics[] = {stats->Get(BlimpConnectionStatistics::BYTES_RECEIVED), | |
124 stats->Get(BlimpConnectionStatistics::BYTES_SENT), | |
125 stats->Get(BlimpConnectionStatistics::COMMIT)}; | |
Wez
2016/06/07 00:30:12
As noted in the implementation, you're creating th
| |
126 return base::android::ToJavaIntArray(env, metrics, arraysize(metrics)); | |
127 } | |
128 | |
117 } // namespace client | 129 } // namespace client |
118 } // namespace blimp | 130 } // namespace blimp |
OLD | NEW |