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

Side by Side Diff: third_party/WebKit/Source/core/editing/TextFinder.cpp

Issue 2962473002: Make Position::LastPositionInNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-26T14:00:00 Created 3 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 const WebString& search_text, 390 const WebString& search_text,
391 const WebFindOptions& options) { 391 const WebFindOptions& options) {
392 if (!ShouldScopeMatches(search_text, options)) { 392 if (!ShouldScopeMatches(search_text, options)) {
393 FinishCurrentScopingEffort(identifier); 393 FinishCurrentScopingEffort(identifier);
394 return; 394 return;
395 } 395 }
396 396
397 PositionInFlatTree search_start = PositionInFlatTree::FirstPositionInNode( 397 PositionInFlatTree search_start = PositionInFlatTree::FirstPositionInNode(
398 *OwnerFrame().GetFrame()->GetDocument()); 398 *OwnerFrame().GetFrame()->GetDocument());
399 PositionInFlatTree search_end = PositionInFlatTree::LastPositionInNode( 399 PositionInFlatTree search_end = PositionInFlatTree::LastPositionInNode(
400 OwnerFrame().GetFrame()->GetDocument()); 400 *OwnerFrame().GetFrame()->GetDocument());
401 DCHECK_EQ(search_start.GetDocument(), search_end.GetDocument()); 401 DCHECK_EQ(search_start.GetDocument(), search_end.GetDocument());
402 402
403 if (resume_scoping_from_range_) { 403 if (resume_scoping_from_range_) {
404 // This is a continuation of a scoping operation that timed out and didn't 404 // This is a continuation of a scoping operation that timed out and didn't
405 // complete last time around, so we should start from where we left off. 405 // complete last time around, so we should start from where we left off.
406 DCHECK(resume_scoping_from_range_->collapsed()); 406 DCHECK(resume_scoping_from_range_->collapsed());
407 search_start = FromPositionInDOMTree<EditingInFlatTreeStrategy>( 407 search_start = FromPositionInDOMTree<EditingInFlatTreeStrategy>(
408 resume_scoping_from_range_->EndPosition()); 408 resume_scoping_from_range_->EndPosition());
409 if (search_start.GetDocument() != search_end.GetDocument()) 409 if (search_start.GetDocument() != search_end.GetDocument())
410 return; 410 return;
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 872
873 DEFINE_TRACE(TextFinder) { 873 DEFINE_TRACE(TextFinder) {
874 visitor->Trace(owner_frame_); 874 visitor->Trace(owner_frame_);
875 visitor->Trace(active_match_); 875 visitor->Trace(active_match_);
876 visitor->Trace(resume_scoping_from_range_); 876 visitor->Trace(resume_scoping_from_range_);
877 visitor->Trace(deferred_scoping_work_); 877 visitor->Trace(deferred_scoping_work_);
878 visitor->Trace(find_matches_cache_); 878 visitor->Trace(find_matches_cache_);
879 } 879 }
880 880
881 } // namespace blink 881 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/SurroundingText.cpp ('k') | third_party/WebKit/Source/core/editing/VisiblePosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698