| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
| 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 ResourcePtr<CSSStyleSheetResource> ResourceFetcher::fetchUserCSSStyleSheet(Fetch
Request& request) | 330 ResourcePtr<CSSStyleSheetResource> ResourceFetcher::fetchUserCSSStyleSheet(Fetch
Request& request) |
| 331 { | 331 { |
| 332 KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(request.resourceReq
uest().url()); | 332 KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(request.resourceReq
uest().url()); |
| 333 | 333 |
| 334 if (Resource* existing = memoryCache()->resourceForURL(url)) { | 334 if (Resource* existing = memoryCache()->resourceForURL(url)) { |
| 335 if (existing->type() == Resource::CSSStyleSheet) | 335 if (existing->type() == Resource::CSSStyleSheet) |
| 336 return toCSSStyleSheetResource(existing); | 336 return toCSSStyleSheetResource(existing); |
| 337 memoryCache()->remove(existing); | 337 memoryCache()->remove(existing); |
| 338 } | 338 } |
| 339 | 339 |
| 340 request.setOptions(ResourceLoaderOptions(SniffContent, BufferData, AllowStor
edCredentials, ClientRequestedCredentials, AskClientForCrossOriginCredentials, S
kipSecurityCheck, CheckContentSecurityPolicy, DocumentContext)); | 340 request.setOptions(ResourceLoaderOptions(SniffContent, BufferData, AllowStor
edCredentials, ClientRequestedCredentials, CheckContentSecurityPolicy, DocumentC
ontext)); |
| 341 return toCSSStyleSheetResource(requestResource(Resource::CSSStyleSheet, requ
est)); | 341 return toCSSStyleSheetResource(requestResource(Resource::CSSStyleSheet, requ
est)); |
| 342 } | 342 } |
| 343 | 343 |
| 344 ResourcePtr<ScriptResource> ResourceFetcher::fetchScript(FetchRequest& request) | 344 ResourcePtr<ScriptResource> ResourceFetcher::fetchScript(FetchRequest& request) |
| 345 { | 345 { |
| 346 return toScriptResource(requestResource(Resource::Script, request)); | 346 return toScriptResource(requestResource(Resource::Script, request)); |
| 347 } | 347 } |
| 348 | 348 |
| 349 ResourcePtr<XSLStyleSheetResource> ResourceFetcher::fetchXSLStyleSheet(FetchRequ
est& request) | 349 ResourcePtr<XSLStyleSheetResource> ResourceFetcher::fetchXSLStyleSheet(FetchRequ
est& request) |
| 350 { | 350 { |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 printf("SCRIPTS: %d (%d hits, hit rate %d%%)\n", scripts, scripts - scri
ptMisses, (scripts - scriptMisses) * 100 / scripts); | 1363 printf("SCRIPTS: %d (%d hits, hit rate %d%%)\n", scripts, scripts - scri
ptMisses, (scripts - scriptMisses) * 100 / scripts); |
| 1364 if (stylesheets) | 1364 if (stylesheets) |
| 1365 printf("STYLESHEETS: %d (%d hits, hit rate %d%%)\n", stylesheets, styles
heets - stylesheetMisses, (stylesheets - stylesheetMisses) * 100 / stylesheets); | 1365 printf("STYLESHEETS: %d (%d hits, hit rate %d%%)\n", stylesheets, styles
heets - stylesheetMisses, (stylesheets - stylesheetMisses) * 100 / stylesheets); |
| 1366 if (images) | 1366 if (images) |
| 1367 printf("IMAGES: %d (%d hits, hit rate %d%%)\n", images, images - imageM
isses, (images - imageMisses) * 100 / images); | 1367 printf("IMAGES: %d (%d hits, hit rate %d%%)\n", images, images - imageM
isses, (images - imageMisses) * 100 / images); |
| 1368 } | 1368 } |
| 1369 #endif | 1369 #endif |
| 1370 | 1370 |
| 1371 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() | 1371 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() |
| 1372 { | 1372 { |
| 1373 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SniffContent, BufferDat
a, AllowStoredCredentials, ClientRequestedCredentials, AskClientForCrossOriginCr
edentials, DoSecurityCheck, CheckContentSecurityPolicy, DocumentContext)); | 1373 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SniffContent, BufferDat
a, AllowStoredCredentials, ClientRequestedCredentials, CheckContentSecurityPolic
y, DocumentContext)); |
| 1374 return options; | 1374 return options; |
| 1375 } | 1375 } |
| 1376 | 1376 |
| 1377 ResourceFetcher::DeadResourceStatsRecorder::DeadResourceStatsRecorder() | 1377 ResourceFetcher::DeadResourceStatsRecorder::DeadResourceStatsRecorder() |
| 1378 : m_useCount(0) | 1378 : m_useCount(0) |
| 1379 , m_revalidateCount(0) | 1379 , m_revalidateCount(0) |
| 1380 , m_loadCount(0) | 1380 , m_loadCount(0) |
| 1381 { | 1381 { |
| 1382 } | 1382 } |
| 1383 | 1383 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1401 case Revalidate: | 1401 case Revalidate: |
| 1402 ++m_revalidateCount; | 1402 ++m_revalidateCount; |
| 1403 return; | 1403 return; |
| 1404 case Use: | 1404 case Use: |
| 1405 ++m_useCount; | 1405 ++m_useCount; |
| 1406 return; | 1406 return; |
| 1407 } | 1407 } |
| 1408 } | 1408 } |
| 1409 | 1409 |
| 1410 } | 1410 } |
| OLD | NEW |