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

Side by Side Diff: shell/application_manager/network_fetcher.h

Issue 1011333003: Fix races when the same bits are downloaded from 2 URLs. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 9 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/tools/data/apptests ('k') | shell/application_manager/network_fetcher.cc » ('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 #ifndef SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ 5 #ifndef SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_
6 #define SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ 6 #define SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_
7 7
8 #include "shell/application_manager/fetcher.h" 8 #include "shell/application_manager/fetcher.h"
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 28 matching lines...) Expand all
39 uint32_t skip) override; 39 uint32_t skip) override;
40 40
41 static void RecordCacheToURLMapping(const base::FilePath& path, 41 static void RecordCacheToURLMapping(const base::FilePath& path,
42 const GURL& url); 42 const GURL& url);
43 43
44 // AppIds should be be both predictable and unique, but any hash would work. 44 // AppIds should be be both predictable and unique, but any hash would work.
45 // Currently we use sha256 from crypto/secure_hash.h 45 // Currently we use sha256 from crypto/secure_hash.h
46 static bool ComputeAppId(const base::FilePath& path, 46 static bool ComputeAppId(const base::FilePath& path,
47 std::string* digest_string); 47 std::string* digest_string);
48 48
49 static bool RenameToAppId(const base::FilePath& old_path, 49 static bool RenameToAppId(const GURL& url,
50 const base::FilePath& old_path,
50 base::FilePath* new_path); 51 base::FilePath* new_path);
51 52
52 void CopyCompleted(base::Callback<void(const base::FilePath&, bool)> callback, 53 void CopyCompleted(base::Callback<void(const base::FilePath&, bool)> callback,
53 bool success); 54 bool success);
54 55
55 void AsPath( 56 void AsPath(
56 base::TaskRunner* task_runner, 57 base::TaskRunner* task_runner,
57 base::Callback<void(const base::FilePath&, bool)> callback) override; 58 base::Callback<void(const base::FilePath&, bool)> callback) override;
58 59
59 std::string MimeType() override; 60 std::string MimeType() override;
(...skipping 13 matching lines...) Expand all
73 base::FilePath path_; 74 base::FilePath path_;
74 base::WeakPtrFactory<NetworkFetcher> weak_ptr_factory_; 75 base::WeakPtrFactory<NetworkFetcher> weak_ptr_factory_;
75 76
76 DISALLOW_COPY_AND_ASSIGN(NetworkFetcher); 77 DISALLOW_COPY_AND_ASSIGN(NetworkFetcher);
77 }; 78 };
78 79
79 } // namespace shell 80 } // namespace shell
80 } // namespace mojo 81 } // namespace mojo
81 82
82 #endif // SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ 83 #endif // SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_
OLDNEW
« no previous file with comments | « mojo/tools/data/apptests ('k') | shell/application_manager/network_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698