1// Copyright (c) 2011 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include "net/base/mock_filter_context.h" 6 7namespace net { 8 9MockFilterContext::MockFilterContext() 10 : is_cached_content_(false), 11 is_download_(false), 12 is_sdch_response_(false), 13 response_code_(-1) { 14} 15 16MockFilterContext::~MockFilterContext() {} 17 18bool MockFilterContext::GetMimeType(std::string* mime_type) const { 19 *mime_type = mime_type_; 20 return true; 21} 22 23// What URL was used to access this data? 24// Return false if gurl is not present. 25bool MockFilterContext::GetURL(GURL* gurl) const { 26 *gurl = gurl_; 27 return true; 28} 29 30// What was this data requested from a server? 31base::Time MockFilterContext::GetRequestTime() const { 32 return request_time_; 33} 34 35bool MockFilterContext::IsCachedContent() const { return is_cached_content_; } 36 37bool MockFilterContext::IsDownload() const { return is_download_; } 38 39bool MockFilterContext::IsSdchResponse() const { return is_sdch_response_; } 40 41int64 MockFilterContext::GetByteReadCount() const { return 0; } 42 43int MockFilterContext::GetResponseCode() const { return response_code_; } 44 45} // namespace net 46