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

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

Issue 2633253002: Split content script injections into multiple tasks (Closed)
Patch Set: comments addressed Created 3 years, 9 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
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | extensions/common/feature_switch.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 // Return if the world_id is not valid. world_id is passed as a plain int 2005 // Return if the world_id is not valid. world_id is passed as a plain int
2006 // over IPC and needs to be verified here, in the IPC endpoint. 2006 // over IPC and needs to be verified here, in the IPC endpoint.
2007 NOTREACHED(); 2007 NOTREACHED();
2008 return; 2008 return;
2009 } 2009 }
2010 2010
2011 v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); 2011 v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
2012 WebScriptSource script = WebScriptSource(WebString::fromUTF16(jscript)); 2012 WebScriptSource script = WebScriptSource(WebString::fromUTF16(jscript));
2013 JavaScriptIsolatedWorldRequest* request = new JavaScriptIsolatedWorldRequest( 2013 JavaScriptIsolatedWorldRequest* request = new JavaScriptIsolatedWorldRequest(
2014 id, notify_result, routing_id_, weak_factory_.GetWeakPtr()); 2014 id, notify_result, routing_id_, weak_factory_.GetWeakPtr());
2015 frame_->requestExecuteScriptInIsolatedWorld(world_id, &script, 1, false, 2015 frame_->requestExecuteScriptInIsolatedWorld(
2016 request); 2016 world_id, &script, 1, false, WebLocalFrame::Synchronous, request);
2017 } 2017 }
2018 2018
2019 RenderFrameImpl::JavaScriptIsolatedWorldRequest::JavaScriptIsolatedWorldRequest( 2019 RenderFrameImpl::JavaScriptIsolatedWorldRequest::JavaScriptIsolatedWorldRequest(
2020 int id, 2020 int id,
2021 bool notify_result, 2021 bool notify_result,
2022 int routing_id, 2022 int routing_id,
2023 base::WeakPtr<RenderFrameImpl> render_frame_impl) 2023 base::WeakPtr<RenderFrameImpl> render_frame_impl)
2024 : id_(id), 2024 : id_(id),
2025 notify_result_(notify_result), 2025 notify_result_(notify_result),
2026 routing_id_(routing_id), 2026 routing_id_(routing_id),
(...skipping 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after
3902 error.unreachableURL = frame->document().url(); 3902 error.unreachableURL = frame->document().url();
3903 error.domain = WebString::fromUTF8(error_domain); 3903 error.domain = WebString::fromUTF8(error_domain);
3904 error.reason = http_status_code; 3904 error.reason = http_status_code;
3905 // This call may run scripts, e.g. via the beforeunload event. 3905 // This call may run scripts, e.g. via the beforeunload event.
3906 LoadNavigationErrorPage(frame->dataSource()->getRequest(), error, true, 3906 LoadNavigationErrorPage(frame->dataSource()->getRequest(), error, true,
3907 nullptr); 3907 nullptr);
3908 } 3908 }
3909 // Do not use |this| or |frame| here without checking |weak_self|. 3909 // Do not use |this| or |frame| here without checking |weak_self|.
3910 } 3910 }
3911 3911
3912 void RenderFrameImpl::runScriptsAtDocumentIdle(blink::WebLocalFrame* frame) {
3913 DCHECK_EQ(frame_, frame);
3914 GetContentClient()->renderer()->RunScriptsAtDocumentIdle(this);
3915 // ContentClient might have deleted |frame| and |this| by now!
3916 }
3917
3912 void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) { 3918 void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) {
3913 DCHECK_EQ(frame_, frame); 3919 DCHECK_EQ(frame_, frame);
3914 if (!frame->parent()) { 3920 if (!frame->parent()) {
3915 FrameMsg_UILoadMetricsReportType::Value report_type = 3921 FrameMsg_UILoadMetricsReportType::Value report_type =
3916 static_cast<FrameMsg_UILoadMetricsReportType::Value>( 3922 static_cast<FrameMsg_UILoadMetricsReportType::Value>(
3917 frame->dataSource()->getRequest().inputPerfMetricReportPolicy()); 3923 frame->dataSource()->getRequest().inputPerfMetricReportPolicy());
3918 base::TimeTicks ui_timestamp = 3924 base::TimeTicks ui_timestamp =
3919 base::TimeTicks() + 3925 base::TimeTicks() +
3920 base::TimeDelta::FromSecondsD( 3926 base::TimeDelta::FromSecondsD(
3921 frame->dataSource()->getRequest().uiStartTime()); 3927 frame->dataSource()->getRequest().uiStartTime());
(...skipping 2967 matching lines...) Expand 10 before | Expand all | Expand 10 after
6889 // event target. Potentially a Pepper plugin will receive the event. 6895 // event target. Potentially a Pepper plugin will receive the event.
6890 // In order to tell whether a plugin gets the last mouse event and which it 6896 // In order to tell whether a plugin gets the last mouse event and which it
6891 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6897 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6892 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6898 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6893 // |pepper_last_mouse_event_target_|. 6899 // |pepper_last_mouse_event_target_|.
6894 pepper_last_mouse_event_target_ = nullptr; 6900 pepper_last_mouse_event_target_ = nullptr;
6895 #endif 6901 #endif
6896 } 6902 }
6897 6903
6898 } // namespace content 6904 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | extensions/common/feature_switch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698