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

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

Issue 506523002: net : Declaring the weak_ptr_factory in proper order. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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_transaction_test_util.h ('k') | net/proxy/proxy_script_fetcher_impl.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/http_transaction_test_util.h" 5 #include "net/http/http_transaction_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 DidRead(result); 218 DidRead(result);
219 break; 219 break;
220 default: 220 default:
221 NOTREACHED(); 221 NOTREACHED();
222 } 222 }
223 } 223 }
224 224
225 MockNetworkTransaction::MockNetworkTransaction( 225 MockNetworkTransaction::MockNetworkTransaction(
226 net::RequestPriority priority, 226 net::RequestPriority priority,
227 MockNetworkLayer* factory) 227 MockNetworkLayer* factory)
228 : weak_factory_(this), 228 : request_(NULL),
229 request_(NULL),
230 data_cursor_(0), 229 data_cursor_(0),
231 priority_(priority), 230 priority_(priority),
232 websocket_handshake_stream_create_helper_(NULL), 231 websocket_handshake_stream_create_helper_(NULL),
233 transaction_factory_(factory->AsWeakPtr()), 232 transaction_factory_(factory->AsWeakPtr()),
234 received_bytes_(0), 233 received_bytes_(0),
235 socket_log_id_(net::NetLog::Source::kInvalidId) { 234 socket_log_id_(net::NetLog::Source::kInvalidId),
235 weak_factory_(this) {
236 } 236 }
237 237
238 MockNetworkTransaction::~MockNetworkTransaction() {} 238 MockNetworkTransaction::~MockNetworkTransaction() {}
239 239
240 int MockNetworkTransaction::Start(const net::HttpRequestInfo* request, 240 int MockNetworkTransaction::Start(const net::HttpRequestInfo* request,
241 const net::CompletionCallback& callback, 241 const net::CompletionCallback& callback,
242 const net::BoundNetLog& net_log) { 242 const net::BoundNetLog& net_log) {
243 if (request_) 243 if (request_)
244 return net::ERR_FAILED; 244 return net::ERR_FAILED;
245 245
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 498
499 if (rv > 0) 499 if (rv > 0)
500 content.append(buf->data(), rv); 500 content.append(buf->data(), rv);
501 else if (rv < 0) 501 else if (rv < 0)
502 return rv; 502 return rv;
503 } while (rv > 0); 503 } while (rv > 0);
504 504
505 result->swap(content); 505 result->swap(content);
506 return net::OK; 506 return net::OK;
507 } 507 }
OLDNEW
« no previous file with comments | « net/http/http_transaction_test_util.h ('k') | net/proxy/proxy_script_fetcher_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698