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

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

Issue 730603002: PPAPI: Refactor renderer side of browser host creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 6 years, 1 month 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/renderer_ppapi_host_impl.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 d669e7464b4ad094dc4fb0eb3eea10bc0e92c990..563e301e5db296e23ee53bc877e50a1b18dbaa00 100644
--- a/content/renderer/pepper/resource_converter.h
+++ b/content/renderer/pepper/resource_converter.h
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
#include "content/renderer/pepper/host_resource_var.h"
#include "ppapi/c/pp_instance.h"
@@ -22,9 +23,15 @@ class Message;
}
namespace ppapi {
+
class ScopedPPVar;
+
+namespace proxy {
+struct CompletedBrowserResourceHosts;
}
+} // namespace ppapi
+
namespace content {
// This class is responsible for converting V8 vars to Pepper resources.
@@ -79,6 +86,16 @@ class ResourceConverterImpl : public ResourceConverter {
v8::Handle<v8::Value>* result) override;
private:
+ typedef std::vector<scoped_refptr<HostResourceVar>> HostResourceVarVector;
+
+ struct PendingConversion {
+ PendingConversion();
+ ~PendingConversion();
+ int sequence_number;
+ base::Callback<void(bool)> callback;
+ HostResourceVarVector browser_vars;
+ };
+
// Creates a resource var with the given |pending_renderer_id| and
// |create_message| to be sent to the plugin.
scoped_refptr<HostResourceVar> CreateResourceVar(
@@ -93,6 +110,8 @@ class ResourceConverterImpl : public ResourceConverter {
const IPC::Message& create_message,
const IPC::Message& browser_host_create_message);
+ void FlushComplete(const ppapi::proxy::CompletedBrowserResourceHosts& hosts);
+
// The instance this ResourceConverter is associated with.
PP_Instance instance_;
@@ -100,8 +119,11 @@ class ResourceConverterImpl : public ResourceConverter {
// array to |browser_vars|. It is kept as a parallel array so that it can be
// conveniently passed to |CreateBrowserResourceHosts|.
std::vector<IPC::Message> browser_host_create_messages_;
- // A list of the resource vars associated with browser hosts.
- std::vector<scoped_refptr<HostResourceVar> > browser_vars_;
+ HostResourceVarVector browser_vars_;
+
+ std::queue<PendingConversion> pending_conversions_;
+
+ base::WeakPtrFactory<ResourceConverterImpl> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ResourceConverterImpl);
};
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.cc ('k') | content/renderer/pepper/resource_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698