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) 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 | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 rights reserved. | 6 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 11 matching lines...) Expand all Loading... |
22 */ | 22 */ |
23 | 23 |
24 #ifndef Resource_h | 24 #ifndef Resource_h |
25 #define Resource_h | 25 #define Resource_h |
26 | 26 |
27 #include <memory> | 27 #include <memory> |
28 #include "platform/MemoryCoordinator.h" | 28 #include "platform/MemoryCoordinator.h" |
29 #include "platform/PlatformExport.h" | 29 #include "platform/PlatformExport.h" |
30 #include "platform/SharedBuffer.h" | 30 #include "platform/SharedBuffer.h" |
31 #include "platform/Timer.h" | 31 #include "platform/Timer.h" |
| 32 #include "platform/WebTaskRunner.h" |
32 #include "platform/instrumentation/tracing/web_process_memory_dump.h" | 33 #include "platform/instrumentation/tracing/web_process_memory_dump.h" |
33 #include "platform/loader/fetch/CachedMetadataHandler.h" | 34 #include "platform/loader/fetch/CachedMetadataHandler.h" |
34 #include "platform/loader/fetch/IntegrityMetadata.h" | 35 #include "platform/loader/fetch/IntegrityMetadata.h" |
35 #include "platform/loader/fetch/ResourceError.h" | 36 #include "platform/loader/fetch/ResourceError.h" |
36 #include "platform/loader/fetch/ResourceLoadPriority.h" | 37 #include "platform/loader/fetch/ResourceLoadPriority.h" |
37 #include "platform/loader/fetch/ResourceLoaderOptions.h" | 38 #include "platform/loader/fetch/ResourceLoaderOptions.h" |
38 #include "platform/loader/fetch/ResourceRequest.h" | 39 #include "platform/loader/fetch/ResourceRequest.h" |
39 #include "platform/loader/fetch/ResourceResponse.h" | 40 #include "platform/loader/fetch/ResourceResponse.h" |
40 #include "platform/loader/fetch/ResourceStatus.h" | 41 #include "platform/loader/fetch/ResourceStatus.h" |
41 #include "platform/wtf/Allocator.h" | 42 #include "platform/wtf/Allocator.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 407 } |
407 | 408 |
408 void SetCachePolicyBypassingCache(); | 409 void SetCachePolicyBypassingCache(); |
409 void SetPreviewsStateNoTransform(); | 410 void SetPreviewsStateNoTransform(); |
410 void ClearRangeRequestHeader(); | 411 void ClearRangeRequestHeader(); |
411 | 412 |
412 SharedBuffer* Data() const { return data_.Get(); } | 413 SharedBuffer* Data() const { return data_.Get(); } |
413 void ClearData(); | 414 void ClearData(); |
414 | 415 |
415 private: | 416 private: |
416 class ResourceCallback; | |
417 class CachedMetadataHandlerImpl; | 417 class CachedMetadataHandlerImpl; |
418 class ServiceWorkerResponseCachedMetadataHandler; | 418 class ServiceWorkerResponseCachedMetadataHandler; |
419 | 419 |
420 void CancelTimerFired(TimerBase*); | 420 void CancelTimerFired(TimerBase*); |
421 | 421 |
422 void RevalidationSucceeded(const ResourceResponse&); | 422 void RevalidationSucceeded(const ResourceResponse&); |
423 void RevalidationFailed(); | 423 void RevalidationFailed(); |
424 | 424 |
425 size_t CalculateOverheadSize() const; | 425 size_t CalculateOverheadSize() const; |
426 | 426 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 473 |
474 HeapHashCountedSet<WeakMember<ResourceClient>> clients_; | 474 HeapHashCountedSet<WeakMember<ResourceClient>> clients_; |
475 HeapHashCountedSet<WeakMember<ResourceClient>> clients_awaiting_callback_; | 475 HeapHashCountedSet<WeakMember<ResourceClient>> clients_awaiting_callback_; |
476 HeapHashCountedSet<WeakMember<ResourceClient>> finished_clients_; | 476 HeapHashCountedSet<WeakMember<ResourceClient>> finished_clients_; |
477 | 477 |
478 ResourceLoaderOptions options_; | 478 ResourceLoaderOptions options_; |
479 | 479 |
480 double response_timestamp_; | 480 double response_timestamp_; |
481 | 481 |
482 TaskRunnerTimer<Resource> cancel_timer_; | 482 TaskRunnerTimer<Resource> cancel_timer_; |
| 483 TaskHandle async_finish_pending_clients_task_; |
483 | 484 |
484 ResourceRequest resource_request_; | 485 ResourceRequest resource_request_; |
485 Member<ResourceLoader> loader_; | 486 Member<ResourceLoader> loader_; |
486 ResourceResponse response_; | 487 ResourceResponse response_; |
487 | 488 |
488 RefPtr<SharedBuffer> data_; | 489 RefPtr<SharedBuffer> data_; |
489 }; | 490 }; |
490 | 491 |
491 class ResourceFactory { | 492 class ResourceFactory { |
492 STACK_ALLOCATED(); | 493 STACK_ALLOCATED(); |
(...skipping 11 matching lines...) Expand all Loading... |
504 }; | 505 }; |
505 | 506 |
506 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 507 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
507 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ | 508 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ |
508 resource->GetType() == Resource::k##typeName, \ | 509 resource->GetType() == Resource::k##typeName, \ |
509 resource.GetType() == Resource::k##typeName); | 510 resource.GetType() == Resource::k##typeName); |
510 | 511 |
511 } // namespace blink | 512 } // namespace blink |
512 | 513 |
513 #endif | 514 #endif |
OLD | NEW |