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

Unified Diff: net/dns/mdns_client_impl.h

Issue 581813004: Enqueue mDns requests if send on socket in progress. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mon Sep 22 15:45:45 PDT 2014 Created 6 years, 3 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 | « no previous file | net/dns/mdns_client_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/mdns_client_impl.h
diff --git a/net/dns/mdns_client_impl.h b/net/dns/mdns_client_impl.h
index 76607880befc42c77a6d1d7a08399eebac34efec..6051511c01975d6eee5fb0c3b46352bb52757fd0 100644
--- a/net/dns/mdns_client_impl.h
+++ b/net/dns/mdns_client_impl.h
@@ -52,7 +52,7 @@ class NET_EXPORT_PRIVATE MDnsConnection {
// Both methods return true if at least one of the socket handlers succeeded.
bool Init(MDnsSocketFactory* socket_factory);
- bool Send(IOBuffer* buffer, unsigned size);
+ void Send(const scoped_refptr<IOBuffer>& buffer, unsigned size);
Vitaly Buka (NO REVIEWS) 2014/09/22 22:53:49 swithing back to IOBuffer, because comment in IOBu
private:
class SocketHandler {
@@ -62,7 +62,7 @@ class NET_EXPORT_PRIVATE MDnsConnection {
~SocketHandler();
int Start();
- int Send(IOBuffer* buffer, unsigned size);
+ void Send(const scoped_refptr<IOBuffer>& buffer, unsigned size);
private:
int DoLoop(int rv);
@@ -76,6 +76,8 @@ class NET_EXPORT_PRIVATE MDnsConnection {
IPEndPoint recv_addr_;
DnsResponse response_;
IPEndPoint multicast_addr_;
+ bool send_in_progress_;
+ std::queue<std::pair<scoped_refptr<IOBuffer>, unsigned> > send_queue_;
DISALLOW_COPY_AND_ASSIGN(SocketHandler);
};
@@ -85,13 +87,16 @@ class NET_EXPORT_PRIVATE MDnsConnection {
const IPEndPoint& recv_addr,
int bytes_read);
- void OnError(SocketHandler* loop, int error);
+ void PostOnError(SocketHandler* loop, int rv);
+ void OnError(int rv);
// Only socket handlers which successfully bound and started are kept.
ScopedVector<SocketHandler> socket_handlers_;
Delegate* delegate_;
+ base::WeakPtrFactory<MDnsConnection> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(MDnsConnection);
};
« no previous file with comments | « no previous file | net/dns/mdns_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698