#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"
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,
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.
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.
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);
};