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

Side by Side Diff: chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc

Issue 2914703002: [Offline Prefetch] Backoff support for PrefetchBackgroundTask (Closed)
Patch Set: Fix test Created 3 years, 6 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
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/common/BUILD.gn » ('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 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/ui/webui/offline/offline_internals_ui_message_handler.h " 5 #include "chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h "
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 base::Value(net::NetworkChangeNotifier::IsOffline() ? "Offline" 229 base::Value(net::NetworkChangeNotifier::IsOffline() ? "Offline"
230 : "Online")); 230 : "Online"));
231 } 231 }
232 232
233 void OfflineInternalsUIMessageHandler::HandleScheduleNwake( 233 void OfflineInternalsUIMessageHandler::HandleScheduleNwake(
234 const base::ListValue* args) { 234 const base::ListValue* args) {
235 AllowJavascript(); 235 AllowJavascript();
236 const base::Value* callback_id; 236 const base::Value* callback_id;
237 CHECK(args->Get(0, &callback_id)); 237 CHECK(args->Get(0, &callback_id));
238 238
239 offline_pages::PrefetchBackgroundTask::Schedule(); 239 offline_pages::PrefetchBackgroundTask::Schedule(0);
240 240
241 ResolveJavascriptCallback(*callback_id, base::Value("Scheduled.")); 241 ResolveJavascriptCallback(*callback_id, base::Value("Scheduled."));
242 } 242 }
243 243
244 void OfflineInternalsUIMessageHandler::HandleCancelNwake( 244 void OfflineInternalsUIMessageHandler::HandleCancelNwake(
245 const base::ListValue* args) { 245 const base::ListValue* args) {
246 AllowJavascript(); 246 AllowJavascript();
247 const base::Value* callback_id; 247 const base::Value* callback_id;
248 CHECK(args->Get(0, &callback_id)); 248 CHECK(args->Get(0, &callback_id));
249 249
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 // Get the offline page model associated with this web ui. 378 // Get the offline page model associated with this web ui.
379 Profile* profile = Profile::FromWebUI(web_ui()); 379 Profile* profile = Profile::FromWebUI(web_ui());
380 offline_page_model_ = 380 offline_page_model_ =
381 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile); 381 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile);
382 request_coordinator_ = 382 request_coordinator_ =
383 offline_pages::RequestCoordinatorFactory::GetForBrowserContext(profile); 383 offline_pages::RequestCoordinatorFactory::GetForBrowserContext(profile);
384 } 384 }
385 385
386 } // namespace offline_internals 386 } // namespace offline_internals
OLDNEW
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698