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

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

Issue 2921063003: Fix process reuse for dedicated processes when over process limit. (Closed)
Patch Set: Fix IsSuitableHost for sites that require a dedicated process but don't set an origin lock Created 3 years, 6 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_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_
6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ 6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 bool CanCopyIntoFileSystemFile(int child_id, 169 bool CanCopyIntoFileSystemFile(int child_id,
170 const storage::FileSystemURL& filesystem_url); 170 const storage::FileSystemURL& filesystem_url);
171 bool CanDeleteFileSystemFile(int child_id, 171 bool CanDeleteFileSystemFile(int child_id,
172 const storage::FileSystemURL& filesystem_url); 172 const storage::FileSystemURL& filesystem_url);
173 173
174 // Returns true if the specified child_id has been granted ReadRawCookies. 174 // Returns true if the specified child_id has been granted ReadRawCookies.
175 bool CanReadRawCookies(int child_id); 175 bool CanReadRawCookies(int child_id);
176 176
177 // Sets the process as only permitted to use and see the cookies for the 177 // Sets the process as only permitted to use and see the cookies for the
178 // given origin. 178 // given origin.
179 // Origin lock is applied only if the --site-per-process flag is used.
180 void LockToOrigin(int child_id, const GURL& gurl); 179 void LockToOrigin(int child_id, const GURL& gurl);
181 180
181 // Check if the process specified by |child_id| has a non-empty origin lock.
182 bool HasOriginLock(int child_id);
183
184 // Check if the process specified by |child_id| is dedicated to the provided
185 // site URL. This returns true if LockToOrigin was previously called on the
186 // same process and on a url with a site that matches |site_url|.
187 bool IsLockedToOrigin(int child_id, const GURL& site_url);
188
182 // Register FileSystem type and permission policy which should be used 189 // Register FileSystem type and permission policy which should be used
183 // for the type. The |policy| must be a bitwise-or'd value of 190 // for the type. The |policy| must be a bitwise-or'd value of
184 // storage::FilePermissionPolicy. 191 // storage::FilePermissionPolicy.
185 void RegisterFileSystemPermissionPolicy(storage::FileSystemType type, 192 void RegisterFileSystemPermissionPolicy(storage::FileSystemType type,
186 int policy); 193 int policy);
187 194
188 // Returns true if sending system exclusive messages is allowed. 195 // Returns true if sending system exclusive messages is allowed.
189 bool CanSendMidiSysExMessage(int child_id); 196 bool CanSendMidiSysExMessage(int child_id);
190 197
191 // Add an origin to the list of origins that require process isolation. 198 // Add an origin to the list of origins that require process isolation.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 // eTLD+1. Each of these origins requires a dedicated process. This set is 319 // eTLD+1. Each of these origins requires a dedicated process. This set is
313 // protected by |lock_|. 320 // protected by |lock_|.
314 std::set<url::Origin> isolated_origins_; 321 std::set<url::Origin> isolated_origins_;
315 322
316 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); 323 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl);
317 }; 324 };
318 325
319 } // namespace content 326 } // namespace content
320 327
321 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ 328 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698