OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/core/v8/V8PerformanceObserver.h" | 5 #include "bindings/core/v8/V8PerformanceObserver.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionMessages.h" | 7 #include "bindings/core/v8/ExceptionMessages.h" |
8 #include "bindings/core/v8/PerformanceObserverCallback.h" | 8 #include "bindings/core/v8/PerformanceObserverCallback.h" |
9 #include "bindings/core/v8/V8BindingForCore.h" | 9 #include "bindings/core/v8/V8BindingForCore.h" |
10 #include "bindings/core/v8/V8GCController.h" | 10 #include "bindings/core/v8/V8GCController.h" |
11 #include "bindings/core/v8/V8Performance.h" | 11 #include "bindings/core/v8/V8Performance.h" |
12 #include "bindings/core/v8/V8PrivateProperty.h" | |
13 #include "core/frame/LocalDOMWindow.h" | 12 #include "core/frame/LocalDOMWindow.h" |
14 #include "core/timing/DOMWindowPerformance.h" | 13 #include "core/timing/DOMWindowPerformance.h" |
15 #include "core/timing/PerformanceObserver.h" | 14 #include "core/timing/PerformanceObserver.h" |
16 #include "platform/bindings/V8DOMWrapper.h" | 15 #include "platform/bindings/V8DOMWrapper.h" |
| 16 #include "platform/bindings/V8PrivateProperty.h" |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 void V8PerformanceObserver::constructorCustom( | 20 void V8PerformanceObserver::constructorCustom( |
21 const v8::FunctionCallbackInfo<v8::Value>& info) { | 21 const v8::FunctionCallbackInfo<v8::Value>& info) { |
22 v8::Isolate* isolate = info.GetIsolate(); | 22 v8::Isolate* isolate = info.GetIsolate(); |
23 | 23 |
24 if (UNLIKELY(info.Length() < 1)) { | 24 if (UNLIKELY(info.Length() < 1)) { |
25 V8ThrowException::ThrowTypeError( | 25 V8ThrowException::ThrowTypeError( |
26 isolate, ExceptionMessages::FailedToConstruct( | 26 isolate, ExceptionMessages::FailedToConstruct( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 // TODO(bashi): Don't set private property (and remove this custom | 61 // TODO(bashi): Don't set private property (and remove this custom |
62 // constructor) when we can trace correctly. See crbug.com/468240. | 62 // constructor) when we can trace correctly. See crbug.com/468240. |
63 V8PrivateProperty::GetPerformanceObserverCallback(isolate).Set(wrapper, | 63 V8PrivateProperty::GetPerformanceObserverCallback(isolate).Set(wrapper, |
64 v8_callback); | 64 v8_callback); |
65 V8SetReturnValue(info, V8DOMWrapper::AssociateObjectWithWrapper( | 65 V8SetReturnValue(info, V8DOMWrapper::AssociateObjectWithWrapper( |
66 isolate, observer, &wrapperTypeInfo, wrapper)); | 66 isolate, observer, &wrapperTypeInfo, wrapper)); |
67 } | 67 } |
68 | 68 |
69 } // namespace blink | 69 } // namespace blink |
OLD | NEW |