Prepare DocumentMarkerController for using different DocumentMarkerList impls

I'm going to start writing different implementations of DocumentMarkerList for
the different MarkerTypes. This CL prepares us to be able to easily specify the
marker list class we want to use for each MarkerType.

BUG=707867

Review-Url: https://codereview.chromium.org/2826493003
Cr-Commit-Position: refs/heads/master@{#467609}
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
index bf490f4..d13fbd0 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -65,6 +65,12 @@
   return DocumentMarker::kSpellingMarkerIndex;
 }
 
+DocumentMarkerList* CreateListForType(DocumentMarker::MarkerType type) {
+  // All MarkerTypes use GenericDocumentMarkerListImpl for now. Eventually we
+  // will use different marker list classes for different MarkerTypes.
+  return new GenericDocumentMarkerListImpl();
+}
+
 }  // namespace
 
 Member<DocumentMarkerList>& DocumentMarkerController::ListForType(
@@ -206,11 +212,8 @@
   }
 
   const DocumentMarker::MarkerType new_marker_type = new_marker->GetType();
-  if (!ListForType(markers, new_marker_type)) {
-    // TODO(rlanday): add method for deciding what type of list to create based
-    // on the MarkerType
-    ListForType(markers, new_marker_type) = new GenericDocumentMarkerListImpl;
-  }
+  if (!ListForType(markers, new_marker_type))
+    ListForType(markers, new_marker_type) = CreateListForType(new_marker_type);
 
   DocumentMarkerList* const list = ListForType(markers, new_marker_type);
   list->Add(new_marker);
@@ -250,11 +253,8 @@
     if (!src_list)
       continue;
 
-    if (!ListForType(dst_markers, type)) {
-      // TODO(rlanday): add method for deciding what type of list to create
-      // based on the MarkerType
-      ListForType(dst_markers, type) = new GenericDocumentMarkerListImpl;
-    }
+    if (!ListForType(dst_markers, type))
+      ListForType(dst_markers, type) = CreateListForType(type);
 
     DocumentMarkerList* const dst_list = ListForType(dst_markers, type);
     if (src_list->MoveMarkers(length, dst_list))