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

Side by Side Diff: net/tools/dump_cache/upgrade.cc

Issue 6125001: Fixed first pass at adding http/backend cache events to the NetLog. ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix Created 9 years, 11 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/tools/crash_cache/crash_cache.cc ('k') | net/url_request/url_request_unittest.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/file_path.h" 5 #include "base/file_path.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 if (dump_to_disk_) { 320 if (dump_to_disk_) {
321 writer_ = new DiskDumper(path_); 321 writer_ = new DiskDumper(path_);
322 } else { 322 } else {
323 disk_cache::Backend* cache; 323 disk_cache::Backend* cache;
324 TestCompletionCallback cb; 324 TestCompletionCallback cb;
325 int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, 325 int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE,
326 FilePath::FromWStringHack(path_), 0, 326 FilePath::FromWStringHack(path_), 0,
327 false, 327 false,
328 cache_thread_.message_loop_proxy(), 328 cache_thread_.message_loop_proxy(),
329 &cache, &cb); 329 NULL, &cache, &cb);
330 if (cb.GetResult(rv) != net::OK) { 330 if (cb.GetResult(rv) != net::OK) {
331 printf("Unable to initialize new files\n"); 331 printf("Unable to initialize new files\n");
332 return false; 332 return false;
333 } 333 }
334 cache_.reset(cache); 334 cache_.reset(cache);
335 writer_ = new CacheDumper(cache_.get()); 335 writer_ = new CacheDumper(cache_.get());
336 } 336 }
337 if (!writer_) 337 if (!writer_)
338 return false; 338 return false;
339 339
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 ALLOW_THIS_IN_INITIALIZER_LIST( 600 ALLOW_THIS_IN_INITIALIZER_LIST(
601 read_callback_(this, &SlaveSM::DoReadDataComplete)), 601 read_callback_(this, &SlaveSM::DoReadDataComplete)),
602 ALLOW_THIS_IN_INITIALIZER_LIST( 602 ALLOW_THIS_IN_INITIALIZER_LIST(
603 next_callback_(this, &SlaveSM::DoGetEntryComplete)) { 603 next_callback_(this, &SlaveSM::DoGetEntryComplete)) {
604 disk_cache::Backend* cache; 604 disk_cache::Backend* cache;
605 TestCompletionCallback cb; 605 TestCompletionCallback cb;
606 int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, 606 int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE,
607 FilePath::FromWStringHack(path), 0, 607 FilePath::FromWStringHack(path), 0,
608 false, 608 false,
609 cache_thread_.message_loop_proxy(), 609 cache_thread_.message_loop_proxy(),
610 &cache, &cb); 610 NULL, &cache, &cb);
611 if (cb.GetResult(rv) != net::OK) { 611 if (cb.GetResult(rv) != net::OK) {
612 printf("Unable to open cache files\n"); 612 printf("Unable to open cache files\n");
613 return; 613 return;
614 } 614 }
615 cache_.reset(reinterpret_cast<disk_cache::BackendImpl*>(cache)); 615 cache_.reset(reinterpret_cast<disk_cache::BackendImpl*>(cache));
616 cache_->SetUpgradeMode(); 616 cache_->SetUpgradeMode();
617 } 617 }
618 618
619 SlaveSM::~SlaveSM() { 619 SlaveSM::~SlaveSM() {
620 if (iterator_) 620 if (iterator_)
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 920
921 SlaveSM slave(input_path, pipe); 921 SlaveSM slave(input_path, pipe);
922 if (!slave.DoInit()) { 922 if (!slave.DoInit()) {
923 printf("Unable to talk with the main process\n"); 923 printf("Unable to talk with the main process\n");
924 return -1; 924 return -1;
925 } 925 }
926 926
927 loop.Run(); 927 loop.Run();
928 return 0; 928 return 0;
929 } 929 }
OLDNEW
« no previous file with comments | « net/tools/crash_cache/crash_cache.cc ('k') | net/url_request/url_request_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698