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

Side by Side Diff: Source/core/fetch/Resource.cpp

Issue 432273004: Implement Blink-side changes to enable V8 code caching. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix very silly bug that causes an unitialized field and a CHECK fail at startup. Created 6 years, 4 months 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 | « Source/core/fetch/Resource.h ('k') | Source/core/frame/Settings.h » ('j') | 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 // Currently, only one type of cached metadata per resource is supported. 415 // Currently, only one type of cached metadata per resource is supported.
416 // If the need arises for multiple types of metadata per resource this could 416 // If the need arises for multiple types of metadata per resource this could
417 // be enhanced to store types of metadata in a map. 417 // be enhanced to store types of metadata in a map.
418 ASSERT(!m_cachedMetadata); 418 ASSERT(!m_cachedMetadata);
419 419
420 m_cachedMetadata = CachedMetadata::create(dataTypeID, data, size); 420 m_cachedMetadata = CachedMetadata::create(dataTypeID, data, size);
421 const Vector<char>& serializedData = m_cachedMetadata->serialize(); 421 const Vector<char>& serializedData = m_cachedMetadata->serialize();
422 blink::Platform::current()->cacheMetadata(m_response.url(), m_response.respo nseTime(), serializedData.data(), serializedData.size()); 422 blink::Platform::current()->cacheMetadata(m_response.url(), m_response.respo nseTime(), serializedData.data(), serializedData.size());
423 } 423 }
424 424
425 void Resource::clearCachedMetadata()
426 {
427 m_cachedMetadata.clear();
428 }
429
425 bool Resource::canDelete() const 430 bool Resource::canDelete() const
426 { 431 {
427 return !hasClients() && !m_loader && !m_preloadCount && hasRightHandleCountA partFromCache(0) 432 return !hasClients() && !m_loader && !m_preloadCount && hasRightHandleCountA partFromCache(0)
428 && !m_protectorCount && !m_resourceToRevalidate && !m_proxyResource; 433 && !m_protectorCount && !m_resourceToRevalidate && !m_proxyResource;
429 } 434 }
430 435
431 bool Resource::hasOneHandle() const 436 bool Resource::hasOneHandle() const
432 { 437 {
433 return hasRightHandleCountApartFromCache(1); 438 return hasRightHandleCountApartFromCache(1);
434 } 439 }
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 return "ImportResource"; 1011 return "ImportResource";
1007 case Resource::Media: 1012 case Resource::Media:
1008 return "Media"; 1013 return "Media";
1009 } 1014 }
1010 ASSERT_NOT_REACHED(); 1015 ASSERT_NOT_REACHED();
1011 return "Unknown"; 1016 return "Unknown";
1012 } 1017 }
1013 #endif // !LOG_DISABLED 1018 #endif // !LOG_DISABLED
1014 1019
1015 } 1020 }
OLDNEW
« no previous file with comments | « Source/core/fetch/Resource.h ('k') | Source/core/frame/Settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698