diff options
-rw-r--r-- | chrome/browser/safe_browsing/protocol_manager.cc | 14 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/protocol_parser.cc | 1 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_util.h | 1 |
3 files changed, 3 insertions, 13 deletions
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index caf2400..eeb1889 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc @@ -306,18 +306,7 @@ bool SafeBrowsingProtocolManager::HandleServiceResponse(const GURL& url, break; } case CHUNK_REQUEST: { - // Find list name from url. - std::string url_path = url.ExtractFileName(); - if (url_path.empty()) - return false; - - std::string::size_type pos = url_path.find_first_of('_'); - if (pos == std::string::npos) - return false; - const ChunkUrl chunk_url = chunk_request_urls_.front(); - DCHECK(url.spec().find(chunk_url.url) != std::string::npos); - bool re_key = false; std::deque<SBChunk>* chunks = new std::deque<SBChunk>; if (!parser.ParseChunk(data, length, @@ -347,8 +336,7 @@ bool SafeBrowsingProtocolManager::HandleServiceResponse(const GURL& url, delete chunks; } else { chunk_pending_to_write_ = true; - std::string list_name(url_path, 0, pos); - sb_service_->HandleChunk(list_name, chunks); + sb_service_->HandleChunk(chunk_url.list_name, chunks); } break; diff --git a/chrome/browser/safe_browsing/protocol_parser.cc b/chrome/browser/safe_browsing/protocol_parser.cc index d1391c2..dcfd247 100644 --- a/chrome/browser/safe_browsing/protocol_parser.cc +++ b/chrome/browser/safe_browsing/protocol_parser.cc @@ -214,6 +214,7 @@ bool SafeBrowsingProtocolParser::ParseUpdate( ChunkUrl chunk_url; chunk_url.url = redirect_url; + chunk_url.list_name = list_name; if (!key.empty()) chunk_url.mac = mac; chunk_urls->push_back(chunk_url); diff --git a/chrome/browser/safe_browsing/safe_browsing_util.h b/chrome/browser/safe_browsing/safe_browsing_util.h index ec2f43d..3d8cfb7 100644 --- a/chrome/browser/safe_browsing/safe_browsing_util.h +++ b/chrome/browser/safe_browsing/safe_browsing_util.h @@ -34,6 +34,7 @@ class SBEntry; typedef struct { std::string url; std::string mac; + std::string list_name; } ChunkUrl; // A truncated hash's type. |