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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 1418003006: Simplify starting a navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enum-ify Created 5 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 302
303 bool FrameFetchContext::shouldLoadNewResource(Resource::Type type) const 303 bool FrameFetchContext::shouldLoadNewResource(Resource::Type type) const
304 { 304 {
305 if (!m_documentLoader) 305 if (!m_documentLoader)
306 return true; 306 return true;
307 if (type == Resource::MainResource) 307 if (type == Resource::MainResource)
308 return m_documentLoader == frame()->loader().provisionalDocumentLoader() ; 308 return m_documentLoader == frame()->loader().provisionalDocumentLoader() ;
309 return m_documentLoader == frame()->loader().documentLoader(); 309 return m_documentLoader == frame()->loader().documentLoader();
310 } 310 }
311 311
312 void FrameFetchContext::willStartLoadingResource(ResourceRequest& request) 312 void FrameFetchContext::willStartLoadingResource(ResourceRequest& request, Fetch ResourceType type)
313 { 313 {
314 if (m_documentLoader) 314 if (!m_documentLoader)
315 m_documentLoader->applicationCacheHost()->willStartLoadingResource(reque st); 315 return;
316 if (type == FetchMainResource)
317 m_documentLoader->applicationCacheHost()->willStartLoadingMainResource(r equest);
318 m_documentLoader->applicationCacheHost()->willStartLoadingResource(request);
316 } 319 }
317 320
318 void FrameFetchContext::didLoadResource() 321 void FrameFetchContext::didLoadResource()
319 { 322 {
320 frame()->loader().checkCompleted(); 323 frame()->loader().checkCompleted();
321 } 324 }
322 325
323 void FrameFetchContext::addResourceTiming(const ResourceTimingInfo& info) 326 void FrameFetchContext::addResourceTiming(const ResourceTimingInfo& info)
324 { 327 {
325 Document* initiatorDocument = m_document && info.isMainResource() ? m_docume nt->parentDocument() : m_document.get(); 328 Document* initiatorDocument = m_document && info.isMainResource() ? m_docume nt->parentDocument() : m_document.get();
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 } 745 }
743 746
744 DEFINE_TRACE(FrameFetchContext) 747 DEFINE_TRACE(FrameFetchContext)
745 { 748 {
746 visitor->trace(m_document); 749 visitor->trace(m_document);
747 visitor->trace(m_documentLoader); 750 visitor->trace(m_documentLoader);
748 FetchContext::trace(visitor); 751 FetchContext::trace(visitor);
749 } 752 }
750 753
751 } // namespace blink 754 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698