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

Side by Side Diff: chrome/browser/resources/file_manager/js/metadata/metadata_cache.js

Issue 10827410: Avoid log spam in Files app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 * MetadataCache is a map from url to an object containing properties. 6 * MetadataCache is a map from url to an object containing properties.
7 * Properties are divided by types, and all properties of one type are accessed 7 * Properties are divided by types, and all properties of one type are accessed
8 * at once. 8 * at once.
9 * Some of the properties: 9 * Some of the properties:
10 * { 10 * {
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 * @param {Object} event The event. 836 * @param {Object} event The event.
837 * @private 837 * @private
838 */ 838 */
839 ContentProvider.prototype.onMessage_ = function(event) { 839 ContentProvider.prototype.onMessage_ = function(event) {
840 var data = event.data; 840 var data = event.data;
841 841
842 var methodName = 842 var methodName =
843 'on' + data.verb.substr(0, 1).toUpperCase() + data.verb.substr(1) + '_'; 843 'on' + data.verb.substr(0, 1).toUpperCase() + data.verb.substr(1) + '_';
844 844
845 if (!(methodName in this)) { 845 if (!(methodName in this)) {
846 console.log('Unknown message from metadata reader: ' + data.verb, data); 846 console.error('Unknown message from metadata reader: ' + data.verb, data);
847 return; 847 return;
848 } 848 }
849 849
850 this[methodName].apply(this, data.arguments); 850 this[methodName].apply(this, data.arguments);
851 }; 851 };
852 852
853 /** 853 /**
854 * @return {boolean} Whether provider is ready. 854 * @return {boolean} Whether provider is ready.
855 */ 855 */
856 ContentProvider.prototype.isInitialized = function() { 856 ContentProvider.prototype.isInitialized = function() {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 921
922 /** 922 /**
923 * Handles the 'error' message from the worker. 923 * Handles the 'error' message from the worker.
924 * @param {string} url File url. 924 * @param {string} url File url.
925 * @param {string} step Step failed. 925 * @param {string} step Step failed.
926 * @param {string} error Error description. 926 * @param {string} error Error description.
927 * @param {Object?} metadata The metadata, if available. 927 * @param {Object?} metadata The metadata, if available.
928 * @private 928 * @private
929 */ 929 */
930 ContentProvider.prototype.onError_ = function(url, step, error, metadata) { 930 ContentProvider.prototype.onError_ = function(url, step, error, metadata) {
931 console.warn('metadata: ' + url + ': ' + step + ': ' + error); 931 if (localStorage.logMetadata) // Avoid log spam by default.
932 console.warn('metadata: ' + url + ': ' + step + ': ' + error);
932 metadata = metadata || {}; 933 metadata = metadata || {};
933 // Prevent asking for thumbnail again. 934 // Prevent asking for thumbnail again.
934 metadata.thumbnailURL = ''; 935 metadata.thumbnailURL = '';
935 this.onResult_(url, metadata); 936 this.onResult_(url, metadata);
936 }; 937 };
937 938
938 /** 939 /**
939 * Handles the 'log' message from the worker. 940 * Handles the 'log' message from the worker.
940 * @param {Array.<*>} arglist Log arguments. 941 * @param {Array.<*>} arglist Log arguments.
941 * @private 942 * @private
942 */ 943 */
943 ContentProvider.prototype.onLog_ = function(arglist) { 944 ContentProvider.prototype.onLog_ = function(arglist) {
944 console.log.apply(console, ['metadata:'].concat(arglist)); 945 if (localStorage.logMetadata) // Avoid log spam by default.
946 console.log.apply(console, ['metadata:'].concat(arglist));
945 }; 947 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698