Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Issue 2533983003: Move hacks for Inspector in restoreCachedResourceIfNeeded() to ResourceFetcher (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 rights reserved.
7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 CheckContentSecurityPolicy, DocumentContext)); 1590 CheckContentSecurityPolicy, DocumentContext));
1591 return options; 1591 return options;
1592 } 1592 }
1593 1593
1594 String ResourceFetcher::getCacheIdentifier() const { 1594 String ResourceFetcher::getCacheIdentifier() const {
1595 if (context().isControlledByServiceWorker()) 1595 if (context().isControlledByServiceWorker())
1596 return String::number(context().serviceWorkerID()); 1596 return String::number(context().serviceWorkerID());
1597 return MemoryCache::defaultCacheIdentifier(); 1597 return MemoryCache::defaultCacheIdentifier();
1598 } 1598 }
1599 1599
1600 void ResourceFetcher::emulateLoadStartedForInspector(
1601 Resource* resource,
1602 const KURL& url,
1603 WebURLRequest::RequestContext requestContext,
1604 const AtomicString& initiatorName) {
1605 if (cachedResource(url))
1606 return;
1607 ResourceRequest resourceRequest(url);
1608 resourceRequest.setRequestContext(requestContext);
1609 FetchRequest request(resourceRequest, initiatorName, resource->options());
1610 context().canRequest(resource->getType(), resource->lastResourceRequest(),
1611 resource->lastResourceRequest().url(), request.options(),
1612 false, request.getOriginRestriction());
1613 requestLoadStarted(resource->identifier(), resource, request,
1614 ResourceLoadingFromCache);
1615 }
1616
1600 ResourceFetcher::DeadResourceStatsRecorder::DeadResourceStatsRecorder() 1617 ResourceFetcher::DeadResourceStatsRecorder::DeadResourceStatsRecorder()
1601 : m_useCount(0), m_revalidateCount(0), m_loadCount(0) {} 1618 : m_useCount(0), m_revalidateCount(0), m_loadCount(0) {}
1602 1619
1603 ResourceFetcher::DeadResourceStatsRecorder::~DeadResourceStatsRecorder() { 1620 ResourceFetcher::DeadResourceStatsRecorder::~DeadResourceStatsRecorder() {
1604 DEFINE_THREAD_SAFE_STATIC_LOCAL( 1621 DEFINE_THREAD_SAFE_STATIC_LOCAL(
1605 CustomCountHistogram, hitCountHistogram, 1622 CustomCountHistogram, hitCountHistogram,
1606 new CustomCountHistogram("WebCore.ResourceFetcher.HitCount", 0, 1000, 1623 new CustomCountHistogram("WebCore.ResourceFetcher.HitCount", 0, 1000,
1607 50)); 1624 50));
1608 hitCountHistogram.count(m_useCount); 1625 hitCountHistogram.count(m_useCount);
1609 DEFINE_THREAD_SAFE_STATIC_LOCAL( 1626 DEFINE_THREAD_SAFE_STATIC_LOCAL(
(...skipping 28 matching lines...) Expand all
1638 visitor->trace(m_context); 1655 visitor->trace(m_context);
1639 visitor->trace(m_archive); 1656 visitor->trace(m_archive);
1640 visitor->trace(m_loaders); 1657 visitor->trace(m_loaders);
1641 visitor->trace(m_nonBlockingLoaders); 1658 visitor->trace(m_nonBlockingLoaders);
1642 visitor->trace(m_documentResources); 1659 visitor->trace(m_documentResources);
1643 visitor->trace(m_preloads); 1660 visitor->trace(m_preloads);
1644 visitor->trace(m_resourceTimingInfoMap); 1661 visitor->trace(m_resourceTimingInfoMap);
1645 } 1662 }
1646 1663
1647 } // namespace blink 1664 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698