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

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

Issue 2772723002: Add detailed use counters for document.registerElement use. (Closed)
Patch Set: Bring patch to head. Created 3 years, 9 months 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/V0CustomElement.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 /* 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 30 matching lines...) Expand all
41 #include "bindings/core/v8/V8PerContextData.h" 41 #include "bindings/core/v8/V8PerContextData.h"
42 #include "bindings/core/v8/V8SVGElement.h" 42 #include "bindings/core/v8/V8SVGElement.h"
43 #include "core/HTMLNames.h" 43 #include "core/HTMLNames.h"
44 #include "core/SVGNames.h" 44 #include "core/SVGNames.h"
45 #include "core/dom/Document.h" 45 #include "core/dom/Document.h"
46 #include "core/dom/ElementRegistrationOptions.h" 46 #include "core/dom/ElementRegistrationOptions.h"
47 #include "core/dom/custom/V0CustomElementDefinition.h" 47 #include "core/dom/custom/V0CustomElementDefinition.h"
48 #include "core/dom/custom/V0CustomElementDescriptor.h" 48 #include "core/dom/custom/V0CustomElementDescriptor.h"
49 #include "core/dom/custom/V0CustomElementException.h" 49 #include "core/dom/custom/V0CustomElementException.h"
50 #include "core/dom/custom/V0CustomElementProcessingStack.h" 50 #include "core/dom/custom/V0CustomElementProcessingStack.h"
51 #include "core/frame/UseCounter.h"
51 #include "wtf/Assertions.h" 52 #include "wtf/Assertions.h"
52 53
53 namespace blink { 54 namespace blink {
54 55
55 static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>&); 56 static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>&);
56 57
57 V0CustomElementConstructorBuilder::V0CustomElementConstructorBuilder( 58 V0CustomElementConstructorBuilder::V0CustomElementConstructorBuilder(
58 ScriptState* scriptState, 59 ScriptState* scriptState,
59 const ElementRegistrationOptions& options) 60 const ElementRegistrationOptions& options)
60 : m_scriptState(scriptState), m_options(options) { 61 : m_scriptState(scriptState), m_options(options) {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 scriptState, data, V8HiddenValue::customElementType(isolate)); 348 scriptState, data, V8HiddenValue::customElementType(isolate));
348 TOSTRING_VOID(V8StringResource<>, type, maybeType); 349 TOSTRING_VOID(V8StringResource<>, type, maybeType);
349 350
350 ExceptionState exceptionState( 351 ExceptionState exceptionState(
351 info.GetIsolate(), ExceptionState::ConstructionContext, "CustomElement"); 352 info.GetIsolate(), ExceptionState::ConstructionContext, "CustomElement");
352 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 353 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
353 Element* element = document->createElementNS( 354 Element* element = document->createElementNS(
354 namespaceURI, tagName, 355 namespaceURI, tagName,
355 StringOrDictionary::fromString(maybeType->IsNull() ? nullAtom : type), 356 StringOrDictionary::fromString(maybeType->IsNull() ? nullAtom : type),
356 exceptionState); 357 exceptionState);
358 if (element) {
359 UseCounter::count(document, UseCounter::V0CustomElementsConstruct);
360 }
357 v8SetReturnValueFast(info, element, document); 361 v8SetReturnValueFast(info, element, document);
358 } 362 }
359 363
360 } // namespace blink 364 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/custom/V0CustomElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698