| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 v8::Isolate* isolate = m_scriptState->isolate(); | 57 v8::Isolate* isolate = m_scriptState->isolate(); |
| 58 | 58 |
| 59 if (!m_scriptState->contextIsValid()) | 59 if (!m_scriptState->contextIsValid()) |
| 60 return; | 60 return; |
| 61 ScriptState::Scope scope(m_scriptState.get()); | 61 ScriptState::Scope scope(m_scriptState.get()); |
| 62 | 62 |
| 63 if (m_callback.isEmpty()) | 63 if (m_callback.isEmpty()) |
| 64 return; | 64 return; |
| 65 v8::Local<v8::Value> observerHandle = toV8(observer, m_scriptState->context(
)->Global(), isolate); | 65 v8::Local<v8::Value> observerHandle = toV8(observer, m_scriptState->context(
)->Global(), isolate); |
| 66 if (observerHandle.IsEmpty()) { | |
| 67 if (!isScriptControllerTerminating()) | |
| 68 CRASH(); | |
| 69 return; | |
| 70 } | |
| 71 | |
| 72 if (!observerHandle->IsObject()) | 66 if (!observerHandle->IsObject()) |
| 73 return; | 67 return; |
| 74 | 68 |
| 75 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(observerHandl
e); | 69 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(observerHandl
e); |
| 76 v8::Local<v8::Value> v8Mutations = toV8(mutations, m_scriptState->context()-
>Global(), isolate); | 70 v8::Local<v8::Value> v8Mutations = toV8(mutations, m_scriptState->context()-
>Global(), isolate); |
| 77 if (v8Mutations.IsEmpty()) | 71 if (v8Mutations.IsEmpty()) |
| 78 return; | 72 return; |
| 79 v8::Local<v8::Value> argv[] = { v8Mutations, observerHandle }; | 73 v8::Local<v8::Value> argv[] = { v8Mutations, observerHandle }; |
| 80 | 74 |
| 81 v8::TryCatch exceptionCatcher(isolate); | 75 v8::TryCatch exceptionCatcher(isolate); |
| 82 exceptionCatcher.SetVerbose(true); | 76 exceptionCatcher.SetVerbose(true); |
| 83 V8ScriptRunner::callFunction(m_callback.newLocal(isolate), getExecutionConte
xt(), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate); | 77 V8ScriptRunner::callFunction(m_callback.newLocal(isolate), getExecutionConte
xt(), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate); |
| 84 } | 78 } |
| 85 | 79 |
| 86 DEFINE_TRACE(V8MutationCallback) | 80 DEFINE_TRACE(V8MutationCallback) |
| 87 { | 81 { |
| 88 MutationCallback::trace(visitor); | 82 MutationCallback::trace(visitor); |
| 89 ActiveDOMCallback::trace(visitor); | 83 ActiveDOMCallback::trace(visitor); |
| 90 } | 84 } |
| 91 | 85 |
| 92 } // namespace blink | 86 } // namespace blink |
| OLD | NEW |