OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
5 * Copyright (C) 2009 Google Inc. All rights reserved. | 5 * Copyright (C) 2009 Google Inc. All rights reserved. |
6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 if (!headerValue.IsNull()) { | 873 if (!headerValue.IsNull()) { |
874 DCHECK(headerValue.Is8Bit()); | 874 DCHECK(headerValue.Is8Bit()); |
875 | 875 |
876 HeaderFieldTokenizer tokenizer(headerValue); | 876 HeaderFieldTokenizer tokenizer(headerValue); |
877 while (!tokenizer.IsConsumed()) { | 877 while (!tokenizer.IsConsumed()) { |
878 StringView metric; | 878 StringView metric; |
879 if (!tokenizer.ConsumeToken(Mode::kNormal, metric)) { | 879 if (!tokenizer.ConsumeToken(Mode::kNormal, metric)) { |
880 break; | 880 break; |
881 } | 881 } |
882 | 882 |
883 double duration = 0.0; | 883 double value = 0.0; |
884 String description = ""; | 884 String description = ""; |
885 if (tokenizer.Consume('=')) { | 885 if (tokenizer.Consume('=')) { |
886 StringView durationOutput; | 886 StringView valueOutput; |
887 if (tokenizer.ConsumeToken(Mode::kNormal, durationOutput)) { | 887 if (tokenizer.ConsumeToken(Mode::kNormal, valueOutput)) { |
888 duration = durationOutput.ToString().ToDouble(); | 888 value = valueOutput.ToString().ToDouble(); |
889 } | 889 } |
890 } | 890 } |
891 if (tokenizer.Consume(';')) { | 891 if (tokenizer.Consume(';')) { |
892 tokenizer.ConsumeTokenOrQuotedString(Mode::kNormal, description); | 892 tokenizer.ConsumeTokenOrQuotedString(Mode::kNormal, description); |
893 } | 893 } |
894 | 894 |
895 headers->push_back(WTF::MakeUnique<ServerTimingHeader>( | 895 headers->push_back(WTF::MakeUnique<ServerTimingHeader>( |
896 metric.ToString(), duration, description)); | 896 metric.ToString(), value, description)); |
897 | 897 |
898 if (!tokenizer.Consume(',')) { | 898 if (!tokenizer.Consume(',')) { |
899 break; | 899 break; |
900 } | 900 } |
901 } | 901 } |
902 } | 902 } |
903 return headers; | 903 return headers; |
904 } | 904 } |
905 | 905 |
906 } // namespace blink | 906 } // namespace blink |
OLD | NEW |