OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CHILD_SITE_ISOLATION_POLICY_H_ | 5 #ifndef CONTENT_CHILD_SITE_ISOLATION_POLICY_H_ |
6 #define CONTENT_CHILD_SITE_ISOLATION_POLICY_H_ | 6 #define CONTENT_CHILD_SITE_ISOLATION_POLICY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 // "X-Content-Type-Options: nosniff" header, and with non-renderable status | 48 // "X-Content-Type-Options: nosniff" header, and with non-renderable status |
49 // code out of SiteIsolation.XSD.[%MIMETYPE].Blocked. | 49 // code out of SiteIsolation.XSD.[%MIMETYPE].Blocked. |
50 // SiteIsolation.XSD.[%MIMETYPE].NotBlocked : | 50 // SiteIsolation.XSD.[%MIMETYPE].NotBlocked : |
51 // # of responses, but not blocked due to failure of mime sniffing. | 51 // # of responses, but not blocked due to failure of mime sniffing. |
52 // SiteIsolation.XSD.[%MIMETYPE].NotBlocked.MaybeJS : | 52 // SiteIsolation.XSD.[%MIMETYPE].NotBlocked.MaybeJS : |
53 // # of responses that are plausibly sniffed to be JavaScript. | 53 // # of responses that are plausibly sniffed to be JavaScript. |
54 | 54 |
55 class CONTENT_EXPORT SiteIsolationPolicy { | 55 class CONTENT_EXPORT SiteIsolationPolicy { |
56 public: | 56 public: |
57 | 57 |
58 // Set activation flag for the UMA data collection for this renderer process. | |
59 static void SetPolicyActivationFlag(bool flag); | |
Charlie Reis
2013/09/03 16:43:23
SetPolicyEnabled seems like a simpler name.
dsjang
2013/09/03 19:13:11
Done.
| |
60 | |
58 // Records the bookkeeping data about the HTTP header information for the | 61 // Records the bookkeeping data about the HTTP header information for the |
59 // request identified by |request_id|. The bookkeeping data is used by | 62 // request identified by |request_id|. The bookkeeping data is used by |
60 // ShouldBlockResponse. We have to make sure to call OnRequestComplete to free | 63 // ShouldBlockResponse. We have to make sure to call OnRequestComplete to free |
61 // the bookkeeping data. | 64 // the bookkeeping data. |
62 static void OnReceivedResponse(int request_id, | 65 static void OnReceivedResponse(int request_id, |
63 GURL& frame_origin, | 66 GURL& frame_origin, |
64 GURL& response_url, | 67 GURL& response_url, |
65 ResourceType::Type resource_type, | 68 ResourceType::Type resource_type, |
66 const webkit_glue::ResourceResponseInfo& info); | 69 const webkit_glue::ResourceResponseInfo& info); |
67 | 70 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 // Maintain the bookkeeping data between OnReceivedResponse and | 163 // Maintain the bookkeeping data between OnReceivedResponse and |
161 // OnReceivedData. The key is a request id maintained by ResourceDispatcher. | 164 // OnReceivedData. The key is a request id maintained by ResourceDispatcher. |
162 static RequestIdToMetaDataMap* GetRequestIdToMetaDataMap(); | 165 static RequestIdToMetaDataMap* GetRequestIdToMetaDataMap(); |
163 | 166 |
164 // Maintain the bookkeeping data for OnReceivedData. Blocking decision is made | 167 // Maintain the bookkeeping data for OnReceivedData. Blocking decision is made |
165 // when OnReceivedData is called for the first time for a request, and the | 168 // when OnReceivedData is called for the first time for a request, and the |
166 // decision will remain the same for following data. This map maintains the | 169 // decision will remain the same for following data. This map maintains the |
167 // decision. The key is a request id maintained by ResourceDispatcher. | 170 // decision. The key is a request id maintained by ResourceDispatcher. |
168 static RequestIdToResultMap* GetRequestIdToResultMap(); | 171 static RequestIdToResultMap* GetRequestIdToResultMap(); |
169 | 172 |
173 static bool g_policy_activated; | |
Charlie Reis
2013/09/03 16:43:23
g_policy_enabled
dsjang
2013/09/03 19:13:11
Done.
| |
170 // Never needs to be constructed/destructed. | 174 // Never needs to be constructed/destructed. |
171 SiteIsolationPolicy() {} | 175 SiteIsolationPolicy() {} |
172 ~SiteIsolationPolicy() {} | 176 ~SiteIsolationPolicy() {} |
173 | 177 |
174 DISALLOW_COPY_AND_ASSIGN(SiteIsolationPolicy); | 178 DISALLOW_COPY_AND_ASSIGN(SiteIsolationPolicy); |
175 }; | 179 }; |
176 | 180 |
177 } // namespace content | 181 } // namespace content |
178 | 182 |
179 #endif // CONTENT_CHILD_SITE_ISOLATION_POLICY_H_ | 183 #endif // CONTENT_CHILD_SITE_ISOLATION_POLICY_H_ |
OLD | NEW |