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

Side by Side Diff: net/base/test_host_resolver_observer.h

Issue 8568021: Add OVERRIDE to net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: net only Created 9 years, 1 month 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
« no previous file with comments | « net/base/test_completion_callback.h ('k') | net/disk_cache/backend_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
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_BASE_TEST_HOST_RESOLVER_OBSERVER_H_ 5 #ifndef NET_BASE_TEST_HOST_RESOLVER_OBSERVER_H_
6 #define NET_BASE_TEST_HOST_RESOLVER_OBSERVER_H_ 6 #define NET_BASE_TEST_HOST_RESOLVER_OBSERVER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "net/base/host_resolver.h" 9 #include "net/base/host_resolver.h"
10 10
11 #include <vector> 11 #include <vector>
12 12
13 namespace net { 13 namespace net {
14 14
15 bool operator==(const HostResolver::RequestInfo& a, 15 bool operator==(const HostResolver::RequestInfo& a,
16 const HostResolver::RequestInfo& b); 16 const HostResolver::RequestInfo& b);
17 17
18 // Observer that just makes note of how it was called. The test code can then 18 // Observer that just makes note of how it was called. The test code can then
19 // inspect to make sure it was called with the right parameters. Used by 19 // inspect to make sure it was called with the right parameters. Used by
20 // HostResolverImpl and AsyncHostResolver unit tests. 20 // HostResolverImpl and AsyncHostResolver unit tests.
21 class TestHostResolverObserver : public HostResolver::Observer { 21 class TestHostResolverObserver : public HostResolver::Observer {
22 public: 22 public:
23 TestHostResolverObserver(); 23 TestHostResolverObserver();
24 virtual ~TestHostResolverObserver(); 24 virtual ~TestHostResolverObserver();
25 25
26 // HostResolver::Observer methods: 26 // HostResolver::Observer methods:
27 virtual void OnStartResolution(int id, const HostResolver::RequestInfo& info); 27 virtual void OnStartResolution(
28 int id,
29 const HostResolver::RequestInfo& info) OVERRIDE;
28 virtual void OnFinishResolutionWithStatus( 30 virtual void OnFinishResolutionWithStatus(
29 int id, 31 int id,
30 bool was_resolved, 32 bool was_resolved,
31 const HostResolver::RequestInfo& info); 33 const HostResolver::RequestInfo& info) OVERRIDE;
32 virtual void OnCancelResolution( 34 virtual void OnCancelResolution(
33 int id, 35 int id,
34 const HostResolver::RequestInfo& info); 36 const HostResolver::RequestInfo& info) OVERRIDE;
35 37
36 // Tuple (id, info). 38 // Tuple (id, info).
37 struct StartOrCancelEntry { 39 struct StartOrCancelEntry {
38 StartOrCancelEntry(int id, const HostResolver::RequestInfo& info) 40 StartOrCancelEntry(int id, const HostResolver::RequestInfo& info)
39 : id(id), info(info) {} 41 : id(id), info(info) {}
40 42
41 bool operator==(const StartOrCancelEntry& other) const { 43 bool operator==(const StartOrCancelEntry& other) const {
42 return id == other.id && info == other.info; 44 return id == other.id && info == other.info;
43 } 45 }
44 46
(...skipping 19 matching lines...) Expand all
64 }; 66 };
65 67
66 std::vector<StartOrCancelEntry> start_log; 68 std::vector<StartOrCancelEntry> start_log;
67 std::vector<FinishEntry> finish_log; 69 std::vector<FinishEntry> finish_log;
68 std::vector<StartOrCancelEntry> cancel_log; 70 std::vector<StartOrCancelEntry> cancel_log;
69 }; 71 };
70 72
71 } // namespace net 73 } // namespace net
72 74
73 #endif // NET_BASE_TEST_HOST_RESOLVER_OBSERVER_H_ 75 #endif // NET_BASE_TEST_HOST_RESOLVER_OBSERVER_H_
OLDNEW
« no previous file with comments | « net/base/test_completion_callback.h ('k') | net/disk_cache/backend_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698