Fix compilation errors on OS X

This commit is contained in:
Cheng Zhao 2016-03-08 23:28:53 +09:00
parent 4503aafe64
commit 5fae63a2f5
93 changed files with 242 additions and 317 deletions

View file

@ -27,12 +27,12 @@ class Archive : public mate::Wrappable {
scoped_ptr<asar::Archive> archive(new asar::Archive(path));
if (!archive->Init())
return v8::False(isolate);
return (new Archive(archive.Pass()))->GetWrapper(isolate);
return (new Archive(std::move(archive)))->GetWrapper(isolate);
}
protected:
explicit Archive(scoped_ptr<asar::Archive> archive)
: archive_(archive.Pass()) {}
: archive_(std::move(archive)) {}
// Reads the offset and size of file.
v8::Local<v8::Value> GetFileInfo(v8::Isolate* isolate,

View file

@ -7,6 +7,7 @@
#include <list>
#include "base/macros.h"
#include "base/strings/string16.h"
#include "v8/include/v8.h"
#include "vendor/node/deps/uv/include/uv.h"

View file

@ -158,7 +158,7 @@ bool Archive::Init() {
}
uint32_t size;
if (!base::PickleIterator(base::Pickle(buf.data(), buf.size())).ReadUint32_t(
if (!base::PickleIterator(base::Pickle(buf.data(), buf.size())).ReadUInt32(
&size)) {
LOG(ERROR) << "Failed to parse header size from " << path_.value();
return false;
@ -296,7 +296,7 @@ bool Archive::CopyFileOut(const base::FilePath& path, base::FilePath* out) {
#endif
*out = temp_file->path();
external_files_.set(path, temp_file.Pass());
external_files_.set(path, std::move(temp_file));
return true;
}

View file

@ -29,7 +29,7 @@ class Archive {
bool unpacked;
bool executable;
uint32_t size;
uint64 offset;
uint64_t offset;
};
struct Stats : public FileInfo {

View file

@ -51,7 +51,7 @@ bool ScopedTemporaryFile::Init(const base::FilePath::StringType& ext) {
bool ScopedTemporaryFile::InitFromFile(base::File* src,
const base::FilePath::StringType& ext,
uint64 offset, uint64 size) {
uint64_t offset, uint64_t size) {
if (!src->IsValid())
return false;

View file

@ -28,7 +28,7 @@ class ScopedTemporaryFile {
// Init an temporary file and fill it with content of |path|.
bool InitFromFile(base::File* src,
const base::FilePath::StringType& ext,
uint64 offset, uint64 size);
uint64_t offset, uint64_t size);
base::FilePath path() const { return path_; }

View file

@ -48,7 +48,8 @@ void CrashReporterMac::InitBreakpad(const std::string& product_name,
if (crashpad_client.StartHandler(handler_path, database_path,
submit_url,
StringMap(),
std::vector<std::string>())) {
std::vector<std::string>(),
true)) {
crashpad_client.UseHandler();
}
} // @autoreleasepool

View file

@ -34,7 +34,7 @@ v8::Local<v8::Value> Converter<const net::URLRequest*>::ToV8(
scoped_ptr<base::ListValue> list(new base::ListValue);
atom::GetUploadData(list.get(), val);
if (!list->empty())
dict->Set("uploadData", list.Pass());
dict->Set("uploadData", std::move(list));
return mate::ConvertToV8(isolate, *(dict.get()));
}
@ -74,7 +74,7 @@ void GetUploadData(base::ListValue* upload_data_list,
const net::UploadDataStream* upload_data = request->get_upload();
if (!upload_data)
return;
const ScopedVector<net::UploadElementReader>* readers =
const std::vector<scoped_ptr<net::UploadElementReader>>* readers =
upload_data->GetElementReaders();
for (const auto& reader : *readers) {
scoped_ptr<base::DictionaryValue> upload_data_dict(
@ -85,14 +85,14 @@ void GetUploadData(base::ListValue* upload_data_list,
scoped_ptr<base::Value> bytes(
base::BinaryValue::CreateWithCopiedBuffer(bytes_reader->bytes(),
bytes_reader->length()));
upload_data_dict->Set("bytes", bytes.Pass());
upload_data_dict->Set("bytes", std::move(bytes));
} else if (reader->AsFileReader()) {
const net::UploadFileElementReader* file_reader =
reader->AsFileReader();
auto file_path = file_reader->path().AsUTF8Unsafe();
upload_data_dict->SetStringWithoutPathExpansion("file", file_path);
}
upload_data_list->Append(upload_data_dict.Pass());
upload_data_list->Append(std::move(upload_data_dict));
}
}

View file

@ -222,8 +222,8 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
if (val->IsBoolean())
return new base::FundamentalValue(val->ToBoolean()->Value());
if (val->Isint32_t())
return new base::FundamentalValue(val->Toint32_t()->Value());
if (val->IsInt32())
return new base::FundamentalValue(val->ToInt32()->Value());
if (val->IsNumber())
return new base::FundamentalValue(val->ToNumber()->Value());

View file

@ -85,7 +85,7 @@ scoped_ptr<const char*[]> StringVectorToArgArray(
for (size_t i = 0; i < vector.size(); ++i) {
array[i] = vector[i].c_str();
}
return array.Pass();
return array;
}
base::FilePath GetResourcesPath(bool is_browser) {