| 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 16 matching lines...) Expand all Loading... |
| 27 #include "bindings/core/v8/V8MutationCallback.h" | 27 #include "bindings/core/v8/V8MutationCallback.h" |
| 28 | 28 |
| 29 #include "bindings/core/v8/ScriptController.h" | 29 #include "bindings/core/v8/ScriptController.h" |
| 30 #include "bindings/core/v8/V8Binding.h" | 30 #include "bindings/core/v8/V8Binding.h" |
| 31 #include "bindings/core/v8/V8HiddenValue.h" | 31 #include "bindings/core/v8/V8HiddenValue.h" |
| 32 #include "bindings/core/v8/V8MutationObserver.h" | 32 #include "bindings/core/v8/V8MutationObserver.h" |
| 33 #include "bindings/core/v8/V8MutationRecord.h" | 33 #include "bindings/core/v8/V8MutationRecord.h" |
| 34 #include "core/dom/ExecutionContext.h" | 34 #include "core/dom/ExecutionContext.h" |
| 35 #include "wtf/Assertions.h" | 35 #include "wtf/Assertions.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace blink { |
| 38 | 38 |
| 39 V8MutationCallback::V8MutationCallback(v8::Handle<v8::Function> callback, v8::Ha
ndle<v8::Object> owner, ScriptState* scriptState) | 39 V8MutationCallback::V8MutationCallback(v8::Handle<v8::Function> callback, v8::Ha
ndle<v8::Object> owner, ScriptState* scriptState) |
| 40 : ActiveDOMCallback(scriptState->executionContext()) | 40 : ActiveDOMCallback(scriptState->executionContext()) |
| 41 , m_callback(scriptState->isolate(), callback) | 41 , m_callback(scriptState->isolate(), callback) |
| 42 , m_scriptState(scriptState) | 42 , m_scriptState(scriptState) |
| 43 { | 43 { |
| 44 V8HiddenValue::setHiddenValue(scriptState->isolate(), owner, V8HiddenValue::
callback(scriptState->isolate()), callback); | 44 V8HiddenValue::setHiddenValue(scriptState->isolate(), owner, V8HiddenValue::
callback(scriptState->isolate()), callback); |
| 45 m_callback.setWeak(this, &setWeakCallback); | 45 m_callback.setWeak(this, &setWeakCallback); |
| 46 } | 46 } |
| 47 | 47 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 74 v8::TryCatch exceptionCatcher; | 74 v8::TryCatch exceptionCatcher; |
| 75 exceptionCatcher.SetVerbose(true); | 75 exceptionCatcher.SetVerbose(true); |
| 76 ScriptController::callFunction(executionContext(), m_callback.newLocal(isola
te), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate); | 76 ScriptController::callFunction(executionContext(), m_callback.newLocal(isola
te), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void V8MutationCallback::setWeakCallback(const v8::WeakCallbackData<v8::Function
, V8MutationCallback>& data) | 79 void V8MutationCallback::setWeakCallback(const v8::WeakCallbackData<v8::Function
, V8MutationCallback>& data) |
| 80 { | 80 { |
| 81 data.GetParameter()->m_callback.clear(); | 81 data.GetParameter()->m_callback.clear(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace WebCore | 84 } // namespace blink |
| OLD | NEW |