Store blocked and accessed cookies in the tab contents.

This will enable chrome to display all cookies used/blocked on the current site to the user instead of just the information that something was blocked. The cookies are collected in data structures suitable for displaying them using the cookies tree model.

BUG=45230
TEST=none

Review URL: http://codereview.chromium.org/2370001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51545 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 4f44f2e3..9a03213 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -441,8 +441,9 @@
   // If the request was destroyed, then there is no more work to do.
   if (request_ && request_->delegate()) {
     if (policy == net::ERR_ACCESS_DENIED) {
-      request_->delegate()->OnGetCookiesBlocked(request_);
+      request_->delegate()->OnGetCookies(request_, true);
     } else if (policy == net::OK && request_->context()->cookie_store()) {
+      request_->delegate()->OnGetCookies(request_, false);
       net::CookieOptions options;
       options.set_include_httponly();
       std::string cookies =
@@ -453,7 +454,7 @@
             net::HttpRequestHeaders::kCookie, cookies);
       }
     }
-    // We may have been canceled within OnGetCookiesBlocked.
+    // We may have been canceled within OnGetCookies.
     if (GetStatus().is_success()) {
       StartTransaction();
     } else {
@@ -467,7 +468,10 @@
   // If the request was destroyed, then there is no more work to do.
   if (request_ && request_->delegate()) {
     if (policy == net::ERR_ACCESS_DENIED) {
-      request_->delegate()->OnSetCookieBlocked(request_);
+      request_->delegate()->OnSetCookie(
+          request_,
+          response_cookies_[response_cookies_save_index_],
+          true);
     } else if ((policy == net::OK || policy == net::OK_FOR_SESSION_ONLY) &&
                request_->context()->cookie_store()) {
       // OK to save the current response cookie now.
@@ -478,9 +482,13 @@
       request_->context()->cookie_store()->SetCookieWithOptions(
           request_->url(), response_cookies_[response_cookies_save_index_],
           options);
+      request_->delegate()->OnSetCookie(
+          request_,
+          response_cookies_[response_cookies_save_index_],
+          false);
     }
     response_cookies_save_index_++;
-    // We may have been canceled within OnSetCookieBlocked.
+    // We may have been canceled within OnSetCookie.
     if (GetStatus().is_success()) {
       SaveNextCookie();
     } else {