OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_BROWSER_PROCESS_MAP_H_ | 5 #ifndef EXTENSIONS_BROWSER_PROCESS_MAP_H_ |
6 #define EXTENSIONS_BROWSER_PROCESS_MAP_H_ | 6 #define EXTENSIONS_BROWSER_PROCESS_MAP_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // downgraded) or in a web page's process (privilege level needs to be | 109 // downgraded) or in a web page's process (privilege level needs to be |
110 // upgraded). | 110 // upgraded). |
111 // | 111 // |
112 // The latter of these is slightly problematic from a security perspective; | 112 // The latter of these is slightly problematic from a security perspective; |
113 // if a web page renderer gets owned it could try to pretend it's an | 113 // if a web page renderer gets owned it could try to pretend it's an |
114 // extension and get access to some unprivileged APIs. Luckly, when OOP | 114 // extension and get access to some unprivileged APIs. Luckly, when OOP |
115 // iframes lauch, it won't be an issue. | 115 // iframes lauch, it won't be an issue. |
116 // | 116 // |
117 // Anyhow, the expected behaviour is: | 117 // Anyhow, the expected behaviour is: |
118 // - For hosted app processes, this will be blessed_web_page. | 118 // - For hosted app processes, this will be blessed_web_page. |
| 119 // - For processes of platform apps running on lock screen, this will be |
| 120 // lock_screen_extension. |
119 // - For other extension processes, this will be blessed_extension. | 121 // - For other extension processes, this will be blessed_extension. |
120 // - For WebUI processes, this will be a webui. | 122 // - For WebUI processes, this will be a webui. |
121 // - For any other extension we have the choice of unblessed_extension or | 123 // - For any other extension we have the choice of unblessed_extension or |
122 // content_script. Since content scripts are more common, guess that. | 124 // content_script. Since content scripts are more common, guess that. |
123 // We *could* in theory track which web processes have extension frames | 125 // We *could* in theory track which web processes have extension frames |
124 // in them, and those would be unblessed_extension, but we don't at the | 126 // in them, and those would be unblessed_extension, but we don't at the |
125 // moment, and once OOP iframes exist then there won't even be such a | 127 // moment, and once OOP iframes exist then there won't even be such a |
126 // thing as an unblessed_extension context. | 128 // thing as an unblessed_extension context. |
127 // - For anything else, web_page. | 129 // - For anything else, web_page. |
128 Feature::Context GetMostLikelyContextType(const Extension* extension, | 130 Feature::Context GetMostLikelyContextType(const Extension* extension, |
129 int process_id) const; | 131 int process_id) const; |
130 | 132 |
| 133 void set_is_lock_screen_context(bool is_lock_screen_context) { |
| 134 is_lock_screen_context_ = is_lock_screen_context; |
| 135 } |
| 136 |
131 private: | 137 private: |
132 struct Item; | 138 struct Item; |
133 | 139 |
134 typedef std::set<Item> ItemSet; | 140 typedef std::set<Item> ItemSet; |
135 ItemSet items_; | 141 ItemSet items_; |
136 | 142 |
| 143 // Whether the process map belongs to the browser context used on Chrome OS |
| 144 // lock screen. |
| 145 bool is_lock_screen_context_ = false; |
| 146 |
137 DISALLOW_COPY_AND_ASSIGN(ProcessMap); | 147 DISALLOW_COPY_AND_ASSIGN(ProcessMap); |
138 }; | 148 }; |
139 | 149 |
140 } // namespace extensions | 150 } // namespace extensions |
141 | 151 |
142 #endif // EXTENSIONS_BROWSER_PROCESS_MAP_H_ | 152 #endif // EXTENSIONS_BROWSER_PROCESS_MAP_H_ |
OLD | NEW |