OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 return nullptr; | 291 return nullptr; |
292 } | 292 } |
293 | 293 |
294 bool WorkerGlobalScope::IsSecureContext(String& error_message) const { | 294 bool WorkerGlobalScope::IsSecureContext(String& error_message) const { |
295 // Until there are APIs that are available in workers and that | 295 // Until there are APIs that are available in workers and that |
296 // require a privileged context test that checks ancestors, just do | 296 // require a privileged context test that checks ancestors, just do |
297 // a simple check here. Once we have a need for a real | 297 // a simple check here. Once we have a need for a real |
298 // |isSecureContext| check here, we can check the responsible | 298 // |isSecureContext| check here, we can check the responsible |
299 // document for a privileged context at worker creation time, pass | 299 // document for a privileged context at worker creation time, pass |
300 // it in via WorkerThreadStartupData, and check it here. | 300 // it in via WorkerThreadStartupData, and check it here. |
| 301 // (Note: also update WorkerShadowFetchContext's IsSecureContext |
| 302 // implementation when we update this.) |
301 if (GetSecurityOrigin()->IsPotentiallyTrustworthy()) | 303 if (GetSecurityOrigin()->IsPotentiallyTrustworthy()) |
302 return true; | 304 return true; |
303 error_message = GetSecurityOrigin()->IsPotentiallyTrustworthyErrorMessage(); | 305 error_message = GetSecurityOrigin()->IsPotentiallyTrustworthyErrorMessage(); |
304 return false; | 306 return false; |
305 } | 307 } |
306 | 308 |
307 ExecutionContext* WorkerGlobalScope::GetExecutionContext() const { | 309 ExecutionContext* WorkerGlobalScope::GetExecutionContext() const { |
308 return const_cast<WorkerGlobalScope*>(this); | 310 return const_cast<WorkerGlobalScope*>(this); |
309 } | 311 } |
310 | 312 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 visitor->Trace(event_listeners_); | 394 visitor->Trace(event_listeners_); |
393 visitor->Trace(pending_error_events_); | 395 visitor->Trace(pending_error_events_); |
394 visitor->Trace(fetch_context_); | 396 visitor->Trace(fetch_context_); |
395 ExecutionContext::Trace(visitor); | 397 ExecutionContext::Trace(visitor); |
396 EventTargetWithInlineData::Trace(visitor); | 398 EventTargetWithInlineData::Trace(visitor); |
397 SecurityContext::Trace(visitor); | 399 SecurityContext::Trace(visitor); |
398 Supplementable<WorkerGlobalScope>::Trace(visitor); | 400 Supplementable<WorkerGlobalScope>::Trace(visitor); |
399 } | 401 } |
400 | 402 |
401 } // namespace blink | 403 } // namespace blink |
OLD | NEW |