OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google, Inc. All rights reserved. | 2 * Copyright (C) 2012 Google, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, | 36 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, |
37 const AtomicString& initiator, | 37 const AtomicString& initiator, |
38 const String& charset) | 38 const String& charset) |
39 : m_resourceRequest(resourceRequest), | 39 : m_resourceRequest(resourceRequest), |
40 m_charset(charset), | 40 m_charset(charset), |
41 m_options(ResourceFetcher::defaultResourceOptions()), | 41 m_options(ResourceFetcher::defaultResourceOptions()), |
42 m_speculativePreload(false), | 42 m_speculativePreload(false), |
43 m_linkPreload(false), | |
44 m_preloadDiscoveryTime(0.0), | 43 m_preloadDiscoveryTime(0.0), |
45 m_defer(NoDefer), | 44 m_defer(NoDefer), |
46 m_originRestriction(UseDefaultOriginRestrictionForType), | 45 m_originRestriction(UseDefaultOriginRestrictionForType), |
47 m_placeholderImageRequestType(DisallowPlaceholder) { | 46 m_placeholderImageRequestType(DisallowPlaceholder) { |
48 m_options.initiatorInfo.name = initiator; | 47 m_options.initiatorInfo.name = initiator; |
49 } | 48 } |
50 | 49 |
51 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, | 50 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, |
52 const AtomicString& initiator, | 51 const AtomicString& initiator, |
53 const ResourceLoaderOptions& options) | 52 const ResourceLoaderOptions& options) |
54 : m_resourceRequest(resourceRequest), | 53 : m_resourceRequest(resourceRequest), |
55 m_options(options), | 54 m_options(options), |
56 m_speculativePreload(false), | 55 m_speculativePreload(false), |
57 m_linkPreload(false), | |
58 m_preloadDiscoveryTime(0.0), | 56 m_preloadDiscoveryTime(0.0), |
59 m_defer(NoDefer), | 57 m_defer(NoDefer), |
60 m_originRestriction(UseDefaultOriginRestrictionForType), | 58 m_originRestriction(UseDefaultOriginRestrictionForType), |
61 m_placeholderImageRequestType( | 59 m_placeholderImageRequestType( |
62 PlaceholderImageRequestType::DisallowPlaceholder) { | 60 PlaceholderImageRequestType::DisallowPlaceholder) { |
63 m_options.initiatorInfo.name = initiator; | 61 m_options.initiatorInfo.name = initiator; |
64 } | 62 } |
65 | 63 |
66 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, | 64 FetchRequest::FetchRequest(const ResourceRequest& resourceRequest, |
67 const FetchInitiatorInfo& initiator) | 65 const FetchInitiatorInfo& initiator) |
68 : m_resourceRequest(resourceRequest), | 66 : m_resourceRequest(resourceRequest), |
69 m_options(ResourceFetcher::defaultResourceOptions()), | 67 m_options(ResourceFetcher::defaultResourceOptions()), |
70 m_speculativePreload(false), | 68 m_speculativePreload(false), |
71 m_linkPreload(false), | |
72 m_preloadDiscoveryTime(0.0), | 69 m_preloadDiscoveryTime(0.0), |
73 m_defer(NoDefer), | 70 m_defer(NoDefer), |
74 m_originRestriction(UseDefaultOriginRestrictionForType), | 71 m_originRestriction(UseDefaultOriginRestrictionForType), |
75 m_placeholderImageRequestType( | 72 m_placeholderImageRequestType( |
76 PlaceholderImageRequestType::DisallowPlaceholder) { | 73 PlaceholderImageRequestType::DisallowPlaceholder) { |
77 m_options.initiatorInfo = initiator; | 74 m_options.initiatorInfo = initiator; |
78 } | 75 } |
79 | 76 |
80 FetchRequest::~FetchRequest() {} | 77 FetchRequest::~FetchRequest() {} |
81 | 78 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // the dimensions for larger images. | 158 // the dimensions for larger images. |
162 // TODO(sclittle): Calculate the optimal value for this number. | 159 // TODO(sclittle): Calculate the optimal value for this number. |
163 m_resourceRequest.setHTTPHeaderField("range", "bytes=0-2047"); | 160 m_resourceRequest.setHTTPHeaderField("range", "bytes=0-2047"); |
164 | 161 |
165 // TODO(sclittle): Indicate somehow (e.g. through a new request bit) to the | 162 // TODO(sclittle): Indicate somehow (e.g. through a new request bit) to the |
166 // embedder that it should return the full resource if the entire resource is | 163 // embedder that it should return the full resource if the entire resource is |
167 // fresh in the cache. | 164 // fresh in the cache. |
168 } | 165 } |
169 | 166 |
170 } // namespace blink | 167 } // namespace blink |
OLD | NEW |