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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/FileInputType.cpp

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 else 248 else
249 UseCounter::count(*document, UseCounter::InputTypeFileSecureOrigin); 249 UseCounter::count(*document, UseCounter::InputTypeFileSecureOrigin);
250 } 250 }
251 251
252 void FileInputType::createShadowSubtree() 252 void FileInputType::createShadowSubtree()
253 { 253 {
254 ASSERT(element().shadow()); 254 ASSERT(element().shadow());
255 RefPtrWillBeRawPtr<HTMLInputElement> button = HTMLInputElement::create(eleme nt().document(), 0, false); 255 RefPtrWillBeRawPtr<HTMLInputElement> button = HTMLInputElement::create(eleme nt().document(), 0, false);
256 button->setType(InputTypeNames::button); 256 button->setType(InputTypeNames::button);
257 button->setAttribute(valueAttr, AtomicString(locale().queryString(element(). multiple() ? WebLocalizedString::FileButtonChooseMultipleFilesLabel : WebLocaliz edString::FileButtonChooseFileLabel))); 257 button->setAttribute(valueAttr, AtomicString(locale().queryString(element(). multiple() ? WebLocalizedString::FileButtonChooseMultipleFilesLabel : WebLocaliz edString::FileButtonChooseFileLabel)));
258 button->setShadowPseudoId(AtomicString("-webkit-file-upload-button", AtomicS tring::ConstructFromLiteral)); 258 button->setShadowPseudoId(AtomicString("-webkit-file-upload-button"));
259 element().userAgentShadowRoot()->appendChild(button.release()); 259 element().userAgentShadowRoot()->appendChild(button.release());
260 } 260 }
261 261
262 void FileInputType::disabledAttributeChanged() 262 void FileInputType::disabledAttributeChanged()
263 { 263 {
264 ASSERT(element().shadow()); 264 ASSERT(element().shadow());
265 if (Element* button = toElement(element().userAgentShadowRoot()->firstChild( ))) 265 if (Element* button = toElement(element().userAgentShadowRoot()->firstChild( )))
266 button->setBooleanAttribute(disabledAttr, element().isDisabledFormContro l()); 266 button->setBooleanAttribute(disabledAttr, element().isDisabledFormContro l());
267 } 267 }
268 268
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 StringBuilder names; 372 StringBuilder names;
373 for (size_t i = 0; i < listSize; ++i) { 373 for (size_t i = 0; i < listSize; ++i) {
374 names.append(fileList->item(i)->name()); 374 names.append(fileList->item(i)->name());
375 if (i != listSize - 1) 375 if (i != listSize - 1)
376 names.append('\n'); 376 names.append('\n');
377 } 377 }
378 return names.toString(); 378 return names.toString();
379 } 379 }
380 380
381 } // namespace blink 381 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698