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

Side by Side Diff: Source/core/dom/DocumentMarkerController.cpp

Issue 479803002: Made code conform to blink's coding guidelines and improved performance (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/web/WebViewImpl.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 28 matching lines...) Expand all
39 #include <stdio.h> 39 #include <stdio.h>
40 #endif 40 #endif
41 41
42 namespace blink { 42 namespace blink {
43 43
44 MarkerRemoverPredicate::MarkerRemoverPredicate(const Vector<String>& words) 44 MarkerRemoverPredicate::MarkerRemoverPredicate(const Vector<String>& words)
45 : m_words(words) 45 : m_words(words)
46 { 46 {
47 } 47 }
48 48
49 bool MarkerRemoverPredicate::operator()(const DocumentMarker& documentMarker, 49 bool MarkerRemoverPredicate::operator()(const DocumentMarker& documentMarker, co nst Text& textNode) const
50 const Text& textNode) const { 50 {
51 unsigned start = documentMarker.startOffset(); 51 unsigned start = documentMarker.startOffset();
52 unsigned length = documentMarker.endOffset() - documentMarker.startOffset(); 52 unsigned length = documentMarker.endOffset() - documentMarker.startOffset();
53 53
54 String markerText = textNode.data().substring(start, length); 54 String markerText = textNode.data().substring(start, length);
55 return m_words.contains(markerText); 55 return m_words.contains(markerText);
56 } 56 }
57 57
58 namespace { 58 namespace {
59 59
60 DocumentMarker::MarkerTypeIndex MarkerTypeToMarkerIndex(DocumentMarker::MarkerTy pe type) 60 DocumentMarker::MarkerTypeIndex MarkerTypeToMarkerIndex(DocumentMarker::MarkerTy pe type)
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 763
764 } // namespace blink 764 } // namespace blink
765 765
766 #ifndef NDEBUG 766 #ifndef NDEBUG
767 void showDocumentMarkers(const blink::DocumentMarkerController* controller) 767 void showDocumentMarkers(const blink::DocumentMarkerController* controller)
768 { 768 {
769 if (controller) 769 if (controller)
770 controller->showMarkers(); 770 controller->showMarkers();
771 } 771 }
772 #endif 772 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698