| OLD | NEW |
| 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 #include "components/offline_pages/request_header/offline_page_header.h" | 5 #include "components/offline_pages/request_header/offline_page_header.h" |
| 6 | 6 |
| 7 #include "base/strings/string_tokenizer.h" | 7 #include "base/strings/string_tokenizer.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 | 9 |
| 10 namespace offline_pages { | 10 namespace offline_pages { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace | 80 } // namespace |
| 81 | 81 |
| 82 OfflinePageHeader::OfflinePageHeader() | 82 OfflinePageHeader::OfflinePageHeader() |
| 83 : did_fail_parsing_for_test(false), | 83 : did_fail_parsing_for_test(false), |
| 84 need_to_persist(false), | 84 need_to_persist(false), |
| 85 reason(Reason::NONE) { | 85 reason(Reason::NONE) { |
| 86 } | 86 } |
| 87 | 87 |
| 88 OfflinePageHeader::OfflinePageHeader(const OfflinePageHeader& other) = default; |
| 89 |
| 88 OfflinePageHeader::OfflinePageHeader(const std::string& header_value) | 90 OfflinePageHeader::OfflinePageHeader(const std::string& header_value) |
| 89 : did_fail_parsing_for_test(false), | 91 : did_fail_parsing_for_test(false), |
| 90 need_to_persist(false), | 92 need_to_persist(false), |
| 91 reason(Reason::NONE) { | 93 reason(Reason::NONE) { |
| 92 if (!ParseOfflineHeaderValue(header_value, &need_to_persist, &reason, &id)) { | 94 if (!ParseOfflineHeaderValue(header_value, &need_to_persist, &reason, &id)) { |
| 93 did_fail_parsing_for_test = true; | 95 did_fail_parsing_for_test = true; |
| 94 Clear(); | 96 Clear(); |
| 95 } | 97 } |
| 96 } | 98 } |
| 97 | 99 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 123 return value; | 125 return value; |
| 124 } | 126 } |
| 125 | 127 |
| 126 void OfflinePageHeader::Clear() { | 128 void OfflinePageHeader::Clear() { |
| 127 reason = Reason::NONE; | 129 reason = Reason::NONE; |
| 128 need_to_persist = false; | 130 need_to_persist = false; |
| 129 id.clear(); | 131 id.clear(); |
| 130 } | 132 } |
| 131 | 133 |
| 132 } // namespace offline_pages | 134 } // namespace offline_pages |
| OLD | NEW |