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

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: use IPC? 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 20 matching lines...) Expand all
31 #include "content/common/service_worker/service_worker_types.h" 31 #include "content/common/service_worker/service_worker_types.h"
32 #include "content/common/socket_stream_handle_data.h" 32 #include "content/common/socket_stream_handle_data.h"
33 #include "content/common/swapped_out_messages.h" 33 #include "content/common/swapped_out_messages.h"
34 #include "content/common/view_messages.h" 34 #include "content/common/view_messages.h"
35 #include "content/public/common/bindings_policy.h" 35 #include "content/public/common/bindings_policy.h"
36 #include "content/public/common/content_constants.h" 36 #include "content/public/common/content_constants.h"
37 #include "content/public/common/content_switches.h" 37 #include "content/public/common/content_switches.h"
38 #include "content/public/common/context_menu_params.h" 38 #include "content/public/common/context_menu_params.h"
39 #include "content/public/common/url_constants.h" 39 #include "content/public/common/url_constants.h"
40 #include "content/public/common/url_utils.h" 40 #include "content/public/common/url_utils.h"
41 #include "content/public/common/widget_visible_state.h"
41 #include "content/public/renderer/content_renderer_client.h" 42 #include "content/public/renderer/content_renderer_client.h"
42 #include "content/public/renderer/context_menu_client.h" 43 #include "content/public/renderer/context_menu_client.h"
43 #include "content/public/renderer/document_state.h" 44 #include "content/public/renderer/document_state.h"
44 #include "content/public/renderer/navigation_state.h" 45 #include "content/public/renderer/navigation_state.h"
45 #include "content/public/renderer/render_frame_observer.h" 46 #include "content/public/renderer/render_frame_observer.h"
46 #include "content/renderer/accessibility/renderer_accessibility.h" 47 #include "content/renderer/accessibility/renderer_accessibility.h"
47 #include "content/renderer/browser_plugin/browser_plugin.h" 48 #include "content/renderer/browser_plugin/browser_plugin.h"
48 #include "content/renderer/browser_plugin/browser_plugin_manager.h" 49 #include "content/renderer/browser_plugin/browser_plugin_manager.h"
49 #include "content/renderer/child_frame_compositing_helper.h" 50 #include "content/renderer/child_frame_compositing_helper.h"
50 #include "content/renderer/context_menu_params_builder.h" 51 #include "content/renderer/context_menu_params_builder.h"
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 // the session history again. We do this regardless of whether this is 1886 // the session history again. We do this regardless of whether this is
1886 // a session history navigation, because if we attempted a session history 1887 // a session history navigation, because if we attempted a session history
1887 // navigation without valid HistoryItem state, WebCore will think it is a 1888 // navigation without valid HistoryItem state, WebCore will think it is a
1888 // new navigation. 1889 // new navigation.
1889 navigation_state->set_request_committed(true); 1890 navigation_state->set_request_committed(true);
1890 1891
1891 UpdateURL(frame); 1892 UpdateURL(frame);
1892 1893
1893 // Check whether we have new encoding name. 1894 // Check whether we have new encoding name.
1894 render_view_->UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); 1895 render_view_->UpdateEncoding(frame, frame->view()->pageEncoding().utf8());
1896
1897 if (!frame->parent()) {
1898 GetRenderWidget()->SendSourceFrameNumberWhenReady(
1899 render_view()->page_id_, WIDGET_VISIBLE_STATE_DID_HANDLE_ONLOAD_EVENTS);
1900 }
1895 } 1901 }
1896 1902
1897 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame, 1903 void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame,
1898 int world_id) { 1904 int world_id) {
1899 DCHECK(!frame_ || frame_ == frame); 1905 DCHECK(!frame_ || frame_ == frame);
1900 // TODO(nasko): Move implementation here. Needed state: 1906 // TODO(nasko): Move implementation here. Needed state:
1901 // * enabled_bindings_ 1907 // * enabled_bindings_
1902 // * dom_automation_controller_ 1908 // * dom_automation_controller_
1903 // * stats_collection_controller_ 1909 // * stats_collection_controller_
1904 1910
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1955 document_state->set_finish_document_load_time(Time::Now()); 1961 document_state->set_finish_document_load_time(Time::Now());
1956 1962
1957 Send(new FrameHostMsg_DidFinishDocumentLoad(routing_id_)); 1963 Send(new FrameHostMsg_DidFinishDocumentLoad(routing_id_));
1958 1964
1959 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), 1965 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(),
1960 DidFinishDocumentLoad(frame)); 1966 DidFinishDocumentLoad(frame));
1961 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishDocumentLoad()); 1967 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishDocumentLoad());
1962 1968
1963 // Check whether we have new encoding name. 1969 // Check whether we have new encoding name.
1964 render_view_->UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); 1970 render_view_->UpdateEncoding(frame, frame->view()->pageEncoding().utf8());
1971
1972 if (!frame->parent()) {
1973 GetRenderWidget()->SendSourceFrameNumberWhenReady(
1974 render_view_->page_id_, WIDGET_VISIBLE_STATE_DID_FINISH_DOCUMENT_LOAD);
1975 }
1965 } 1976 }
1966 1977
1967 void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) { 1978 void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) {
1968 DCHECK(!frame_ || frame_ == frame); 1979 DCHECK(!frame_ || frame_ == frame);
1969 // TODO(nasko): Move implementation here. Needed state: 1980 // TODO(nasko): Move implementation here. Needed state:
1970 // * page_id_ 1981 // * page_id_
1971 render_view_->didHandleOnloadEvents(frame); 1982 render_view_->didHandleOnloadEvents(frame);
1983
1984 if (!frame->parent()) {
1985 GetRenderWidget()->SendSourceFrameNumberWhenReady(
1986 render_view()->page_id_, WIDGET_VISIBLE_STATE_DID_HANDLE_ONLOAD_EVENTS);
1987 }
1972 } 1988 }
1973 1989
1974 void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame, 1990 void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame,
1975 const blink::WebURLError& error) { 1991 const blink::WebURLError& error) {
1976 DCHECK(!frame_ || frame_ == frame); 1992 DCHECK(!frame_ || frame_ == frame);
1977 // TODO(nasko): Move implementation here. No state needed. 1993 // TODO(nasko): Move implementation here. No state needed.
1978 WebDataSource* ds = frame->dataSource(); 1994 WebDataSource* ds = frame->dataSource();
1979 DCHECK(ds); 1995 DCHECK(ds);
1980 1996
1981 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), 1997 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(),
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 2523
2508 FOR_EACH_OBSERVER(RenderFrameObserver, 2524 FOR_EACH_OBSERVER(RenderFrameObserver,
2509 observers_, 2525 observers_,
2510 WillReleaseScriptContext(context, world_id)); 2526 WillReleaseScriptContext(context, world_id));
2511 } 2527 }
2512 2528
2513 void RenderFrameImpl::didFirstVisuallyNonEmptyLayout( 2529 void RenderFrameImpl::didFirstVisuallyNonEmptyLayout(
2514 blink::WebLocalFrame* frame) { 2530 blink::WebLocalFrame* frame) {
2515 DCHECK(!frame_ || frame_ == frame); 2531 DCHECK(!frame_ || frame_ == frame);
2516 render_view_->didFirstVisuallyNonEmptyLayout(frame); 2532 render_view_->didFirstVisuallyNonEmptyLayout(frame);
2533
2534 if (!frame->parent()) {
2535 GetRenderWidget()->SendSourceFrameNumberWhenReady(
2536 render_view()->page_id_,
2537 WIDGET_VISIBLE_STATE_FIRST_VISUALLY_NON_EMPTY_LAYOUT);
2538 }
2517 } 2539 }
2518 2540
2519 void RenderFrameImpl::didChangeContentsSize(blink::WebLocalFrame* frame, 2541 void RenderFrameImpl::didChangeContentsSize(blink::WebLocalFrame* frame,
2520 const blink::WebSize& size) { 2542 const blink::WebSize& size) {
2521 DCHECK(!frame_ || frame_ == frame); 2543 DCHECK(!frame_ || frame_ == frame);
2522 #if defined(OS_MACOSX) 2544 #if defined(OS_MACOSX)
2523 if (frame->parent()) 2545 if (frame->parent())
2524 return; 2546 return;
2525 2547
2526 WebView* frameView = frame->view(); 2548 WebView* frameView = frame->view();
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
3219 selection_text_offset_ = offset; 3241 selection_text_offset_ = offset;
3220 selection_range_ = range; 3242 selection_range_ = range;
3221 // This IPC is dispatched by RenderWidetHost, so use its routing ID. 3243 // This IPC is dispatched by RenderWidetHost, so use its routing ID.
3222 Send(new ViewHostMsg_SelectionChanged( 3244 Send(new ViewHostMsg_SelectionChanged(
3223 GetRenderWidget()->routing_id(), text, offset, range)); 3245 GetRenderWidget()->routing_id(), text, offset, range));
3224 } 3246 }
3225 GetRenderWidget()->UpdateSelectionBounds(); 3247 GetRenderWidget()->UpdateSelectionBounds();
3226 } 3248 }
3227 3249
3228 } // namespace content 3250 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698