2
* Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
#include "AboutData.h"
22
#include "AboutTemplate.html.cpp"
23
#include "CacheHelper.h"
24
#include "CookieManager.h"
25
#include "JSDOMWindow.h"
26
#include "MemoryCache.h"
27
#include "MemoryStatistics.h"
28
#include "SurfacePool.h"
29
#include "WebKitVersion.h"
31
#include <BlackBerryPlatformLog.h>
32
#include <BlackBerryPlatformMemory.h>
33
#include <BlackBerryPlatformSettings.h>
34
#include <BlackBerryPlatformWebKitCredits.h>
35
#include <BuildInformation.h>
36
#include <heap/Heap.h>
38
#include <runtime/JSGlobalData.h>
40
#include <sys/utsname.h>
41
#include <wtf/text/CString.h>
43
using namespace WebCore;
45
namespace BlackBerry {
48
static String writeFeatures(const Vector<String>& trueList, const Vector<String>& falseList)
51
for (unsigned int i = 0, j = 0; i < trueList.size() || j < falseList.size();) {
52
bool pickFromFalse = ((i >= trueList.size()) || (j < falseList.size() && strcmp(falseList[j].ascii().data(), trueList[i].ascii().data()) < 0));
53
const String& item = (pickFromFalse ? falseList : trueList)[ (pickFromFalse ? j : i)++ ];
54
ret += String("<tr><td><div class='" + String(pickFromFalse ? "false" : "true") + "'" + (item.length() >= 30 ? " style='font-size:10px;' " : "") + ">" + item + "</div></td></tr>");
59
template<class T> static String numberToHTMLTr(const String& description, T number)
61
return String("<tr><td>") + description + "</td><td>" + String::number(number) + "</td></tr>";
64
template<> String numberToHTMLTr<bool>(const String& description, bool truth)
66
return String("<tr><td>") + description + "</td><td>" + (truth?"true":"false") + "</td></tr>";
69
static String configPage()
72
#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
73
page = writeHeader("Configuration")
74
+ "<div class=\"box\"><div class=\"box-title\">Compiler Information</div><table class='fixed-table'><col width=75%><col width=25%>"
76
+ "<tr><td>Microsoft Visual C++</td><td>MSVC</td></tr>"
77
+ "<tr><td>_MSC_VER</td><td>" + String::number(_MSC_VER) + "</td></tr>"
78
+ "<tr><td>_MSC_FULL_VER</td><td>" + String::number(_MSC_FULL_VER) + "</td></tr>"
79
+ "<tr><td>_MSC_BUILD</td><td>" + String::number(_MSC_BUILD) + "</td></tr>"
81
+ "<tr><td>ARM RealView Compiler Toolkit</td><td>RVCT</td></tr>"
82
+ "<tr><td>__ARMCC_VERSION</td><td>" + String::number(__ARMCC_VERSION) + "</td></tr>"
83
#if COMPILER(RVCT4GNU)
84
+ "<tr><td>RVCT 4+ in --gnu mode</td><td>1</td></tr>"
87
+ "<tr><td>GCC</td><td>" + String::number(__GNUC__) + "." + String::number(__GNUC_MINOR__) + "." + String::number(__GNUC_PATCHLEVEL__) + "</td></tr>"
90
// Add "" to satisfy check-webkit-style.
93
page += String("</table></div><br><div class='box'><div class='box-title'>CPU Information</div><table class='fixed-table'><col width=75%><col width=25%>")
95
+ "<tr><td>X86</td><td></td></tr>"
97
+ "<tr><td>ARM</td><td></td></tr>"
98
+ "<tr><td>ARM_ARCH_VERSION</td><td>" + String::number(WTF_ARM_ARCH_VERSION) + "</td></tr>"
99
+ "<tr><td>THUMB_ARCH_VERSION</td><td>" + String::number(WTF_THUMB_ARCH_VERSION) + "</td></tr>"
100
+ "<tr><td>THUMB2</td><td>" + String::number(WTF_CPU_ARM_THUMB2) + "</td></tr>"
102
+ "<tr><td>Endianness</td><td>"
105
#elif CPU(MIDDLE_ENDIAN)
112
page += String("</table></div><br><div class='box'><div class='box-title'>Platform Information</div><table class='fixed-table'><col width=75%><col width=25%>")
113
+ "<tr><td>WebKit Version</td><td>" + String::number(WEBKIT_MAJOR_VERSION) + "." + String::number(WEBKIT_MINOR_VERSION) + "</td></tr>"
114
+ "<tr><td>BlackBerry</td><td>"
115
#if PLATFORM(BLACKBERRY)
121
+ "<tr><td>__STDC_ISO_10646__</td><td>"
122
#ifdef __STDC_ISO_10646__
129
BlackBerry::Platform::Settings* settings = BlackBerry::Platform::Settings::instance();
130
page += String("</table></div><br><div class='box'><div class='box-title'>Platform Settings</div><table style='font-size:11px;' class='fixed-table'><col width=75%><col width=25%>");
131
page += numberToHTMLTr("isRSSFilteringEnabled", settings->isRSSFilteringEnabled());
132
page += numberToHTMLTr("secondaryThreadStackSize", settings->secondaryThreadStackSize());
133
page += numberToHTMLTr("maxPixelsPerDecodedImage", settings->maxPixelsPerDecodedImage());
134
page += numberToHTMLTr("shouldReportLowMemoryToUser", settings->shouldReportLowMemoryToUser());
135
page += numberToHTMLTr("numberOfBackingStoreTiles", settings->numberOfBackingStoreTiles());
136
page += numberToHTMLTr("maximumNumberOfBacking...AcrossProcesses", settings->maximumNumberOfBackingStoreTilesAcrossProcesses());
137
page += numberToHTMLTr("tabsSupportedByClient", settings->tabsSupportedByClient());
138
page += numberToHTMLTr("contextMenuEnabled", settings->contextMenuEnabled());
139
page += numberToHTMLTr("selectionEnabled", settings->selectionEnabled());
140
page += numberToHTMLTr("fineCursorControlEnabled", settings->fineCursorControlEnabled());
141
page += numberToHTMLTr("alwaysShowKeyboardOnFocus", settings->alwaysShowKeyboardOnFocus());
142
page += numberToHTMLTr("allowedScrollAdjustmentForInputFields", settings->allowedScrollAdjustmentForInputFields());
143
page += numberToHTMLTr("unrestrictedResizeEvents", settings->unrestrictedResizeEvents());
144
page += numberToHTMLTr("isBridgeBrowser", settings->isBridgeBrowser());
145
page += numberToHTMLTr("showImageLocationOptionsInGCM", settings->showImageLocationOptionsInGCM());
146
page += numberToHTMLTr("forceGLES2WindowUsage", settings->forceGLES2WindowUsage());
147
page += numberToHTMLTr("maxClickableSpeed", settings->maxClickableSpeed());
148
page += numberToHTMLTr("maxJitterRadiusClick", settings->maxJitterRadiusClick());
149
page += numberToHTMLTr("maxJitterRadiusTap", settings->maxJitterRadiusTap());
150
page += numberToHTMLTr("maxJitterRadiusSingleTouchMove", settings->maxJitterRadiusSingleTouchMove());
151
page += numberToHTMLTr("maxJitterRadiusTouchHold", settings->maxJitterRadiusTouchHold());
152
page += numberToHTMLTr("maxJitterRadiusHandleDrag", settings->maxJitterRadiusHandleDrag());
153
page += numberToHTMLTr("maxJitterRadiusTapHighlight", settings->maxJitterRadiusTapHighlight());
154
page += numberToHTMLTr("maxJitterDistanceClick", settings->maxJitterDistanceClick());
155
page += numberToHTMLTr("maxJitterDistanceTap", settings->maxJitterDistanceTap());
156
page += numberToHTMLTr("maxJitterDistanceSingleTouchMove", settings->maxJitterDistanceSingleTouchMove());
157
page += numberToHTMLTr("maxJitterDistanceTouchHold", settings->maxJitterDistanceTouchHold());
158
page += numberToHTMLTr("maxJitterDistanceTapHighlight", settings->maxJitterDistanceTapHighlight());
159
page += numberToHTMLTr("maxJitterDistanceHandleDrag", settings->maxJitterDistanceHandleDrag());
160
page += numberToHTMLTr("topFatFingerPadding", settings->topFatFingerPadding());
161
page += numberToHTMLTr("rightFatFingerPadding", settings->rightFatFingerPadding());
162
page += numberToHTMLTr("bottomFatFingerPadding", settings->bottomFatFingerPadding());
163
page += numberToHTMLTr("maxSelectionNeckHeight", settings->maxSelectionNeckHeight());
164
page += numberToHTMLTr("leftFatFingerPadding", settings->leftFatFingerPadding());
166
Vector<String> trueList, falseList;
167
#include "AboutDataEnableFeatures.cpp"
168
page += String("</table></div><br><div class='box'><div class='box-title'>WebKit Features (ENABLE_)</div><table class='fixed-table'>");
170
page += writeFeatures(trueList, falseList);
174
#include "AboutDataHaveFeatures.cpp"
175
page += String("</table></div><br><div class='box'><div class='box-title'>WebKit Features (HAVE_)</div><table class='fixed-table'>");
177
page += writeFeatures(trueList, falseList);
181
#include "AboutDataUseFeatures.cpp"
182
page += String("</table></div><br><div class='box'><div class='box-title'>WebKit Features (USE_)</div><table class='fixed-table'>");
183
page += writeFeatures(trueList, falseList);
184
page += String("</table></div></body></html>");
190
static String cacheTypeStatisticToHTMLTr(const String& description, const MemoryCache::TypeStatistic& statistic)
192
const int s_kiloByte = 1024;
193
return String("<tr><td>") + description + "</td>"
194
+ "<td>" + String::number(statistic.count) + "</td>"
195
+ "<td>" + String::number(statistic.size / s_kiloByte) + "</td>"
196
+ "<td>" + String::number(statistic.liveSize / s_kiloByte) + "</td>"
197
+ "<td>" + String::number(statistic.decodedSize / s_kiloByte) + "</td>"
201
static void dumpJSCTypeCountSetToTableHTML(String& tableHTML, JSC::TypeCountSet* typeCountSet)
206
for (JSC::TypeCountSet::const_iterator iter = typeCountSet->begin(); iter != typeCountSet->end(); ++iter)
207
tableHTML += numberToHTMLTr(iter->key, iter->value);
210
static String memoryPage()
214
page = writeHeader("Memory")
215
+ "<div class=\"box\"><div class=\"box-title\">Cache Information<br><div style='font-size:11px;color:#A8A8A8'>Size, Living, and Decoded are expressed in KB.</div><br></div><table class='fixed-table'><col width=75%><col width=25%>";
217
// generate cache information
218
MemoryCache* cacheInc = memoryCache();
219
MemoryCache::Statistics cacheStat = cacheInc->getStatistics();
221
page += "<tr> <th align=left>Item</th> <th align=left>Count</th> <th align=left>Size</th> <th align=left>Living</th> <th align=left>Decoded</th></tr>";
223
MemoryCache::TypeStatistic total;
224
total.count = cacheStat.images.count + cacheStat.cssStyleSheets.count
225
+ cacheStat.scripts.count + cacheStat.xslStyleSheets.count + cacheStat.fonts.count;
226
total.size = cacheInc->totalSize();
227
total.liveSize = cacheStat.images.liveSize + cacheStat.cssStyleSheets.liveSize
228
+ cacheStat.scripts.liveSize + cacheStat.xslStyleSheets.liveSize + cacheStat.fonts.liveSize;
229
total.decodedSize = cacheStat.images.decodedSize
230
+ cacheStat.cssStyleSheets.decodedSize + cacheStat.scripts.decodedSize
231
+ cacheStat.xslStyleSheets.decodedSize + cacheStat.fonts.decodedSize;
233
page += cacheTypeStatisticToHTMLTr("Total", total);
234
page += cacheTypeStatisticToHTMLTr("Images", cacheStat.images);
235
page += cacheTypeStatisticToHTMLTr("CSS Style Sheets", cacheStat.cssStyleSheets);
236
page += cacheTypeStatisticToHTMLTr("Scripts", cacheStat.scripts);
238
page += cacheTypeStatisticToHTMLTr("XSL Style Sheets", cacheStat.xslStyleSheets);
240
page += cacheTypeStatisticToHTMLTr("Fonts", cacheStat.fonts);
242
page += "</table></div><br>";
244
#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
246
// JS engine memory usage.
247
JSC::GlobalMemoryStatistics jscMemoryStat = JSC::globalMemoryStatistics();
248
JSC::Heap& mainHeap = JSDOMWindow::commonJSGlobalData()->heap;
249
OwnPtr<JSC::TypeCountSet> objectTypeCounts = mainHeap.objectTypeCounts();
250
OwnPtr<JSC::TypeCountSet> protectedObjectTypeCounts = mainHeap.protectedObjectTypeCounts();
253
struct mallinfo mallocInfo = mallinfo();
255
page += "<div class='box'><div class='box-title'>Process memory usage summary</div><table class='fixed-table'><col width=75%><col width=25%>";
257
page += numberToHTMLTr("Total used memory (malloc + JSC)", mallocInfo.usmblks + mallocInfo.uordblks + jscMemoryStat.stackBytes + jscMemoryStat.JITBytes + mainHeap.capacity());
259
if (unsigned totalCommittedMemoryOfChromeProcess = BlackBerry::Platform::totalCommittedMemoryOfChromeProcess()) {
260
page += numberToHTMLTr("Total committed memory of tab process", BlackBerry::Platform::totalCommittedMemoryOfCurrentProcess());
261
page += numberToHTMLTr("Total committed memory of chrome process", totalCommittedMemoryOfChromeProcess);
263
page += numberToHTMLTr("Total committed memory", BlackBerry::Platform::totalCommittedMemoryOfCurrentProcess());
265
struct stat processInfo;
266
if (!stat(String::format("/proc/%u/as", getpid()).latin1().data(), &processInfo))
267
page += numberToHTMLTr("Total mapped memory", processInfo.st_size);
269
page += numberToHTMLTr("System free memory", BlackBerry::Platform::systemFreeMemory());
271
page += "</table></div><br>";
273
page += "<div class='box'><div class='box-title'>JS engine memory usage</div><table class='fixed-table'><col width=75%><col width=25%>";
275
page += numberToHTMLTr("Stack size", jscMemoryStat.stackBytes);
276
page += numberToHTMLTr("JIT memory usage", jscMemoryStat.JITBytes);
277
page += numberToHTMLTr("Main heap capacity", mainHeap.capacity());
278
page += numberToHTMLTr("Main heap size", mainHeap.size());
279
page += numberToHTMLTr("Object count", mainHeap.objectCount());
280
page += numberToHTMLTr("Global object count", mainHeap.globalObjectCount());
281
page += numberToHTMLTr("Protected object count", mainHeap.protectedObjectCount());
282
page += numberToHTMLTr("Protected global object count", mainHeap.protectedGlobalObjectCount());
284
page += "</table></div><br>";
286
page += "<div class='box'><div class='box-title'>JS object type counts</div><table class='fixed-table'><col width=75%><col width=25%>";
287
dumpJSCTypeCountSetToTableHTML(page, objectTypeCounts.get());
288
page += "</table></div><br>";
290
page += "<div class='box'><div class='box-title'>JS protected object type counts</div><table class='fixed-table'><col width=75%><col width=25%>";
291
dumpJSCTypeCountSetToTableHTML(page, protectedObjectTypeCounts.get());
292
page += "</table></div><br>";
294
page += "<div class='box'><div class='box-title'>Malloc Information</div><table class='fixed-table'><col width=75%><col width=25%>";
296
page += numberToHTMLTr("Total space in use", mallocInfo.usmblks + mallocInfo.uordblks);
297
page += numberToHTMLTr("Total space in free blocks", mallocInfo.fsmblks + mallocInfo.fordblks);
298
page += numberToHTMLTr("Size of the arena", mallocInfo.arena);
299
page += numberToHTMLTr("Number of big blocks in use", mallocInfo.ordblks);
300
page += numberToHTMLTr("Number of small blocks in use", mallocInfo.smblks);
301
page += numberToHTMLTr("Number of header blocks in use", mallocInfo.hblks);
302
page += numberToHTMLTr("Space in header block headers", mallocInfo.hblkhd);
303
page += numberToHTMLTr("Space in small blocks in use", mallocInfo.usmblks);
304
page += numberToHTMLTr("Memory in free small blocks", mallocInfo.fsmblks);
305
page += numberToHTMLTr("Space in big blocks in use", mallocInfo.uordblks);
306
page += numberToHTMLTr("Memory in free big blocks", mallocInfo.fordblks);
308
page += "</table></div>";
311
page += "</body></html>";
315
#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
316
class MemoryTracker {
318
static MemoryTracker& instance();
321
bool isActive() const { return m_memoryTrackingTimer.isActive(); }
324
m_peakTotalUsedMemory = 0;
325
m_peakTotalCommittedMemoryOfCurrentProcess = 0;
326
m_peakTotalCommittedMemoryOfChromeProcess = 0;
327
m_peakTotalMappedMemory = 0;
330
void updateMemoryPeaks(Timer<MemoryTracker>*);
331
unsigned peakTotalUsedMemory() const { return m_peakTotalUsedMemory; }
332
unsigned peakTotalCommittedMemoryOfCurrentProcess() const { return m_peakTotalCommittedMemoryOfCurrentProcess; }
333
unsigned peakTotalCommittedMemoryOfChromeProcess() const { return m_peakTotalCommittedMemoryOfChromeProcess; }
334
unsigned peakTotalMappedMemory() const { return m_peakTotalMappedMemory; }
338
Timer<MemoryTracker> m_memoryTrackingTimer;
339
unsigned m_peakTotalUsedMemory;
340
unsigned m_peakTotalCommittedMemoryOfCurrentProcess;
341
unsigned m_peakTotalCommittedMemoryOfChromeProcess;
342
unsigned m_peakTotalMappedMemory;
345
MemoryTracker::MemoryTracker()
346
: m_memoryTrackingTimer(this, &MemoryTracker::updateMemoryPeaks)
347
, m_peakTotalUsedMemory(0)
348
, m_peakTotalCommittedMemoryOfCurrentProcess(0)
349
, m_peakTotalCommittedMemoryOfChromeProcess(0)
350
, m_peakTotalMappedMemory(0)
354
MemoryTracker& MemoryTracker::instance()
356
DEFINE_STATIC_LOCAL(MemoryTracker, s_memoryTracker, ());
357
return s_memoryTracker;
360
void MemoryTracker::start()
363
if (!m_memoryTrackingTimer.isActive())
364
m_memoryTrackingTimer.start(0, 0.01);
367
void MemoryTracker::stop()
369
m_memoryTrackingTimer.stop();
372
void MemoryTracker::updateMemoryPeaks(Timer<MemoryTracker>*)
374
// JS engine memory usage.
375
JSC::GlobalMemoryStatistics jscMemoryStat = JSC::globalMemoryStatistics();
376
JSC::Heap& mainHeap = JSDOMWindow::commonJSGlobalData()->heap;
379
struct mallinfo mallocInfo = mallinfo();
381
// Malloc and JSC memory.
382
unsigned totalUsedMemory = static_cast<unsigned>(mallocInfo.usmblks + mallocInfo.uordblks + jscMemoryStat.stackBytes + jscMemoryStat.JITBytes + mainHeap.capacity());
383
if (totalUsedMemory > m_peakTotalUsedMemory)
384
m_peakTotalUsedMemory = totalUsedMemory;
386
unsigned totalCommittedMemoryOfCurrentProcess = BlackBerry::Platform::totalCommittedMemoryOfCurrentProcess();
387
if (totalCommittedMemoryOfCurrentProcess > m_peakTotalCommittedMemoryOfCurrentProcess)
388
m_peakTotalCommittedMemoryOfCurrentProcess = totalCommittedMemoryOfCurrentProcess;
390
unsigned totalCommittedMemoryOfChromeProcess = BlackBerry::Platform::totalCommittedMemoryOfChromeProcess();
391
if (totalCommittedMemoryOfChromeProcess > m_peakTotalCommittedMemoryOfChromeProcess)
392
m_peakTotalCommittedMemoryOfChromeProcess = totalCommittedMemoryOfChromeProcess;
394
struct stat processInfo;
395
if (!stat(String::format("/proc/%u/as", getpid()).latin1().data(), &processInfo)) {
396
unsigned totalMappedMemory = static_cast<unsigned>(processInfo.st_size);
397
if (totalMappedMemory > m_peakTotalMappedMemory)
398
m_peakTotalMappedMemory = totalMappedMemory;
402
static String memoryPeaksToHtmlTable(MemoryTracker& memoryTracker)
404
String htmlTable = String("<table class='fixed-table'><col width=75%><col width=25%>")
405
+ numberToHTMLTr("Total used memory(malloc + JSC):", memoryTracker.peakTotalUsedMemory());
407
if (unsigned peakTotalCommittedMemoryOfChromeProcess = memoryTracker.peakTotalCommittedMemoryOfChromeProcess()) {
408
htmlTable += numberToHTMLTr("Total committed memory of tab process:", memoryTracker.peakTotalCommittedMemoryOfCurrentProcess());
409
htmlTable += numberToHTMLTr("Total committed memory of chrome process:", peakTotalCommittedMemoryOfChromeProcess);
411
htmlTable += numberToHTMLTr("Total committed memory:", memoryTracker.peakTotalCommittedMemoryOfCurrentProcess());
413
htmlTable += numberToHTMLTr("Total mapped memory:", memoryTracker.peakTotalMappedMemory()) + "</table>";
417
static String memoryLivePage(String memoryLiveCommand)
421
page = writeHeader("Memory Live Page")
422
+ "<div class='box'><div class='box-title'>Memory Peaks</div>"
423
+ "<div style='font-size:12px;color:#1BE0C9'>\"about:memory-live/start\": start tracking memory peaks.</div>"
424
+ "<div style='font-size:12px;color:#1BE0C9'>\"about:memory-live\": show memory peaks every 30ms.</div>"
425
+ "<div style='font-size:12px;color:#1BE0C9'>\"about:memory-live/stop\": stop tracking and show memory peaks.</div><br>";
427
MemoryTracker& memoryTracker = MemoryTracker::instance();
428
if (memoryLiveCommand.isEmpty()) {
429
if (!memoryTracker.isActive())
430
page += "<div style='font-size:15px;color:#E6F032'>Memory tracker isn't running, please use \"about:memory-live/start\" to start the tracker.</div>";
432
page += memoryPeaksToHtmlTable(memoryTracker);
433
page += "<script type=\"text/javascript\">setInterval(function(){window.location.reload()},30);</script>";
435
} else if (equalIgnoringCase(memoryLiveCommand, "/start")) {
436
memoryTracker.start();
437
page += "<div style='font-size:15px;color:#E6F032'>Memory tracker is running.</div>";
438
} else if (equalIgnoringCase(memoryLiveCommand, "/stop")) {
439
if (!memoryTracker.isActive())
440
page += "<div style='font-size:15px;color:#E6F032'>Memory tracker isn't running.</div>";
442
memoryTracker.stop();
443
page += memoryPeaksToHtmlTable(memoryTracker);
444
page += "<div style='font-size:15px;color:#E6F032'>Memory tracker is stopped.</div>";
447
page += "<div style='font-size:15spx;color:#E6F032'>Unknown command! Please input a correct command!</div>";
449
page += "</div><br></div></body></html>";
454
static String cachePage(String cacheCommand)
458
result.append(String("<html><head><title>BlackBerry Browser Disk Cache</title></head><body>"));
460
if (cacheCommand.isEmpty())
461
result.append(String(BlackBerry::Platform::generateHtmlFragmentForCacheKeys().data()));
462
else if (cacheCommand.startsWith("?query=", false)) {
463
String key(cacheCommand.substring(7).utf8().data()); // 7 is length of "query=".
465
result.append(String("<hr>"));
466
result.append(String(BlackBerry::Platform::generateHtmlFragmentForCacheHeaders(key).data()));
468
// Unknown cache command.
472
result.append(String("</body></html>"));
477
static String buildPage()
481
result.append(writeHeader("Build"));
482
result.append(String("<div class='box'><div class='box-title'>Basic</div><table>"));
483
result.append(String("<tr><td>Built On: </td><td>"));
484
result.append(String(BlackBerry::Platform::BUILDCOMPUTER));
485
result.append(String("</td></tr>"));
486
result.append(String("<tr><td>Build User: </td><td>"));
487
result.append(String(BlackBerry::Platform::BUILDUSER));
488
result.append(String("</td></tr>"));
489
result.append(String("<tr><td>Build Time: </td><td>"));
490
result.append(String(BlackBerry::Platform::BUILDTIME));
491
result.append(String("</table></div><br>"));
492
result.append(String(BlackBerry::Platform::BUILDINFO_WEBKIT));
493
result.append(String(BlackBerry::Platform::BUILDINFO_PLATFORM));
494
result.append(String(BlackBerry::Platform::BUILDINFO_LIBWEBVIEW));
495
result.append(String(BlackBerry::Platform::BUILDINFO_WEBPLATFORM));
496
result.append(String("</body></html>"));
501
static String creditsPage()
505
result.append(writeHeader("Credits"));
506
result.append(String("<style> .about {padding:14px;} </style>"));
507
result.append(String(BlackBerry::Platform::WEBKITCREDITS));
508
result.append(String("</body></html>"));
513
static String cookiePage()
517
result.append(String("<html><head><title>BlackBerry Browser cookie information</title></head><body>"));
518
result.append(cookieManager().generateHtmlFragmentForCookies());
519
result.append(String("</body></html>"));
524
String aboutData(String aboutWhat)
526
if (equalIgnoringCase(aboutWhat, "credits"))
527
return creditsPage();
529
if (aboutWhat.startsWith("cache"))
530
return cachePage(aboutWhat.substring(5));
532
if (equalIgnoringCase(aboutWhat, "memory"))
535
#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
536
if (equalIgnoringCase(aboutWhat, "cookie"))
539
if (BlackBerry::Platform::debugSetting() > 0 && equalIgnoringCase(aboutWhat, "build"))
542
if (BlackBerry::Platform::debugSetting() > 0 && equalIgnoringCase(aboutWhat, "config"))
545
if (aboutWhat.startsWith("memory-live"))
546
return memoryLivePage(aboutWhat.substring(11));
552
} // namespace WebKit
553
} // namespace BlackBerry