OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/common/user_script.h" | 5 #include "extensions/common/user_script.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "extensions/common/switches.h" | 10 #include "extensions/common/switches.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 uint64 num_files = 0; | 233 uint64 num_files = 0; |
234 CHECK(pickle.ReadUInt64(iter, &num_files)); | 234 CHECK(pickle.ReadUInt64(iter, &num_files)); |
235 scripts->clear(); | 235 scripts->clear(); |
236 for (uint64 i = 0; i < num_files; ++i) { | 236 for (uint64 i = 0; i < num_files; ++i) { |
237 File file; | 237 File file; |
238 file.Unpickle(pickle, iter); | 238 file.Unpickle(pickle, iter); |
239 scripts->push_back(file); | 239 scripts->push_back(file); |
240 } | 240 } |
241 } | 241 } |
242 | 242 |
| 243 bool operator<(const UserScript& script1, const UserScript& script2) { |
| 244 // The only kind of script that should be compared is the kind that has its |
| 245 // IDs initialized to a meaningful value. |
| 246 DCHECK(script1.id() != -1 && script2.id() != -1); |
| 247 return script1.id() < script2.id(); |
| 248 } |
| 249 |
243 } // namespace extensions | 250 } // namespace extensions |
OLD | NEW |