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

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

Issue 2583123002: Reload: FrameMsg_Navigate_Type cleanup to rename RELOAD_MAIN_RESOURCE (Closed)
Patch Set: replace logic update Created 3 years, 11 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/common/frame_message_enums.h ('k') | no next file » | 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 media::Context3D GetSharedMainThreadContext3D( 648 media::Context3D GetSharedMainThreadContext3D(
649 scoped_refptr<ui::ContextProviderCommandBuffer> provider) { 649 scoped_refptr<ui::ContextProviderCommandBuffer> provider) {
650 if (!provider) 650 if (!provider)
651 return media::Context3D(); 651 return media::Context3D();
652 return media::Context3D(provider->ContextGL(), provider->GrContext()); 652 return media::Context3D(provider->ContextGL(), provider->GrContext());
653 } 653 }
654 654
655 bool IsReload(FrameMsg_Navigate_Type::Value navigation_type) { 655 bool IsReload(FrameMsg_Navigate_Type::Value navigation_type) {
656 switch (navigation_type) { 656 switch (navigation_type) {
657 case FrameMsg_Navigate_Type::RELOAD: 657 case FrameMsg_Navigate_Type::RELOAD:
658 case FrameMsg_Navigate_Type::RELOAD_MAIN_RESOURCE:
659 case FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE: 658 case FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE:
660 case FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL: 659 case FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL:
661 return true; 660 return true;
662 case FrameMsg_Navigate_Type::RESTORE: 661 case FrameMsg_Navigate_Type::RESTORE:
663 case FrameMsg_Navigate_Type::RESTORE_WITH_POST: 662 case FrameMsg_Navigate_Type::RESTORE_WITH_POST:
664 case FrameMsg_Navigate_Type::NORMAL: 663 case FrameMsg_Navigate_Type::NORMAL:
665 return false; 664 return false;
666 } 665 }
667 NOTREACHED(); 666 NOTREACHED();
668 return false; 667 return false;
669 } 668 }
670 669
671 WebFrameLoadType ReloadFrameLoadTypeFor( 670 WebFrameLoadType ReloadFrameLoadTypeFor(
672 FrameMsg_Navigate_Type::Value navigation_type) { 671 FrameMsg_Navigate_Type::Value navigation_type) {
673 switch (navigation_type) { 672 switch (navigation_type) {
674 case FrameMsg_Navigate_Type::RELOAD: 673 case FrameMsg_Navigate_Type::RELOAD:
675 case FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL: 674 case FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL:
676 return WebFrameLoadType::Reload;
677 case FrameMsg_Navigate_Type::RELOAD_MAIN_RESOURCE:
678 return WebFrameLoadType::ReloadMainResource; 675 return WebFrameLoadType::ReloadMainResource;
679 case FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE: 676 case FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE:
680 return WebFrameLoadType::ReloadBypassingCache; 677 return WebFrameLoadType::ReloadBypassingCache;
681 case FrameMsg_Navigate_Type::RESTORE: 678 case FrameMsg_Navigate_Type::RESTORE:
682 case FrameMsg_Navigate_Type::RESTORE_WITH_POST: 679 case FrameMsg_Navigate_Type::RESTORE_WITH_POST:
683 case FrameMsg_Navigate_Type::NORMAL: 680 case FrameMsg_Navigate_Type::NORMAL:
684 NOTREACHED(); 681 NOTREACHED();
685 return WebFrameLoadType::Standard; 682 return WebFrameLoadType::Standard;
686 } 683 }
687 NOTREACHED(); 684 NOTREACHED();
(...skipping 5577 matching lines...) Expand 10 before | Expand all | Expand 10 after
6265 if (!data_url.is_valid() || !data_url.SchemeIs(url::kDataScheme)) { 6262 if (!data_url.is_valid() || !data_url.SchemeIs(url::kDataScheme)) {
6266 data_url = params.url; 6263 data_url = params.url;
6267 } 6264 }
6268 } 6265 }
6269 #endif 6266 #endif
6270 std::string mime_type, charset, data; 6267 std::string mime_type, charset, data;
6271 if (net::DataURL::Parse(data_url, &mime_type, &charset, &data)) { 6268 if (net::DataURL::Parse(data_url, &mime_type, &charset, &data)) {
6272 const GURL base_url = params.base_url_for_data_url.is_empty() ? 6269 const GURL base_url = params.base_url_for_data_url.is_empty() ?
6273 params.url : params.base_url_for_data_url; 6270 params.url : params.base_url_for_data_url;
6274 bool replace = load_type == WebFrameLoadType::ReloadBypassingCache || 6271 bool replace = load_type == WebFrameLoadType::ReloadBypassingCache ||
6272 load_type == WebFrameLoadType::ReloadMainResource ||
6275 load_type == WebFrameLoadType::Reload; 6273 load_type == WebFrameLoadType::Reload;
6276 6274
6277 frame->loadData( 6275 frame->loadData(
6278 WebData(data.c_str(), data.length()), WebString::fromUTF8(mime_type), 6276 WebData(data.c_str(), data.length()), WebString::fromUTF8(mime_type),
6279 WebString::fromUTF8(charset), base_url, 6277 WebString::fromUTF8(charset), base_url,
6280 // Needed so that history-url-only changes don't become reloads. 6278 // Needed so that history-url-only changes don't become reloads.
6281 params.history_url_for_data_url, replace, load_type, 6279 params.history_url_for_data_url, replace, load_type,
6282 item_for_history_navigation, history_load_type, is_client_redirect); 6280 item_for_history_navigation, history_load_type, is_client_redirect);
6283 } else { 6281 } else {
6284 CHECK(false) << "Invalid URL passed: " 6282 CHECK(false) << "Invalid URL passed: "
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
6795 // event target. Potentially a Pepper plugin will receive the event. 6793 // event target. Potentially a Pepper plugin will receive the event.
6796 // In order to tell whether a plugin gets the last mouse event and which it 6794 // In order to tell whether a plugin gets the last mouse event and which it
6797 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6795 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6798 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6796 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6799 // |pepper_last_mouse_event_target_|. 6797 // |pepper_last_mouse_event_target_|.
6800 pepper_last_mouse_event_target_ = nullptr; 6798 pepper_last_mouse_event_target_ = nullptr;
6801 #endif 6799 #endif
6802 } 6800 }
6803 6801
6804 } // namespace content 6802 } // namespace content
OLDNEW
« no previous file with comments | « content/common/frame_message_enums.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698