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

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

Issue 281663002: Create RenderFrameProxyHost at time of swap-out instead of commit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_FRAME_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/id_map.h" 13 #include "base/id_map.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/process/process_handle.h" 16 #include "base/process/process_handle.h"
17 #include "content/public/common/javascript_message_type.h" 17 #include "content/public/common/javascript_message_type.h"
18 #include "content/public/common/referrer.h" 18 #include "content/public/common/referrer.h"
19 #include "content/public/renderer/render_frame.h" 19 #include "content/public/renderer/render_frame.h"
20 #include "content/renderer/media/webmediaplayer_delegate.h" 20 #include "content/renderer/media/webmediaplayer_delegate.h"
21 #include "content/renderer/render_frame_proxy.h"
21 #include "content/renderer/renderer_webcookiejar_impl.h" 22 #include "content/renderer/renderer_webcookiejar_impl.h"
22 #include "ipc/ipc_message.h" 23 #include "ipc/ipc_message.h"
23 #include "third_party/WebKit/public/web/WebDataSource.h" 24 #include "third_party/WebKit/public/web/WebDataSource.h"
24 #include "third_party/WebKit/public/web/WebFrameClient.h" 25 #include "third_party/WebKit/public/web/WebFrameClient.h"
25 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" 26 #include "third_party/WebKit/public/web/WebHistoryCommitType.h"
26 #include "ui/gfx/range/range.h" 27 #include "ui/gfx/range/range.h"
27 28
28 class TransportDIB; 29 class TransportDIB;
29 struct FrameMsg_BuffersSwapped_Params; 30 struct FrameMsg_BuffersSwapped_Params;
30 struct FrameMsg_CompositorFrameSwapped_Params; 31 struct FrameMsg_CompositorFrameSwapped_Params;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 : public RenderFrame, 68 : public RenderFrame,
68 NON_EXPORTED_BASE(public blink::WebFrameClient), 69 NON_EXPORTED_BASE(public blink::WebFrameClient),
69 NON_EXPORTED_BASE(public WebMediaPlayerDelegate) { 70 NON_EXPORTED_BASE(public WebMediaPlayerDelegate) {
70 public: 71 public:
71 // Creates a new RenderFrame. |render_view| is the RenderView object that this 72 // Creates a new RenderFrame. |render_view| is the RenderView object that this
72 // frame belongs to. 73 // frame belongs to.
73 // Callers *must* call |SetWebFrame| immediately after creation. 74 // Callers *must* call |SetWebFrame| immediately after creation.
74 // TODO(creis): We should structure this so that |SetWebFrame| isn't needed. 75 // TODO(creis): We should structure this so that |SetWebFrame| isn't needed.
75 static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id); 76 static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id);
76 77
78 // Returns the RenderFrameImpl for the given routing ID.
79 static RenderFrameImpl* FromRoutingID(int routing_id);
80
77 // Just like RenderFrame::FromWebFrame but returns the implementation. 81 // Just like RenderFrame::FromWebFrame but returns the implementation.
78 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame); 82 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame);
79 83
80 // Used by content_layouttest_support to hook into the creation of 84 // Used by content_layouttest_support to hook into the creation of
81 // RenderFrameImpls. 85 // RenderFrameImpls.
82 static void InstallCreateHook( 86 static void InstallCreateHook(
83 RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32)); 87 RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32));
84 88
85 virtual ~RenderFrameImpl(); 89 virtual ~RenderFrameImpl();
86 90
87 bool is_swapped_out() const { 91 bool is_swapped_out() const {
88 return is_swapped_out_; 92 return is_swapped_out_;
89 } 93 }
90 94
95 // TODO(nasko): Remove this method once RenderFrame no longer uses swapped out
96 // state.
97 void set_render_frame_proxy(RenderFrameProxy* proxy) {
98 render_frame_proxy_ = proxy;
99 }
100
91 // Out-of-process child frames receive a signal from RenderWidgetCompositor 101 // Out-of-process child frames receive a signal from RenderWidgetCompositor
92 // when a compositor frame has committed. 102 // when a compositor frame has committed.
93 void DidCommitCompositorFrame(); 103 void DidCommitCompositorFrame();
94 104
95 // TODO(jam): this is a temporary getter until all the code is transitioned 105 // TODO(jam): this is a temporary getter until all the code is transitioned
96 // to using RenderFrame instead of RenderView. 106 // to using RenderFrame instead of RenderView.
97 RenderViewImpl* render_view() { return render_view_.get(); } 107 RenderViewImpl* render_view() { return render_view_.get(); }
98 108
99 RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; } 109 RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; }
100 110
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 415
406 // Gets the focused element. If no such element exists then the element will 416 // Gets the focused element. If no such element exists then the element will
407 // be NULL. 417 // be NULL.
408 blink::WebElement GetFocusedElement(); 418 blink::WebElement GetFocusedElement();
409 419
410 // IPC message handlers ------------------------------------------------------ 420 // IPC message handlers ------------------------------------------------------
411 // 421 //
412 // The documentation for these functions should be in 422 // The documentation for these functions should be in
413 // content/common/*_messages.h for the message that the function is handling. 423 // content/common/*_messages.h for the message that the function is handling.
414 void OnBeforeUnload(); 424 void OnBeforeUnload();
415 void OnSwapOut(); 425 void OnSwapOut(int proxy_routing_id);
416 void OnChildFrameProcessGone(); 426 void OnChildFrameProcessGone();
417 void OnBuffersSwapped(const FrameMsg_BuffersSwapped_Params& params); 427 void OnBuffersSwapped(const FrameMsg_BuffersSwapped_Params& params);
418 void OnCompositorFrameSwapped(const IPC::Message& message); 428 void OnCompositorFrameSwapped(const IPC::Message& message);
419 void OnShowContextMenu(const gfx::Point& location); 429 void OnShowContextMenu(const gfx::Point& location);
420 void OnContextMenuClosed(const CustomContextMenuContext& custom_context); 430 void OnContextMenuClosed(const CustomContextMenuContext& custom_context);
421 void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context, 431 void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context,
422 unsigned action); 432 unsigned action);
423 void OnUndo(); 433 void OnUndo();
424 void OnRedo(); 434 void OnRedo();
425 void OnCut(); 435 void OnCut();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 #if defined(OS_ANDROID) 523 #if defined(OS_ANDROID)
514 blink::WebMediaPlayer* CreateAndroidWebMediaPlayer( 524 blink::WebMediaPlayer* CreateAndroidWebMediaPlayer(
515 const blink::WebURL& url, 525 const blink::WebURL& url,
516 blink::WebMediaPlayerClient* client); 526 blink::WebMediaPlayerClient* client);
517 #endif 527 #endif
518 528
519 // Stores the WebLocalFrame we are associated with. 529 // Stores the WebLocalFrame we are associated with.
520 blink::WebLocalFrame* frame_; 530 blink::WebLocalFrame* frame_;
521 531
522 base::WeakPtr<RenderViewImpl> render_view_; 532 base::WeakPtr<RenderViewImpl> render_view_;
533 RenderFrameProxy* render_frame_proxy_;
Charlie Reis 2014/05/15 00:32:50 This should have a comment saying it's usually nul
nasko 2014/05/15 18:47:13 Done.
523 int routing_id_; 534 int routing_id_;
524 bool is_swapped_out_; 535 bool is_swapped_out_;
525 bool is_detaching_; 536 bool is_detaching_;
526 537
527 #if defined(ENABLE_PLUGINS) 538 #if defined(ENABLE_PLUGINS)
528 // Current text input composition text. Empty if no composition is in 539 // Current text input composition text. Empty if no composition is in
529 // progress. 540 // progress.
530 base::string16 pepper_composition_text_; 541 base::string16 pepper_composition_text_;
531 #endif 542 #endif
532 543
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 blink::WebUserMediaClient* web_user_media_client_; 591 blink::WebUserMediaClient* web_user_media_client_;
581 592
582 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; 593 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
583 594
584 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); 595 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
585 }; 596 };
586 597
587 } // namespace content 598 } // namespace content
588 599
589 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 600 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698