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

Side by Side Diff: net/base/file_stream_win.cc

Issue 28046: Use string for Histogram names since these are all ASCII anyway wide-characte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « net/base/connection_type_histograms.cc ('k') | net/base/mime_sniffer.cc » ('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 (c) 2008 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "net/base/file_stream.h" 5 #include "net/base/file_stream.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 FileStream::AsyncContext::~AsyncContext() { 72 FileStream::AsyncContext::~AsyncContext() {
73 bool waited = false; 73 bool waited = false;
74 base::Time start = base::Time::Now(); 74 base::Time start = base::Time::Now();
75 while (callback_) { 75 while (callback_) {
76 waited = true; 76 waited = true;
77 MessageLoopForIO::current()->WaitForIOCompletion(INFINITE, this); 77 MessageLoopForIO::current()->WaitForIOCompletion(INFINITE, this);
78 } 78 }
79 if (waited) { 79 if (waited) {
80 // We want to see if we block the message loop for too long. 80 // We want to see if we block the message loop for too long.
81 UMA_HISTOGRAM_TIMES(L"AsyncIO.FileStreamClose", base::Time::Now() - start); 81 UMA_HISTOGRAM_TIMES("AsyncIO.FileStreamClose", base::Time::Now() - start);
82 } 82 }
83 } 83 }
84 84
85 void FileStream::AsyncContext::IOCompletionIsPending( 85 void FileStream::AsyncContext::IOCompletionIsPending(
86 CompletionCallback* callback) { 86 CompletionCallback* callback) {
87 DCHECK(!callback_); 87 DCHECK(!callback_);
88 callback_ = callback; 88 callback_ = callback;
89 } 89 }
90 90
91 void FileStream::AsyncContext::OnIOCompleted( 91 void FileStream::AsyncContext::OnIOCompleted(
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } else if (overlapped) { 281 } else if (overlapped) {
282 async_context_->IOCompletionIsPending(callback); 282 async_context_->IOCompletionIsPending(callback);
283 rv = ERR_IO_PENDING; 283 rv = ERR_IO_PENDING;
284 } else { 284 } else {
285 rv = static_cast<int>(bytes_written); 285 rv = static_cast<int>(bytes_written);
286 } 286 }
287 return rv; 287 return rv;
288 } 288 }
289 289
290 } // namespace net 290 } // namespace net
291
OLDNEW
« no previous file with comments | « net/base/connection_type_histograms.cc ('k') | net/base/mime_sniffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698