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

Unified Diff: net/proxy/mock_proxy_resolver.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months 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/proxy/dhcpcsvc_init_win.cc ('k') | net/proxy/mock_proxy_resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/mock_proxy_resolver.h
diff --git a/net/proxy/mock_proxy_resolver.h b/net/proxy/mock_proxy_resolver.h
deleted file mode 100644
index 8ae551d96a7f5b134384a692a92a40494b6bf416..0000000000000000000000000000000000000000
--- a/net/proxy/mock_proxy_resolver.h
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (c) 2012 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_PROXY_MOCK_PROXY_RESOLVER_H_
-#define NET_PROXY_MOCK_PROXY_RESOLVER_H_
-
-#include <vector>
-
-#include "base/memory/scoped_ptr.h"
-#include "net/base/net_errors.h"
-#include "net/proxy/proxy_resolver.h"
-#include "url/gurl.h"
-
-namespace base {
-class MessageLoop;
-}
-
-namespace net {
-
-// Asynchronous mock proxy resolver. All requests complete asynchronously,
-// user must call Request::CompleteNow() on a pending request to signal it.
-class MockAsyncProxyResolverBase : public ProxyResolver {
- public:
- class Request : public base::RefCounted<Request> {
- public:
- Request(MockAsyncProxyResolverBase* resolver,
- const GURL& url,
- ProxyInfo* results,
- const net::CompletionCallback& callback);
-
- const GURL& url() const { return url_; }
- ProxyInfo* results() const { return results_; }
- const net::CompletionCallback& callback() const { return callback_; }
-
- void CompleteNow(int rv);
-
- private:
- friend class base::RefCounted<Request>;
-
- virtual ~Request();
-
- MockAsyncProxyResolverBase* resolver_;
- const GURL url_;
- ProxyInfo* results_;
- net::CompletionCallback callback_;
- base::MessageLoop* origin_loop_;
- };
-
- class SetPacScriptRequest {
- public:
- SetPacScriptRequest(
- MockAsyncProxyResolverBase* resolver,
- const scoped_refptr<ProxyResolverScriptData>& script_data,
- const net::CompletionCallback& callback);
- ~SetPacScriptRequest();
-
- const ProxyResolverScriptData* script_data() const {
- return script_data_.get();
- }
-
- void CompleteNow(int rv);
-
- private:
- MockAsyncProxyResolverBase* resolver_;
- const scoped_refptr<ProxyResolverScriptData> script_data_;
- net::CompletionCallback callback_;
- base::MessageLoop* origin_loop_;
- };
-
- typedef std::vector<scoped_refptr<Request> > RequestsList;
-
- ~MockAsyncProxyResolverBase() override;
-
- // ProxyResolver implementation.
- int GetProxyForURL(const GURL& url,
- ProxyInfo* results,
- const net::CompletionCallback& callback,
- RequestHandle* request_handle,
- const BoundNetLog& /*net_log*/) override;
- void CancelRequest(RequestHandle request_handle) override;
- LoadState GetLoadState(RequestHandle request_handle) const override;
- int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data,
- const net::CompletionCallback& callback) override;
- void CancelSetPacScript() override;
-
- const RequestsList& pending_requests() const {
- return pending_requests_;
- }
-
- const RequestsList& cancelled_requests() const {
- return cancelled_requests_;
- }
-
- SetPacScriptRequest* pending_set_pac_script_request() const;
-
- bool has_pending_set_pac_script_request() const {
- return pending_set_pac_script_request_.get() != NULL;
- }
-
- void RemovePendingRequest(Request* request);
-
- void RemovePendingSetPacScriptRequest(SetPacScriptRequest* request);
-
- protected:
- explicit MockAsyncProxyResolverBase(bool expects_pac_bytes);
-
- private:
- RequestsList pending_requests_;
- RequestsList cancelled_requests_;
- scoped_ptr<SetPacScriptRequest> pending_set_pac_script_request_;
-};
-
-class MockAsyncProxyResolver : public MockAsyncProxyResolverBase {
- public:
- MockAsyncProxyResolver()
- : MockAsyncProxyResolverBase(false /*expects_pac_bytes*/) {}
-};
-
-class MockAsyncProxyResolverExpectsBytes : public MockAsyncProxyResolverBase {
- public:
- MockAsyncProxyResolverExpectsBytes()
- : MockAsyncProxyResolverBase(true /*expects_pac_bytes*/) {}
-};
-
-} // namespace net
-
-#endif // NET_PROXY_MOCK_PROXY_RESOLVER_H_
« no previous file with comments | « net/proxy/dhcpcsvc_init_win.cc ('k') | net/proxy/mock_proxy_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698