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

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

Issue 936413003: Allow extensions of the ManifestParser outside of the content/ layer. (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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/manifest/manifest_manager.cc
diff --git a/content/renderer/manifest/manifest_manager.cc b/content/renderer/manifest/manifest_manager.cc
index 98e976e2c2c1117d44f8f494bc74dd97338f89cf..b87524941c626b5e69280834a46c2fb0275f000d 100644
--- a/content/renderer/manifest/manifest_manager.cc
+++ b/content/renderer/manifest/manifest_manager.cc
@@ -8,10 +8,10 @@
#include "base/strings/nullable_string16.h"
#include "content/common/manifest_manager_messages.h"
#include "content/public/renderer/document_state.h"
+#include "content/public/renderer/manifest_parser.h"
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_frame.h"
#include "content/renderer/fetchers/manifest_fetcher.h"
-#include "content/renderer/manifest/manifest_parser.h"
#include "content/renderer/manifest/manifest_uma_util.h"
#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "third_party/WebKit/public/web/WebConsoleMessage.h"
@@ -141,12 +141,12 @@ void ManifestManager::OnManifestFetchComplete(
ManifestUmaUtil::FetchSucceeded();
- ManifestParser parser(data, response.url(), document_url);
- parser.Parse();
+ scoped_ptr<ManifestParser> parser = ManifestParser::Get();
+ parser->Parse(data, response.url(), document_url);
fetcher_.reset();
- for (const std::string& msg : parser.errors()) {
+ for (const std::string& msg : parser->errors()) {
blink::WebConsoleMessage message;
message.level = blink::WebConsoleMessage::LevelError;
message.text = blink::WebString::fromUTF8(msg);
@@ -155,12 +155,12 @@ void ManifestManager::OnManifestFetchComplete(
// Having errors while parsing the manifest doesn't mean the manifest parsing
// failed. Some properties might have been ignored but some others kept.
- if (parser.failed()) {
+ if (parser->failed()) {
ResolveCallbacks(ResolveStateFailure);
return;
}
- manifest_ = parser.manifest();
+ manifest_ = parser->manifest();
ResolveCallbacks(ResolveStateSuccess);
}

Powered by Google App Engine
This is Rietveld 408576698