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