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

Side by Side Diff: chrome/browser/child_process_security_policy.h

Issue 119014: Add some browser-level checks to prohibit access to extension bindings by... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/child_process_security_policy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ 5 #ifndef CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_
6 #define CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ 6 #define CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_
7 7
8 #include <string> 8 #include <string>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void GrantUploadFile(int renderer_id, const FilePath& file); 71 void GrantUploadFile(int renderer_id, const FilePath& file);
72 72
73 // Whenever the browser processes commands the renderer to run web inspector, 73 // Whenever the browser processes commands the renderer to run web inspector,
74 // it should call this method to grant the renderer process the capability to 74 // it should call this method to grant the renderer process the capability to
75 // run the inspector. 75 // run the inspector.
76 void GrantInspectElement(int renderer_id); 76 void GrantInspectElement(int renderer_id);
77 77
78 // Grant this renderer the ability to use DOM UI Bindings. 78 // Grant this renderer the ability to use DOM UI Bindings.
79 void GrantDOMUIBindings(int renderer_id); 79 void GrantDOMUIBindings(int renderer_id);
80 80
81 // Grant this renderer the ability to use extension Bindings.
82 void GrantExtensionBindings(int renderer_id);
83
81 // Before servicing a renderer's request for a URL, the browser should call 84 // Before servicing a renderer's request for a URL, the browser should call
82 // this method to determine whether the renderer has the capability to 85 // this method to determine whether the renderer has the capability to
83 // request the URL. 86 // request the URL.
84 bool CanRequestURL(int renderer_id, const GURL& url); 87 bool CanRequestURL(int renderer_id, const GURL& url);
85 88
86 // Before servicing a renderer's request to upload a file to the web, the 89 // Before servicing a renderer's request to upload a file to the web, the
87 // browser should call this method to determine whether the renderer has the 90 // browser should call this method to determine whether the renderer has the
88 // capability to upload the requested file. 91 // capability to upload the requested file.
89 bool CanUploadFile(int renderer_id, const FilePath& file); 92 bool CanUploadFile(int renderer_id, const FilePath& file);
90 93
91 // Returns true of the specified renderer_id has been granted DOMUIBindings. 94 // Returns true of the specified renderer_id has been granted DOMUIBindings.
92 // The browser should check this property before assuming the renderer is 95 // The browser should check this property before assuming the renderer is
93 // allowed to use DOMUIBindings. 96 // allowed to use DOMUIBindings.
94 bool HasDOMUIBindings(int renderer_id); 97 bool HasDOMUIBindings(int renderer_id);
95 98
99 // Returns true of the specified renderer_id has been granted DOMUIBindings.
100 // The browser should check this property before assuming the renderer is
101 // allowed to use extension bindings.
102 bool HasExtensionBindings(int renderer_id);
103
96 private: 104 private:
97 friend class ChildProcessSecurityPolicyInProcessBrowserTest; 105 friend class ChildProcessSecurityPolicyInProcessBrowserTest;
98 FRIEND_TEST(ChildProcessSecurityPolicyInProcessBrowserTest, NoLeak); 106 FRIEND_TEST(ChildProcessSecurityPolicyInProcessBrowserTest, NoLeak);
99 107
100 class SecurityState; 108 class SecurityState;
101 109
102 typedef std::set<std::string> SchemeSet; 110 typedef std::set<std::string> SchemeSet;
103 typedef std::map<int, SecurityState*> SecurityStateMap; 111 typedef std::map<int, SecurityState*> SecurityStateMap;
104 112
105 // Obtain an instance of ChildProcessSecurityPolicy via GetInstance(). 113 // Obtain an instance of ChildProcessSecurityPolicy via GetInstance().
(...skipping 16 matching lines...) Expand all
122 // This map holds a SecurityState for each renderer process. The key for the 130 // This map holds a SecurityState for each renderer process. The key for the
123 // map is the ID of the RenderProcessHost. The SecurityState objects are 131 // map is the ID of the RenderProcessHost. The SecurityState objects are
124 // owned by this object and are protected by |lock_|. References to them must 132 // owned by this object and are protected by |lock_|. References to them must
125 // not escape this class. 133 // not escape this class.
126 SecurityStateMap security_state_; 134 SecurityStateMap security_state_;
127 135
128 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicy); 136 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicy);
129 }; 137 };
130 138
131 #endif // CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ 139 #endif // CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/child_process_security_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698