OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef BLIMP_ENGINE_COMMON_BLIMP_BROWSER_CONTEXT_H_ | 5 #ifndef BLIMP_ENGINE_COMMON_BLIMP_BROWSER_CONTEXT_H_ |
6 #define BLIMP_ENGINE_COMMON_BLIMP_BROWSER_CONTEXT_H_ | 6 #define BLIMP_ENGINE_COMMON_BLIMP_BROWSER_CONTEXT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "blimp/engine/app/blimp_metrics_service_client.h" |
12 #include "blimp/engine/app/blimp_system_url_request_context_getter.h" | 13 #include "blimp/engine/app/blimp_system_url_request_context_getter.h" |
13 #include "blimp/engine/app/blimp_url_request_context_getter.h" | 14 #include "blimp/engine/app/blimp_url_request_context_getter.h" |
14 #include "content/public/browser/browser_context.h" | 15 #include "content/public/browser/browser_context.h" |
15 #include "content/public/browser/content_browser_client.h" | 16 #include "content/public/browser/content_browser_client.h" |
16 #include "content/public/browser/resource_context.h" | 17 #include "content/public/browser/resource_context.h" |
17 #include "net/url_request/url_request_job_factory.h" | 18 #include "net/url_request/url_request_job_factory.h" |
18 | 19 |
19 namespace net { | 20 namespace net { |
20 class NetLog; | 21 class NetLog; |
21 } | 22 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 61 |
61 // Provides a URLRequestContextGetter for system requests (e.g. metrics | 62 // Provides a URLRequestContextGetter for system requests (e.g. metrics |
62 // uploads). | 63 // uploads). |
63 net::URLRequestContextGetter* GetSystemRequestContextGetter(); | 64 net::URLRequestContextGetter* GetSystemRequestContextGetter(); |
64 | 65 |
65 private: | 66 private: |
66 // Performs initialization of the BlimpBrowserContext while IO is still | 67 // Performs initialization of the BlimpBrowserContext while IO is still |
67 // allowed on the current thread. | 68 // allowed on the current thread. |
68 void InitWhileIOAllowed(); | 69 void InitWhileIOAllowed(); |
69 | 70 |
| 71 // Used in metrics initialization to get a PrefService to store logs |
| 72 // temporarily. |
| 73 std::unique_ptr<PrefService> GetPrefService(); |
| 74 |
70 std::unique_ptr<BlimpResourceContext> resource_context_; | 75 std::unique_ptr<BlimpResourceContext> resource_context_; |
71 scoped_refptr<BlimpSystemURLRequestContextGetter> system_context_getter_; | 76 scoped_refptr<BlimpSystemURLRequestContextGetter> system_context_getter_; |
72 bool ignore_certificate_errors_; | 77 bool ignore_certificate_errors_; |
73 std::unique_ptr<content::PermissionManager> permission_manager_; | 78 std::unique_ptr<content::PermissionManager> permission_manager_; |
74 bool off_the_record_; | 79 bool off_the_record_; |
75 net::NetLog* net_log_; | 80 net::NetLog* net_log_; |
76 base::FilePath path_; | 81 base::FilePath path_; |
77 | 82 |
78 DISALLOW_COPY_AND_ASSIGN(BlimpBrowserContext); | 83 DISALLOW_COPY_AND_ASSIGN(BlimpBrowserContext); |
79 }; | 84 }; |
80 | 85 |
81 } // namespace engine | 86 } // namespace engine |
82 } // namespace blimp | 87 } // namespace blimp |
83 | 88 |
84 #endif // BLIMP_ENGINE_COMMON_BLIMP_BROWSER_CONTEXT_H_ | 89 #endif // BLIMP_ENGINE_COMMON_BLIMP_BROWSER_CONTEXT_H_ |
OLD | NEW |