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

Side by Side Diff: third_party/WebKit/Source/core/fetch/Resource.h

Issue 1369253002: Add Web Resources usage to chrome://tracing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Patch Set: Use singleton provider. Created 5 years, 2 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
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) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
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 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 virtual void didSendData(unsigned long long /* bytesSent */, unsigned long l ong /* totalBytesToBeSent */) { } 253 virtual void didSendData(unsigned long long /* bytesSent */, unsigned long l ong /* totalBytesToBeSent */) { }
254 virtual void didDownloadData(int) { } 254 virtual void didDownloadData(int) { }
255 255
256 double loadFinishTime() const { return m_loadFinishTime; } 256 double loadFinishTime() const { return m_loadFinishTime; }
257 257
258 virtual bool canReuse(const ResourceRequest&) const { return true; } 258 virtual bool canReuse(const ResourceRequest&) const { return true; }
259 259
260 // Used by the MemoryCache to reduce the memory consumption of the entry. 260 // Used by the MemoryCache to reduce the memory consumption of the entry.
261 void prune(); 261 void prune();
262 262
263 virtual void onMemoryDump(WebProcessMemoryDump*) const;
264
263 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); 265 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&);
264 266
265 #ifdef ENABLE_RESOURCE_IS_DELETED_CHECK 267 #ifdef ENABLE_RESOURCE_IS_DELETED_CHECK
266 void assertAlive() const { RELEASE_ASSERT(!m_deleted); } 268 void assertAlive() const { RELEASE_ASSERT(!m_deleted); }
267 #else 269 #else
268 void assertAlive() const { } 270 void assertAlive() const { }
269 #endif 271 #endif
270 272
271 protected: 273 protected:
272 virtual void checkNotify(); 274 virtual void checkNotify();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 338 }
337 339
338 ResourceRequest m_request; 340 ResourceRequest m_request;
339 ResourceResponse m_redirectResponse; 341 ResourceResponse m_redirectResponse;
340 }; 342 };
341 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain; } 343 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain; }
342 344
343 virtual bool isSafeToUnlock() const { return false; } 345 virtual bool isSafeToUnlock() const { return false; }
344 virtual void destroyDecodedDataIfPossible() { } 346 virtual void destroyDecodedDataIfPossible() { }
345 347
348 // Returns the memory dump name used for tracing. See Resource::onMemoryDump .
349 String getMemoryDumpName() const;
350
346 ResourceRequest m_resourceRequest; 351 ResourceRequest m_resourceRequest;
347 AtomicString m_accept; 352 AtomicString m_accept;
348 PersistentWillBeMember<ResourceLoader> m_loader; 353 PersistentWillBeMember<ResourceLoader> m_loader;
349 ResourceLoaderOptions m_options; 354 ResourceLoaderOptions m_options;
350 355
351 ResourceResponse m_response; 356 ResourceResponse m_response;
352 double m_responseTimestamp; 357 double m_responseTimestamp;
353 358
354 RefPtr<SharedBuffer> m_data; 359 RefPtr<SharedBuffer> m_data;
355 Timer<Resource> m_cancelTimer; 360 Timer<Resource> m_cancelTimer;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 const char* ResourceTypeName(Resource::Type); 446 const char* ResourceTypeName(Resource::Type);
442 #endif 447 #endif
443 448
444 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 449 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
445 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \ 450 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \
446 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); } 451 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); }
447 452
448 } 453 }
449 454
450 #endif 455 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698