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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSTokenizerInputStream.cpp

Issue 2162863002: Add StringView constructor that takes a ref to save a branch in CSSTokenizerInputStream::rangeAt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo. Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "core/css/parser/CSSTokenizerInputStream.h" 5 #include "core/css/parser/CSSTokenizerInputStream.h"
6 6
7 #include "core/html/parser/HTMLParserIdioms.h" 7 #include "core/html/parser/HTMLParserIdioms.h"
8 #include "core/html/parser/InputStreamPreprocessor.h" 8 #include "core/html/parser/InputStreamPreprocessor.h"
9 #include "wtf/text/StringToNumber.h" 9 #include "wtf/text/StringToNumber.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 if (start < end) { 47 if (start < end) {
48 if (m_string->is8Bit()) 48 if (m_string->is8Bit())
49 result = charactersToDouble(m_string->characters8() + m_offset + sta rt, end - start, &isResultOK); 49 result = charactersToDouble(m_string->characters8() + m_offset + sta rt, end - start, &isResultOK);
50 else 50 else
51 result = charactersToDouble(m_string->characters16() + m_offset + st art, end - start, &isResultOK); 51 result = charactersToDouble(m_string->characters16() + m_offset + st art, end - start, &isResultOK);
52 } 52 }
53 // FIXME: It looks like callers ensure we have a valid number 53 // FIXME: It looks like callers ensure we have a valid number
54 return isResultOK ? result : 0.0; 54 return isResultOK ? result : 0.0;
55 } 55 }
56 56
57 StringView CSSTokenizerInputStream::rangeAt(unsigned start, unsigned length) con st
58 {
59 DCHECK(start + length <= m_stringLength);
60 return StringView(m_string.get(), start, length);
61 }
62
63 } // namespace blink 57 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSTokenizerInputStream.h ('k') | third_party/WebKit/Source/wtf/text/StringView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698