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 25 matching lines...) Expand all Loading... | |
36 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
37 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 | 40 |
41 class Resource; | 41 class Resource; |
42 class KURL; | 42 class KURL; |
43 class ResourceError; | 43 class ResourceError; |
44 class ResourceResponse; | 44 class ResourceResponse; |
45 class ResourceLoaderHost; | 45 class ResourceLoaderHost; |
46 class WebParserResourceBridge; | |
46 | 47 |
47 class ResourceLoader : public RefCounted<ResourceLoader>, protected blink::WebUR LLoaderClient { | 48 class ResourceLoader : public RefCounted<ResourceLoader>, protected blink::WebUR LLoaderClient { |
48 public: | 49 public: |
49 static PassRefPtr<ResourceLoader> create(ResourceLoaderHost*, Resource*, con st ResourceRequest&, const ResourceLoaderOptions&); | 50 static PassRefPtr<ResourceLoader> create(ResourceLoaderHost*, Resource*, con st ResourceRequest&, const ResourceLoaderOptions&); |
50 virtual ~ResourceLoader(); | 51 virtual ~ResourceLoader(); |
51 | 52 |
52 void start(); | 53 void start(); |
53 void changeToSynchronous(); | 54 void changeToSynchronous(); |
54 | 55 |
55 void cancel(); | 56 void cancel(); |
56 void cancel(const ResourceError&); | 57 void cancel(const ResourceError&); |
57 void cancelIfNotFinishing(); | 58 void cancelIfNotFinishing(); |
58 | 59 |
59 Resource* cachedResource() { return m_resource; } | 60 Resource* cachedResource() { return m_resource; } |
60 const ResourceRequest& originalRequest() const { return m_originalRequest; } | 61 const ResourceRequest& originalRequest() const { return m_originalRequest; } |
61 | 62 |
62 void setDefersLoading(bool); | 63 void setDefersLoading(bool); |
63 bool defersLoading() const { return m_defersLoading; } | 64 bool defersLoading() const { return m_defersLoading; } |
64 | 65 |
66 PassOwnPtr<blink::WebParserResourceBridge> constructParserResourceBridge(); | |
abarth-chromium
2013/12/18 18:28:49
constructFoo -> createFoo
| |
67 | |
65 void releaseResources(); | 68 void releaseResources(); |
66 | 69 |
67 void didChangePriority(ResourceLoadPriority); | 70 void didChangePriority(ResourceLoadPriority); |
68 | 71 |
69 // WebURLLoaderClient | 72 // WebURLLoaderClient |
70 virtual void willSendRequest(blink::WebURLLoader*, blink::WebURLRequest&, co nst blink::WebURLResponse& redirectResponse) OVERRIDE; | 73 virtual void willSendRequest(blink::WebURLLoader*, blink::WebURLRequest&, co nst blink::WebURLResponse& redirectResponse) OVERRIDE; |
71 virtual void didSendData(blink::WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) OVERRIDE; | 74 virtual void didSendData(blink::WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) OVERRIDE; |
72 virtual void didReceiveResponse(blink::WebURLLoader*, const blink::WebURLRes ponse&) OVERRIDE; | 75 virtual void didReceiveResponse(blink::WebURLLoader*, const blink::WebURLRes ponse&) OVERRIDE; |
73 virtual void didReceiveData(blink::WebURLLoader*, const char*, int, int enco dedDataLength) OVERRIDE; | 76 virtual void didReceiveData(blink::WebURLLoader*, const char*, int, int enco dedDataLength) OVERRIDE; |
74 virtual void didReceiveCachedMetadata(blink::WebURLLoader*, const char* data , int length) OVERRIDE; | 77 virtual void didReceiveCachedMetadata(blink::WebURLLoader*, const char* data , int length) OVERRIDE; |
75 virtual void didFinishLoading(blink::WebURLLoader*, double finishTime) OVERR IDE; | 78 virtual void didFinishLoading(blink::WebURLLoader*, double finishTime) OVERR IDE; |
76 virtual void didFail(blink::WebURLLoader*, const blink::WebURLError&) OVERRI DE; | 79 virtual void didFail(blink::WebURLLoader*, const blink::WebURLError&) OVERRI DE; |
77 virtual void didDownloadData(blink::WebURLLoader*, int, int) OVERRIDE; | 80 virtual void didDownloadData(blink::WebURLLoader*, int, int) OVERRIDE; |
81 virtual void didAddParserResourceMessageFilter() OVERRIDE; | |
78 | 82 |
79 const KURL& url() const { return m_request.url(); } | 83 const KURL& url() const { return m_request.url(); } |
80 bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCall backs == SendCallbacks; } | 84 bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCall backs == SendCallbacks; } |
81 bool shouldSniffContent() const { return m_options.sniffContent == SniffCont ent; } | 85 bool shouldSniffContent() const { return m_options.sniffContent == SniffCont ent; } |
82 bool isLoadedBy(ResourceLoaderHost*) const; | 86 bool isLoadedBy(ResourceLoaderHost*) const; |
83 | 87 |
84 bool reachedTerminalState() const { return m_state == Terminated; } | 88 bool reachedTerminalState() const { return m_state == Terminated; } |
85 const ResourceRequest& request() const { return m_request; } | 89 const ResourceRequest& request() const { return m_request; } |
86 | 90 |
87 private: | 91 private: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 // Used for sanity checking to make sure we don't experience illegal state | 139 // Used for sanity checking to make sure we don't experience illegal state |
136 // transitions. | 140 // transitions. |
137 ConnectionState m_connectionState; | 141 ConnectionState m_connectionState; |
138 | 142 |
139 OwnPtr<RequestCountTracker> m_requestCountTracker; | 143 OwnPtr<RequestCountTracker> m_requestCountTracker; |
140 }; | 144 }; |
141 | 145 |
142 } | 146 } |
143 | 147 |
144 #endif | 148 #endif |
OLD | NEW |