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

Unified Diff: client/cmd/isolate/exp_archive.go

Issue 2990503002: isolate: move creation of isolate into UploadTracker (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/cmd/isolate/upload_tracker.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cmd/isolate/exp_archive.go
diff --git a/client/cmd/isolate/exp_archive.go b/client/cmd/isolate/exp_archive.go
index 742e105fa2ba63572dfb0885eb36e03e6d55142e..7e1491f0f2edc06706ec30f3b87fbebe3d4ee86f 100644
--- a/client/cmd/isolate/exp_archive.go
+++ b/client/cmd/isolate/exp_archive.go
@@ -212,36 +212,15 @@ func (c *expArchiveRun) main() error {
log.Printf("\t%d files (%s) to be isolated individually", len(parts.indivFiles.items), humanize.Bytes(uint64(parts.indivFiles.totalSize)))
log.Printf("\t%d files (%s) to be isolated in archives", len(parts.filesToArchive.items), humanize.Bytes(uint64(parts.filesToArchive.totalSize)))
- tracker := NewUploadTracker(checker, uploader)
+ tracker := NewUploadTracker(checker, uploader, isol)
if err := tracker.UploadDeps(parts); err != nil {
return err
}
- isol.Files = tracker.Files()
-
- // Marshal the isolated file into JSON, and create an Item to describe it.
- var isolJSON []byte
- isolJSON, err = json.Marshal(isol)
+ isolItem, isolJSON, err := tracker.Finalize(archiveOpts.Isolated)
if err != nil {
return err
}
- isolItem := &Item{
- Path: archiveOpts.Isolated,
- RelPath: filepath.Base(archiveOpts.Isolated),
- Digest: isolated.HashBytes(isolJSON),
- Size: int64(len(isolJSON)),
- }
-
- // Check and upload isolate JSON.
- checker.AddItem(isolItem, true, func(item *Item, ps *isolatedclient.PushState) {
- if ps == nil {
- return
- }
- log.Printf("QUEUED %q for upload", item.RelPath)
- uploader.UploadBytes(item.RelPath, isolJSON, ps, func() {
- log.Printf("UPLOADED %q", item.RelPath)
- })
- })
// Make sure that all pending items have been checked.
if err := checker.Close(); err != nil {
« no previous file with comments | « no previous file | client/cmd/isolate/upload_tracker.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698