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

Side by Side Diff: net/proxy/sync_host_resolver_bridge.h

Issue 9121055: Add a source to V8 proxy resolver-initiated DNS requests, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Pass BoundNetLog around in unittest Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
eroman 2012/01/27 20:22:53 2012?
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_ 5 #ifndef NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_
6 #define NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_ 6 #define NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "net/proxy/sync_host_resolver.h" 10 #include "net/proxy/sync_host_resolver.h"
11 11
12 class MessageLoop; 12 class MessageLoop;
13 13
14 namespace net { 14 namespace net {
15 15
16 // Wrapper around HostResolver to give a sync API while running the resolver 16 // Wrapper around HostResolver to give a sync API while running the resolver
17 // in async mode on |host_resolver_loop|. 17 // in async mode on |host_resolver_loop|.
18 class NET_EXPORT_PRIVATE SyncHostResolverBridge : public SyncHostResolver { 18 class NET_EXPORT_PRIVATE SyncHostResolverBridge : public SyncHostResolver {
19 public: 19 public:
20 SyncHostResolverBridge(HostResolver* host_resolver, 20 SyncHostResolverBridge(HostResolver* host_resolver,
21 MessageLoop* host_resolver_loop); 21 MessageLoop* host_resolver_loop);
22 22
23 virtual ~SyncHostResolverBridge(); 23 virtual ~SyncHostResolverBridge();
24 24
25 // SyncHostResolver methods: 25 // SyncHostResolver methods:
26 virtual int Resolve(const HostResolver::RequestInfo& info, 26 virtual int Resolve(const HostResolver::RequestInfo& info,
27 AddressList* addresses) OVERRIDE; 27 AddressList* addresses,
28 const BoundNetLog& net_log) OVERRIDE;
28 29
29 // The Shutdown() method should be called prior to destruction, from 30 // The Shutdown() method should be called prior to destruction, from
30 // |host_resolver_loop_|. It aborts any in progress synchronous resolves, to 31 // |host_resolver_loop_|. It aborts any in progress synchronous resolves, to
31 // prevent deadlocks from happening. 32 // prevent deadlocks from happening.
32 virtual void Shutdown() OVERRIDE; 33 virtual void Shutdown() OVERRIDE;
33 34
34 private: 35 private:
35 class Core; 36 class Core;
36 37
37 MessageLoop* const host_resolver_loop_; 38 MessageLoop* const host_resolver_loop_;
38 scoped_refptr<Core> core_; 39 scoped_refptr<Core> core_;
39 DISALLOW_COPY_AND_ASSIGN(SyncHostResolverBridge); 40 DISALLOW_COPY_AND_ASSIGN(SyncHostResolverBridge);
40 }; 41 };
41 42
42 } // namespace net 43 } // namespace net
43 44
44 #endif // NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_ 45 #endif // NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698