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/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 public: | 29 public: |
30 // TODO(clamy): The browser should be made aware on destruction of this struct | 30 // TODO(clamy): The browser should be made aware on destruction of this struct |
31 // that it can release its associated stream handle. | 31 // that it can release its associated stream handle. |
32 GURL stream_url; | 32 GURL stream_url; |
33 ResourceResponseHead response; | 33 ResourceResponseHead response; |
34 }; | 34 }; |
35 | 35 |
36 class CONTENT_EXPORT WebURLLoaderImpl | 36 class CONTENT_EXPORT WebURLLoaderImpl |
37 : public NON_EXPORTED_BASE(blink::WebURLLoader) { | 37 : public NON_EXPORTED_BASE(blink::WebURLLoader) { |
38 public: | 38 public: |
39 explicit WebURLLoaderImpl( | 39 |
40 ResourceDispatcher* resource_dispatcher, | 40 // Takes ownership of |web_task_runner|. |
41 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 41 WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher, |
| 42 scoped_ptr<blink::WebTaskRunner> web_task_runner); |
42 ~WebURLLoaderImpl() override; | 43 ~WebURLLoaderImpl() override; |
43 | 44 |
44 static void PopulateURLResponse(const GURL& url, | 45 static void PopulateURLResponse(const GURL& url, |
45 const ResourceResponseInfo& info, | 46 const ResourceResponseInfo& info, |
46 blink::WebURLResponse* response, | 47 blink::WebURLResponse* response, |
47 bool report_security_info); | 48 bool report_security_info); |
48 static void PopulateURLRequestForRedirect( | 49 static void PopulateURLRequestForRedirect( |
49 const blink::WebURLRequest& request, | 50 const blink::WebURLRequest& request, |
50 const net::RedirectInfo& redirect_info, | 51 const net::RedirectInfo& redirect_info, |
51 blink::WebReferrerPolicy referrer_policy, | 52 blink::WebReferrerPolicy referrer_policy, |
52 bool skip_service_worker, | 53 bool skip_service_worker, |
53 blink::WebURLRequest* new_request); | 54 blink::WebURLRequest* new_request); |
54 | 55 |
55 // WebURLLoader methods: | 56 // WebURLLoader methods: |
56 void loadSynchronously( | 57 void loadSynchronously( |
57 const blink::WebURLRequest& request, | 58 const blink::WebURLRequest& request, |
58 blink::WebURLResponse& response, | 59 blink::WebURLResponse& response, |
59 blink::WebURLError& error, | 60 blink::WebURLError& error, |
60 blink::WebData& data) override; | 61 blink::WebData& data) override; |
61 void loadAsynchronously( | 62 void loadAsynchronously( |
62 const blink::WebURLRequest& request, | 63 const blink::WebURLRequest& request, |
63 blink::WebURLLoaderClient* client) override; | 64 blink::WebURLLoaderClient* client) override; |
64 void cancel() override; | 65 void cancel() override; |
65 void setDefersLoading(bool value) override; | 66 void setDefersLoading(bool value) override; |
66 void didChangePriority(blink::WebURLRequest::Priority new_priority, | 67 void didChangePriority(blink::WebURLRequest::Priority new_priority, |
67 int intra_priority_value) override; | 68 int intra_priority_value) override; |
68 bool attachThreadedDataReceiver( | 69 bool attachThreadedDataReceiver( |
69 blink::WebThreadedDataReceiver* threaded_data_receiver) override; | 70 blink::WebThreadedDataReceiver* threaded_data_receiver) override; |
| 71 void setLoadingTaskRunner(blink::WebTaskRunner* loading_task_runner) override; |
70 | 72 |
71 private: | 73 private: |
72 class Context; | 74 class Context; |
73 scoped_refptr<Context> context_; | 75 scoped_refptr<Context> context_; |
74 | 76 |
75 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); | 77 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); |
76 }; | 78 }; |
77 | 79 |
78 } // namespace content | 80 } // namespace content |
79 | 81 |
80 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ | 82 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ |
OLD | NEW |