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

Side by Side Diff: components/update_client/component_patcher.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 "components/update_client/component_patcher.h" 5 #include "components/update_client/component_patcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 16 matching lines...) Expand all
27 // level must be a list. 27 // level must be a list.
28 base::ListValue* ReadCommands(const base::FilePath& unpack_path) { 28 base::ListValue* ReadCommands(const base::FilePath& unpack_path) {
29 const base::FilePath commands = 29 const base::FilePath commands =
30 unpack_path.Append(FILE_PATH_LITERAL("commands.json")); 30 unpack_path.Append(FILE_PATH_LITERAL("commands.json"));
31 if (!base::PathExists(commands)) 31 if (!base::PathExists(commands))
32 return NULL; 32 return NULL;
33 33
34 JSONFileValueDeserializer deserializer(commands); 34 JSONFileValueDeserializer deserializer(commands);
35 std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, NULL); 35 std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, NULL);
36 36
37 return (root.get() && root->IsType(base::Value::TYPE_LIST)) 37 return (root.get() && root->IsType(base::Value::Type::LIST))
38 ? static_cast<base::ListValue*>(root.release()) 38 ? static_cast<base::ListValue*>(root.release())
39 : NULL; 39 : NULL;
40 } 40 }
41 41
42 } // namespace 42 } // namespace
43 43
44 ComponentPatcher::ComponentPatcher( 44 ComponentPatcher::ComponentPatcher(
45 const base::FilePath& input_dir, 45 const base::FilePath& input_dir,
46 const base::FilePath& unpack_dir, 46 const base::FilePath& unpack_dir,
47 scoped_refptr<CrxInstaller> installer, 47 scoped_refptr<CrxInstaller> installer,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 void ComponentPatcher::DonePatching(UnpackerError error, int extended_error) { 114 void ComponentPatcher::DonePatching(UnpackerError error, int extended_error) {
115 current_operation_ = NULL; 115 current_operation_ = NULL;
116 task_runner_->PostTask(FROM_HERE, 116 task_runner_->PostTask(FROM_HERE,
117 base::Bind(callback_, error, extended_error)); 117 base::Bind(callback_, error, extended_error));
118 callback_.Reset(); 118 callback_.Reset();
119 } 119 }
120 120
121 } // namespace update_client 121 } // namespace update_client
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_language_list.cc ('k') | components/update_client/component_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698