Changeset 158958 in webkit
- Timestamp:
- Nov 8, 2013 2:42:27 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r158956 r158958 1 2013-11-08 Sam Weinig <sam@webkit.org> 2 3 Modernize FrameLoader a bit 4 https://bugs.webkit.org/show_bug.cgi?id=124073 5 6 Reviewed by Anders Carlsson. 7 8 * loader/FrameLoader.cpp: 9 * loader/FrameLoader.h: 10 Use std::unique_ptrs rather than OwnPtrs. 11 12 * loader/MixedContentChecker.cpp: 13 * loader/MixedContentChecker.h: 14 Switch to hold a Frame& rather than Frame*. 15 1 16 2013-11-08 Zan Dobersek <zdobersek@igalia.com> 2 17 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r158867 r158958 177 177 class FrameLoader::FrameProgressTracker { 178 178 public: 179 static PassOwnPtr<FrameProgressTracker> create(Frame& frame) { return adoptPtr(new FrameProgressTracker(frame)); } 179 explicit FrameProgressTracker(Frame& frame) 180 : m_frame(frame) 181 , m_inProgress(false) 182 { 183 } 184 180 185 ~FrameProgressTracker() 181 186 { … … 202 207 203 208 private: 204 FrameProgressTracker(Frame& frame)205 : m_frame(frame)206 , m_inProgress(false)207 {208 }209 210 209 Frame& m_frame; 211 210 bool m_inProgress; … … 215 214 : m_frame(frame) 216 215 , m_client(client) 217 , m_policyChecker( adoptPtr(new PolicyChecker(frame)))218 , m_history( adoptPtr(new HistoryController(frame)))216 , m_policyChecker(std::make_unique<PolicyChecker>(frame)) 217 , m_history(std::make_unique<HistoryController>(frame)) 219 218 , m_notifier(frame) 220 , m_subframeLoader( adoptPtr(new SubframeLoader(frame)))221 , m_icon( adoptPtr(new IconController(frame)))222 , m_mixedContentChecker( &frame)219 , m_subframeLoader(std::make_unique<SubframeLoader>(frame)) 220 , m_icon(std::make_unique<IconController>(frame)) 221 , m_mixedContentChecker(frame) 223 222 , m_state(FrameStateProvisional) 224 223 , m_loadType(FrameLoadTypeStandard) … … 236 235 , m_shouldCallCheckCompleted(false) 237 236 , m_shouldCallCheckLoadComplete(false) 238 , m_opener( 0)237 , m_opener(nullptr) 239 238 , m_didPerformFirstNavigation(false) 240 239 , m_loadingFromCachedPage(false) … … 247 246 FrameLoader::~FrameLoader() 248 247 { 249 setOpener( 0);248 setOpener(nullptr); 250 249 251 250 HashSet<Frame*>::iterator end = m_openedFrames.end(); … … 269 268 270 269 m_networkingContext = m_client.createNetworkingContext(); 271 m_progressTracker = FrameProgressTracker::create(m_frame);270 m_progressTracker = std::make_unique<FrameProgressTracker>(m_frame); 272 271 } 273 272 … … 2415 2414 detachViewsAndDocumentLoader(); 2416 2415 2417 m_progressTracker .clear();2416 m_progressTracker = nullptr; 2418 2417 2419 2418 if (Frame* parent = m_frame.tree().parent()) { -
trunk/Source/WebCore/loader/FrameLoader.h
r157007 r158958 383 383 FrameLoaderClient& m_client; 384 384 385 // FIXME: These should be OwnPtr<T> to reduce build times and simplify 386 // header dependencies unless performance testing proves otherwise. 387 // Some of these could be lazily created for memory savings on devices. 388 const OwnPtr<PolicyChecker> m_policyChecker; 389 const OwnPtr<HistoryController> m_history; 385 const std::unique_ptr<PolicyChecker> m_policyChecker; 386 const std::unique_ptr<HistoryController> m_history; 390 387 mutable ResourceLoadNotifier m_notifier; 391 const OwnPtr<SubframeLoader> m_subframeLoader;388 const std::unique_ptr<SubframeLoader> m_subframeLoader; 392 389 mutable FrameLoaderStateMachine m_stateMachine; 393 const OwnPtr<IconController> m_icon;390 const std::unique_ptr<IconController> m_icon; 394 391 mutable MixedContentChecker m_mixedContentChecker; 395 392 396 393 class FrameProgressTracker; 397 OwnPtr<FrameProgressTracker> m_progressTracker;394 std::unique_ptr<FrameProgressTracker> m_progressTracker; 398 395 399 396 FrameState m_state; -
trunk/Source/WebCore/loader/MixedContentChecker.cpp
r156550 r158958 44 44 namespace WebCore { 45 45 46 MixedContentChecker::MixedContentChecker(Frame *frame)46 MixedContentChecker::MixedContentChecker(Frame& frame) 47 47 : m_frame(frame) 48 48 { … … 51 51 FrameLoaderClient& MixedContentChecker::client() const 52 52 { 53 return m_frame ->loader().client();53 return m_frame.loader().client(); 54 54 } 55 55 … … 69 69 return true; 70 70 71 bool allowed = client().allowDisplayingInsecureContent(m_frame ->settings().allowDisplayOfInsecureContent(), securityOrigin, url);71 bool allowed = client().allowDisplayingInsecureContent(m_frame.settings().allowDisplayOfInsecureContent(), securityOrigin, url); 72 72 logWarning(allowed, "displayed", url); 73 73 … … 83 83 return true; 84 84 85 bool allowed = client().allowRunningInsecureContent(m_frame ->settings().allowRunningOfInsecureContent(), securityOrigin, url);85 bool allowed = client().allowRunningInsecureContent(m_frame.settings().allowRunningOfInsecureContent(), securityOrigin, url); 86 86 logWarning(allowed, "ran", url); 87 87 … … 94 94 void MixedContentChecker::logWarning(bool allowed, const String& action, const URL& target) const 95 95 { 96 String message = makeString((allowed ? "" : "[blocked] "), "The page at ", m_frame ->document()->url().stringCenterEllipsizedToLength(), " ", action, " insecure content from ", target.stringCenterEllipsizedToLength(), ".\n");97 m_frame ->document()->addConsoleMessage(SecurityMessageSource, WarningMessageLevel, message);96 String message = makeString((allowed ? "" : "[blocked] "), "The page at ", m_frame.document()->url().stringCenterEllipsizedToLength(), " ", action, " insecure content from ", target.stringCenterEllipsizedToLength(), ".\n"); 97 m_frame.document()->addConsoleMessage(SecurityMessageSource, WarningMessageLevel, message); 98 98 } 99 99 -
trunk/Source/WebCore/loader/MixedContentChecker.h
r156550 r158958 45 45 WTF_MAKE_NONCOPYABLE(MixedContentChecker); 46 46 public: 47 MixedContentChecker(Frame *);47 MixedContentChecker(Frame&); 48 48 49 49 bool canDisplayInsecureContent(SecurityOrigin*, const URL&) const; … … 57 57 void logWarning(bool allowed, const String& action, const URL&) const; 58 58 59 Frame *m_frame;59 Frame& m_frame; 60 60 }; 61 61
Note: See TracChangeset
for help on using the changeset viewer.