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

Side by Side Diff: net/http/http_transaction_test_util.h

Issue 2721933002: HttpCache::Transaction layer allowing parallel validation (Closed)
Patch Set: Feedback addressed Created 3 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_ 5 #ifndef NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_
6 #define NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_ 6 #define NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_
7 7
8 #include "net/http/http_transaction.h" 8 #include "net/http/http_transaction.h"
9 9
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 int ResumeNetworkStart() override; 237 int ResumeNetworkStart() override;
238 238
239 void GetConnectionAttempts(ConnectionAttempts* out) const override; 239 void GetConnectionAttempts(ConnectionAttempts* out) const override;
240 240
241 CreateHelper* websocket_handshake_stream_create_helper() { 241 CreateHelper* websocket_handshake_stream_create_helper() {
242 return websocket_handshake_stream_create_helper_; 242 return websocket_handshake_stream_create_helper_;
243 } 243 }
244 RequestPriority priority() const { return priority_; } 244 RequestPriority priority() const { return priority_; }
245 const HttpRequestInfo* request() const { return request_; } 245 const HttpRequestInfo* request() const { return request_; }
246 246
247 static void DeferNetworkStart(bool* defer);
248
247 // Bogus value that will be returned by GetTotalReceivedBytes() if the 249 // Bogus value that will be returned by GetTotalReceivedBytes() if the
248 // MockNetworkTransaction was started. 250 // MockNetworkTransaction was started.
249 static const int64_t kTotalReceivedBytes; 251 static const int64_t kTotalReceivedBytes;
250 // Bogus value that will be returned by GetTotalSentBytes() if the 252 // Bogus value that will be returned by GetTotalSentBytes() if the
251 // MockNetworkTransaction was started. 253 // MockNetworkTransaction was started.
252 static const int64_t kTotalSentBytes; 254 static const int64_t kTotalSentBytes;
253 255
254 private: 256 private:
255 int StartInternal(const HttpRequestInfo* request, 257 int StartInternal(const HttpRequestInfo* request,
256 const CompletionCallback& callback, 258 const CompletionCallback& callback,
(...skipping 16 matching lines...) Expand all
273 int64_t sent_bytes_; 275 int64_t sent_bytes_;
274 276
275 // NetLog ID of the fake / non-existent underlying socket used by the 277 // NetLog ID of the fake / non-existent underlying socket used by the
276 // connection. Requires Start() be passed a NetLogWithSource with a real 278 // connection. Requires Start() be passed a NetLogWithSource with a real
277 // NetLog to 279 // NetLog to
278 // be initialized. 280 // be initialized.
279 unsigned int socket_log_id_; 281 unsigned int socket_log_id_;
280 282
281 bool done_reading_called_; 283 bool done_reading_called_;
282 284
285 CompletionCallback callback_; // used for pause and restart.
286
283 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; 287 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_;
284 288
285 }; 289 };
286 290
287 class MockNetworkLayer : public HttpTransactionFactory, 291 class MockNetworkLayer : public HttpTransactionFactory,
288 public base::SupportsWeakPtr<MockNetworkLayer> { 292 public base::SupportsWeakPtr<MockNetworkLayer> {
289 public: 293 public:
290 MockNetworkLayer(); 294 MockNetworkLayer();
291 ~MockNetworkLayer() override; 295 ~MockNetworkLayer() override;
292 296
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 353
350 //----------------------------------------------------------------------------- 354 //-----------------------------------------------------------------------------
351 // helpers 355 // helpers
352 356
353 // read the transaction completely 357 // read the transaction completely
354 int ReadTransaction(HttpTransaction* trans, std::string* result); 358 int ReadTransaction(HttpTransaction* trans, std::string* result);
355 359
356 } // namespace net 360 } // namespace net
357 361
358 #endif // NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_ 362 #endif // NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698