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

Side by Side Diff: net/disk_cache/blockfile/file_win.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again 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
« no previous file with comments | « net/cert_net/nss_ocsp.cc ('k') | net/dns/dns_reloader.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "net/disk_cache/blockfile/file.h" 5 #include "net/disk_cache/blockfile/file.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 21 matching lines...) Expand all
32 static_assert(offsetof(MyOverlapped, context_) == 0, 32 static_assert(offsetof(MyOverlapped, context_) == 0,
33 "should start with overlapped"); 33 "should start with overlapped");
34 34
35 // Helper class to handle the IO completion notifications from the message loop. 35 // Helper class to handle the IO completion notifications from the message loop.
36 class CompletionHandler : public base::MessageLoopForIO::IOHandler { 36 class CompletionHandler : public base::MessageLoopForIO::IOHandler {
37 void OnIOCompleted(base::MessageLoopForIO::IOContext* context, 37 void OnIOCompleted(base::MessageLoopForIO::IOContext* context,
38 DWORD actual_bytes, 38 DWORD actual_bytes,
39 DWORD error) override; 39 DWORD error) override;
40 }; 40 };
41 41
42 static base::LazyInstance<CompletionHandler> g_completion_handler = 42 static base::LazyInstance<CompletionHandler>::DestructorAtExit
43 LAZY_INSTANCE_INITIALIZER; 43 g_completion_handler = LAZY_INSTANCE_INITIALIZER;
44 44
45 void CompletionHandler::OnIOCompleted( 45 void CompletionHandler::OnIOCompleted(
46 base::MessageLoopForIO::IOContext* context, 46 base::MessageLoopForIO::IOContext* context,
47 DWORD actual_bytes, 47 DWORD actual_bytes,
48 DWORD error) { 48 DWORD error) {
49 MyOverlapped* data = reinterpret_cast<MyOverlapped*>(context); 49 MyOverlapped* data = reinterpret_cast<MyOverlapped*>(context);
50 50
51 if (error) { 51 if (error) {
52 DCHECK(!actual_bytes); 52 DCHECK(!actual_bytes);
53 actual_bytes = static_cast<DWORD>(net::ERR_CACHE_READ_FAILURE); 53 actual_bytes = static_cast<DWORD>(net::ERR_CACHE_READ_FAILURE);
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 base::MessageLoopForIO::IOHandler* handler = g_completion_handler.Pointer(); 247 base::MessageLoopForIO::IOHandler* handler = g_completion_handler.Pointer();
248 base::MessageLoopForIO::current()->WaitForIOCompletion(100, handler); 248 base::MessageLoopForIO::current()->WaitForIOCompletion(100, handler);
249 } 249 }
250 } 250 }
251 251
252 // Static. 252 // Static.
253 void File::DropPendingIO() { 253 void File::DropPendingIO() {
254 } 254 }
255 255
256 } // namespace disk_cache 256 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/cert_net/nss_ocsp.cc ('k') | net/dns/dns_reloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698