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

Side by Side Diff: content/common/site_isolation_policy.h

Issue 1208143002: Move existing kSitePerProcess checks to a policy-oracle object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
Patch Set: Fix some includes Created 5 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_SITE_ISOLATION_POLICY_H_
6 #define CONTENT_COMMON_SITE_ISOLATION_POLICY_H_
7
8 #include "base/basictypes.h"
9 #include "url/gurl.h"
10
11 namespace content {
12
13 // A centralized place for making policy decisions about out-of-process iframes,
14 // site isolation, --site-per-process, and related features.
15 //
16 // This is currently static because all these modes are controlled by command-
17 // line flags.
18 //
19 // These methods can be called from any thread.
20 class SiteIsolationPolicy {
21 public:
22 // Returns true if the current process model might allow the use of cross-
23 // process iframes. This should typically used to avoid executing codepaths
24 // that only matter for cross-process iframes, to protect the default
25 // behavior.
26 //
27 // Note: Since cross-process frames will soon be possible by default (e.g. for
28 // <iframe src="http://..."> in an extension process), usage should be limited
29 // to temporary stop-gaps.
30 //
31 // Instead of calling this method, prefer to examine object state to see
32 // whether a particular frame happens to have a cross-process relationship
33 // with another, or to consult DoesSiteRequireDedicatedProcess() to see if a
34 // particular site merits protection.
35 static bool AreCrossProcessFramesPossible();
36
37 // Returns true if pages loaded from |url|'s site ought to be handled only by
38 // a renderer process isolated from other sites. If --site-per-process is on
39 // the command line, this is true for all sites.
40 //
41 // Eventually, this function will be made to return true for only some schemes
42 // (e.g. extensions) or a whitelist of sites that we should protect for this
43 // user.
44 //
45 // Although |url| is currently ignored, callers can assume for now that they
46 // can pass a full URL here -- they needn't canonicalize it to a site.
47 static bool DoesSiteRequireDedicatedProcess(const GURL& url);
48
49 // Returns true if navigation and history code should maintain per-frame
50 // navigation entries. This is an in-progress feature related to site
51 // isolation, so the return value is currently tied to --site-per-process.
52 // TODO(creis, avi): Make this the default, and eliminate this.
53 static bool UseSubframeNavigationEntries();
54
55 private:
56 SiteIsolationPolicy(); // Not instantiable.
57
58 DISALLOW_COPY_AND_ASSIGN(SiteIsolationPolicy);
59 };
60
61 } // namespace content
62
63 #endif // CONTENT_COMMON_SITE_ISOLATION_POLICY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698