2013-03-13 19:12:05 +00:00
|
|
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE-CHROMIUM file.
|
|
|
|
|
2013-03-13 19:42:16 +00:00
|
|
|
#ifndef BRIGHTRAY_BROWSER_URL_REQUEST_CONTEXT_GETTER_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_URL_REQUEST_CONTEXT_GETTER_H_
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2013-08-23 12:19:37 +00:00
|
|
|
#include "base/callback.h"
|
2013-03-13 19:12:05 +00:00
|
|
|
#include "base/files/file_path.h"
|
|
|
|
#include "base/memory/scoped_ptr.h"
|
|
|
|
#include "content/public/browser/content_browser_client.h"
|
|
|
|
#include "net/url_request/url_request_context_getter.h"
|
|
|
|
|
2013-04-18 03:27:53 +00:00
|
|
|
namespace base {
|
2013-03-13 19:12:05 +00:00
|
|
|
class MessageLoop;
|
2013-04-18 03:27:53 +00:00
|
|
|
}
|
2013-03-13 19:12:05 +00:00
|
|
|
|
|
|
|
namespace net {
|
|
|
|
class HostResolver;
|
|
|
|
class ProxyConfigService;
|
|
|
|
class URLRequestContextStorage;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
2013-07-17 14:21:33 +00:00
|
|
|
class NetworkDelegate;
|
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
class URLRequestContextGetter : public net::URLRequestContextGetter {
|
2013-11-17 23:43:46 +00:00
|
|
|
public:
|
2013-03-13 19:12:05 +00:00
|
|
|
URLRequestContextGetter(
|
|
|
|
const base::FilePath& base_path,
|
2013-04-18 03:27:53 +00:00
|
|
|
base::MessageLoop* io_loop,
|
|
|
|
base::MessageLoop* file_loop,
|
2013-08-23 12:19:37 +00:00
|
|
|
base::Callback<scoped_ptr<NetworkDelegate>(void)>,
|
2014-06-26 20:27:22 +00:00
|
|
|
content::ProtocolHandlerMap* protocol_handlers,
|
|
|
|
content::ProtocolHandlerScopedVector protocol_interceptors);
|
2013-03-13 19:12:05 +00:00
|
|
|
virtual ~URLRequestContextGetter();
|
|
|
|
|
|
|
|
net::HostResolver* host_resolver();
|
|
|
|
virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE;
|
|
|
|
|
2013-11-17 23:43:46 +00:00
|
|
|
private:
|
|
|
|
virtual scoped_refptr<base::SingleThreadTaskRunner>
|
|
|
|
GetNetworkTaskRunner() const OVERRIDE;
|
2013-03-13 19:12:05 +00:00
|
|
|
|
|
|
|
base::FilePath base_path_;
|
2013-04-18 03:27:53 +00:00
|
|
|
base::MessageLoop* io_loop_;
|
|
|
|
base::MessageLoop* file_loop_;
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2013-08-23 12:19:37 +00:00
|
|
|
base::Callback<scoped_ptr<NetworkDelegate>(void)> network_delegate_factory_;
|
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
scoped_ptr<net::ProxyConfigService> proxy_config_service_;
|
2013-07-17 14:21:33 +00:00
|
|
|
scoped_ptr<NetworkDelegate> network_delegate_;
|
2013-03-13 19:12:05 +00:00
|
|
|
scoped_ptr<net::URLRequestContextStorage> storage_;
|
|
|
|
scoped_ptr<net::URLRequestContext> url_request_context_;
|
|
|
|
content::ProtocolHandlerMap protocol_handlers_;
|
2014-06-26 20:27:22 +00:00
|
|
|
content::ProtocolHandlerScopedVector protocol_interceptors_;
|
2013-03-13 19:12:05 +00:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter);
|
|
|
|
};
|
|
|
|
|
2013-11-17 23:20:17 +00:00
|
|
|
} // namespace brightray
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2013-03-13 19:42:16 +00:00
|
|
|
#endif
|