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

Side by Side Diff: ppapi/cpp/dev/string_wrapper_dev.h

Issue 60173003: Draft: apps APIs in Pepper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « ppapi/cpp/dev/optional_dev.h ('k') | ppapi/cpp/dev/string_wrapper_dev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 PPAPI_CPP_DEV_STRING_WRAPPER_DEV_H_
6 #define PPAPI_CPP_DEV_STRING_WRAPPER_DEV_H_
7
8 #include <string>
9
10 #include "ppapi/c/pp_var.h"
11 #include "ppapi/cpp/dev/may_own_ptr_dev.h"
12
13 namespace pp {
14 namespace internal {
15
16 class StringWrapper {
17 public:
18 StringWrapper(PP_Var* storage, NotOwned);
19 explicit StringWrapper(const std::string& value);
20 StringWrapper(const StringWrapper& other);
21
22 ~StringWrapper();
23
24 StringWrapper& operator=(const StringWrapper& other);
25 StringWrapper& operator=(const PP_Var& other);
26
27 bool is_set() const;
28 void unset();
29 // TODO(yzshen): it should be easy to add a cache.
30 std::string get() const;
31 void set(const std::string& value);
32
33 const PP_Var& ToVar() const {
34 return *storage_;
35 }
36
37 PP_Var* StartRawUpdate() { return storage_.get(); }
38 void EndRawUpdate() {}
39
40 private:
41 MayOwnPtr<PP_Var> storage_;
42 };
43
44 } // namespace internal
45 } // namespace pp
46
47 #endif // PPAPI_CPP_DEV_STRING_WRAPPER_DEV_H_
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/optional_dev.h ('k') | ppapi/cpp/dev/string_wrapper_dev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698