| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 class WebThreadedDataReceiver; | 40 class WebThreadedDataReceiver; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 class Resource; | 45 class Resource; |
| 46 class KURL; | 46 class KURL; |
| 47 class ResourceError; | 47 class ResourceError; |
| 48 class ResourceLoaderHost; | 48 class ResourceLoaderHost; |
| 49 | 49 |
| 50 class ResourceLoader FINAL : public RefCountedWillBeGarbageCollectedFinalized<Re
sourceLoader>, protected WebURLLoaderClient { | 50 class ResourceLoader final : public RefCountedWillBeGarbageCollectedFinalized<Re
sourceLoader>, protected WebURLLoaderClient { |
| 51 public: | 51 public: |
| 52 static PassRefPtrWillBeRawPtr<ResourceLoader> create(ResourceLoaderHost*, Re
source*, const ResourceRequest&, const ResourceLoaderOptions&); | 52 static PassRefPtrWillBeRawPtr<ResourceLoader> create(ResourceLoaderHost*, Re
source*, const ResourceRequest&, const ResourceLoaderOptions&); |
| 53 virtual ~ResourceLoader(); | 53 virtual ~ResourceLoader(); |
| 54 void trace(Visitor*); | 54 void trace(Visitor*); |
| 55 | 55 |
| 56 void start(); | 56 void start(); |
| 57 void changeToSynchronous(); | 57 void changeToSynchronous(); |
| 58 | 58 |
| 59 void cancel(); | 59 void cancel(); |
| 60 void cancel(const ResourceError&); | 60 void cancel(const ResourceError&); |
| 61 void cancelIfNotFinishing(); | 61 void cancelIfNotFinishing(); |
| 62 | 62 |
| 63 Resource* cachedResource() { return m_resource; } | 63 Resource* cachedResource() { return m_resource; } |
| 64 const ResourceRequest& originalRequest() const { return m_originalRequest; } | 64 const ResourceRequest& originalRequest() const { return m_originalRequest; } |
| 65 | 65 |
| 66 void setDefersLoading(bool); | 66 void setDefersLoading(bool); |
| 67 bool defersLoading() const { return m_defersLoading; } | 67 bool defersLoading() const { return m_defersLoading; } |
| 68 | 68 |
| 69 void attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDataReceiver>); | 69 void attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDataReceiver>); |
| 70 | 70 |
| 71 void releaseResources(); | 71 void releaseResources(); |
| 72 | 72 |
| 73 void didChangePriority(ResourceLoadPriority, int intraPriorityValue); | 73 void didChangePriority(ResourceLoadPriority, int intraPriorityValue); |
| 74 | 74 |
| 75 // WebURLLoaderClient | 75 // WebURLLoaderClient |
| 76 virtual void willSendRequest(blink::WebURLLoader*, blink::WebURLRequest&, co
nst blink::WebURLResponse& redirectResponse) OVERRIDE; | 76 virtual void willSendRequest(blink::WebURLLoader*, blink::WebURLRequest&, co
nst blink::WebURLResponse& redirectResponse) override; |
| 77 virtual void didSendData(blink::WebURLLoader*, unsigned long long bytesSent,
unsigned long long totalBytesToBeSent) OVERRIDE; | 77 virtual void didSendData(blink::WebURLLoader*, unsigned long long bytesSent,
unsigned long long totalBytesToBeSent) override; |
| 78 virtual void didReceiveResponse(blink::WebURLLoader*, const blink::WebURLRes
ponse&) OVERRIDE; | 78 virtual void didReceiveResponse(blink::WebURLLoader*, const blink::WebURLRes
ponse&) override; |
| 79 virtual void didReceiveData(blink::WebURLLoader*, const char*, int, int enco
dedDataLength) OVERRIDE; | 79 virtual void didReceiveData(blink::WebURLLoader*, const char*, int, int enco
dedDataLength) override; |
| 80 virtual void didReceiveCachedMetadata(blink::WebURLLoader*, const char* data
, int length) OVERRIDE; | 80 virtual void didReceiveCachedMetadata(blink::WebURLLoader*, const char* data
, int length) override; |
| 81 virtual void didFinishLoading(blink::WebURLLoader*, double finishTime, int64
encodedDataLength) OVERRIDE; | 81 virtual void didFinishLoading(blink::WebURLLoader*, double finishTime, int64
encodedDataLength) override; |
| 82 virtual void didFail(blink::WebURLLoader*, const blink::WebURLError&) OVERRI
DE; | 82 virtual void didFail(blink::WebURLLoader*, const blink::WebURLError&) overri
de; |
| 83 virtual void didDownloadData(blink::WebURLLoader*, int, int) OVERRIDE; | 83 virtual void didDownloadData(blink::WebURLLoader*, int, int) override; |
| 84 | 84 |
| 85 const KURL& url() const { return m_request.url(); } | 85 const KURL& url() const { return m_request.url(); } |
| 86 bool isLoadedBy(ResourceLoaderHost*) const; | 86 bool isLoadedBy(ResourceLoaderHost*) const; |
| 87 | 87 |
| 88 bool reachedTerminalState() const { return m_state == Terminated; } | 88 bool reachedTerminalState() const { return m_state == Terminated; } |
| 89 const ResourceRequest& request() const { return m_request; } | 89 const ResourceRequest& request() const { return m_request; } |
| 90 | 90 |
| 91 class RequestCountTracker { | 91 class RequestCountTracker { |
| 92 public: | 92 public: |
| 93 RequestCountTracker(ResourceLoaderHost*, Resource*); | 93 RequestCountTracker(ResourceLoaderHost*, Resource*); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Used for sanity checking to make sure we don't experience illegal state | 144 // Used for sanity checking to make sure we don't experience illegal state |
| 145 // transitions. | 145 // transitions. |
| 146 ConnectionState m_connectionState; | 146 ConnectionState m_connectionState; |
| 147 | 147 |
| 148 OwnPtr<RequestCountTracker> m_requestCountTracker; | 148 OwnPtr<RequestCountTracker> m_requestCountTracker; |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } | 151 } |
| 152 | 152 |
| 153 #endif | 153 #endif |
| OLD | NEW |