Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: ppapi/cpp/dev/websocket_dev.cc

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/cpp/dev/websocket_dev.cc
diff --git a/ppapi/cpp/dev/websocket_dev.cc b/ppapi/cpp/dev/websocket_dev.cc
index 65578fdaecae65460db749b10f4da3d71157a232..d8cc7029420dc481591e0c4589d7cef088952721 100644
--- a/ppapi/cpp/dev/websocket_dev.cc
+++ b/ppapi/cpp/dev/websocket_dev.cc
@@ -7,7 +7,7 @@
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_macros.h"
#include "ppapi/cpp/completion_callback.h"
-#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
#include "ppapi/cpp/var.h"
@@ -22,11 +22,11 @@ template <> const char* interface_name<PPB_WebSocket_Dev>() {
} // namespace
-WebSocket_Dev::WebSocket_Dev(Instance* instance) {
+WebSocket_Dev::WebSocket_Dev(const InstanceHandle& instance) {
if (!has_interface<PPB_WebSocket_Dev>())
return;
PassRefFromConstructor(get_interface<PPB_WebSocket_Dev>()->Create(
- instance->pp_instance()));
+ instance.pp_instance()));
}
WebSocket_Dev::~WebSocket_Dev() {
@@ -101,8 +101,8 @@ Var WebSocket_Dev::GetCloseReason() {
if (!has_interface<PPB_WebSocket_Dev>())
return 0;
- return Var(Var::PassRef(),
- get_interface<PPB_WebSocket_Dev>()->GetCloseReason(pp_resource()));
+ return Var(PASS_REF,
+ get_interface<PPB_WebSocket_Dev>()->GetCloseReason(pp_resource()));
}
bool WebSocket_Dev::GetCloseWasClean() {
@@ -118,16 +118,16 @@ Var WebSocket_Dev::GetExtensions() {
if (!has_interface<PPB_WebSocket_Dev>())
return Var();
- return Var(Var::PassRef(),
- get_interface<PPB_WebSocket_Dev>()->GetExtensions(pp_resource()));
+ return Var(PASS_REF,
+ get_interface<PPB_WebSocket_Dev>()->GetExtensions(pp_resource()));
}
Var WebSocket_Dev::GetProtocol() {
if (!has_interface<PPB_WebSocket_Dev>())
return Var();
- return Var(Var::PassRef(),
- get_interface<PPB_WebSocket_Dev>()->GetProtocol(pp_resource()));
+ return Var(PASS_REF,
+ get_interface<PPB_WebSocket_Dev>()->GetProtocol(pp_resource()));
}
PP_WebSocketReadyState_Dev WebSocket_Dev::GetReadyState() {
@@ -141,8 +141,8 @@ Var WebSocket_Dev::GetURL() {
if (!has_interface<PPB_WebSocket_Dev>())
return Var();
- return Var(Var::PassRef(),
- get_interface<PPB_WebSocket_Dev>()->GetURL(pp_resource()));
+ return Var(PASS_REF,
+ get_interface<PPB_WebSocket_Dev>()->GetURL(pp_resource()));
}
} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698