Upstream version 9.37.195.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / renderer_host / chrome_resource_dispatcher_host_delegate.h
index 81ecfea..9ef9150 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
 
+#include <map>
 #include <set>
 
 #include "base/compiler_specific.h"
@@ -69,18 +70,13 @@ class ChromeResourceDispatcherHostDelegate
   virtual bool ShouldForceDownloadResource(
       const GURL& url, const std::string& mime_type) OVERRIDE;
   virtual bool ShouldInterceptResourceAsStream(
-      content::ResourceContext* resource_context,
-      const GURL& url,
+      net::URLRequest* request,
       const std::string& mime_type,
       GURL* origin,
-      std::string* target_id) OVERRIDE;
+      std::string* payload) OVERRIDE;
   virtual void OnStreamCreated(
-      content::ResourceContext* resource_context,
-      int render_process_id,
-      int render_view_id,
-      const std::string& target_id,
-      scoped_ptr<content::StreamHandle> stream,
-      int64 expected_content_size) OVERRIDE;
+      net::URLRequest* request,
+      scoped_ptr<content::StreamHandle> stream) OVERRIDE;
   virtual void OnResponseStarted(
       net::URLRequest* request,
       content::ResourceContext* resource_context,
@@ -91,6 +87,7 @@ class ChromeResourceDispatcherHostDelegate
       net::URLRequest* request,
       content::ResourceContext* resource_context,
       content::ResourceResponse* response) OVERRIDE;
+  virtual void RequestComplete(net::URLRequest* url_request) OVERRIDE;
 
   // Called on the UI thread. Allows switching out the
   // ExternalProtocolHandler::Delegate for testing code.
@@ -98,20 +95,17 @@ class ChromeResourceDispatcherHostDelegate
       ExternalProtocolHandler::Delegate* delegate);
 
  private:
+  struct StreamTargetInfo {
+    std::string extension_id;
+    std::string view_id;
+  };
+
   void AppendStandardResourceThrottles(
       net::URLRequest* request,
       content::ResourceContext* resource_context,
       ResourceType::Type resource_type,
       ScopedVector<content::ResourceThrottle>* throttles);
 
-  // Adds Chrome experiment and metrics state as custom headers to |request|.
-  // This is a best-effort attempt, and does not interrupt the request if the
-  // headers can not be appended.
-  void AppendChromeMetricsHeaders(
-      net::URLRequest* request,
-      content::ResourceContext* resource_context,
-      ResourceType::Type resource_type);
-
 #if defined(ENABLE_ONE_CLICK_SIGNIN)
   // Append headers required to tell Gaia whether the sync interstitial
   // should be shown or not.  This header is only added for valid Gaia URLs.
@@ -124,6 +118,7 @@ class ChromeResourceDispatcherHostDelegate
   scoped_refptr<SafeBrowsingService> safe_browsing_;
   scoped_refptr<extensions::UserScriptListener> user_script_listener_;
   prerender::PrerenderTracker* prerender_tracker_;
+  std::map<net::URLRequest*, StreamTargetInfo> stream_target_info_;
 
   DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegate);
 };