OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |