OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_CHILD_WEBURLLOADER_IMPL_H_ | 5 #ifndef WEBKIT_CHILD_WEBURLLOADER_IMPL_H_ |
6 #define WEBKIT_CHILD_WEBURLLOADER_IMPL_H_ | 6 #define WEBKIT_CHILD_WEBURLLOADER_IMPL_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 9 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
| 10 #include "webkit/child/webkit_child_export.h" |
10 | 11 |
11 namespace webkit_glue { | 12 namespace webkit_glue { |
12 | 13 |
13 class WebKitPlatformSupportImpl; | 14 class WebKitPlatformSupportImpl; |
| 15 struct ResourceResponseInfo; |
14 | 16 |
15 class WebURLLoaderImpl : public WebKit::WebURLLoader { | 17 class WebURLLoaderImpl : public WebKit::WebURLLoader { |
16 public: | 18 public: |
17 explicit WebURLLoaderImpl(WebKitPlatformSupportImpl* platform); | 19 explicit WebURLLoaderImpl(WebKitPlatformSupportImpl* platform); |
18 virtual ~WebURLLoaderImpl(); | 20 virtual ~WebURLLoaderImpl(); |
19 | 21 |
20 static WebKit::WebURLError CreateError(const WebKit::WebURL& unreachable_url, | 22 static WebKit::WebURLError CreateError(const WebKit::WebURL& unreachable_url, |
21 int reason); | 23 int reason); |
| 24 WEBKIT_CHILD_EXPORT static void PopulateURLResponse( |
| 25 const GURL& url, |
| 26 const ResourceResponseInfo& info, |
| 27 WebKit::WebURLResponse* response); |
22 | 28 |
23 // WebURLLoader methods: | 29 // WebURLLoader methods: |
24 virtual void loadSynchronously( | 30 virtual void loadSynchronously( |
25 const WebKit::WebURLRequest& request, | 31 const WebKit::WebURLRequest& request, |
26 WebKit::WebURLResponse& response, | 32 WebKit::WebURLResponse& response, |
27 WebKit::WebURLError& error, | 33 WebKit::WebURLError& error, |
28 WebKit::WebData& data); | 34 WebKit::WebData& data); |
29 virtual void loadAsynchronously( | 35 virtual void loadAsynchronously( |
30 const WebKit::WebURLRequest& request, | 36 const WebKit::WebURLRequest& request, |
31 WebKit::WebURLLoaderClient* client); | 37 WebKit::WebURLLoaderClient* client); |
32 virtual void cancel(); | 38 virtual void cancel(); |
33 virtual void setDefersLoading(bool value); | 39 virtual void setDefersLoading(bool value); |
34 virtual void didChangePriority(WebKit::WebURLRequest::Priority new_priority); | 40 virtual void didChangePriority(WebKit::WebURLRequest::Priority new_priority); |
35 | 41 |
36 private: | 42 private: |
37 class Context; | 43 class Context; |
38 scoped_refptr<Context> context_; | 44 scoped_refptr<Context> context_; |
39 WebKitPlatformSupportImpl* platform_; | 45 WebKitPlatformSupportImpl* platform_; |
40 }; | 46 }; |
41 | 47 |
42 } // namespace webkit_glue | 48 } // namespace webkit_glue |
43 | 49 |
44 #endif // WEBKIT_CHILD_WEBURLLOADER_IMPL_H_ | 50 #endif // WEBKIT_CHILD_WEBURLLOADER_IMPL_H_ |
OLD | NEW |