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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->IsObject()) | 66 if (!observerHandle->IsObject()) |
67 return; | 67 return; |
68 | 68 |
69 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); |
70 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); |
71 if (v8Mutations.IsEmpty()) | |
72 return; | |
73 v8::Local<v8::Value> argv[] = { v8Mutations, observerHandle }; | 71 v8::Local<v8::Value> argv[] = { v8Mutations, observerHandle }; |
74 | 72 |
75 v8::TryCatch exceptionCatcher(isolate); | 73 v8::TryCatch exceptionCatcher(isolate); |
76 exceptionCatcher.SetVerbose(true); | 74 exceptionCatcher.SetVerbose(true); |
77 V8ScriptRunner::callFunction(m_callback.newLocal(isolate), getExecutionConte
xt(), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate); | 75 V8ScriptRunner::callFunction(m_callback.newLocal(isolate), getExecutionConte
xt(), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate); |
78 } | 76 } |
79 | 77 |
80 DEFINE_TRACE(V8MutationCallback) | 78 DEFINE_TRACE(V8MutationCallback) |
81 { | 79 { |
82 MutationCallback::trace(visitor); | 80 MutationCallback::trace(visitor); |
83 ActiveDOMCallback::trace(visitor); | 81 ActiveDOMCallback::trace(visitor); |
84 } | 82 } |
85 | 83 |
86 } // namespace blink | 84 } // namespace blink |
OLD | NEW |