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) 2012 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2012 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 ExecutionContext::ExecutionContext() | 49 ExecutionContext::ExecutionContext() |
50 : circular_sequential_id_(0), | 50 : circular_sequential_id_(0), |
51 in_dispatch_error_event_(false), | 51 in_dispatch_error_event_(false), |
52 is_context_suspended_(false), | 52 is_context_suspended_(false), |
53 is_context_destroyed_(false), | 53 is_context_destroyed_(false), |
54 window_interaction_tokens_(0), | 54 window_interaction_tokens_(0), |
55 referrer_policy_(kReferrerPolicyDefault) {} | 55 referrer_policy_(kReferrerPolicyDefault) {} |
56 | 56 |
57 ExecutionContext::~ExecutionContext() {} | 57 ExecutionContext::~ExecutionContext() {} |
58 | 58 |
| 59 ExecutionContext* ExecutionContext::From(const ScriptState* script_state) { |
| 60 v8::HandleScope scope(script_state->GetIsolate()); |
| 61 return ToExecutionContext(script_state->GetContext()); |
| 62 } |
| 63 |
59 void ExecutionContext::SuspendSuspendableObjects() { | 64 void ExecutionContext::SuspendSuspendableObjects() { |
60 DCHECK(!is_context_suspended_); | 65 DCHECK(!is_context_suspended_); |
61 NotifySuspendingSuspendableObjects(); | 66 NotifySuspendingSuspendableObjects(); |
62 is_context_suspended_ = true; | 67 is_context_suspended_ = true; |
63 } | 68 } |
64 | 69 |
65 void ExecutionContext::ResumeSuspendableObjects() { | 70 void ExecutionContext::ResumeSuspendableObjects() { |
66 DCHECK(is_context_suspended_); | 71 DCHECK(is_context_suspended_); |
67 is_context_suspended_ = false; | 72 is_context_suspended_ = false; |
68 NotifyResumingSuspendableObjects(); | 73 NotifyResumingSuspendableObjects(); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 239 } |
235 | 240 |
236 DEFINE_TRACE(ExecutionContext) { | 241 DEFINE_TRACE(ExecutionContext) { |
237 visitor->Trace(public_url_manager_); | 242 visitor->Trace(public_url_manager_); |
238 visitor->Trace(pending_exceptions_); | 243 visitor->Trace(pending_exceptions_); |
239 ContextLifecycleNotifier::Trace(visitor); | 244 ContextLifecycleNotifier::Trace(visitor); |
240 Supplementable<ExecutionContext>::Trace(visitor); | 245 Supplementable<ExecutionContext>::Trace(visitor); |
241 } | 246 } |
242 | 247 |
243 } // namespace blink | 248 } // namespace blink |
OLD | NEW |