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 "ios/web/shell/shell_browser_state.h" | 5 #include "ios/web/shell/shell_browser_state.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/threading/thread_restrictions.h" | 11 #include "base/threading/thread_restrictions.h" |
12 #include "ios/web/public/web_thread.h" | 12 #include "ios/web/public/web_thread.h" |
13 #include "ios/web/shell/shell_url_request_context_getter.h" | 13 #include "ios/web/shell/shell_url_request_context_getter.h" |
14 | 14 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." |
| 17 #endif |
| 18 |
15 namespace web { | 19 namespace web { |
16 | 20 |
17 ShellBrowserState::ShellBrowserState() : BrowserState() { | 21 ShellBrowserState::ShellBrowserState() : BrowserState() { |
18 CHECK(PathService::Get(base::DIR_APP_DATA, &path_)); | 22 CHECK(PathService::Get(base::DIR_APP_DATA, &path_)); |
19 | 23 |
20 request_context_getter_ = new ShellURLRequestContextGetter( | 24 request_context_getter_ = new ShellURLRequestContextGetter( |
21 GetStatePath(), | 25 GetStatePath(), |
22 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO), | 26 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO), |
23 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE), | 27 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE), |
24 web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE)); | 28 web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE)); |
25 } | 29 } |
26 | 30 |
27 ShellBrowserState::~ShellBrowserState() { | 31 ShellBrowserState::~ShellBrowserState() { |
28 } | 32 } |
29 | 33 |
30 bool ShellBrowserState::IsOffTheRecord() const { | 34 bool ShellBrowserState::IsOffTheRecord() const { |
31 return false; | 35 return false; |
32 } | 36 } |
33 | 37 |
34 base::FilePath ShellBrowserState::GetStatePath() const { | 38 base::FilePath ShellBrowserState::GetStatePath() const { |
35 return path_; | 39 return path_; |
36 } | 40 } |
37 | 41 |
38 net::URLRequestContextGetter* ShellBrowserState::GetRequestContext() { | 42 net::URLRequestContextGetter* ShellBrowserState::GetRequestContext() { |
39 return request_context_getter_.get(); | 43 return request_context_getter_.get(); |
40 } | 44 } |
41 | 45 |
42 } // namespace web | 46 } // namespace web |
OLD | NEW |