summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl/var.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-07 05:38:00 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-07 05:38:00 +0000
commit2d449b31b71c259f63dbf4b7a28ee297531b721a (patch)
tree91564c036afe5a22e6ab4414d2a948decec28542 /ppapi/shared_impl/var.h
parentf4f1be5d33972f2bd04dc6a295aaeaee6c96e94c (diff)
downloadchromium_src-2d449b31b71c259f63dbf4b7a28ee297531b721a.zip
chromium_src-2d449b31b71c259f63dbf4b7a28ee297531b721a.tar.gz
chromium_src-2d449b31b71c259f63dbf4b7a28ee297531b721a.tar.bz2
Remove special handling for strings in var serialization.
Previously we had to have a lot of weird string handling because strings needed a PP_Module to be constructed, and because they had different methods for being created in the host and the plugin processes. We've removed all of these limitations, so now we can just delete the whole mess. Review URL: https://chromiumcodereview.appspot.com/9316123 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl/var.h')
-rw-r--r--ppapi/shared_impl/var.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/ppapi/shared_impl/var.h b/ppapi/shared_impl/var.h
index ed7f4f1..d8084d7 100644
--- a/ppapi/shared_impl/var.h
+++ b/ppapi/shared_impl/var.h
@@ -94,7 +94,6 @@ class PPAPI_SHARED_EXPORT StringVar : public Var {
public:
StringVar(const std::string& str);
StringVar(const char* str, uint32 len);
- StringVar(scoped_ptr<std::string> str);
virtual ~StringVar();
const std::string& value() const { return value_; }
@@ -117,13 +116,19 @@ class PPAPI_SHARED_EXPORT StringVar : public Var {
// create a StringVar and return the reference to it in the var.
static PP_Var StringToPPVar(const std::string& str);
static PP_Var StringToPPVar(const char* str, uint32 len);
- static PP_Var StringToPPVar(scoped_ptr<std::string> str);
+
+ // Same as StringToPPVar but avoids a copy by destructively swapping the
+ // given string into the newly created StringVar. The string must already be
+ // valid UTF-8. After the call, *src will be empty.
+ static PP_Var SwapValidatedUTF8StringIntoPPVar(std::string* src);
// Helper function that converts a PP_Var to a string. This will return NULL
// if the PP_Var is not of string type or the string is invalid.
static StringVar* FromPPVar(PP_Var var);
private:
+ StringVar(); // Makes an empty string.
+
std::string value_;
DISALLOW_COPY_AND_ASSIGN(StringVar);