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

Unified Diff: chrome/browser/net/file_reader.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/file_reader.h ('k') | chrome/browser/net/file_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/file_reader.cc
===================================================================
--- chrome/browser/net/file_reader.cc (revision 28272)
+++ chrome/browser/net/file_reader.cc (working copy)
@@ -1,32 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/net/file_reader.h"
-
-#include "base/file_util.h"
-#include "chrome/browser/chrome_thread.h"
-
-FileReader::FileReader(const FilePath& path, Callback* callback)
- : path_(path),
- callback_(callback),
- origin_loop_(MessageLoop::current()) {
- DCHECK(callback_);
-}
-
-void FileReader::Start() {
- ChromeThread::GetMessageLoop(ChromeThread::FILE)->PostTask(FROM_HERE,
- NewRunnableMethod(this, &FileReader::ReadFileOnBackgroundThread));
-}
-
-void FileReader::ReadFileOnBackgroundThread() {
- std::string data;
- bool success = file_util::ReadFileToString(path_, &data);
- origin_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &FileReader::RunCallback, success, data));
-}
-
-void FileReader::RunCallback(bool success, const std::string& data) {
- callback_->Run(success, data);
- delete callback_;
-}
« no previous file with comments | « chrome/browser/net/file_reader.h ('k') | chrome/browser/net/file_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698