Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / child / npapi / plugin_url_fetcher.h
index 4e5e2ff..bffb9af 100644 (file)
@@ -8,8 +8,8 @@
 #include <string>
 
 #include "base/memory/scoped_ptr.h"
+#include "content/public/child/request_peer.h"
 #include "url/gurl.h"
-#include "webkit/child/resource_loader_bridge.h"
 
 namespace webkit_glue {
 class MultipartResponseDelegate;
@@ -20,7 +20,7 @@ namespace content {
 class PluginStreamUrl;
 
 // Fetches URLS for a plugin using ResourceDispatcher.
-class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer {
+class PluginURLFetcher : public RequestPeer {
  public:
   PluginURLFetcher(PluginStreamUrl* plugin_stream,
                    const GURL& url,
@@ -29,6 +29,7 @@ class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer {
                    const char* buf,
                    unsigned int len,
                    const GURL& referrer,
+                   const std::string& range,
                    bool notify_redirects,
                    bool is_plugin_src_load,
                    int origin_pid,
@@ -44,10 +45,16 @@ class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer {
   // Called with the plugin's reply to NPP_URLRedirectNotify.
   void URLRedirectResponse(bool allow);
 
+  GURL first_party_for_cookies() { return first_party_for_cookies_; }
+  GURL referrer() { return referrer_; }
+  int origin_pid() { return origin_pid_; }
+  int render_frame_id() { return render_frame_id_; }
+  int render_view_id() { return render_view_id_; }
+  bool copy_stream_data() { return copy_stream_data_; }
   bool pending_failure_notification() { return pending_failure_notification_; }
 
  private:
-  // webkit_glue::ResourceLoaderBridge::Peer implementation:
+  // RequestPeer implementation:
   virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE;
   virtual bool OnReceivedRedirect(const GURL& new_url,
                                   const webkit_glue::ResourceResponseInfo& info,
@@ -59,14 +66,15 @@ class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer {
   virtual void OnReceivedData(const char* data,
                               int data_length,
                               int encoded_data_length) OVERRIDE;
-  virtual void OnCompletedRequest(
-      int error_code,
-      bool was_ignored_by_handler,
-      bool stale_copy_in_cache,
-      const std::string& security_info,
-      const base::TimeTicks& completion_time,
-      int64 total_transfer_size) OVERRIDE;
-
+  virtual void OnCompletedRequest(int error_code,
+                                  bool was_ignored_by_handler,
+                                  bool stale_copy_in_cache,
+                                  const std::string& security_info,
+                                  const base::TimeTicks& completion_time,
+                                  int64 total_transfer_size) OVERRIDE;
+
+  // |plugin_stream_| becomes NULL after Cancel() to ensure no further calls
+  // |reach it.
   PluginStreamUrl* plugin_stream_;
   GURL url_;
   GURL first_party_for_cookies_;
@@ -74,6 +82,9 @@ class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer {
   GURL referrer_;
   bool notify_redirects_;
   bool is_plugin_src_load_;
+  int origin_pid_;
+  int render_frame_id_;
+  int render_view_id_;
   unsigned long resource_id_;
   bool copy_stream_data_;
   int64 data_offset_;