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

Side by Side Diff: components/cronet/android/cronet_url_request_context_adapter.cc

Issue 1942893002: Split NQE to multiple files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 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 | « components/cronet/android/cronet_url_request_context_adapter.h ('k') | net/net.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/cronet/android/cronet_url_request_context_adapter.h" 5 #include "components/cronet/android/cronet_url_request_context_adapter.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 if (!file_thread_) { 739 if (!file_thread_) {
740 file_thread_.reset(new base::Thread("Network File Thread")); 740 file_thread_.reset(new base::Thread("Network File Thread"));
741 file_thread_->Start(); 741 file_thread_->Start();
742 } 742 }
743 return file_thread_.get(); 743 return file_thread_.get();
744 } 744 }
745 745
746 void CronetURLRequestContextAdapter::OnRTTObservation( 746 void CronetURLRequestContextAdapter::OnRTTObservation(
747 int32_t rtt_ms, 747 int32_t rtt_ms,
748 const base::TimeTicks& timestamp, 748 const base::TimeTicks& timestamp,
749 net::NetworkQualityEstimator::ObservationSource source) { 749 net::NetworkQualityObservationSource source) {
750 Java_CronetUrlRequestContext_onRttObservation( 750 Java_CronetUrlRequestContext_onRttObservation(
751 base::android::AttachCurrentThread(), jcronet_url_request_context_.obj(), 751 base::android::AttachCurrentThread(), jcronet_url_request_context_.obj(),
752 rtt_ms, (timestamp - base::TimeTicks::UnixEpoch()).InMilliseconds(), 752 rtt_ms, (timestamp - base::TimeTicks::UnixEpoch()).InMilliseconds(),
753 source); 753 source);
754 } 754 }
755 755
756 void CronetURLRequestContextAdapter::OnThroughputObservation( 756 void CronetURLRequestContextAdapter::OnThroughputObservation(
757 int32_t throughput_kbps, 757 int32_t throughput_kbps,
758 const base::TimeTicks& timestamp, 758 const base::TimeTicks& timestamp,
759 net::NetworkQualityEstimator::ObservationSource source) { 759 net::NetworkQualityObservationSource source) {
760 Java_CronetUrlRequestContext_onThroughputObservation( 760 Java_CronetUrlRequestContext_onThroughputObservation(
761 base::android::AttachCurrentThread(), jcronet_url_request_context_.obj(), 761 base::android::AttachCurrentThread(), jcronet_url_request_context_.obj(),
762 throughput_kbps, 762 throughput_kbps,
763 (timestamp - base::TimeTicks::UnixEpoch()).InMilliseconds(), source); 763 (timestamp - base::TimeTicks::UnixEpoch()).InMilliseconds(), source);
764 } 764 }
765 765
766 // Create a URLRequestContextConfig from the given parameters. 766 // Create a URLRequestContextConfig from the given parameters.
767 static jlong CreateRequestContextConfig( 767 static jlong CreateRequestContextConfig(
768 JNIEnv* env, 768 JNIEnv* env,
769 const JavaParamRef<jclass>& jcaller, 769 const JavaParamRef<jclass>& jcaller,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 JNIEnv* env, 885 JNIEnv* env,
886 const JavaParamRef<jclass>& jcaller) { 886 const JavaParamRef<jclass>& jcaller) {
887 base::StatisticsRecorder::Initialize(); 887 base::StatisticsRecorder::Initialize();
888 std::vector<uint8_t> data; 888 std::vector<uint8_t> data;
889 if (!HistogramManager::GetInstance()->GetDeltas(&data)) 889 if (!HistogramManager::GetInstance()->GetDeltas(&data))
890 return ScopedJavaLocalRef<jbyteArray>(); 890 return ScopedJavaLocalRef<jbyteArray>();
891 return base::android::ToJavaByteArray(env, &data[0], data.size()); 891 return base::android::ToJavaByteArray(env, &data[0], data.size());
892 } 892 }
893 893
894 } // namespace cronet 894 } // namespace cronet
OLDNEW
« no previous file with comments | « components/cronet/android/cronet_url_request_context_adapter.h ('k') | net/net.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698