OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the Adblock Plus, | 2 * This file is part of the Adblock Plus, |
3 * Copyright (C) 2006-2012 Eyeo GmbH | 3 * Copyright (C) 2006-2012 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 { | 964 { |
965 headers[i][0] = header; | 965 headers[i][0] = header; |
966 headers[i][1] = StringUtils.join(result.headers.get(header).toArray(
), "; "); | 966 headers[i][1] = StringUtils.join(result.headers.get(header).toArray(
), "; "); |
967 i++; | 967 i++; |
968 } | 968 } |
969 } | 969 } |
970 params[0] = result.code; | 970 params[0] = result.code; |
971 params[1] = result.message; | 971 params[1] = result.message; |
972 params[2] = headers; | 972 params[2] = headers; |
973 params[3] = result.data; | 973 params[3] = result.data; |
| 974 |
| 975 // Do not run callback if engine was stopped |
| 976 if (js == null) |
| 977 return; |
| 978 |
974 js.execute(new Runnable() | 979 js.execute(new Runnable() |
975 { | 980 { |
976 @Override | 981 @Override |
977 public void run() | 982 public void run() |
978 { | 983 { |
979 js.callback(callback, params); | 984 js.callback(callback, params); |
980 } | 985 } |
981 | 986 |
982 }); | 987 }); |
983 } | 988 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 } | 1043 } |
1039 return result; | 1044 return result; |
1040 } | 1045 } |
1041 | 1046 |
1042 protected void onProgressUpdate(Integer... progress) | 1047 protected void onProgressUpdate(Integer... progress) |
1043 { | 1048 { |
1044 Log.d("HTTP", "Progress: " + progress[0].intValue()); | 1049 Log.d("HTTP", "Progress: " + progress[0].intValue()); |
1045 } | 1050 } |
1046 } | 1051 } |
1047 } | 1052 } |
OLD | NEW |