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

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/CronetLibraryLoader.java

Issue 981013002: [Cronet] Make sure to only pass the application Context to InitApplicationContext to avoid DCHECK fa (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add ChromiumUrlRequestContext test too Created 5 years, 9 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
OLDNEW
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 package org.chromium.net; 5 package org.chromium.net;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.Handler; 8 import android.os.Handler;
9 import android.os.Looper; 9 import android.os.Looper;
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Registers to always receive network notifications. Note 55 // Registers to always receive network notifications. Note
56 // that this call is fine for Cronet because Cronet 56 // that this call is fine for Cronet because Cronet
57 // embedders do not have API access to create network change 57 // embedders do not have API access to create network change
58 // observers. Existing observers in the net stack do not 58 // observers. Existing observers in the net stack do not
59 // perform expensive work. 59 // perform expensive work.
60 NetworkChangeNotifier.registerToReceiveNotificationsAlways(); 60 NetworkChangeNotifier.registerToReceiveNotificationsAlways();
61 // registerToReceiveNotificationsAlways() is called before the native 61 // registerToReceiveNotificationsAlways() is called before the native
62 // NetworkChangeNotifierAndroid is created, so as to avoid receiving 62 // NetworkChangeNotifierAndroid is created, so as to avoid receiving
63 // the undesired initial network change observer notification, which 63 // the undesired initial network change observer notification, which
64 // will cause active requests to fail with ERR_NETWORK_CHANGED. 64 // will cause active requests to fail with ERR_NETWORK_CHANGED.
65 nativeCronetInitOnMainThread(context); 65 nativeCronetInitOnMainThread(context.getApplicationContext());
66 } 66 }
67 67
68 // Native methods are implemented in cronet_loader.cc. 68 // Native methods are implemented in cronet_loader.cc.
69 private static native void nativeCronetInitOnMainThread(Context context); 69 private static native void nativeCronetInitOnMainThread(Context appContext);
70 } 70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698