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

Unified Diff: content/renderer/manifest/manifest_manager.cc

Issue 2140463002: Remove WebContents::HasManifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/manifest/manifest_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/manifest/manifest_manager.cc
diff --git a/content/renderer/manifest/manifest_manager.cc b/content/renderer/manifest/manifest_manager.cc
index 6e7823606de6b59d14b343aadfc16e7a5ba8a76f..83c2eb48e6adb90a7fde9e6b11bcd75a08b2d00e 100644
--- a/content/renderer/manifest/manifest_manager.cc
+++ b/content/renderer/manifest/manifest_manager.cc
@@ -38,7 +38,6 @@ bool ManifestManager::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ManifestManager, message)
- IPC_MESSAGE_HANDLER(ManifestManagerMsg_HasManifest, OnHasManifest)
IPC_MESSAGE_HANDLER(ManifestManagerMsg_RequestManifest, OnRequestManifest)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -46,14 +45,6 @@ bool ManifestManager::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void ManifestManager::OnHasManifest(int request_id) {
- GURL url(render_frame()->GetWebFrame()->document().manifestURL());
-
- bool has_manifest = may_have_manifest_ && !url.is_empty();
- Send(new ManifestManagerHostMsg_HasManifestResponse(
- routing_id(), request_id, has_manifest));
-}
-
void ManifestManager::OnRequestManifest(int request_id) {
GetManifest(base::Bind(&ManifestManager::OnRequestManifestComplete,
base::Unretained(this), request_id));
@@ -115,6 +106,7 @@ void ManifestManager::GetManifest(const GetManifestCallback& callback) {
void ManifestManager::DidChangeManifest() {
may_have_manifest_ = true;
manifest_dirty_ = true;
+ manifest_url_ = GURL();
}
void ManifestManager::DidCommitProvisionalLoad(
@@ -125,18 +117,19 @@ void ManifestManager::DidCommitProvisionalLoad(
may_have_manifest_ = false;
manifest_dirty_ = true;
+ manifest_url_ = GURL();
}
void ManifestManager::FetchManifest() {
- GURL url(render_frame()->GetWebFrame()->document().manifestURL());
+ manifest_url_ = render_frame()->GetWebFrame()->document().manifestURL();
- if (url.is_empty()) {
+ if (manifest_url_.is_empty()) {
ManifestUmaUtil::FetchFailed(ManifestUmaUtil::FETCH_EMPTY_URL);
ResolveCallbacks(ResolveStateFailure);
return;
}
- fetcher_.reset(new ManifestFetcher(url));
+ fetcher_.reset(new ManifestFetcher(manifest_url_));
fetcher_->Start(
render_frame()->GetWebFrame(),
render_frame()->GetWebFrame()->document().manifestUseCredentials(),
@@ -194,10 +187,8 @@ void ManifestManager::OnManifestFetchComplete(
}
void ManifestManager::ResolveCallbacks(ResolveState state) {
- if (state == ResolveStateFailure) {
- manifest_url_ = GURL();
+ if (state == ResolveStateFailure)
manifest_ = Manifest();
Mike West 2016/07/11 08:14:18 Why don't you need to clear out |manifest_url_| an
dominickn 2016/07/11 10:51:18 It's explicitly meant to not be cleared (it gets r
- }
manifest_dirty_ = state != ResolveStateSuccess;
« no previous file with comments | « content/renderer/manifest/manifest_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698