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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_app_data.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_shutdown.cc ('k') | chrome/browser/chromeos/boot_times_loader.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/app_mode/kiosk_app_data.h" 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_data.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 private: 105 private:
106 friend class base::RefCountedThreadSafe<IconLoader>; 106 friend class base::RefCountedThreadSafe<IconLoader>;
107 107
108 virtual ~IconLoader() {} 108 virtual ~IconLoader() {}
109 109
110 // Loads the icon from locally stored |icon_path_| on the blocking pool 110 // Loads the icon from locally stored |icon_path_| on the blocking pool
111 void LoadOnBlockingPool() { 111 void LoadOnBlockingPool() {
112 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 112 DCHECK(task_runner_->RunsTasksOnCurrentThread());
113 113
114 std::string data; 114 std::string data;
115 if (!file_util::ReadFileToString(base::FilePath(icon_path_), &data)) { 115 if (!base::ReadFileToString(base::FilePath(icon_path_), &data)) {
116 ReportResultOnBlockingPool(FAILED_TO_LOAD); 116 ReportResultOnBlockingPool(FAILED_TO_LOAD);
117 return; 117 return;
118 } 118 }
119 raw_icon_ = base::RefCountedString::TakeString(&data); 119 raw_icon_ = base::RefCountedString::TakeString(&data);
120 120
121 scoped_refptr<ImageDecoder> image_decoder = new ImageDecoder( 121 scoped_refptr<ImageDecoder> image_decoder = new ImageDecoder(
122 this, raw_icon_->data(), ImageDecoder::DEFAULT_CODEC); 122 this, raw_icon_->data(), ImageDecoder::DEFAULT_CODEC);
123 image_decoder->Start(task_runner_); 123 image_decoder->Start(task_runner_);
124 } 124 }
125 125
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 icon_url, 437 icon_url,
438 GetRequestContextGetter()); 438 GetRequestContextGetter());
439 } 439 }
440 440
441 void KioskAppData::OnWebstoreResponseParseFailure(const std::string& error) { 441 void KioskAppData::OnWebstoreResponseParseFailure(const std::string& error) {
442 webstore_fetcher_.reset(); 442 webstore_fetcher_.reset();
443 SetStatus(STATUS_ERROR); 443 SetStatus(STATUS_ERROR);
444 } 444 }
445 445
446 } // namespace chromeos 446 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/browser_shutdown.cc ('k') | chrome/browser/chromeos/boot_times_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698