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

Unified Diff: net/filter/mock_filter_context.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/filter/gzip_filter_unittest.cc ('k') | net/filter/mock_filter_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/filter/mock_filter_context.h
diff --git a/net/filter/mock_filter_context.h b/net/filter/mock_filter_context.h
deleted file mode 100644
index ad36a2263e9f8b63cc543f0628515d2cb3672a27..0000000000000000000000000000000000000000
--- a/net/filter/mock_filter_context.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_FILTER_MOCK_FILTER_CONTEXT_H_
-#define NET_FILTER_MOCK_FILTER_CONTEXT_H_
-
-#include <stdint.h>
-
-#include <memory>
-#include <string>
-#include <utility>
-
-#include "base/macros.h"
-#include "net/base/sdch_manager.h"
-#include "net/filter/filter.h"
-#include "net/log/net_log_with_source.h"
-#include "url/gurl.h"
-
-namespace net {
-
-class URLRequestContext;
-
-class MockFilterContext : public FilterContext {
- public:
- MockFilterContext();
- ~MockFilterContext() override;
-
- void SetMimeType(const std::string& mime_type) { mime_type_ = mime_type; }
- void SetURL(const GURL& gurl) { gurl_ = gurl; }
- void SetRequestTime(const base::Time time) { request_time_ = time; }
- void SetCached(bool is_cached) { is_cached_content_ = is_cached; }
- void SetResponseCode(int response_code) { response_code_ = response_code; }
- void SetSdchResponse(std::unique_ptr<SdchManager::DictionarySet> handle) {
- dictionaries_handle_ = std::move(handle);
- }
- URLRequestContext* GetModifiableURLRequestContext() const {
- return context_.get();
- }
-
- // After a URLRequest's destructor is called, some interfaces may become
- // unstable. This method is used to signal that state, so we can tag use
- // of those interfaces as coding errors.
- void NukeUnstableInterfaces();
-
- bool GetMimeType(std::string* mime_type) const override;
-
- // What URL was used to access this data?
- // Return false if gurl is not present.
- bool GetURL(GURL* gurl) const override;
-
- // What was this data requested from a server?
- base::Time GetRequestTime() const override;
-
- // Is data supplied from cache, or fresh across the net?
- bool IsCachedContent() const override;
-
- // Handle to dictionaries advertised.
- SdchManager::DictionarySet* SdchDictionariesAdvertised() const override;
-
- // How many bytes were fed to filter(s) so far?
- int64_t GetByteReadCount() const override;
-
- int GetResponseCode() const override;
-
- // The URLRequestContext associated with the request.
- const URLRequestContext* GetURLRequestContext() const override;
-
- void RecordPacketStats(StatisticSelector statistic) const override {}
-
- const NetLogWithSource& GetNetLog() const override;
-
- private:
- std::string mime_type_;
- GURL gurl_;
- base::Time request_time_;
- bool is_cached_content_;
- std::unique_ptr<SdchManager::DictionarySet> dictionaries_handle_;
- bool ok_to_call_get_url_;
- int response_code_;
- std::unique_ptr<URLRequestContext> context_;
- NetLogWithSource net_log_;
-
- DISALLOW_COPY_AND_ASSIGN(MockFilterContext);
-};
-
-} // namespace net
-
-#endif // NET_FILTER_MOCK_FILTER_CONTEXT_H_
« no previous file with comments | « net/filter/gzip_filter_unittest.cc ('k') | net/filter/mock_filter_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698