Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: chrome/browser/sync/js_arg_list.h

Issue 6250088: Cleanup everything but net/ for our first clang plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 CHROME_BROWSER_SYNC_JS_ARG_LIST_H_ 5 #ifndef CHROME_BROWSER_SYNC_JS_ARG_LIST_H_
6 #define CHROME_BROWSER_SYNC_JS_ARG_LIST_H_ 6 #define CHROME_BROWSER_SYNC_JS_ARG_LIST_H_
7 #pragma once 7 #pragma once
8 8
9 // See README.js for design comments. 9 // See README.js for design comments.
10 10
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/ref_counted.h" 14 #include "base/ref_counted.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 16
17 namespace browser_sync { 17 namespace browser_sync {
18 18
19 // A thread-safe ref-counted wrapper around an immutable ListValue. 19 // A thread-safe ref-counted wrapper around an immutable ListValue.
20 // Used for passing around argument lists to different threads. 20 // Used for passing around argument lists to different threads.
21 class JsArgList { 21 class JsArgList {
22 public: 22 public:
23 JsArgList(); 23 JsArgList();
24 explicit JsArgList(const ListValue& args); 24 explicit JsArgList(const ListValue& args);
25 explicit JsArgList(const std::vector<const Value*>& args); 25 explicit JsArgList(const std::vector<const Value*>& args);
26 ~JsArgList();
26 27
27 const ListValue& Get() const; 28 const ListValue& Get() const;
28 29
29 std::string ToString() const; 30 std::string ToString() const;
30 31
31 private: 32 private:
32 class SharedListValue : public base::RefCountedThreadSafe<SharedListValue> { 33 class SharedListValue : public base::RefCountedThreadSafe<SharedListValue> {
33 public: 34 public:
34 SharedListValue(); 35 SharedListValue();
35 explicit SharedListValue(const ListValue& list_value); 36 explicit SharedListValue(const ListValue& list_value);
36 explicit SharedListValue(const std::vector<const Value*>& value_list); 37 explicit SharedListValue(const std::vector<const Value*>& value_list);
37 38
38 const ListValue& Get() const; 39 const ListValue& Get() const;
39 40
40 private: 41 private:
41 virtual ~SharedListValue(); 42 virtual ~SharedListValue();
42 friend class base::RefCountedThreadSafe<SharedListValue>; 43 friend class base::RefCountedThreadSafe<SharedListValue>;
43 44
44 ListValue list_value_; 45 ListValue list_value_;
45 }; 46 };
46 47
47 scoped_refptr<const SharedListValue> args_; 48 scoped_refptr<const SharedListValue> args_;
48 49
49 // Copy constructor and assignment operator welcome. 50 // Copy constructor and assignment operator welcome.
50 }; 51 };
51 52
52 } // namespace browser_sync 53 } // namespace browser_sync
53 54
54 #endif // CHROME_BROWSER_SYNC_JS_ARG_LIST_H_ 55 #endif // CHROME_BROWSER_SYNC_JS_ARG_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698