Change blob state PENDING_INTERNALS to PENDING_REFERENCED_BLOBS

Bug: 670398
Change-Id: Ic0268d77ca5afe92d2fa8254786d7c57c0990b10
Reviewed-on: https://chromium-review.googlesource.com/c/1396693
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Commit-Queue: Minmin Jin <jinmmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620601}
diff --git a/content/browser/blob_storage/blob_transport_host_unittest.cc b/content/browser/blob_storage/blob_transport_host_unittest.cc
index 4649f1a..9dcaaf9 100644
--- a/content/browser/blob_storage/blob_transport_host_unittest.cc
+++ b/content/browser/blob_storage/blob_transport_host_unittest.cc
@@ -483,7 +483,8 @@
   PopulateBytes(response1.allocate_mutable_data(2), 2);
   std::vector<storage::BlobItemBytesResponse> responses = {response1};
   host_.OnMemoryResponses(kBlob3, responses, &context_);
-  EXPECT_EQ(storage::BlobStatus::PENDING_INTERNALS, handle3->GetBlobStatus());
+  EXPECT_EQ(storage::BlobStatus::PENDING_REFERENCED_BLOBS,
+            handle3->GetBlobStatus());
   EXPECT_FALSE(request_called_);
   EXPECT_FALSE(host_.IsBeingBuilt(kBlob3));
   EXPECT_TRUE(IsBeingBuiltInContext(kBlob3));
diff --git a/storage/browser/blob/README.md b/storage/browser/blob/README.md
index f74dd19..92b9a110 100644
--- a/storage/browser/blob/README.md
+++ b/storage/browser/blob/README.md
@@ -322,7 +322,7 @@
 
 The BlobStatus tracks the construction procedure (specifically the transport
 process), and the copy memory quota and dependent blob process is encompassed
-in `PENDING_INTERNALS`.
+in `PENDING_REFERENCED_BLOBS`.
 
 Once a blob is finished constructing, the status is set to `DONE` or any of
 the `ERR_*` values.
diff --git a/storage/browser/blob/blob_entry.h b/storage/browser/blob/blob_entry.h
index e159e65..67068de 100644
--- a/storage/browser/blob/blob_entry.h
+++ b/storage/browser/blob/blob_entry.h
@@ -52,7 +52,7 @@
   // 1. Waiting for quota to be granted for transport data (PENDING_QUOTA)
   // 2. Waiting for user population of data after quota (PENDING_TRANSPORT)
   // 3. Waiting for blobs we reference to complete & quota granted for possible
-  //    copies. (PENDING_INTERNALS)
+  //    copies. (PENDING_REFERENCED_BLOBS)
   struct COMPONENT_EXPORT(STORAGE_BROWSER) BuildingState {
     // |transport_allowed_callback| is not null when data needs population. See
     // BlobStorageContext::BuildBlob for when the callback is called.
@@ -110,8 +110,8 @@
 
   // Returns if we're a pending blob that can finish building.
   bool CanFinishBuilding() const {
-    // PENDING_INTERNALS means transport is finished.
-    return status_ == BlobStatus::PENDING_INTERNALS && building_state_ &&
+    // PENDING_REFERENCED_BLOBS means transport is finished.
+    return status_ == BlobStatus::PENDING_REFERENCED_BLOBS && building_state_ &&
            !building_state_->copy_quota_request &&
            building_state_->num_building_dependent_blobs == 0;
   }
diff --git a/storage/browser/blob/blob_reader.cc b/storage/browser/blob/blob_reader.cc
index 88bf538..ecc8f7a 100644
--- a/storage/browser/blob/blob_reader.cc
+++ b/storage/browser/blob/blob_reader.cc
@@ -61,7 +61,7 @@
     case BlobStatus::DONE:
     case BlobStatus::PENDING_QUOTA:
     case BlobStatus::PENDING_TRANSPORT:
-    case BlobStatus::PENDING_INTERNALS:
+    case BlobStatus::PENDING_REFERENCED_BLOBS:
     case BlobStatus::PENDING_CONSTRUCTION:
       NOTREACHED();
   }
diff --git a/storage/browser/blob/blob_storage_context.cc b/storage/browser/blob/blob_storage_context.cc
index c4febb8..b0b98b5 100644
--- a/storage/browser/blob/blob_storage_context.cc
+++ b/storage/browser/blob/blob_storage_context.cc
@@ -227,7 +227,7 @@
   } else if (content->transport_quota_needed()) {
     entry->set_status(BlobStatus::PENDING_QUOTA);
   } else {
-    entry->set_status(BlobStatus::PENDING_INTERNALS);
+    entry->set_status(BlobStatus::PENDING_REFERENCED_BLOBS);
   }
 
   std::unique_ptr<BlobDataHandle> handle = CreateHandle(content->uuid_, entry);
@@ -459,7 +459,7 @@
     DCHECK(shareable_item->state() == ShareableBlobDataItem::QUOTA_GRANTED);
     shareable_item->set_state(ShareableBlobDataItem::POPULATED_WITH_QUOTA);
   }
-  entry->set_status(BlobStatus::PENDING_INTERNALS);
+  entry->set_status(BlobStatus::PENDING_REFERENCED_BLOBS);
   if (entry->CanFinishBuilding())
     FinishBuilding(entry);
 }
diff --git a/storage/browser/blob/view_blob_internals_job.cc b/storage/browser/blob/view_blob_internals_job.cc
index 00e9e05..dd5c6715 100644
--- a/storage/browser/blob/view_blob_internals_job.cc
+++ b/storage/browser/blob/view_blob_internals_job.cc
@@ -95,9 +95,9 @@
     case BlobStatus::PENDING_TRANSPORT:
       return "BlobStatus::PENDING_TRANSPORT: Blob construction is pending on "
              "data transport from renderer.";
-    case BlobStatus::PENDING_INTERNALS:
-      return "BlobStatus::PENDING_INTERNALS: Blob construction is pending on "
-             "dependency blobs to finish construction.";
+    case BlobStatus::PENDING_REFERENCED_BLOBS:
+      return "BlobStatus::PENDING_REFERENCED_BLOBS: Blob construction is "
+             "pending on dependency blobs to finish construction.";
     case BlobStatus::PENDING_CONSTRUCTION:
       return "BlobStatus::PENDING_CONSTRUCTION: Blob construction is pending "
              "on resolving the UUIDs of refereneced blobs.";
diff --git a/storage/common/blob_storage/blob_storage_constants.h b/storage/common/blob_storage/blob_storage_constants.h
index 077b5e4..48c405a 100644
--- a/storage/common/blob_storage/blob_storage_constants.h
+++ b/storage/common/blob_storage/blob_storage_constants.h
@@ -140,8 +140,7 @@
   PENDING_TRANSPORT = 202,
   // Waiting for any operations involving dependent blobs after transport data
   // has been populated. See BlobEntry::BuildingState for more info.
-  // TODO(dmurph): Change to PENDING_REFERENCED_BLOBS (crbug.com/670398).
-  PENDING_INTERNALS = 203,
+  PENDING_REFERENCED_BLOBS = 203,
   // Waiting for construction to begin.
   PENDING_CONSTRUCTION = 204,
   LAST_PENDING = PENDING_CONSTRUCTION,