OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/shell/browser/shell_browser_context.h" | 5 #include "extensions/shell/browser/shell_browser_context.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "components/guest_view/browser/guest_view_manager.h" | 10 #include "components/guest_view/browser/guest_view_manager.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 return storage_policy_.get(); | 44 return storage_policy_.get(); |
45 } | 45 } |
46 | 46 |
47 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( | 47 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( |
48 content::ProtocolHandlerMap* protocol_handlers, | 48 content::ProtocolHandlerMap* protocol_handlers, |
49 content::URLRequestInterceptorScopedVector request_interceptors, | 49 content::URLRequestInterceptorScopedVector request_interceptors, |
50 InfoMap* extension_info_map) { | 50 InfoMap* extension_info_map) { |
51 DCHECK(!url_request_context_getter()); | 51 DCHECK(!url_request_context_getter()); |
52 set_url_request_context_getter(new ShellURLRequestContextGetter( | 52 set_url_request_context_getter(new ShellURLRequestContextGetter( |
53 this, IgnoreCertificateErrors(), GetPath(), | 53 this, IgnoreCertificateErrors(), GetPath(), |
54 content::BrowserThread::UnsafeGetMessageLoopForThread( | 54 content::BrowserThread::GetMessageLoopProxyForThread( |
55 content::BrowserThread::IO), | 55 content::BrowserThread::IO), |
56 content::BrowserThread::UnsafeGetMessageLoopForThread( | 56 content::BrowserThread::GetMessageLoopProxyForThread( |
57 content::BrowserThread::FILE), | 57 content::BrowserThread::FILE), |
58 protocol_handlers, std::move(request_interceptors), nullptr /* net_log */, | 58 protocol_handlers, std::move(request_interceptors), nullptr /* net_log */, |
59 extension_info_map)); | 59 extension_info_map)); |
60 resource_context_->set_url_request_context_getter( | 60 resource_context_->set_url_request_context_getter( |
61 url_request_context_getter()); | 61 url_request_context_getter()); |
62 content::BrowserThread::PostTask( | 62 content::BrowserThread::PostTask( |
63 content::BrowserThread::IO, | 63 content::BrowserThread::IO, |
64 FROM_HERE, | 64 FROM_HERE, |
65 base::Bind( | 65 base::Bind( |
66 &ShellBrowserContext::InitURLRequestContextOnIOThread, | 66 &ShellBrowserContext::InitURLRequestContextOnIOThread, |
67 base::Unretained(this))); | 67 base::Unretained(this))); |
68 return url_request_context_getter(); | 68 return url_request_context_getter(); |
69 } | 69 } |
70 | 70 |
71 void ShellBrowserContext::InitURLRequestContextOnIOThread() { | 71 void ShellBrowserContext::InitURLRequestContextOnIOThread() { |
72 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 72 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
73 | 73 |
74 // GetURLRequestContext() will create a URLRequestContext if it isn't | 74 // GetURLRequestContext() will create a URLRequestContext if it isn't |
75 // initialized. | 75 // initialized. |
76 url_request_context_getter()->GetURLRequestContext(); | 76 url_request_context_getter()->GetURLRequestContext(); |
77 } | 77 } |
78 | 78 |
79 } // namespace extensions | 79 } // namespace extensions |
OLD | NEW |