 // URLSessionDataDelegate conformance, and break retain cycle between URLSession
 // and URLSessionDataDelegate.
 private final class _DataLoader: NSObject, URLSessionDataDelegate {
-    weak var session: URLSession! // This is safe.
     var validate: (URLResponse) -> Swift.Error? = DataLoader.validate
     private var handlers = [URLSessionTask: _Handler]()
     weak var observer: _DataLoaderObserving?
 
     /// Loads data with the given request.
     func loadData(with request: URLRequest,
+                  session: URLSession,
                   didReceiveData: @escaping (Data, URLResponse) -> Void,
                   completion: @escaping (Error?) -> Void) -> Cancellable {
         let task = session.dataTask(with: request)

/// Provides basic networking using `URLSession`.
public final class DataLoader: DataLoading, _DataLoaderObserving {
    public let session: URLSession
    private let impl: _DataLoader

    public var observer: DataLoaderObserving?


    /// `URLCache` with 0 MB memory capacity and 150 MB disk capacity.
    public init(configuration: URLSessionConfiguration = DataLoader.defaultConfiguration,
                validate: @escaping (URLResponse) -> Swift.Error? = DataLoader.validate) {
        let queue = OperationQueue()
        queue.maxConcurrentOperationCount = 1
        self.session = URLSession(configuration: configuration, delegate: impl, delegateQueue: queue)
        self.impl.validate = validate
        self.impl.observer = self
    }
