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

Side by Side Diff: chrome/common/extensions/extension_unpacker.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension_file_util.cc ('k') | chrome/common/json_pref_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/common/extensions/extension_unpacker.h" 5 #include "chrome/common/extensions/extension_unpacker.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/memory/scoped_handle.h" 10 #include "base/memory/scoped_handle.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 JSONFileValueSerializer serializer(manifest_path); 102 JSONFileValueSerializer serializer(manifest_path);
103 std::string error; 103 std::string error;
104 scoped_ptr<Value> root(serializer.Deserialize(NULL, &error)); 104 scoped_ptr<Value> root(serializer.Deserialize(NULL, &error));
105 if (!root.get()) { 105 if (!root.get()) {
106 SetError(error); 106 SetError(error);
107 return NULL; 107 return NULL;
108 } 108 }
109 109
110 if (!root->IsType(Value::TYPE_DICTIONARY)) { 110 if (!root->IsDictionary()) {
111 SetError(errors::kInvalidManifest); 111 SetError(errors::kInvalidManifest);
112 return NULL; 112 return NULL;
113 } 113 }
114 114
115 return static_cast<DictionaryValue*>(root.release()); 115 return static_cast<DictionaryValue*>(root.release());
116 } 116 }
117 117
118 bool ExtensionUnpacker::ReadAllMessageCatalogs( 118 bool ExtensionUnpacker::ReadAllMessageCatalogs(
119 const std::string& default_locale) { 119 const std::string& default_locale) {
120 FilePath locales_path = 120 FilePath locales_path =
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 return false; 316 return false;
317 } 317 }
318 parsed_catalogs_->Set(dir_name, root.release()); 318 parsed_catalogs_->Set(dir_name, root.release());
319 319
320 return true; 320 return true;
321 } 321 }
322 322
323 void ExtensionUnpacker::SetError(const std::string &error) { 323 void ExtensionUnpacker::SetError(const std::string &error) {
324 error_message_ = error; 324 error_message_ = error;
325 } 325 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_file_util.cc ('k') | chrome/common/json_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698