Update the context classpath after the dex files are opened.

The classpath stored in the context maybe be out of sync with the list of
opened dex files if any of the dex file is a multidex or cannot be opened.

This CL ensures that OpenDexFiles updates the classpath with the dex file
locations that were open.

The change does not affect the current use of ClassLoaderContext. It is a
preparatory step for b/62269291

Bug: 62269291
Test: m test-art-host-gtest-class_loader_context_test
Change-Id: Ibe675df9b2c06a4df8189f0d72df8b4061603a0e
diff --git a/runtime/class_loader_context.h b/runtime/class_loader_context.h
index 9afa880..692a6cd 100644
--- a/runtime/class_loader_context.h
+++ b/runtime/class_loader_context.h
@@ -41,7 +41,12 @@
   // to ClassLoaderInfo::opened_oat_files. The 'classpath_dir' argument specifies the directory to
   // use for the relative class paths.
   // Returns true if all dex files where successfully opened.
-  // It may be called only once per ClassLoaderContext. The second call will abort.
+  // It may be called only once per ClassLoaderContext. Subsequent calls will return the same
+  // result without doing anything.
+  //
+  // This will replace the class path locations with the locations of the opened dex files.
+  // (Note that one dex file can contain multidexes. Each multidex will be added to the classpath
+  // separately.)
   //
   // Note that a "false" return could mean that either an apk/jar contained no dex files or
   // that we hit a I/O or checksum mismatch error.
@@ -98,6 +103,7 @@
   //    - the number and type of the class loaders from the chain matches
   //    - the class loader from the same position have the same classpath
   //      (the order and checksum of the dex files matches)
+  // This should be called after OpenDexFiles().
   bool VerifyClassLoaderContextMatch(const std::string& context_spec) const;
 
   // Creates the class loader context from the given string.