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

Unified Diff: net/url_request/sdch_dictionary_fetcher.cc

Issue 664263002: Restructure SDCH layering to allow more separation (observer/1->[0,n] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync'd to p300953. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/sdch_dictionary_fetcher.cc
diff --git a/net/base/sdch_dictionary_fetcher.cc b/net/url_request/sdch_dictionary_fetcher.cc
similarity index 96%
rename from net/base/sdch_dictionary_fetcher.cc
rename to net/url_request/sdch_dictionary_fetcher.cc
index 8d08b9a678afabacd828ee0b8efb70989362fabf..c2ae47967a74b45c85e7deb84c7354d7766d1de1 100644
--- a/net/base/sdch_dictionary_fetcher.cc
+++ b/net/url_request/sdch_dictionary_fetcher.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/base/sdch_dictionary_fetcher.h"
+#include "net/url_request/sdch_dictionary_fetcher.h"
#include <stdint.h>
@@ -24,15 +24,13 @@ const int kBufferSize = 4096;
namespace net {
SdchDictionaryFetcher::SdchDictionaryFetcher(
- SdchFetcher::Delegate* consumer,
- URLRequestContext* context)
+ URLRequestContext* context, const OnDictionaryFetchedCallback& callback)
: next_state_(STATE_NONE),
in_loop_(false),
- consumer_(consumer),
context_(context),
+ dictionary_fetched_callback_(callback),
weak_factory_(this) {
DCHECK(CalledOnValidThread());
- DCHECK(consumer);
DCHECK(context);
}
@@ -230,7 +228,7 @@ int SdchDictionaryFetcher::DoCompleteRequest(int rv) {
// If the dictionary was successfully fetched, add it to the manager.
if (rv == OK)
- consumer_->AddSdchDictionary(dictionary_, current_request_->url());
+ dictionary_fetched_callback_.Run(dictionary_, current_request_->url());
current_request_.reset();
buffer_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698