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

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

Issue 1624583003: Reload Lo-Fi images inline instead of reloading the whole page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding blink test Created 4 years, 10 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
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 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 bool handled = true; 1309 bool handled = true;
1310 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) 1310 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg)
1311 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) 1311 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate)
1312 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) 1312 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload)
1313 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) 1313 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut)
1314 IPC_MESSAGE_HANDLER(FrameMsg_Delete, OnDeleteFrame) 1314 IPC_MESSAGE_HANDLER(FrameMsg_Delete, OnDeleteFrame)
1315 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop) 1315 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop)
1316 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) 1316 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed)
1317 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, 1317 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction,
1318 OnCustomContextMenuAction) 1318 OnCustomContextMenuAction)
1319 IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages)
1319 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo) 1320 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo)
1320 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo) 1321 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo)
1321 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut) 1322 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut)
1322 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy) 1323 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy)
1323 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste) 1324 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste)
1324 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) 1325 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle)
1325 IPC_MESSAGE_HANDLER(InputMsg_Delete, OnDelete) 1326 IPC_MESSAGE_HANDLER(InputMsg_Delete, OnDelete)
1326 IPC_MESSAGE_HANDLER(InputMsg_SelectAll, OnSelectAll) 1327 IPC_MESSAGE_HANDLER(InputMsg_SelectAll, OnSelectAll)
1327 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange) 1328 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange)
1328 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset, 1329 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset,
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 ContextMenuClient* client = 1640 ContextMenuClient* client =
1640 pending_context_menus_.Lookup(custom_context.request_id); 1641 pending_context_menus_.Lookup(custom_context.request_id);
1641 if (client) 1642 if (client)
1642 client->OnMenuAction(custom_context.request_id, action); 1643 client->OnMenuAction(custom_context.request_id, action);
1643 } else { 1644 } else {
1644 // Internal request, forward to WebKit. 1645 // Internal request, forward to WebKit.
1645 render_view_->webview()->performCustomContextMenuAction(action); 1646 render_view_->webview()->performCustomContextMenuAction(action);
1646 } 1647 }
1647 } 1648 }
1648 1649
1650 void RenderFrameImpl::OnReloadLoFiImages() {
1651 is_using_lofi_ = false;
Charlie Reis 2016/01/29 23:01:12 This line is surprising to me, since this CL isn't
megjablon 2016/01/29 23:22:23 There is no other state to update. This is the onl
Charlie Reis 2016/01/29 23:52:00 As in web_contents.h, a comment (perhaps in frame_
1652 GetWebFrame()->reloadLoFiImages();
1653 }
1654
1649 void RenderFrameImpl::OnUndo() { 1655 void RenderFrameImpl::OnUndo() {
1650 frame_->executeCommand(WebString::fromUTF8("Undo"), GetFocusedElement()); 1656 frame_->executeCommand(WebString::fromUTF8("Undo"), GetFocusedElement());
1651 } 1657 }
1652 1658
1653 void RenderFrameImpl::OnRedo() { 1659 void RenderFrameImpl::OnRedo() {
1654 frame_->executeCommand(WebString::fromUTF8("Redo"), GetFocusedElement()); 1660 frame_->executeCommand(WebString::fromUTF8("Redo"), GetFocusedElement());
1655 } 1661 }
1656 1662
1657 void RenderFrameImpl::OnCut() { 1663 void RenderFrameImpl::OnCut() {
1658 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); 1664 base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after
3078 TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad", 3084 TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad",
3079 "id", routing_id_, 3085 "id", routing_id_,
3080 "url", GetLoadingUrl().possibly_invalid_spec()); 3086 "url", GetLoadingUrl().possibly_invalid_spec());
3081 DCHECK(!frame_ || frame_ == frame); 3087 DCHECK(!frame_ || frame_ == frame);
3082 DocumentState* document_state = 3088 DocumentState* document_state =
3083 DocumentState::FromDataSource(frame->dataSource()); 3089 DocumentState::FromDataSource(frame->dataSource());
3084 NavigationStateImpl* navigation_state = 3090 NavigationStateImpl* navigation_state =
3085 static_cast<NavigationStateImpl*>(document_state->navigation_state()); 3091 static_cast<NavigationStateImpl*>(document_state->navigation_state());
3086 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse( 3092 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(
3087 frame->dataSource()->response()); 3093 frame->dataSource()->response());
3088 is_using_lofi_ = extra_data && extra_data->is_using_lofi(); 3094 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) {
Charlie Reis 2016/01/29 23:01:12 This looks unrelated to the rest of the CL, and it
megjablon 2016/01/29 23:22:23 The initial intention was this behavior. Children
Charlie Reis 2016/01/29 23:52:00 Sorry, I'm not following. If I understand correct
megjablon 2016/01/30 08:30:09 The first paragraph you're describing is the only
Charlie Reis 2016/02/01 22:12:00 Ok, thanks. I'd recommend adding a test for that
megjablon 2016/02/04 02:37:26 Done.
3095 is_using_lofi_ = extra_data && extra_data->is_using_lofi();
3096 }
3089 3097
3090 if (proxy_routing_id_ != MSG_ROUTING_NONE) { 3098 if (proxy_routing_id_ != MSG_ROUTING_NONE) {
3091 RenderFrameProxy* proxy = 3099 RenderFrameProxy* proxy =
3092 RenderFrameProxy::FromRoutingID(proxy_routing_id_); 3100 RenderFrameProxy::FromRoutingID(proxy_routing_id_);
3093 3101
3094 // The proxy might have been detached while the provisional LocalFrame was 3102 // The proxy might have been detached while the provisional LocalFrame was
3095 // being navigated. In that case, don't swap the frame back in the tree 3103 // being navigated. In that case, don't swap the frame back in the tree
3096 // and return early (to avoid sending confusing IPCs to the browser 3104 // and return early (to avoid sending confusing IPCs to the browser
3097 // process). See https://crbug.com/526304 and https://crbug.com/568676. 3105 // process). See https://crbug.com/526304 and https://crbug.com/568676.
3098 // TODO(nasko, alexmos): Eventually, the browser process will send an IPC 3106 // TODO(nasko, alexmos): Eventually, the browser process will send an IPC
(...skipping 2942 matching lines...) Expand 10 before | Expand all | Expand 10 after
6041 int match_count, 6049 int match_count,
6042 int ordinal, 6050 int ordinal,
6043 const WebRect& selection_rect, 6051 const WebRect& selection_rect,
6044 bool final_status_update) { 6052 bool final_status_update) {
6045 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6053 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6046 selection_rect, ordinal, 6054 selection_rect, ordinal,
6047 final_status_update)); 6055 final_status_update));
6048 } 6056 }
6049 6057
6050 } // namespace content 6058 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698