Compare commits

..

6 Commits

Author SHA1 Message Date
Max Woghiren 4fc26fb686 [CB-4013] Added a missing import. 2013-08-08 00:49:40 -04:00
Max Woghiren 731ae51a00 [CB-4013] Fixed loadUrlTimeoutValue preference. 2013-07-30 12:32:13 -04:00
Joe Bowser d0b3f419ef Incrementing version to 3.0.0, ready for tagging 2013-07-18 17:25:18 -07:00
Andrew Grieve d91ac45d88 [CB-3384] Fix thread assertion when plugins remap URIs
(cherry picked from commit b915aafb5b)
2013-07-18 01:39:48 -04:00
David Kemp 488492813d [CB-4133] Add main thread warning for plugins that run too long 2013-07-16 21:19:36 -04:00
Joe Bowser 0b6e90b82a We can remove the plugins tag now. Tested plugman, it's all good. 2013-07-16 15:00:02 -07:00
9 changed files with 39 additions and 16 deletions
+1 -1
View File
@@ -1 +1 @@
3.0.0rc1
3.0.0
+1 -1
View File
@@ -16,4 +16,4 @@
# specific language governing permissions and limitations
# under the License.
echo "3.0.0rc1"
echo "3.0.0"
+3 -3
View File
@@ -1,5 +1,5 @@
// Platform: android
// 3.0.0rc1-0-g1965a39
// 3.0.0-0-ge670de9
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
var CORDOVA_JS_BUILD_LABEL = '3.0.0rc1-0-g1965a39';
var CORDOVA_JS_BUILD_LABEL = '3.0.0-0-ge670de9';
// file: lib/scripts/require.js
var require,
@@ -1786,7 +1786,7 @@ function handlePluginsObject(path, moduleList) {
var scriptCounter = moduleList.length;
if (!scriptCounter) {
onScriptLoadingComplete();
finishPluginLoading();
return;
}
function scriptLoadedCallback() {
-4
View File
@@ -47,8 +47,4 @@
<feature name="App">
<param name="android-package" value="org.apache.cordova.App" />
</feature>
<!-- Deprecated plugins element. Remove in 3.0 -->
<plugins>
</plugins>
</widget>
@@ -156,9 +156,24 @@ public class CordovaResourceApi {
* @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
* resolved before being passed into this function.
* @throws Throws an IOException if the URI cannot be opened.
* @throws Throws an IllegalStateException if called on a foreground thread.
*/
public OpenForReadResult openForRead(Uri uri) throws IOException {
assertBackgroundThread();
return openForRead(uri, false);
}
/**
* Opens a stream to the givne URI, also providing the MIME type & length.
* @return Never returns null.
* @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
* resolved before being passed into this function.
* @throws Throws an IOException if the URI cannot be opened.
* @throws Throws an IllegalStateException if called on a foreground thread and skipThreadCheck is false.
*/
public OpenForReadResult openForRead(Uri uri, boolean skipThreadCheck) throws IOException {
if (!skipThreadCheck) {
assertBackgroundThread();
}
switch (getUriType(uri)) {
case URI_TYPE_FILE: {
FileInputStream inputStream = new FileInputStream(uri.getPath());
@@ -23,6 +23,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import org.apache.cordova.Config;
import org.apache.cordova.CordovaInterface;
@@ -425,7 +426,7 @@ public class CordovaWebView extends WebView {
// Create a timeout timer for loadUrl
final CordovaWebView me = this;
final int currentLoadUrlTimeout = me.loadUrlTimeout;
final int loadUrlTimeoutValue = Integer.parseInt(this.getProperty("loadUrlTimeoutValue", "20000"));
final int loadUrlTimeoutValue = Integer.parseInt(this.getProperty("LoadUrlTimeoutValue", "20000"));
// Timeout error method
final Runnable loadError = new Runnable() {
@@ -620,7 +621,7 @@ public class CordovaWebView extends WebView {
*/
private void loadConfiguration() {
if ("true".equals(this.getProperty("fullscreen", "false"))) {
if ("true".equals(this.getProperty("Fullscreen", "false"))) {
this.cordova.getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
this.cordova.getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
@@ -638,6 +639,7 @@ public class CordovaWebView extends WebView {
if (bundle == null) {
return defaultValue;
}
name = name.toLowerCase(Locale.getDefault());
Object p = bundle.get(name);
if (p == null) {
return defaultValue;
@@ -59,7 +59,7 @@ public class IceCreamCordovaWebViewClient extends CordovaWebViewClient {
Uri remappedUri = resourceApi.remapUri(origUri);
if (!origUri.equals(remappedUri) || needsSpecialsInAssetUrlFix(origUri)) {
OpenForReadResult result = resourceApi.openForRead(remappedUri);
OpenForReadResult result = resourceApi.openForRead(remappedUri, true);
return new WebResourceResponse(result.mimeType, "UTF-8", result.inputStream);
}
// If we don't need to special-case the request, let the browser load it.
@@ -225,7 +225,12 @@ public class PluginManager {
}
try {
CallbackContext callbackContext = new CallbackContext(callbackId, app);
long pluginStartTime = System.currentTimeMillis();
boolean wasValidAction = plugin.execute(action, rawArgs, callbackContext);
long duration = System.currentTimeMillis() - pluginStartTime;
if (duration > 16) {
Log.w(TAG, "THREAD WARNING: exec() call to " + service + "." + action + " blocked the main thread for " + duration + "ms. Plugin should use CordovaInterface.getThreadPool().");
}
if (!wasValidAction) {
PluginResult cr = new PluginResult(PluginResult.Status.INVALID_ACTION);
app.sendPluginResult(cr, callbackId);
+8 -3
View File
@@ -1,5 +1,5 @@
// Platform: android
// 2.7.0rc1-169-g87cc336
// 3.0.0-0-ge670de9
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
var CORDOVA_JS_BUILD_LABEL = '2.7.0rc1-169-g87cc336';
var CORDOVA_JS_BUILD_LABEL = '3.0.0-0-ge670de9';
// file: lib/scripts/require.js
var require,
@@ -900,7 +900,7 @@ function androidExec(success, fail, service, action, args) {
// Process any ArrayBuffers in the args into a string.
for (var i = 0; i < args.length; i++) {
if (utils.typeName(args[i]) == 'ArrayBuffer') {
args[i] = utils.encodeBase64(args[i]);
args[i] = base64.fromArrayBuffer(args[i]);
}
}
@@ -1784,6 +1784,11 @@ function finishPluginLoading() {
function handlePluginsObject(path, moduleList) {
// Now inject the scripts.
var scriptCounter = moduleList.length;
if (!scriptCounter) {
finishPluginLoading();
return;
}
function scriptLoadedCallback() {
if (!--scriptCounter) {
onScriptLoadingComplete(moduleList);