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

Side by Side Diff: content/common/resource_request_completion_status.h

Issue 2875143002: Reduce boilerplate when creating simple mojom::URLLoaders. (Closed)
Patch Set: Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CONTENT_COMMON_RESOURCE_REQUEST_COMPLETION_STATUS_H_ 5 #ifndef CONTENT_COMMON_RESOURCE_REQUEST_COMPLETION_STATUS_H_
6 #define CONTENT_COMMON_RESOURCE_REQUEST_COMPLETION_STATUS_H_ 6 #define CONTENT_COMMON_RESOURCE_REQUEST_COMPLETION_STATUS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 struct CONTENT_EXPORT ResourceRequestCompletionStatus { 16 struct CONTENT_EXPORT ResourceRequestCompletionStatus {
17 ResourceRequestCompletionStatus(); 17 ResourceRequestCompletionStatus();
18 ResourceRequestCompletionStatus( 18 ResourceRequestCompletionStatus(
19 const ResourceRequestCompletionStatus& status); 19 const ResourceRequestCompletionStatus& status);
20 explicit ResourceRequestCompletionStatus(int64_t length);
21 // Sets error_code to net::OK, completition_time to base::TimeTicks::Now(),
22 // and encoded_data_length = encoded_body_length = |length|;
20 ~ResourceRequestCompletionStatus(); 23 ~ResourceRequestCompletionStatus();
21 24
22 // The error code. 25 // The error code.
23 int error_code = 0; 26 int error_code = 0;
24 27
25 // Was ignored by the request handler. 28 // Was ignored by the request handler.
26 bool was_ignored_by_handler = false; 29 bool was_ignored_by_handler = false;
27 30
28 // A copy of the data requested exists in the cache. 31 // A copy of the data requested exists in the cache.
29 bool exists_in_cache = false; 32 bool exists_in_cache = false;
30 33
31 // Time the request completed. 34 // Time the request completed.
32 base::TimeTicks completion_time; 35 base::TimeTicks completion_time;
33 36
34 // Total amount of data received from the network. 37 // Total amount of data received from the network.
35 int64_t encoded_data_length = 0; 38 int64_t encoded_data_length = 0;
36 39
37 // The length of the response body before removing any content encodings. 40 // The length of the response body before removing any content encodings.
38 int64_t encoded_body_length = 0; 41 int64_t encoded_body_length = 0;
39 42
40 // The length of the response body after decoding. 43 // The length of the response body after decoding.
41 int64_t decoded_body_length = 0; 44 int64_t decoded_body_length = 0;
42 }; 45 };
43 46
44 } // namespace content 47 } // namespace content
45 48
46 #endif // CONTENT_COMMON_RESOURCE_REQUEST_COMPLETION_STATUS_H_ 49 #endif // CONTENT_COMMON_RESOURCE_REQUEST_COMPLETION_STATUS_H_
OLDNEW
« no previous file with comments | « content/browser/webui/web_ui_url_loader_factory.cc ('k') | content/common/resource_request_completion_status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698