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

Side by Side Diff: components/resource_provider/public/cpp/resource_loader.h

Issue 1429263005: Revert of mandoline: Fix ICU initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
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 COMPONENTS_RESOURCE_PROVIDER_PUBLIC_CPP_RESOURCE_LOADER_H_ 5 #ifndef COMPONENTS_RESOURCE_PROVIDER_PUBLIC_CPP_RESOURCE_LOADER_H_
6 #define COMPONENTS_RESOURCE_PROVIDER_PUBLIC_CPP_RESOURCE_LOADER_H_ 6 #define COMPONENTS_RESOURCE_PROVIDER_PUBLIC_CPP_RESOURCE_LOADER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 28 matching lines...) Expand all
39 39
40 // Uses WaitForIncomingMessage() to block until the results are available, or 40 // Uses WaitForIncomingMessage() to block until the results are available, or
41 // an error occurs. Returns true if the resources were obtained, false on 41 // an error occurs. Returns true if the resources were obtained, false on
42 // error. This immediately returns if the resources have already been 42 // error. This immediately returns if the resources have already been
43 // obtained. 43 // obtained.
44 bool BlockUntilLoaded(); 44 bool BlockUntilLoaded();
45 45
46 // Releases and returns the file wrapping the handle. 46 // Releases and returns the file wrapping the handle.
47 base::File ReleaseFile(const std::string& path); 47 base::File ReleaseFile(const std::string& path);
48 48
49 base::File GetICUFile();
50
49 bool loaded() const { return loaded_; } 51 bool loaded() const { return loaded_; }
50 52
51 private: 53 private:
52 using ResourceMap = std::map<std::string, scoped_ptr<base::File>>; 54 using ResourceMap = std::map<std::string, scoped_ptr<base::File>>;
53 55
54 // Callback when resources have loaded. 56 // Callback when resources have loaded.
55 void OnGotResources(const std::vector<std::string>& paths, 57 void OnGotResources(const std::vector<std::string>& paths,
56 mojo::Array<mojo::ScopedHandle> resources); 58 mojo::Array<mojo::ScopedHandle> resources);
59 void OnGotICU(base::File* file, mojo::ScopedHandle handle);
57 60
58 ResourceProviderPtr resource_provider_; 61 ResourceProviderPtr resource_provider_;
59 62
60 ResourceMap resource_map_; 63 ResourceMap resource_map_;
61 64
62 bool loaded_; 65 bool loaded_;
63 bool did_block_; 66 bool did_block_;
64 67
65 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); 68 DISALLOW_COPY_AND_ASSIGN(ResourceLoader);
66 }; 69 };
67 70
68 } // namespace resource_provider 71 } // namespace resource_provider
69 72
70 #endif // COMPONENTS_RESOURCE_PROVIDER_PUBLIC_CPP_RESOURCE_LOADER_H_ 73 #endif // COMPONENTS_RESOURCE_PROVIDER_PUBLIC_CPP_RESOURCE_LOADER_H_
OLDNEW
« no previous file with comments | « components/resource_provider/BUILD.gn ('k') | components/resource_provider/public/cpp/resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698