1 // Copyright 2013 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. 4 5 #ifndef MOJO_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ 6 #define MOJO_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ 7 8 #include "base/files/file_path.h" 9 #include "base/memory/scoped_ptr.h" 10 #include "base/message_loop/message_loop_proxy.h" 11 #include "net/base/network_delegate.h" 12 #include "net/http/transport_security_persister.h" 13 #include "net/url_request/url_request_context_getter.h" 14 #include "net/url_request/url_request_context_storage.h" 15 16 namespace mojo { 17 namespace shell { 18 19 class URLRequestContextGetter : public net::URLRequestContextGetter { 20 public: 21 URLRequestContextGetter( 22 base::FilePath base_path, 23 base::SingleThreadTaskRunner* network_task_runner, 24 base::SingleThreadTaskRunner* file_task_runner, 25 base::MessageLoopProxy* cache_task_runner, 26 scoped_ptr<net::NetworkDelegate> network_delegate); 27 28 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; 29 virtual scoped_refptr<base::SingleThreadTaskRunner> 30 GetNetworkTaskRunner() const OVERRIDE; 31 32 protected: 33 virtual ~URLRequestContextGetter(); 34 35 private: 36 base::FilePath base_path_; 37 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; 38 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; 39 scoped_refptr<base::MessageLoopProxy> cache_task_runner_; 40 scoped_ptr<net::NetworkDelegate> network_delegate_; 41 scoped_ptr<net::NetLog> net_log_; 42 scoped_ptr<net::URLRequestContextStorage> storage_; 43 scoped_ptr<net::URLRequestContext> url_request_context_; 44 scoped_ptr<net::TransportSecurityPersister> transport_security_persister_; 45 46 DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter); 47 }; 48 49 } // namespace shell 50 } // namespace mojo 51 52 #endif // MOJO_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ 53