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

Unified Diff: extensions/renderer/guest_view/extensions_iframe_guest_view_container.cc

Issue 972313002: Make <webview> use out-of-process iframe architecture. (Closed) Base URL: ssh://saopaulo.wat/mnt/dev/shared/src@testoopif2z-better-chrome
Patch Set: address comments from nasko@ + git cl format Created 5 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
Index: extensions/renderer/guest_view/extensions_iframe_guest_view_container.cc
diff --git a/extensions/renderer/guest_view/extensions_iframe_guest_view_container.cc b/extensions/renderer/guest_view/extensions_iframe_guest_view_container.cc
new file mode 100644
index 0000000000000000000000000000000000000000..396730347888d06808ff3f019c5e9995bf776d0e
--- /dev/null
+++ b/extensions/renderer/guest_view/extensions_iframe_guest_view_container.cc
@@ -0,0 +1,40 @@
+// 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.
+
+#include "extensions/renderer/guest_view/extensions_iframe_guest_view_container.h"
+
+#include "base/command_line.h"
+#include "components/guest_view/common/guest_view_messages.h"
+#include "content/public/common/content_switches.h"
+#include "content/public/renderer/render_frame.h"
+#include "extensions/common/guest_view/extensions_guest_view_messages.h"
+
+namespace extensions {
+
+ExtensionsIframeGuestViewContainer::ExtensionsIframeGuestViewContainer(
+ content::RenderFrame* render_frame)
+ : ExtensionsGuestViewContainer(render_frame), weak_ptr_factory_(this) {
+ CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess));
+ // There is no BrowserPluginDelegate to wait for.
+ ready_ = true;
+}
+
+ExtensionsIframeGuestViewContainer::~ExtensionsIframeGuestViewContainer() {
+}
+
+bool ExtensionsIframeGuestViewContainer::OnMessage(
+ const IPC::Message& message) {
+ // TODO(lazyboy): Do not send this message in --site-per-process.
+ if (message.type() == GuestViewMsg_GuestAttached::ID)
+ return true;
+
+ if (message.type() != ExtensionsGuestViewMsg_AttachToEmbedderFrame_ACK::ID)
+ return false;
+
+ OnHandleCallback(message);
+ return true;
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698