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