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

Unified Diff: chrome/browser/extensions/process_map.h

Issue 8565023: Add some commentary and warnings to extensions::ProcessMap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/process_map.h
diff --git a/chrome/browser/extensions/process_map.h b/chrome/browser/extensions/process_map.h
index 9d435054282645613b507865d3294b2784d24bfc..84c8f86677195d56d2ce718eb67d250dc1ab0fba 100644
--- a/chrome/browser/extensions/process_map.h
+++ b/chrome/browser/extensions/process_map.h
@@ -33,6 +33,30 @@ namespace extensions {
//
// But we only allow high-privilege operations to be performed by an extension
// when it is running in an assigned process.
+//
+// ===========================================================================
+// WARNINGS - PLEASE UNDERSTAND THESE BEFORE CALLING OR MODIFYING THIS CLASS
+// ===========================================================================
+//
+// 1. This class contains the processes for hosted apps as well as extensions
+// and packaged apps. Just because a process is present here *does not* mean
+// it is an "extension process" (e.g., for UI purposes). It may contain only
+// hosted apps. See crbug.com/102533.
+//
+// 2. An extension can show be in multiple processes. That is why there is no
+// GetExtensionProcess() method here. There are two cases: a) The extension
+// is actually a hosted app, in which case this is normal, or b) there is an
+// incognito window open and the extension is "split mode". It is *not safe*
+// to assume that there is one process per extension. If you only care about
+// extensions (not hosted apps), and you are on the UI thread, then use
+// ExtensionProcessManager::GetSiteInstanceForURL()->[Has|Get]Process().
+//
+// 3. The process ids contained in this class are *not limited* to the Profile
+// you got this map from. They can also be associated with that profile's
+// incognito/normal twin. If you care about this, use
+// RenderProcessHost::FromID() and check the profile of the resulting object.
+//
+// TODO(aa): The above warnings suggest this class could use improvement :).
class ProcessMap {
public:
ProcessMap();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698