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

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

Issue 1564913003: [DevTools] Shows Manifest file in Sources tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set Manifest URL in error messages. Created 4 years, 11 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/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/render_frame.h" 10 #include "content/public/renderer/render_frame.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return; 153 return;
154 } 154 }
155 155
156 ManifestUmaUtil::FetchSucceeded(); 156 ManifestUmaUtil::FetchSucceeded();
157 157
158 ManifestParser parser(data, response.url(), document_url); 158 ManifestParser parser(data, response.url(), document_url);
159 parser.Parse(); 159 parser.Parse();
160 160
161 fetcher_.reset(); 161 fetcher_.reset();
162 162
163 for (const std::string& msg : parser.errors()) { 163 for (const std::string& msg : parser.errors()) {
pfeldman 2016/01/08 01:54:06 JSONReader actually has the error line and column,
164 blink::WebConsoleMessage message; 164 blink::WebConsoleMessage message;
165 message.level = blink::WebConsoleMessage::LevelError; 165 message.level = blink::WebConsoleMessage::LevelError;
166 message.text = blink::WebString::fromUTF8(msg); 166 message.text = blink::WebString::fromUTF8(msg);
167 message.url =
168 render_frame()->GetWebFrame()->document().manifestURL().string();
167 render_frame()->GetWebFrame()->addMessageToConsole(message); 169 render_frame()->GetWebFrame()->addMessageToConsole(message);
168 } 170 }
169 171
170 // Having errors while parsing the manifest doesn't mean the manifest parsing 172 // Having errors while parsing the manifest doesn't mean the manifest parsing
171 // failed. Some properties might have been ignored but some others kept. 173 // failed. Some properties might have been ignored but some others kept.
172 if (parser.failed()) { 174 if (parser.failed()) {
173 ResolveCallbacks(ResolveStateFailure); 175 ResolveCallbacks(ResolveStateFailure);
174 return; 176 return;
175 } 177 }
176 178
(...skipping 12 matching lines...) Expand all
189 191
190 pending_callbacks_.clear(); 192 pending_callbacks_.clear();
191 193
192 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin(); 194 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin();
193 it != callbacks.end(); ++it) { 195 it != callbacks.end(); ++it) {
194 it->Run(manifest); 196 it->Run(manifest);
195 } 197 }
196 } 198 }
197 199
198 } // namespace content 200 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/RawResource.h » ('j') | third_party/WebKit/public/web/WebConsoleMessage.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698