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

Side by Side Diff: content/renderer/render_view_impl.h

Issue 8760024: Cross-process postMessage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Some cleanup Created 9 years 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 23 matching lines...) Expand all
34 #include "content/renderer/pepper_plugin_delegate_impl.h" 34 #include "content/renderer/pepper_plugin_delegate_impl.h"
35 #include "content/renderer/render_widget.h" 35 #include "content/renderer/render_widget.h"
36 #include "ipc/ipc_platform_file.h" 36 #include "ipc/ipc_platform_file.h"
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste m.h" 38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste m.h"
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h"
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h" 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h"
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h"
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie nt.h" 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie nt.h"
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityStat e.h" 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityStat e.h"
44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h"
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h" 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h"
47 #include "ui/base/javascript_message_type.h" 48 #include "ui/base/javascript_message_type.h"
48 #include "ui/gfx/surface/transport_dib.h" 49 #include "ui/gfx/surface/transport_dib.h"
49 #include "webkit/glue/webpreferences.h" 50 #include "webkit/glue/webpreferences.h"
50 #include "webkit/media/webmediaplayer_delegate.h" 51 #include "webkit/media/webmediaplayer_delegate.h"
51 #include "webkit/plugins/npapi/webplugin_page_delegate.h" 52 #include "webkit/plugins/npapi/webplugin_page_delegate.h"
52 53
53 #if defined(OS_WIN) 54 #if defined(OS_WIN)
(...skipping 13 matching lines...) Expand all
67 class LoadProgressTracker; 68 class LoadProgressTracker;
68 class MediaStreamImpl; 69 class MediaStreamImpl;
69 class NotificationProvider; 70 class NotificationProvider;
70 class PepperDeviceTest; 71 class PepperDeviceTest;
71 struct PP_NetAddress_Private; 72 struct PP_NetAddress_Private;
72 class RenderWidgetFullscreenPepper; 73 class RenderWidgetFullscreenPepper;
73 class RendererAccessibility; 74 class RendererAccessibility;
74 class SkBitmap; 75 class SkBitmap;
75 class SpeechInputDispatcher; 76 class SpeechInputDispatcher;
76 struct ViewMsg_Navigate_Params; 77 struct ViewMsg_Navigate_Params;
78 struct ViewMsg_PostMessage_Params;
77 struct ViewMsg_StopFinding_Params; 79 struct ViewMsg_StopFinding_Params;
78 struct ViewMsg_SwapOut_Params; 80 struct ViewMsg_SwapOut_Params;
79 struct WebDropData; 81 struct WebDropData;
80 class WebPluginDelegateProxy; 82 class WebPluginDelegateProxy;
81 class WebUIBindings; 83 class WebUIBindings;
82 84
83 namespace content { 85 namespace content {
84 class DocumentState; 86 class DocumentState;
85 class P2PSocketDispatcher; 87 class P2PSocketDispatcher;
86 class RenderViewObserver; 88 class RenderViewObserver;
(...skipping 16 matching lines...) Expand all
103 105
104 namespace webkit_glue { 106 namespace webkit_glue {
105 struct CustomContextMenuContext; 107 struct CustomContextMenuContext;
106 class ImageResourceFetcher; 108 class ImageResourceFetcher;
107 class ResourceFetcher; 109 class ResourceFetcher;
108 } 110 }
109 111
110 namespace WebKit { 112 namespace WebKit {
111 class WebApplicationCacheHost; 113 class WebApplicationCacheHost;
112 class WebApplicationCacheHostClient; 114 class WebApplicationCacheHostClient;
115 class WebDOMMessageEvent;
113 class WebDataSource; 116 class WebDataSource;
114 class WebDragData; 117 class WebDragData;
115 class WebGeolocationClient; 118 class WebGeolocationClient;
116 class WebIconURL; 119 class WebIconURL;
117 class WebImage; 120 class WebImage;
118 class WebMediaPlayer; 121 class WebMediaPlayer;
119 class WebMediaPlayerClient; 122 class WebMediaPlayerClient;
120 class WebMouseEvent; 123 class WebMouseEvent;
121 class WebSpeechInputController; 124 class WebSpeechInputController;
122 class WebSpeechInputListener; 125 class WebSpeechInputListener;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // we treat this RenderView as a top level window). 169 // we treat this RenderView as a top level window).
167 CONTENT_EXPORT static RenderViewImpl* Create( 170 CONTENT_EXPORT static RenderViewImpl* Create(
168 gfx::NativeViewId parent_hwnd, 171 gfx::NativeViewId parent_hwnd,
169 int32 opener_id, 172 int32 opener_id,
170 const content::RendererPreferences& renderer_prefs, 173 const content::RendererPreferences& renderer_prefs,
171 const WebPreferences& webkit_prefs, 174 const WebPreferences& webkit_prefs,
172 SharedRenderViewCounter* counter, 175 SharedRenderViewCounter* counter,
173 int32 routing_id, 176 int32 routing_id,
174 int64 session_storage_namespace_id, 177 int64 session_storage_namespace_id,
175 const string16& frame_name, 178 const string16& frame_name,
179 bool is_renderer_created,
176 int32 next_page_id); 180 int32 next_page_id);
177 181
178 // Returns the RenderViewImpl containing the given WebView. 182 // Returns the RenderViewImpl containing the given WebView.
179 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); 183 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview);
180 184
181 // May return NULL when the view is closing. 185 // May return NULL when the view is closing.
182 CONTENT_EXPORT WebKit::WebView* webview() const; 186 CONTENT_EXPORT WebKit::WebView* webview() const;
183 187
184 // Called by a GraphicsContext associated with this view when swapbuffers 188 // Called by a GraphicsContext associated with this view when swapbuffers
185 // is posted, completes or is aborted. 189 // is posted, completes or is aborted.
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 WebKit::WebStorageQuotaType type, 527 WebKit::WebStorageQuotaType type,
524 unsigned long long requested_size, 528 unsigned long long requested_size,
525 WebKit::WebStorageQuotaCallbacks* callbacks); 529 WebKit::WebStorageQuotaCallbacks* callbacks);
526 530
527 virtual void registerIntentService( 531 virtual void registerIntentService(
528 WebKit::WebFrame* frame, 532 WebKit::WebFrame* frame,
529 const WebKit::WebIntentServiceInfo& service); 533 const WebKit::WebIntentServiceInfo& service);
530 virtual void dispatchIntent(WebKit::WebFrame* frame, 534 virtual void dispatchIntent(WebKit::WebFrame* frame,
531 const WebKit::WebIntent& intent); 535 const WebKit::WebIntent& intent);
532 536
537 virtual bool interceptPostMessage(WebKit::WebFrame* source,
538 WebKit::WebSecurityOrigin targetOrigin,
539 WebKit::WebDOMMessageEvent event) OVERRIDE;
540
533 // WebKit::WebPageSerializerClient implementation ---------------------------- 541 // WebKit::WebPageSerializerClient implementation ----------------------------
534 542
535 virtual void didSerializeDataForFrame( 543 virtual void didSerializeDataForFrame(
536 const WebKit::WebURL& frame_url, 544 const WebKit::WebURL& frame_url,
537 const WebKit::WebCString& data, 545 const WebKit::WebCString& data,
538 PageSerializationStatus status) OVERRIDE; 546 PageSerializationStatus status) OVERRIDE;
539 547
540 // content::RenderView implementation ---------------------------------------- 548 // content::RenderView implementation ----------------------------------------
541 549
542 virtual bool Send(IPC::Message* message) OVERRIDE; 550 virtual bool Send(IPC::Message* message) OVERRIDE;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 }; 679 };
672 680
673 RenderViewImpl(gfx::NativeViewId parent_hwnd, 681 RenderViewImpl(gfx::NativeViewId parent_hwnd,
674 int32 opener_id, 682 int32 opener_id,
675 const content::RendererPreferences& renderer_prefs, 683 const content::RendererPreferences& renderer_prefs,
676 const WebPreferences& webkit_prefs, 684 const WebPreferences& webkit_prefs,
677 SharedRenderViewCounter* counter, 685 SharedRenderViewCounter* counter,
678 int32 routing_id, 686 int32 routing_id,
679 int64 session_storage_namespace_id, 687 int64 session_storage_namespace_id,
680 const string16& frame_name, 688 const string16& frame_name,
689 bool is_renderer_created,
681 int32 next_page_id); 690 int32 next_page_id);
682 691
683 // Do not delete directly. This class is reference counted. 692 // Do not delete directly. This class is reference counted.
684 virtual ~RenderViewImpl(); 693 virtual ~RenderViewImpl();
685 694
686 void UpdateURL(WebKit::WebFrame* frame); 695 void UpdateURL(WebKit::WebFrame* frame);
687 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, 696 void UpdateTitle(WebKit::WebFrame* frame, const string16& title,
688 WebKit::WebTextDirection title_direction); 697 WebKit::WebTextDirection title_direction);
689 void UpdateSessionHistory(WebKit::WebFrame* frame); 698 void UpdateSessionHistory(WebKit::WebFrame* frame);
690 699
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 void OnMediaPlayerActionAt(const gfx::Point& location, 801 void OnMediaPlayerActionAt(const gfx::Point& location,
793 const WebKit::WebMediaPlayerAction& action); 802 const WebKit::WebMediaPlayerAction& action);
794 void OnMouseLockLost(); 803 void OnMouseLockLost();
795 void OnMoveOrResizeStarted(); 804 void OnMoveOrResizeStarted();
796 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params); 805 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params);
797 void OnPaste(); 806 void OnPaste();
798 void OnPasteAndMatchStyle(); 807 void OnPasteAndMatchStyle();
799 #if defined(OS_MACOSX) 808 #if defined(OS_MACOSX)
800 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); 809 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id);
801 #endif 810 #endif
811 void OnPostMessage(int64 frame_id, const ViewMsg_PostMessage_Params& params);
802 void OnRedo(); 812 void OnRedo();
803 void OnReloadFrame(); 813 void OnReloadFrame();
804 void OnReplace(const string16& text); 814 void OnReplace(const string16& text);
805 void OnResetPageEncodingToDefault(); 815 void OnResetPageEncodingToDefault();
806 void OnScriptEvalRequest(const string16& frame_xpath, 816 void OnScriptEvalRequest(const string16& frame_xpath,
807 const string16& jscript, 817 const string16& jscript,
808 int id, 818 int id,
809 bool notify_result); 819 bool notify_result);
810 void OnSelectAll(); 820 void OnSelectAll();
811 void OnSelectRange(const gfx::Point& start, const gfx::Point& end); 821 void OnSelectRange(const gfx::Point& start, const gfx::Point& end);
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 scoped_ptr<LoadProgressTracker> load_progress_tracker_; 1200 scoped_ptr<LoadProgressTracker> load_progress_tracker_;
1191 1201
1192 // All the registered observers. We expect this list to be small, so vector 1202 // All the registered observers. We expect this list to be small, so vector
1193 // is fine. 1203 // is fine.
1194 ObserverList<content::RenderViewObserver> observers_; 1204 ObserverList<content::RenderViewObserver> observers_;
1195 1205
1196 // Used to inform didChangeSelection() when it is called in the context 1206 // Used to inform didChangeSelection() when it is called in the context
1197 // of handling a ViewMsg_SelectRange IPC. 1207 // of handling a ViewMsg_SelectRange IPC.
1198 bool handling_select_range_; 1208 bool handling_select_range_;
1199 1209
1210 // The content frame id of the frame we're a proxy for, or -1 if none.
1211 // This should be valid when the RV is swapped out, and -1 when swapped in.
1212 int64 active_content_frame_id_;
1213
1200 // Plugins ------------------------------------------------------------------- 1214 // Plugins -------------------------------------------------------------------
1201 1215
1202 // All the currently active plugin delegates for this RenderView; kept so 1216 // All the currently active plugin delegates for this RenderView; kept so
1203 // that we can enumerate them to send updates about things like window 1217 // that we can enumerate them to send updates about things like window
1204 // location or tab focus and visibily. These are non-owning references. 1218 // location or tab focus and visibily. These are non-owning references.
1205 std::set<WebPluginDelegateProxy*> plugin_delegates_; 1219 std::set<WebPluginDelegateProxy*> plugin_delegates_;
1206 1220
1207 #if defined(OS_WIN) 1221 #if defined(OS_WIN)
1208 // The ID of the focused NPAPI plug-in. 1222 // The ID of the focused NPAPI plug-in.
1209 int focused_plugin_id_; 1223 int focused_plugin_id_;
1210 #endif 1224 #endif
1211 1225
1212 // NOTE: pepper_delegate_ should be last member because its constructor calls 1226 // NOTE: pepper_delegate_ should be last member because its constructor calls
1213 // AddObservers method of RenderViewImpl from c-tor. 1227 // AddObservers method of RenderViewImpl from c-tor.
1214 PepperPluginDelegateImpl pepper_delegate_; 1228 PepperPluginDelegateImpl pepper_delegate_;
1215 1229
1216 // --------------------------------------------------------------------------- 1230 // ---------------------------------------------------------------------------
1217 // ADDING NEW DATA? Please see if it fits appropriately in one of the above 1231 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
1218 // sections rather than throwing it randomly at the end. If you're adding a 1232 // sections rather than throwing it randomly at the end. If you're adding a
1219 // bunch of stuff, you should probably create a helper class and put your 1233 // bunch of stuff, you should probably create a helper class and put your
1220 // data and methods on that to avoid bloating RenderView more. You can 1234 // data and methods on that to avoid bloating RenderView more. You can
1221 // use the Observer interface to filter IPC messages and receive frame change 1235 // use the Observer interface to filter IPC messages and receive frame change
1222 // notifications. 1236 // notifications.
1223 // --------------------------------------------------------------------------- 1237 // ---------------------------------------------------------------------------
1224 1238
1225 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); 1239 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
1226 }; 1240 };
1227 1241
1228 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 1242 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698