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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl

Issue 1987203002: Remove OwnPtr::release(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with trunk for landing. Created 4 years, 7 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/inspector/InspectorTraceEvents.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 {% from "macros.tmpl" import license %} 1 {% from "macros.tmpl" import license %}
2 {{ license() }} 2 {{ license() }}
3 3
4 #include "{{namespace}}Names.h" 4 #include "{{namespace}}Names.h"
5 5
6 #include "wtf/StaticConstructors.h" 6 #include "wtf/StaticConstructors.h"
7 #include "wtf/StdLibExtras.h" 7 #include "wtf/StdLibExtras.h"
8 8
9 namespace blink { 9 namespace blink {
10 namespace {{namespace}}Names { 10 namespace {{namespace}}Names {
11 11
12 using namespace blink; 12 using namespace blink;
13 13
14 DEFINE_GLOBAL(AtomicString, {{namespace_prefix}}NamespaceURI) 14 DEFINE_GLOBAL(AtomicString, {{namespace_prefix}}NamespaceURI)
15 15
16 {% if tags %} 16 {% if tags %}
17 // Tags 17 // Tags
18 18
19 void* {{suffix}}TagStorage[{{namespace}}TagsCount * ((sizeof({{namespace}}Qualif iedName) + sizeof(void *) - 1) / sizeof(void *))]; 19 void* {{suffix}}TagStorage[{{namespace}}TagsCount * ((sizeof({{namespace}}Qualif iedName) + sizeof(void *) - 1) / sizeof(void *))];
20 {% for tag in tags|sort(attribute='name', case_sensitive=True) %} 20 {% for tag in tags|sort(attribute='name', case_sensitive=True) %}
21 const {{namespace}}QualifiedName& {{tag|symbol}}Tag = reinterpret_cast<{{namespa ce}}QualifiedName*>(&{{suffix}}TagStorage)[{{loop.index0}}]; 21 const {{namespace}}QualifiedName& {{tag|symbol}}Tag = reinterpret_cast<{{namespa ce}}QualifiedName*>(&{{suffix}}TagStorage)[{{loop.index0}}];
22 {% endfor %} 22 {% endfor %}
23 23
24 24
25 PassOwnPtr<const {{namespace}}QualifiedName*[]> get{{namespace}}Tags() 25 PassOwnPtr<const {{namespace}}QualifiedName*[]> get{{namespace}}Tags()
26 { 26 {
27 OwnPtr<const {{namespace}}QualifiedName*[]> tags = adoptArrayPtr(new const { {namespace}}QualifiedName*[{{namespace}}TagsCount]); 27 OwnPtr<const {{namespace}}QualifiedName*[]> tags = adoptArrayPtr(new const { {namespace}}QualifiedName*[{{namespace}}TagsCount]);
28 for (size_t i = 0; i < {{namespace}}TagsCount; i++) 28 for (size_t i = 0; i < {{namespace}}TagsCount; i++)
29 tags[i] = reinterpret_cast<{{namespace}}QualifiedName*>(&{{suffix}}TagSt orage) + i; 29 tags[i] = reinterpret_cast<{{namespace}}QualifiedName*>(&{{suffix}}TagSt orage) + i;
30 return tags.release(); 30 return tags;
31 } 31 }
32 32
33 {% endif %} 33 {% endif %}
34 // Attributes 34 // Attributes
35 35
36 void* {{suffix}}AttrStorage[{{namespace}}AttrsCount * ((sizeof(QualifiedName) + sizeof(void *) - 1) / sizeof(void *))]; 36 void* {{suffix}}AttrStorage[{{namespace}}AttrsCount * ((sizeof(QualifiedName) + sizeof(void *) - 1) / sizeof(void *))];
37 37
38 {% for attr in attrs|sort(attribute='name', case_sensitive=True) %} 38 {% for attr in attrs|sort(attribute='name', case_sensitive=True) %}
39 const QualifiedName& {{attr|symbol}}Attr = reinterpret_cast<QualifiedName*>(&{{s uffix}}AttrStorage)[{{loop.index0}}]; 39 const QualifiedName& {{attr|symbol}}Attr = reinterpret_cast<QualifiedName*>(&{{s uffix}}AttrStorage)[{{loop.index0}}];
40 {% endfor %} 40 {% endfor %}
41 41
42 {% if namespace != 'HTML' %} 42 {% if namespace != 'HTML' %}
43 PassOwnPtr<const QualifiedName*[]> get{{namespace}}Attrs() 43 PassOwnPtr<const QualifiedName*[]> get{{namespace}}Attrs()
44 { 44 {
45 OwnPtr<const QualifiedName*[]> attrs = adoptArrayPtr(new const QualifiedName *[{{namespace}}AttrsCount]); 45 OwnPtr<const QualifiedName*[]> attrs = adoptArrayPtr(new const QualifiedName *[{{namespace}}AttrsCount]);
46 for (size_t i = 0; i < {{namespace}}AttrsCount; i++) 46 for (size_t i = 0; i < {{namespace}}AttrsCount; i++)
47 attrs[i] = reinterpret_cast<QualifiedName*>(&{{suffix}}AttrStorage) + i; 47 attrs[i] = reinterpret_cast<QualifiedName*>(&{{suffix}}AttrStorage) + i;
48 return attrs.release(); 48 return attrs;
49 } 49 }
50 {% endif %} 50 {% endif %}
51 51
52 52
53 void init() 53 void init()
54 { 54 {
55 struct NameEntry { 55 struct NameEntry {
56 const char* name; 56 const char* name;
57 unsigned hash; 57 unsigned hash;
58 unsigned char length; 58 unsigned char length;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 attr_i++; 98 attr_i++;
99 } 99 }
100 {% if tags %} 100 {% if tags %}
101 ASSERT(tag_i == {{namespace}}TagsCount); 101 ASSERT(tag_i == {{namespace}}TagsCount);
102 {% endif %} 102 {% endif %}
103 ASSERT(attr_i == {{namespace}}AttrsCount); 103 ASSERT(attr_i == {{namespace}}AttrsCount);
104 } 104 }
105 105
106 } // {{namespace}} 106 } // {{namespace}}
107 } // namespace blink 107 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698