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

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

Issue 1932623003: DevTools: Introduce Page.getManifest remote debugging protocol method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_parser.h" 5 #include "content/renderer/manifest/manifest_parser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 manifest_.background_color = ParseBackgroundColor(*dictionary); 143 manifest_.background_color = ParseBackgroundColor(*dictionary);
144 manifest_.gcm_sender_id = ParseGCMSenderID(*dictionary); 144 manifest_.gcm_sender_id = ParseGCMSenderID(*dictionary);
145 145
146 ManifestUmaUtil::ParseSucceeded(manifest_); 146 ManifestUmaUtil::ParseSucceeded(manifest_);
147 } 147 }
148 148
149 const Manifest& ManifestParser::manifest() const { 149 const Manifest& ManifestParser::manifest() const {
150 return manifest_; 150 return manifest_;
151 } 151 }
152 152
153 const std::vector<std::unique_ptr<ManifestParser::ErrorInfo>>& 153 void ManifestParser::TakeErrors(
154 ManifestParser::errors() const { 154 std::vector<ManifestDebugInfo::Error>* errors) {
155 return errors_; 155 errors->clear();
156 errors->swap(errors_);
156 } 157 }
157 158
158 bool ManifestParser::failed() const { 159 bool ManifestParser::failed() const {
159 return failed_; 160 return failed_;
160 } 161 }
161 162
162 bool ManifestParser::ParseBoolean(const base::DictionaryValue& dictionary, 163 bool ManifestParser::ParseBoolean(const base::DictionaryValue& dictionary,
163 const std::string& key, 164 const std::string& key,
164 bool default_value) { 165 bool default_value) {
165 if (!dictionary.HasKey(key)) 166 if (!dictionary.HasKey(key))
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 } 440 }
440 441
441 base::NullableString16 ManifestParser::ParseGCMSenderID( 442 base::NullableString16 ManifestParser::ParseGCMSenderID(
442 const base::DictionaryValue& dictionary) { 443 const base::DictionaryValue& dictionary) {
443 return ParseString(dictionary, "gcm_sender_id", Trim); 444 return ParseString(dictionary, "gcm_sender_id", Trim);
444 } 445 }
445 446
446 void ManifestParser::AddErrorInfo(const std::string& error_msg, 447 void ManifestParser::AddErrorInfo(const std::string& error_msg,
447 int error_line, 448 int error_line,
448 int error_column) { 449 int error_column) {
449 errors_.push_back( 450 errors_.push_back({error_msg, error_line, error_column});
450 base::WrapUnique(new ErrorInfo(error_msg, error_line, error_column)));
451 } 451 }
452
452 } // namespace content 453 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698