Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(930)

Unified Diff: extensions/browser/process_map.h

Issue 444133003: Try run for https://codereview.chromium.org/426593007. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: app view fix Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/extension_function_dispatcher.cc ('k') | extensions/browser/process_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/process_map.h
diff --git a/extensions/browser/process_map.h b/extensions/browser/process_map.h
index 23f2674b020470718ddbceb3ccdc1d131ac0c52a..d7ae8b39e61c4c3325cf6b1546af823ed19f9df5 100644
--- a/extensions/browser/process_map.h
+++ b/extensions/browser/process_map.h
@@ -10,12 +10,14 @@
#include "base/basictypes.h"
#include "components/keyed_service/core/keyed_service.h"
+#include "extensions/common/features/feature.h"
namespace content {
class BrowserContext;
}
namespace extensions {
+class Extension;
// Contains information about which extensions are assigned to which processes.
//
@@ -66,6 +68,10 @@ namespace extensions {
// RenderProcessHost::FromID() and check the profile of the resulting object.
//
// TODO(aa): The above warnings suggest this class could use improvement :).
+//
+// TODO(kalman): This class is not threadsafe, but is used on both the UI and
+// IO threads. Somebody should fix that, either make it
+// threadsafe or enforce single thread. Investigation required.
class ProcessMap : public KeyedService {
public:
ProcessMap();
@@ -89,6 +95,25 @@ class ProcessMap : public KeyedService {
std::set<std::string> GetExtensionsInProcess(int process_id) const;
+ // Guesses the most permissive context type for the process with ID
+ // |process_id|. Context types are renderer (JavaScript) concepts but the
+ // browser can do a decent job in guessing what the process hosts.
+ //
+ // - For hosted app processes, this will be blessed_web_page.
+ // - For other extension processes, this will be blessed_extension.
+ // - For WebUI processes, this will be a webui.
+ // - For anything else we have the choice of unblessed_extension or
+ // content_script. Since content scripts are more common, guess that.
+ // We *could* in theory track which web processes have extension frames
+ // in them, and those would be unblessed_extension, but we don't at the
+ // moment, and once OOP iframes exist then there won't even be such a
+ // thing as an unblessed_extension context.
+ //
+ // |extension| isn't used to upgrade the process trust level, but rather used
+ // as a tiebreaker if a process is found to contain multiple extensions.
+ Feature::Context GuessContextType(const Extension* extension,
+ int process_id) const;
+
private:
struct Item;
« no previous file with comments | « extensions/browser/extension_function_dispatcher.cc ('k') | extensions/browser/process_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698