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

Side by Side Diff: Source/bindings/core/v8/custom/V8HTMLAllCollectionCustom.cpp

Issue 656693002: Don't count UseCounters in private scripts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 void V8HTMLAllCollection::legacyCallCustom(const v8::FunctionCallbackInfo<v8::Va lue>& info) 93 void V8HTMLAllCollection::legacyCallCustom(const v8::FunctionCallbackInfo<v8::Va lue>& info)
94 { 94 {
95 if (info.Length() < 1) 95 if (info.Length() < 1)
96 return; 96 return;
97 97
98 HTMLAllCollection* impl = V8HTMLAllCollection::toImpl(info.Holder()); 98 HTMLAllCollection* impl = V8HTMLAllCollection::toImpl(info.Holder());
99 Node& ownerNode = impl->ownerNode(); 99 Node& ownerNode = impl->ownerNode();
100 100
101 UseCounter::count(ownerNode.document(), UseCounter::DocumentAllLegacyCall); 101 UseCounter::countIfNotPrivateScript(info.GetIsolate(), ownerNode.document(), UseCounter::DocumentAllLegacyCall);
102 102
103 if (info.Length() == 1) { 103 if (info.Length() == 1) {
104 v8SetReturnValue(info, getItem(impl, info[0], info)); 104 v8SetReturnValue(info, getItem(impl, info[0], info));
105 return; 105 return;
106 } 106 }
107 107
108 // If there is a second argument it is the index of the item we want. 108 // If there is a second argument it is the index of the item we want.
109 TOSTRING_VOID(V8StringResource<>, name, info[0]); 109 TOSTRING_VOID(V8StringResource<>, name, info[0]);
110 v8::Local<v8::Uint32> index = info[1]->ToArrayIndex(); 110 v8::Local<v8::Uint32> index = info[1]->ToArrayIndex();
111 if (index.IsEmpty()) 111 if (index.IsEmpty())
112 return; 112 return;
113 113
114 if (Node* node = impl->namedItemWithIndex(name, index->Uint32Value())) { 114 if (Node* node = impl->namedItemWithIndex(name, index->Uint32Value())) {
115 v8SetReturnValueFast(info, node, impl); 115 v8SetReturnValueFast(info, node, impl);
116 return; 116 return;
117 } 117 }
118 } 118 }
119 119
120 } // namespace blink 120 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/custom/V8ElementCustom.cpp ('k') | Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698