| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 V8PrivateProperty::GetMutationObserverCallback(script_state->GetIsolate()) | 44 V8PrivateProperty::GetMutationObserverCallback(script_state->GetIsolate()) |
| 45 .Set(owner, callback); | 45 .Set(owner, callback); |
| 46 } | 46 } |
| 47 | 47 |
| 48 V8MutationCallback::~V8MutationCallback() {} | 48 V8MutationCallback::~V8MutationCallback() {} |
| 49 | 49 |
| 50 void V8MutationCallback::Call( | 50 void V8MutationCallback::Call( |
| 51 const HeapVector<Member<MutationRecord>>& mutations, | 51 const HeapVector<Member<MutationRecord>>& mutations, |
| 52 MutationObserver* observer) { | 52 MutationObserver* observer) { |
| 53 v8::Isolate* isolate = script_state_->GetIsolate(); | 53 v8::Isolate* isolate = script_state_->GetIsolate(); |
| 54 ExecutionContext* execution_context = script_state_->GetExecutionContext(); | 54 ExecutionContext* execution_context = |
| 55 ExecutionContext::From(script_state_.Get()); |
| 55 if (!execution_context || execution_context->IsContextSuspended() || | 56 if (!execution_context || execution_context->IsContextSuspended() || |
| 56 execution_context->IsContextDestroyed()) | 57 execution_context->IsContextDestroyed()) |
| 57 return; | 58 return; |
| 58 if (!script_state_->ContextIsValid()) | 59 if (!script_state_->ContextIsValid()) |
| 59 return; | 60 return; |
| 60 ScriptState::Scope scope(script_state_.Get()); | 61 ScriptState::Scope scope(script_state_.Get()); |
| 61 | 62 |
| 62 if (callback_.IsEmpty()) | 63 if (callback_.IsEmpty()) |
| 63 return; | 64 return; |
| 64 v8::Local<v8::Value> observer_handle = | 65 v8::Local<v8::Value> observer_handle = |
| (...skipping 19 matching lines...) Expand all Loading... |
| 84 DEFINE_TRACE(V8MutationCallback) { | 85 DEFINE_TRACE(V8MutationCallback) { |
| 85 MutationCallback::Trace(visitor); | 86 MutationCallback::Trace(visitor); |
| 86 } | 87 } |
| 87 | 88 |
| 88 DEFINE_TRACE_WRAPPERS(V8MutationCallback) { | 89 DEFINE_TRACE_WRAPPERS(V8MutationCallback) { |
| 89 visitor->TraceWrappers(callback_.Cast<v8::Value>()); | 90 visitor->TraceWrappers(callback_.Cast<v8::Value>()); |
| 90 MutationCallback::TraceWrappers(visitor); | 91 MutationCallback::TraceWrappers(visitor); |
| 91 } | 92 } |
| 92 | 93 |
| 93 } // namespace blink | 94 } // namespace blink |
| OLD | NEW |