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

Side by Side Diff: talk/app/webrtc/java/jni/androidnetworkmonitor_jni.h

Issue 1535943004: Multi-networking with Android L. Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 26 matching lines...) Expand all
37 37
38 class AndroidNetworkMonitor : public rtc::NetworkMonitorBase { 38 class AndroidNetworkMonitor : public rtc::NetworkMonitorBase {
39 public: 39 public:
40 AndroidNetworkMonitor(); 40 AndroidNetworkMonitor();
41 41
42 static void SetAndroidContext(JNIEnv* jni, jobject context); 42 static void SetAndroidContext(JNIEnv* jni, jobject context);
43 43
44 void Start() override; 44 void Start() override;
45 void Stop() override; 45 void Stop() override;
46 46
47 bool GetAllNetworkInfos(
48 std::vector<rtc::NetworkInformation>* network_infos) override;
49 //void OnNetworkAvailable(const rtc::NetworkInformation& network_info) overrid e;
50
47 private: 51 private:
48 JNIEnv* jni() { return AttachCurrentThreadIfNeeded(); } 52 JNIEnv* jni() { return AttachCurrentThreadIfNeeded(); }
49 53
50 ScopedGlobalRef<jclass> j_network_monitor_class_; 54 ScopedGlobalRef<jclass> j_network_monitor_class_;
51 ScopedGlobalRef<jobject> j_network_monitor_; 55 ScopedGlobalRef<jobject> j_network_monitor_;
52 rtc::ThreadChecker thread_checker_; 56 rtc::ThreadChecker thread_checker_;
53 static jobject application_context_; 57 static jobject application_context_;
54 }; 58 };
55 59
56 class AndroidNetworkMonitorFactory : public rtc::NetworkMonitorFactory { 60 class AndroidNetworkMonitorFactory : public rtc::NetworkMonitorFactory {
57 public: 61 public:
58 AndroidNetworkMonitorFactory() {} 62 AndroidNetworkMonitorFactory() {}
59 63
60 rtc::NetworkMonitorInterface* CreateNetworkMonitor() override { 64 rtc::NetworkMonitorInterface* CreateNetworkMonitor() override {
61 return new AndroidNetworkMonitor(); 65 return new AndroidNetworkMonitor();
62 } 66 }
63 }; 67 };
64 68
65 } // namespace webrtc_jni 69 } // namespace webrtc_jni
66 70
67 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDNETWORKMONITOR_JNI_H_ 71 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDNETWORKMONITOR_JNI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698