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

Side by Side Diff: media/blink/resource_multibuffer_data_provider.cc

Issue 2983733002: media: Add UMA stats for bytes going in and out of multibuffer cache (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | media/blink/url_index.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "media/blink/resource_multibuffer_data_provider.h" 5 #include "media/blink/resource_multibuffer_data_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 381 }
382 } 382 }
383 383
384 void ResourceMultiBufferDataProvider::DidReceiveData(const char* data, 384 void ResourceMultiBufferDataProvider::DidReceiveData(const char* data,
385 int data_length) { 385 int data_length) {
386 DVLOG(1) << "didReceiveData: " << data_length << " bytes"; 386 DVLOG(1) << "didReceiveData: " << data_length << " bytes";
387 DCHECK(!Available()); 387 DCHECK(!Available());
388 DCHECK(active_loader_); 388 DCHECK(active_loader_);
389 DCHECK_GT(data_length, 0); 389 DCHECK_GT(data_length, 0);
390 390
391 url_data_->AddBytesReadFromNetwork(data_length);
392
391 if (bytes_to_discard_) { 393 if (bytes_to_discard_) {
392 uint64_t tmp = std::min<uint64_t>(bytes_to_discard_, data_length); 394 uint64_t tmp = std::min<uint64_t>(bytes_to_discard_, data_length);
393 data_length -= tmp; 395 data_length -= tmp;
394 data += tmp; 396 data += tmp;
395 bytes_to_discard_ -= tmp; 397 bytes_to_discard_ -= tmp;
396 if (data_length == 0) 398 if (data_length == 0)
397 return; 399 return;
398 } 400 }
399 401
400 // When we receive data, we allow more retries. 402 // When we receive data, we allow more retries.
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 } 579 }
578 if (last_byte_position + 1 < byte_pos()) { 580 if (last_byte_position + 1 < byte_pos()) {
579 return false; 581 return false;
580 } 582 }
581 bytes_to_discard_ = byte_pos() - first_byte_position; 583 bytes_to_discard_ = byte_pos() - first_byte_position;
582 584
583 return true; 585 return true;
584 } 586 }
585 587
586 } // namespace media 588 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/blink/url_index.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698