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

Unified Diff: net/proxy/mock_proxy_script_fetcher.cc

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/mock_proxy_script_fetcher.h ('k') | net/proxy/multi_threaded_proxy_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/mock_proxy_script_fetcher.cc
diff --git a/net/proxy/mock_proxy_script_fetcher.cc b/net/proxy/mock_proxy_script_fetcher.cc
deleted file mode 100644
index 7604b5b34b1955cc0cbe47ce17f6ca527f3cce0a..0000000000000000000000000000000000000000
--- a/net/proxy/mock_proxy_script_fetcher.cc
+++ /dev/null
@@ -1,69 +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.
-
-#include "net/proxy/mock_proxy_script_fetcher.h"
-
-#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
-#include "base/strings/string16.h"
-#include "base/strings/utf_string_conversions.h"
-#include "net/base/net_errors.h"
-
-namespace net {
-
-MockProxyScriptFetcher::MockProxyScriptFetcher()
- : pending_request_text_(NULL),
- waiting_for_fetch_(false) {
-}
-
-MockProxyScriptFetcher::~MockProxyScriptFetcher() {}
-
-// ProxyScriptFetcher implementation.
-int MockProxyScriptFetcher::Fetch(const GURL& url, base::string16* text,
- const CompletionCallback& callback) {
- DCHECK(!has_pending_request());
-
- // Save the caller's information, and have them wait.
- pending_request_url_ = url;
- pending_request_callback_ = callback;
- pending_request_text_ = text;
-
- if (waiting_for_fetch_)
- base::MessageLoop::current()->Quit();
-
- return ERR_IO_PENDING;
-}
-
-void MockProxyScriptFetcher::NotifyFetchCompletion(
- int result, const std::string& ascii_text) {
- DCHECK(has_pending_request());
- *pending_request_text_ = base::ASCIIToUTF16(ascii_text);
- CompletionCallback callback = pending_request_callback_;
- pending_request_callback_.Reset();
- callback.Run(result);
-}
-
-void MockProxyScriptFetcher::Cancel() {
-}
-
-URLRequestContext* MockProxyScriptFetcher::GetRequestContext() const {
- return NULL;
-}
-
-const GURL& MockProxyScriptFetcher::pending_request_url() const {
- return pending_request_url_;
-}
-
-bool MockProxyScriptFetcher::has_pending_request() const {
- return !pending_request_callback_.is_null();
-}
-
-void MockProxyScriptFetcher::WaitUntilFetch() {
- DCHECK(!has_pending_request());
- waiting_for_fetch_ = true;
- base::MessageLoop::current()->Run();
- waiting_for_fetch_ = false;
-}
-
-} // namespace net
« no previous file with comments | « net/proxy/mock_proxy_script_fetcher.h ('k') | net/proxy/multi_threaded_proxy_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698