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

Side by Side Diff: content/renderer/manifest/manifest_manager.cc

Issue 930223003: Do not reset ManifestManager state for same page navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « content/browser/manifest/manifest_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/manifest/manifest_manager.h" 5 #include "content/renderer/manifest/manifest_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/nullable_string16.h" 8 #include "base/strings/nullable_string16.h"
9 #include "content/common/manifest_manager_messages.h" 9 #include "content/common/manifest_manager_messages.h"
10 #include "content/public/renderer/document_state.h"
11 #include "content/public/renderer/navigation_state.h"
10 #include "content/public/renderer/render_frame.h" 12 #include "content/public/renderer/render_frame.h"
11 #include "content/renderer/fetchers/manifest_fetcher.h" 13 #include "content/renderer/fetchers/manifest_fetcher.h"
12 #include "content/renderer/manifest/manifest_parser.h" 14 #include "content/renderer/manifest/manifest_parser.h"
13 #include "content/renderer/manifest/manifest_uma_util.h" 15 #include "content/renderer/manifest/manifest_uma_util.h"
14 #include "third_party/WebKit/public/platform/WebURLResponse.h" 16 #include "third_party/WebKit/public/platform/WebURLResponse.h"
15 #include "third_party/WebKit/public/web/WebConsoleMessage.h" 17 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
16 #include "third_party/WebKit/public/web/WebDocument.h" 18 #include "third_party/WebKit/public/web/WebDocument.h"
17 #include "third_party/WebKit/public/web/WebLocalFrame.h" 19 #include "third_party/WebKit/public/web/WebLocalFrame.h"
18 20
19 namespace content { 21 namespace content {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 97
96 FetchManifest(); 98 FetchManifest();
97 } 99 }
98 100
99 void ManifestManager::DidChangeManifest() { 101 void ManifestManager::DidChangeManifest() {
100 may_have_manifest_ = true; 102 may_have_manifest_ = true;
101 manifest_dirty_ = true; 103 manifest_dirty_ = true;
102 } 104 }
103 105
104 void ManifestManager::DidCommitProvisionalLoad(bool is_new_navigation) { 106 void ManifestManager::DidCommitProvisionalLoad(bool is_new_navigation) {
107 NavigationState* navigation_state = DocumentState::FromDataSource(
108 render_frame()->GetWebFrame()->dataSource())->navigation_state();
109 if (navigation_state->was_within_same_page())
110 return;
111
105 may_have_manifest_ = false; 112 may_have_manifest_ = false;
106 manifest_dirty_ = true; 113 manifest_dirty_ = true;
107 } 114 }
108 115
109 void ManifestManager::FetchManifest() { 116 void ManifestManager::FetchManifest() {
110 GURL url(render_frame()->GetWebFrame()->document().manifestURL()); 117 GURL url(render_frame()->GetWebFrame()->document().manifestURL());
111 118
112 if (url.is_empty()) { 119 if (url.is_empty()) {
113 ManifestUmaUtil::FetchFailed(ManifestUmaUtil::FETCH_EMPTY_URL); 120 ManifestUmaUtil::FetchFailed(ManifestUmaUtil::FETCH_EMPTY_URL);
114 ResolveCallbacks(ResolveStateFailure); 121 ResolveCallbacks(ResolveStateFailure);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 175
169 pending_callbacks_.clear(); 176 pending_callbacks_.clear();
170 177
171 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin(); 178 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin();
172 it != callbacks.end(); ++it) { 179 it != callbacks.end(); ++it) {
173 it->Run(manifest); 180 it->Run(manifest);
174 } 181 }
175 } 182 }
176 183
177 } // namespace content 184 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/manifest/manifest_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698