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

Side by Side Diff: components/sync/core/http_bridge.cc

Issue 2378173002: Precache per-resource cap should be applied on network bytes used (Closed)
Patch Set: Created 4 years, 2 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 | « components/sync/core/http_bridge.h ('k') | components/update_client/url_fetcher_downloader.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "components/sync/core/http_bridge.h" 5 #include "components/sync/core/http_bridge.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 fetch_state_.url_poster); 363 fetch_state_.url_poster);
364 fetch_state_.url_poster = NULL; 364 fetch_state_.url_poster = NULL;
365 365
366 // Wake the blocked syncer thread in MakeSynchronousPost. 366 // Wake the blocked syncer thread in MakeSynchronousPost.
367 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! 367 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted!
368 http_post_completed_.Signal(); 368 http_post_completed_.Signal();
369 } 369 }
370 370
371 void HttpBridge::OnURLFetchDownloadProgress(const net::URLFetcher* source, 371 void HttpBridge::OnURLFetchDownloadProgress(const net::URLFetcher* source,
372 int64_t current, 372 int64_t current,
373 int64_t total) { 373 int64_t total,
374 int64_t current_network_bytes) {
374 DCHECK(network_task_runner_->BelongsToCurrentThread()); 375 DCHECK(network_task_runner_->BelongsToCurrentThread());
375 // Reset the delay when forward progress is made. 376 // Reset the delay when forward progress is made.
376 base::AutoLock lock(fetch_state_lock_); 377 base::AutoLock lock(fetch_state_lock_);
377 if (fetch_state_.http_request_timeout_timer.get()) 378 if (fetch_state_.http_request_timeout_timer.get())
378 fetch_state_.http_request_timeout_timer->Reset(); 379 fetch_state_.http_request_timeout_timer->Reset();
379 } 380 }
380 381
381 void HttpBridge::OnURLFetchUploadProgress(const net::URLFetcher* source, 382 void HttpBridge::OnURLFetchUploadProgress(const net::URLFetcher* source,
382 int64_t current, 383 int64_t current,
383 int64_t total) { 384 int64_t total) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 int64_t sane_time_ms = 0; 437 int64_t sane_time_ms = 0;
437 if (base::StringToInt64(sane_time_str, &sane_time_ms)) { 438 if (base::StringToInt64(sane_time_str, &sane_time_ms)) {
438 network_time_update_callback_.Run( 439 network_time_update_callback_.Run(
439 base::Time::FromJsTime(sane_time_ms), 440 base::Time::FromJsTime(sane_time_ms),
440 base::TimeDelta::FromMilliseconds(1), 441 base::TimeDelta::FromMilliseconds(1),
441 fetch_state_.end_time - fetch_state_.start_time); 442 fetch_state_.end_time - fetch_state_.start_time);
442 } 443 }
443 } 444 }
444 445
445 } // namespace syncer 446 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/core/http_bridge.h ('k') | components/update_client/url_fetcher_downloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698