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

Side by Side Diff: components/nacl/renderer/manifest_downloader.h

Issue 1267713003: Make the WebURLLoaderClients in the pepper code destroy (or have some guard) the loader in didFail() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed #7 and #8 Created 5 years, 4 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 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 <string> 5 #include <string>
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "components/nacl/renderer/ppb_nacl_private.h" 9 #include "components/nacl/renderer/ppb_nacl_private.h"
10 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" 10 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h"
(...skipping 19 matching lines...) Expand all
30 static const size_t kNaClManifestMaxFileBytes = 1024 * 1024; 30 static const size_t kNaClManifestMaxFileBytes = 1024 * 1024;
31 31
32 ManifestDownloader(scoped_ptr<blink::WebURLLoader> url_loader, 32 ManifestDownloader(scoped_ptr<blink::WebURLLoader> url_loader,
33 bool is_installed, 33 bool is_installed,
34 Callback cb); 34 Callback cb);
35 virtual ~ManifestDownloader(); 35 virtual ~ManifestDownloader();
36 36
37 void Load(const blink::WebURLRequest& request); 37 void Load(const blink::WebURLRequest& request);
38 38
39 private: 39 private:
40 void done();
41
40 // WebURLLoaderClient implementation. 42 // WebURLLoaderClient implementation.
41 virtual void didReceiveResponse(blink::WebURLLoader* loader, 43 virtual void didReceiveResponse(blink::WebURLLoader* loader,
42 const blink::WebURLResponse& response); 44 const blink::WebURLResponse& response);
43 virtual void didReceiveData(blink::WebURLLoader* loader, 45 virtual void didReceiveData(blink::WebURLLoader* loader,
44 const char* data, 46 const char* data,
45 int data_length, 47 int data_length,
46 int encoded_data_length); 48 int encoded_data_length);
47 virtual void didFinishLoading(blink::WebURLLoader* loader, 49 virtual void didFinishLoading(blink::WebURLLoader* loader,
48 double finish_time, 50 double finish_time,
49 int64_t total_encoded_data_length); 51 int64_t total_encoded_data_length);
50 virtual void didFail(blink::WebURLLoader* loader, 52 virtual void didFail(blink::WebURLLoader* loader,
51 const blink::WebURLError& error); 53 const blink::WebURLError& error);
52 54
53 scoped_ptr<blink::WebURLLoader> url_loader_; 55 scoped_ptr<blink::WebURLLoader> url_loader_;
54 bool is_installed_; 56 bool is_installed_;
55 Callback cb_; 57 Callback cb_;
56 std::string buffer_; 58 std::string buffer_;
57 int status_code_; 59 int status_code_;
58 PP_NaClError pp_nacl_error_; 60 PP_NaClError pp_nacl_error_;
59 }; 61 };
60 62
61 } // namespace nacl 63 } // namespace nacl
OLDNEW
« no previous file with comments | « no previous file | components/nacl/renderer/manifest_downloader.cc » ('j') | components/nacl/renderer/manifest_downloader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698