[ServiceWorker] Plumbing the request credentials mode to the ServiceWorker. [2/2...
[chromium-blink-merge.git] / ipc / ipc_channel_factory.cc
blob4cb1790382462f250ba0cca3ed9fd836553f08e0
1 // Copyright 2014 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 #include "ipc/ipc_channel_factory.h"
7 namespace IPC {
9 namespace {
11 class PlatformChannelFactory : public ChannelFactory {
12 public:
13 PlatformChannelFactory(ChannelHandle handle,
14 Channel::Mode mode)
15 : handle_(handle), mode_(mode) {
18 virtual std::string GetName() const OVERRIDE {
19 return handle_.name;
22 virtual scoped_ptr<Channel> BuildChannel(
23 Listener* listener) OVERRIDE {
24 return Channel::Create(handle_, mode_, listener);
27 private:
28 ChannelHandle handle_;
29 Channel::Mode mode_;
31 DISALLOW_COPY_AND_ASSIGN(PlatformChannelFactory);
34 } // namespace
36 // static
37 scoped_ptr<ChannelFactory> ChannelFactory::Create(
38 const ChannelHandle& handle, Channel::Mode mode) {
39 return scoped_ptr<ChannelFactory>(new PlatformChannelFactory(handle, mode));
42 } // namespace IPC