context.cc revision f2477e01787aa58f445919b809d89e252beef54f
11e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
21e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
31e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// found in the LICENSE file.
41e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
51e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "mojo/shell/context.h"
61e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
71e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "mojo/shell/network_delegate.h"
81e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "mojo/system/core_impl.h"
91e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
101e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)namespace mojo {
111e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)namespace shell {
121e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
131e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)Context::Context()
141e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)    : task_runners_(base::MessageLoop::current()->message_loop_proxy()),
151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)      storage_(),
161e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)      loader_(task_runners_.io_runner(),
171e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)              task_runners_.file_runner(),
18f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)              task_runners_.cache_runner(),
191e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)              scoped_ptr<net::NetworkDelegate>(new NetworkDelegate()),
201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)              storage_.profile_path()) {
211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  system::CoreImpl::Init();
22f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  BindingsSupport::Set(&bindings_support_impl_);
231e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)}
241e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)Context::~Context() {
26f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  BindingsSupport::Set(NULL);
271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)}
281e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)}  // namespace shell
301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)}  // namespace mojo
31