OLD | NEW |
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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 const blink::WebURL& url) { | 1076 const blink::WebURL& url) { |
1077 return GetContentClient()->renderer()->OverrideFlashEmbedWithHTML(url); | 1077 return GetContentClient()->renderer()->OverrideFlashEmbedWithHTML(url); |
1078 } | 1078 } |
1079 | 1079 |
1080 // RenderFrameImpl ---------------------------------------------------------- | 1080 // RenderFrameImpl ---------------------------------------------------------- |
1081 RenderFrameImpl::RenderFrameImpl(const CreateParams& params) | 1081 RenderFrameImpl::RenderFrameImpl(const CreateParams& params) |
1082 : frame_(NULL), | 1082 : frame_(NULL), |
1083 is_main_frame_(true), | 1083 is_main_frame_(true), |
1084 in_browser_initiated_detach_(false), | 1084 in_browser_initiated_detach_(false), |
1085 in_frame_tree_(false), | 1085 in_frame_tree_(false), |
1086 render_view_(params.render_view->AsWeakPtr()), | 1086 render_view_(params.render_view), |
1087 routing_id_(params.routing_id), | 1087 routing_id_(params.routing_id), |
1088 proxy_routing_id_(MSG_ROUTING_NONE), | 1088 proxy_routing_id_(MSG_ROUTING_NONE), |
1089 #if defined(ENABLE_PLUGINS) | 1089 #if defined(ENABLE_PLUGINS) |
1090 plugin_power_saver_helper_(nullptr), | 1090 plugin_power_saver_helper_(nullptr), |
1091 plugin_find_handler_(nullptr), | 1091 plugin_find_handler_(nullptr), |
1092 #endif | 1092 #endif |
1093 cookie_jar_(this), | 1093 cookie_jar_(this), |
1094 selection_text_offset_(0), | 1094 selection_text_offset_(0), |
1095 selection_range_(gfx::Range::InvalidRange()), | 1095 selection_range_(gfx::Range::InvalidRange()), |
1096 handling_select_range_(false), | 1096 handling_select_range_(false), |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 // Synchronously run the unload handler before sending the ACK. | 1728 // Synchronously run the unload handler before sending the ACK. |
1729 // TODO(creis): Call dispatchUnloadEvent unconditionally here to support | 1729 // TODO(creis): Call dispatchUnloadEvent unconditionally here to support |
1730 // unload on subframes as well. | 1730 // unload on subframes as well. |
1731 if (is_main_frame_) | 1731 if (is_main_frame_) |
1732 frame_->dispatchUnloadEvent(); | 1732 frame_->dispatchUnloadEvent(); |
1733 | 1733 |
1734 // Swap out and stop sending any IPC messages that are not ACKs. | 1734 // Swap out and stop sending any IPC messages that are not ACKs. |
1735 if (is_main_frame_) | 1735 if (is_main_frame_) |
1736 render_view_->SetSwappedOut(true); | 1736 render_view_->SetSwappedOut(true); |
1737 | 1737 |
1738 RenderViewImpl* render_view = render_view_.get(); | 1738 RenderViewImpl* render_view = render_view_; |
1739 bool is_main_frame = is_main_frame_; | 1739 bool is_main_frame = is_main_frame_; |
1740 int routing_id = GetRoutingID(); | 1740 int routing_id = GetRoutingID(); |
1741 | 1741 |
1742 // Now that all of the cleanup is complete and the browser side is notified, | 1742 // Now that all of the cleanup is complete and the browser side is notified, |
1743 // start using the RenderFrameProxy. | 1743 // start using the RenderFrameProxy. |
1744 // | 1744 // |
1745 // The swap call deletes this RenderFrame via frameDetached. Do not access | 1745 // The swap call deletes this RenderFrame via frameDetached. Do not access |
1746 // any members after this call. | 1746 // any members after this call. |
1747 // | 1747 // |
1748 // TODO(creis): WebFrame::swap() can return false. Most of those cases | 1748 // TODO(creis): WebFrame::swap() can return false. Most of those cases |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2407 // similar precautions. | 2407 // similar precautions. |
2408 PepperPluginSet plugins = active_pepper_instances_; | 2408 PepperPluginSet plugins = active_pepper_instances_; |
2409 for (auto* plugin : plugins) { | 2409 for (auto* plugin : plugins) { |
2410 if (active_pepper_instances_.find(plugin) != active_pepper_instances_.end()) | 2410 if (active_pepper_instances_.find(plugin) != active_pepper_instances_.end()) |
2411 plugin->ViewInitiatedPaint(); | 2411 plugin->ViewInitiatedPaint(); |
2412 } | 2412 } |
2413 #endif | 2413 #endif |
2414 } | 2414 } |
2415 | 2415 |
2416 RenderView* RenderFrameImpl::GetRenderView() { | 2416 RenderView* RenderFrameImpl::GetRenderView() { |
2417 return render_view_.get(); | 2417 return render_view_; |
2418 } | 2418 } |
2419 | 2419 |
2420 RenderAccessibility* RenderFrameImpl::GetRenderAccessibility() { | 2420 RenderAccessibility* RenderFrameImpl::GetRenderAccessibility() { |
2421 return render_accessibility_; | 2421 return render_accessibility_; |
2422 } | 2422 } |
2423 | 2423 |
2424 int RenderFrameImpl::GetRoutingID() { | 2424 int RenderFrameImpl::GetRoutingID() { |
2425 return routing_id_; | 2425 return routing_id_; |
2426 } | 2426 } |
2427 | 2427 |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2981 | 2981 |
2982 // This method is always called by local frames, never remote frames. | 2982 // This method is always called by local frames, never remote frames. |
2983 | 2983 |
2984 // Tracing analysis uses this to find main frames when this value is | 2984 // Tracing analysis uses this to find main frames when this value is |
2985 // MSG_ROUTING_NONE, and build the frame tree otherwise. | 2985 // MSG_ROUTING_NONE, and build the frame tree otherwise. |
2986 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::createChildFrame", | 2986 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::createChildFrame", |
2987 "id", routing_id_, | 2987 "id", routing_id_, |
2988 "child", child_routing_id); | 2988 "child", child_routing_id); |
2989 | 2989 |
2990 // Create the RenderFrame and WebLocalFrame, linking the two. | 2990 // Create the RenderFrame and WebLocalFrame, linking the two. |
2991 RenderFrameImpl* child_render_frame = RenderFrameImpl::Create( | 2991 RenderFrameImpl* child_render_frame = |
2992 render_view_.get(), child_routing_id); | 2992 RenderFrameImpl::Create(render_view_, child_routing_id); |
2993 child_render_frame->InitializeBlameContext(this); | 2993 child_render_frame->InitializeBlameContext(this); |
2994 blink::WebLocalFrame* web_frame = | 2994 blink::WebLocalFrame* web_frame = |
2995 WebLocalFrame::create(scope, child_render_frame); | 2995 WebLocalFrame::create(scope, child_render_frame); |
2996 child_render_frame->BindToWebFrame(web_frame); | 2996 child_render_frame->BindToWebFrame(web_frame); |
2997 | 2997 |
2998 // Add the frame to the frame tree and initialize it. | 2998 // Add the frame to the frame tree and initialize it. |
2999 parent->appendChild(web_frame); | 2999 parent->appendChild(web_frame); |
3000 child_render_frame->in_frame_tree_ = true; | 3000 child_render_frame->in_frame_tree_ = true; |
3001 child_render_frame->Initialize(); | 3001 child_render_frame->Initialize(); |
3002 | 3002 |
(...skipping 3626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6629 // event target. Potentially a Pepper plugin will receive the event. | 6629 // event target. Potentially a Pepper plugin will receive the event. |
6630 // In order to tell whether a plugin gets the last mouse event and which it | 6630 // In order to tell whether a plugin gets the last mouse event and which it |
6631 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6631 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6632 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6632 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6633 // |pepper_last_mouse_event_target_|. | 6633 // |pepper_last_mouse_event_target_|. |
6634 pepper_last_mouse_event_target_ = nullptr; | 6634 pepper_last_mouse_event_target_ = nullptr; |
6635 #endif | 6635 #endif |
6636 } | 6636 } |
6637 | 6637 |
6638 } // namespace content | 6638 } // namespace content |
OLD | NEW |