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

Side by Side Diff: components/autofill/content/renderer/form_autofill_util.cc

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/content/renderer/form_autofill_util.h" 5 #include "components/autofill/content/renderer/form_autofill_util.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 if (!frame) 1413 if (!frame)
1414 return false; 1414 return false;
1415 1415
1416 form->name = GetFormIdentifier(form_element); 1416 form->name = GetFormIdentifier(form_element);
1417 form->origin = frame->document().url(); 1417 form->origin = frame->document().url();
1418 form->action = frame->document().completeURL(form_element.action()); 1418 form->action = frame->document().completeURL(form_element.action());
1419 1419
1420 // If the completed URL is not valid, just use the action we get from 1420 // If the completed URL is not valid, just use the action we get from
1421 // WebKit. 1421 // WebKit.
1422 if (!form->action.is_valid()) 1422 if (!form->action.is_valid())
1423 form->action = GURL(form_element.action()); 1423 form->action = GURL(base::string16(form_element.action()));
1424 1424
1425 WebVector<WebFormControlElement> control_elements; 1425 WebVector<WebFormControlElement> control_elements;
1426 form_element.getFormControlElements(control_elements); 1426 form_element.getFormControlElements(control_elements);
1427 1427
1428 std::vector<blink::WebElement> dummy_fieldset; 1428 std::vector<blink::WebElement> dummy_fieldset;
1429 return FormOrFieldsetsToFormData(&form_element, &form_control_element, 1429 return FormOrFieldsetsToFormData(&form_element, &form_control_element,
1430 dummy_fieldset, control_elements, 1430 dummy_fieldset, control_elements,
1431 extract_mask, form, field); 1431 extract_mask, form, field);
1432 } 1432 }
1433 1433
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 // Zero selection start is for password manager, which can show usernames 1710 // Zero selection start is for password manager, which can show usernames
1711 // that do not begin with the user input value. 1711 // that do not begin with the user input value.
1712 selection_start = (offset == base::string16::npos) ? 0 : offset; 1712 selection_start = (offset == base::string16::npos) ? 0 : offset;
1713 } 1713 }
1714 1714
1715 input_element->setSelectionRange(selection_start, suggestion.length()); 1715 input_element->setSelectionRange(selection_start, suggestion.length());
1716 } 1716 }
1717 1717
1718 } // namespace form_util 1718 } // namespace form_util
1719 } // namespace autofill 1719 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698