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

Unified Diff: tools/telemetry/telemetry/core/video.py

Issue 379443002: Change ownership of video file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing the comments Created 6 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
Index: tools/telemetry/telemetry/core/video.py
diff --git a/tools/telemetry/telemetry/core/video.py b/tools/telemetry/telemetry/core/video.py
index f470437513b1f99d3a5cb6d3f576651f7f453c7b..e7dac55a682ffb432a573db891bc35edd46c0c4d 100644
--- a/tools/telemetry/telemetry/core/video.py
+++ b/tools/telemetry/telemetry/core/video.py
@@ -17,9 +17,8 @@ class BoundingBoxNotFoundException(Exception):
class Video(object):
"""Utilities for storing and interacting with the video capture."""
- def __init__(self, video_file_path):
- # TODO(satyanarayana): Figure out when to delete this file.
- self._video_file_path = video_file_path
+ def __init__(self, video_file_obj):
nednguyen 2014/07/08 22:28:12 Don't you still need the TODO to clean up this fil
nduca 2014/07/08 22:34:21 tempfiles delete the file on gc BUT, this code ne
Satyanarayana N H Manyam 2014/07/08 22:57:27 Done.
+ self._video_file_obj = video_file_obj
self._tab_contents_bounding_box = None
def UploadToCloudStorage(self, bucket, target_path):
@@ -28,7 +27,7 @@ class Video(object):
Args:
target_path: Path indicating where to store the file in cloud storage.
"""
- cloud_storage.Insert(bucket, target_path, self._video_file_path)
+ cloud_storage.Insert(bucket, target_path, self._video_file_obj.name)
def GetVideoFrameIter(self):
"""Returns the iteration for processing the video capture.
@@ -42,7 +41,7 @@ class Video(object):
time_ms is milliseconds since navigationStart.
bitmap is a telemetry.core.Bitmap.
"""
- frame_generator = self._FramesFromMp4(self._video_file_path)
+ frame_generator = self._FramesFromMp4(self._video_file_obj.name)
# Flip through frames until we find the initial tab contents flash.
content_box = None

Powered by Google App Engine
This is Rietveld 408576698