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

Unified Diff: net/proxy/mojo_proxy_resolver_impl.cc

Issue 1145153004: Split ProxyResolverV8Tracing into an implementation and a wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/mojo_proxy_resolver_impl.h ('k') | net/proxy/mojo_proxy_resolver_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/mojo_proxy_resolver_impl.cc
diff --git a/net/proxy/mojo_proxy_resolver_impl.cc b/net/proxy/mojo_proxy_resolver_impl.cc
index c300b6eff0dc5604a27b1aa804f38781fb3e978f..b2704382fb09f5f391c421b195e1cef62ad173f0 100644
--- a/net/proxy/mojo_proxy_resolver_impl.cc
+++ b/net/proxy/mojo_proxy_resolver_impl.cc
@@ -8,15 +8,11 @@
#include "mojo/common/url_type_converters.h"
#include "net/base/net_errors.h"
#include "net/log/net_log.h"
-#include "net/proxy/load_state_change_coalescer.h"
#include "net/proxy/mojo_proxy_type_converters.h"
#include "net/proxy/proxy_info.h"
#include "net/proxy/proxy_resolver_script_data.h"
namespace net {
-namespace {
-const int kLoadStateChangeCoalesceTimeoutMilliseconds = 10;
-}
class MojoProxyResolverImpl::Job : public mojo::ErrorHandler {
public:
@@ -27,9 +23,6 @@ class MojoProxyResolverImpl::Job : public mojo::ErrorHandler {
void Start();
- // Invoked when the LoadState for this job changes.
- void LoadStateChanged(LoadState load_state);
-
net::ProxyResolver::RequestHandle request_handle() { return request_handle_; }
private:
@@ -40,8 +33,6 @@ class MojoProxyResolverImpl::Job : public mojo::ErrorHandler {
void GetProxyDone(int error);
- void SendLoadStateChanged(LoadState load_state);
-
MojoProxyResolverImpl* resolver_;
interfaces::ProxyResolverRequestClientPtr client_;
@@ -49,33 +40,19 @@ class MojoProxyResolverImpl::Job : public mojo::ErrorHandler {
GURL url_;
net::ProxyResolver::RequestHandle request_handle_;
bool done_;
- LoadStateChangeCoalescer load_state_change_coalescer_;
DISALLOW_COPY_AND_ASSIGN(Job);
};
MojoProxyResolverImpl::MojoProxyResolverImpl(
- scoped_ptr<net::ProxyResolver> resolver,
- const base::Callback<
- void(const net::ProxyResolver::LoadStateChangedCallback&)>&
- load_state_change_callback_setter)
+ scoped_ptr<net::ProxyResolver> resolver)
: resolver_(resolver.Pass()) {
- load_state_change_callback_setter.Run(base::Bind(
- &MojoProxyResolverImpl::LoadStateChanged, base::Unretained(this)));
}
MojoProxyResolverImpl::~MojoProxyResolverImpl() {
STLDeleteElements(&resolve_jobs_);
}
-void MojoProxyResolverImpl::LoadStateChanged(
- net::ProxyResolver::RequestHandle handle,
- LoadState load_state) {
- auto it = request_handle_to_job_.find(handle);
- DCHECK(it != request_handle_to_job_.end());
- it->second->LoadStateChanged(load_state);
-}
-
void MojoProxyResolverImpl::GetProxyForUrl(
const mojo::String& url,
interfaces::ProxyResolverRequestClientPtr client) {
@@ -103,13 +80,7 @@ MojoProxyResolverImpl::Job::Job(
client_(client.Pass()),
url_(url),
request_handle_(nullptr),
- done_(false),
- load_state_change_coalescer_(
- base::Bind(&MojoProxyResolverImpl::Job::SendLoadStateChanged,
- base::Unretained(this)),
- base::TimeDelta::FromMilliseconds(
- kLoadStateChangeCoalesceTimeoutMilliseconds),
- LOAD_STATE_RESOLVING_PROXY_FOR_URL) {
+ done_(false) {
}
MojoProxyResolverImpl::Job::~Job() {
@@ -130,10 +101,6 @@ void MojoProxyResolverImpl::Job::Start() {
std::make_pair(request_handle_, this));
}
-void MojoProxyResolverImpl::Job::LoadStateChanged(LoadState load_state) {
- load_state_change_coalescer_.LoadStateChanged(load_state);
-}
-
void MojoProxyResolverImpl::Job::GetProxyDone(int error) {
done_ = true;
DVLOG(1) << "GetProxyForUrl(" << url_ << ") finished with error " << error
@@ -154,8 +121,4 @@ void MojoProxyResolverImpl::Job::OnConnectionError() {
resolver_->DeleteJob(this);
}
-void MojoProxyResolverImpl::Job::SendLoadStateChanged(LoadState load_state) {
- client_->LoadStateChanged(load_state);
-}
-
} // namespace net
« no previous file with comments | « net/proxy/mojo_proxy_resolver_impl.h ('k') | net/proxy/mojo_proxy_resolver_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698