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