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

Side by Side Diff: extensions/browser/guest_view/extensions_guest_view_message_filter.h

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@ 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_MESSAGE_FILTER_H_ 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_MESSAGE_FILTER_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_MESSAGE_FILTER_H_ 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_MESSAGE_FILTER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "components/guest_view/browser/guest_view_message_filter.h" 12 #include "components/guest_view/browser/guest_view_message_filter.h"
13 #include "content/public/browser/browser_message_filter.h" 13 #include "content/public/browser/browser_message_filter.h"
14 14
15 namespace content { 15 namespace content {
16 class BrowserContext; 16 class BrowserContext;
17 class WebContents; 17 class WebContents;
18 } 18 }
19 19
20 namespace gfx { 20 namespace gfx {
21 class Size; 21 class Size;
22 } 22 }
23 23
24 namespace guest_view { 24 namespace guest_view {
25 class GuestViewManager; 25 class GuestViewManager;
26 } 26 }
27 27
28 namespace extensions { 28 namespace extensions {
29 29
30 class WebViewGuest;
31
30 // This class filters out incoming extensions GuestView-specific IPC messages 32 // This class filters out incoming extensions GuestView-specific IPC messages
31 // from thw renderer process. It is created on the UI thread. Messages may be 33 // from thw renderer process. It is created on the UI thread. Messages may be
32 // handled on the IO thread or the UI thread. 34 // handled on the IO thread or the UI thread.
33 class ExtensionsGuestViewMessageFilter 35 class ExtensionsGuestViewMessageFilter
34 : public guest_view::GuestViewMessageFilter { 36 : public guest_view::GuestViewMessageFilter {
35 public: 37 public:
36 ExtensionsGuestViewMessageFilter(int render_process_id, 38 ExtensionsGuestViewMessageFilter(int render_process_id,
37 content::BrowserContext* context); 39 content::BrowserContext* context);
38 40
39 private: 41 private:
40 friend class content::BrowserThread; 42 friend class content::BrowserThread;
41 friend class base::DeleteHelper<ExtensionsGuestViewMessageFilter>; 43 friend class base::DeleteHelper<ExtensionsGuestViewMessageFilter>;
42 44
43 ~ExtensionsGuestViewMessageFilter() override; 45 ~ExtensionsGuestViewMessageFilter() override;
44 46
45 // GuestViewMessageFilter implementation. 47 // GuestViewMessageFilter implementation.
46 void OverrideThreadForMessage(const IPC::Message& message, 48 void OverrideThreadForMessage(const IPC::Message& message,
47 content::BrowserThread::ID* thread) override; 49 content::BrowserThread::ID* thread) override;
48 bool OnMessageReceived(const IPC::Message& message) override; 50 bool OnMessageReceived(const IPC::Message& message) override;
49 guest_view::GuestViewManager* GetOrCreateGuestViewManager() override; 51 guest_view::GuestViewManager* GetOrCreateGuestViewManager() override;
50 52
51 // Message handlers on the UI thread. 53 // Message handlers on the UI thread.
54 void OnAttachToEmbedderFrame(int embedder_local_render_frame_id,
55 int element_instance_id,
56 int guest_instance_id,
57 const base::DictionaryValue& params);
52 void OnCanExecuteContentScript(int render_view_id, 58 void OnCanExecuteContentScript(int render_view_id,
53 int script_id, 59 int script_id,
54 bool* allowed); 60 bool* allowed);
55 void OnCreateMimeHandlerViewGuest(int render_frame_id, 61 void OnCreateMimeHandlerViewGuest(int render_frame_id,
56 const std::string& view_id, 62 const std::string& view_id,
57 int element_instance_id, 63 int element_instance_id,
58 const gfx::Size& element_size); 64 const gfx::Size& element_size);
59 void OnResizeGuest(int render_frame_id, 65 void OnResizeGuest(int render_frame_id,
60 int element_instance_id, 66 int element_instance_id,
61 const gfx::Size& new_size); 67 const gfx::Size& new_size);
62 68
63 // Runs on UI thread. 69 // Runs on UI thread.
64 void MimeHandlerViewGuestCreatedCallback(int element_instance_id, 70 void MimeHandlerViewGuestCreatedCallback(int element_instance_id,
65 int embedder_render_process_id, 71 int embedder_render_process_id,
66 int embedder_render_frame_id, 72 int embedder_render_frame_id,
67 const gfx::Size& element_size, 73 const gfx::Size& element_size,
68 content::WebContents* web_contents); 74 content::WebContents* web_contents);
75 void WillAttachCallback(extensions::WebViewGuest* guest);
69 76
70 static const uint32 kFilteredMessageClasses[]; 77 static const uint32 kFilteredMessageClasses[];
71 78
72 DISALLOW_COPY_AND_ASSIGN(ExtensionsGuestViewMessageFilter); 79 DISALLOW_COPY_AND_ASSIGN(ExtensionsGuestViewMessageFilter);
73 }; 80 };
74 81
75 } // namespace extensions 82 } // namespace extensions
76 83
77 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_MESSAGE_FILTER_H_ 84 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_MESSAGE_FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698