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

Unified Diff: chrome/renderer/pepper/pepper_extensions_common_host.h

Issue 13080002: Apps V2 in Pepper: introduce singleton resource ExtensionsCommon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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
Index: chrome/renderer/pepper/pepper_extensions_common_host.h
diff --git a/chrome/renderer/pepper/pepper_extensions_common_host.h b/chrome/renderer/pepper/pepper_extensions_common_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..86f932a1a80e335f7e60a0ca9c5bedcc1f3514e4
--- /dev/null
+++ b/chrome/renderer/pepper/pepper_extensions_common_host.h
@@ -0,0 +1,71 @@
+// Copyright (c) 2013 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.
+
+#ifndef CHROME_RENDERER_PEPPER_PEPPER_EXTENSIONS_COMMON_HOST_H_
+#define CHROME_RENDERER_PEPPER_PEPPER_EXTENSIONS_COMMON_HOST_H_
+
+#include <map>
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/linked_ptr.h"
+#include "ppapi/host/resource_host.h"
+
+namespace base {
+class ListValue;
+}
+
+namespace content {
+class RendererPpapiHost;
+}
+
+namespace ppapi {
+namespace host {
+struct ReplyMessageContext;
+}
+}
+
+namespace chrome {
+
+class PepperExtensionsCommonHost : public ppapi::host::ResourceHost {
+ public:
+ virtual ~PepperExtensionsCommonHost();
+
+ static PepperExtensionsCommonHost* Create(content::RendererPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource);
+
+ // ppapi::host::ResourceMessageHandler overrides.
+ virtual int32_t OnResourceMessageReceived(
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) OVERRIDE;
+
+ private:
+ typedef std::map<int, linked_ptr<ppapi::host::ReplyMessageContext> >
+ PendingRequestMap;
+
+ PepperExtensionsCommonHost(content::RendererPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource);
+
+ int32_t OnPost(ppapi::host::HostMessageContext* context,
+ const std::string& request_name,
+ const base::ListValue& args);
+
+ int32_t OnCall(ppapi::host::HostMessageContext* context,
+ const std::string& request_name,
+ const base::ListValue& args);
+
+ // Non-owning pointer.
+ content::RendererPpapiHost* renderer_ppapi_host_;
+
+ PendingRequestMap pending_request_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperExtensionsCommonHost);
+};
+
+} // namespace chrome
+
+#endif // CHROME_RENDERER_PEPPER_PEPPER_EXTENSIONS_COMMON_HOST_H_
« no previous file with comments | « chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc ('k') | chrome/renderer/pepper/pepper_extensions_common_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698