summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-09 21:01:35 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-09 21:01:35 +0000
commit5376119db8db98303ff177c1ce153e58c742e824 (patch)
tree1807b545295f0969572426b93dcb430d396d7347
parent8ef13715896630c51f1926cfce8a67d7308c05b2 (diff)
downloadchromium_src-5376119db8db98303ff177c1ce153e58c742e824.zip
chromium_src-5376119db8db98303ff177c1ce153e58c742e824.tar.gz
chromium_src-5376119db8db98303ff177c1ce153e58c742e824.tar.bz2
Update Chrome to pull latest PPAPI with new uses of point and size.
This also pulls in the renamed enums from Darin's patch http://codereview.chromium.org/2900003 TEST=covered by unit tests BUG=none Review URL: http://codereview.chromium.org/2925007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52010 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rw-r--r--remoting/client/plugin/chromoting_plugin.cc12
-rw-r--r--remoting/client/plugin/pepper_entrypoints.cc2
-rw-r--r--webkit/glue/plugins/pepper_device_context_2d.cc54
-rw-r--r--webkit/glue/plugins/pepper_device_context_2d.h8
-rw-r--r--webkit/glue/plugins/pepper_directory_reader.cc4
-rw-r--r--webkit/glue/plugins/pepper_event_conversion.cc84
-rw-r--r--webkit/glue/plugins/pepper_file_chooser.cc4
-rw-r--r--webkit/glue/plugins/pepper_file_io.cc42
-rw-r--r--webkit/glue/plugins/pepper_file_ref.cc10
-rw-r--r--webkit/glue/plugins/pepper_file_system.cc10
-rw-r--r--webkit/glue/plugins/pepper_image_data.cc11
-rw-r--r--webkit/glue/plugins/pepper_plugin_module.cc4
-rw-r--r--webkit/glue/plugins/pepper_url_loader.cc30
-rw-r--r--webkit/glue/plugins/pepper_url_request_info.cc10
-rw-r--r--webkit/glue/plugins/pepper_var.cc78
16 files changed, 187 insertions, 178 deletions
diff --git a/DEPS b/DEPS
index 7ff5d11..cacb66b 100644
--- a/DEPS
+++ b/DEPS
@@ -158,7 +158,7 @@ deps = {
Var("libvpx_revision"),
"src/third_party/ppapi":
- "http://ppapi.googlecode.com/svn/trunk@147",
+ "http://ppapi.googlecode.com/svn/trunk@151",
"src/third_party/libjingle/source":
"http://libjingle.googlecode.com/svn/branches/nextsnap@" +
diff --git a/remoting/client/plugin/chromoting_plugin.cc b/remoting/client/plugin/chromoting_plugin.cc
index c5b5b03..a312426 100644
--- a/remoting/client/plugin/chromoting_plugin.cc
+++ b/remoting/client/plugin/chromoting_plugin.cc
@@ -148,15 +148,15 @@ void ChromotingPlugin::ViewChanged(const PP_Rect& position,
bool ChromotingPlugin::HandleEvent(const PP_Event& event) {
switch (event.type) {
- case PP_Event_Type_MouseDown:
- case PP_Event_Type_MouseUp:
- case PP_Event_Type_MouseMove:
- case PP_Event_Type_MouseEnter:
- case PP_Event_Type_MouseLeave:
+ case PP_EVENT_TYPE_MOUSEDOWN:
+ case PP_EVENT_TYPE_MOUSEUP:
+ case PP_EVENT_TYPE_MOUSEMOVE:
+ case PP_EVENT_TYPE_MOUSEENTER:
+ case PP_EVENT_TYPE_MOUSELEAVE:
//client_->handle_mouse_event(npevent);
break;
- case PP_Event_Type_Char:
+ case PP_EVENT_TYPE_CHAR:
//client_->handle_char_event(npevent);
break;
diff --git a/remoting/client/plugin/pepper_entrypoints.cc b/remoting/client/plugin/pepper_entrypoints.cc
index c8a0895..ad21956 100644
--- a/remoting/client/plugin/pepper_entrypoints.cc
+++ b/remoting/client/plugin/pepper_entrypoints.cc
@@ -174,7 +174,7 @@ class ChromotingModule {
static PP_Var Instance_GetInstanceObject(PP_Instance pp_instance) {
PP_Var var;
- var.type = PP_VarType_Void;
+ var.type = PP_VARTYPE_VOID;
return var;
}
diff --git a/webkit/glue/plugins/pepper_device_context_2d.cc b/webkit/glue/plugins/pepper_device_context_2d.cc
index 4dcfa5e..cf64276 100644
--- a/webkit/glue/plugins/pepper_device_context_2d.cc
+++ b/webkit/glue/plugins/pepper_device_context_2d.cc
@@ -62,14 +62,15 @@ bool ValidateAndConvertRect(const PP_Rect* rect,
return true;
}
-PP_Resource Create(PP_Module module_id, int32_t width, int32_t height,
+PP_Resource Create(PP_Module module_id,
+ const PP_Size* size,
bool is_always_opaque) {
PluginModule* module = PluginModule::FromPPModule(module_id);
if (!module)
return NULL;
scoped_refptr<DeviceContext2D> context(new DeviceContext2D(module));
- if (!context->Init(width, height, is_always_opaque))
+ if (!context->Init(size->width, size->height, is_always_opaque))
return NULL;
context->AddRef(); // AddRef for the caller.
return context->GetResource();
@@ -82,33 +83,34 @@ bool IsDeviceContext2D(PP_Resource resource) {
}
bool Describe(PP_Resource device_context,
- int32_t* width, int32_t* height, bool* is_always_opaque) {
+ PP_Size* size,
+ bool* is_always_opaque) {
scoped_refptr<DeviceContext2D> context(
Resource::GetAs<DeviceContext2D>(device_context));
if (!context.get())
return false;
- return context->Describe(width, height, is_always_opaque);
+ return context->Describe(size, is_always_opaque);
}
bool PaintImageData(PP_Resource device_context,
PP_Resource image,
- int32_t x, int32_t y,
+ const PP_Point* top_left,
const PP_Rect* src_rect) {
scoped_refptr<DeviceContext2D> context(
Resource::GetAs<DeviceContext2D>(device_context));
if (!context.get())
return false;
- return context->PaintImageData(image, x, y, src_rect);
+ return context->PaintImageData(image, top_left, src_rect);
}
bool Scroll(PP_Resource device_context,
const PP_Rect* clip_rect,
- int32_t dx, int32_t dy) {
+ const PP_Point* amount) {
scoped_refptr<DeviceContext2D> context(
Resource::GetAs<DeviceContext2D>(device_context));
if (!context.get())
return false;
- return context->Scroll(clip_rect, dx, dy);
+ return context->Scroll(clip_rect, amount);
}
bool ReplaceContents(PP_Resource device_context, PP_Resource image) {
@@ -124,7 +126,7 @@ int32_t Flush(PP_Resource device_context,
scoped_refptr<DeviceContext2D> context(
Resource::GetAs<DeviceContext2D>(device_context));
if (!context.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return context->Flush(callback);
}
@@ -197,17 +199,19 @@ bool DeviceContext2D::Init(int width, int height, bool is_always_opaque) {
return true;
}
-bool DeviceContext2D::Describe(int32_t* width, int32_t* height,
- bool* is_always_opaque) {
- *width = image_data_->width();
- *height = image_data_->height();
+bool DeviceContext2D::Describe(PP_Size* size, bool* is_always_opaque) {
+ size->width = image_data_->width();
+ size->height = image_data_->height();
*is_always_opaque = false; // TODO(brettw) implement this.
return true;
}
bool DeviceContext2D::PaintImageData(PP_Resource image,
- int32_t x, int32_t y,
+ const PP_Point* top_left,
const PP_Rect* src_rect) {
+ if (!top_left)
+ return false;
+
scoped_refptr<ImageData> image_resource(Resource::GetAs<ImageData>(image));
if (!image_resource.get())
return false;
@@ -221,7 +225,8 @@ bool DeviceContext2D::PaintImageData(PP_Resource image,
// Validate the bitmap position using the previously-validated rect, there
// should be no painted area outside of the image.
- int64 x64 = static_cast<int64>(x), y64 = static_cast<int64>(y);
+ int64 x64 = static_cast<int64>(top_left->x);
+ int64 y64 = static_cast<int64>(top_left->y);
if (x64 + static_cast<int64>(operation.paint_src_rect.x()) < 0 ||
x64 + static_cast<int64>(operation.paint_src_rect.right()) >
image_data_->width())
@@ -230,15 +235,15 @@ bool DeviceContext2D::PaintImageData(PP_Resource image,
y64 + static_cast<int64>(operation.paint_src_rect.bottom()) >
image_data_->height())
return false;
- operation.paint_x = x;
- operation.paint_y = y;
+ operation.paint_x = top_left->x;
+ operation.paint_y = top_left->y;
queued_operations_.push_back(operation);
return true;
}
bool DeviceContext2D::Scroll(const PP_Rect* clip_rect,
- int32_t dx, int32_t dy) {
+ const PP_Point* amount) {
QueuedOperation operation(QueuedOperation::SCROLL);
if (!ValidateAndConvertRect(clip_rect,
image_data_->width(),
@@ -248,6 +253,8 @@ bool DeviceContext2D::Scroll(const PP_Rect* clip_rect,
// If we're being asked to scroll by more than the clip rect size, just
// ignore this scroll command and say it worked.
+ int32 dx = amount->x;
+ int32 dy = amount->y;
if (dx <= -image_data_->width() || dx >= image_data_->width() ||
dx <= -image_data_->height() || dy >= image_data_->height())
return true;
@@ -280,12 +287,12 @@ bool DeviceContext2D::ReplaceContents(PP_Resource image) {
int32_t DeviceContext2D::Flush(const PP_CompletionCallback& callback) {
// Don't allow more than one pending flush at a time.
if (HasPendingFlush())
- return PP_Error_InProgress;
+ return PP_ERROR_INPROGRESS;
// TODO(brettw) check that the current thread is not the main one and
// implement blocking flushes in this case.
if (!callback.func)
- return PP_Error_BadArgument;
+ return PP_ERROR_BADARGUMENT;
gfx::Rect changed_rect;
for (size_t i = 0; i < queued_operations_.size(); i++) {
@@ -328,10 +335,11 @@ int32_t DeviceContext2D::Flush(const PP_CompletionCallback& callback) {
// execute in the next round of the message loop.
ScheduleOffscreenCallback(FlushCallbackData(callback));
}
- return PP_Error_WouldBlock;
+ return PP_ERROR_WOULDBLOCK;
}
-bool DeviceContext2D::ReadImageData(PP_Resource image, int32_t x, int32_t y) {
+bool DeviceContext2D::ReadImageData(PP_Resource image,
+ const PP_Point* top_left) {
// Get and validate the image object to paint into.
scoped_refptr<ImageData> image_resource(Resource::GetAs<ImageData>(image));
if (!image_resource.get())
@@ -340,10 +348,12 @@ bool DeviceContext2D::ReadImageData(PP_Resource image, int32_t x, int32_t y) {
return false; // Must be in the right format.
// Validate the bitmap position.
+ int x = top_left->x;
if (x < 0 ||
static_cast<int64>(x) + static_cast<int64>(image_resource->width()) >
image_data_->width())
return false;
+ int y = top_left->y;
if (y < 0 ||
static_cast<int64>(y) + static_cast<int64>(image_resource->height()) >
image_data_->height())
diff --git a/webkit/glue/plugins/pepper_device_context_2d.h b/webkit/glue/plugins/pepper_device_context_2d.h
index 87203c8..5d9180c 100644
--- a/webkit/glue/plugins/pepper_device_context_2d.h
+++ b/webkit/glue/plugins/pepper_device_context_2d.h
@@ -40,15 +40,15 @@ class DeviceContext2D : public Resource {
virtual DeviceContext2D* AsDeviceContext2D() { return this; }
// PPB_DeviceContext2D functions.
- bool Describe(int32_t* width, int32_t* height, bool* is_always_opaque);
+ bool Describe(PP_Size* size, bool* is_always_opaque);
bool PaintImageData(PP_Resource image,
- int32_t x, int32_t y,
+ const PP_Point* top_left,
const PP_Rect* src_rect);
- bool Scroll(const PP_Rect* clip_rect, int32_t dx, int32_t dy);
+ bool Scroll(const PP_Rect* clip_rect, const PP_Point* amount);
bool ReplaceContents(PP_Resource image);
int32_t Flush(const PP_CompletionCallback& callback);
- bool ReadImageData(PP_Resource image, int32_t x, int32_t y);
+ bool ReadImageData(PP_Resource image, const PP_Point* top_left);
// Assciates this device with the given plugin instance. You can pass NULL to
// clear the existing device. Returns true on success. In this case, a
diff --git a/webkit/glue/plugins/pepper_directory_reader.cc b/webkit/glue/plugins/pepper_directory_reader.cc
index 429fb24..f575e2c 100644
--- a/webkit/glue/plugins/pepper_directory_reader.cc
+++ b/webkit/glue/plugins/pepper_directory_reader.cc
@@ -35,7 +35,7 @@ int32_t GetNextEntry(PP_Resource reader_id,
scoped_refptr<DirectoryReader> reader(
Resource::GetAs<DirectoryReader>(reader_id));
if (!reader.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return reader->GetNextEntry(entry, callback);
}
@@ -63,7 +63,7 @@ const PPB_DirectoryReader* DirectoryReader::GetInterface() {
int32_t DirectoryReader::GetNextEntry(PP_DirectoryEntry* entry,
PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
} // namespace pepper
diff --git a/webkit/glue/plugins/pepper_event_conversion.cc b/webkit/glue/plugins/pepper_event_conversion.cc
index 8ffa5e0..033ac93 100644
--- a/webkit/glue/plugins/pepper_event_conversion.cc
+++ b/webkit/glue/plugins/pepper_event_conversion.cc
@@ -20,28 +20,28 @@ namespace {
PP_Event_Type ConvertEventTypes(WebInputEvent::Type wetype) {
switch (wetype) {
case WebInputEvent::MouseDown:
- return PP_Event_Type_MouseDown;
+ return PP_EVENT_TYPE_MOUSEDOWN;
case WebInputEvent::MouseUp:
- return PP_Event_Type_MouseUp;
+ return PP_EVENT_TYPE_MOUSEUP;
case WebInputEvent::MouseMove:
- return PP_Event_Type_MouseMove;
+ return PP_EVENT_TYPE_MOUSEMOVE;
case WebInputEvent::MouseEnter:
- return PP_Event_Type_MouseEnter;
+ return PP_EVENT_TYPE_MOUSEENTER;
case WebInputEvent::MouseLeave:
- return PP_Event_Type_MouseLeave;
+ return PP_EVENT_TYPE_MOUSELEAVE;
case WebInputEvent::MouseWheel:
- return PP_Event_Type_MouseWheel;
+ return PP_EVENT_TYPE_MOUSEWHEEL;
case WebInputEvent::RawKeyDown:
- return PP_Event_Type_RawKeyDown;
+ return PP_EVENT_TYPE_RAWKEYDOWN;
case WebInputEvent::KeyDown:
- return PP_Event_Type_KeyDown;
+ return PP_EVENT_TYPE_KEYDOWN;
case WebInputEvent::KeyUp:
- return PP_Event_Type_KeyUp;
+ return PP_EVENT_TYPE_KEYUP;
case WebInputEvent::Char:
- return PP_Event_Type_Char;
+ return PP_EVENT_TYPE_CHAR;
case WebInputEvent::Undefined:
default:
- return PP_Event_Type_Undefined;
+ return PP_EVENT_TYPE_UNDEFINED;
}
}
@@ -91,13 +91,13 @@ void BuildMouseWheelEvent(const WebInputEvent* event, PP_Event* pp_event) {
WebKeyboardEvent* BuildKeyEvent(const PP_Event& event) {
WebKeyboardEvent* key_event = new WebKeyboardEvent();
switch (event.type) {
- case PP_Event_Type_RawKeyDown:
+ case PP_EVENT_TYPE_RAWKEYDOWN:
key_event->type = WebInputEvent::RawKeyDown;
break;
- case PP_Event_Type_KeyDown:
+ case PP_EVENT_TYPE_KEYDOWN:
key_event->type = WebInputEvent::KeyDown;
break;
- case PP_Event_Type_KeyUp:
+ case PP_EVENT_TYPE_KEYUP:
key_event->type = WebInputEvent::KeyUp;
break;
}
@@ -126,19 +126,19 @@ WebKeyboardEvent* BuildCharEvent(const PP_Event& event) {
WebMouseEvent* BuildMouseEvent(const PP_Event& event) {
WebMouseEvent* mouse_event = new WebMouseEvent();
switch (event.type) {
- case PP_Event_Type_MouseDown:
+ case PP_EVENT_TYPE_MOUSEDOWN:
mouse_event->type = WebInputEvent::MouseDown;
break;
- case PP_Event_Type_MouseUp:
+ case PP_EVENT_TYPE_MOUSEUP:
mouse_event->type = WebInputEvent::MouseUp;
break;
- case PP_Event_Type_MouseMove:
+ case PP_EVENT_TYPE_MOUSEMOVE:
mouse_event->type = WebInputEvent::MouseMove;
break;
- case PP_Event_Type_MouseEnter:
+ case PP_EVENT_TYPE_MOUSEENTER:
mouse_event->type = WebInputEvent::MouseEnter;
break;
- case PP_Event_Type_MouseLeave:
+ case PP_EVENT_TYPE_MOUSELEAVE:
mouse_event->type = WebInputEvent::MouseLeave;
break;
}
@@ -176,24 +176,24 @@ PP_Event* CreatePP_Event(const WebInputEvent& event) {
pp_event->size = sizeof(pp_event);
pp_event->time_stamp_seconds = event.timeStampSeconds;
switch (pp_event->type) {
- case PP_Event_Type_Undefined:
+ case PP_EVENT_TYPE_UNDEFINED:
return NULL;
- case PP_Event_Type_MouseDown:
- case PP_Event_Type_MouseUp:
- case PP_Event_Type_MouseMove:
- case PP_Event_Type_MouseEnter:
- case PP_Event_Type_MouseLeave:
+ case PP_EVENT_TYPE_MOUSEDOWN:
+ case PP_EVENT_TYPE_MOUSEUP:
+ case PP_EVENT_TYPE_MOUSEMOVE:
+ case PP_EVENT_TYPE_MOUSEENTER:
+ case PP_EVENT_TYPE_MOUSELEAVE:
BuildMouseEvent(&event, pp_event.get());
break;
- case PP_Event_Type_MouseWheel:
+ case PP_EVENT_TYPE_MOUSEWHEEL:
BuildMouseWheelEvent(&event, pp_event.get());
break;
- case PP_Event_Type_RawKeyDown:
- case PP_Event_Type_KeyDown:
- case PP_Event_Type_KeyUp:
+ case PP_EVENT_TYPE_RAWKEYDOWN:
+ case PP_EVENT_TYPE_KEYDOWN:
+ case PP_EVENT_TYPE_KEYUP:
BuildKeyEvent(&event, pp_event.get());
break;
- case PP_Event_Type_Char:
+ case PP_EVENT_TYPE_CHAR:
BuildCharEvent(&event, pp_event.get());
break;
}
@@ -204,27 +204,27 @@ PP_Event* CreatePP_Event(const WebInputEvent& event) {
WebInputEvent* CreateWebInputEvent(const PP_Event& event) {
scoped_ptr<WebInputEvent> web_input_event;
switch (event.type) {
- case PP_Event_Type_Undefined:
+ case PP_EVENT_TYPE_UNDEFINED:
return NULL;
- case PP_Event_Type_MouseDown:
- case PP_Event_Type_MouseUp:
- case PP_Event_Type_MouseMove:
- case PP_Event_Type_MouseEnter:
- case PP_Event_Type_MouseLeave:
+ case PP_EVENT_TYPE_MOUSEDOWN:
+ case PP_EVENT_TYPE_MOUSEUP:
+ case PP_EVENT_TYPE_MOUSEMOVE:
+ case PP_EVENT_TYPE_MOUSEENTER:
+ case PP_EVENT_TYPE_MOUSELEAVE:
web_input_event.reset(BuildMouseEvent(event));
break;
- case PP_Event_Type_MouseWheel:
+ case PP_EVENT_TYPE_MOUSEWHEEL:
web_input_event.reset(BuildMouseWheelEvent(event));
break;
- case PP_Event_Type_RawKeyDown:
- case PP_Event_Type_KeyDown:
- case PP_Event_Type_KeyUp:
+ case PP_EVENT_TYPE_RAWKEYDOWN:
+ case PP_EVENT_TYPE_KEYDOWN:
+ case PP_EVENT_TYPE_KEYUP:
web_input_event.reset(BuildKeyEvent(event));
break;
- case PP_Event_Type_Char:
+ case PP_EVENT_TYPE_CHAR:
web_input_event.reset(BuildCharEvent(event));
break;
- case PP_Event_Type_Focus:
+ case PP_EVENT_TYPE_FOCUS:
// NOTIMPLEMENTED();
return NULL;
}
diff --git a/webkit/glue/plugins/pepper_file_chooser.cc b/webkit/glue/plugins/pepper_file_chooser.cc
index a2e96b2..6c4c72a 100644
--- a/webkit/glue/plugins/pepper_file_chooser.cc
+++ b/webkit/glue/plugins/pepper_file_chooser.cc
@@ -34,7 +34,7 @@ int32_t Show(PP_Resource chooser_id, PP_CompletionCallback callback) {
scoped_refptr<FileChooser> chooser(
Resource::GetAs<FileChooser>(chooser_id).get());
if (!chooser.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return chooser->Show(callback);
}
@@ -79,7 +79,7 @@ const PPB_FileChooser* FileChooser::GetInterface() {
int32_t FileChooser::Show(PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
scoped_refptr<FileRef> FileChooser::GetNextChosenFile() {
diff --git a/webkit/glue/plugins/pepper_file_io.cc b/webkit/glue/plugins/pepper_file_io.cc
index 926a6db..7100c1f 100644
--- a/webkit/glue/plugins/pepper_file_io.cc
+++ b/webkit/glue/plugins/pepper_file_io.cc
@@ -37,11 +37,11 @@ int32_t Open(PP_Resource file_io_id,
PP_CompletionCallback callback) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id));
if (!file_ref.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->Open(file_ref, open_flags, callback);
}
@@ -51,7 +51,7 @@ int32_t Query(PP_Resource file_io_id,
PP_CompletionCallback callback) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->Query(info, callback);
}
@@ -62,7 +62,7 @@ int32_t Touch(PP_Resource file_io_id,
PP_CompletionCallback callback) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->Touch(last_access_time, last_modified_time, callback);
}
@@ -74,7 +74,7 @@ int32_t Read(PP_Resource file_io_id,
PP_CompletionCallback callback) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->Read(offset, buffer, bytes_to_read, callback);
}
@@ -86,7 +86,7 @@ int32_t Write(PP_Resource file_io_id,
PP_CompletionCallback callback) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->Write(offset, buffer, bytes_to_write, callback);
}
@@ -96,7 +96,7 @@ int32_t SetLength(PP_Resource file_io_id,
PP_CompletionCallback callback) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->SetLength(length, callback);
}
@@ -105,7 +105,7 @@ int32_t Flush(PP_Resource file_io_id,
PP_CompletionCallback callback) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->Flush(callback);
}
@@ -134,7 +134,7 @@ const PPB_FileIO ppb_fileio = {
int32_t GetOSFileDescriptor(PP_Resource file_io_id) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->GetOSFileDescriptor();
}
@@ -145,7 +145,7 @@ int32_t WillWrite(PP_Resource file_io_id,
PP_CompletionCallback callback) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->WillWrite(offset, bytes_to_write, callback);
}
@@ -155,7 +155,7 @@ int32_t WillSetLength(PP_Resource file_io_id,
PP_CompletionCallback callback) {
scoped_refptr<FileIO> file_io(Resource::GetAs<FileIO>(file_io_id));
if (!file_io.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return file_io->WillSetLength(length, callback);
}
@@ -188,20 +188,20 @@ int32_t FileIO::Open(FileRef* file_ref,
int32_t open_flags,
PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
int32_t FileIO::Query(PP_FileInfo* info,
PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
int32_t FileIO::Touch(PP_Time last_access_time,
PP_Time last_modified_time,
PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
int32_t FileIO::Read(int64_t offset,
@@ -209,7 +209,7 @@ int32_t FileIO::Read(int64_t offset,
int32_t bytes_to_read,
PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
int32_t FileIO::Write(int64_t offset,
@@ -217,18 +217,18 @@ int32_t FileIO::Write(int64_t offset,
int32_t bytes_to_write,
PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
int32_t FileIO::SetLength(int64_t length,
PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
int32_t FileIO::Flush(PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
void FileIO::Close() {
@@ -237,20 +237,20 @@ void FileIO::Close() {
int32_t FileIO::GetOSFileDescriptor() {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
int32_t FileIO::WillWrite(int64_t offset,
int32_t bytes_to_write,
PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
int32_t FileIO::WillSetLength(int64_t length,
PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
} // namespace pepper
diff --git a/webkit/glue/plugins/pepper_file_ref.cc b/webkit/glue/plugins/pepper_file_ref.cc
index 45ec567..8ea8c4f 100644
--- a/webkit/glue/plugins/pepper_file_ref.cc
+++ b/webkit/glue/plugins/pepper_file_ref.cc
@@ -55,11 +55,11 @@ PP_Resource CreateFileRef(PP_Instance instance_id,
}
PP_Resource CreatePersistentFileRef(PP_Instance instance_id, const char* path) {
- return CreateFileRef(instance_id, PP_FileSystemType_LocalPersistent, path);
+ return CreateFileRef(instance_id, PP_FILESYSTEMTYPE_LOCALPERSISTENT, path);
}
PP_Resource CreateTemporaryFileRef(PP_Instance instance_id, const char* path) {
- return CreateFileRef(instance_id, PP_FileSystemType_LocalTemporary, path);
+ return CreateFileRef(instance_id, PP_FILESYSTEMTYPE_LOCALTEMPORARY, path);
}
bool IsFileRef(PP_Resource resource) {
@@ -69,7 +69,7 @@ bool IsFileRef(PP_Resource resource) {
PP_FileSystemType GetFileSystemType(PP_Resource file_ref_id) {
scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id));
if (!file_ref.get())
- return PP_FileSystemType_External;
+ return PP_FILESYSTEMTYPE_EXTERNAL;
return file_ref->file_system_type();
}
@@ -87,7 +87,7 @@ PP_Var GetPath(PP_Resource file_ref_id) {
if (!file_ref.get())
return PP_MakeVoid();
- if (file_ref->file_system_type() == PP_FileSystemType_External)
+ if (file_ref->file_system_type() == PP_FILESYSTEMTYPE_EXTERNAL)
return PP_MakeVoid();
return StringToPPVar(file_ref->path());
@@ -98,7 +98,7 @@ PP_Resource GetParent(PP_Resource file_ref_id) {
if (!file_ref.get())
return 0;
- if (file_ref->file_system_type() == PP_FileSystemType_External)
+ if (file_ref->file_system_type() == PP_FILESYSTEMTYPE_EXTERNAL)
return 0;
scoped_refptr<FileRef> parent_ref(file_ref->GetParent());
diff --git a/webkit/glue/plugins/pepper_file_system.cc b/webkit/glue/plugins/pepper_file_system.cc
index f9dcc0f..678399e 100644
--- a/webkit/glue/plugins/pepper_file_system.cc
+++ b/webkit/glue/plugins/pepper_file_system.cc
@@ -15,31 +15,31 @@ namespace {
int32_t MakeDirectory(PP_Resource directory_ref,
bool make_ancestors,
PP_CompletionCallback callback) {
- return PP_Error_Failed; // TODO(darin): Implement me!
+ return PP_ERROR_FAILED; // TODO(darin): Implement me!
}
int32_t Query(PP_Resource file_ref,
PP_FileInfo* info,
PP_CompletionCallback callback) {
- return PP_Error_Failed; // TODO(darin): Implement me!
+ return PP_ERROR_FAILED; // TODO(darin): Implement me!
}
int32_t Touch(PP_Resource file_ref,
PP_Time last_access_time,
PP_Time last_modified_time,
PP_CompletionCallback callback) {
- return PP_Error_Failed; // TODO(darin): Implement me!
+ return PP_ERROR_FAILED; // TODO(darin): Implement me!
}
int32_t Delete(PP_Resource file_ref,
PP_CompletionCallback callback) {
- return PP_Error_Failed; // TODO(darin): Implement me!
+ return PP_ERROR_FAILED; // TODO(darin): Implement me!
}
int32_t Rename(PP_Resource file_ref,
PP_Resource new_file_ref,
PP_CompletionCallback callback) {
- return PP_Error_Failed; // TODO(darin): Implement me!
+ return PP_ERROR_FAILED; // TODO(darin): Implement me!
}
const PPB_FileSystem ppb_filesystem = {
diff --git a/webkit/glue/plugins/pepper_image_data.cc b/webkit/glue/plugins/pepper_image_data.cc
index 56cf877e..51245b4 100644
--- a/webkit/glue/plugins/pepper_image_data.cc
+++ b/webkit/glue/plugins/pepper_image_data.cc
@@ -27,14 +27,14 @@ PP_ImageDataFormat GetNativeImageDataFormat() {
PP_Resource Create(PP_Module module_id,
PP_ImageDataFormat format,
- int32_t width, int32_t height,
+ const PP_Size* size,
bool init_to_zero) {
PluginModule* module = PluginModule::FromPPModule(module_id);
if (!module)
return NULL;
scoped_refptr<ImageData> data(new ImageData(module));
- if (!data->Init(format, width, height, init_to_zero))
+ if (!data->Init(format, size->width, size->height, init_to_zero))
return NULL;
data->AddRef(); // AddRef for the caller.
@@ -45,8 +45,7 @@ bool IsImageData(PP_Resource resource) {
return !!Resource::GetAs<ImageData>(resource).get();
}
-bool Describe(PP_Resource resource,
- PP_ImageDataDesc* desc) {
+bool Describe(PP_Resource resource, PP_ImageDataDesc* desc) {
// Give predictable values on failure.
memset(desc, 0, sizeof(PP_ImageDataDesc));
@@ -118,8 +117,8 @@ bool ImageData::Init(PP_ImageDataFormat format,
void ImageData::Describe(PP_ImageDataDesc* desc) const {
desc->format = PP_IMAGEDATAFORMAT_BGRA_PREMUL;
- desc->width = width_;
- desc->height = height_;
+ desc->size.width = width_;
+ desc->size.height = height_;
desc->stride = width_ * 4;
}
diff --git a/webkit/glue/plugins/pepper_plugin_module.cc b/webkit/glue/plugins/pepper_plugin_module.cc
index 3dc3e04..f4059e5 100644
--- a/webkit/glue/plugins/pepper_plugin_module.cc
+++ b/webkit/glue/plugins/pepper_plugin_module.cc
@@ -123,12 +123,12 @@ const PPB_Core core_interface = {
bool ReadImageData(PP_Resource device_context_2d,
PP_Resource image,
- int32_t x, int32_t y) {
+ const PP_Point* top_left) {
scoped_refptr<DeviceContext2D> context(
Resource::GetAs<DeviceContext2D>(device_context_2d));
if (!context.get())
return false;
- return context->ReadImageData(image, x, y);
+ return context->ReadImageData(image, top_left);
}
void RunMessageLoop() {
diff --git a/webkit/glue/plugins/pepper_url_loader.cc b/webkit/glue/plugins/pepper_url_loader.cc
index e026f74..aee2a86 100644
--- a/webkit/glue/plugins/pepper_url_loader.cc
+++ b/webkit/glue/plugins/pepper_url_loader.cc
@@ -55,12 +55,12 @@ int32_t Open(PP_Resource loader_id,
PP_CompletionCallback callback) {
scoped_refptr<URLLoader> loader(Resource::GetAs<URLLoader>(loader_id));
if (!loader.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
scoped_refptr<URLRequestInfo> request(
Resource::GetAs<URLRequestInfo>(request_id));
if (!request.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return loader->Open(request, callback);
}
@@ -69,7 +69,7 @@ int32_t FollowRedirect(PP_Resource loader_id,
PP_CompletionCallback callback) {
scoped_refptr<URLLoader> loader(Resource::GetAs<URLLoader>(loader_id));
if (!loader.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return loader->FollowRedirect(callback);
}
@@ -117,7 +117,7 @@ int32_t ReadResponseBody(PP_Resource loader_id,
PP_CompletionCallback callback) {
scoped_refptr<URLLoader> loader(Resource::GetAs<URLLoader>(loader_id));
if (!loader.get())
- return PP_Error_BadResource;
+ return PP_ERROR_BADRESOURCE;
return loader->ReadResponseBody(buffer, bytes_to_read, callback);
}
@@ -165,17 +165,17 @@ const PPB_URLLoader* URLLoader::GetInterface() {
int32_t URLLoader::Open(URLRequestInfo* request,
PP_CompletionCallback callback) {
if (loader_.get())
- return PP_Error_InProgress;
+ return PP_ERROR_INPROGRESS;
// We only support non-blocking calls.
if (!callback.func)
- return PP_Error_BadArgument;
+ return PP_ERROR_BADARGUMENT;
WebURLRequest web_request(request->web_request());
WebFrame* frame = instance_->container()->element().document().frame();
if (!frame)
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
web_request.setURL(
frame->document().completeURL(WebString::fromUTF8(request->url())));
frame->setReferrerForRequest(web_request, WebURL()); // Use default.
@@ -184,31 +184,31 @@ int32_t URLLoader::Open(URLRequestInfo* request,
loader_.reset(WebKit::webKitClient()->createURLLoader());
if (!loader_.get()) {
loader_.reset();
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
loader_->loadAsynchronously(web_request, this);
pending_callback_ = callback;
// Notify completion when we receive a redirect or response headers.
- return PP_Error_WouldBlock;
+ return PP_ERROR_WOULDBLOCK;
}
int32_t URLLoader::FollowRedirect(PP_CompletionCallback callback) {
NOTIMPLEMENTED(); // TODO(darin): Implement me.
- return PP_Error_Failed;
+ return PP_ERROR_FAILED;
}
int32_t URLLoader::ReadResponseBody(char* buffer, int32_t bytes_to_read,
PP_CompletionCallback callback) {
if (bytes_to_read <= 0 || !buffer)
- return PP_Error_BadArgument;
+ return PP_ERROR_BADARGUMENT;
if (pending_callback_.func)
- return PP_Error_InProgress;
+ return PP_ERROR_INPROGRESS;
// We only support non-blocking calls.
if (!callback.func)
- return PP_Error_BadArgument;
+ return PP_ERROR_BADARGUMENT;
user_buffer_ = buffer;
user_buffer_size_ = bytes_to_read;
@@ -217,7 +217,7 @@ int32_t URLLoader::ReadResponseBody(char* buffer, int32_t bytes_to_read,
return FillUserBuffer();
pending_callback_ = callback;
- return PP_Error_WouldBlock;
+ return PP_ERROR_WOULDBLOCK;
}
void URLLoader::Close() {
@@ -261,7 +261,7 @@ void URLLoader::didFinishLoading(WebURLLoader* loader) {
void URLLoader::didFail(WebURLLoader* loader, const WebURLError& error) {
// TODO(darin): Provide more detailed error information.
- RunCallback(PP_Error_Failed);
+ RunCallback(PP_ERROR_FAILED);
}
void URLLoader::RunCallback(int32_t result) {
diff --git a/webkit/glue/plugins/pepper_url_request_info.cc b/webkit/glue/plugins/pepper_url_request_info.cc
index 60f7b57..7813136 100644
--- a/webkit/glue/plugins/pepper_url_request_info.cc
+++ b/webkit/glue/plugins/pepper_url_request_info.cc
@@ -42,10 +42,10 @@ bool SetProperty(PP_Resource request_id,
if (!request.get())
return false;
- if (var.type == PP_VarType_Bool)
+ if (var.type == PP_VARTYPE_BOOL)
return request->SetBooleanProperty(property, var.value.as_bool);
- if (var.type == PP_VarType_String)
+ if (var.type == PP_VARTYPE_STRING)
return request->SetStringProperty(property, GetString(var)->value());
return false;
@@ -117,15 +117,15 @@ bool URLRequestInfo::SetStringProperty(PP_URLRequestProperty property,
const std::string& value) {
// TODO(darin): Validate input. Perhaps at a different layer?
switch (property) {
- case PP_URLRequestProperty_URL:
+ case PP_URLREQUESTPROPERTY_URL:
// Keep the url in a string instead of a URL object because it might not
// be complete yet.
url_ = value;
return true;
- case PP_URLRequestProperty_Method:
+ case PP_URLREQUESTPROPERTY_METHOD:
web_request_.setHTTPMethod(WebString::fromUTF8(value));
return true;
- case PP_URLRequestProperty_Headers:
+ case PP_URLREQUESTPROPERTY_HEADERS:
// TODO(darin): Support extra request headers
NOTIMPLEMENTED();
return false;
diff --git a/webkit/glue/plugins/pepper_var.cc b/webkit/glue/plugins/pepper_var.cc
index 4360b9b..414df7b 100644
--- a/webkit/glue/plugins/pepper_var.cc
+++ b/webkit/glue/plugins/pepper_var.cc
@@ -37,7 +37,7 @@ class TryCatch {
}
bool HasException() const {
- return exception_ && exception_->type != PP_VarType_Void;
+ return exception_ && exception_->type != PP_VARTYPE_VOID;
}
void SetException(const char* message) {
@@ -106,27 +106,27 @@ PP_Var NPVariantToPPVar(const NPVariant* variant) {
NPVariant PPVarToNPVariant(PP_Var var) {
NPVariant ret;
switch (var.type) {
- case PP_VarType_Void:
+ case PP_VARTYPE_VOID:
VOID_TO_NPVARIANT(ret);
break;
- case PP_VarType_Null:
+ case PP_VARTYPE_NULL:
NULL_TO_NPVARIANT(ret);
break;
- case PP_VarType_Bool:
+ case PP_VARTYPE_BOOL:
BOOLEAN_TO_NPVARIANT(var.value.as_bool, ret);
break;
- case PP_VarType_Int32:
+ case PP_VARTYPE_INT32:
INT32_TO_NPVARIANT(var.value.as_int, ret);
break;
- case PP_VarType_Double:
+ case PP_VARTYPE_DOUBLE:
DOUBLE_TO_NPVARIANT(var.value.as_double, ret);
break;
- case PP_VarType_String: {
+ case PP_VARTYPE_STRING: {
const std::string& value = GetStringUnchecked(var)->value();
STRINGN_TO_NPVARIANT(base::strdup(value.c_str()), value.size(), ret);
break;
}
- case PP_VarType_Object: {
+ case PP_VARTYPE_OBJECT: {
NPObject* object = GetNPObjectUnchecked(var);
OBJECT_TO_NPVARIANT(WebBindings::retainObject(object), ret);
break;
@@ -141,27 +141,27 @@ NPVariant PPVarToNPVariant(PP_Var var) {
NPVariant PPVarToNPVariantNoCopy(PP_Var var) {
NPVariant ret;
switch (var.type) {
- case PP_VarType_Void:
+ case PP_VARTYPE_VOID:
VOID_TO_NPVARIANT(ret);
break;
- case PP_VarType_Null:
+ case PP_VARTYPE_NULL:
NULL_TO_NPVARIANT(ret);
break;
- case PP_VarType_Bool:
+ case PP_VARTYPE_BOOL:
BOOLEAN_TO_NPVARIANT(var.value.as_bool, ret);
break;
- case PP_VarType_Int32:
+ case PP_VARTYPE_INT32:
INT32_TO_NPVARIANT(var.value.as_int, ret);
break;
- case PP_VarType_Double:
+ case PP_VARTYPE_DOUBLE:
DOUBLE_TO_NPVARIANT(var.value.as_double, ret);
break;
- case PP_VarType_String: {
+ case PP_VARTYPE_STRING: {
const std::string& value = GetStringUnchecked(var)->value();
STRINGN_TO_NPVARIANT(value.c_str(), value.size(), ret);
break;
}
- case PP_VarType_Object: {
+ case PP_VARTYPE_OBJECT: {
OBJECT_TO_NPVARIANT(GetNPObjectUnchecked(var), ret);
break;
}
@@ -174,10 +174,10 @@ NPVariant PPVarToNPVariantNoCopy(PP_Var var) {
// string or integer type.
NPIdentifier PPVarToNPIdentifier(PP_Var var) {
switch (var.type) {
- case PP_VarType_String:
+ case PP_VARTYPE_STRING:
return WebBindings::getStringIdentifier(
GetStringUnchecked(var)->value().c_str());
- case PP_VarType_Int32:
+ case PP_VARTYPE_INT32:
return WebBindings::getIntIdentifier(var.value.as_int);
default:
return NULL;
@@ -197,9 +197,9 @@ PP_Var NPIdentifierToPPVar(NPIdentifier id) {
PP_Var NPIdentifierToPPVarString(NPIdentifier id) {
PP_Var var = NPIdentifierToPPVar(id);
- if (var.type == PP_VarType_String)
+ if (var.type == PP_VARTYPE_STRING)
return var;
- DCHECK(var.type == PP_VarType_Int32);
+ DCHECK(var.type == PP_VARTYPE_INT32);
const std::string& str = IntToString(var.value.as_int);
return VarFromUtf8(str.data(), str.size());
}
@@ -246,7 +246,7 @@ bool WrapperClass_HasMethod(NPObject* object, NPIdentifier method_name) {
&exception);
Release(method_name_var);
- if (exception.type != PP_VarType_Void) {
+ if (exception.type != PP_VARTYPE_VOID) {
ThrowException(object, exception);
Release(exception);
return false;
@@ -275,7 +275,7 @@ bool WrapperClass_Invoke(NPObject* object, NPIdentifier method_name,
Release(args[i]);
bool rv;
- if (exception.type == PP_VarType_Void) {
+ if (exception.type == PP_VARTYPE_VOID) {
rv = true;
*result = PPVarToNPVariant(result_var);
} else {
@@ -305,7 +305,7 @@ bool WrapperClass_InvokeDefault(NPObject* object, const NPVariant* argv,
Release(args[i]);
bool rv;
- if (exception.type == PP_VarType_Void) {
+ if (exception.type == PP_VARTYPE_VOID) {
rv = true;
*result = PPVarToNPVariant(result_var);
} else {
@@ -327,7 +327,7 @@ bool WrapperClass_HasProperty(NPObject* object, NPIdentifier property_name) {
&exception);
Release(property_name_var);
- if (exception.type != PP_VarType_Void) {
+ if (exception.type != PP_VARTYPE_VOID) {
ThrowException(object, exception);
Release(exception);
return false;
@@ -347,7 +347,7 @@ bool WrapperClass_GetProperty(NPObject* object, NPIdentifier property_name,
Release(property_name_var);
bool rv;
- if (exception.type == PP_VarType_Void) {
+ if (exception.type == PP_VARTYPE_VOID) {
rv = true;
*result = PPVarToNPVariant(result_var);
} else {
@@ -371,7 +371,7 @@ bool WrapperClass_SetProperty(NPObject* object, NPIdentifier property_name,
Release(value_var);
Release(property_name_var);
- if (exception.type != PP_VarType_Void) {
+ if (exception.type != PP_VARTYPE_VOID) {
ThrowException(object, exception);
Release(exception);
return false;
@@ -388,7 +388,7 @@ bool WrapperClass_RemoveProperty(NPObject* object, NPIdentifier property_name) {
&exception);
Release(property_name_var);
- if (exception.type != PP_VarType_Void) {
+ if (exception.type != PP_VARTYPE_VOID) {
ThrowException(object, exception);
Release(exception);
return false;
@@ -409,7 +409,7 @@ bool WrapperClass_Enumerate(NPObject* object, NPIdentifier** values,
&exception);
bool rv;
- if (exception.type == PP_VarType_Void) {
+ if (exception.type == PP_VARTYPE_VOID) {
rv = true;
if (property_count == 0) {
*values = NULL;
@@ -452,7 +452,7 @@ bool WrapperClass_Construct(NPObject* object, const NPVariant* argv,
Release(args[i]);
bool rv;
- if (exception.type == PP_VarType_Void) {
+ if (exception.type == PP_VARTYPE_VOID) {
rv = true;
*result = PPVarToNPVariant(result_var);
} else {
@@ -484,18 +484,18 @@ const NPClass wrapper_class = {
// PPB_Var methods
void AddRef(PP_Var var) {
- if (var.type == PP_VarType_String) {
+ if (var.type == PP_VARTYPE_STRING) {
GetStringUnchecked(var)->AddRef();
- } else if (var.type == PP_VarType_Object) {
+ } else if (var.type == PP_VARTYPE_OBJECT) {
// TODO(darin): Add thread safety check
WebBindings::retainObject(GetNPObjectUnchecked(var));
}
}
void Release(PP_Var var) {
- if (var.type == PP_VarType_String) {
+ if (var.type == PP_VARTYPE_STRING) {
GetStringUnchecked(var)->Release();
- } else if (var.type == PP_VarType_Object) {
+ } else if (var.type == PP_VARTYPE_OBJECT) {
// TODO(darin): Add thread safety check
WebBindings::releaseObject(GetNPObjectUnchecked(var));
}
@@ -505,13 +505,13 @@ PP_Var VarFromUtf8(const char* data, uint32_t len) {
String* str = new String(data, len);
str->AddRef(); // This is for the caller, we return w/ a refcount of 1.
PP_Var ret;
- ret.type = PP_VarType_String;
+ ret.type = PP_VARTYPE_STRING;
ret.value.as_id = reinterpret_cast<intptr_t>(str);
return ret;
}
const char* VarToUtf8(PP_Var var, uint32_t* len) {
- if (var.type != PP_VarType_String) {
+ if (var.type != PP_VARTYPE_STRING) {
*len = 0;
return NULL;
}
@@ -701,9 +701,9 @@ PP_Var Call(PP_Var var,
}
NPIdentifier identifier;
- if (method_name.type == PP_VarType_Void) {
+ if (method_name.type == PP_VARTYPE_VOID) {
identifier = NULL;
- } else if (method_name.type == PP_VarType_String) {
+ } else if (method_name.type == PP_VARTYPE_STRING) {
// Specifically allow only string functions to be called.
identifier = PPVarToNPIdentifier(method_name);
if (!identifier) {
@@ -831,14 +831,14 @@ const PPB_Var* GetVarInterface() {
PP_Var NPObjectToPPVar(NPObject* object) {
PP_Var ret;
- ret.type = PP_VarType_Object;
+ ret.type = PP_VARTYPE_OBJECT;
ret.value.as_id = reinterpret_cast<intptr_t>(object);
WebBindings::retainObject(object);
return ret;
}
NPObject* GetNPObject(PP_Var var) {
- if (var.type != PP_VarType_Object)
+ if (var.type != PP_VARTYPE_OBJECT)
return NULL;
return GetNPObjectUnchecked(var);
}
@@ -849,7 +849,7 @@ PP_Var StringToPPVar(const std::string& str) {
}
String* GetString(PP_Var var) {
- if (var.type != PP_VarType_String)
+ if (var.type != PP_VARTYPE_STRING)
return NULL;
return GetStringUnchecked(var);
}