| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "components/webp_transcode/webp_network_client_factory.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "base/sequenced_task_runner.h" |
| 9 #include "base/single_thread_task_runner.h" |
| 10 #import "components/webp_transcode/webp_network_client.h" |
| 11 |
| 12 @interface WebPNetworkClientFactory () { |
| 13 scoped_refptr<base::SequencedTaskRunner> _taskRunner; |
| 14 } |
| 15 @end |
| 16 |
| 17 @implementation WebPNetworkClientFactory |
| 18 |
| 19 - (instancetype)init { |
| 20 NOTREACHED() << "Use |-initWithTaskRunner:| instead"; |
| 21 return nil; |
| 22 } |
| 23 |
| 24 - (Class)clientClass { |
| 25 return [WebPNetworkClient class]; |
| 26 } |
| 27 |
| 28 - (instancetype)initWithTaskRunner: |
| 29 (const scoped_refptr<base::SequencedTaskRunner>&)runner { |
| 30 if ((self = [super init])) { |
| 31 DCHECK(runner); |
| 32 _taskRunner = runner; |
| 33 } |
| 34 return self; |
| 35 } |
| 36 |
| 37 - (CRNForwardingNetworkClient*)clientHandlingAnyRequest { |
| 38 return |
| 39 [[[WebPNetworkClient alloc] initWithTaskRunner:_taskRunner] autorelease]; |
| 40 } |
| 41 |
| 42 @end |
| OLD | NEW |