Use string16 instead of std::string when sending IPC messages.

The underlying V8::String is represented in UTF18, by using string16 in
IPC messages we can avoid the overhead of encode conversion.
This commit is contained in:
Cheng Zhao 2013-09-20 22:55:42 +08:00
parent ef5a4b5fe0
commit ef4b36d621
17 changed files with 68 additions and 60 deletions

View file

@ -5,9 +5,8 @@
#ifndef ATOM_BROWSER_ATOM_API_EVENT_H_
#define ATOM_BROWSER_ATOM_API_EVENT_H_
#include <string>
#include "base/basictypes.h"
#include "base/string16.h"
#include "vendor/node/src/node_object_wrap.h"
namespace atom {
@ -22,7 +21,7 @@ class Event : public node::ObjectWrap {
static v8::Handle<v8::Object> CreateV8Object();
// Get JSON string of the event.returnValue from a Event object.
static std::string GetReturnValue(v8::Handle<v8::Object> event);
static string16 GetReturnValue(v8::Handle<v8::Object> event);
// Accessor to return handle_, this follows Google C++ Style.
v8::Persistent<v8::Object>& handle() { return handle_; }