Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: mojo/fetcher/update_fetcher.cc

Issue 1342503003: Move fetching logic out of ApplicationManager, eliminate url mappings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/fetcher/update_fetcher.h ('k') | mojo/fetcher/url_resolver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/update_fetcher.h" 5 #include "mojo/fetcher/update_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "mojo/common/common_type_converters.h" 12 #include "mojo/common/common_type_converters.h"
13 #include "mojo/common/data_pipe_utils.h" 13 #include "mojo/common/data_pipe_utils.h"
14 #include "mojo/common/url_type_converters.h" 14 #include "mojo/common/url_type_converters.h"
15 15
16 namespace mojo { 16 namespace mojo {
17 namespace shell { 17 namespace fetcher {
18 18
19 namespace { 19 namespace {
20
21 void IgnoreResult(bool result) { 20 void IgnoreResult(bool result) {
22 } 21 }
23 22
24 } // namespace 23 } // namespace
25 UpdateFetcher::UpdateFetcher(const GURL& url, 24 UpdateFetcher::UpdateFetcher(const GURL& url,
26 updater::Updater* updater, 25 updater::Updater* updater,
27 const FetchCallback& loader_callback) 26 const FetchCallback& loader_callback)
28 : Fetcher(loader_callback), url_(url), weak_ptr_factory_(this) { 27 : Fetcher(loader_callback), url_(url), weak_ptr_factory_(this) {
29 DVLOG(1) << "updating: " << url_; 28 DVLOG(1) << "updating: " << url_;
30 updater->GetPathForApp( 29 updater->GetPathForApp(
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return false; 89 return false;
91 *line = start_of_file.substr(0, return_position + 1); 90 *line = start_of_file.substr(0, return_position + 1);
92 return true; 91 return true;
93 } 92 }
94 93
95 void UpdateFetcher::OnGetAppPath(const mojo::String& path) { 94 void UpdateFetcher::OnGetAppPath(const mojo::String& path) {
96 path_ = base::FilePath::FromUTF8Unsafe(path); 95 path_ = base::FilePath::FromUTF8Unsafe(path);
97 loader_callback_.Run(make_scoped_ptr(this)); 96 loader_callback_.Run(make_scoped_ptr(this));
98 } 97 }
99 98
100 } // namespace shell 99 } // namespace fetcher
101 } // namespace mojo 100 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/fetcher/update_fetcher.h ('k') | mojo/fetcher/url_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698