OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_NPAPI_URL_FETCHER_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_URL_FETCHER_H_ |
6 #define CONTENT_CHILD_NPAPI_URL_FETCHER_H_ | 6 #define CONTENT_CHILD_NPAPI_URL_FETCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/public/child/request_peer.h" |
11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
12 #include "webkit/child/resource_loader_bridge.h" | |
13 | 13 |
14 namespace webkit_glue { | 14 namespace webkit_glue { |
15 class MultipartResponseDelegate; | 15 class MultipartResponseDelegate; |
16 class ResourceLoaderBridge; | 16 class ResourceLoaderBridge; |
17 } | 17 } |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class PluginStreamUrl; | 20 class PluginStreamUrl; |
21 | 21 |
22 // Fetches URLS for a plugin using ResourceDispatcher. | 22 // Fetches URLS for a plugin using ResourceDispatcher. |
23 class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer { | 23 class PluginURLFetcher : public RequestPeer { |
24 public: | 24 public: |
25 PluginURLFetcher(PluginStreamUrl* plugin_stream, | 25 PluginURLFetcher(PluginStreamUrl* plugin_stream, |
26 const GURL& url, | 26 const GURL& url, |
27 const GURL& first_party_for_cookies, | 27 const GURL& first_party_for_cookies, |
28 const std::string& method, | 28 const std::string& method, |
29 const char* buf, | 29 const char* buf, |
30 unsigned int len, | 30 unsigned int len, |
31 const GURL& referrer, | 31 const GURL& referrer, |
32 const std::string& range, | 32 const std::string& range, |
33 bool notify_redirects, | 33 bool notify_redirects, |
(...skipping 13 matching lines...) Expand all Loading... |
47 | 47 |
48 GURL first_party_for_cookies() { return first_party_for_cookies_; } | 48 GURL first_party_for_cookies() { return first_party_for_cookies_; } |
49 GURL referrer() { return referrer_; } | 49 GURL referrer() { return referrer_; } |
50 int origin_pid() { return origin_pid_; } | 50 int origin_pid() { return origin_pid_; } |
51 int render_frame_id() { return render_frame_id_; } | 51 int render_frame_id() { return render_frame_id_; } |
52 int render_view_id() { return render_view_id_; } | 52 int render_view_id() { return render_view_id_; } |
53 bool copy_stream_data() { return copy_stream_data_; } | 53 bool copy_stream_data() { return copy_stream_data_; } |
54 bool pending_failure_notification() { return pending_failure_notification_; } | 54 bool pending_failure_notification() { return pending_failure_notification_; } |
55 | 55 |
56 private: | 56 private: |
57 // webkit_glue::ResourceLoaderBridge::Peer implementation: | 57 // RequestPeer implementation: |
58 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE; | 58 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE; |
59 virtual bool OnReceivedRedirect(const GURL& new_url, | 59 virtual bool OnReceivedRedirect(const GURL& new_url, |
60 const webkit_glue::ResourceResponseInfo& info, | 60 const webkit_glue::ResourceResponseInfo& info, |
61 bool* has_new_first_party_for_cookies, | 61 bool* has_new_first_party_for_cookies, |
62 GURL* new_first_party_for_cookies) OVERRIDE; | 62 GURL* new_first_party_for_cookies) OVERRIDE; |
63 virtual void OnReceivedResponse( | 63 virtual void OnReceivedResponse( |
64 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; | 64 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; |
65 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE; | 65 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE; |
66 virtual void OnReceivedData(const char* data, | 66 virtual void OnReceivedData(const char* data, |
67 int data_length, | 67 int data_length, |
68 int encoded_data_length) OVERRIDE; | 68 int encoded_data_length) OVERRIDE; |
69 virtual void OnCompletedRequest( | 69 virtual void OnCompletedRequest(int error_code, |
70 int error_code, | 70 bool was_ignored_by_handler, |
71 bool was_ignored_by_handler, | 71 bool stale_copy_in_cache, |
72 bool stale_copy_in_cache, | 72 const std::string& security_info, |
73 const std::string& security_info, | 73 const base::TimeTicks& completion_time, |
74 const base::TimeTicks& completion_time, | 74 int64 total_transfer_size) OVERRIDE; |
75 int64 total_transfer_size) OVERRIDE; | |
76 | 75 |
77 PluginStreamUrl* plugin_stream_; | 76 PluginStreamUrl* plugin_stream_; |
78 GURL url_; | 77 GURL url_; |
79 GURL first_party_for_cookies_; | 78 GURL first_party_for_cookies_; |
80 std::string method_; | 79 std::string method_; |
81 GURL referrer_; | 80 GURL referrer_; |
82 bool notify_redirects_; | 81 bool notify_redirects_; |
83 bool is_plugin_src_load_; | 82 bool is_plugin_src_load_; |
84 int origin_pid_; | 83 int origin_pid_; |
85 int render_frame_id_; | 84 int render_frame_id_; |
86 int render_view_id_; | 85 int render_view_id_; |
87 unsigned long resource_id_; | 86 unsigned long resource_id_; |
88 bool copy_stream_data_; | 87 bool copy_stream_data_; |
89 int64 data_offset_; | 88 int64 data_offset_; |
90 bool pending_failure_notification_; | 89 bool pending_failure_notification_; |
91 | 90 |
92 scoped_ptr<webkit_glue::MultipartResponseDelegate> multipart_delegate_; | 91 scoped_ptr<webkit_glue::MultipartResponseDelegate> multipart_delegate_; |
93 | 92 |
94 scoped_ptr<webkit_glue::ResourceLoaderBridge> bridge_; | 93 scoped_ptr<webkit_glue::ResourceLoaderBridge> bridge_; |
95 | 94 |
96 DISALLOW_COPY_AND_ASSIGN(PluginURLFetcher); | 95 DISALLOW_COPY_AND_ASSIGN(PluginURLFetcher); |
97 }; | 96 }; |
98 | 97 |
99 } // namespace content | 98 } // namespace content |
100 | 99 |
101 #endif // CONTENT_CHILD_NPAPI_URL_FETCHER_H_ | 100 #endif // CONTENT_CHILD_NPAPI_URL_FETCHER_H_ |
OLD | NEW |