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

Side by Side Diff: chrome/browser/net/file_reader.h

Issue 256022: Loads local resources from current locale subtree if available, if not it fal... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/image_loading_tracker.cc ('k') | chrome/browser/net/file_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // This file defines an interface for reading a file asynchronously on a
6 // background thread.
7
8 #ifndef CHROME_BROWSER_NET_FILE_READER_H_
9 #define CHROME_BROWSER_NET_FILE_READER_H_
10
11 #include <string>
12
13 #include "base/file_path.h"
14 #include "base/ref_counted.h"
15 #include "base/task.h"
16
17 class MessageLoop;
18
19 class FileReader : public base::RefCountedThreadSafe<FileReader> {
20 public:
21 // Reports success or failure and the data of the file upon success.
22 typedef Callback2<bool, const std::string&>::Type Callback;
23
24 FileReader(const FilePath& path, Callback* callback);
25
26 // Called to start reading the file on a background thread. Upon completion,
27 // the callback will be notified of the results.
28 void Start();
29
30 private:
31 void ReadFileOnBackgroundThread();
32 void RunCallback(bool success, const std::string& data);
33
34 FilePath path_;
35 Callback* callback_;
36 MessageLoop* origin_loop_;
37 };
38
39 #endif // CHROME_BROWSER_NET_FILE_READER_H_
OLDNEW
« no previous file with comments | « chrome/browser/image_loading_tracker.cc ('k') | chrome/browser/net/file_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698