[Verification] TCT filesystem 100% passrate.
Checked metadata features in chrome console.
Change-Id: I807d8514bfda1afccd136fe74b37f80ff45190ca
Instance();
virtual ~Instance();
- static void DoAndPostMessage(Instance* that, const std::function<void()>& work, const picojson::value& json);
+ static void DoAndPostMessage(Instance* that, const std::function<void()>& work,
+ const picojson::value& json);
static void PostMessage(Instance* that, const char* msg);
static void PostMessage(Instance* that, const picojson::value& json);
void PostMessage(const char* msg);
#define LOGGER_IF(priority, condition) \
!(condition) ? (void)0 : LogMessageVoidify() & (LOGGER(priority))
-#define DEPRECATION_WARN(log, version) \
- /* For public code, warning should be always shown */ \
+#define DEPRECATION_WARN(log, version) \
+ /* For public code, warning should be always shown */ \
LoggerW("DEPRECATION WARNING: %s", log);
// This class more or less represents a particular log message.
var native_ = new xwalk.utils.NativeManager(extension);
/*
- * Create new array-like object of numbers: UTF-16 char codes from string.
- * As type pass Array, Uint8Array, etc.
- * Useful for passing data through crosswalk.
- */
-function StringToArray(str, type) {
- var len = str.length;
- var output = new type(len);
- for (var i = 0; i < len; i++) {
- output[i] = str.charCodeAt(i);
- }
- return output;
-}
-
-/*
* Pass array-like object of numbers (Array, Uint8Array, etc.), returns string.
* Each char has codepoint equal to value from array cropped with & 0xFF
* Useful for passing data through crosswalk.
throw native_.getErrorObject(result);
}
var encodedData = native_.getResultObject(result);
- var data = StringToArray(encodedData, Uint8Array);
+ var data = privUtils_.StringToArray(encodedData, Uint8Array);
return new Blob([data]);
};
native_.callIfPossible(args.errorCallback, native_.getErrorObject(result));
} else {
var encodedData = native_.getResultObject(result);
- var data = StringToArray(encodedData, Uint8Array);
+ var data = privUtils_.StringToArray(encodedData, Uint8Array);
native_.callIfPossible(args.successCallback, new Blob([data]));
}
};
throw native_.getErrorObject(result);
}
var encodedData = native_.getResultObject(result);
- var data = StringToArray(encodedData, Uint8Array);
+ var data = privUtils_.StringToArray(encodedData, Uint8Array);
return new Uint8Array(data);
};
native_.callIfPossible(args.errorCallback, native_.getErrorObject(result));
} else {
var data_out = new Uint8Array(
- StringToArray(native_.getResultObject(result), Uint8Array)
+ privUtils_.StringToArray(native_.getResultObject(result), Uint8Array)
);
native_.callIfPossible(args.successCallback, data_out);
}
throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Could not read');
}
- var decoded = StringToArray(native_.getResultObject(result), Array);
+ var decoded = privUtils_.StringToArray(native_.getResultObject(result), Array);
if (decoded.length) {
can_change_size = true;
LogAndReportError(result, &response_obj, ("Failed: server_->DeletePlaylist"));
}
- if (MEDIA_CONTROLLER_ERROR_NONE != mc_playlist_destroy(server_playlist_map_[serverName][name])) {
+ if (MEDIA_CONTROLLER_ERROR_NONE !=
+ mc_playlist_destroy(server_playlist_map_[serverName][name])) {
LoggerE("Unable to destroy playlist %s", name.c_str());
}
mc_playlist_h handle = nullptr;
if (server_playlist_map_.find(app_id) != server_playlist_map_.end() &&
- server_playlist_map_[app_id].find(playlist_name) !=
- server_playlist_map_[app_id].end()) {
- LoggerD("Using saved handle");
+ server_playlist_map_[app_id].find(playlist_name) != server_playlist_map_[app_id].end()) {
+ LoggerD("Using saved handle");
handle = server_playlist_map_[app_id][playlist_name];
}
var types_ = validator_.Types;
var native_ = new xwalk.utils.NativeManager(extension);
-var DEFAULT_BLOB_MIME_TYPE = "image/jpeg"
+var DEFAULT_BLOB_MIME_TYPE = 'image/jpeg';
var MetadataType = {
ALBUM: 'ALBUM',
return native_.getResultObject(result);
};
-// below section copied from filesystem
-// TODO move this to utils?
-/*
- * Create new array-like object of numbers: UTF-16 char codes from string.
- * As type pass Array, Uint8Array, etc.
- * Useful for passing data through crosswalk.
- */
-function StringToArray(str, type) {
- var len = str.length;
- var output = new type(len);
- for (var i = 0; i < len; i++) {
- output[i] = str.charCodeAt(i);
- }
- return output;
-}
-////////////////////////////////////////////////////
-
MetadataFileHandle.prototype.getArtwork = function() {
var data = {
uri: this.uri,
throw native_.getErrorObject(result);
}
var resultData = native_.getResultObject(result);
- var encodedData = StringToArray(resultData.encodedData, Uint8Array);
+ var encodedData = privUtils_.StringToArray(resultData.encodedData, Uint8Array);
return new Blob([encodedData], { type: resultData.mimeType });
};
if (native_.isFailure(result)) {
throw native_.getErrorObject(result);
}
- var encodedData = StringToArray(native_.getResultObject(result), Uint8Array);
+ var encodedData = privUtils_.StringToArray(
+ native_.getResultObject(result),
+ Uint8Array
+ );
return new Blob([encodedData], { type: DEFAULT_BLOB_MIME_TYPE });
};
if (native_.isFailure(result)) {
throw native_.getErrorObject(result);
}
- var encodedData = StringToArray(native_.getResultObject(result), Uint8Array);
+ var encodedData = privUtils_.StringToArray(
+ native_.getResultObject(result),
+ Uint8Array
+ );
return new Blob([encodedData], { type: DEFAULT_BLOB_MIME_TYPE });
};
}
};
+/*
+ * Create new array-like object of numbers: UTF-16 char codes from string.
+ * As type pass Array, Uint8Array, etc.
+ * Useful for passing data through crosswalk.
+ */
+Utils.prototype.StringToArray = function(str, type) {
+ var len = str.length;
+ var output = new type(len);
+ for (var i = 0; i < len; i++) {
+ output[i] = str.charCodeAt(i);
+ }
+ return output;
+};
+
/////////////////////////////////////////////////////////////////////////////
/** @constructor */
var Type = function() {};