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

Side by Side Diff: webkit/glue/plugins/pepper_var.h

Issue 5741001: Even more virtual method deinlining. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase (windows) Created 10 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/glue/plugins/pepper_transport.cc ('k') | webkit/glue/plugins/pepper_var.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_ 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_ 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "webkit/glue/plugins/pepper_resource.h" 10 #include "webkit/glue/plugins/pepper_resource.h"
(...skipping 10 matching lines...) Expand all
21 // Var ------------------------------------------------------------------------- 21 // Var -------------------------------------------------------------------------
22 22
23 // Represents a non-POD var. This is derived from a resource even though it 23 // Represents a non-POD var. This is derived from a resource even though it
24 // isn't a resource from the plugin's perspective. This allows us to re-use 24 // isn't a resource from the plugin's perspective. This allows us to re-use
25 // the refcounting and the association with the module from the resource code. 25 // the refcounting and the association with the module from the resource code.
26 class Var : public Resource { 26 class Var : public Resource {
27 public: 27 public:
28 virtual ~Var(); 28 virtual ~Var();
29 29
30 // Resource overrides. 30 // Resource overrides.
31 virtual Var* AsVar() { return this; } 31 virtual Var* AsVar();
32 32
33 // Returns a PP_Var that corresponds to the given NPVariant. The contents of 33 // Returns a PP_Var that corresponds to the given NPVariant. The contents of
34 // the NPVariant will be copied unless the NPVariant corresponds to an 34 // the NPVariant will be copied unless the NPVariant corresponds to an
35 // object. This will handle all Variant types including POD, strings, and 35 // object. This will handle all Variant types including POD, strings, and
36 // objects. 36 // objects.
37 // 37 //
38 // The returned PP_Var will have a refcount of 1, this passing ownership of 38 // The returned PP_Var will have a refcount of 1, this passing ownership of
39 // the reference to the caller. This is suitable for returning to a plugin. 39 // the reference to the caller. This is suitable for returning to a plugin.
40 static PP_Var NPVariantToPPVar(PluginModule* module, 40 static PP_Var NPVariantToPPVar(PluginModule* module,
41 const NPVariant* variant); 41 const NPVariant* variant);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // return false; // Not a string or an invalid var. 107 // return false; // Not a string or an invalid var.
108 // DoSomethingWithTheString(string->value()); 108 // DoSomethingWithTheString(string->value());
109 class StringVar : public Var { 109 class StringVar : public Var {
110 public: 110 public:
111 StringVar(PluginModule* module, const char* str, uint32 len); 111 StringVar(PluginModule* module, const char* str, uint32 len);
112 virtual ~StringVar(); 112 virtual ~StringVar();
113 113
114 const std::string& value() const { return value_; } 114 const std::string& value() const { return value_; }
115 115
116 // Resource overrides. 116 // Resource overrides.
117 virtual StringVar* AsStringVar() { return this; } 117 virtual StringVar* AsStringVar();
118 118
119 // Helper function to create a PP_Var of type string that contains a copy of 119 // Helper function to create a PP_Var of type string that contains a copy of
120 // the given string. The input data must be valid UTF-8 encoded text, if it 120 // the given string. The input data must be valid UTF-8 encoded text, if it
121 // is not valid UTF-8, a NULL var will be returned. 121 // is not valid UTF-8, a NULL var will be returned.
122 // 122 //
123 // The return value will have a reference count of 1. Internally, this will 123 // The return value will have a reference count of 1. Internally, this will
124 // create a StringVar, associate it with a module, and return the reference 124 // create a StringVar, associate it with a module, and return the reference
125 // to it in the var. 125 // to it in the var.
126 static PP_Var StringToPPVar(PluginModule* module, const std::string& str); 126 static PP_Var StringToPPVar(PluginModule* module, const std::string& str);
127 static PP_Var StringToPPVar(PluginModule* module, 127 static PP_Var StringToPPVar(PluginModule* module,
(...skipping 19 matching lines...) Expand all
147 // given module and free them when the plugin exits independently of other 147 // given module and free them when the plugin exits independently of other
148 // plugins that may be running at the same time. 148 // plugins that may be running at the same time.
149 // 149 //
150 // See StringVar for examples, except obviously using NPObjects instead of 150 // See StringVar for examples, except obviously using NPObjects instead of
151 // strings. 151 // strings.
152 class ObjectVar : public Var { 152 class ObjectVar : public Var {
153 public: 153 public:
154 virtual ~ObjectVar(); 154 virtual ~ObjectVar();
155 155
156 // Resource overrides. 156 // Resource overrides.
157 virtual ObjectVar* AsObjectVar() { return this; } 157 virtual ObjectVar* AsObjectVar();
158 158
159 // Returns the underlying NPObject corresponding to this ObjectVar. 159 // Returns the underlying NPObject corresponding to this ObjectVar.
160 // Guaranteed non-NULL. 160 // Guaranteed non-NULL.
161 NPObject* np_object() const { return np_object_; } 161 NPObject* np_object() const { return np_object_; }
162 162
163 // Helper function to create a PP_Var of type object that contains the given 163 // Helper function to create a PP_Var of type object that contains the given
164 // NPObject for use byt he given module. Calling this function multiple times 164 // NPObject for use byt he given module. Calling this function multiple times
165 // given the same module + NPObject results in the same PP_Var, assuming that 165 // given the same module + NPObject results in the same PP_Var, assuming that
166 // there is still a PP_Var with a reference open to it from the previous 166 // there is still a PP_Var with a reference open to it from the previous
167 // call. 167 // call.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // the exception itself has been stored. 242 // the exception itself has been stored.
243 bool has_exception_; 243 bool has_exception_;
244 244
245 // May be null if the consumer isn't interesting in catching exceptions. 245 // May be null if the consumer isn't interesting in catching exceptions.
246 PP_Var* exception_; 246 PP_Var* exception_;
247 }; 247 };
248 248
249 } // namespace pepper 249 } // namespace pepper
250 250
251 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_ 251 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_transport.cc ('k') | webkit/glue/plugins/pepper_var.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698