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 "sdch_test_util.h" | 5 #include "sdch_test_util.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/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "components/cronet/android/cronet_url_request_context_adapter.h" | 14 #include "components/cronet/android/cronet_url_request_context_adapter.h" |
15 #include "components/cronet/android/url_request_context_adapter.h" | 15 #include "components/cronet/android/url_request_context_adapter.h" |
16 #include "jni/SdchObserver_jni.h" | 16 #include "jni/SdchObserver_jni.h" |
17 #include "net/base/sdch_manager.h" | 17 #include "net/base/sdch_manager.h" |
18 #include "net/base/sdch_observer.h" | 18 #include "net/base/sdch_observer.h" |
19 #include "net/url_request/url_request_context.h" | 19 #include "net/url_request/url_request_context.h" |
20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
21 | 21 |
| 22 using base::android::JavaParamRef; |
| 23 |
22 namespace cronet { | 24 namespace cronet { |
23 | 25 |
24 namespace { | 26 namespace { |
25 | 27 |
26 class TestSdchObserver : public net::SdchObserver { | 28 class TestSdchObserver : public net::SdchObserver { |
27 public: | 29 public: |
28 TestSdchObserver( | 30 TestSdchObserver( |
29 const GURL& target_url, | 31 const GURL& target_url, |
30 net::SdchManager* manager, | 32 net::SdchManager* manager, |
31 const base::android::ScopedJavaGlobalRef<jobject>& jsdch_observer_ref) | 33 const base::android::ScopedJavaGlobalRef<jobject>& jsdch_observer_ref) |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 FROM_HERE, | 136 FROM_HERE, |
135 base::Bind(&AddSdchObserverOnNetworkThreadLegacyAPI, target_url, | 137 base::Bind(&AddSdchObserverOnNetworkThreadLegacyAPI, target_url, |
136 jsdch_observer_ref, base::Unretained(context_adapter))); | 138 jsdch_observer_ref, base::Unretained(context_adapter))); |
137 } | 139 } |
138 | 140 |
139 bool RegisterSdchTestUtil(JNIEnv* env) { | 141 bool RegisterSdchTestUtil(JNIEnv* env) { |
140 return RegisterNativesImpl(env); | 142 return RegisterNativesImpl(env); |
141 } | 143 } |
142 | 144 |
143 } // namespace cronet | 145 } // namespace cronet |
OLD | NEW |