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

Unified Diff: content/renderer/pepper/resource_converter.h

Issue 331593002: Change V8VarConverter::FromV8Value to complete synchronously if possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « content/renderer/pepper/message_channel.cc ('k') | content/renderer/pepper/resource_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/resource_converter.h
diff --git a/content/renderer/pepper/resource_converter.h b/content/renderer/pepper/resource_converter.h
index 5b46adf4c533b1866a7a4e07eca00a1d18845ca6..842f7c723245a2d2e3cb37c9f38eda0aa562ed9b 100644
--- a/content/renderer/pepper/resource_converter.h
+++ b/content/renderer/pepper/resource_converter.h
@@ -34,8 +34,16 @@ class CONTENT_EXPORT ResourceConverter {
public:
virtual ~ResourceConverter();
- // Flush() must be called before any vars created by the ResourceConverter
- // are valid. It handles creating any resource hosts that need to be created.
+ // Reset the state of the resource converter.
+ virtual void Reset() = 0;
+
+ // Returns true if Flush() needs to be called before using any vars created
+ // by the resource converter.
+ virtual bool NeedsFlush() = 0;
+
+ // If NeedsFlush() is true then Flush() must be called before any vars created
+ // by the ResourceConverter are valid. It handles creating any resource hosts
+ // that need to be created. |callback| will always be called asynchronously.
virtual void Flush(const base::Callback<void(bool)>& callback) = 0;
// Attempts to convert a V8 object to a PP_Var with type PP_VARTYPE_RESOURCE.
@@ -61,6 +69,8 @@ class ResourceConverterImpl : public ResourceConverter {
virtual ~ResourceConverterImpl();
// ResourceConverter overrides.
+ virtual void Reset() OVERRIDE;
+ virtual bool NeedsFlush() OVERRIDE;
virtual void Flush(const base::Callback<void(bool)>& callback) OVERRIDE;
virtual bool FromV8Value(v8::Handle<v8::Object> val,
v8::Handle<v8::Context> context,
« no previous file with comments | « content/renderer/pepper/message_channel.cc ('k') | content/renderer/pepper/resource_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698