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
3 // found in the LICENSE file.
5 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_OBSERVER_H_
6 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_OBSERVER_H_
8 #include "base/macros.h"
9 #include "net/base/net_export.h"
12 class URLRequestContextGetter
;
14 // Interface for watching when a URLRequestContext associated with a
15 // URLRequestContextGetter is shutting down.
16 class NET_EXPORT URLRequestContextGetterObserver
{
18 URLRequestContextGetterObserver() {}
20 // Called before the URLRequestContext shuts down. When called, the Getter's
21 // GetURLRequestContext method must return NULL to protected against
22 // re-entrancy, but the Context must still be valid and GetNetworkTaskRunner()
23 // must return the thread it lives on. Called on the network thread.
24 virtual void OnContextShuttingDown() = 0;
27 virtual ~URLRequestContextGetterObserver() {}
30 DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetterObserver
);
35 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_OBSERVER_H_