Skip to content

Commit

Permalink
fix: handle connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed May 10, 2019
1 parent fed93cf commit 94f64a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions atom/browser/net/node_stream_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ NodeStreamLoader::NodeStreamLoader(network::ResourceResponseHead head,
isolate_(isolate),
emitter_(isolate, emitter),
weak_factory_(this) {
binding_.set_connection_error_handler(
base::BindOnce(&NodeStreamLoader::NotifyComplete,
weak_factory_.GetWeakPtr(), net::ERR_FAILED));

// PostTask since it might destruct.
base::SequencedTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(&NodeStreamLoader::Start,
Expand Down
1 change: 1 addition & 0 deletions atom/browser/net/node_stream_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define ATOM_BROWSER_NET_NODE_STREAM_LOADER_H_

#include <map>
#include <memory>
#include <string>
#include <vector>

Expand Down

0 comments on commit 94f64a7

Please sign in to comment.