2013-03-13 15:12:05 -04: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 15:42:16 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#ifndef BRIGHTRAY_BROWSER_URL_REQUEST_CONTEXT_GETTER_H_
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define BRIGHTRAY_BROWSER_URL_REQUEST_CONTEXT_GETTER_H_
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-18 15:06:57 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include <string>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <vector>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "base/files/file_path.h"
							 | 
						
					
						
							
								
									
										
										
										
											2016-05-23 10:59:07 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "content/public/browser/browser_context.h"
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "content/public/browser/content_browser_client.h"
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-21 09:09:43 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "net/cookies/cookie_monster.h"
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-05 13:29:16 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "net/http/http_cache.h"
							 | 
						
					
						
							
								
									
										
										
										
											2016-10-17 16:06:37 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "net/http/transport_security_state.h"
							 | 
						
					
						
							
								
									
										
										
										
											2015-05-05 22:35:48 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "net/http/url_security_manager.h"
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "net/url_request/url_request_context_getter.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-17 23:27:53 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								namespace base {
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class MessageLoop;
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-17 23:27:53 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								namespace net {
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-15 12:30:50 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class HostMappingRules;
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class HostResolver;
							 | 
						
					
						
							
								
									
										
										
										
											2016-03-08 20:59:29 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class HttpAuthPreferences;
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 14:39:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class NetworkDelegate;
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class ProxyConfigService;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class URLRequestContextStorage;
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 14:39:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class URLRequestJobFactory;
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								namespace brightray {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-15 10:09:22 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class RequireCTDelegate;
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-14 06:59:14 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class DevToolsNetworkControllerHandle;
							 | 
						
					
						
							
								
									
										
										
										
											2015-08-11 18:29:55 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class NetLog;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class URLRequestContextGetter : public net::URLRequestContextGetter {
							 | 
						
					
						
							
								
									
										
										
										
											2013-11-17 18:43:46 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 public:
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 14:39:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  class Delegate {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   public:
							 | 
						
					
						
							
								
									
										
										
										
											2016-05-21 23:40:02 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Delegate() {}
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 14:39:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    virtual ~Delegate() {}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-21 09:09:43 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    virtual net::NetworkDelegate* CreateNetworkDelegate() { return nullptr; }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual net::CookieMonsterDelegate* CreateCookieDelegate() {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      return nullptr;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2015-07-14 10:04:34 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    virtual std::string GetUserAgent();
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 20:30:26 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    virtual std::unique_ptr<net::URLRequestJobFactory>
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-23 15:47:30 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    CreateURLRequestJobFactory(content::ProtocolHandlerMap* protocol_handlers);
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-05 13:29:16 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    virtual net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        const base::FilePath& base_path);
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-15 10:09:22 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    virtual std::unique_ptr<net::CertVerifier> CreateCertVerifier(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        RequireCTDelegate* ct_delegate);
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-21 22:14:32 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    virtual net::SSLConfigService* CreateSSLConfigService();
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-05 16:23:31 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    virtual std::vector<std::string> GetCookieableSchemes();
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 14:39:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  URLRequestContextGetter(
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 14:39:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      Delegate* delegate,
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-14 06:59:14 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      DevToolsNetworkControllerHandle* handle,
							 | 
						
					
						
							
								
									
										
										
										
											2015-08-11 18:29:55 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      NetLog* net_log,
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      const base::FilePath& base_path,
							 | 
						
					
						
							
								
									
										
										
										
											2015-08-27 03:10:02 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      bool in_memory,
							 | 
						
					
						
							
								
									
										
										
										
											2017-01-23 15:42:37 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-26 16:27:22 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      content::ProtocolHandlerMap* protocol_handlers,
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-31 18:43:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      content::URLRequestInterceptorScopedVector protocol_interceptors);
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  virtual ~URLRequestContextGetter();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 15:19:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  // net::URLRequestContextGetter:
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-05 12:07:27 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  net::URLRequestContext* GetURLRequestContext() override;
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-23 15:47:30 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      const override;
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 15:19:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  net::HostResolver* host_resolver();
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 20:30:26 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  net::URLRequestJobFactory* job_factory() const { return job_factory_; }
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 15:19:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 private:
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-20 14:39:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  Delegate* delegate_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-14 06:59:14 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  DevToolsNetworkControllerHandle* network_controller_handle_;
							 | 
						
					
						
							
								
									
										
										
										
											2015-08-11 18:29:55 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  NetLog* net_log_;
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  base::FilePath base_path_;
							 | 
						
					
						
							
								
									
										
										
										
											2015-08-27 03:10:02 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  bool in_memory_;
							 | 
						
					
						
							
								
									
										
										
										
											2017-01-23 15:42:37 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-22 15:52:04 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  std::string user_agent_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-15 10:09:22 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  std::unique_ptr<RequireCTDelegate> ct_delegate_;
							 | 
						
					
						
							
								
									
										
										
										
											2016-05-23 10:59:07 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::unique_ptr<net::NetworkDelegate> network_delegate_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::unique_ptr<net::URLRequestContextStorage> storage_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::unique_ptr<net::URLRequestContext> url_request_context_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::unique_ptr<net::HostMappingRules> host_mapping_rules_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::unique_ptr<net::HttpNetworkSession> http_network_session_;
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  content::ProtocolHandlerMap protocol_handlers_;
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-31 18:43:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  content::URLRequestInterceptorScopedVector protocol_interceptors_;
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 20:30:26 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  net::URLRequestJobFactory* job_factory_;  // weak ref
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								};
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-11-17 18:20:17 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}  // namespace brightray
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-18 15:05:25 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#endif  // BRIGHTRAY_BROWSER_URL_REQUEST_CONTEXT_GETTER_H_
							 |