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

Side by Side Diff: chrome/browser/android/offline_pages/background_loader_offliner.cc

Issue 2683493002: Get signals working in the EXTRA_DATA section of MHTML (Closed)
Patch Set: Approach for writing to the file afterwards instead. Created 3 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/android/offline_pages/background_loader_offliner.h" 5 #include "chrome/browser/android/offline_pages/background_loader_offliner.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" 9 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h"
10 #include "chrome/browser/android/offline_pages/offliner_helper.h" 10 #include "chrome/browser/android/offline_pages/offliner_helper.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 case net::ERR_UNKNOWN_URL_SCHEME: 232 case net::ERR_UNKNOWN_URL_SCHEME:
233 page_load_state_ = NONRETRIABLE; 233 page_load_state_ = NONRETRIABLE;
234 break; 234 break;
235 default: 235 default:
236 page_load_state_ = RETRIABLE; 236 page_load_state_ = RETRIABLE;
237 } 237 }
238 } 238 }
239 } 239 }
240 240
241 void BackgroundLoaderOffliner::OnPageSaved(SavePageResult save_result, 241 void BackgroundLoaderOffliner::OnPageSaved(SavePageResult save_result,
242 int64_t offline_id) { 242 int64_t offline_id,
243 const base::FilePath& file_path) {
243 if (!pending_request_) 244 if (!pending_request_)
244 return; 245 return;
245 246
246 SavePageRequest request(*pending_request_.get()); 247 SavePageRequest request(*pending_request_.get());
247 ResetState(); 248 ResetState();
248 249
249 if (save_state_ == DELETE_AFTER_SAVE) { 250 if (save_state_ == DELETE_AFTER_SAVE) {
250 save_state_ = NONE; 251 save_state_ = NONE;
251 return; 252 return;
252 } 253 }
(...skipping 28 matching lines...) Expand all
281 application_state == 282 application_state ==
282 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { 283 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) {
283 DVLOG(1) << "App became active, canceling current offlining request"; 284 DVLOG(1) << "App became active, canceling current offlining request";
284 SavePageRequest* request = pending_request_.get(); 285 SavePageRequest* request = pending_request_.get();
285 Cancel(); 286 Cancel();
286 completion_callback_.Run(*request, RequestStatus::FOREGROUND_CANCELED); 287 completion_callback_.Run(*request, RequestStatus::FOREGROUND_CANCELED);
287 } 288 }
288 } 289 }
289 290
290 } // namespace offline_pages 291 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698