Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 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 28 matching lines...) Expand all Loading... | |
| 39 class Range; | 39 class Range; |
| 40 | 40 |
| 41 class CORE_EXPORT PlainTextRange { | 41 class CORE_EXPORT PlainTextRange { |
| 42 STACK_ALLOCATED(); | 42 STACK_ALLOCATED(); |
| 43 public: | 43 public: |
| 44 PlainTextRange(); | 44 PlainTextRange(); |
| 45 PlainTextRange(const PlainTextRange&); | 45 PlainTextRange(const PlainTextRange&); |
| 46 explicit PlainTextRange(int location); | 46 explicit PlainTextRange(int location); |
| 47 PlainTextRange(int start, int end); | 47 PlainTextRange(int start, int end); |
| 48 | 48 |
| 49 size_t end() const { ASSERT(!isNull()); return m_end; } | 49 size_t end() const { DCHECK(!isNull()); return m_end; } |
|
yosin_UTC9
2016/04/14 04:35:00
Let's use |isNotNull()|.
| |
| 50 size_t start() const { ASSERT(!isNull()); return m_start; } | 50 size_t start() const { DCHECK(!isNull()); return m_start; } |
|
yosin_UTC9
2016/04/14 04:35:00
Let's use |isNotNull()|.
| |
| 51 bool isNull() const { return m_start == kNotFound; } | 51 bool isNull() const { return m_start == kNotFound; } |
| 52 bool isNotNull() const { return m_start != kNotFound; } | 52 bool isNotNull() const { return m_start != kNotFound; } |
| 53 size_t length() const { ASSERT(!isNull()); return m_end - m_start; } | 53 size_t length() const { DCHECK(!isNull()); return m_end - m_start; } |
|
yosin_UTC9
2016/04/14 04:35:00
Let's use |isNotNull()|.
| |
| 54 | 54 |
| 55 EphemeralRange createRange(const ContainerNode& scope) const; | 55 EphemeralRange createRange(const ContainerNode& scope) const; |
| 56 EphemeralRange createRangeForSelection(const ContainerNode& scope) const; | 56 EphemeralRange createRangeForSelection(const ContainerNode& scope) const; |
| 57 | 57 |
| 58 static PlainTextRange create(const ContainerNode& scope, const EphemeralRang e&); | 58 static PlainTextRange create(const ContainerNode& scope, const EphemeralRang e&); |
| 59 static PlainTextRange create(const ContainerNode& scope, const Range&); | 59 static PlainTextRange create(const ContainerNode& scope, const Range&); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 PlainTextRange& operator=(const PlainTextRange&) = delete; | 62 PlainTextRange& operator=(const PlainTextRange&) = delete; |
| 63 | 63 |
| 64 enum GetRangeFor { ForGeneric, ForSelection }; | 64 enum GetRangeFor { ForGeneric, ForSelection }; |
| 65 EphemeralRange createRangeFor(const ContainerNode& scope, GetRangeFor) const ; | 65 EphemeralRange createRangeFor(const ContainerNode& scope, GetRangeFor) const ; |
| 66 | 66 |
| 67 const size_t m_start; | 67 const size_t m_start; |
| 68 const size_t m_end; | 68 const size_t m_end; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace blink | 71 } // namespace blink |
| 72 | 72 |
| 73 #endif // PlainTextRange_h | 73 #endif // PlainTextRange_h |
| OLD | NEW |