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

Side by Side Diff: Source/core/events/CompositionEvent.cpp

Issue 637223008: Use C++11 range-based loop in core/events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « no previous file | Source/core/events/DOMWindowEventQueue.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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void CompositionEvent::initializeSegments(const Vector<CompositionUnderline>* un derlines) 76 void CompositionEvent::initializeSegments(const Vector<CompositionUnderline>* un derlines)
77 { 77 {
78 m_activeSegmentStart = 0; 78 m_activeSegmentStart = 0;
79 m_activeSegmentEnd = m_data.length(); 79 m_activeSegmentEnd = m_data.length();
80 80
81 if (!underlines || !underlines->size()) { 81 if (!underlines || !underlines->size()) {
82 m_segments.append(0); 82 m_segments.append(0);
83 return; 83 return;
84 } 84 }
85 85
86 for (size_t i = 0; i < underlines->size(); ++i) { 86 for (const auto& underline : *underlines) {
87 if (underlines->at(i).thick) { 87 if (underline.thick) {
88 m_activeSegmentStart = underlines->at(i).startOffset; 88 m_activeSegmentStart = underline.startOffset;
89 m_activeSegmentEnd = underlines->at(i).endOffset; 89 m_activeSegmentEnd = underline.endOffset;
90 break; 90 break;
91 } 91 }
92 } 92 }
93 93
94 for (size_t i = 0; i < underlines->size(); ++i) 94 for (const auto& underline : *underlines)
95 m_segments.append(underlines->at(i).startOffset); 95 m_segments.append(underline.startOffset);
96 } 96 }
97 97
98 const AtomicString& CompositionEvent::interfaceName() const 98 const AtomicString& CompositionEvent::interfaceName() const
99 { 99 {
100 return EventNames::CompositionEvent; 100 return EventNames::CompositionEvent;
101 } 101 }
102 102
103 void CompositionEvent::trace(Visitor* visitor) 103 void CompositionEvent::trace(Visitor* visitor)
104 { 104 {
105 UIEvent::trace(visitor); 105 UIEvent::trace(visitor);
106 } 106 }
107 107
108 } // namespace blink 108 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/events/DOMWindowEventQueue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698