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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp

Issue 2810743003: Move ScriptState::GetExecutionContext (Part 3) (Closed)
Patch Set: Rebase Created 3 years, 8 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698