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

Side by Side Diff: mojo/services/network/http_connection_impl.cc

Issue 1358163006: Adds some code to help isolate where crash is happening (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 5 years, 2 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mojo/services/network/http_connection_impl.h" 5 #include "mojo/services/network/http_connection_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 18 matching lines...) Expand all
29 29
30 namespace mojo { 30 namespace mojo {
31 31
32 // SimpleDataPipeReader reads till end-of-file, stores the data in a string and 32 // SimpleDataPipeReader reads till end-of-file, stores the data in a string and
33 // notifies completion. 33 // notifies completion.
34 class HttpConnectionImpl::SimpleDataPipeReader { 34 class HttpConnectionImpl::SimpleDataPipeReader {
35 public: 35 public:
36 using CompletionCallback = 36 using CompletionCallback =
37 base::Callback<void(SimpleDataPipeReader*, scoped_ptr<std::string>)>; 37 base::Callback<void(SimpleDataPipeReader*, scoped_ptr<std::string>)>;
38 38
39 SimpleDataPipeReader() {} 39 SimpleDataPipeReader() : watcher_(11) {}
40 ~SimpleDataPipeReader() {} 40 ~SimpleDataPipeReader() {}
41 41
42 void Start(ScopedDataPipeConsumerHandle consumer, 42 void Start(ScopedDataPipeConsumerHandle consumer,
43 const CompletionCallback& completion_callback) { 43 const CompletionCallback& completion_callback) {
44 DCHECK(consumer.is_valid() && !consumer_.is_valid()); 44 DCHECK(consumer.is_valid() && !consumer_.is_valid());
45 consumer_ = consumer.Pass(); 45 consumer_ = consumer.Pass();
46 completion_callback_ = completion_callback; 46 completion_callback_ = completion_callback;
47 buffer_.reset(new std::string); 47 buffer_.reset(new std::string);
48 ReadMore(); 48 ReadMore();
49 } 49 }
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // The close operation is initiated by this object. 413 // The close operation is initiated by this object.
414 NotifyOwnerCloseIfAllDone(); 414 NotifyOwnerCloseIfAllDone();
415 } else { 415 } else {
416 // The close operation is initiated by |web_socket_|; start closing this 416 // The close operation is initiated by |web_socket_|; start closing this
417 // object. 417 // object.
418 Close(); 418 Close();
419 } 419 }
420 } 420 }
421 421
422 } // namespace mojo 422 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/message_pump/message_pump_mojo_unittest.cc ('k') | mojo/services/network/public/cpp/web_socket_read_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698