also format missing .cc files

This commit is contained in:
Shelley Vohr 2018-04-17 21:55:30 -04:00
parent 53bdf22c85
commit c6f4bbd143
No known key found for this signature in database
GPG key ID: F13993A75599653C
181 changed files with 4102 additions and 4254 deletions

View file

@ -17,12 +17,9 @@ namespace api {
SavePageHandler::SavePageHandler(content::WebContents* web_contents,
const SavePageCallback& callback)
: web_contents_(web_contents),
callback_(callback) {
}
: web_contents_(web_contents), callback_(callback) {}
SavePageHandler::~SavePageHandler() {
}
SavePageHandler::~SavePageHandler() {}
void SavePageHandler::OnDownloadCreated(content::DownloadManager* manager,
content::DownloadItem* item) {
@ -41,9 +38,8 @@ bool SavePageHandler::Handle(const base::FilePath& full_path,
base::FilePath saved_main_directory_path = full_path.DirName().Append(
full_path.RemoveExtension().BaseName().value() +
FILE_PATH_LITERAL("_files"));
bool result = web_contents_->SavePage(full_path,
saved_main_directory_path,
save_type);
bool result =
web_contents_->SavePage(full_path, saved_main_directory_path, save_type);
download_manager->RemoveObserver(this);
// If initialization fails which means fail to create |DownloadItem|, we need
// to delete the |SavePageHandler| instance to avoid memory-leak.
@ -60,8 +56,8 @@ void SavePageHandler::OnDownloadUpdated(content::DownloadItem* item) {
if (item->GetState() == content::DownloadItem::COMPLETE) {
callback_.Run(v8::Null(isolate));
} else {
v8::Local<v8::String> error_message = v8::String::NewFromUtf8(
isolate, "Fail to save page");
v8::Local<v8::String> error_message =
v8::String::NewFromUtf8(isolate, "Fail to save page");
callback_.Run(v8::Exception::Error(error_message));
}
Destroy(item);