Update to API changes of Chrome 51

This commit is contained in:
Cheng Zhao 2016-05-23 10:59:39 +09:00
parent 05c2999651
commit 7ba391da7c
87 changed files with 225 additions and 231 deletions

View file

@ -22,7 +22,7 @@ class Archive : public mate::Wrappable<Archive> {
public:
static v8::Local<v8::Value> Create(v8::Isolate* isolate,
const base::FilePath& path) {
scoped_ptr<asar::Archive> archive(new asar::Archive(path));
std::unique_ptr<asar::Archive> archive(new asar::Archive(path));
if (!archive->Init())
return v8::False(isolate);
return (new Archive(isolate, std::move(archive)))->GetWrapper();
@ -42,7 +42,7 @@ class Archive : public mate::Wrappable<Archive> {
}
protected:
Archive(v8::Isolate* isolate, scoped_ptr<asar::Archive> archive)
Archive(v8::Isolate* isolate, std::unique_ptr<asar::Archive> archive)
: archive_(std::move(archive)) {
Init(isolate);
}
@ -120,7 +120,7 @@ class Archive : public mate::Wrappable<Archive> {
}
private:
scoped_ptr<asar::Archive> archive_;
std::unique_ptr<asar::Archive> archive_;
DISALLOW_COPY_AND_ASSIGN(Archive);
};

View file

@ -76,7 +76,7 @@ bool AddImageSkiaRep(gfx::ImageSkia* image,
const unsigned char* data,
size_t size,
double scale_factor) {
scoped_ptr<SkBitmap> decoded(new SkBitmap());
std::unique_ptr<SkBitmap> decoded(new SkBitmap());
// Try PNG first.
if (!gfx::PNGCodec::Decode(data, size, decoded.get()))
@ -162,7 +162,7 @@ base::win::ScopedHICON ReadICOFromPath(int size, const base::FilePath& path) {
void ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon) {
// Convert the icon from the Windows specific HICON to gfx::ImageSkia.
scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon));
std::unique_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon));
image->AddRepresentation(gfx::ImageSkiaRep(*bitmap, 1.0f));
}
#endif

View file

@ -17,7 +17,7 @@ v8::Local<v8::Value> CallEmitWithArgs(v8::Isolate* isolate,
v8::Local<v8::Object> obj,
ValueVector* args) {
// Perform microtask checkpoint after running JavaScript.
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
std::unique_ptr<blink::WebScopedRunV8Script> script_scope(
Locker::IsBrowserProcess() ?
nullptr : new blink::WebScopedRunV8Script);
// Use node::MakeCallback to call the callback, and it will also run pending

View file

@ -5,7 +5,9 @@
#ifndef ATOM_COMMON_API_LOCKER_H_
#define ATOM_COMMON_API_LOCKER_H_
#include "base/memory/scoped_ptr.h"
#include <memory>
#include "base/macros.h"
#include "v8/include/v8.h"
namespace mate {
@ -24,7 +26,7 @@ class Locker {
void* operator new(size_t size);
void operator delete(void*, size_t);
scoped_ptr<v8::Locker> locker_;
std::unique_ptr<v8::Locker> locker_;
DISALLOW_COPY_AND_ASSIGN(Locker);
};