| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 DocumentMarkerDetails::~DocumentMarkerDetails() | 36 DocumentMarkerDetails::~DocumentMarkerDetails() |
| 37 { | 37 { |
| 38 } | 38 } |
| 39 | 39 |
| 40 class DocumentMarkerDescription final : public DocumentMarkerDetails { | 40 class DocumentMarkerDescription final : public DocumentMarkerDetails { |
| 41 public: | 41 public: |
| 42 static PassRefPtrWillBeRawPtr<DocumentMarkerDescription> create(const String
&); | 42 static PassRefPtrWillBeRawPtr<DocumentMarkerDescription> create(const String
&); |
| 43 | 43 |
| 44 const String& description() const { return m_description; } | 44 const String& description() const { return m_description; } |
| 45 virtual bool isDescription() const override { return true; } | 45 bool isDescription() const override { return true; } |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 explicit DocumentMarkerDescription(const String& description) | 48 explicit DocumentMarkerDescription(const String& description) |
| 49 : m_description(description) | 49 : m_description(description) |
| 50 { | 50 { |
| 51 } | 51 } |
| 52 | 52 |
| 53 String m_description; | 53 String m_description; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 PassRefPtrWillBeRawPtr<DocumentMarkerDescription> DocumentMarkerDescription::cre
ate(const String& description) | 56 PassRefPtrWillBeRawPtr<DocumentMarkerDescription> DocumentMarkerDescription::cre
ate(const String& description) |
| 57 { | 57 { |
| 58 return adoptRefWillBeNoop(new DocumentMarkerDescription(description)); | 58 return adoptRefWillBeNoop(new DocumentMarkerDescription(description)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 inline DocumentMarkerDescription* toDocumentMarkerDescription(DocumentMarkerDeta
ils* details) | 61 inline DocumentMarkerDescription* toDocumentMarkerDescription(DocumentMarkerDeta
ils* details) |
| 62 { | 62 { |
| 63 if (details && details->isDescription()) | 63 if (details && details->isDescription()) |
| 64 return static_cast<DocumentMarkerDescription*>(details); | 64 return static_cast<DocumentMarkerDescription*>(details); |
| 65 return 0; | 65 return 0; |
| 66 } | 66 } |
| 67 | 67 |
| 68 | 68 |
| 69 class DocumentMarkerTextMatch final : public DocumentMarkerDetails { | 69 class DocumentMarkerTextMatch final : public DocumentMarkerDetails { |
| 70 public: | 70 public: |
| 71 static PassRefPtrWillBeRawPtr<DocumentMarkerTextMatch> instanceFor(bool); | 71 static PassRefPtrWillBeRawPtr<DocumentMarkerTextMatch> instanceFor(bool); |
| 72 | 72 |
| 73 bool activeMatch() const { return m_match; } | 73 bool activeMatch() const { return m_match; } |
| 74 virtual bool isTextMatch() const override { return true; } | 74 bool isTextMatch() const override { return true; } |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 explicit DocumentMarkerTextMatch(bool match) | 77 explicit DocumentMarkerTextMatch(bool match) |
| 78 : m_match(match) | 78 : m_match(match) |
| 79 { | 79 { |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool m_match; | 82 bool m_match; |
| 83 }; | 83 }; |
| 84 | 84 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 return details->activeMatch(); | 147 return details->activeMatch(); |
| 148 return false; | 148 return false; |
| 149 } | 149 } |
| 150 | 150 |
| 151 DEFINE_TRACE(DocumentMarker) | 151 DEFINE_TRACE(DocumentMarker) |
| 152 { | 152 { |
| 153 visitor->trace(m_details); | 153 visitor->trace(m_details); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace blink | 156 } // namespace blink |
| OLD | NEW |