Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Unified Diff: content/browser/frame_host/navigation_handle_impl.h

Issue 1416953007: Add a function to add extra headers from NavigationThrottle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data-reduction-proxy-resource-throttle
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_handle_impl.h
diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h
index 26ead9b534a9c181b8da848215642939b00cf468..bcd407393d69234cc49c9657c4669dac9b1e49fa 100644
--- a/content/browser/frame_host/navigation_handle_impl.h
+++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -112,9 +112,15 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
return service_worker_handle_.get();
}
- typedef base::Callback<void(NavigationThrottle::ThrottleCheckResult)>
+ typedef std::vector<std::pair<std::string, std::string> > ExtraHeadersList;
nasko 2015/11/06 23:51:51 The new style requires "using " syntax. Please con
clamy 2015/11/09 15:47:09 Done.
+ typedef base::Callback<void(NavigationThrottle::ThrottleCheckResult,
+ const ExtraHeadersList&)>
ThrottleChecksFinishedCallback;
+ // Adds an entry in the ExtraHeadersList. The extra header itself will be
+ // added to the request when the ThrottleChecksFinishedCallback will be run.
+ void AddExtraHeader(const std::string& name, const std::string& value);
+
// Called when the URLRequest will start in the network stack. |callback|
// will be called when all throttle checks have completed. This will allow
// the caller to cancel the navigation or let it proceed.
@@ -202,6 +208,10 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
// The index of the next throttle to check.
size_t next_index_;
+ // Passed back to the handler of the navigation request after the throttles
+ // checks have been performed.
+ ExtraHeadersList extra_headers_to_add_;
+
// This callback will be run when all throttle checks have been performed.
ThrottleChecksFinishedCallback complete_callback_;
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl.cc » ('j') | content/browser/frame_host/navigation_request.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698