Remove repaint callbacks from Viewport.
[chromium-blink-merge.git] / net / filter / mock_filter_context.cc
blobeb3484c19eb1eabcbc23a3d2df9e4ab47d8771ea
1 // Copyright 2014 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.
5 #include "net/filter/mock_filter_context.h"
7 #include "net/url_request/url_request_context.h"
9 namespace net {
11 MockFilterContext::MockFilterContext()
12 : is_cached_content_(false),
13 is_download_(false),
14 is_sdch_response_(false),
15 response_code_(-1),
16 context_(new URLRequestContext()) {
19 MockFilterContext::~MockFilterContext() {}
21 bool MockFilterContext::GetMimeType(std::string* mime_type) const {
22 *mime_type = mime_type_;
23 return true;
26 // What URL was used to access this data?
27 // Return false if gurl is not present.
28 bool MockFilterContext::GetURL(GURL* gurl) const {
29 *gurl = gurl_;
30 return true;
33 bool MockFilterContext::GetContentDisposition(std::string* disposition) const {
34 if (content_disposition_.empty())
35 return false;
36 *disposition = content_disposition_;
37 return true;
40 // What was this data requested from a server?
41 base::Time MockFilterContext::GetRequestTime() const {
42 return request_time_;
45 bool MockFilterContext::IsCachedContent() const { return is_cached_content_; }
47 bool MockFilterContext::IsDownload() const { return is_download_; }
49 bool MockFilterContext::IsSdchResponse() const { return is_sdch_response_; }
51 int64 MockFilterContext::GetByteReadCount() const { return 0; }
53 int MockFilterContext::GetResponseCode() const { return response_code_; }
55 const URLRequestContext* MockFilterContext::GetURLRequestContext() const {
56 return context_.get();
59 } // namespace net