1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
|
diff -r a0120629678b ChangeLog
--- a/ChangeLog Wed Apr 14 12:21:03 2010 +0200
+++ b/ChangeLog Fri Jul 16 14:30:37 2010 +0200
@@ -1,3 +1,227 @@
+2010-07-13 Mark Wielaard <mjw@redhat.com>
+
+ Reported by William Cohen <wcohen@redhat.com>
+ * tapset/hotspot.stp.in (object_alloc): size is arg4, not arg3.
+
+2010-07-14 Deepak Bhole <dbhole@redhat.com>
+
+ * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: Add a new
+ processedIds list to track which instances have been instantiated.
+ (okToProcess): Register width as priority only after handle is acquired.
+ Process resize messages only after tag and handle are processed.
+ (notifyWorkerIsFree): Add instance id to processedIds list if the worked
+ being free'd is an init worker.
+ (getFreeWorker): Create new normal worked only if worker count is less
+ than MAX_WORKERS - PRIORITY_WORKERS.
+ (dumpWorkerStatus): New method. Useful when debugging -- prints status of
+ all workers.
+ * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java
+ (toString): New method. Returns the string representation of the worker
+ instance at call time.
+
+2010-07-13 Matthias Klose <doko@ubuntu.com>
+
+ * acinclude.m4 (IT_CHECK_PLUGIN_DEPENDENCIES): Don't require libxul
+ libraries.
+ (IT_CHECK_XULRUNNER_VERSION): Use pkgconfig --modversion as version.
+
+2010-07-13 Deepak Bhole <dbhole@redhat.com>
+
+ * plugin/icedteanp/IcedTeaJavaRequestProcessor.h: Set timeout to 120
+ seconds (previous commit mistakenly changed it to 10).
+ * plugin/icedteanp/IcedTeaPluginUtils.h: Print debug info only in debug
+ mode.
+
+2010-06-14 Deepak Bhole <dbhole@redhat.com>
+
+ * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Use variadic macro
+ for debug message printing.
+ * plugin/icedteanp/IcedTeaJavaRequestProcessor.h: Same.
+ * plugin/icedteanp/IcedTeaNPPlugin.cc: Same.
+ * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same.
+ * plugin/icedteanp/IcedTeaPluginUtils.cc: Same.
+ * plugin/icedteanp/IcedTeaPluginUtils.h: Same.
+ * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: Same.
+
+2010-07-12 Jon VanAlten <jon.vanalten@redhat.com>
+ * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java
+ * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java
+ * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
+ * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java:
+ Eliminate spurious exception throwing from open, close, read, write,
+ drain, and flush calls on closed lines.
+ Use isOpen() API call instead of instance variable where appropriate.
+
+2010-07-08 Man Lung Wong <mwong@redhat.com>
+
+ * netx/net/sourceforge/jnlp/Parser.java:
+ (getRootNode): Used BufferedInputStream instead of InputStream to
+ have mark and reset method available. Passed the encoding to the
+ constructor of InputStreamReader, such that the stream will now
+ be parsed with the encoding the jnlp file is in.
+ (getEncoding): A new method which checks the first four bytes of input
+ and determines what the files encoding is.
+
+2010-06-24 Omair Majid <omajid@redhat.com>
+
+ * netx/net/sourceforge/jnlp/SecurityDesc.java: Fix comments.
+ * netx/net/sourceforge/jnlp/JNLPClassLoader.java
+ (activateJars): Always call activateNative.
+ (activateNative): Search for native code anywhere in the jar.
+
+2010-06-29 Omair Majid <omajid@redhat.com>
+
+ * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+ nativeDirectories: New variable. Contains a list of directories that
+ contain native libraries.
+ (getInstance): Tell other classloaders about the native directory.
+ (getNativeDir): Add the new native directory to nativeDirectories.
+ (addNativeDirectory): New function.
+ (getNativeDirectories): New function.
+ (findLibrary): Look in all the native directories for the native library.
+
+2010-06-29 Omair Majid <omajid@redhat.com>
+
+ * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java
+ (startListeningServer): Mark the thread as a daemon so the JVM can
+ shutdown if there are no other non-daemon thread running.
+
+2010-06-29 Omair Majid <omajid@redhat.com>
+
+ * netx/net/sourceforge/jnlp/cache/CacheUtil.java
+ (urlToPath): Call FileUtils.sanitizePath.
+ (fixPath): Moved to...
+ * netx/net/sourceforge/jnlp/util/FileUtils.java
+ (sanitizePath): New function. Moved from CacheUtil.java
+ (sanitizeFileName): Use a blacklisting approach rather than a whitelisting
+ approach: should work better with non ascii filenames.
+
+2010-07-08 Omair Majid <omajid@redhat.com>
+
+ * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java:
+ (reFrame): Pass the panel to the constructor, dont set it yourself.
+ (PluginAppletViewer): Set the panel to be the passed in object and only
+ then add it to the list of all panels.
+
+2010-07-08 Omair Majid <omajid@redhat.com>
+
+ PR icedtea/460
+ * plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java:
+ New file. Some applets, for legacy support, expect this class to be
+ present.
+
+2010-06-14 Andrew John Hughes <ahughes@redhat.com>
+
+ Don't print out the return value of pthread_self
+ which is a pthread_t. pthread_t is an opaque type
+ and we don't know what it actually is (it varies
+ from system to system; recent versions of Linux
+ use an unsigned long int).
+ * plugin/icedteanp/IcedTeaPluginUtils.h:
+ (PLUGIN_DEBUG_0ARG(str)): Don't print the thread_t.
+ (PLUGIN_DEBUG_1ARG(str,arg1)): Likewise.
+ (PLUGIN_DEBUG_2ARG(str,arg1,arg2)): Likewise.
+ (PLUGIN_DEBUG_3ARG(str,arg1,arg2,arg3)): Likewise.
+ (PLUGIN_DEBUG_4ARG(str,arg1,arg2,arg3,arg4)): Likewise.
+ (PLUGIN_DEBUG_5ARG(str,arg1,arg2,arg3,arg4,arg5)): Likewise.
+
+2010-06-14 Deepak Bhole <dbhole@redhat.com>
+
+ * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: Fix bug
+ causing 100% CPU usage (rhbz# 592553).
+
+2010-06-14 Omair Majid <omajid@redhat.com>
+
+ PR icedtea/488
+ * plugin/icedteanp/IcedTeaPluginUtils.h: Bug #488. Fix bug due to
+ incorrect assumption that 'A' > 'a'.
+
+2010-06-14 Omair Majid <omajid@redhat.com>
+
+ PR icedtea/480
+ * plugin/icedteanp/IcedTeaNPPlugin.cc: Use getproperty NPAPI call instead
+ of evaluate, to get page URL.
+
+2010-05-07 Deepak Bhole <dbhole@redhat.com>
+
+ PR icedtea/436:
+ * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
+ (handleMessage): Don't print stack trace on InterruptedException.
+ (appletClose): Kill misbehaving applets that don't shut down properly.
+
+2010-05-07 Deepak Bhole <dbhole@redhat.com>
+
+ * netx/net/sourceforge/jnlp/Launcher.java
+ (setContextClassLoaderForAllThreads): Change to set context CL only for
+ given threadgroup.
+ (launchApplication): Supply threadgroup to
+ setContextClassLoaderForAllThreads.
+ (createApplet): Same.
+
+2010-05-07 Gary Benson <gbenson@redhat.com>
+
+ * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java:
+ Removed a stray semicolon.
+
+2010-05-06 Deepak Bhole <dbhole@redhat.com>
+
+ * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java:
+ Add imports missed in last commit.
+
+2010-05-06 Deepak Bhole <dbhole@redhat.com>
+
+ * rt/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
+ (checkPermission): Allow Runtime and Security permission (for
+ putProvider.SunJCE) if initiated for an https connection.
+ (inTrustedCallChain): New method. Returns if given class/method is
+ in the call chain, and everything upto there is trusted.
+
+2010-05-05 Gary Benson <gbenson@redhat.com>
+
+ PR icedtea/481
+ * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
+ (SharkTopLevelBlock::improve_virtual_call): Disable an
+ optimization that cannot currently be supported.
+
+2010-04-30 Gary Benson <gbenson@redhat.com>
+
+ PR icedtea/324
+ * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
+ (SharkTopLevelBlock::do_aload): Cope with cases where
+ the array's type is unknown.
+ (SharkTopLevelBlock::do_astore): Likewise.
+
+2010-04-28 Andrew John Hughes <ahughes@redhat.com>
+
+ PR icedtea/476
+ * Makefile.am:
+ Add patch when SystemTap is enabled to support
+ building with GCC 4.5.
+ * patches/systemtap-gcc-4.5.patch:
+ Add cast to NULL (doesn't apply to DTrace due
+ to differences between SystemTap and DTrace macros).
+
+2010-04-24 Matthias Klose <doko@ubuntu.com>
+
+ * Makefile.am (check-langtools, check-jdk): Allow overwriting -samevm
+ with the environment variable ICEDTEA_JTREG_OTHERVM.
+
+2010-04-22 Xerxes Rånby <xerxes@zafena.se>
+
+ * ports/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp
+ (SharkNativeWrapper::initialize): Shark calling static jni
+ methods jclass argument fix.
+
+2010-04-04 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+ * acinclude.m4 (IT_SET_ARCH_SETTINGS): Fix Hitachi SH settings.
+
+2010-04-21 Deepak Bhole <dbhole@redhat.com>
+
+ * plugin/icedteanp/IcedTeaNPPlugin.cc
+ (plugin_filter_environment): Increment malloc size by one to account for
+ NULL terminator. Bug# 474.
+
2010-04-12 Andrew John Hughes <ahughes@redhat.com>
PR icedtea/373
diff -r a0120629678b Makefile.am
--- a/Makefile.am Wed Apr 14 12:21:03 2010 +0200
+++ b/Makefile.am Fri Jul 16 14:30:37 2010 +0200
@@ -374,7 +374,8 @@
endif
if ENABLE_SYSTEMTAP
-ICEDTEA_PATCHES += patches/icedtea-systemtap.patch
+ICEDTEA_PATCHES += patches/icedtea-systemtap.patch \
+ patches/systemtap-gcc-4.5.patch
endif
if ENABLE_NSS
@@ -2024,7 +2025,8 @@
mkdir -p test/langtools/JTwork test/langtools/JTreport
$(ICEDTEA_BOOT_DIR)/bin/java -jar test/jtreg.jar -v1 -a -ignore:quiet \
-w:test/langtools/JTwork -r:test/langtools/JTreport \
- -s -jdk:`pwd`/$(BUILD_OUTPUT_DIR)/j2sdk-image \
+ $${ICEDTEA_JTREG_OTHERVM:--samevm} \
+ -jdk:`pwd`/$(BUILD_OUTPUT_DIR)/j2sdk-image \
$(ICEDTEA_JTREG_OPTIONS) \
`pwd`/openjdk/langtools/test \
| tee test/$@.log
@@ -2033,7 +2035,8 @@
mkdir -p test/jdk/JTwork test/jdk/JTreport
$(ICEDTEA_BOOT_DIR)/bin/java -jar test/jtreg.jar -v1 -a -ignore:quiet \
-w:test/jdk/JTwork -r:test/jdk/JTreport \
- -s -jdk:`pwd`/$(BUILD_OUTPUT_DIR)/j2sdk-image \
+ $${ICEDTEA_JTREG_OTHERVM:--samevm} \
+ -jdk:`pwd`/$(BUILD_OUTPUT_DIR)/j2sdk-image \
-exclude:$(abs_top_srcdir)/test/jtreg/excludelist.jdk.jtx \
$(ICEDTEA_JTREG_OPTIONS) \
`pwd`/openjdk/jdk/test \
diff -r a0120629678b acinclude.m4
--- a/acinclude.m4 Wed Apr 14 12:21:03 2010 +0200
+++ b/acinclude.m4 Fri Jul 16 14:30:37 2010 +0200
@@ -85,7 +85,7 @@
CROSS_TARGET_ARCH=s390x
ARCHFLAG="-m64"
;;
- sh*-*-*)
+ sh*)
BUILD_ARCH_DIR=sh
INSTALL_ARCH_DIR=sh
JRE_ARCH_DIR=sh
@@ -1461,15 +1461,7 @@
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
-
- if $PKG_CONFIG --atleast-version 1.9.2 libxul 2>&AS_MESSAGE_LOG_FD ; then
- xullibs=libxul
- else
- xullibs="libxul libxul-unstable"
- fi
-
- PKG_CHECK_MODULES(MOZILLA, \
- mozilla-plugin ${xullibs})
+ PKG_CHECK_MODULES(MOZILLA, mozilla-plugin)
AC_SUBST(MOZILLA_CFLAGS)
AC_SUBST(MOZILLA_LIBS)
@@ -1482,52 +1474,13 @@
AC_REQUIRE([IT_CHECK_PLUGIN_DEPENDENCIES])
if test "x${enable_plugin}" = "xyes"
then
- AC_LANG_PUSH([C++])
- OLDCPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $MOZILLA_CFLAGS"
-
- AC_CACHE_CHECK([for xulrunner version], [xulrunner_cv_collapsed_version],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([[
-#include <mozilla-config.h>
-#include <math.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-]],[[
-int version = 0;
-const char* token = NULL;
-int power=6;
-FILE *datafile;
-
-datafile = fopen ("conftest.vdata", "w");
-if (!datafile) return 1;
-
-// 32 chars is more than enough to hold version
-char* mozilla_version = (char*) malloc(32*sizeof(char));
-snprintf(mozilla_version, 32, "%s", MOZILLA_VERSION);
-
-token = strtok(mozilla_version, ".");
-while (token)
-{
- version += atoi(token)*(pow(10, power));
- power -=2;
- token = strtok(NULL, ".");
-}
-
-fprintf (datafile, "%d\n", version);
-free(mozilla_version);
-if (fclose(datafile)) return 1;
-
-return EXIT_SUCCESS;
-]])],
- [xulrunner_cv_collapsed_version="$(cat conftest.vdata)"],
- [AC_MSG_FAILURE([cannot determine xulrunner version])])],
- [xulrunner_cv_collapsed_version="190000"])
-
- CPPFLAGS="$OLDCPPFLAGS"
- AC_LANG_POP([C++])
-
+ AC_CACHE_CHECK([for xulrunner version], [xulrunner_cv_collapsed_version],[
+ if pkg-config --modversion libxul >/dev/null 2>&1
+ then
+ xulrunner_cv_collapsed_version=`pkg-config --modversion libxul | awk -F. '{power=6; v=0; for (i=1; i <= NF; i++) {v += $i * 10 ^ power; power -=2}; print v}'`
+ else
+ AC_MSG_FAILURE([cannot determine xulrunner version])
+ fi])
AC_SUBST(MOZILLA_VERSION_COLLAPSED, $xulrunner_cv_collapsed_version)
fi
])
diff -r a0120629678b netx/net/sourceforge/jnlp/Launcher.java
--- a/netx/net/sourceforge/jnlp/Launcher.java Wed Apr 14 12:21:03 2010 +0200
+++ b/netx/net/sourceforge/jnlp/Launcher.java Fri Jul 16 14:30:37 2010 +0200
@@ -442,7 +442,7 @@
Method main = mainClass.getDeclaredMethod("main", new Class[] {String[].class} );
String args[] = file.getApplication().getArguments();
- setContextClassLoaderForAllThreads(app.getClassLoader());
+ setContextClassLoaderForAllThreads(app.getThreadGroup(), app.getClassLoader());
if (splashScreen != null) {
if (splashScreen.isSplashScreenValid()) {
@@ -464,30 +464,24 @@
}
/**
- * Set the classloader as the context classloader for all threads. This is
- * required to make some applications work. For example, an application that
- * provides a custom Swing LnF may ask the swing thread to load resources
- * from their JNLP, which would only work if the Swing thread knows about
- * the JNLPClassLoader.
+ * Set the classloader as the context classloader for all threads in
+ * the given threadgroup. This is required to make some applications
+ * work. For example, an application that provides a custom Swing LnF
+ * may ask the swing thread to load resources from their JNLP, which
+ * would only work if the Swing thread knows about the JNLPClassLoader.
*
+ * @param tg The threadgroup for which the context classloader should be set
* @param classLoader the classloader to set as the context classloader
*/
- private void setContextClassLoaderForAllThreads(ClassLoader classLoader) {
- ThreadMXBean threadBean = ManagementFactory.getThreadMXBean();
- ThreadGroup root;
-
- root = Thread.currentThread().getThreadGroup();
- while (root.getParent() != null) {
- root = root.getParent();
- }
+ private void setContextClassLoaderForAllThreads(ThreadGroup tg, ClassLoader classLoader) {
/* be prepared for change in thread size */
- int threadCountGuess = threadBean.getThreadCount();
+ int threadCountGuess = tg.activeCount();
Thread[] threads;
do {
threadCountGuess = threadCountGuess * 2;
threads = new Thread[threadCountGuess];
- root.enumerate(threads, true);
+ tg.enumerate(threads, true);
} while (threads[threadCountGuess-1] != null);
@@ -595,7 +589,7 @@
group.setApplication(appletInstance);
loader.setApplication(appletInstance);
- setContextClassLoaderForAllThreads(appletInstance.getClassLoader());
+ setContextClassLoaderForAllThreads(appletInstance.getThreadGroup(), appletInstance.getClassLoader());
return appletInstance;
}
diff -r a0120629678b netx/net/sourceforge/jnlp/Parser.java
--- a/netx/net/sourceforge/jnlp/Parser.java Wed Apr 14 12:21:03 2010 +0200
+++ b/netx/net/sourceforge/jnlp/Parser.java Fri Jul 16 14:30:37 2010 +0200
@@ -1169,11 +1169,15 @@
Node jnlpNode = getChildNode(document, "jnlp"); // skip comments
*/
+ //A BufferedInputStream is used to allow marking and reseting
+ //of a stream.
+ BufferedInputStream bs = new BufferedInputStream(input);
+
/* NANO */
final XMLElement xml = new XMLElement();
final PipedInputStream pin = new PipedInputStream();
final PipedOutputStream pout = new PipedOutputStream(pin);
- final InputStreamReader isr = new InputStreamReader(input);
+ final InputStreamReader isr = new InputStreamReader(bs, getEncoding(bs));
// Clean the jnlp xml file of all comments before passing
// it to the parser.
new Thread(
@@ -1196,7 +1200,69 @@
throw new ParseException(R("PBadXML"), ex);
}
}
+
+ /**
+ * Returns the name of the encoding used in this InputStream.
+ *
+ * @param input the InputStream
+ * @return a String representation of encoding
+ */
+ private static String getEncoding(InputStream input) throws IOException{
+ //Fixme: This only recognizes UTF-8, UTF-16, and
+ //UTF-32, which is enough to parse the prolog portion of xml to
+ //find out the exact encoding (if it exists). The reason being
+ //there could be other encodings, such as ISO 8859 which is 8-bits
+ //but it supports latin characters.
+ //So what needs to be done is to parse the prolog and retrieve
+ //the exact encoding from it.
+ int[] s = new int[4];
+ String encoding = "UTF-8";
+
+ //Determine what the first four bytes are and store
+ //them into an int array.
+ input.mark(4);
+ for (int i = 0; i < 4; i++) {
+ s[i] = input.read();
+ }
+ input.reset();
+
+ //Set the encoding base on what the first four bytes of the
+ //inputstream turn out to be (following the information from
+ //www.w3.org/TR/REC-xml/#sec-guessing).
+ if (s[0] == 255) {
+ if (s[1] == 254) {
+ if (s[2] != 0 || s[3] != 0) {
+ encoding = "UnicodeLittle";
+ } else {
+ encoding = "X-UTF-32LE-BOM";
+ }
+ }
+ } else if (s[0] == 254 && s[1] == 255 && (s[2] != 0 ||
+ s[3] != 0)) {
+ encoding = "UTF-16";
+
+ } else if (s[0] == 0 && s[1] == 0 && s[2] == 254 &&
+ s[3] == 255) {
+ encoding = "X-UTF-32BE-BOM";
+
+ } else if (s[0] == 0 && s[1] == 0 && s[2] == 0 &&
+ s[3] == 60) {
+ encoding = "UTF-32BE";
+
+ } else if (s[0] == 60 && s[1] == 0 && s[2] == 0 &&
+ s[3] == 0) {
+ encoding = "UTF-32LE";
+
+ } else if (s[0] == 0 && s[1] == 60 && s[2] == 0 &&
+ s[3] == 63) {
+ encoding = "UTF-16BE";
+ } else if (s[0] == 60 && s[1] == 0 && s[2] == 63 &&
+ s[3] == 0) {
+ encoding = "UTF-16LE";
+ }
+
+ return encoding;
+ }
}
-
diff -r a0120629678b netx/net/sourceforge/jnlp/SecurityDesc.java
--- a/netx/net/sourceforge/jnlp/SecurityDesc.java Wed Apr 14 12:21:03 2010 +0200
+++ b/netx/net/sourceforge/jnlp/SecurityDesc.java Fri Jul 16 14:30:37 2010 +0200
@@ -31,12 +31,9 @@
*/
public class SecurityDesc {
- // todo: make sure classloader's native code support checks
- // the security permissions
-
- // shouldn't need to verify that native code only runs in
- // trusted environment because the parser and/or classloader
- // should kick it.
+ /*
+ * We do not verify security here, the classloader deals with security
+ */
/** All permissions. */
public static final Object ALL_PERMISSIONS = "All";
diff -r a0120629678b netx/net/sourceforge/jnlp/cache/CacheUtil.java
--- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Wed Apr 14 12:21:03 2010 +0200
+++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Fri Jul 16 14:30:37 2010 +0200
@@ -26,6 +26,7 @@
import net.sourceforge.jnlp.*;
import net.sourceforge.jnlp.runtime.*;
+import net.sourceforge.jnlp.util.FileUtils;
/**
* Provides static methods to interact with the cache, download
@@ -300,23 +301,9 @@
path.append(File.separatorChar);
path.append(location.getPath().replace('/', File.separatorChar));
- return new File(JNLPRuntime.getBaseDir(), fixPath(path.toString()));
+ return new File(JNLPRuntime.getBaseDir(), FileUtils.sanitizePath(path.toString()));
}
- /**
- * Clean up a string by removing characters that can't appear in
- * a local file name.
- */
- private static String fixPath(String path) {
- char badChars[] = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
-
- for (int i=0; i < badChars.length; i++)
- if (badChars[i] != File.separatorChar)
- if (-1 != path.indexOf(badChars[i]))
- path = path.replace(badChars[i], 'X');
-
- return path;
- }
/**
* Waits until the resources are downloaded, while showing a
diff -r a0120629678b netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Wed Apr 14 12:21:03 2010 +0200
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Jul 16 14:30:37 2010 +0200
@@ -32,6 +32,7 @@
import java.security.Permissions;
import java.security.PrivilegedAction;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedList;
@@ -80,12 +81,12 @@
/** map from JNLPFile url to shared classloader */
private static Map urlToLoader = new HashMap(); // never garbage collected!
- /** number of times a classloader with native code is created */
- private static int nativeCounter = 0;
-
/** the directory for native code */
private File nativeDir = null; // if set, some native code exists
+ /** a list of directories that contain native libraries */
+ private List<File> nativeDirectories = Collections.synchronizedList(new LinkedList<File>());
+
/** security context */
private AccessControlContext acc = AccessController.getContext();
@@ -240,18 +241,22 @@
// loader for this unique key. Check.
JNLPClassLoader extLoader = (JNLPClassLoader) urlToLoader.get(uniqueKey);
- if (extLoader != null) {
+ if (extLoader != null && extLoader != loader) {
for (URL u : loader.getURLs())
extLoader.addURL(u);
+ for (File nativeDirectory: loader.getNativeDirectories())
+ extLoader.addNativeDirectory(nativeDirectory);
loader = extLoader;
}
// loader is now current + ext. But we also need to think of
// the baseLoader
- if (baseLoader != null) {
+ if (baseLoader != null && baseLoader != loader) {
for (URL u : loader.getURLs())
baseLoader.addURL(u);
+ for (File nativeDirectory: loader.getNativeDirectories())
+ baseLoader.addNativeDirectory(nativeDirectory);
loader = baseLoader;
}
@@ -642,8 +647,8 @@
ex.printStackTrace();
}
- if (jar.isNative())
- activateNative(jar);
+ // some programs place a native library in any jar
+ activateNative(jar);
}
return null;
@@ -654,9 +659,9 @@
}
/**
- * Enable the native code contained in a JAR by copying the
- * native files into the filesystem. Called in the security
- * context of the classloader.
+ * Search for and enable any native code contained in a JAR by copying the
+ * native files into the filesystem. Called in the security context of the
+ * classloader.
*/
protected void activateNative(JARDesc jar) {
if (JNLPRuntime.isDebug())
@@ -669,17 +674,33 @@
if (nativeDir == null)
nativeDir = getNativeDir();
+ String[] librarySuffixes = { ".so", ".dylib", ".jnilib", ".framework", ".dll" };
+
try {
JarFile jarFile = new JarFile(localFile, false);
- Enumeration entries = jarFile.entries();
+ Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreElements()) {
- JarEntry e = (JarEntry) entries.nextElement();
+ JarEntry e = entries.nextElement();
- if (e.isDirectory() || e.getName().indexOf('/') != -1)
+ if (e.isDirectory()) {
continue;
+ }
- File outFile = new File(nativeDir, e.getName());
+ String name = new File(e.getName()).getName();
+ boolean isLibrary = false;
+
+ for (String suffix: librarySuffixes) {
+ if (name.endsWith(suffix)) {
+ isLibrary = true;
+ break;
+ }
+ }
+ if (!isLibrary) {
+ continue;
+ }
+
+ File outFile = new File(nativeDir, name);
CacheUtil.streamCopy(jarFile.getInputStream(e),
new FileOutputStream(outFile));
@@ -703,29 +724,47 @@
if (!nativeDir.mkdirs())
return null;
- else
+ else {
+ // add this new native directory to the search path
+ addNativeDirectory(nativeDir);
return nativeDir;
+ }
+ }
+
+ /**
+ * Adds the {@link File} to the search path of this {@link JNLPClassLoader}
+ * when trying to find a native library
+ */
+ protected void addNativeDirectory(File nativeDirectory) {
+ nativeDirectories.add(nativeDirectory);
+ }
+
+ /**
+ * Returns a list of all directories in the search path of the current classloader
+ * when it tires to find a native library.
+ * @return a list of directories in the search path for native libraries
+ */
+ protected List<File> getNativeDirectories() {
+ return nativeDirectories;
}
/**
* Return the absolute path to the native library.
*/
protected String findLibrary(String lib) {
- if (nativeDir == null)
- return null;
-
String syslib = System.mapLibraryName(lib);
- File target = new File(nativeDir, syslib);
- if (target.exists())
- return target.toString();
- else {
- String result = super.findLibrary(lib);
- if (result != null)
- return result;
+ for (File dir: getNativeDirectories()) {
+ File target = new File(dir, syslib);
+ if (target.exists())
+ return target.toString();
+ }
- return findLibraryExt(lib);
- }
+ String result = super.findLibrary(lib);
+ if (result != null)
+ return result;
+
+ return findLibraryExt(lib);
}
/**
diff -r a0120629678b netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
--- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Wed Apr 14 12:21:03 2010 +0200
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Fri Jul 16 14:30:37 2010 +0200
@@ -23,10 +23,12 @@
import java.awt.event.WindowEvent;
import java.lang.ref.WeakReference;
import java.net.SocketPermission;
+import java.security.AllPermission;
import java.security.AccessControlException;
import java.security.AccessController;
import java.security.Permission;
import java.security.PrivilegedAction;
+import java.security.SecurityPermission;
import java.util.PropertyPermission;
import javax.swing.JWindow;
@@ -395,6 +397,24 @@
// Everything else is denied
throw se;
+ } else if (perm instanceof SecurityPermission) {
+
+ // JCE's initialization requires putProviderProperty permission
+ if (perm.equals(new SecurityPermission("putProviderProperty.SunJCE"))) {
+ if (inTrustedCallChain("com.sun.crypto.provider.SunJCE", "run")) {
+ return;
+ }
+ }
+
+ } else if (perm instanceof RuntimePermission) {
+
+ // KeyGenerator's init method requires internal spec access
+ if (perm.equals(new SecurityPermission("accessClassInPackage.sun.security.internal.spec"))) {
+ if (inTrustedCallChain("javax.crypto.KeyGenerator", "init")) {
+ return;
+ }
+ }
+
} else {
tmpPerm = perm;
}
@@ -419,6 +439,34 @@
}
}
+ /**
+ * Returns weather the given class and method are in the current stack,
+ * and whether or not everything upto then is trusted
+ *
+ * @param className The name of the class to look for in the stack
+ * @param methodName The name of the method for the given class to look for in the stack
+ * @return Weather or not class::method() are in the chain, and everything upto there is trusted
+ */
+ private boolean inTrustedCallChain(String className, String methodName) {
+
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+
+ for (int i=0; i < stack.length; i++) {
+
+ // Everything up to the desired class/method must be trusted
+ if (!stack[i].getClass().getProtectionDomain().implies(new AllPermission())) {
+ return false;
+ }
+
+ if (stack[i].getClassName().equals(className) &&
+ stack[i].getMethodName().equals(methodName)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
/**
* Asks the user whether or not to grant permission.
* @param perm the permission to be granted
diff -r a0120629678b netx/net/sourceforge/jnlp/services/XSingleInstanceService.java
--- a/netx/net/sourceforge/jnlp/services/XSingleInstanceService.java Wed Apr 14 12:21:03 2010 +0200
+++ b/netx/net/sourceforge/jnlp/services/XSingleInstanceService.java Fri Jul 16 14:30:37 2010 +0200
@@ -145,14 +145,21 @@
}
/**
- * Start the listening server to accept arguments from new isntances of
+ * Start the listening server to accept arguments from new instances of
* applications
*
* @param lockFile
+ * the {@link SingleInstanceLock} that the server should use
*/
private void startListeningServer(SingleInstanceLock lockFile) {
SingleInstanceServer server = new SingleInstanceServer(lockFile);
- new Thread(server).start();
+ Thread serverThread = new Thread(server);
+ /*
+ * mark as daemon so the JVM can shutdown if the server is the only
+ * thread running
+ */
+ serverThread.setDaemon(true);
+ serverThread.start();
}
/**
diff -r a0120629678b netx/net/sourceforge/jnlp/util/FileUtils.java
--- a/netx/net/sourceforge/jnlp/util/FileUtils.java Wed Apr 14 12:21:03 2010 +0200
+++ b/netx/net/sourceforge/jnlp/util/FileUtils.java Fri Jul 16 14:30:37 2010 +0200
@@ -14,35 +14,58 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
package net.sourceforge.jnlp.util;
+import java.io.File;
+
/**
- * This class contains a few file-related utility functions.
+ * This class contains a few file-related utility functions.
*
* @author Omair Majid
*/
-public class FileUtils {
+public final class FileUtils {
-
+ /**
+ * list of characters not allowed in filenames
+ */
+ private static final char INVALID_CHARS[] = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
+
+ private static final char SANITIZED_CHAR = '_';
+
+ /**
+ * Clean up a string by removing characters that can't appear in a local
+ * file name.
+ *
+ * @param path
+ * the path to sanitize
+ * @return a sanitized version of the input which is suitable for using as a
+ * file path
+ */
+ public static String sanitizePath(String path) {
+
+ for (int i = 0; i < INVALID_CHARS.length; i++)
+ if (INVALID_CHARS[i] != File.separatorChar)
+ if (-1 != path.indexOf(INVALID_CHARS[i]))
+ path = path.replace(INVALID_CHARS[i], SANITIZED_CHAR);
+
+ return path;
+ }
+
/**
* Given an input, return a sanitized form of the input suitable for use as
* a file/directory name
- *
+ *
* @param input
* @return a sanitized version of the input
*/
- public static String sanitizeFileName(String input) {
+ public static String sanitizeFileName(String filename) {
- /*
- * FIXME
- *
- * Assuming safe characters are 'a-z','A-Z','0-9', '_', '.'
- */
+ for (int i = 0; i < INVALID_CHARS.length; i++)
+ if (-1 != filename.indexOf(INVALID_CHARS[i]))
+ filename = filename.replace(INVALID_CHARS[i], SANITIZED_CHAR);
- String sanitizedName = input.replaceAll("[^a-zA-Z0-9.]", "_");
- return sanitizedName;
+ return filename;
}
-
+
}
diff -r a0120629678b patches/systemtap-gcc-4.5.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/systemtap-gcc-4.5.patch Fri Jul 16 14:30:37 2010 +0200
@@ -0,0 +1,11 @@
+--- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp 2010-04-28 08:51:29.000000000 +0100
++++ openjdk/hotspot/src/share/vm/prims/jni.cpp 2010-04-28 09:29:22.000000000 +0100
+@@ -2723,7 +2723,7 @@
+
+ if (!directBufferSupportInitializeEnded) {
+ if (!initializeDirectBufferSupport(env, thread)) {
+- DTRACE_PROBE1(hotspot_jni, NewDirectByteBuffer__return, NULL);
++ DTRACE_PROBE1(hotspot_jni, NewDirectByteBuffer__return, (uintptr_t) NULL);
+ return NULL;
+ }
+ }
diff -r a0120629678b plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
--- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc Wed Apr 14 12:21:03 2010 +0200
+++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc Fri Jul 16 14:30:37 2010 +0200
@@ -179,7 +179,7 @@
JavaRequestProcessor::JavaRequestProcessor()
{
- PLUGIN_DEBUG_0ARG("JavaRequestProcessor constructor\n");
+ PLUGIN_DEBUG("JavaRequestProcessor constructor\n");
// caller frees this
result = new JavaResultData();
@@ -200,7 +200,7 @@
JavaRequestProcessor::~JavaRequestProcessor()
{
- PLUGIN_DEBUG_0ARG("JavaRequestProcessor::~JavaRequestProcessor\n");
+ PLUGIN_DEBUG("JavaRequestProcessor::~JavaRequestProcessor\n");
if (result)
{
@@ -271,7 +271,7 @@
result->error_msg->append("Error: Timed out when waiting for response");
// Report error
- PLUGIN_DEBUG_1ARG("Error: Timed out when waiting for response to %s\n", message.c_str());
+ PLUGIN_DEBUG("Error: Timed out when waiting for response to %s\n", message.c_str());
}
java_to_plugin_bus->unSubscribe(this);
@@ -847,12 +847,12 @@
if (NPVARIANT_IS_VOID(variant))
{
- PLUGIN_DEBUG_1ARG("VOID %d\n", variant);
+ PLUGIN_DEBUG("VOID %d\n", variant);
id->append("0");
return; // no need to go further
} else if (NPVARIANT_IS_NULL(variant))
{
- PLUGIN_DEBUG_1ARG("NULL\n", variant);
+ PLUGIN_DEBUG("NULL\n", variant);
id->append("0");
return; // no need to go further
} else if (NPVARIANT_IS_BOOLEAN(variant))
@@ -894,18 +894,18 @@
NPObject* obj = NPVARIANT_TO_OBJECT(variant);
if (IcedTeaScriptableJavaPackageObject::is_valid_java_object(obj))
{
- PLUGIN_DEBUG_0ARG("NPObject is a Java object\n");
+ PLUGIN_DEBUG("NPObject is a Java object\n");
alreadyCreated = true;
} else
{
- PLUGIN_DEBUG_0ARG("NPObject is not a Java object\n");
+ PLUGIN_DEBUG("NPObject is not a Java object\n");
NPIdentifier length_id = browser_functions.getstringidentifier("length");
// FIXME: We currently only handle <= 2 dim arrays. Do we really need more though?
// Is it an array?
if (IcedTeaPluginUtilities::isObjectJSArray(instance, obj)) {
- PLUGIN_DEBUG_0ARG("NPObject is an array\n");
+ PLUGIN_DEBUG("NPObject is an array\n");
std::string array_id = std::string();
std::string java_array_type = std::string();
diff -r a0120629678b plugin/icedteanp/IcedTeaNPPlugin.cc
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc Wed Apr 14 12:21:03 2010 +0200
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Fri Jul 16 14:30:37 2010 +0200
@@ -262,7 +262,7 @@
int16_t argc, char* argn[], char* argv[],
NPSavedData* saved)
{
- PLUGIN_DEBUG_0ARG("ITNP_New\n");
+ PLUGIN_DEBUG("ITNP_New\n");
static NPObject *window_ptr;
NPIdentifier identifier;
@@ -275,7 +275,7 @@
}
browser_functions.getproperty(instance, window_ptr, identifier, &member_ptr);
- PLUGIN_DEBUG_1ARG("Got variant %p\n", &member_ptr);
+ PLUGIN_DEBUG("Got variant %p\n", &member_ptr);
NPError np_error = NPERR_NO_ERROR;
@@ -395,12 +395,12 @@
documentbase = NULL;
// store an identifier for this plugin
- PLUGIN_DEBUG_2ARG("Mapping id %d and instance %p\n", instance_counter, instance);
+ PLUGIN_DEBUG("Mapping id %d and instance %p\n", instance_counter, instance);
g_hash_table_insert(instance_to_id_map, instance, GINT_TO_POINTER(instance_counter));
g_hash_table_insert(id_to_instance_map, GINT_TO_POINTER(instance_counter), instance);
instance_counter++;
- PLUGIN_DEBUG_0ARG ("ITNP_New return\n");
+ PLUGIN_DEBUG ("ITNP_New return\n");
return np_error;
}
@@ -415,16 +415,16 @@
GMutex *vm_start_mutex = g_mutex_new();
g_mutex_lock(vm_start_mutex);
- PLUGIN_DEBUG_0ARG("Checking JVM status...\n");
+ PLUGIN_DEBUG("Checking JVM status...\n");
// If the jvm is already up, do nothing
if (jvm_up)
{
- PLUGIN_DEBUG_0ARG("JVM is up. Returning.\n");
+ PLUGIN_DEBUG("JVM is up. Returning.\n");
return;
}
- PLUGIN_DEBUG_0ARG("No JVM is running. Attempting to start one...\n");
+ PLUGIN_DEBUG("No JVM is running. Attempting to start one...\n");
NPError np_error = NPERR_NO_ERROR;
ITNPPluginData* data = NULL;
@@ -447,14 +447,14 @@
// clean up any older pip
unlink (in_pipe_name);
- PLUGIN_DEBUG_1ARG ("ITNP_New: creating input fifo: %s\n", in_pipe_name);
+ PLUGIN_DEBUG ("ITNP_New: creating input fifo: %s\n", in_pipe_name);
if (mkfifo (in_pipe_name, 0600) == -1 && errno != EEXIST)
{
PLUGIN_ERROR_TWO ("Failed to create input pipe", strerror (errno));
np_error = NPERR_GENERIC_ERROR;
goto cleanup_in_pipe_name;
}
- PLUGIN_DEBUG_1ARG ("ITNP_New: created input fifo: %s\n", in_pipe_name);
+ PLUGIN_DEBUG ("ITNP_New: created input fifo: %s\n", in_pipe_name);
// Create plugin-to-appletviewer pipe which we refer to as the
// output pipe.
@@ -473,14 +473,14 @@
// clean up any older pip
unlink (out_pipe_name);
- PLUGIN_DEBUG_1ARG ("ITNP_New: creating output fifo: %s\n", out_pipe_name);
+ PLUGIN_DEBUG ("ITNP_New: creating output fifo: %s\n", out_pipe_name);
if (mkfifo (out_pipe_name, 0600) == -1 && errno != EEXIST)
{
PLUGIN_ERROR_TWO ("Failed to create output pipe", strerror (errno));
np_error = NPERR_GENERIC_ERROR;
goto cleanup_out_pipe_name;
}
- PLUGIN_DEBUG_1ARG ("ITNP_New: created output fifo: %s\n", out_pipe_name);
+ PLUGIN_DEBUG ("ITNP_New: created output fifo: %s\n", out_pipe_name);
// Start a separate appletviewer process for each applet, even if
// there are multiple applets in the same page. We may need to
@@ -571,9 +571,9 @@
// cleanup_out_pipe:
// Delete output pipe.
- PLUGIN_DEBUG_1ARG ("ITNP_New: deleting input fifo: %s\n", in_pipe_name);
+ PLUGIN_DEBUG ("ITNP_New: deleting input fifo: %s\n", in_pipe_name);
unlink (out_pipe_name);
- PLUGIN_DEBUG_1ARG ("ITNP_New: deleted input fifo: %s\n", in_pipe_name);
+ PLUGIN_DEBUG ("ITNP_New: deleted input fifo: %s\n", in_pipe_name);
cleanup_out_pipe_name:
g_free (out_pipe_name);
@@ -581,9 +581,9 @@
// cleanup_in_pipe:
// Delete input pipe.
- PLUGIN_DEBUG_1ARG ("ITNP_New: deleting output fifo: %s\n", out_pipe_name);
+ PLUGIN_DEBUG ("ITNP_New: deleting output fifo: %s\n", out_pipe_name);
unlink (in_pipe_name);
- PLUGIN_DEBUG_1ARG ("ITNP_New: deleted output fifo: %s\n", out_pipe_name);
+ PLUGIN_DEBUG ("ITNP_New: deleted output fifo: %s\n", out_pipe_name);
cleanup_in_pipe_name:
g_free (in_pipe_name);
@@ -599,7 +599,7 @@
NPError
ITNP_GetValue (NPP instance, NPPVariable variable, void* value)
{
- PLUGIN_DEBUG_0ARG ("ITNP_GetValue\n");
+ PLUGIN_DEBUG ("ITNP_GetValue\n");
NPError np_error = NPERR_NO_ERROR;
@@ -608,7 +608,7 @@
// This plugin needs XEmbed support.
case NPPVpluginNeedsXEmbed:
{
- PLUGIN_DEBUG_0ARG ("ITNP_GetValue: returning TRUE for NeedsXEmbed.\n");
+ PLUGIN_DEBUG ("ITNP_GetValue: returning TRUE for NeedsXEmbed.\n");
bool* bool_value = (bool*) value;
*bool_value = true;
}
@@ -624,7 +624,7 @@
break;
}
- PLUGIN_DEBUG_0ARG ("ITNP_GetValue return\n");
+ PLUGIN_DEBUG ("ITNP_GetValue return\n");
return np_error;
}
@@ -632,7 +632,7 @@
NPError
ITNP_Destroy (NPP instance, NPSavedData** save)
{
- PLUGIN_DEBUG_1ARG ("ITNP_Destroy %p\n", instance);
+ PLUGIN_DEBUG ("ITNP_Destroy %p\n", instance);
ITNPPluginData* data = (ITNPPluginData*) instance->pdata;
@@ -649,7 +649,7 @@
IcedTeaPluginUtilities::invalidateInstance(instance);
- PLUGIN_DEBUG_0ARG ("ITNP_Destroy return\n");
+ PLUGIN_DEBUG ("ITNP_Destroy return\n");
return NPERR_NO_ERROR;
}
@@ -657,7 +657,7 @@
NPError
ITNP_SetWindow (NPP instance, NPWindow* window)
{
- PLUGIN_DEBUG_0ARG ("ITNP_SetWindow\n");
+ PLUGIN_DEBUG ("ITNP_SetWindow\n");
if (instance == NULL)
{
@@ -679,7 +679,7 @@
// Simply return if we receive a NULL window.
if ((window == NULL) || (window->window == NULL))
{
- PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: got NULL window.\n");
+ PLUGIN_DEBUG ("ITNP_SetWindow: got NULL window.\n");
return NPERR_NO_ERROR;
}
@@ -690,7 +690,7 @@
if (data->window_handle == window->window)
{
// The parent window is the same as in previous calls.
- PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: window already exists.\n");
+ PLUGIN_DEBUG ("ITNP_SetWindow: window already exists.\n");
// Critical region. Read data->appletviewer_mutex and send
// a message to the appletviewer.
@@ -704,7 +704,7 @@
// SetWindow call.
if (window->width != data->window_width)
{
- PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: window width changed.\n");
+ PLUGIN_DEBUG ("ITNP_SetWindow: window width changed.\n");
// The width of the plugin window has changed.
// Store the new width.
@@ -714,7 +714,7 @@
if (window->height != data->window_height)
{
- PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: window height changed.\n");
+ PLUGIN_DEBUG ("ITNP_SetWindow: window height changed.\n");
// The height of the plugin window has changed.
// Store the new height.
@@ -736,7 +736,7 @@
else
{
// The appletviewer is not running.
- PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: appletviewer is not running.\n");
+ PLUGIN_DEBUG ("ITNP_SetWindow: appletviewer is not running.\n");
}
g_mutex_unlock (data->appletviewer_mutex);
@@ -745,12 +745,12 @@
{
// The parent window has changed. This branch does run but
// doing nothing in response seems to be sufficient.
- PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: parent window changed.\n");
+ PLUGIN_DEBUG ("ITNP_SetWindow: parent window changed.\n");
}
}
else
{
- PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: setting window.\n");
+ PLUGIN_DEBUG ("ITNP_SetWindow: setting window.\n");
// Critical region. Send messages to appletviewer.
g_mutex_lock (data->appletviewer_mutex);
@@ -774,7 +774,7 @@
data->window_handle = window->window;
}
- PLUGIN_DEBUG_0ARG ("ITNP_SetWindow return\n");
+ PLUGIN_DEBUG ("ITNP_SetWindow return\n");
return NPERR_NO_ERROR;
}
@@ -783,9 +783,9 @@
ITNP_NewStream (NPP instance, NPMIMEType type, NPStream* stream,
NPBool seekable, uint16_t* stype)
{
- PLUGIN_DEBUG_0ARG ("ITNP_NewStream\n");
-
- PLUGIN_DEBUG_0ARG ("ITNP_NewStream return\n");
+ PLUGIN_DEBUG ("ITNP_NewStream\n");
+
+ PLUGIN_DEBUG ("ITNP_NewStream return\n");
return NPERR_NO_ERROR;
}
@@ -793,17 +793,17 @@
void
ITNP_StreamAsFile (NPP instance, NPStream* stream, const char* filename)
{
- PLUGIN_DEBUG_0ARG ("ITNP_StreamAsFile\n");
-
- PLUGIN_DEBUG_0ARG ("ITNP_StreamAsFile return\n");
+ PLUGIN_DEBUG ("ITNP_StreamAsFile\n");
+
+ PLUGIN_DEBUG ("ITNP_StreamAsFile return\n");
}
NPError
ITNP_DestroyStream (NPP instance, NPStream* stream, NPReason reason)
{
- PLUGIN_DEBUG_0ARG ("ITNP_DestroyStream\n");
-
- PLUGIN_DEBUG_0ARG ("ITNP_DestroyStream return\n");
+ PLUGIN_DEBUG ("ITNP_DestroyStream\n");
+
+ PLUGIN_DEBUG ("ITNP_DestroyStream return\n");
return NPERR_NO_ERROR;
}
@@ -811,9 +811,9 @@
int32_t
ITNP_WriteReady (NPP instance, NPStream* stream)
{
- PLUGIN_DEBUG_0ARG ("ITNP_WriteReady\n");
-
- PLUGIN_DEBUG_0ARG ("ITNP_WriteReady return\n");
+ PLUGIN_DEBUG ("ITNP_WriteReady\n");
+
+ PLUGIN_DEBUG ("ITNP_WriteReady return\n");
return 0;
}
@@ -822,9 +822,9 @@
ITNP_Write (NPP instance, NPStream* stream, int32_t offset, int32_t len,
void* buffer)
{
- PLUGIN_DEBUG_0ARG ("ITNP_Write\n");
-
- PLUGIN_DEBUG_0ARG ("ITNP_Write return\n");
+ PLUGIN_DEBUG ("ITNP_Write\n");
+
+ PLUGIN_DEBUG ("ITNP_Write return\n");
return 0;
}
@@ -832,17 +832,17 @@
void
ITNP_Print (NPP instance, NPPrint* platformPrint)
{
- PLUGIN_DEBUG_0ARG ("ITNP_Print\n");
-
- PLUGIN_DEBUG_0ARG ("ITNP_Print return\n");
+ PLUGIN_DEBUG ("ITNP_Print\n");
+
+ PLUGIN_DEBUG ("ITNP_Print return\n");
}
int16_t
ITNP_HandleEvent (NPP instance, void* event)
{
- PLUGIN_DEBUG_0ARG ("ITNP_HandleEvent\n");
-
- PLUGIN_DEBUG_0ARG ("ITNP_HandleEvent return\n");
+ PLUGIN_DEBUG ("ITNP_HandleEvent\n");
+
+ PLUGIN_DEBUG ("ITNP_HandleEvent return\n");
return 0;
}
@@ -851,9 +851,9 @@
ITNP_URLNotify (NPP instance, const char* url, NPReason reason,
void* notifyData)
{
- PLUGIN_DEBUG_0ARG ("ITNP_URLNotify\n");
-
- PLUGIN_DEBUG_0ARG ("ITNP_URLNotify return\n");
+ PLUGIN_DEBUG ("ITNP_URLNotify\n");
+
+ PLUGIN_DEBUG ("ITNP_URLNotify return\n");
}
NPError
@@ -924,7 +924,7 @@
static void
plugin_data_new (ITNPPluginData** data)
{
- PLUGIN_DEBUG_0ARG ("plugin_data_new\n");
+ PLUGIN_DEBUG ("plugin_data_new\n");
*data = (ITNPPluginData*)
(*browser_functions.memalloc) (sizeof (struct ITNPPluginData));
@@ -933,7 +933,7 @@
if (*data)
memset (*data, 0, sizeof (struct ITNPPluginData));
- PLUGIN_DEBUG_0ARG ("plugin_data_new return\n");
+ PLUGIN_DEBUG ("plugin_data_new return\n");
}
@@ -948,7 +948,7 @@
static gchar*
plugin_get_documentbase (NPP instance)
{
- PLUGIN_DEBUG_0ARG ("plugin_get_documentbase\n");
+ PLUGIN_DEBUG ("plugin_get_documentbase\n");
nsIPluginInstance* xpcom_instance = NULL;
nsIPluginInstancePeer* peer = NULL;
@@ -1000,16 +1000,16 @@
NS_RELEASE (peer);
cleanup_done:
- PLUGIN_DEBUG_0ARG ("plugin_get_documentbase return\n");
-
- PLUGIN_DEBUG_1ARG("plugin_get_documentbase returning: %s\n", documentbase_copy);
+ PLUGIN_DEBUG ("plugin_get_documentbase return\n");
+
+ PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy);
return documentbase_copy;
}
#else
static gchar*
plugin_get_documentbase (NPP instance)
{
- PLUGIN_DEBUG_0ARG ("plugin_get_documentbase\n");
+ PLUGIN_DEBUG ("plugin_get_documentbase\n");
char const* documentbase = NULL;
gchar* documentbase_copy = NULL;
@@ -1021,30 +1021,26 @@
// Additionally, since it is insecure, we cannot use it for making
// security decisions.
NPObject* window;
- NPString script = NPString();
- std::string script_str = std::string();
- NPVariant* location = new NPVariant();
- std::string location_str = std::string();
-
browser_functions.getvalue(instance, NPNVWindowNPObject, &window);
- script_str += "window.location.href";
-#if MOZILLA_VERSION_COLLAPSED < 1090200
- script.utf8characters = script_str.c_str();
- script.utf8length = script_str.size();
-#else
- script.UTF8Characters = script_str.c_str();
- script.UTF8Length = script_str.size();
-#endif
- browser_functions.evaluate(instance, window, &script, location);
+
+ NPVariant location;
+ NPIdentifier location_id = browser_functions.getstringidentifier("location");
+ browser_functions.getproperty(instance, window, location_id, &location);
+
+ NPVariant href;
+ NPIdentifier href_id = browser_functions.getstringidentifier("href");
+ browser_functions.getproperty(instance, NPVARIANT_TO_OBJECT(location),
+ href_id, &href);
// Strip everything after the last "/"
#if MOZILLA_VERSION_COLLAPSED < 1090200
- gchar** parts = g_strsplit (NPVARIANT_TO_STRING(*location).utf8characters, "/", -1);
+ gchar** parts = g_strsplit (NPVARIANT_TO_STRING(href).utf8characters, "/", -1);
#else
- gchar** parts = g_strsplit (NPVARIANT_TO_STRING(*location).UTF8Characters, "/", -1);
+ gchar** parts = g_strsplit (NPVARIANT_TO_STRING(href).UTF8Characters, "/", -1);
#endif
guint parts_sz = g_strv_length (parts);
+ std::string location_str;
for (int i=0; i < parts_sz - 1; i++)
{
location_str += parts[i];
@@ -1054,9 +1050,11 @@
documentbase_copy = g_strdup (location_str.c_str());
// Release references.
+ browser_functions.releasevariantvalue(&href);
+ browser_functions.releasevariantvalue(&location);
cleanup_done:
- PLUGIN_DEBUG_0ARG ("plugin_get_documentbase return\n");
- PLUGIN_DEBUG_1ARG("plugin_get_documentbase returning: %s\n", documentbase_copy);
+ PLUGIN_DEBUG ("plugin_get_documentbase return\n");
+ PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy);
return documentbase_copy;
}
@@ -1069,7 +1067,7 @@
{
GtkWidget* dialog = NULL;
- PLUGIN_DEBUG_0ARG ("plugin_display_failure_dialog\n");
+ PLUGIN_DEBUG ("plugin_display_failure_dialog\n");
dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -1081,7 +1079,7 @@
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
- PLUGIN_DEBUG_0ARG ("plugin_display_failure_dialog return\n");
+ PLUGIN_DEBUG ("plugin_display_failure_dialog return\n");
}
@@ -1095,7 +1093,7 @@
GIOCondition condition,
gpointer plugin_data)
{
- PLUGIN_DEBUG_0ARG ("plugin_in_pipe_callback\n");
+ PLUGIN_DEBUG ("plugin_in_pipe_callback\n");
gboolean keep_installed = TRUE;
@@ -1130,18 +1128,18 @@
if (condition & (G_IO_ERR | G_IO_HUP))
{
- PLUGIN_DEBUG_0ARG ("appletviewer has stopped.\n");
+ PLUGIN_DEBUG ("appletviewer has stopped.\n");
keep_installed = FALSE;
}
- PLUGIN_DEBUG_0ARG ("plugin_in_pipe_callback return\n");
+ PLUGIN_DEBUG ("plugin_in_pipe_callback return\n");
return keep_installed;
}
void consume_message(gchar* message) {
- PLUGIN_DEBUG_1ARG (" PIPE: plugin read: %s\n", message);
+ PLUGIN_DEBUG (" PIPE: plugin read: %s\n", message);
if (g_str_has_prefix (message, "instance"))
{
@@ -1156,7 +1154,7 @@
if (instance_id > 0 && !instance)
{
- PLUGIN_DEBUG_2ARG("Instance %d is not active. Refusing to consume message \"%s\"\n", instance_id, message);
+ PLUGIN_DEBUG("Instance %d is not active. Refusing to consume message \"%s\"\n", instance_id, message);
return;
}
else if (instance)
@@ -1170,8 +1168,8 @@
gchar* decoded_url = (gchar*) calloc(strlen(parts[3]) + 1, sizeof(gchar));
IcedTeaPluginUtilities::decodeURL(parts[3], &decoded_url);
- PLUGIN_DEBUG_1ARG ("plugin_in_pipe_callback: opening URL %s\n", decoded_url);
- PLUGIN_DEBUG_1ARG ("plugin_in_pipe_callback: URL target %s\n", parts[4]);
+ PLUGIN_DEBUG ("plugin_in_pipe_callback: opening URL %s\n", decoded_url);
+ PLUGIN_DEBUG ("plugin_in_pipe_callback: URL target %s\n", parts[4]);
NPError np_error =
(*browser_functions.geturl) (data->owner, decoded_url, parts[4]);
@@ -1193,7 +1191,7 @@
// join the rest
gchar* status_message = g_strjoinv(" ", parts);
- PLUGIN_DEBUG_1ARG ("plugin_in_pipe_callback: setting status %s\n", status_message);
+ PLUGIN_DEBUG ("plugin_in_pipe_callback: setting status %s\n", status_message);
(*browser_functions.status) (data->owner, status_message);
g_free(status_message);
@@ -1229,7 +1227,7 @@
gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, sizeof(gchar));
IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
- PLUGIN_DEBUG_5ARG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], decoded_url);
+ PLUGIN_DEBUG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], decoded_url);
gchar* proxy_info;
@@ -1243,7 +1241,7 @@
proxy_info = g_strconcat (proxy_info, proxy, NULL);
}
- PLUGIN_DEBUG_1ARG("Proxy info: %s\n", proxy_info);
+ PLUGIN_DEBUG("Proxy info: %s\n", proxy_info);
plugin_send_message_to_appletviewer(proxy_info);
g_free(decoded_url);
@@ -1269,7 +1267,7 @@
cookie_info = g_strconcat (cookie_info, cookie_string, NULL);
}
- PLUGIN_DEBUG_1ARG("Cookie info: %s\n", cookie_info);
+ PLUGIN_DEBUG("Cookie info: %s\n", cookie_info);
plugin_send_message_to_appletviewer(cookie_info);
g_free(decoded_url);
@@ -1294,7 +1292,7 @@
{
int id = GPOINTER_TO_INT(g_hash_table_lookup(instance_to_id_map,
instance));
- PLUGIN_DEBUG_2ARG("Returning id %d for instance %p\n", id, instance);
+ PLUGIN_DEBUG("Returning id %d for instance %p\n", id, instance);
return id;
}
@@ -1329,7 +1327,7 @@
// if there is no proxy found, return immediately
if (!info) {
- PLUGIN_DEBUG_1ARG("%s does not need a proxy\n", siteAddr);
+ PLUGIN_DEBUG("%s does not need a proxy\n", siteAddr);
return NPERR_GENERIC_ERROR;
}
@@ -1367,7 +1365,7 @@
*len = strlen(*proxy);
- PLUGIN_DEBUG_2ARG("Proxy info for %s: %s\n", siteAddr, *proxy);
+ PLUGIN_DEBUG("Proxy info for %s: %s\n", siteAddr, *proxy);
#else
@@ -1400,13 +1398,13 @@
GIOCondition condition,
gpointer plugin_data)
{
- PLUGIN_DEBUG_0ARG ("plugin_out_pipe_callback\n");
+ PLUGIN_DEBUG ("plugin_out_pipe_callback\n");
ITNPPluginData* data = (ITNPPluginData*) plugin_data;
- PLUGIN_DEBUG_0ARG ("plugin_out_pipe_callback: appletviewer has stopped.\n");
-
- PLUGIN_DEBUG_0ARG ("plugin_out_pipe_callback return\n");
+ PLUGIN_DEBUG ("plugin_out_pipe_callback: appletviewer has stopped.\n");
+
+ PLUGIN_DEBUG ("plugin_out_pipe_callback return\n");
return FALSE;
}
@@ -1449,12 +1447,12 @@
if (path_new == NULL || strlen (path_new) == 0)
{
- PLUGIN_DEBUG_0ARG("Unset LD_LIBRARY_PATH\n");
+ PLUGIN_DEBUG("Unset LD_LIBRARY_PATH\n");
return NULL;
}
else
{
- PLUGIN_DEBUG_1ARG ("Set LD_LIBRARY_PATH: %s\n", path_new);
+ PLUGIN_DEBUG ("Set LD_LIBRARY_PATH: %s\n", path_new);
return path_new;
}
}
@@ -1464,7 +1462,7 @@
plugin_filter_environment(void)
{
gchar **var_names = g_listenv();
- gchar **new_env = (gchar**) malloc(sizeof(gchar*) * g_strv_length (var_names));
+ gchar **new_env = (gchar**) malloc(sizeof(gchar*) * (g_strv_length (var_names) + 1));
int i_var, i_env;
for (i_var = 0, i_env = 0; var_names[i_var] != NULL; i_var++)
@@ -1486,7 +1484,7 @@
static NPError
plugin_test_appletviewer ()
{
- PLUGIN_DEBUG_1ARG ("plugin_test_appletviewer: %s\n", appletviewer_executable);
+ PLUGIN_DEBUG ("plugin_test_appletviewer: %s\n", appletviewer_executable);
NPError error = NPERR_NO_ERROR;
gchar* command_line[3] = { NULL, NULL, NULL };
@@ -1523,14 +1521,14 @@
g_free (command_line[2]);
command_line[2] = NULL;
- PLUGIN_DEBUG_0ARG ("plugin_test_appletviewer return\n");
+ PLUGIN_DEBUG ("plugin_test_appletviewer return\n");
return error;
}
static NPError
plugin_start_appletviewer (ITNPPluginData* data)
{
- PLUGIN_DEBUG_0ARG ("plugin_start_appletviewer\n");
+ PLUGIN_DEBUG ("plugin_start_appletviewer\n");
NPError error = NPERR_NO_ERROR;
gchar** command_line;
@@ -1599,12 +1597,12 @@
if (appletviewer_pid)
{
- PLUGIN_DEBUG_1ARG("Initialized VM with pid=%d\n", appletviewer_pid);
+ PLUGIN_DEBUG("Initialized VM with pid=%d\n", appletviewer_pid);
appletviewer_watch_id = g_child_watch_add(appletviewer_pid, (GChildWatchFunc) appletviewer_monitor, (gpointer) appletviewer_pid);
}
- PLUGIN_DEBUG_0ARG ("plugin_start_appletviewer return\n");
+ PLUGIN_DEBUG ("plugin_start_appletviewer return\n");
return error;
}
@@ -1613,7 +1611,7 @@
static gchar*
plugin_create_applet_tag (int16_t argc, char* argn[], char* argv[])
{
- PLUGIN_DEBUG_0ARG ("plugin_create_applet_tag\n");
+ PLUGIN_DEBUG ("plugin_create_applet_tag\n");
gchar* applet_tag = g_strdup ("<EMBED ");
gchar* parameters = g_strdup ("");
@@ -1712,7 +1710,7 @@
g_free (parameters);
parameters = NULL;
- PLUGIN_DEBUG_0ARG ("plugin_create_applet_tag return\n");
+ PLUGIN_DEBUG ("plugin_create_applet_tag return\n");
return applet_tag;
}
@@ -1722,7 +1720,7 @@
void
plugin_send_message_to_appletviewer (gchar const* message)
{
- PLUGIN_DEBUG_0ARG ("plugin_send_message_to_appletviewer\n");
+ PLUGIN_DEBUG ("plugin_send_message_to_appletviewer\n");
if (jvm_up)
{
@@ -1767,10 +1765,10 @@
g_free (newline_message);
newline_message = NULL;
- PLUGIN_DEBUG_1ARG (" PIPE: plugin wrote: %s\n", message);
+ PLUGIN_DEBUG (" PIPE: plugin wrote: %s\n", message);
}
- PLUGIN_DEBUG_0ARG ("plugin_send_message_to_appletviewer return\n");
+ PLUGIN_DEBUG ("plugin_send_message_to_appletviewer return\n");
}
// Stop the appletviewer process. When this is called the
@@ -1789,7 +1787,7 @@
static void
plugin_stop_appletviewer ()
{
- PLUGIN_DEBUG_0ARG ("plugin_stop_appletviewer\n");
+ PLUGIN_DEBUG ("plugin_stop_appletviewer\n");
if (jvm_up)
{
@@ -1865,21 +1863,21 @@
jvm_up = FALSE;
sleep(2); /* Needed to prevent crashes during debug (when JDWP port is not freed by the kernel right away) */
- PLUGIN_DEBUG_0ARG ("plugin_stop_appletviewer return\n");
+ PLUGIN_DEBUG ("plugin_stop_appletviewer return\n");
}
static void appletviewer_monitor(GPid pid, gint status, gpointer data)
{
- PLUGIN_DEBUG_0ARG ("appletviewer_monitor\n");
+ PLUGIN_DEBUG ("appletviewer_monitor\n");
jvm_up = FALSE;
pid = -1;
- PLUGIN_DEBUG_0ARG ("appletviewer_monitor return\n");
+ PLUGIN_DEBUG ("appletviewer_monitor return\n");
}
static void
plugin_data_destroy (NPP instance)
{
- PLUGIN_DEBUG_0ARG ("plugin_data_destroy\n");
+ PLUGIN_DEBUG ("plugin_data_destroy\n");
ITNPPluginData* tofree = (ITNPPluginData*) instance->pdata;
@@ -1914,7 +1912,7 @@
(*browser_functions.memfree) (tofree);
tofree = NULL;
- PLUGIN_DEBUG_0ARG ("plugin_data_destroy return\n");
+ PLUGIN_DEBUG ("plugin_data_destroy return\n");
}
// FACTORY FUNCTIONS
@@ -1931,7 +1929,7 @@
NPError
NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable)
{
- PLUGIN_DEBUG_0ARG ("NP_Initialize\n");
+ PLUGIN_DEBUG ("NP_Initialize\n");
if (initialized)
return NPERR_NO_ERROR;
@@ -2145,7 +2143,7 @@
appletviewer_executable = g_strdup_printf ("%s/../../bin/java",
dirname (filename));
- PLUGIN_DEBUG_4ARG(".so is located at: %s and the link points to: %s. Executing java from dir %s to run %s\n", info.dli_fname, filename, dirname (filename), appletviewer_executable);
+ PLUGIN_DEBUG(".so is located at: %s and the link points to: %s. Executing java from dir %s to run %s\n", info.dli_fname, filename, dirname (filename), appletviewer_executable);
if (!appletviewer_executable)
{
PLUGIN_ERROR ("Failed to create appletviewer executable name.");
@@ -2169,9 +2167,9 @@
plugin_instance_mutex = g_mutex_new ();
- PLUGIN_DEBUG_1ARG ("NP_Initialize: using %s\n", appletviewer_executable);
-
- PLUGIN_DEBUG_0ARG ("NP_Initialize return\n");
+ PLUGIN_DEBUG ("NP_Initialize: using %s\n", appletviewer_executable);
+
+ PLUGIN_DEBUG ("NP_Initialize return\n");
plugin_req_proc = new PluginRequestProcessor();
java_req_proc = new JavaMessageSender();
@@ -2218,9 +2216,9 @@
char*
NP_GetMIMEDescription ()
{
- PLUGIN_DEBUG_0ARG ("NP_GetMIMEDescription\n");
-
- PLUGIN_DEBUG_0ARG ("NP_GetMIMEDescription return\n");
+ PLUGIN_DEBUG ("NP_GetMIMEDescription\n");
+
+ PLUGIN_DEBUG ("NP_GetMIMEDescription return\n");
return (char*) PLUGIN_MIME_DESC;
}
@@ -2230,7 +2228,7 @@
NPError
NP_GetValue (void* future, NPPVariable variable, void* value)
{
- PLUGIN_DEBUG_0ARG ("NP_GetValue\n");
+ PLUGIN_DEBUG ("NP_GetValue\n");
NPError result = NPERR_NO_ERROR;
gchar** char_value = (gchar**) value;
@@ -2238,12 +2236,12 @@
switch (variable)
{
case NPPVpluginNameString:
- PLUGIN_DEBUG_0ARG ("NP_GetValue: returning plugin name.\n");
+ PLUGIN_DEBUG ("NP_GetValue: returning plugin name.\n");
*char_value = g_strdup (PLUGIN_NAME);
break;
case NPPVpluginDescriptionString:
- PLUGIN_DEBUG_0ARG ("NP_GetValue: returning plugin description.\n");
+ PLUGIN_DEBUG ("NP_GetValue: returning plugin description.\n");
*char_value = g_strdup (PLUGIN_DESC);
break;
@@ -2253,7 +2251,7 @@
break;
}
- PLUGIN_DEBUG_0ARG ("NP_GetValue return\n");
+ PLUGIN_DEBUG ("NP_GetValue return\n");
return result;
}
@@ -2263,7 +2261,7 @@
NPError
NP_Shutdown (void)
{
- PLUGIN_DEBUG_0ARG ("NP_Shutdown\n");
+ PLUGIN_DEBUG ("NP_Shutdown\n");
// Free mutex.
if (plugin_instance_mutex)
@@ -2312,9 +2310,9 @@
// cleanup_out_pipe:
// Delete output pipe.
- PLUGIN_DEBUG_1ARG ("NP_Shutdown: deleting output fifo: %s\n", out_pipe_name);
+ PLUGIN_DEBUG ("NP_Shutdown: deleting output fifo: %s\n", out_pipe_name);
unlink (out_pipe_name);
- PLUGIN_DEBUG_1ARG ("NP_Shutdown: deleted output fifo: %s\n", out_pipe_name);
+ PLUGIN_DEBUG ("NP_Shutdown: deleted output fifo: %s\n", out_pipe_name);
// cleanup_out_pipe_name:
g_free (out_pipe_name);
@@ -2322,9 +2320,9 @@
// cleanup_in_pipe:
// Delete input pipe.
- PLUGIN_DEBUG_1ARG ("NP_Shutdown: deleting input fifo: %s\n", in_pipe_name);
+ PLUGIN_DEBUG ("NP_Shutdown: deleting input fifo: %s\n", in_pipe_name);
unlink (in_pipe_name);
- PLUGIN_DEBUG_1ARG ("NP_Shutdown: deleted input fifo: %s\n", in_pipe_name);
+ PLUGIN_DEBUG ("NP_Shutdown: deleted input fifo: %s\n", in_pipe_name);
// cleanup_in_pipe_name:
g_free (in_pipe_name);
@@ -2347,7 +2345,7 @@
delete plugin_to_java_bus;
//delete internal_bus;
- PLUGIN_DEBUG_0ARG ("NP_Shutdown return\n");
+ PLUGIN_DEBUG ("NP_Shutdown return\n");
return NPERR_NO_ERROR;
}
@@ -2415,6 +2413,6 @@
NPObject*
allocate_scriptable_object(NPP npp, NPClass *aClass)
{
- PLUGIN_DEBUG_0ARG("Allocating new scriptable object\n");
+ PLUGIN_DEBUG("Allocating new scriptable object\n");
return new IcedTeaScriptablePluginObject(npp);
}
diff -r a0120629678b plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
--- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc Wed Apr 14 12:21:03 2010 +0200
+++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc Fri Jul 16 14:30:37 2010 +0200
@@ -73,7 +73,7 @@
PluginRequestProcessor::~PluginRequestProcessor()
{
- PLUGIN_DEBUG_0ARG("PluginRequestProcessor::~PluginRequestProcessor\n");
+ PLUGIN_DEBUG("PluginRequestProcessor::~PluginRequestProcessor\n");
if (pendingRequests)
delete pendingRequests;
@@ -89,7 +89,7 @@
bool
PluginRequestProcessor::newMessageOnBus(const char* message)
{
- PLUGIN_DEBUG_1ARG("PluginRequestProcessor processing %s\n", message);
+ PLUGIN_DEBUG("PluginRequestProcessor processing %s\n", message);
std::string* type;
std::string* command;
@@ -169,7 +169,7 @@
get_instance_from_id(id, instance);
browser_functions.getvalue(instance, NPNVWindowNPObject, &window_ptr);
- PLUGIN_DEBUG_3ARG("ID=%d, Instance=%p, WindowPTR = %p\n", id, instance, window_ptr);
+ PLUGIN_DEBUG("ID=%d, Instance=%p, WindowPTR = %p\n", id, instance, window_ptr);
OBJECT_TO_NPVARIANT(window_ptr, *variant);
browser_functions.retainobject(window_ptr);
@@ -592,7 +592,7 @@
}
#endif
- PLUGIN_DEBUG_1ARG("Member PTR after internal request: %s\n", thread_data.result.c_str());
+ PLUGIN_DEBUG("Member PTR after internal request: %s\n", thread_data.result.c_str());
java_result = java_request.findClass(0, "netscape.javascript.JSObject");
@@ -711,7 +711,7 @@
std::string command;
pthread_mutex_t wait_mutex = PTHREAD_MUTEX_INITIALIZER; // This is needed for API compat. and is unused
- PLUGIN_DEBUG_1ARG("Queue processor initialized. Queue = %p\n", message_queue);
+ PLUGIN_DEBUG("Queue processor initialized. Queue = %p\n", message_queue);
while (true)
{
@@ -787,7 +787,7 @@
message_parts = NULL;
}
- PLUGIN_DEBUG_0ARG("Queue processing stopped.\n");
+ PLUGIN_DEBUG("Queue processing stopped.\n");
}
/******************************************
@@ -810,7 +810,7 @@
property = (NPIdentifier*) parameters.at(2);
value = (std::string*) parameters.at(3);
- PLUGIN_DEBUG_4ARG("Setting %s on instance %p, object %p to value %s\n", browser_functions.utf8fromidentifier(*property), instance, member, value->c_str());
+ PLUGIN_DEBUG("Setting %s on instance %p, object %p to value %s\n", browser_functions.utf8fromidentifier(*property), instance, member, value->c_str());
IcedTeaPluginUtilities::javaResultToNPVariant(instance, value, &value_variant);
@@ -834,7 +834,7 @@
NPIdentifier* member_identifier = (NPIdentifier*) parameters.at(2);
// Get the NPVariant corresponding to this member
- PLUGIN_DEBUG_4ARG("Looking for %p %p %p (%s)\n", instance, parent_ptr, member_identifier, browser_functions.utf8fromidentifier(*member_identifier));
+ PLUGIN_DEBUG("Looking for %p %p %p (%s)\n", instance, parent_ptr, member_identifier, browser_functions.utf8fromidentifier(*member_identifier));
if (!browser_functions.hasproperty(instance, parent_ptr, *member_identifier))
{
@@ -854,7 +854,7 @@
// store member -> instance link
IcedTeaPluginUtilities::storeInstanceID(member_ptr, instance);
- PLUGIN_DEBUG_0ARG("_getMember returning.\n");
+ PLUGIN_DEBUG("_getMember returning.\n");
}
void
@@ -868,7 +868,7 @@
NPVariant* eval_result = new NPVariant();
std::string eval_result_ptr_str = std::string();
- PLUGIN_DEBUG_0ARG("_eval called\n");
+ PLUGIN_DEBUG("_eval called\n");
std::vector<void*>* call_data = (std::vector<void*>*) data;
@@ -880,12 +880,12 @@
script.utf8characters = script_str->c_str();
script.utf8length = script_str->size();
- PLUGIN_DEBUG_1ARG("Evaluating: %s\n", script.utf8characters);
+ PLUGIN_DEBUG("Evaluating: %s\n", script.utf8characters);
#else
script.UTF8Characters = script_str->c_str();
script.UTF8Length = script_str->size();
- PLUGIN_DEBUG_1ARG("Evaluating: %s\n", script.UTF8Characters);
+ PLUGIN_DEBUG("Evaluating: %s\n", script.UTF8Characters);
#endif
((AsyncCallThreadData*) data)->call_successful = browser_functions.evaluate(instance, window_ptr, &script, eval_result);
@@ -898,7 +898,7 @@
}
((AsyncCallThreadData*) data)->result_ready = true;
- PLUGIN_DEBUG_0ARG("_eval returning\n");
+ PLUGIN_DEBUG("_eval returning\n");
}
@@ -914,7 +914,7 @@
NPVariant* call_result = new NPVariant();
std::string call_result_ptr_str = std::string();
- PLUGIN_DEBUG_0ARG("_call called\n");
+ PLUGIN_DEBUG("_call called\n");
std::vector<void*>* call_data = (std::vector<void*>*) data;
@@ -930,7 +930,9 @@
IcedTeaPluginUtilities::printNPVariant(args[i]);
}
+ PLUGIN_DEBUG("_calling\n");
((AsyncCallThreadData*) data)->call_successful = browser_functions.invoke(instance, window_ptr, function, args, *arg_count, call_result);
+ PLUGIN_DEBUG("_called\n");
IcedTeaPluginUtilities::printNPVariant(*call_result);
@@ -942,7 +944,7 @@
((AsyncCallThreadData*) data)->result_ready = true;
- PLUGIN_DEBUG_0ARG("_call returning\n");
+ PLUGIN_DEBUG("_call returning\n");
}
void
@@ -958,7 +960,7 @@
instance = (NPP) call_data->at(0);
NPVariant* variant = (NPVariant*) call_data->at(1);
- PLUGIN_DEBUG_2ARG("_getString called with %p and %p\n", instance, variant);
+ PLUGIN_DEBUG("_getString called with %p and %p\n", instance, variant);
if (NPVARIANT_IS_OBJECT(*variant))
{
@@ -972,7 +974,7 @@
((AsyncCallThreadData*) data)->call_successful = true;
}
- PLUGIN_DEBUG_0ARG("ToString result: ");
+ PLUGIN_DEBUG("ToString result: ");
IcedTeaPluginUtilities::printNPVariant(tostring_result);
if (((AsyncCallThreadData*) data)->call_successful)
@@ -981,6 +983,6 @@
}
((AsyncCallThreadData*) data)->result_ready = true;
- PLUGIN_DEBUG_0ARG("_getString returning\n");
+ PLUGIN_DEBUG("_getString returning\n");
}
diff -r a0120629678b plugin/icedteanp/IcedTeaPluginUtils.cc
--- a/plugin/icedteanp/IcedTeaPluginUtils.cc Wed Apr 14 12:21:03 2010 +0200
+++ b/plugin/icedteanp/IcedTeaPluginUtils.cc Fri Jul 16 14:30:37 2010 +0200
@@ -157,7 +157,7 @@
result->append(id_str);
- PLUGIN_DEBUG_2ARG("Converting pointer %p to %s\n", id, id_str);
+ PLUGIN_DEBUG("Converting pointer %p to %s\n", id, id_str);
free(id_str);
}
@@ -174,15 +174,15 @@
void* ptr;
if (sizeof(void*) == sizeof(long long))
{
- PLUGIN_DEBUG_2ARG("Casting (long long) \"%s\" -- %llu\n", id_str.c_str(), strtoull(id_str.c_str(), NULL, 0));
+ PLUGIN_DEBUG("Casting (long long) \"%s\" -- %llu\n", id_str.c_str(), strtoull(id_str.c_str(), NULL, 0));
ptr = reinterpret_cast <void*> ((unsigned long long) strtoull(id_str.c_str(), NULL, 0));
} else
{
- PLUGIN_DEBUG_2ARG("Casting (long) \"%s\" -- %lu\n", id_str.c_str(), strtoul(id_str.c_str(), NULL, 0));
+ PLUGIN_DEBUG("Casting (long) \"%s\" -- %lu\n", id_str.c_str(), strtoul(id_str.c_str(), NULL, 0));
ptr = reinterpret_cast <void*> ((unsigned long) strtoul(id_str.c_str(), NULL, 0));
}
- PLUGIN_DEBUG_1ARG("Casted: %p\n", ptr);
+ PLUGIN_DEBUG("Casted: %p\n", ptr);
return ptr;
}
@@ -200,15 +200,15 @@
void* ptr;
if (sizeof(void*) == sizeof(long long))
{
- PLUGIN_DEBUG_2ARG("Casting (long long) \"%s\" -- %llu\n", id_str->c_str(), strtoull(id_str->c_str(), NULL, 0));
+ PLUGIN_DEBUG("Casting (long long) \"%s\" -- %llu\n", id_str->c_str(), strtoull(id_str->c_str(), NULL, 0));
ptr = reinterpret_cast <void*> ((unsigned long long) strtoull(id_str->c_str(), NULL, 0));
} else
{
- PLUGIN_DEBUG_2ARG("Casting (long) \"%s\" -- %lu\n", id_str->c_str(), strtoul(id_str->c_str(), NULL, 0));
+ PLUGIN_DEBUG("Casting (long) \"%s\" -- %lu\n", id_str->c_str(), strtoul(id_str->c_str(), NULL, 0));
ptr = reinterpret_cast <void*> ((unsigned long) strtoul(id_str->c_str(), NULL, 0));
}
- PLUGIN_DEBUG_1ARG("Casted: %p\n", ptr);
+ PLUGIN_DEBUG("Casted: %p\n", ptr);
return ptr;
}
@@ -344,7 +344,7 @@
for (int i = begin; i < begin+length; i++)
result_unicode_str->push_back((char) strtol(unicode_byte_array->at(i)->c_str(), NULL, 16));
- PLUGIN_DEBUG_2ARG("Converted UTF-8 string: %s. Length=%d\n", result_unicode_str->c_str(), result_unicode_str->length());
+ PLUGIN_DEBUG("Converted UTF-8 string: %s. Length=%d\n", result_unicode_str->c_str(), result_unicode_str->length());
}
/**
@@ -381,7 +381,7 @@
*utf_str = ostream.str();
free(hex_value);
- PLUGIN_DEBUG_2ARG("Converted %s to UTF-8 string %s\n", str->c_str(), utf_str->c_str());
+ PLUGIN_DEBUG("Converted %s to UTF-8 string %s\n", str->c_str(), utf_str->c_str());
}
/**
@@ -451,7 +451,7 @@
*str += " }";
- PLUGIN_DEBUG_2ARG("%s %s\n", prefix, str->c_str());
+ PLUGIN_DEBUG("%s %s\n", prefix, str->c_str());
delete str;
}
@@ -483,7 +483,7 @@
void
IcedTeaPluginUtilities::storeInstanceID(void* member_ptr, NPP instance)
{
- PLUGIN_DEBUG_2ARG("Storing instance %p with key %p\n", instance, member_ptr);
+ PLUGIN_DEBUG("Storing instance %p with key %p\n", instance, member_ptr);
instance_map->insert(std::make_pair(member_ptr, instance));
}
@@ -496,7 +496,7 @@
void
IcedTeaPluginUtilities::removeInstanceID(void* member_ptr)
{
- PLUGIN_DEBUG_1ARG("Removing key %p from instance map\n", member_ptr);
+ PLUGIN_DEBUG("Removing key %p from instance map\n", member_ptr);
instance_map->erase(member_ptr);
}
@@ -506,7 +506,7 @@
void
IcedTeaPluginUtilities::invalidateInstance(NPP instance)
{
- PLUGIN_DEBUG_1ARG("Invalidating instance %p\n", instance);
+ PLUGIN_DEBUG("Invalidating instance %p\n", instance);
std::map<void*,NPP>::iterator iterator;
@@ -531,14 +531,14 @@
{
NPP instance = NULL;
- PLUGIN_DEBUG_1ARG("getInstanceFromMemberPtr looking for %p\n", member_ptr);
+ PLUGIN_DEBUG("getInstanceFromMemberPtr looking for %p\n", member_ptr);
std::map<void*, NPP>::iterator iterator = instance_map->find(member_ptr);
if (iterator != instance_map->end())
{
instance = instance_map->find(member_ptr)->second;
- PLUGIN_DEBUG_2ARG("getInstanceFromMemberPtr found %p. Instance = %p\n", member_ptr, instance);
+ PLUGIN_DEBUG("getInstanceFromMemberPtr found %p. Instance = %p\n", member_ptr, instance);
}
return instance;
@@ -556,7 +556,7 @@
{
NPObject* object = NULL;
- PLUGIN_DEBUG_1ARG("getNPObjectFromJavaKey looking for %s\n", key.c_str());
+ PLUGIN_DEBUG("getNPObjectFromJavaKey looking for %s\n", key.c_str());
std::map<std::string, NPObject*>::iterator iterator = object_map->find(key);
@@ -567,7 +567,7 @@
if (getInstanceFromMemberPtr(mapped_object) != NULL)
{
object = mapped_object;
- PLUGIN_DEBUG_2ARG("getNPObjectFromJavaKey found %s. NPObject = %p\n", key.c_str(), object);
+ PLUGIN_DEBUG("getNPObjectFromJavaKey found %s. NPObject = %p\n", key.c_str(), object);
}
}
@@ -584,7 +584,7 @@
void
IcedTeaPluginUtilities::storeObjectMapping(std::string key, NPObject* object)
{
- PLUGIN_DEBUG_2ARG("Storing object %p with key %s\n", object, key.c_str());
+ PLUGIN_DEBUG("Storing object %p with key %s\n", object, key.c_str());
object_map->insert(std::make_pair(key, object));
}
@@ -597,7 +597,7 @@
void
IcedTeaPluginUtilities::removeObjectMapping(std::string key)
{
- PLUGIN_DEBUG_1ARG("Removing key %s from object map\n", key.c_str());
+ PLUGIN_DEBUG("Removing key %s from object map\n", key.c_str());
object_map->erase(key);
}
@@ -627,7 +627,7 @@
*str += " }";
- PLUGIN_DEBUG_2ARG("%s %s\n", prefix, str->c_str());
+ PLUGIN_DEBUG("%s %s\n", prefix, str->c_str());
delete str;
}
@@ -641,35 +641,35 @@
if (NPVARIANT_IS_VOID(variant))
{
- PLUGIN_DEBUG_1ARG("VOID %d\n", variant);
+ PLUGIN_DEBUG("VOID %d\n", variant);
}
else if (NPVARIANT_IS_NULL(variant))
{
- PLUGIN_DEBUG_1ARG("NULL\n", variant);
+ PLUGIN_DEBUG("NULL\n", variant);
}
else if (NPVARIANT_IS_BOOLEAN(variant))
{
- PLUGIN_DEBUG_1ARG("BOOL: %d\n", NPVARIANT_TO_BOOLEAN(variant));
+ PLUGIN_DEBUG("BOOL: %d\n", NPVARIANT_TO_BOOLEAN(variant));
}
else if (NPVARIANT_IS_INT32(variant))
{
- PLUGIN_DEBUG_1ARG("INT32: %d\n", NPVARIANT_TO_INT32(variant));
+ PLUGIN_DEBUG("INT32: %d\n", NPVARIANT_TO_INT32(variant));
}
else if (NPVARIANT_IS_DOUBLE(variant))
{
- PLUGIN_DEBUG_1ARG("DOUBLE: %f\n", NPVARIANT_TO_DOUBLE(variant));
+ PLUGIN_DEBUG("DOUBLE: %f\n", NPVARIANT_TO_DOUBLE(variant));
}
else if (NPVARIANT_IS_STRING(variant))
{
#if MOZILLA_VERSION_COLLAPSED < 1090200
- PLUGIN_DEBUG_1ARG("STRING: %s\n", NPVARIANT_TO_STRING(variant).utf8characters);
+ PLUGIN_DEBUG("STRING: %s\n", NPVARIANT_TO_STRING(variant).utf8characters);
#else
- PLUGIN_DEBUG_1ARG("STRING: %s\n", NPVARIANT_TO_STRING(variant).UTF8Characters);
+ PLUGIN_DEBUG("STRING: %s\n", NPVARIANT_TO_STRING(variant).UTF8Characters);
#endif
}
else
{
- PLUGIN_DEBUG_1ARG("OBJ: %p\n", NPVARIANT_TO_OBJECT(variant));
+ PLUGIN_DEBUG("OBJ: %p\n", NPVARIANT_TO_OBJECT(variant));
}
}
@@ -738,19 +738,19 @@
if (value == "void")
{
- PLUGIN_DEBUG_0ARG("Method call returned void\n");
+ PLUGIN_DEBUG("Method call returned void\n");
VOID_TO_NPVARIANT(*variant);
} else if (value == "null")
{
- PLUGIN_DEBUG_0ARG("Method call returned null\n");
+ PLUGIN_DEBUG("Method call returned null\n");
NULL_TO_NPVARIANT(*variant);
}else if (value == "true")
{
- PLUGIN_DEBUG_0ARG("Method call returned a boolean (true)\n");
+ PLUGIN_DEBUG("Method call returned a boolean (true)\n");
BOOLEAN_TO_NPVARIANT(true, *variant);
} else if (value == "false")
{
- PLUGIN_DEBUG_0ARG("Method call returned a boolean (false)\n");
+ PLUGIN_DEBUG("Method call returned a boolean (false)\n");
BOOLEAN_TO_NPVARIANT(false, *variant);
} else
{
@@ -761,12 +761,12 @@
d < -(0x7fffffffL - 1L) ||
d > 0x7fffffffL)
{
- PLUGIN_DEBUG_1ARG("Method call returned a double %f\n", d);
+ PLUGIN_DEBUG("Method call returned a double %f\n", d);
DOUBLE_TO_NPVARIANT(d, *variant);
} else
{
int32_t i = (int32_t) d;
- PLUGIN_DEBUG_1ARG("Method call returned an int %d\n", i);
+ PLUGIN_DEBUG("Method call returned an int %d\n", i);
INT32_TO_NPVARIANT(i, *variant);
}
}
@@ -803,7 +803,7 @@
NPUTF8* return_str = (NPUTF8*) malloc(sizeof(NPUTF8)*java_result->return_string->size() + 1);
strcpy(return_str, java_result->return_string->c_str());
- PLUGIN_DEBUG_1ARG("Method call returned a string: \"%s\"\n", return_str);
+ PLUGIN_DEBUG("Method call returned a string: \"%s\"\n", return_str);
STRINGZ_TO_NPVARIANT(return_str, *variant);
} else {
@@ -865,7 +865,7 @@
constructor_name.append(NPVARIANT_TO_STRING(constructor_str).UTF8Characters);
#endif
- PLUGIN_DEBUG_1ARG("Constructor for NPObject is %s\n", constructor_name.c_str());
+ PLUGIN_DEBUG("Constructor for NPObject is %s\n", constructor_name.c_str());
return constructor_name.find("function Array") == 0;
}
@@ -874,7 +874,7 @@
IcedTeaPluginUtilities::decodeURL(const gchar* url, gchar** decoded_url)
{
- PLUGIN_DEBUG_2ARG("GOT URL: %s -- %s\n", url, *decoded_url);
+ PLUGIN_DEBUG("GOT URL: %s -- %s\n", url, *decoded_url);
int length = strlen(url);
for (int i=0; i < length; i++)
{
@@ -903,7 +903,7 @@
}
}
- PLUGIN_DEBUG_1ARG("SENDING URL: %s\n", *decoded_url);
+ PLUGIN_DEBUG("SENDING URL: %s\n", *decoded_url);
}
/******************************************
@@ -951,13 +951,13 @@
ret = pthread_mutex_init(&subscriber_mutex, NULL);
if(ret)
- PLUGIN_DEBUG_1ARG("Error: Unable to initialize subscriber mutex: %d\n", ret);
+ PLUGIN_DEBUG("Error: Unable to initialize subscriber mutex: %d\n", ret);
ret = pthread_mutex_init(&msg_queue_mutex, NULL);
if(ret)
- PLUGIN_DEBUG_1ARG("Error: Unable to initialize message queue mutex: %d\n", ret);
+ PLUGIN_DEBUG("Error: Unable to initialize message queue mutex: %d\n", ret);
- PLUGIN_DEBUG_2ARG("Mutexs %p and %p initialized\n", &subscriber_mutex, &msg_queue_mutex);
+ PLUGIN_DEBUG("Mutexs %p and %p initialized\n", &subscriber_mutex, &msg_queue_mutex);
}
/**
@@ -968,17 +968,17 @@
MessageBus::~MessageBus()
{
- PLUGIN_DEBUG_0ARG("MessageBus::~MessageBus\n");
+ PLUGIN_DEBUG("MessageBus::~MessageBus\n");
int ret;
ret = pthread_mutex_destroy(&subscriber_mutex);
if(ret)
- PLUGIN_DEBUG_1ARG("Error: Unable to destroy subscriber mutex: %d\n", ret);
+ PLUGIN_DEBUG("Error: Unable to destroy subscriber mutex: %d\n", ret);
ret = pthread_mutex_destroy(&msg_queue_mutex);
if(ret)
- PLUGIN_DEBUG_1ARG("Error: Unable to destroy message queue mutex: %d\n", ret);
+ PLUGIN_DEBUG("Error: Unable to destroy message queue mutex: %d\n", ret);
}
/**
@@ -991,7 +991,7 @@
{
// Applets may initialize in parallel. So lock before pushing.
- PLUGIN_DEBUG_2ARG("Subscribing %p to bus %p\n", b, this);
+ PLUGIN_DEBUG("Subscribing %p to bus %p\n", b, this);
pthread_mutex_lock(&subscriber_mutex);
subscribers.push_back(b);
pthread_mutex_unlock(&subscriber_mutex);
@@ -1007,7 +1007,7 @@
{
// Applets may initialize in parallel. So lock before pushing.
- PLUGIN_DEBUG_2ARG("Un-subscribing %p from bus %p\n", b, this);
+ PLUGIN_DEBUG("Un-subscribing %p from bus %p\n", b, this);
pthread_mutex_lock(&subscriber_mutex);
subscribers.remove(b);
pthread_mutex_unlock(&subscriber_mutex);
@@ -1027,21 +1027,21 @@
// consumer frees this memory
strcpy(msg, message);
- PLUGIN_DEBUG_1ARG("Trying to lock %p...\n", &msg_queue_mutex);
+ PLUGIN_DEBUG("Trying to lock %p...\n", &msg_queue_mutex);
pthread_mutex_lock(&subscriber_mutex);
- PLUGIN_DEBUG_1ARG("Message %s received on bus. Notifying subscribers.\n", msg);
+ PLUGIN_DEBUG("Message %s received on bus. Notifying subscribers.\n", msg);
std::list<BusSubscriber*>::const_iterator i;
for( i = subscribers.begin(); i != subscribers.end() && !message_consumed; ++i ) {
- PLUGIN_DEBUG_2ARG("Notifying subscriber %p of %s\n", *i, msg);
+ PLUGIN_DEBUG("Notifying subscriber %p of %s\n", *i, msg);
message_consumed = ((BusSubscriber*) *i)->newMessageOnBus(msg);
}
pthread_mutex_unlock(&subscriber_mutex);
if (!message_consumed)
- PLUGIN_DEBUG_1ARG("Warning: No consumer found for message %s\n", msg);
+ PLUGIN_DEBUG("Warning: No consumer found for message %s\n", msg);
- PLUGIN_DEBUG_1ARG("%p unlocked...\n", &msg_queue_mutex);
+ PLUGIN_DEBUG("%p unlocked...\n", &msg_queue_mutex);
}
diff -r a0120629678b plugin/icedteanp/IcedTeaPluginUtils.h
--- a/plugin/icedteanp/IcedTeaPluginUtils.h Wed Apr 14 12:21:03 2010 +0200
+++ b/plugin/icedteanp/IcedTeaPluginUtils.h Fri Jul 16 14:30:37 2010 +0200
@@ -66,64 +66,14 @@
#include "IcedTeaNPPlugin.h"
-#define PLUGIN_DEBUG_0ARG(str) \
- do \
- { \
- if (plugin_debug) \
- { \
- fprintf(stderr, "ICEDTEA NP PLUGIN: thread %p: ", pthread_self()); \
- fprintf(stderr, str); \
- } \
- } while (0)
-
-#define PLUGIN_DEBUG_1ARG(str, arg1) \
- do \
- { \
- if (plugin_debug) \
- { \
- fprintf(stderr, "ICEDTEA NP PLUGIN: thread %p: ", pthread_self()); \
- fprintf(stderr, str, arg1); \
- } \
- } while (0)
-
-#define PLUGIN_DEBUG_2ARG(str, arg1, arg2) \
- do \
- { \
- if (plugin_debug) \
- { \
- fprintf(stderr, "ICEDTEA NP PLUGIN: thread %p: ", pthread_self()); \
- fprintf(stderr, str, arg1, arg2); \
- } \
- } while (0)
-
-#define PLUGIN_DEBUG_3ARG(str, arg1, arg2, arg3) \
- do \
- { \
- if (plugin_debug) \
- { \
- fprintf(stderr, "ICEDTEA NP PLUGIN: thread %p: ", pthread_self()); \
- fprintf(stderr, str, arg1, arg2, arg3); \
- } \
- } while (0)
-
-#define PLUGIN_DEBUG_4ARG(str, arg1, arg2, arg3, arg4) \
- do \
- { \
- if (plugin_debug) \
- { \
- fprintf(stderr, "ICEDTEA NP PLUGIN: thread %p: ", pthread_self()); \
- fprintf(stderr, str, arg1, arg2, arg3, arg4); \
- } \
- } while (0)
-
-#define PLUGIN_DEBUG_5ARG(str, arg1, arg2, arg3, arg4, arg5) \
- do \
- { \
- if (plugin_debug) \
- { \
- fprintf(stderr, "ICEDTEA NP PLUGIN: thread %p: ", pthread_self()); \
- fprintf(stderr, str, arg1, arg2, arg3, arg4, arg5); \
- } \
+#define PLUGIN_DEBUG(...) \
+ do \
+ { \
+ if (plugin_debug) \
+ { \
+ fprintf (stderr, "ITNPP Thread# %ld: ", pthread_self()); \
+ fprintf (stderr, __VA_ARGS__); \
+ } \
} while (0)
#define CHECK_JAVA_RESULT(result_data) \
@@ -137,8 +87,8 @@
}
#define HEX_TO_INT(c) \
- ((*c >= 'A') ? *c - 'A' + 10 : \
- (*c >= 'a') ? *c - 'a' + 10 : \
+ ((*c >= 'a') ? *c - 'a' + 10 : \
+ (*c >= 'A') ? *c - 'A' + 10 : \
*c - '0')
#define IS_VALID_HEX(c) \
diff -r a0120629678b plugin/icedteanp/IcedTeaScriptablePluginObject.cc
--- a/plugin/icedteanp/IcedTeaScriptablePluginObject.cc Wed Apr 14 12:21:03 2010 +0200
+++ b/plugin/icedteanp/IcedTeaScriptablePluginObject.cc Fri Jul 16 14:30:37 2010 +0200
@@ -135,7 +135,7 @@
NPObject*
allocate_scriptable_jp_object(NPP npp, NPClass *aClass)
{
- PLUGIN_DEBUG_0ARG("Allocating new scriptable Java Package object\n");
+ PLUGIN_DEBUG("Allocating new scriptable Java Package object\n");
return new IcedTeaScriptableJavaPackageObject(npp);
}
@@ -161,7 +161,7 @@
np_class->construct = IcedTeaScriptableJavaPackageObject::construct;
scriptable_object = browser_functions.createobject(instance, np_class);
- PLUGIN_DEBUG_3ARG("Returning new scriptable package class: %p from instance %p with name %s\n", scriptable_object, instance, name);
+ PLUGIN_DEBUG("Returning new scriptable package class: %p from instance %p with name %s\n", scriptable_object, instance, name);
((IcedTeaScriptableJavaPackageObject*) scriptable_object)->setPackageName(name);
@@ -172,7 +172,7 @@
IcedTeaScriptableJavaPackageObject::IcedTeaScriptableJavaPackageObject(NPP instance)
{
- PLUGIN_DEBUG_0ARG("Constructing new scriptable java package object\n");
+ PLUGIN_DEBUG("Constructing new scriptable java package object\n");
this->instance = instance;
this->package_name = new std::string();
}
@@ -232,7 +232,7 @@
bool
IcedTeaScriptableJavaPackageObject::hasProperty(NPObject *npobj, NPIdentifier name)
{
- PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaPackageObject::hasProperty %s\n", browser_functions.utf8fromidentifier(name));
+ PLUGIN_DEBUG("IcedTeaScriptableJavaPackageObject::hasProperty %s\n", browser_functions.utf8fromidentifier(name));
bool hasProperty = false;
JavaResultData* java_result;
@@ -240,7 +240,7 @@
NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj);
int plugin_instance_id = get_id_from_instance(instance);
- PLUGIN_DEBUG_1ARG("Object package name: \"%s\"\n", ((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName().c_str());
+ PLUGIN_DEBUG("Object package name: \"%s\"\n", ((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName().c_str());
// "^java" is always a package
if (((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName().length() == 0 &&
@@ -255,7 +255,7 @@
property_name += ".";
property_name += browser_functions.utf8fromidentifier(name);
- PLUGIN_DEBUG_1ARG("Looking for name \"%s\"\n", property_name.c_str());
+ PLUGIN_DEBUG("Looking for name \"%s\"\n", property_name.c_str());
java_result = java_request->hasPackage(plugin_instance_id, property_name);
@@ -278,7 +278,7 @@
IcedTeaScriptableJavaPackageObject::getProperty(NPObject *npobj, NPIdentifier name, NPVariant *result)
{
- PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaPackageObject::getProperty %s\n", browser_functions.utf8fromidentifier(name));
+ PLUGIN_DEBUG("IcedTeaScriptableJavaPackageObject::getProperty %s\n", browser_functions.utf8fromidentifier(name));
if (!browser_functions.utf8fromidentifier(name))
return false;
@@ -303,14 +303,14 @@
if (isPropertyClass)
{
- PLUGIN_DEBUG_0ARG("Returning package object\n");
+ PLUGIN_DEBUG("Returning package object\n");
obj = IcedTeaScriptablePluginObject::get_scriptable_java_package_object(
IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj),
property_name.c_str());
}
else
{
- PLUGIN_DEBUG_0ARG("Returning Java object\n");
+ PLUGIN_DEBUG("Returning Java object\n");
obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(
IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj),
*(java_result->return_string), "0", false);
@@ -353,7 +353,7 @@
NPObject*
allocate_scriptable_java_object(NPP npp, NPClass *aClass)
{
- PLUGIN_DEBUG_0ARG("Allocating new scriptable Java object\n");
+ PLUGIN_DEBUG("Allocating new scriptable Java object\n");
return new IcedTeaScriptableJavaObject(npp);
}
@@ -370,12 +370,12 @@
obj_key += ":";
obj_key += instance_id;
- PLUGIN_DEBUG_1ARG("get_scriptable_java_object searching for %s...\n", obj_key.c_str());
+ PLUGIN_DEBUG("get_scriptable_java_object searching for %s...\n", obj_key.c_str());
scriptable_object = IcedTeaPluginUtilities::getNPObjectFromJavaKey(obj_key);
if (scriptable_object != NULL)
{
- PLUGIN_DEBUG_1ARG("Returning existing object %p\n", scriptable_object);
+ PLUGIN_DEBUG("Returning existing object %p\n", scriptable_object);
browser_functions.retainobject(scriptable_object);
return scriptable_object;
}
@@ -420,7 +420,7 @@
browser_functions.retainobject(scriptable_object);
}
- PLUGIN_DEBUG_4ARG("Constructed new Java Object with classid=%s, instanceid=%s, isArray=%d and scriptable_object=%p\n", class_id.c_str(), instance_id.c_str(), isArray, scriptable_object);
+ PLUGIN_DEBUG("Constructed new Java Object with classid=%s, instanceid=%s, isArray=%d and scriptable_object=%p\n", class_id.c_str(), instance_id.c_str(), isArray, scriptable_object);
((IcedTeaScriptableJavaObject*) scriptable_object)->setClassIdentifier(class_id);
((IcedTeaScriptableJavaObject*) scriptable_object)->setIsArray(isArray);
@@ -431,7 +431,7 @@
IcedTeaPluginUtilities::storeInstanceID(scriptable_object, instance);
IcedTeaPluginUtilities::storeObjectMapping(obj_key, scriptable_object);
- PLUGIN_DEBUG_2ARG("Inserting into object_map key %s->%p\n", obj_key.c_str(), scriptable_object);
+ PLUGIN_DEBUG("Inserting into object_map key %s->%p\n", obj_key.c_str(), scriptable_object);
return scriptable_object;
}
@@ -439,7 +439,7 @@
void
_createAndRetainJavaObject(void* data)
{
- PLUGIN_DEBUG_0ARG("Asynchronously creating/retaining object ...\n");
+ PLUGIN_DEBUG("Asynchronously creating/retaining object ...\n");
std::vector<void*> parameters = ((AsyncCallThreadData*) data)->parameters;
NPP instance = (NPP) parameters.at(0);
@@ -510,7 +510,7 @@
bool
IcedTeaScriptableJavaObject::hasMethod(NPObject *npobj, NPIdentifier name)
{
- PLUGIN_DEBUG_2ARG("IcedTeaScriptableJavaObject::hasMethod %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasMethod %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
bool hasMethod = false;
// If object is an array and requested "method" may be a number, check for it first
@@ -531,7 +531,7 @@
hasMethod = java_result->return_identifier != 0;
}
- PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaObject::hasMethod returning %d\n", hasMethod);
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasMethod returning %d\n", hasMethod);
return hasMethod;
}
@@ -542,7 +542,7 @@
NPUTF8* method_name = browser_functions.utf8fromidentifier(name);
// Extract arg type array
- PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaObject::invoke %s. Args follow.\n", method_name);
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::invoke %s. Args follow.\n", method_name);
for (int i=0; i < argCount; i++)
{
IcedTeaPluginUtilities::printNPVariant(args[i]);
@@ -577,14 +577,14 @@
if (instance_id.length() == 0) // Static
{
- PLUGIN_DEBUG_0ARG("Calling static method\n");
+ PLUGIN_DEBUG("Calling static method\n");
callee = ((IcedTeaScriptableJavaObject*) npobj)->getClassID();
java_result = java_request.callStaticMethod(
IcedTeaPluginUtilities::getSourceFromInstance(instance),
callee, browser_functions.utf8fromidentifier(name), arg_ids);
} else
{
- PLUGIN_DEBUG_0ARG("Calling method normally\n");
+ PLUGIN_DEBUG("Calling method normally\n");
callee = ((IcedTeaScriptableJavaObject*) npobj)->getInstanceID();
java_result = java_request.callMethod(
IcedTeaPluginUtilities::getSourceFromInstance(instance),
@@ -600,7 +600,7 @@
return false;
}
- PLUGIN_DEBUG_0ARG("IcedTeaScriptableJavaObject::invoke converting and returning.\n");
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::invoke converting and returning.\n");
return IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, result);
}
@@ -615,7 +615,7 @@
bool
IcedTeaScriptableJavaObject::hasProperty(NPObject *npobj, NPIdentifier name)
{
- PLUGIN_DEBUG_2ARG("IcedTeaScriptableJavaObject::hasProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
bool hasProperty = false;
// If it is an array, only length and indexes are valid
@@ -648,14 +648,14 @@
}
}
- PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaObject::hasProperty returning %d\n", hasProperty);
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasProperty returning %d\n", hasProperty);
return hasProperty;
}
bool
IcedTeaScriptableJavaObject::getProperty(NPObject *npobj, NPIdentifier name, NPVariant *result)
{
- PLUGIN_DEBUG_2ARG("IcedTeaScriptableJavaObject::getProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::getProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
bool isPropertyClass = false;
JavaResultData* java_result;
@@ -730,14 +730,14 @@
return false;
}
- PLUGIN_DEBUG_0ARG("IcedTeaScriptableJavaObject::getProperty converting and returning.\n");
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::getProperty converting and returning.\n");
return IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, result);
}
bool
IcedTeaScriptableJavaObject::setProperty(NPObject *npobj, NPIdentifier name, const NPVariant *value)
{
- PLUGIN_DEBUG_2ARG("IcedTeaScriptableJavaObject::setProperty %s (ival=%d) to:\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::setProperty %s (ival=%d) to:\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
IcedTeaPluginUtilities::printNPVariant(*value);
bool isPropertyClass = false;
@@ -811,7 +811,7 @@
return false;
}
- PLUGIN_DEBUG_0ARG("IcedTeaScriptableJavaObject::setProperty returning.\n");
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::setProperty returning.\n");
return true;
}
@@ -834,7 +834,7 @@
NPVariant *result)
{
// Extract arg type array
- PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaObject::construct %s. Args follow.\n", ((IcedTeaScriptableJavaObject*) npobj)->getClassID().c_str());
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::construct %s. Args follow.\n", ((IcedTeaScriptableJavaObject*) npobj)->getClassID().c_str());
for (int i=0; i < argCount; i++)
{
IcedTeaPluginUtilities::printNPVariant(args[i]);
@@ -892,6 +892,6 @@
OBJECT_TO_NPVARIANT(obj, *result);
- PLUGIN_DEBUG_0ARG("IcedTeaScriptableJavaObject::construct returning.\n");
+ PLUGIN_DEBUG("IcedTeaScriptableJavaObject::construct returning.\n");
return true;
}
diff -r a0120629678b plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java Fri Jul 16 14:30:37 2010 +0200
@@ -0,0 +1,52 @@
+/* ForbiddenTargetException.java
+ Copyright (C) 2010 Red Hat
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package netscape.security;
+
+public class ForbiddenTargetException extends RuntimeException{
+
+ private static final long serialVersionUID = 1271219852541058396L;
+
+ public ForbiddenTargetException() {
+ super();
+ }
+
+ public ForbiddenTargetException(String s) {
+ super(s);
+ }
+
+}
diff -r a0120629678b plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Wed Apr 14 12:21:03 2010 +0200
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri Jul 16 14:30:37 2010 +0200
@@ -1,4 +1,4 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
+/* PluginAppletViewer -- Handles embedding of the applet panel
Copyright (C) 2008 Red Hat
This file is part of IcedTea.
@@ -393,8 +393,7 @@
if (oldFrame != null && handle == oldFrame.handle)
return;
- PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, heightFactor, widthFactor);
- newFrame.panel = panel;
+ PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, heightFactor, widthFactor, panel);
if (oldFrame != null) {
applets.remove(oldFrame.identifier);
@@ -425,13 +424,14 @@
*/
private PluginAppletViewer(long handle, final int identifier,
PrintStream statusMsgStream, double heightFactor,
- double widthFactor) {
+ double widthFactor, AppletViewerPanel appletPanel) {
super(handle, true);
this.statusMsgStream = statusMsgStream;
this.identifier = identifier;
this.proposedHeightFactor = heightFactor;
this.proposedWidthFactor = widthFactor;
+ this.panel = appletPanel;
if (!appletPanels.contains(panel))
appletPanels.addElement(panel);
@@ -735,7 +735,7 @@
Thread.sleep(50);
wait += 50;
} catch (InterruptedException ie) {
- ie.printStackTrace();
+ // just wait
}
}
@@ -1605,10 +1605,15 @@
{
public void run()
{
+ ThreadGroup tg = ((JNLPClassLoader) p.applet.getClass().getClassLoader()).getApplication().getThreadGroup();
+
appletShutdown(p);
appletPanels.removeElement(p);
dispose();
+ if (tg.activeCount() > 0)
+ tg.stop();
+
if (countApplets() == 0) {
appletSystemExit();
}
diff -r a0120629678b plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java
--- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Wed Apr 14 12:21:03 2010 +0200
+++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Fri Jul 16 14:30:37 2010 +0200
@@ -61,6 +61,7 @@
PluginStreamHandler streamHandler = null;
AppletSecurity as;
ConsumerThread consumerThread = new ConsumerThread();
+ private static ArrayList<Integer> processedIds = new ArrayList<Integer>();
/**
* Registers a reference to wait for. Responses to registered priority
@@ -162,15 +163,24 @@
}
registerPriorityWait("instance " + instanceNum + " handle");
- registerPriorityWait("instance " + instanceNum + " width");
- } else if (msgParts[2].equals("handle") || msgParts[2].equals("width")) {
+ } else if (msgParts[2].equals("handle")) {
Integer instanceNum = new Integer(msgParts[1]);
// If this instance is not in init, return false immediately.
- // Handle/Width messages should NEVER go before tag messages
+ // Handle messages should NEVER go before tag messages
if (!isInInit(instanceNum))
return false;
+
+ registerPriorityWait("instance " + instanceNum + " width");
+ } else if (msgParts[2].equals("width")) {
+
+ // width messages cannot proceed until handle and tag have been resolved
+ Integer instanceNum = new Integer(msgParts[1]);
+
+ if (!processedIds.contains(instanceNum)) {
+ return false;
+ }
}
return true;
@@ -181,8 +191,10 @@
Iterator<Integer> i = initWorkers.keySet().iterator();
while (i.hasNext()) {
Integer key = i.next();
- if (initWorkers.get(key).equals(worker))
+ if (initWorkers.get(key).equals(worker)) {
+ processedIds.add(key);
initWorkers.remove(key);
+ }
}
}
@@ -270,7 +282,7 @@
if (workers.size() <= MAX_WORKERS) {
PluginMessageHandlerWorker worker = null;
- if (workers.size() <= (MAX_WORKERS - PRIORITY_WORKERS)) {
+ if (workers.size() < (MAX_WORKERS - PRIORITY_WORKERS)) {
PluginDebug.debug("Cannot find free worker, creating worker " + workers.size());
worker = new PluginMessageHandlerWorker(this, streamHandler, workers.size(), as, false);
} else if (prioritized) {
@@ -291,4 +303,9 @@
return null;
}
+ private void dumpWorkerStatus() {
+ for (PluginMessageHandlerWorker worker: workers) {
+ PluginDebug.debug(worker.toString());
+ }
+ }
}
diff -r a0120629678b plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java
--- a/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java Wed Apr 14 12:21:03 2010 +0200
+++ b/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java Fri Jul 16 14:30:37 2010 +0200
@@ -72,7 +72,7 @@
if (message != null) {
- PluginDebug.debug("Consumer thread " + id + " consuming " + message);
+ PluginDebug.debug("Consumer (priority=" + isPriorityWorker + ") thread " + id + " consuming " + message);
// ideally, whoever returns things object should mark it
// busy first, but just in case..
@@ -90,7 +90,7 @@
this.message = null;
- PluginDebug.debug("Consumption completed by consumer thread " + id);
+ PluginDebug.debug("Consumption (priority=" + isPriorityWorker + ") completed by consumer thread " + id);
// mark ourselves free again
free();
@@ -140,4 +140,8 @@
return free && (prioritized == isPriorityWorker);
}
}
+
+ public String toString() {
+ return "Worker #" + this.id + "/IsPriority=" + this.isPriorityWorker + "/IsFree=" + this.free + "/Message=" + message;
+ }
}
diff -r a0120629678b ports/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp Wed Apr 14 12:21:03 2010 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp Fri Jul 16 14:30:37 2010 +0200
@@ -98,7 +98,8 @@
if (is_static()) {
builder()->CreateStore(
builder()->CreateInlineOop(
- JNIHandles::make_local(target()->method_holder())),
+ JNIHandles::make_local(
+ target()->method_holder()->klass_part()->java_mirror())),
oop_tmp_slot());
param_types.push_back(box_type);
diff -r a0120629678b ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Apr 14 12:21:03 2010 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jul 16 14:30:37 2010 +0200
@@ -691,12 +691,6 @@
SharkValue *index = pop();
SharkValue *array = pop();
- assert(array->type()->is_array_klass(), "should be");
- ciType *element_type = ((ciArrayKlass *) array->type())->element_type();
- assert((element_type->basic_type() == T_BOOLEAN && basic_type == T_BYTE) ||
- (element_type->basic_type() == T_ARRAY && basic_type == T_OBJECT) ||
- (element_type->basic_type() == basic_type), "type mismatch");
-
check_null(array);
check_bounds(array, index);
@@ -729,7 +723,21 @@
break;
case T_OBJECT:
- push(SharkValue::create_generic(element_type, value, false));
+ // You might expect that array->type()->is_array_klass() would
+ // always be true, but it isn't. If ciTypeFlow detects that a
+ // value is always null then that value becomes an untyped null
+ // object. Shark doesn't presently support this, so a generic
+ // T_OBJECT is created. In this case we guess the type using
+ // the BasicType we were supplied. In reality the generated
+ // code will never be used, as the null value will be caught
+ // by the above null pointer check.
+ // http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=324
+ push(
+ SharkValue::create_generic(
+ array->type()->is_array_klass() ?
+ ((ciArrayKlass *) array->type())->element_type() :
+ ciType::make(basic_type),
+ value, false));
break;
default:
@@ -743,12 +751,6 @@
SharkValue *index = pop();
SharkValue *array = pop();
- assert(array->type()->is_array_klass(), "should be");
- ciType *element_type = ((ciArrayKlass *) array->type())->element_type();
- assert((element_type->basic_type() == T_BOOLEAN && basic_type == T_BYTE) ||
- (element_type->basic_type() == T_ARRAY && basic_type == T_OBJECT) ||
- (element_type->basic_type() == basic_type), "type mismatch");
-
check_null(array);
check_bounds(array, index);
@@ -792,7 +794,7 @@
builder()->CreateStore(value, addr);
- if (!element_type->is_primitive_type())
+ if (basic_type == T_OBJECT) // XXX or T_ARRAY?
builder()->CreateUpdateBarrierSet(oopDesc::bs(), addr);
}
@@ -901,6 +903,18 @@
dest_method->holder() == java_lang_Object_klass())
return dest_method;
+#ifdef SHARK_CAN_DEOPTIMIZE_ANYWHERE
+ // This code can replace a virtual call with a direct call if this
+ // class is the only one in the entire set of loaded classes that
+ // implements this method. This makes the compiled code dependent
+ // on other classes that implement the method not being loaded, a
+ // condition which is enforced by the dependency tracker. If the
+ // dependency tracker determines a method has become invalid it
+ // will mark it for recompilation, causing running copies to be
+ // deoptimized. Shark currently can't deoptimize arbitrarily like
+ // that, so this optimization cannot be used.
+ // http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=481
+
// All other interesting cases are instance classes
if (!receiver_type->is_instance_klass())
return NULL;
@@ -956,6 +970,8 @@
// with non-monomorphic targets if the receiver has an exact
// type. We don't mark types this way, so we can't do this.
+#endif // SHARK_CAN_DEOPTIMIZE_ANYWHERE
+
return NULL;
}
diff -r a0120629678b pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Wed Apr 14 12:21:03 2010 +0200
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Jul 16 14:30:37 2010 +0200
@@ -86,7 +86,7 @@
protected void open(AudioFormat format, int bufferSize)
throws LineUnavailableException {
- if (isOpen) {
+ if (isOpen()) {
throw new IllegalStateException("Line is already open");
}
@@ -139,7 +139,7 @@
}
}
- if (!isOpen) {
+ if (!isOpen()) {
throw new IllegalArgumentException("Invalid format");
}
@@ -299,9 +299,10 @@
@Override
public void close() {
- if (!isOpen) {
- throw new IllegalStateException(
- "Line must be open for close() to work");
+ if (!isOpen()) {
+ // For whatever reason, we are being asked to close
+ // a line that is not even open.
+ return;
}
synchronized (eventLoop.threadLock) {
@@ -346,7 +347,7 @@
@Override
public void start() {
- if (!isOpen) {
+ if (!isOpen()) {
throw new IllegalStateException(
"Line must be open()ed before it can be start()ed");
}
@@ -376,10 +377,10 @@
@Override
public synchronized void stop() {
- if (!isOpen) {
- throw new IllegalStateException(
- "Line must be open()ed before it can be start()ed");
-
+ if (!isOpen()) {
+ // For some reason, we are being asked to stop a line
+ // that isn't even open.
+ return;
}
writeInterrupted = true;
if (!isStarted) {
@@ -433,7 +434,7 @@
throws LineUnavailableException;
public Stream getStream() {
- if (!isOpen) {
+ if (!isOpen()) {
throw new IllegalStateException("Line must be open");
}
@@ -442,7 +443,7 @@
@Override
public int getBufferSize() {
- if (!isOpen) {
+ if (!isOpen()) {
return DEFAULT_BUFFER_SIZE;
}
return bufferSize;
@@ -450,7 +451,7 @@
@Override
public AudioFormat getFormat() {
- if (!isOpen) {
+ if (!isOpen()) {
return defaultFormat;
}
return currentFormat;
@@ -467,7 +468,7 @@
* the name of this audio stream
*/
public void setName(String streamName) {
- if (isOpen) {
+ if (isOpen()) {
Operation o;
synchronized (eventLoop.threadLock) {
diff -r a0120629678b pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Wed Apr 14 12:21:03 2010 +0200
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Fri Jul 16 14:30:37 2010 +0200
@@ -62,7 +62,7 @@
@Override
public void close() {
- if (!isOpen) {
+ if (!isOpen()) {
throw new IllegalStateException("Line is not open");
}
@@ -79,7 +79,7 @@
@Override
public Control getControl(Type control) {
- if (isOpen) {
+ if (isOpen()) {
for (Control aControl : controls) {
if (aControl.getType() == control) {
return aControl;
@@ -92,7 +92,7 @@
@Override
public Control[] getControls() {
- if (!isOpen) {
+ if (!isOpen()) {
return new Control[] {};
}
diff -r a0120629678b pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Wed Apr 14 12:21:03 2010 +0200
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Jul 16 14:30:37 2010 +0200
@@ -142,8 +142,9 @@
writeInterrupted = false;
}
- if (!isOpen) {
- throw new IllegalStateException("must call open() before write()");
+ if (!isOpen()) {
+ // A closed line can write exactly 0 bytes.
+ return 0;
}
int frameSize = currentFormat.getFrameSize();
@@ -259,11 +260,6 @@
@Override
public void drain() {
- if (!isOpen) {
- throw new IllegalStateException(
- "Line must be open before it can be drain()ed");
-
- }
synchronized (this) {
writeInterrupted = true;
@@ -271,13 +267,13 @@
do {
synchronized (this) {
- if (!isOpen) {
+ if (!isOpen()) {
return;
}
if (getBytesInBuffer() == 0) {
return;
}
- if (isStarted || !isOpen) {
+ if (isStarted) {
break;
}
try {
@@ -301,29 +297,27 @@
@Override
public void flush() {
- if (!isOpen) {
- throw new IllegalStateException(
- "Line must be open before it can be flush()ed");
- }
synchronized (this) {
writeInterrupted = true;
}
- Operation operation;
- synchronized (eventLoop.threadLock) {
- operation = stream.flush();
+ if (isOpen()) {
+ Operation operation;
+ synchronized (eventLoop.threadLock) {
+ operation = stream.flush();
+ }
+
+ operation.waitForCompletion();
+ operation.releaseReference();
}
- operation.waitForCompletion();
- operation.releaseReference();
-
}
@Override
synchronized public void close() {
- if (!isOpen) {
- throw new IllegalStateException("not open so cant close");
+ if (!isOpen()) {
+ return;
}
writeInterrupted = true;
diff -r a0120629678b pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Wed Apr 14 12:21:03 2010 +0200
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Fri Jul 16 14:30:37 2010 +0200
@@ -76,15 +76,19 @@
@Override
synchronized public void close() {
+ if (!isOpen()) {
+ // Probably due to some programmer error, we are being
+ // asked to close an already closed line. Oh well.
+ Debug.println(DebugLevel.Verbose,
+ "PulseAudioTargetDataLine.close(): "
+ + "Line closed that wasn't open.");
+ return;
+ }
+
/* check for permission to record audio */
AudioPermission perm = new AudioPermission("record", null);
perm.checkGuard(null);
- if (!isOpen) {
- throw new IllegalStateException(
- "Line cant be closed if it isnt open");
- }
-
PulseAudioMixer parentMixer = PulseAudioMixer.getInstance();
parentMixer.removeTargetLine(this);
@@ -101,7 +105,7 @@
AudioPermission perm = new AudioPermission("record", null);
perm.checkGuard(null);
- if (isOpen) {
+ if (isOpen()) {
throw new IllegalStateException("already open");
}
super.open(format, bufferSize);
@@ -142,8 +146,9 @@
/* check state and inputs */
- if (!isOpen) {
- throw new IllegalStateException("must call open() before read()");
+ if (!isOpen()) {
+ // A closed line can produce zero bytes of data.
+ return 0;
}
int frameSize = currentFormat.getFrameSize();
@@ -220,7 +225,7 @@
while (remainingLength != 0) {
synchronized (this) {
- if (!isOpen || !isStarted) {
+ if (!isOpen() || !isStarted) {
return sizeRead;
}
@@ -287,57 +292,57 @@
@Override
public void drain() {
- if (!isOpen) {
- throw new IllegalStateException("must call open() before drain()");
+ // blocks when there is data on the line
+ // http://www.jsresources.org/faq_audio.html#stop_drain_tdl
+ while (true) {
+ synchronized (this) {
+ if (!isStarted || !isOpen()) {
+ break;
+ }
+ }
+ try {
+ //TODO: Is this the best length of sleep?
+ //Maybe in case this loop runs for a long time
+ //it would be good to switch to a longer
+ //sleep. Like bump it up each iteration after
+ //the Nth iteration, up to a MAXSLEEP length.
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ // do nothing
+ }
}
synchronized (this) {
drained = true;
}
- // blocks when there is data on the line
- // http://www.jsresources.org/faq_audio.html#stop_drain_tdl
- while (true) {
- synchronized (this) {
- if (!isStarted || !isOpen) {
- break;
- }
- }
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- // do nothing
- }
- }
-
}
@Override
public void flush() {
- if (!isOpen) {
- throw new IllegalStateException("Line must be open");
+ if (isOpen()) {
+
+ /* flush the buffer on pulseaudio's side */
+ Operation operation;
+ synchronized (eventLoop.threadLock) {
+ operation = stream.flush();
+ }
+ operation.waitForCompletion();
+ operation.releaseReference();
}
- /* flush the buffer on pulseaudio's side */
- Operation operation;
- synchronized (eventLoop.threadLock) {
- operation = stream.flush();
- }
- operation.waitForCompletion();
- operation.releaseReference();
-
synchronized (this) {
flushed = true;
/* flush the partial fragment we stored */
fragmentBuffer = null;
}
-
}
@Override
public int available() {
- if (!isOpen) {
- throw new IllegalStateException("Line must be open");
+ if (!isOpen()) {
+ // a closed line has 0 bytes available.
+ return 0;
}
synchronized (eventLoop.threadLock) {
diff -r a0120629678b tapset/hotspot.stp.in
--- a/tapset/hotspot.stp.in Wed Apr 14 12:21:03 2010 +0200
+++ b/tapset/hotspot.stp.in Fri Jul 16 14:30:37 2010 +0200
@@ -120,7 +120,7 @@
name = "object_alloc";
thread_id = $arg1;
class = user_string_n($arg2, $arg3);
- size = $arg3;
+ size = $arg4;
probestr = sprintf("%s(thread_id=%d,class='%s',size=0x%x)",
name, thread_id, class, size);
}
|