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

Side by Side Diff: remoting/webapp/crd/js/video_frame_recorder.js

Issue 1015553003: Added more typechecking functions and unit tests for existing code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « remoting/webapp/crd/js/typecheck_unittest.js ('k') | remoting/webapp/js_proto/qunit_proto.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Class implement the video frame recorder extension client. 7 * Class implement the video frame recorder extension client.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 * @param {string} type Type of extension message. 56 * @param {string} type Type of extension message.
57 * @param {Object} message The parsed extension message data. 57 * @param {Object} message The parsed extension message data.
58 * @return {boolean} 58 * @return {boolean}
59 */ 59 */
60 remoting.VideoFrameRecorder.prototype.handleMessage = 60 remoting.VideoFrameRecorder.prototype.handleMessage =
61 function(type, message) { 61 function(type, message) {
62 if (type != 'video-recorder') { 62 if (type != 'video-recorder') {
63 return false; 63 return false;
64 } 64 }
65 65
66 var messageType = getStringAttr(message, 'type'); 66 var messageType = base.getStringAttr(message, 'type');
67 var messageData = getStringAttr(message, 'data'); 67 var messageData = base.getStringAttr(message, 'data');
68 68
69 if (messageType == 'next-frame-reply') { 69 if (messageType == 'next-frame-reply') {
70 if (!this.fileWriter_) { 70 if (!this.fileWriter_) {
71 console.log("Received frame but have no writer"); 71 console.log("Received frame but have no writer");
72 return true; 72 return true;
73 } 73 }
74 if (!messageData) { 74 if (!messageData) {
75 console.log("Finished receiving frames"); 75 console.log("Finished receiving frames");
76 this.fileWriter_ = null; 76 this.fileWriter_ = null;
77 return true; 77 return true;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 remoting.VideoFrameRecorder.prototype.onWriteComplete_ = function(e) { 142 remoting.VideoFrameRecorder.prototype.onWriteComplete_ = function(e) {
143 console.log("Video frame write complete"); 143 console.log("Video frame write complete");
144 this.fetchNextFrame_(); 144 this.fetchNextFrame_();
145 } 145 }
146 146
147 remoting.VideoFrameRecorder.prototype.fetchNextFrame_ = function() { 147 remoting.VideoFrameRecorder.prototype.fetchNextFrame_ = function() {
148 console.log("Request next video frame"); 148 console.log("Request next video frame");
149 var data = { type: 'next-frame' } 149 var data = { type: 'next-frame' }
150 this.plugin_.sendClientMessage('video-recorder', JSON.stringify(data)); 150 this.plugin_.sendClientMessage('video-recorder', JSON.stringify(data));
151 } 151 }
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/typecheck_unittest.js ('k') | remoting/webapp/js_proto/qunit_proto.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698