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

Side by Side Diff: content/browser/site_instance_impl.h

Issue 1777233002: Top document isolation mode prototype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Doghouse SiteInstance, with bugs Created 4 years, 9 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_
6 #define CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ 6 #define CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 25 matching lines...) Expand all
36 // SiteInstance interface overrides. 36 // SiteInstance interface overrides.
37 int32_t GetId() override; 37 int32_t GetId() override;
38 bool HasProcess() const override; 38 bool HasProcess() const override;
39 RenderProcessHost* GetProcess() override; 39 RenderProcessHost* GetProcess() override;
40 BrowserContext* GetBrowserContext() const override; 40 BrowserContext* GetBrowserContext() const override;
41 const GURL& GetSiteURL() const override; 41 const GURL& GetSiteURL() const override;
42 SiteInstance* GetRelatedSiteInstance(const GURL& url) override; 42 SiteInstance* GetRelatedSiteInstance(const GURL& url) override;
43 bool IsRelatedSiteInstance(const SiteInstance* instance) override; 43 bool IsRelatedSiteInstance(const SiteInstance* instance) override;
44 size_t GetRelatedActiveContentsCount() override; 44 size_t GetRelatedActiveContentsCount() override;
45 bool RequiresDedicatedProcess() override; 45 bool RequiresDedicatedProcess() override;
46 bool IsForDoghouse() const override;
46 47
47 // Set the web site that this SiteInstance is rendering pages for. 48 // Set the web site that this SiteInstance is rendering pages for.
48 // This includes the scheme and registered domain, but not the port. If the 49 // This includes the scheme and registered domain, but not the port. If the
49 // URL does not have a valid registered domain, then the full hostname is 50 // URL does not have a valid registered domain, then the full hostname is
50 // stored. 51 // stored.
51 void SetSite(const GURL& url); 52 void SetSite(const GURL& url);
52 bool HasSite() const; 53 bool HasSite() const;
53 54
54 // Returns whether there is currently a related SiteInstance (registered with 55 // Returns whether there is currently a related SiteInstance (registered with
55 // BrowsingInstance) for the site of the given url. If so, we should try to 56 // BrowsingInstance) for the site of the given url. If so, we should try to
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 friend class SiteInstance; 119 friend class SiteInstance;
119 120
120 // Virtual to allow tests to extend it. 121 // Virtual to allow tests to extend it.
121 ~SiteInstanceImpl() override; 122 ~SiteInstanceImpl() override;
122 123
123 // Create a new SiteInstance. Protected to give access to BrowsingInstance 124 // Create a new SiteInstance. Protected to give access to BrowsingInstance
124 // and tests; most callers should use Create or GetRelatedSiteInstance 125 // and tests; most callers should use Create or GetRelatedSiteInstance
125 // instead. 126 // instead.
126 explicit SiteInstanceImpl(BrowsingInstance* browsing_instance); 127 explicit SiteInstanceImpl(BrowsingInstance* browsing_instance);
127 128
129 void SetForDoghouse(bool);
130
128 private: 131 private:
129 // RenderProcessHostObserver implementation. 132 // RenderProcessHostObserver implementation.
130 void RenderProcessHostDestroyed(RenderProcessHost* host) override; 133 void RenderProcessHostDestroyed(RenderProcessHost* host) override;
131 void RenderProcessWillExit(RenderProcessHost* host) override; 134 void RenderProcessWillExit(RenderProcessHost* host) override;
132 void RenderProcessExited(RenderProcessHost* host, 135 void RenderProcessExited(RenderProcessHost* host,
133 base::TerminationStatus status, 136 base::TerminationStatus status,
134 int exit_code) override; 137 int exit_code) override;
135 138
136 // Used to restrict a process' origin access rights. 139 // Used to restrict a process' origin access rights.
137 void LockToOrigin(); 140 void LockToOrigin();
(...skipping 18 matching lines...) Expand all
156 // will still remain the same even if the process crashes, since in that 159 // will still remain the same even if the process crashes, since in that
157 // scenario the RenderProcessHost remains the same. 160 // scenario the RenderProcessHost remains the same.
158 RenderProcessHost* process_; 161 RenderProcessHost* process_;
159 162
160 // The web site that this SiteInstance is rendering pages for. 163 // The web site that this SiteInstance is rendering pages for.
161 GURL site_; 164 GURL site_;
162 165
163 // Whether SetSite has been called. 166 // Whether SetSite has been called.
164 bool has_site_; 167 bool has_site_;
165 168
169 // Whether the SiteInstance is dedicated for doghoused sites.
170 bool is_for_doghouse_;
171
166 base::ObserverList<Observer, true> observers_; 172 base::ObserverList<Observer, true> observers_;
167 173
168 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); 174 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl);
169 }; 175 };
170 176
171 } // namespace content 177 } // namespace content
172 178
173 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ 179 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698