| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bindings/modules/v8/V8IDBObserver.h" | 5 #include "bindings/modules/v8/V8IDBObserver.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionMessages.h" | 7 #include "bindings/core/v8/ExceptionMessages.h" |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/core/v8/V8Binding.h" | 9 #include "bindings/core/v8/V8Binding.h" |
| 10 #include "bindings/core/v8/V8DOMWrapper.h" | 10 #include "bindings/core/v8/V8DOMWrapper.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 44 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 45 v8::Local<v8::Function> v8Callback = v8::Local<v8::Function>::Cast(info[0]); | 45 v8::Local<v8::Function> v8Callback = v8::Local<v8::Function>::Cast(info[0]); |
| 46 IDBObserverCallback* callback = | 46 IDBObserverCallback* callback = |
| 47 IDBObserverCallback::create(scriptState, v8Callback); | 47 IDBObserverCallback::create(scriptState, v8Callback); |
| 48 IDBObserver* observer = IDBObserver::create(callback); | 48 IDBObserver* observer = IDBObserver::create(callback); |
| 49 if (exceptionState.hadException()) | 49 if (exceptionState.hadException()) |
| 50 return; | 50 return; |
| 51 DCHECK(observer); | 51 DCHECK(observer); |
| 52 // TODO(bashi): Don't set private property (and remove this custom | 52 // TODO(bashi): Don't set private property (and remove this custom |
| 53 // constructor) when we can call setWrapperReference() correctly. | 53 // constructor) when we can trace correctly. |
| 54 V8PrivateProperty::getIDBObserverCallback(info.GetIsolate()) | 54 V8PrivateProperty::getIDBObserverCallback(info.GetIsolate()) |
| 55 .set(info.GetIsolate()->GetCurrentContext(), wrapper, v8Callback); | 55 .set(info.GetIsolate()->GetCurrentContext(), wrapper, v8Callback); |
| 56 v8SetReturnValue(info, | 56 v8SetReturnValue(info, |
| 57 V8DOMWrapper::associateObjectWithWrapper( | 57 V8DOMWrapper::associateObjectWithWrapper( |
| 58 info.GetIsolate(), observer, &wrapperTypeInfo, wrapper)); | 58 info.GetIsolate(), observer, &wrapperTypeInfo, wrapper)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace blink | 61 } // namespace blink |
| OLD | NEW |