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

Unified Diff: ios/net/clients/crn_simple_network_client_factory.mm

Issue 994823004: [iOS] Upstream //ios/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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: ios/net/clients/crn_simple_network_client_factory.mm
diff --git a/ios/net/clients/crn_simple_network_client_factory.mm b/ios/net/clients/crn_simple_network_client_factory.mm
new file mode 100644
index 0000000000000000000000000000000000000000..9ffd9d255b69b798cdd2c87da6bdad53bfae8984
--- /dev/null
+++ b/ios/net/clients/crn_simple_network_client_factory.mm
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/net/clients/crn_simple_network_client_factory.h"
+
+#include "base/logging.h"
+#include "base/mac/scoped_nsobject.h"
+#import "ios/net/clients/crn_forwarding_network_client.h"
+
+@interface CRNSimpleNetworkClientFactory () {
+ base::scoped_nsprotocol<Class> _clientClass;
+}
+@end
+
+@implementation CRNSimpleNetworkClientFactory
+
+- (instancetype)initWithClass:(Class)clientClass {
+ if (self = [super init]) {
+ DCHECK([clientClass isSubclassOfClass:[CRNForwardingNetworkClient class]]);
+ _clientClass.reset([clientClass retain]);
+ }
+ return self;
+}
+
+- (CRNForwardingNetworkClient*)clientHandlingAnyRequest {
+ return [[[_clientClass alloc] init] autorelease];
+}
+
+- (Class)clientClass {
+ return _clientClass;
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698