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

Unified Diff: ui/file_manager/video_player/js/cast/media_manager.js

Issue 450913002: Video Player: Fix the private API error in Debug build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 | « chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/video_player/js/cast/media_manager.js
diff --git a/ui/file_manager/video_player/js/cast/media_manager.js b/ui/file_manager/video_player/js/cast/media_manager.js
index 884c63985bebb25a0bd14c5182009274e12f7658..93b43b2e9f437f5d64c0bc46bc357acf11ba3b4e 100644
--- a/ui/file_manager/video_player/js/cast/media_manager.js
+++ b/ui/file_manager/video_player/js/cast/media_manager.js
@@ -51,6 +51,10 @@ MediaManager.prototype.getToken = function(refresh) {
// TODO(yoshiki): Creates the method to get a token and use it.
chrome.fileBrowserPrivate.getDownloadUrl(this.entry_.toURL(), fulfill);
}.bind(this)).then(function(url) {
+ if (chrome.runtime.lastError) {
+ return Promise.reject(
+ 'Token fetch failed: ' + chrome.runtime.lastError.message);
+ }
if (!url)
return Promise.reject('Token fetch failed.');
var token = url.substring(url.indexOf('access_token=') + 13);
@@ -76,6 +80,10 @@ MediaManager.prototype.getUrl = function() {
// TODO(yoshiki): Creates the method to get a url and use it.
chrome.fileBrowserPrivate.getDownloadUrl(this.entry_.toURL(), fulfill);
}.bind(this)).then(function(url) {
+ if (chrome.runtime.lastError) {
+ return Promise.reject(
+ 'URL fetch failed: ' + chrome.runtime.lastError.message);
+ }
if (!url)
return Promise.reject('URL fetch failed.');
var access_token_index = url.indexOf('access_token=');
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698