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

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

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't use metadata to stash IPC messages 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 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 21 matching lines...) Expand all
32 #include "content/common/service_worker/service_worker_types.h" 32 #include "content/common/service_worker/service_worker_types.h"
33 #include "content/common/socket_stream_handle_data.h" 33 #include "content/common/socket_stream_handle_data.h"
34 #include "content/common/swapped_out_messages.h" 34 #include "content/common/swapped_out_messages.h"
35 #include "content/common/view_messages.h" 35 #include "content/common/view_messages.h"
36 #include "content/public/common/bindings_policy.h" 36 #include "content/public/common/bindings_policy.h"
37 #include "content/public/common/content_constants.h" 37 #include "content/public/common/content_constants.h"
38 #include "content/public/common/content_switches.h" 38 #include "content/public/common/content_switches.h"
39 #include "content/public/common/context_menu_params.h" 39 #include "content/public/common/context_menu_params.h"
40 #include "content/public/common/url_constants.h" 40 #include "content/public/common/url_constants.h"
41 #include "content/public/common/url_utils.h" 41 #include "content/public/common/url_utils.h"
42 #include "content/public/common/widget_visible_state.h"
42 #include "content/public/renderer/content_renderer_client.h" 43 #include "content/public/renderer/content_renderer_client.h"
43 #include "content/public/renderer/context_menu_client.h" 44 #include "content/public/renderer/context_menu_client.h"
44 #include "content/public/renderer/document_state.h" 45 #include "content/public/renderer/document_state.h"
45 #include "content/public/renderer/navigation_state.h" 46 #include "content/public/renderer/navigation_state.h"
46 #include "content/public/renderer/render_frame_observer.h" 47 #include "content/public/renderer/render_frame_observer.h"
47 #include "content/renderer/accessibility/renderer_accessibility.h" 48 #include "content/renderer/accessibility/renderer_accessibility.h"
48 #include "content/renderer/browser_plugin/browser_plugin.h" 49 #include "content/renderer/browser_plugin/browser_plugin.h"
49 #include "content/renderer/browser_plugin/browser_plugin_manager.h" 50 #include "content/renderer/browser_plugin/browser_plugin_manager.h"
50 #include "content/renderer/child_frame_compositing_helper.h" 51 #include "content/renderer/child_frame_compositing_helper.h"
51 #include "content/renderer/context_menu_params_builder.h" 52 #include "content/renderer/context_menu_params_builder.h"
(...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after
1967 // the session history again. We do this regardless of whether this is 1968 // the session history again. We do this regardless of whether this is
1968 // a session history navigation, because if we attempted a session history 1969 // a session history navigation, because if we attempted a session history
1969 // navigation without valid HistoryItem state, WebCore will think it is a 1970 // navigation without valid HistoryItem state, WebCore will think it is a
1970 // new navigation. 1971 // new navigation.
1971 navigation_state->set_request_committed(true); 1972 navigation_state->set_request_committed(true);
1972 1973
1973 UpdateURL(frame); 1974 UpdateURL(frame);
1974 1975
1975 // Check whether we have new encoding name. 1976 // Check whether we have new encoding name.
1976 UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); 1977 UpdateEncoding(frame, frame->view()->pageEncoding().utf8());
1978
1979 if (!frame->parent()) {
1980 GetRenderWidget()->QueueMessage(new FrameHostMsg_WidgetVisibleStateChanged(
1981 routing_id_, WIDGET_VISIBLE_STATE_DID_HANDLE_ONLOAD_EVENTS));
1982 }
1977 } 1983 }
1978 1984
1979 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame) { 1985 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame) {
1980 DCHECK(!frame_ || frame_ == frame); 1986 DCHECK(!frame_ || frame_ == frame);
1981 // TODO(nasko): Move implementation here. Needed state: 1987 // TODO(nasko): Move implementation here. Needed state:
1982 // * enabled_bindings_ 1988 // * enabled_bindings_
1983 // * dom_automation_controller_ 1989 // * dom_automation_controller_
1984 // * stats_collection_controller_ 1990 // * stats_collection_controller_
1985 1991
1986 render_view_->didClearWindowObject(frame); 1992 render_view_->didClearWindowObject(frame);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
2043 document_state->set_finish_document_load_time(Time::Now()); 2049 document_state->set_finish_document_load_time(Time::Now());
2044 2050
2045 Send(new FrameHostMsg_DidFinishDocumentLoad(routing_id_)); 2051 Send(new FrameHostMsg_DidFinishDocumentLoad(routing_id_));
2046 2052
2047 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), 2053 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(),
2048 DidFinishDocumentLoad(frame)); 2054 DidFinishDocumentLoad(frame));
2049 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishDocumentLoad()); 2055 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishDocumentLoad());
2050 2056
2051 // Check whether we have new encoding name. 2057 // Check whether we have new encoding name.
2052 UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); 2058 UpdateEncoding(frame, frame->view()->pageEncoding().utf8());
2059
2060 if (!frame->parent()) {
2061 GetRenderWidget()->QueueMessage(new FrameHostMsg_WidgetVisibleStateChanged(
2062 routing_id_, WIDGET_VISIBLE_STATE_DID_FINISH_DOCUMENT_LOAD));
2063 }
2053 } 2064 }
2054 2065
2055 void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) { 2066 void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) {
2056 DCHECK(!frame_ || frame_ == frame); 2067 DCHECK(!frame_ || frame_ == frame);
2057 if (!frame->parent()) 2068 if (!frame->parent()) {
2058 Send(new FrameHostMsg_DocumentOnLoadCompleted(routing_id_)); 2069 Send(new FrameHostMsg_DocumentOnLoadCompleted(routing_id_));
2070
2071 GetRenderWidget()->QueueMessage(new FrameHostMsg_WidgetVisibleStateChanged(
2072 routing_id_, WIDGET_VISIBLE_STATE_DID_HANDLE_ONLOAD_EVENTS));
2073 }
2059 } 2074 }
2060 2075
2061 void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame, 2076 void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame,
2062 const blink::WebURLError& error) { 2077 const blink::WebURLError& error) {
2063 DCHECK(!frame_ || frame_ == frame); 2078 DCHECK(!frame_ || frame_ == frame);
2064 // TODO(nasko): Move implementation here. No state needed. 2079 // TODO(nasko): Move implementation here. No state needed.
2065 WebDataSource* ds = frame->dataSource(); 2080 WebDataSource* ds = frame->dataSource();
2066 DCHECK(ds); 2081 DCHECK(ds);
2067 2082
2068 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), 2083 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(),
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 return; 2619 return;
2605 2620
2606 InternalDocumentStateData* data = 2621 InternalDocumentStateData* data =
2607 InternalDocumentStateData::FromDataSource(frame->dataSource()); 2622 InternalDocumentStateData::FromDataSource(frame->dataSource());
2608 data->set_did_first_visually_non_empty_layout(true); 2623 data->set_did_first_visually_non_empty_layout(true);
2609 2624
2610 #if defined(OS_ANDROID) 2625 #if defined(OS_ANDROID)
2611 GetRenderWidget()->DidChangeBodyBackgroundColor( 2626 GetRenderWidget()->DidChangeBodyBackgroundColor(
2612 render_view_->webwidget_->backgroundColor()); 2627 render_view_->webwidget_->backgroundColor());
2613 #endif 2628 #endif
2629
2630 if (!frame->parent()) {
2631 GetRenderWidget()->QueueMessage(new FrameHostMsg_WidgetVisibleStateChanged(
2632 routing_id_, WIDGET_VISIBLE_STATE_FIRST_VISUALLY_NON_EMPTY_LAYOUT));
2633 }
2614 } 2634 }
2615 2635
2616 void RenderFrameImpl::didChangeContentsSize(blink::WebLocalFrame* frame, 2636 void RenderFrameImpl::didChangeContentsSize(blink::WebLocalFrame* frame,
2617 const blink::WebSize& size) { 2637 const blink::WebSize& size) {
2618 DCHECK(!frame_ || frame_ == frame); 2638 DCHECK(!frame_ || frame_ == frame);
2619 #if defined(OS_MACOSX) 2639 #if defined(OS_MACOSX)
2620 if (frame->parent()) 2640 if (frame->parent())
2621 return; 2641 return;
2622 2642
2623 WebView* frameView = frame->view(); 2643 WebView* frameView = frame->view();
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
3470 weak_factory_.GetWeakPtr(), 3490 weak_factory_.GetWeakPtr(),
3471 render_view_->media_player_manager_, 3491 render_view_->media_player_manager_,
3472 stream_texture_factory, 3492 stream_texture_factory,
3473 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), 3493 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(),
3474 new RenderMediaLog()); 3494 new RenderMediaLog());
3475 } 3495 }
3476 3496
3477 #endif 3497 #endif
3478 3498
3479 } // namespace content 3499 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698