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

Side by Side Diff: net/filter/mock_filter_context.cc

Issue 2478703004: Remove net::Filter code (Closed)
Patch Set: Address Matt's comment Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « net/filter/mock_filter_context.h ('k') | net/filter/sdch_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "net/filter/mock_filter_context.h"
6
7 #include "net/url_request/url_request_context.h"
8
9 namespace net {
10
11 MockFilterContext::MockFilterContext()
12 : is_cached_content_(false),
13 ok_to_call_get_url_(true),
14 response_code_(-1),
15 context_(new URLRequestContext()) {
16 }
17
18 MockFilterContext::~MockFilterContext() {}
19
20 void MockFilterContext::NukeUnstableInterfaces() {
21 context_.reset();
22 ok_to_call_get_url_ = false;
23 request_time_ = base::Time();
24 }
25
26 bool MockFilterContext::GetMimeType(std::string* mime_type) const {
27 *mime_type = mime_type_;
28 return true;
29 }
30
31 // What URL was used to access this data?
32 // Return false if gurl is not present.
33 bool MockFilterContext::GetURL(GURL* gurl) const {
34 DCHECK(ok_to_call_get_url_);
35 *gurl = gurl_;
36 return true;
37 }
38
39 // What was this data requested from a server?
40 base::Time MockFilterContext::GetRequestTime() const {
41 return request_time_;
42 }
43
44 bool MockFilterContext::IsCachedContent() const { return is_cached_content_; }
45
46 SdchManager::DictionarySet*
47 MockFilterContext::SdchDictionariesAdvertised() const {
48 return dictionaries_handle_.get();
49 }
50
51 int64_t MockFilterContext::GetByteReadCount() const {
52 return 0;
53 }
54
55 int MockFilterContext::GetResponseCode() const { return response_code_; }
56
57 const URLRequestContext* MockFilterContext::GetURLRequestContext() const {
58 return context_.get();
59 }
60
61 const NetLogWithSource& MockFilterContext::GetNetLog() const {
62 return net_log_;
63 }
64
65 } // namespace net
OLDNEW
« no previous file with comments | « net/filter/mock_filter_context.h ('k') | net/filter/sdch_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698