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/resource_loader_bridge.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 ResourceLoaderBridge::Peer { |
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 bool notify_redirects, | 32 bool notify_redirects, |
33 bool is_plugin_src_load, | 33 bool is_plugin_src_load, |
34 int origin_pid, | 34 int origin_pid, |
35 int render_frame_id, | 35 int render_frame_id, |
36 int render_view_id, | 36 int render_view_id, |
37 unsigned long resource_id, | 37 unsigned long resource_id, |
38 bool copy_stream_data); | 38 bool copy_stream_data); |
39 virtual ~PluginURLFetcher(); | 39 virtual ~PluginURLFetcher(); |
40 | 40 |
41 // Cancels the current request. | 41 // Cancels the current request. |
42 void Cancel(); | 42 void Cancel(); |
43 | 43 |
44 // Called with the plugin's reply to NPP_URLRedirectNotify. | 44 // Called with the plugin's reply to NPP_URLRedirectNotify. |
45 void URLRedirectResponse(bool allow); | 45 void URLRedirectResponse(bool allow); |
46 | 46 |
47 bool pending_failure_notification() { return pending_failure_notification_; } | 47 bool pending_failure_notification() { return pending_failure_notification_; } |
48 | 48 |
49 private: | 49 private: |
50 // webkit_glue::ResourceLoaderBridge::Peer implementation: | 50 // ResourceLoaderBridge::Peer implementation: |
51 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE; | 51 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE; |
52 virtual bool OnReceivedRedirect(const GURL& new_url, | 52 virtual bool OnReceivedRedirect(const GURL& new_url, |
53 const webkit_glue::ResourceResponseInfo& info, | 53 const webkit_glue::ResourceResponseInfo& info, |
54 bool* has_new_first_party_for_cookies, | 54 bool* has_new_first_party_for_cookies, |
55 GURL* new_first_party_for_cookies) OVERRIDE; | 55 GURL* new_first_party_for_cookies) OVERRIDE; |
56 virtual void OnReceivedResponse( | 56 virtual void OnReceivedResponse( |
57 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; | 57 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; |
58 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE; | 58 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE; |
59 virtual void OnReceivedData(const char* data, | 59 virtual void OnReceivedData(const char* data, |
60 int data_length, | 60 int data_length, |
(...skipping 13 matching lines...) Expand all Loading... |
74 GURL referrer_; | 74 GURL referrer_; |
75 bool notify_redirects_; | 75 bool notify_redirects_; |
76 bool is_plugin_src_load_; | 76 bool is_plugin_src_load_; |
77 unsigned long resource_id_; | 77 unsigned long resource_id_; |
78 bool copy_stream_data_; | 78 bool copy_stream_data_; |
79 int64 data_offset_; | 79 int64 data_offset_; |
80 bool pending_failure_notification_; | 80 bool pending_failure_notification_; |
81 | 81 |
82 scoped_ptr<webkit_glue::MultipartResponseDelegate> multipart_delegate_; | 82 scoped_ptr<webkit_glue::MultipartResponseDelegate> multipart_delegate_; |
83 | 83 |
84 scoped_ptr<webkit_glue::ResourceLoaderBridge> bridge_; | 84 scoped_ptr<ResourceLoaderBridge> bridge_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(PluginURLFetcher); | 86 DISALLOW_COPY_AND_ASSIGN(PluginURLFetcher); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace content | 89 } // namespace content |
90 | 90 |
91 #endif // CONTENT_CHILD_NPAPI_URL_FETCHER_H_ | 91 #endif // CONTENT_CHILD_NPAPI_URL_FETCHER_H_ |
OLD | NEW |