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

Side by Side Diff: Source/core/timing/ResourceTimingInfo.h

Issue 271083002: Resource Timing: Use original Timing-Allow-Origin for cache validating (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/core/timing/Performance.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Intel Inc. All rights reserved. 2 * Copyright (C) 2013 Intel 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 static PassRefPtr<ResourceTimingInfo> create(const AtomicString& type, const double time) 42 static PassRefPtr<ResourceTimingInfo> create(const AtomicString& type, const double time)
43 { 43 {
44 return adoptRef(new ResourceTimingInfo(type, time)); 44 return adoptRef(new ResourceTimingInfo(type, time));
45 } 45 }
46 46
47 double initialTime() const { return m_initialTime; } 47 double initialTime() const { return m_initialTime; }
48 48
49 void setInitiatorType(const AtomicString& type) { m_type = type; } 49 void setInitiatorType(const AtomicString& type) { m_type = type; }
50 const AtomicString& initiatorType() const { return m_type; } 50 const AtomicString& initiatorType() const { return m_type; }
51 51
52 void setOriginalTimingAllowOrigin(const AtomicString& originalTimingAllowOri gin) { m_originalTimingAllowOrigin = originalTimingAllowOrigin; }
53 const AtomicString& originalTimingAllowOrigin() const { return m_originalTim ingAllowOrigin; }
54
52 void setLoadFinishTime(double time) { m_loadFinishTime = time; } 55 void setLoadFinishTime(double time) { m_loadFinishTime = time; }
53 double loadFinishTime() const { return m_loadFinishTime; } 56 double loadFinishTime() const { return m_loadFinishTime; }
54 57
55 void setInitialRequest(const ResourceRequest& request) { m_initialRequest = request; } 58 void setInitialRequest(const ResourceRequest& request) { m_initialRequest = request; }
56 const ResourceRequest& initialRequest() const { return m_initialRequest; } 59 const ResourceRequest& initialRequest() const { return m_initialRequest; }
57 60
58 void setFinalResponse(const ResourceResponse& response) { m_finalResponse = response; } 61 void setFinalResponse(const ResourceResponse& response) { m_finalResponse = response; }
59 const ResourceResponse& finalResponse() const { return m_finalResponse; } 62 const ResourceResponse& finalResponse() const { return m_finalResponse; }
60 63
61 void addRedirect(const ResourceResponse& redirectResponse) { m_redirectChain .append(redirectResponse); } 64 void addRedirect(const ResourceResponse& redirectResponse) { m_redirectChain .append(redirectResponse); }
62 const Vector<ResourceResponse>& redirectChain() const { return m_redirectCha in; } 65 const Vector<ResourceResponse>& redirectChain() const { return m_redirectCha in; }
63 66
64 void clearLoadTimings() 67 void clearLoadTimings()
65 { 68 {
66 m_finalResponse.setResourceLoadTiming(nullptr); 69 m_finalResponse.setResourceLoadTiming(nullptr);
67 for (size_t i = 0; i < m_redirectChain.size(); ++i) 70 for (size_t i = 0; i < m_redirectChain.size(); ++i)
68 m_redirectChain[i].setResourceLoadTiming(nullptr); 71 m_redirectChain[i].setResourceLoadTiming(nullptr);
69 } 72 }
70 73
71 private: 74 private:
72 ResourceTimingInfo(const AtomicString& type, const double time) 75 ResourceTimingInfo(const AtomicString& type, const double time)
73 : m_type(type) 76 : m_type(type)
74 , m_initialTime(time) 77 , m_initialTime(time)
75 { 78 {
76 } 79 }
77 80
78 AtomicString m_type; 81 AtomicString m_type;
82 AtomicString m_originalTimingAllowOrigin;
79 double m_initialTime; 83 double m_initialTime;
80 double m_loadFinishTime; 84 double m_loadFinishTime;
81 ResourceRequest m_initialRequest; 85 ResourceRequest m_initialRequest;
82 ResourceResponse m_finalResponse; 86 ResourceResponse m_finalResponse;
83 Vector<ResourceResponse> m_redirectChain; 87 Vector<ResourceResponse> m_redirectChain;
84 }; 88 };
85 89
86 } // namespace WebCore 90 } // namespace WebCore
87 91
88 #endif 92 #endif
OLDNEW
« no previous file with comments | « Source/core/timing/Performance.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698