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

Unified Diff: extensions/browser/extension_url_request_context_getter.cc

Issue 615583003: Introduce NetworkDelegate's implementation in extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: extensions/browser/extension_url_request_context_getter.cc
diff --git a/cc/resources/single_release_callback.cc b/extensions/browser/extension_url_request_context_getter.cc
similarity index 20%
copy from cc/resources/single_release_callback.cc
copy to extensions/browser/extension_url_request_context_getter.cc
index 4565963a59fdb8aa7ec0db0707930b17b95a0d69..aa548f447aaf7e1a23fb44c840d6447710706762 100644
--- a/cc/resources/single_release_callback.cc
+++ b/extensions/browser/extension_url_request_context_getter.cc
@@ -2,28 +2,37 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "cc/resources/single_release_callback.h"
+#include "extensions/browser/extension_url_request_context_getter.h"
-#include "base/callback_helpers.h"
-#include "base/logging.h"
+#include "content/public/browser/resource_request_info.h"
+#include "extensions/browser/extension_network_delegate.h"
-namespace cc {
+namespace extensions {
-SingleReleaseCallback::SingleReleaseCallback(const ReleaseCallback& callback)
- : has_been_run_(false), callback_(callback) {
- DCHECK(!callback_.is_null())
- << "Use a NULL SingleReleaseCallback for an empty callback.";
+ExtensionURLRequestContextGetter::ExtensionURLRequestContextGetter(
+ bool ignore_certificate_errors,
+ const base::FilePath& base_path,
+ base::MessageLoop* io_loop,
+ base::MessageLoop* file_loop,
+ content::ProtocolHandlerMap* protocol_handlers,
+ content::URLRequestInterceptorScopedVector request_interceptors,
+ net::NetLog* net_log)
+ : ShellURLRequestContextGetter(
+ ignore_certificate_errors,
+ base_path,
+ io_loop,
+ file_loop,
+ protocol_handlers,
+ request_interceptors.Pass(),
+ net_log) {
}
-SingleReleaseCallback::~SingleReleaseCallback() {
- DCHECK(callback_.is_null() || has_been_run_)
- << "SingleReleaseCallback was never run.";
+ExtensionURLRequestContextGetter::~ExtensionURLRequestContextGetter() {
}
-void SingleReleaseCallback::Run(uint32 sync_point, bool is_lost) {
- DCHECK(!has_been_run_) << "SingleReleaseCallback was run more than once.";
- has_been_run_ = true;
- callback_.Run(sync_point, is_lost);
+net::NetworkDelegate*
+ExtensionURLRequestContextGetter::CreateNetworkDelegate() {
+ return new ExtensionNetworkDelegate();
}
-} // namespace cc
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698