Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8HTMLConstructor.cpp

Issue 2459443004: Add tracing to custom elements operations (Closed)
Patch Set: Bring patch to head. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/custom/CustomElementReactionQueue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/core/v8/V8HTMLConstructor.h" 5 #include "bindings/core/v8/V8HTMLConstructor.h"
6 6
7 #include "bindings/core/v8/DOMWrapperWorld.h" 7 #include "bindings/core/v8/DOMWrapperWorld.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptCustomElementDefinition.h" 9 #include "bindings/core/v8/ScriptCustomElementDefinition.h"
10 #include "bindings/core/v8/V8Binding.h" 10 #include "bindings/core/v8/V8Binding.h"
11 #include "bindings/core/v8/V8BindingMacros.h" 11 #include "bindings/core/v8/V8BindingMacros.h"
12 #include "bindings/core/v8/V8DOMWrapper.h" 12 #include "bindings/core/v8/V8DOMWrapper.h"
13 #include "bindings/core/v8/V8HTMLElement.h" 13 #include "bindings/core/v8/V8HTMLElement.h"
14 #include "bindings/core/v8/V8PerContextData.h" 14 #include "bindings/core/v8/V8PerContextData.h"
15 #include "bindings/core/v8/V8ThrowException.h" 15 #include "bindings/core/v8/V8ThrowException.h"
16 #include "core/dom/Document.h" 16 #include "core/dom/Document.h"
17 #include "core/dom/Element.h" 17 #include "core/dom/Element.h"
18 #include "core/dom/ExceptionCode.h" 18 #include "core/dom/ExceptionCode.h"
19 #include "core/dom/custom/CustomElementRegistry.h" 19 #include "core/dom/custom/CustomElementRegistry.h"
20 #include "core/frame/LocalDOMWindow.h" 20 #include "core/frame/LocalDOMWindow.h"
21 #include "platform/RuntimeEnabledFeatures.h" 21 #include "platform/RuntimeEnabledFeatures.h"
22 #include "platform/tracing/TraceEvent.h"
22 23
23 namespace blink { 24 namespace blink {
24 25
25 // https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors 26 // https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors
26 void V8HTMLConstructor::htmlConstructor( 27 void V8HTMLConstructor::htmlConstructor(
27 const v8::FunctionCallbackInfo<v8::Value>& info, 28 const v8::FunctionCallbackInfo<v8::Value>& info,
28 const WrapperTypeInfo& wrapperTypeInfo, 29 const WrapperTypeInfo& wrapperTypeInfo,
29 const HTMLElementType elementInterfaceName) { 30 const HTMLElementType elementInterfaceName) {
31 TRACE_EVENT0("blink", "HTMLConstructor");
30 DCHECK(info.IsConstructCall()); 32 DCHECK(info.IsConstructCall());
31 33
32 v8::Isolate* isolate = info.GetIsolate(); 34 v8::Isolate* isolate = info.GetIsolate();
33 ScriptState* scriptState = ScriptState::current(isolate); 35 ScriptState* scriptState = ScriptState::current(isolate);
34 v8::Local<v8::Value> newTarget = info.NewTarget(); 36 v8::Local<v8::Value> newTarget = info.NewTarget();
35 37
36 if (!scriptState->contextIsValid()) { 38 if (!scriptState->contextIsValid()) {
37 V8ThrowException::throwError(isolate, "The context has been destroyed"); 39 V8ThrowException::throwError(isolate, "The context has been destroyed");
38 return; 40 return;
39 } 41 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // If the element had a wrapper, we now update and return that 145 // If the element had a wrapper, we now update and return that
144 // instead. 146 // instead.
145 v8SetReturnValue(info, wrapper); 147 v8SetReturnValue(info, wrapper);
146 148
147 // 11. Perform element.[[SetPrototypeOf]](prototype). Rethrow any exceptions. 149 // 11. Perform element.[[SetPrototypeOf]](prototype). Rethrow any exceptions.
148 // Note: I don't think this prototype set *can* throw exceptions. 150 // Note: I don't think this prototype set *can* throw exceptions.
149 wrapper->SetPrototype(scriptState->context(), prototype.As<v8::Object>()) 151 wrapper->SetPrototype(scriptState->context(), prototype.As<v8::Object>())
150 .ToChecked(); 152 .ToChecked();
151 } 153 }
152 } // namespace blink 154 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/custom/CustomElementReactionQueue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698