| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SYNC_JS_ARG_LIST_H_ | |
| 6 #define CHROME_BROWSER_SYNC_JS_ARG_LIST_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 // See README.js for design comments. | |
| 10 | |
| 11 #include <string> | |
| 12 | |
| 13 #include "base/memory/ref_counted.h" | |
| 14 #include "base/values.h" | |
| 15 #include "chrome/browser/sync/shared_value.h" | |
| 16 | |
| 17 namespace browser_sync { | |
| 18 | |
| 19 // A thread-safe wrapper around an immutable ListValue. Used for | |
| 20 // passing around argument lists to different threads. | |
| 21 class JsArgList { | |
| 22 public: | |
| 23 // Uses an empty argument list. | |
| 24 JsArgList(); | |
| 25 | |
| 26 // Takes over the data in |args|, leaving |args| empty. | |
| 27 explicit JsArgList(ListValue* args); | |
| 28 | |
| 29 ~JsArgList(); | |
| 30 | |
| 31 const ListValue& Get() const; | |
| 32 | |
| 33 std::string ToString() const; | |
| 34 | |
| 35 // Copy constructor and assignment operator welcome. | |
| 36 | |
| 37 private: | |
| 38 scoped_refptr<const SharedValue<ListValue> > args_; | |
| 39 }; | |
| 40 | |
| 41 } // namespace browser_sync | |
| 42 | |
| 43 #endif // CHROME_BROWSER_SYNC_JS_ARG_LIST_H_ | |
| OLD | NEW |