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

Unified Diff: chrome/browser/guest_view/chrome_guest_view_message_filter.h

Issue 1560553002: Framelet Prototype 2016 Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased + Applied Brett's Windows + Fixed security issue Created 4 years, 11 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/browser/guest_view/chrome_guest_view_message_filter.h
diff --git a/chrome/browser/guest_view/chrome_guest_view_message_filter.h b/chrome/browser/guest_view/chrome_guest_view_message_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..bf7d33926ba9ee31c0662cbc0a3cec657c84bbf2
--- /dev/null
+++ b/chrome/browser/guest_view/chrome_guest_view_message_filter.h
@@ -0,0 +1,62 @@
+// Copyright 2015 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_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MESSAGE_FILTER_H_
+#define CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MESSAGE_FILTER_H_
+
+#if defined(ENABLE_EXTENSIONS)
+#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
+#else
+#include "components/guest_view/browser/guest_view_message_filter.h"
+#endif
+
+namespace content {
+class WebContents;
+}
+
+namespace chrome {
+
+#if defined(ENABLE_EXTENSIONS)
+using GuestViewMessageFilterBase = extensions::ExtensionsGuestViewMessageFilter;
+#else
+using GuestViewMessageFilterBase = guest_view::GuestViewMessageFilter;
+#endif
+
+class ChromeGuestViewMessageFilter : public GuestViewMessageFilterBase {
+ public:
+ ChromeGuestViewMessageFilter(int render_process_id,
+ content::BrowserContext* context);
+
+ private:
+ friend class content::BrowserThread;
+ friend class base::DeleteHelper<ChromeGuestViewMessageFilter>;
+
+ ~ChromeGuestViewMessageFilter() override;
+
+ // GuestViewMessageFilterBase implementation.
+ guest_view::GuestViewManager* GetOrCreateGuestViewManager() override;
+ bool OnMessageReceived(const IPC::Message& message) override;
+ void OverrideThreadForMessage(const IPC::Message& message,
+ content::BrowserThread::ID* thread) override;
+
+ // Message handler(s):
+ void OnAttachFramelet(int render_frame_id,
+ int element_instance_id,
+ int guest_instance_id,
+ const base::DictionaryValue& params);
+ void OnCreateFramelet(int render_frame_id,
+ int element_instance_id,
+ const base::DictionaryValue& params);
+ void OnHeapSize(int routing_id, int heap_size);
+
+ void FrameletCreatedCallback(int element_instance_id,
+ int embedder_local_render_frame_id,
+ content::WebContents* guest_web_contents);
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeGuestViewMessageFilter);
+};
+
+} // namespace chrome
+
+#endif // CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698