1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ppapi/shared_impl/url_request_info_data.h"
7 #include "ppapi/shared_impl/resource.h"
13 const int32_t kDefaultPrefetchBufferUpperThreshold
= 100 * 1000 * 1000;
14 const int32_t kDefaultPrefetchBufferLowerThreshold
= 50 * 1000 * 1000;
18 URLRequestInfoData::BodyItem::BodyItem()
20 file_ref_pp_resource(0),
23 expected_last_modified_time(0.0) {
26 URLRequestInfoData::BodyItem::BodyItem(const std::string
& data
)
29 file_ref_pp_resource(0),
32 expected_last_modified_time(0.0) {
35 URLRequestInfoData::BodyItem::BodyItem(
38 int64_t number_of_bytes
,
39 PP_Time expected_last_modified_time
)
41 file_ref_resource(file_ref
),
42 file_ref_pp_resource(file_ref
->pp_resource()),
43 start_offset(start_offset
),
44 number_of_bytes(number_of_bytes
),
45 expected_last_modified_time(expected_last_modified_time
) {
48 URLRequestInfoData::URLRequestInfoData()
52 stream_to_file(false),
53 follow_redirects(true),
54 record_download_progress(false),
55 record_upload_progress(false),
56 has_custom_referrer_url(false),
57 custom_referrer_url(),
58 allow_cross_origin_requests(false),
59 allow_credentials(false),
60 has_custom_content_transfer_encoding(false),
61 custom_content_transfer_encoding(),
62 has_custom_user_agent(false),
64 prefetch_buffer_upper_threshold(kDefaultPrefetchBufferUpperThreshold
),
65 prefetch_buffer_lower_threshold(kDefaultPrefetchBufferLowerThreshold
),
69 URLRequestInfoData::~URLRequestInfoData() {