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

Unified Diff: chrome/browser/automation/automation_resource_message_filter.h

Issue 3066004: ChromeFrame cookie requests would incorrectly get routed to the first host br... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months 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: chrome/browser/automation/automation_resource_message_filter.h
===================================================================
--- chrome/browser/automation/automation_resource_message_filter.h (revision 53631)
+++ chrome/browser/automation/automation_resource_message_filter.h (working copy)
@@ -8,6 +8,7 @@
#include <map>
#include "base/atomicops.h"
+#include "base/lazy_instance.h"
#include "base/lock.h"
#include "base/platform_thread.h"
#include "ipc/ipc_channel_proxy.h"
@@ -99,9 +100,9 @@
// Retrieves cookies for the url passed in from the external host. The
// callback passed in is notified on success or failure asynchronously.
- void GetCookiesForUrl(int tab_handle, const GURL& url,
- net::CompletionCallback* callback,
- net::CookieStore* cookie_store);
+ static void GetCookiesForUrl(int tab_handle, const GURL& url,
+ net::CompletionCallback* callback,
+ net::CookieStore* cookie_store);
// This function gets invoked when we receive a response from the external
// host for the cookie request sent in GetCookiesForUrl above. It sets the
@@ -111,6 +112,10 @@
void OnGetCookiesHostResponse(int tab_handle, bool success, const GURL& url,
const std::string& cookies, int cookie_id);
+ // Set cookies in the external host.
+ static void SetCookiesForUrl(int tab_handle, const GURL&url,
+ const std::string& cookie_line, net::CompletionCallback* callback);
+
protected:
// Retrieves the automation request id for the passed in chrome request
// id and returns it in the automation_request_id parameter.
@@ -138,7 +143,7 @@
AutomationResourceMessageFilter* old_filter,
AutomationResourceMessageFilter* new_filter);
- int GetNextCompletionCallbackId() {
+ static int GetNextCompletionCallbackId() {
return ++next_completion_callback_id_;
}
@@ -174,7 +179,7 @@
RequestMap pending_request_map_;
// Map of render views interested in diverting url requests over automation.
- static RenderViewMap filtered_render_views_;
+ static base::LazyInstance<RenderViewMap> filtered_render_views_;
// Contains information used for completing the request to read cookies from
// the host coming in from the renderer.
@@ -189,11 +194,11 @@
// cookies from the host and is removed when we receive a response from the
// host. Please see the OnGetCookiesHostResponse function.
typedef std::map<int, CookieCompletionInfo> CompletionCallbackMap;
- CompletionCallbackMap completion_callback_map_;
+ static base::LazyInstance<CompletionCallbackMap> completion_callback_map_;
// Contains the id of the next completion callback. This is passed to the the
// external host as a cookie referring to the completion callback.
- int next_completion_callback_id_;
+ static int next_completion_callback_id_;
DISALLOW_COPY_AND_ASSIGN(AutomationResourceMessageFilter);
};

Powered by Google App Engine
This is Rietveld 408576698