OLD | NEW |
---|---|
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/org_chromium_net_UrlRequestContext.h" | 5 #include "components/cronet/android/org_chromium_net_UrlRequestContext.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/metrics/statistics_recorder.h" | 13 #include "base/metrics/statistics_recorder.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "components/cronet/android/org_chromium_net_UrlRequest.h" | 15 #include "components/cronet/android/org_chromium_net_UrlRequest.h" |
16 #include "components/cronet/android/url_request_context_peer.h" | 16 #include "components/cronet/android/url_request_context_peer.h" |
17 #include "components/cronet/android/url_request_peer.h" | 17 #include "components/cronet/android/url_request_peer.h" |
18 #include "components/cronet/url_request_context_config.h" | 18 #include "components/cronet/url_request_context_config.h" |
19 #include "cronet/cronet_version.h" | |
19 #include "jni/UrlRequestContext_jni.h" | 20 #include "jni/UrlRequestContext_jni.h" |
20 | 21 |
21 // Version of this build of Chromium NET. | |
22 #define CHROMIUM_NET_VERSION "1" | |
23 | 22 |
mmenke
2014/06/19 19:45:28
nit: Only need one blank line here.
mef
2014/06/19 21:23:29
Done.
| |
24 namespace { | 23 namespace { |
25 | 24 |
26 const char kVersion[] = CHROMIUM_VERSION "/" CHROMIUM_NET_VERSION; | 25 const char kVersion[] = CRONET_VERSION "/" LAST_CHANGE; |
mmenke
2014/06/19 19:45:28
Should we copy the strings used in about:version h
mef
2014/06/19 21:23:29
Maybe. That seems to require a mix of official bui
| |
27 | 26 |
28 // Delegate of URLRequestContextPeer that delivers callbacks to the Java layer. | 27 // Delegate of URLRequestContextPeer that delivers callbacks to the Java layer. |
29 class JniURLRequestContextPeerDelegate | 28 class JniURLRequestContextPeerDelegate |
30 : public cronet::URLRequestContextPeer::URLRequestContextPeerDelegate { | 29 : public cronet::URLRequestContextPeer::URLRequestContextPeerDelegate { |
31 public: | 30 public: |
32 JniURLRequestContextPeerDelegate(JNIEnv* env, jobject owner) | 31 JniURLRequestContextPeerDelegate(JNIEnv* env, jobject owner) |
33 : owner_(env->NewGlobalRef(owner)) { | 32 : owner_(env->NewGlobalRef(owner)) { |
34 } | 33 } |
35 | 34 |
36 virtual void OnContextInitialized( | 35 virtual void OnContextInitialized( |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 // Stops recording NetLog. | 147 // Stops recording NetLog. |
149 static void StopNetLog(JNIEnv* env, | 148 static void StopNetLog(JNIEnv* env, |
150 jobject jcaller, | 149 jobject jcaller, |
151 jlong urlRequestContextPeer) { | 150 jlong urlRequestContextPeer) { |
152 URLRequestContextPeer* peer = | 151 URLRequestContextPeer* peer = |
153 reinterpret_cast<URLRequestContextPeer*>(urlRequestContextPeer); | 152 reinterpret_cast<URLRequestContextPeer*>(urlRequestContextPeer); |
154 peer->StopNetLog(); | 153 peer->StopNetLog(); |
155 } | 154 } |
156 | 155 |
157 } // namespace cronet | 156 } // namespace cronet |
OLD | NEW |