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

Side by Side Diff: content/renderer/fetchers/manifest_fetcher.cc

Issue 2928033002: Move GetDocument method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Split a DCHECK in two as suggested by boliu@. Created 3 years, 6 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 "content/renderer/fetchers/manifest_fetcher.h" 5 #include "content/renderer/fetchers/manifest_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/public/renderer/associated_resource_fetcher.h" 9 #include "content/public/renderer/associated_resource_fetcher.h"
10 #include "third_party/WebKit/public/platform/WebURLRequest.h" 10 #include "third_party/WebKit/public/platform/WebURLRequest.h"
11 #include "third_party/WebKit/public/web/WebAssociatedURLLoaderOptions.h" 11 #include "third_party/WebKit/public/web/WebAssociatedURLLoaderOptions.h"
12 #include "third_party/WebKit/public/web/WebFrame.h" 12 #include "third_party/WebKit/public/web/WebLocalFrame.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 ManifestFetcher::ManifestFetcher(const GURL& url) 16 ManifestFetcher::ManifestFetcher(const GURL& url)
17 : completed_(false) { 17 : completed_(false) {
18 fetcher_.reset(AssociatedResourceFetcher::Create(url)); 18 fetcher_.reset(AssociatedResourceFetcher::Create(url));
19 } 19 }
20 20
21 ManifestFetcher::~ManifestFetcher() { 21 ManifestFetcher::~ManifestFetcher() {
22 if (!completed_) 22 if (!completed_)
23 Cancel(); 23 Cancel();
24 } 24 }
25 25
26 void ManifestFetcher::Start(blink::WebFrame* frame, 26 void ManifestFetcher::Start(blink::WebLocalFrame* frame,
27 bool use_credentials, 27 bool use_credentials,
28 const Callback& callback) { 28 const Callback& callback) {
29 callback_ = callback; 29 callback_ = callback;
30 30
31 blink::WebAssociatedURLLoaderOptions options; 31 blink::WebAssociatedURLLoaderOptions options;
32 // See https://w3c.github.io/manifest/. Use "include" when use_credentials is 32 // See https://w3c.github.io/manifest/. Use "include" when use_credentials is
33 // true, and "omit" otherwise. 33 // true, and "omit" otherwise.
34 options.fetch_credentials_mode = 34 options.fetch_credentials_mode =
35 use_credentials ? blink::WebURLRequest::kFetchCredentialsModeInclude 35 use_credentials ? blink::WebURLRequest::kFetchCredentialsModeInclude
36 : blink::WebURLRequest::kFetchCredentialsModeOmit; 36 : blink::WebURLRequest::kFetchCredentialsModeOmit;
(...skipping 13 matching lines...) Expand all
50 50
51 void ManifestFetcher::OnLoadComplete(const blink::WebURLResponse& response, 51 void ManifestFetcher::OnLoadComplete(const blink::WebURLResponse& response,
52 const std::string& data) { 52 const std::string& data) {
53 DCHECK(!completed_); 53 DCHECK(!completed_);
54 completed_ = true; 54 completed_ = true;
55 55
56 Callback callback = callback_; 56 Callback callback = callback_;
57 callback.Run(response, data); 57 callback.Run(response, data);
58 } 58 }
59 59
60 } // namespace content 60 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/fetchers/manifest_fetcher.h ('k') | content/renderer/fetchers/multi_resolution_image_resource_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698