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

Unified Diff: shell/application_manager/local_fetcher.cc

Issue 1276073004: Offline By Default (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 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 side-by-side diff with in-line comments
Download patch
Index: shell/application_manager/local_fetcher.cc
diff --git a/shell/application_manager/local_fetcher.cc b/shell/application_manager/local_fetcher.cc
index ce753853dc976a82efe4f24d7a30eb9024822314..de52d4a154da5fbf2354f0e8596a311e39cd74a8 100644
--- a/shell/application_manager/local_fetcher.cc
+++ b/shell/application_manager/local_fetcher.cc
@@ -91,19 +91,11 @@ std::string LocalFetcher::MimeType() {
}
bool LocalFetcher::HasMojoMagic() {
- std::string magic;
- ReadFileToString(path_, &magic, strlen(kMojoMagic));
- return magic == kMojoMagic;
+ return Fetcher::HasMojoMagic(path_);
}
bool LocalFetcher::PeekFirstLine(std::string* line) {
- std::string start_of_file;
- ReadFileToString(path_, &start_of_file, kMaxShebangLength);
- size_t return_position = start_of_file.find('\n');
- if (return_position == std::string::npos)
- return false;
- *line = start_of_file.substr(0, return_position + 1);
- return true;
+ return Fetcher::PeekFirstLine(path_, line);
}
} // namespace shell

Powered by Google App Engine
This is Rietveld 408576698