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 #ifndef EXTENSIONS_COMMON_USER_SCRIPT_H_ | 5 #ifndef EXTENSIONS_COMMON_USER_SCRIPT_H_ |
6 #define EXTENSIONS_COMMON_USER_SCRIPT_H_ | 6 #define EXTENSIONS_COMMON_USER_SCRIPT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // Serialize the UserScript into a pickle. The content of the scripts and | 228 // Serialize the UserScript into a pickle. The content of the scripts and |
229 // paths to UserScript::Files will not be serialized! | 229 // paths to UserScript::Files will not be serialized! |
230 void Pickle(base::Pickle* pickle) const; | 230 void Pickle(base::Pickle* pickle) const; |
231 | 231 |
232 // Deserialize the script from a pickle. Note that this always succeeds | 232 // Deserialize the script from a pickle. Note that this always succeeds |
233 // because presumably we were the one that pickled it, and we did it | 233 // because presumably we were the one that pickled it, and we did it |
234 // correctly. | 234 // correctly. |
235 void Unpickle(const base::Pickle& pickle, base::PickleIterator* iter); | 235 void Unpickle(const base::Pickle& pickle, base::PickleIterator* iter); |
236 | 236 |
237 private: | 237 private: |
238 // Pickle helper functions used to pickle the individual types of components. | 238 // base::Pickle helper functions used to pickle the individual types of |
| 239 // components. |
239 void PickleGlobs(base::Pickle* pickle, | 240 void PickleGlobs(base::Pickle* pickle, |
240 const std::vector<std::string>& globs) const; | 241 const std::vector<std::string>& globs) const; |
241 void PickleHostID(base::Pickle* pickle, const HostID& host_id) const; | 242 void PickleHostID(base::Pickle* pickle, const HostID& host_id) const; |
242 void PickleURLPatternSet(base::Pickle* pickle, | 243 void PickleURLPatternSet(base::Pickle* pickle, |
243 const URLPatternSet& pattern_list) const; | 244 const URLPatternSet& pattern_list) const; |
244 void PickleScripts(base::Pickle* pickle, const FileList& scripts) const; | 245 void PickleScripts(base::Pickle* pickle, const FileList& scripts) const; |
245 | 246 |
246 // Unpickle helper functions used to unpickle individual types of components. | 247 // Unpickle helper functions used to unpickle individual types of components. |
247 void UnpickleGlobs(const base::Pickle& pickle, | 248 void UnpickleGlobs(const base::Pickle& pickle, |
248 base::PickleIterator* iter, | 249 base::PickleIterator* iter, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 }; | 319 }; |
319 | 320 |
320 // For storing UserScripts with unique IDs in sets. | 321 // For storing UserScripts with unique IDs in sets. |
321 bool operator<(const UserScript& script1, const UserScript& script2); | 322 bool operator<(const UserScript& script1, const UserScript& script2); |
322 | 323 |
323 typedef std::vector<UserScript> UserScriptList; | 324 typedef std::vector<UserScript> UserScriptList; |
324 | 325 |
325 } // namespace extensions | 326 } // namespace extensions |
326 | 327 |
327 #endif // EXTENSIONS_COMMON_USER_SCRIPT_H_ | 328 #endif // EXTENSIONS_COMMON_USER_SCRIPT_H_ |
OLD | NEW |