OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/shell/loader.h" | 5 #include "mojo/shell/loader.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "net/base/load_flags.h" | |
8 #include "net/base/network_delegate.h" | 9 #include "net/base/network_delegate.h" |
9 | 10 |
10 namespace mojo { | 11 namespace mojo { |
11 namespace shell { | 12 namespace shell { |
12 | 13 |
13 Loader::Delegate::~Delegate() { | 14 Loader::Delegate::~Delegate() { |
14 } | 15 } |
15 | 16 |
16 Loader::Job::Job(const GURL& app_url, Delegate* delegate) | 17 Loader::Job::Job(const GURL& app_url, Delegate* delegate) |
17 : delegate_(delegate) { | 18 : delegate_(delegate) { |
(...skipping 23 matching lines...) Expand all Loading... | |
41 network_delegate.Pass())) { | 42 network_delegate.Pass())) { |
42 } | 43 } |
43 | 44 |
44 Loader::~Loader() { | 45 Loader::~Loader() { |
45 } | 46 } |
46 | 47 |
47 scoped_ptr<Loader::Job> Loader::Load(const GURL& app_url, Delegate* delegate) { | 48 scoped_ptr<Loader::Job> Loader::Load(const GURL& app_url, Delegate* delegate) { |
48 scoped_ptr<Job> job(new Job(app_url, delegate)); | 49 scoped_ptr<Job> job(new Job(app_url, delegate)); |
49 job->fetcher_->SetRequestContext(url_request_context_getter_.get()); | 50 job->fetcher_->SetRequestContext(url_request_context_getter_.get()); |
50 job->fetcher_->SaveResponseToTemporaryFile(file_runner_.get()); | 51 job->fetcher_->SaveResponseToTemporaryFile(file_runner_.get()); |
52 #if !defined(NDEBUG) | |
53 // Don't use the cache when in debug. | |
54 // TODO(davemoore): Should we make this a command line flag instead? | |
darin (slow to review)
2013/12/10 06:12:36
yes, a command line flag would be better. that wa
DaveMoore
2013/12/11 18:56:44
Removed...I'll add in separate cl.
On 2013/12/10 0
| |
55 job->fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE); | |
56 #endif | |
51 job->fetcher_->Start(); | 57 job->fetcher_->Start(); |
52 return job.Pass(); | 58 return job.Pass(); |
53 } | 59 } |
54 | 60 |
55 } // namespace shell | 61 } // namespace shell |
56 } // namespace mojo | 62 } // namespace mojo |
OLD | NEW |