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.
5 #include "content/renderer/fetchers/manifest_fetcher.h"
8 #include "base/logging.h"
9 #include "content/public/renderer/resource_fetcher.h"
10 #include "third_party/WebKit/public/platform/WebURLRequest.h"
11 #include "third_party/WebKit/public/web/WebFrame.h"
15 ManifestFetcher::ManifestFetcher(const GURL& url)
17 fetcher_.reset(ResourceFetcher::Create(url));
20 ManifestFetcher::~ManifestFetcher() {
25 void ManifestFetcher::Start(blink::WebFrame* frame, const Callback& callback) {
27 fetcher_->Start(frame,
28 blink::WebURLRequest::RequestContextManifest,
29 blink::WebURLRequest::FrameTypeNone,
30 ResourceFetcher::FRAME_ASSOCIATED_LOADER,
31 base::Bind(&ManifestFetcher::OnLoadComplete,
32 base::Unretained(this)));
35 void ManifestFetcher::Cancel() {
40 void ManifestFetcher::OnLoadComplete(const blink::WebURLResponse& response,
41 const std::string& data) {
45 Callback callback = callback_;
46 callback.Run(response, data);
49 } // namespace content