Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
windows can’t figure out how to convert a char* to a std::string
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Mar 12, 2017
1 parent 815b915 commit f698449
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions brave/browser/extensions/path_bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ void PathBindings::Append(
return;
}

base::FilePath base_path(*v8::String::Utf8Value(args[0]));
base::FilePath append_path(*v8::String::Utf8Value(args[1]));
std::string base_path_str = *v8::String::Utf8Value(args[0]);
std::string append_path_str = *v8::String::Utf8Value(args[1]);
base::FilePath base_path(base_path_str);
base::FilePath append_path(append_path_str);

args.GetReturnValue().Set(v8::String::NewFromUtf8(
GetIsolate(), base_path.Append(append_path).AsUTF8Unsafe().c_str()));
Expand All @@ -52,7 +54,8 @@ void PathBindings::DirName(
return;
}

base::FilePath path(*v8::String::Utf8Value(args[0]));
std::string path_str = *v8::String::Utf8Value(args[0]);
base::FilePath path(path_str);

args.GetReturnValue().Set(v8::String::NewFromUtf8(
GetIsolate(), path.DirName().AsUTF8Unsafe().c_str()));
Expand Down

0 comments on commit f698449

Please sign in to comment.