Remove support for FileContentOverlay from ContextBuilder.

Change-Id: I23b9481ac6a841675e401579ff60bfb383865f8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index 364b605..8887ae4 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -73,10 +73,6 @@
   /// The byte store used by any analysis drivers created through this interface.
   late final ByteStore byteStore;
 
-  /// The file content overlay used by analysis drivers. If this builder will be
-  /// used to build analysis contexts, set the [contentCache] instead.
-  FileContentOverlay? fileContentOverlay;
-
   /// Whether any analysis driver created through this interface should support
   /// indexing and search.
   bool enableIndex = false;
@@ -119,7 +115,7 @@
       performanceLog,
       resourceProvider,
       byteStore,
-      fileContentOverlay,
+      FileContentOverlay(),
       contextRoot,
       sf,
       options,
diff --git a/pkg/analyzer/lib/src/dart/analysis/analysis_context_collection.dart b/pkg/analyzer/lib/src/dart/analysis/analysis_context_collection.dart
index dbe5024..a2f9ed7 100644
--- a/pkg/analyzer/lib/src/dart/analysis/analysis_context_collection.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/analysis_context_collection.dart
@@ -11,7 +11,6 @@
 import 'package:analyzer/src/dart/analysis/context_builder.dart';
 import 'package:analyzer/src/dart/analysis/driver.dart';
 import 'package:analyzer/src/dart/analysis/driver_based_analysis_context.dart';
-import 'package:analyzer/src/dart/analysis/file_state.dart';
 import 'package:analyzer/src/dart/analysis/performance_logger.dart';
 import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl;
 import 'package:cli_util/cli_util.dart';
@@ -57,7 +56,6 @@
       optionsFile: optionsFile,
       packagesFile: packagesFile,
     );
-    var fileContentOverlay = FileContentOverlay();
     for (var root in roots) {
       var contextBuilder = ContextBuilderImpl(
         resourceProvider: this.resourceProvider,
@@ -68,7 +66,6 @@
         declaredVariables: DeclaredVariables.fromMap(declaredVariables ?? {}),
         drainStreams: drainStreams,
         enableIndex: enableIndex,
-        fileContentOverlay: fileContentOverlay,
         performanceLog: performanceLog,
         retainDataForTesting: retainDataForTesting,
         sdkPath: sdkPath,
diff --git a/pkg/analyzer/lib/src/dart/analysis/context_builder.dart b/pkg/analyzer/lib/src/dart/analysis/context_builder.dart
index 761e60b..a6313ef 100644
--- a/pkg/analyzer/lib/src/dart/analysis/context_builder.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/context_builder.dart
@@ -15,8 +15,6 @@
 import 'package:analyzer/src/dart/analysis/driver.dart'
     show AnalysisDriver, AnalysisDriverScheduler;
 import 'package:analyzer/src/dart/analysis/driver_based_analysis_context.dart';
-import 'package:analyzer/src/dart/analysis/file_state.dart'
-    show FileContentOverlay;
 import 'package:analyzer/src/dart/analysis/performance_logger.dart'
     show PerformanceLog;
 import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl;
@@ -42,7 +40,6 @@
     DeclaredVariables? declaredVariables,
     bool drainStreams = true,
     bool enableIndex = false,
-    FileContentOverlay? fileContentOverlay,
     List<String>? librarySummaryPaths,
     PerformanceLog? performanceLog,
     bool retainDataForTesting = false,
@@ -56,7 +53,6 @@
     ArgumentError.checkNotNull(sdkPath, 'sdkPath');
 
     byteStore ??= MemoryByteStore();
-    fileContentOverlay ??= FileContentOverlay();
     performanceLog ??= PerformanceLog(StringBuffer());
 
     DartSdkManager sdkManager = DartSdkManager(sdkPath);
@@ -85,7 +81,6 @@
         old.ContextBuilder(resourceProvider, sdkManager, options: options);
     builder.analysisDriverScheduler = scheduler;
     builder.byteStore = byteStore;
-    builder.fileContentOverlay = fileContentOverlay;
     builder.enableIndex = enableIndex;
     builder.performanceLog = performanceLog;
     builder.retainDataForTesting = retainDataForTesting;