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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 InfoMap* extension_info_map = | 61 InfoMap* extension_info_map = |
62 browser_main_parts_->extension_system()->info_map(); | 62 browser_main_parts_->extension_system()->info_map(); |
63 (*protocol_handlers)[kExtensionScheme] = | 63 (*protocol_handlers)[kExtensionScheme] = |
64 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( | 64 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( |
65 CreateExtensionProtocolHandler(false /* is_incognito */, | 65 CreateExtensionProtocolHandler(false /* is_incognito */, |
66 extension_info_map) | 66 extension_info_map) |
67 .release()); | 67 .release()); |
68 | 68 |
69 set_url_request_context_getter(new ShellURLRequestContextGetter( | 69 set_url_request_context_getter(new ShellURLRequestContextGetter( |
70 this, IgnoreCertificateErrors(), GetPath(), | 70 this, IgnoreCertificateErrors(), GetPath(), |
71 content::BrowserThread::GetMessageLoopProxyForThread( | 71 content::BrowserThread::GetTaskRunnerForThread( |
72 content::BrowserThread::IO), | 72 content::BrowserThread::IO), |
73 content::BrowserThread::GetMessageLoopProxyForThread( | 73 content::BrowserThread::GetTaskRunnerForThread( |
74 content::BrowserThread::FILE), | 74 content::BrowserThread::FILE), |
75 protocol_handlers, std::move(request_interceptors), nullptr /* net_log */, | 75 protocol_handlers, std::move(request_interceptors), nullptr /* net_log */, |
76 extension_info_map)); | 76 extension_info_map)); |
77 resource_context_->set_url_request_context_getter( | 77 resource_context_->set_url_request_context_getter( |
78 url_request_context_getter()); | 78 url_request_context_getter()); |
79 content::BrowserThread::PostTask( | 79 content::BrowserThread::PostTask( |
80 content::BrowserThread::IO, | 80 content::BrowserThread::IO, |
81 FROM_HERE, | 81 FROM_HERE, |
82 base::Bind( | 82 base::Bind( |
83 &ShellBrowserContext::InitURLRequestContextOnIOThread, | 83 &ShellBrowserContext::InitURLRequestContextOnIOThread, |
84 base::Unretained(this))); | 84 base::Unretained(this))); |
85 return url_request_context_getter(); | 85 return url_request_context_getter(); |
86 } | 86 } |
87 | 87 |
88 void ShellBrowserContext::InitURLRequestContextOnIOThread() { | 88 void ShellBrowserContext::InitURLRequestContextOnIOThread() { |
89 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 89 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
90 | 90 |
91 // GetURLRequestContext() will create a URLRequestContext if it isn't | 91 // GetURLRequestContext() will create a URLRequestContext if it isn't |
92 // initialized. | 92 // initialized. |
93 url_request_context_getter()->GetURLRequestContext(); | 93 url_request_context_getter()->GetURLRequestContext(); |
94 } | 94 } |
95 | 95 |
96 } // namespace extensions | 96 } // namespace extensions |
OLD | NEW |