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

Side by Side Diff: net/http/mock_http_cache.cc

Issue 1154283003: Change most uses of Pickle to base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/http/http_vary_data.cc ('k') | net/quic/crypto/quic_server_info.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/http/mock_http_cache.h" 5 #include "net/http/mock_http_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "net/base/completion_callback.h" 9 #include "net/base/completion_callback.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 EXPECT_EQ(size, rv); 557 EXPECT_EQ(size, rv);
558 558
559 return HttpCache::ParseResponseInfo(buffer->data(), size, response_info, 559 return HttpCache::ParseResponseInfo(buffer->data(), size, response_info,
560 response_truncated); 560 response_truncated);
561 } 561 }
562 562
563 bool MockHttpCache::WriteResponseInfo(disk_cache::Entry* disk_entry, 563 bool MockHttpCache::WriteResponseInfo(disk_cache::Entry* disk_entry,
564 const HttpResponseInfo* response_info, 564 const HttpResponseInfo* response_info,
565 bool skip_transient_headers, 565 bool skip_transient_headers,
566 bool response_truncated) { 566 bool response_truncated) {
567 Pickle pickle; 567 base::Pickle pickle;
568 response_info->Persist( 568 response_info->Persist(
569 &pickle, skip_transient_headers, response_truncated); 569 &pickle, skip_transient_headers, response_truncated);
570 570
571 TestCompletionCallback cb; 571 TestCompletionCallback cb;
572 scoped_refptr<WrappedIOBuffer> data( 572 scoped_refptr<WrappedIOBuffer> data(
573 new WrappedIOBuffer(reinterpret_cast<const char*>(pickle.data()))); 573 new WrappedIOBuffer(reinterpret_cast<const char*>(pickle.data())));
574 int len = static_cast<int>(pickle.size()); 574 int len = static_cast<int>(pickle.size());
575 575
576 int rv = disk_entry->WriteData(0, 0, data.get(), len, cb.callback(), true); 576 int rv = disk_entry->WriteData(0, 0, data.get(), len, cb.callback(), true);
577 rv = cb.GetResult(rv); 577 rv = cb.GetResult(rv);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 if (!callback_.is_null()) { 655 if (!callback_.is_null()) {
656 if (!fail_) 656 if (!fail_)
657 backend_->reset(new MockDiskCache()); 657 backend_->reset(new MockDiskCache());
658 CompletionCallback cb = callback_; 658 CompletionCallback cb = callback_;
659 callback_.Reset(); 659 callback_.Reset();
660 cb.Run(Result()); // This object can be deleted here. 660 cb.Run(Result()); // This object can be deleted here.
661 } 661 }
662 } 662 }
663 663
664 } // namespace net 664 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_vary_data.cc ('k') | net/quic/crypto/quic_server_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698