Ensure low-memory renderers retry failed loads correctly.
[chromium-blink-merge.git] / components / webp_transcode / webp_network_client_factory.mm
blob4c8bd0f25e00353b6c6eb6b4ad32e1635ab2710f
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.
5 #import "components/webp_transcode/webp_network_client_factory.h"
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"
12 @interface WebPNetworkClientFactory () {
13   scoped_refptr<base::SequencedTaskRunner> _taskRunner;
15 @end
17 @implementation WebPNetworkClientFactory
19 - (instancetype)init {
20   NOTREACHED() << "Use |-initWithTaskRunner:| instead";
21   return nil;
24 - (Class)clientClass {
25   return [WebPNetworkClient class];
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;
37 - (CRNForwardingNetworkClient*)clientHandlingAnyRequest {
38   return
39       [[[WebPNetworkClient alloc] initWithTaskRunner:_taskRunner] autorelease];
42 @end