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

Unified Diff: webkit/plugins/ppapi/npobject_var.cc

Issue 20165002: Move webkit/plugins/ppapi to content/renderer/pepper. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: more more clang fun Created 7 years, 5 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
« no previous file with comments | « webkit/plugins/ppapi/npobject_var.h ('k') | webkit/plugins/ppapi/plugin_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/npobject_var.cc
===================================================================
--- webkit/plugins/ppapi/npobject_var.cc (revision 213561)
+++ webkit/plugins/ppapi/npobject_var.cc (working copy)
@@ -1,59 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "webkit/plugins/ppapi/npobject_var.h"
-
-#include "base/logging.h"
-#include "ppapi/c/pp_var.h"
-#include "third_party/WebKit/public/web/WebBindings.h"
-#include "webkit/plugins/ppapi/host_globals.h"
-#include "webkit/plugins/ppapi/host_var_tracker.h"
-
-using webkit::ppapi::HostGlobals;
-using WebKit::WebBindings;
-
-namespace ppapi {
-
-// NPObjectVar -----------------------------------------------------------------
-
-NPObjectVar::NPObjectVar(PP_Instance instance,
- NPObject* np_object)
- : pp_instance_(instance),
- np_object_(np_object) {
- WebBindings::retainObject(np_object_);
- HostGlobals::Get()->host_var_tracker()->AddNPObjectVar(this);
-}
-
-NPObjectVar::~NPObjectVar() {
- if (pp_instance())
- HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this);
- WebBindings::releaseObject(np_object_);
-}
-
-NPObjectVar* NPObjectVar::AsNPObjectVar() {
- return this;
-}
-
-PP_VarType NPObjectVar::GetType() const {
- return PP_VARTYPE_OBJECT;
-}
-
-void NPObjectVar::InstanceDeleted() {
- DCHECK(pp_instance_);
- HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this);
- pp_instance_ = 0;
-}
-
-// static
-scoped_refptr<NPObjectVar> NPObjectVar::FromPPVar(PP_Var var) {
- if (var.type != PP_VARTYPE_OBJECT)
- return scoped_refptr<NPObjectVar>(NULL);
- scoped_refptr<Var> var_object(
- PpapiGlobals::Get()->GetVarTracker()->GetVar(var));
- if (!var_object.get())
- return scoped_refptr<NPObjectVar>();
- return scoped_refptr<NPObjectVar>(var_object->AsNPObjectVar());
-}
-
-} // namespace ppapi
« no previous file with comments | « webkit/plugins/ppapi/npobject_var.h ('k') | webkit/plugins/ppapi/plugin_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698