| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 3706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3717 &error_description); | 3717 &error_description); |
| 3718 Send(new ViewHostMsg_DidFailLoadWithError(routing_id_, | 3718 Send(new ViewHostMsg_DidFailLoadWithError(routing_id_, |
| 3719 frame->identifier(), | 3719 frame->identifier(), |
| 3720 failed_request.url(), | 3720 failed_request.url(), |
| 3721 !frame->parent(), | 3721 !frame->parent(), |
| 3722 error.reason, | 3722 error.reason, |
| 3723 error_description)); | 3723 error_description)); |
| 3724 } | 3724 } |
| 3725 | 3725 |
| 3726 void RenderViewImpl::didFinishLoad(WebFrame* frame) { | 3726 void RenderViewImpl::didFinishLoad(WebFrame* frame) { |
| 3727 if (!frame->parent()) |
| 3728 TRACE_EVENT_INSTANT0("WebCore", "LoadEvent", TRACE_EVENT_SCOPE_THREAD); |
| 3727 WebDataSource* ds = frame->dataSource(); | 3729 WebDataSource* ds = frame->dataSource(); |
| 3728 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3730 DocumentState* document_state = DocumentState::FromDataSource(ds); |
| 3729 if (document_state->finish_load_time().is_null()) | 3731 if (document_state->finish_load_time().is_null()) |
| 3730 document_state->set_finish_load_time(Time::Now()); | 3732 document_state->set_finish_load_time(Time::Now()); |
| 3731 | 3733 |
| 3732 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidFinishLoad(frame)); | 3734 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidFinishLoad(frame)); |
| 3733 | 3735 |
| 3734 Send(new ViewHostMsg_DidFinishLoad(routing_id_, | 3736 Send(new ViewHostMsg_DidFinishLoad(routing_id_, |
| 3735 frame->identifier(), | 3737 frame->identifier(), |
| 3736 ds->request().url(), | 3738 ds->request().url(), |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5195 frame = frame->findChildByExpression(*i); | 5197 frame = frame->findChildByExpression(*i); |
| 5196 } | 5198 } |
| 5197 | 5199 |
| 5198 return frame; | 5200 return frame; |
| 5199 } | 5201 } |
| 5200 | 5202 |
| 5201 void RenderViewImpl::OnScriptEvalRequest(const string16& frame_xpath, | 5203 void RenderViewImpl::OnScriptEvalRequest(const string16& frame_xpath, |
| 5202 const string16& jscript, | 5204 const string16& jscript, |
| 5203 int id, | 5205 int id, |
| 5204 bool notify_result) { | 5206 bool notify_result) { |
| 5205 TRACE_EVENT_INSTANT0("test_tracing", "OnScriptEvalRequest"); | 5207 TRACE_EVENT_INSTANT0("test_tracing", "OnScriptEvalRequest", |
| 5208 TRACE_EVENT_SCOPE_THREAD); |
| 5206 EvaluateScript(frame_xpath, jscript, id, notify_result); | 5209 EvaluateScript(frame_xpath, jscript, id, notify_result); |
| 5207 } | 5210 } |
| 5208 | 5211 |
| 5209 void RenderViewImpl::OnPostMessageEvent( | 5212 void RenderViewImpl::OnPostMessageEvent( |
| 5210 const ViewMsg_PostMessage_Params& params) { | 5213 const ViewMsg_PostMessage_Params& params) { |
| 5211 // Find the target frame of this message. The source tags the message with | 5214 // Find the target frame of this message. The source tags the message with |
| 5212 // |target_frame_id|, so use it to locate the frame. | 5215 // |target_frame_id|, so use it to locate the frame. |
| 5213 // TODO(nasko): Lookup based on the frame id, once http://crbug.com/153701 | 5216 // TODO(nasko): Lookup based on the frame id, once http://crbug.com/153701 |
| 5214 // is fixed and we can rely on having frame tree updates again. | 5217 // is fixed and we can rely on having frame tree updates again. |
| 5215 WebFrame* frame = webview()->mainFrame(); | 5218 WebFrame* frame = webview()->mainFrame(); |
| (...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6662 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6665 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6663 RenderProcess::current()->ReleaseTransportDIB(dib); | 6666 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6664 } | 6667 } |
| 6665 | 6668 |
| 6666 void RenderViewImpl::DidCommitCompositorFrame() { | 6669 void RenderViewImpl::DidCommitCompositorFrame() { |
| 6667 RenderWidget::DidCommitCompositorFrame(); | 6670 RenderWidget::DidCommitCompositorFrame(); |
| 6668 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6671 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
| 6669 } | 6672 } |
| 6670 | 6673 |
| 6671 } // namespace content | 6674 } // namespace content |
| OLD | NEW |