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
3 // found in the LICENSE file.
7 #include "base/callback.h"
8 #include "ppapi/c/private/ppb_nacl_private.h"
9 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h"
19 // Downloads a NaCl manifest (.nmf) and returns the contents of the file to
20 // caller through a callback.
21 class ManifestDownloader : public blink::WebURLLoaderClient {
23 typedef base::Callback<void(PP_NaClError, const std::string&)>
24 ManifestDownloaderCallback;
26 ManifestDownloader(bool is_installed, ManifestDownloaderCallback cb);
27 virtual ~ManifestDownloader();
30 // WebURLLoaderClient implementation.
31 virtual void didReceiveResponse(blink::WebURLLoader* loader,
32 const blink::WebURLResponse& response);
33 virtual void didReceiveData(blink::WebURLLoader* loader,
36 int encoded_data_length);
37 virtual void didFinishLoading(blink::WebURLLoader* loader,
39 int64_t total_encoded_data_length);
40 virtual void didFail(blink::WebURLLoader* loader,
41 const blink::WebURLError& error);
44 ManifestDownloaderCallback cb_;
47 PP_NaClError pp_nacl_error_;