OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 return false; | 87 return false; |
88 } | 88 } |
89 } | 89 } |
90 return fail_to_read_response_; | 90 return fail_to_read_response_; |
91 } | 91 } |
92 | 92 |
93 private: | 93 private: |
94 rtc::scoped_ptr<ResourceFileReader> reader_; | 94 rtc::scoped_ptr<ResourceFileReader> reader_; |
95 bool fail_to_read_response_; | 95 bool fail_to_read_response_; |
96 | 96 |
97 DISALLOW_IMPLICIT_CONSTRUCTORS(BaseLineFileVerify); | 97 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BaseLineFileVerify); |
98 }; | 98 }; |
99 | 99 |
100 class BaseLineFileUpdate : public BaseLineFileInterface { | 100 class BaseLineFileUpdate : public BaseLineFileInterface { |
101 public: | 101 public: |
102 BaseLineFileUpdate(const std::string& filepath, | 102 BaseLineFileUpdate(const std::string& filepath, |
103 BaseLineFileInterface* verifier) | 103 BaseLineFileInterface* verifier) |
104 : verifier_(verifier), | 104 : verifier_(verifier), |
105 output_content_(), | 105 output_content_(), |
106 filepath_(filepath) { | 106 filepath_(filepath) { |
107 output_content_.push_back(kMagicMarker); | 107 output_content_.push_back(kMagicMarker); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 printf("NOTE: No change, not writing: %s\n", filepath_.c_str()); | 140 printf("NOTE: No change, not writing: %s\n", filepath_.c_str()); |
141 return true; | 141 return true; |
142 } | 142 } |
143 | 143 |
144 private: | 144 private: |
145 rtc::scoped_ptr<BaseLineFileInterface> verifier_; | 145 rtc::scoped_ptr<BaseLineFileInterface> verifier_; |
146 std::vector<uint32_t> output_content_; | 146 std::vector<uint32_t> output_content_; |
147 std::string filepath_; | 147 std::string filepath_; |
148 | 148 |
149 DISALLOW_IMPLICIT_CONSTRUCTORS(BaseLineFileUpdate); | 149 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BaseLineFileUpdate); |
150 }; | 150 }; |
151 | 151 |
152 BaseLineFileInterface* BaseLineFileInterface::Create( | 152 BaseLineFileInterface* BaseLineFileInterface::Create( |
153 const std::string& filename, bool write_output_file) { | 153 const std::string& filename, bool write_output_file) { |
154 std::string filepath = filename; | 154 std::string filepath = filename; |
155 std::replace(filepath.begin(), filepath.end(), '/', '_'); | 155 std::replace(filepath.begin(), filepath.end(), '/', '_'); |
156 filepath = std::string(kResourceSubDir) + "/" + filepath; | 156 filepath = std::string(kResourceSubDir) + "/" + filepath; |
157 | 157 |
158 rtc::scoped_ptr<BaseLineFileInterface> result; | 158 rtc::scoped_ptr<BaseLineFileInterface> result; |
159 result.reset(new BaseLineFileVerify(filepath, !write_output_file)); | 159 result.reset(new BaseLineFileVerify(filepath, !write_output_file)); |
160 if (write_output_file) { | 160 if (write_output_file) { |
161 // Takes ownership of the |verifier| instance. | 161 // Takes ownership of the |verifier| instance. |
162 result.reset(new BaseLineFileUpdate(filepath, result.release())); | 162 result.reset(new BaseLineFileUpdate(filepath, result.release())); |
163 } | 163 } |
164 return result.release(); | 164 return result.release(); |
165 } | 165 } |
166 } // namespace bwe | 166 } // namespace bwe |
167 } // namespace testing | 167 } // namespace testing |
168 } // namespace webrtc | 168 } // namespace webrtc |
OLD | NEW |