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

Unified Diff: net/proxy/mock_proxy_script_fetcher.cc

Issue 9078003: Poll PAC scripts for content changes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix dcheck reached on bot Created 8 years, 12 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/proxy_resolver_script_data.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
index 9aeab1c450d5edf9d15aff326bbd6181b7c1f879..1e45c00fe90f2fa0a1bdde53554c0cd47f529a58 100644
--- a/net/proxy/mock_proxy_script_fetcher.cc
+++ b/net/proxy/mock_proxy_script_fetcher.cc
@@ -5,6 +5,7 @@
#include "net/proxy/mock_proxy_script_fetcher.h"
#include "base/logging.h"
+#include "base/message_loop.h"
#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "net/base/net_errors.h"
@@ -12,7 +13,8 @@
namespace net {
MockProxyScriptFetcher::MockProxyScriptFetcher()
- : pending_request_text_(NULL) {
+ : pending_request_text_(NULL),
+ waiting_for_fetch_(false) {
}
MockProxyScriptFetcher::~MockProxyScriptFetcher() {}
@@ -26,6 +28,10 @@ int MockProxyScriptFetcher::Fetch(const GURL& url, string16* text,
pending_request_url_ = url;
pending_request_callback_ = callback;
pending_request_text_ = text;
+
+ if (waiting_for_fetch_)
+ MessageLoop::current()->Quit();
+
return ERR_IO_PENDING;
}
@@ -53,4 +59,11 @@ bool MockProxyScriptFetcher::has_pending_request() const {
return !pending_request_callback_.is_null();
}
+void MockProxyScriptFetcher::WaitUntilFetch() {
+ DCHECK(!has_pending_request());
+ waiting_for_fetch_ = true;
+ MessageLoop::current()->Run();
+ waiting_for_fetch_ = false;
+}
+
} // namespace net
« no previous file with comments | « net/proxy/mock_proxy_script_fetcher.h ('k') | net/proxy/proxy_resolver_script_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698