OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SimNetwork_h | 5 #ifndef SimNetwork_h |
6 #define SimNetwork_h | 6 #define SimNetwork_h |
7 | 7 |
8 #include "public/platform/WebURLLoaderTestDelegate.h" | 8 #include "public/platform/WebURLLoaderTestDelegate.h" |
9 #include "wtf/HashMap.h" | 9 #include "wtf/HashMap.h" |
10 #include "wtf/text/StringHash.h" | 10 #include "wtf/text/StringHash.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 private: | 27 private: |
28 friend class SimRequest; | 28 friend class SimRequest; |
29 | 29 |
30 static SimNetwork& current(); | 30 static SimNetwork& current(); |
31 | 31 |
32 void servePendingRequests(); | 32 void servePendingRequests(); |
33 void addRequest(SimRequest&); | 33 void addRequest(SimRequest&); |
34 void removeRequest(SimRequest&); | 34 void removeRequest(SimRequest&); |
35 | 35 |
36 // WebURLLoaderTestDelegate | 36 // WebURLLoaderTestDelegate |
37 void didReceiveResponse(WebURLLoaderClient*, | 37 void didReceiveResponse(WebURLLoaderClient*, const WebURLResponse&) override; |
38 const WebURLResponse&) override; | |
39 void didReceiveData(WebURLLoaderClient*, | 38 void didReceiveData(WebURLLoaderClient*, |
40 const char* data, | 39 const char* data, |
41 int dataLength) override; | 40 int dataLength) override; |
42 void didFail(WebURLLoaderClient*, | 41 void didFail(WebURLLoaderClient*, |
43 const WebURLError&, | 42 const WebURLError&, |
44 int64_t totalEncodedDataLength, | 43 int64_t totalEncodedDataLength, |
45 int64_t totalEncodedBodyLength) override; | 44 int64_t totalEncodedBodyLength) override; |
46 void didFinishLoading(WebURLLoaderClient*, | 45 void didFinishLoading(WebURLLoaderClient*, |
47 double finishTime, | 46 double finishTime, |
48 int64_t totalEncodedDataLength, | 47 int64_t totalEncodedDataLength, |
49 int64_t totalEncodedBodyLength) override; | 48 int64_t totalEncodedBodyLength) override; |
50 | 49 |
51 SimRequest* m_currentRequest; | 50 SimRequest* m_currentRequest; |
52 HashMap<String, SimRequest*> m_requests; | 51 HashMap<String, SimRequest*> m_requests; |
53 }; | 52 }; |
54 | 53 |
55 } // namespace blink | 54 } // namespace blink |
56 | 55 |
57 #endif | 56 #endif |
OLD | NEW |