From dd3ca81589d1cc990e3bbb951853d6c85a1a9ac1 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 8 Jan 2016 12:56:42 -0800 Subject: [PATCH] [core] Inline sole use of OnlineFileSource::Impl::update --- platform/default/online_file_source.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/platform/default/online_file_source.cpp b/platform/default/online_file_source.cpp index 03de4f2db..6a65bb44e 100644 --- a/platform/default/online_file_source.cpp +++ b/platform/default/online_file_source.cpp @@ -104,7 +104,6 @@ public: void cancel(Resource, FileRequest*); private: - void update(OnlineFileRequestImpl&); void startCacheRequest(OnlineFileRequestImpl&); void startRealRequest(OnlineFileRequestImpl&); void reschedule(OnlineFileRequestImpl&); @@ -199,15 +198,6 @@ void OnlineFileSource::Impl::add(Resource resource, FileRequest* req, Callback c auto& request = *pending.emplace(resource, std::make_unique(resource)).first->second; - // Trigger a potentially required refresh of this Request - update(request); - - // Add this request as an observer so that it'll get notified when something about this - // request changes. - request.addObserver(req, callback); -} - -void OnlineFileSource::Impl::update(OnlineFileRequestImpl& request) { if (request.getResponse()) { // We've at least obtained a cache value, potentially we also got a final response. // The observers have been notified already; send what we have to the new one as well. @@ -237,6 +227,10 @@ void OnlineFileSource::Impl::update(OnlineFileRequestImpl& request) { } else { // There is a request in progress. We just have to wait. } + + // Add this request as an observer so that it'll get notified when something about this + // request changes. + request.addObserver(req, callback); } void OnlineFileSource::Impl::startCacheRequest(OnlineFileRequestImpl& request) {