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

Side by Side Diff: webkit/plugins/ppapi/npobject_var.cc

Issue 8826011: Remove PP_Module from parameters for PPB_Var.VarFromUtf8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/npobject_var.h ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/ppapi/npobject_var.h" 5 #include "webkit/plugins/ppapi/npobject_var.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/c/pp_var.h" 8 #include "ppapi/c/pp_var.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
10 #include "webkit/plugins/ppapi/host_globals.h" 10 #include "webkit/plugins/ppapi/host_globals.h"
11 #include "webkit/plugins/ppapi/host_var_tracker.h" 11 #include "webkit/plugins/ppapi/host_var_tracker.h"
12 12
13 using webkit::ppapi::HostGlobals; 13 using webkit::ppapi::HostGlobals;
14 using WebKit::WebBindings; 14 using WebKit::WebBindings;
15 15
16 namespace ppapi { 16 namespace ppapi {
17 17
18 // NPObjectVar ----------------------------------------------------------------- 18 // NPObjectVar -----------------------------------------------------------------
19 19
20 NPObjectVar::NPObjectVar(PP_Module module, 20 NPObjectVar::NPObjectVar(PP_Instance instance,
21 PP_Instance instance,
22 NPObject* np_object) 21 NPObject* np_object)
23 : Var(module), 22 : pp_instance_(instance),
24 pp_instance_(instance),
25 np_object_(np_object) { 23 np_object_(np_object) {
26 WebBindings::retainObject(np_object_); 24 WebBindings::retainObject(np_object_);
27 HostGlobals::Get()->host_var_tracker()->AddNPObjectVar(this); 25 HostGlobals::Get()->host_var_tracker()->AddNPObjectVar(this);
28 } 26 }
29 27
30 NPObjectVar::~NPObjectVar() { 28 NPObjectVar::~NPObjectVar() {
31 if (pp_instance()) 29 if (pp_instance())
32 HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this); 30 HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this);
33 WebBindings::releaseObject(np_object_); 31 WebBindings::releaseObject(np_object_);
34 } 32 }
(...skipping 27 matching lines...) Expand all
62 if (var.type != PP_VARTYPE_OBJECT) 60 if (var.type != PP_VARTYPE_OBJECT)
63 return scoped_refptr<NPObjectVar>(NULL); 61 return scoped_refptr<NPObjectVar>(NULL);
64 scoped_refptr<Var> var_object( 62 scoped_refptr<Var> var_object(
65 PpapiGlobals::Get()->GetVarTracker()->GetVar(var)); 63 PpapiGlobals::Get()->GetVarTracker()->GetVar(var));
66 if (!var_object) 64 if (!var_object)
67 return scoped_refptr<NPObjectVar>(); 65 return scoped_refptr<NPObjectVar>();
68 return scoped_refptr<NPObjectVar>(var_object->AsNPObjectVar()); 66 return scoped_refptr<NPObjectVar>(var_object->AsNPObjectVar());
69 } 67 }
70 68
71 } // namespace ppapi 69 } // namespace ppapi
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/npobject_var.h ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698