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

Side by Side Diff: chrome/browser/extensions/convert_user_script.cc

Issue 3052023: Remove some debug switches. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Rebase. Created 10 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/browser/extensions/convert_user_script.h" 5 #include "chrome/browser/extensions/convert_user_script.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 27 matching lines...) Expand all
38 if (!UserScriptMaster::ScriptReloader::ParseMetadataHeader(content, 38 if (!UserScriptMaster::ScriptReloader::ParseMetadataHeader(content,
39 &script)) { 39 &script)) {
40 *error = "Invalid script header."; 40 *error = "Invalid script header.";
41 return NULL; 41 return NULL;
42 } 42 }
43 43
44 FilePath user_data_temp_dir; 44 FilePath user_data_temp_dir;
45 CHECK(PathService::Get(chrome::DIR_USER_DATA_TEMP, &user_data_temp_dir)); 45 CHECK(PathService::Get(chrome::DIR_USER_DATA_TEMP, &user_data_temp_dir));
46 46
47 ScopedTempDir temp_dir; 47 ScopedTempDir temp_dir;
48 if (!temp_dir.CreateUniqueTempDirUnderPath(user_data_temp_dir, false)) { 48 if (!temp_dir.CreateUniqueTempDirUnderPath(user_data_temp_dir)) {
49 *error = "Could not create temporary directory."; 49 *error = "Could not create temporary directory.";
50 return NULL; 50 return NULL;
51 } 51 }
52 52
53 // Create the manifest 53 // Create the manifest
54 scoped_ptr<DictionaryValue> root(new DictionaryValue); 54 scoped_ptr<DictionaryValue> root(new DictionaryValue);
55 std::string script_name; 55 std::string script_name;
56 if (!script.name().empty() && !script.name_space().empty()) 56 if (!script.name().empty() && !script.name_space().empty())
57 script_name = script.name_space() + "/" + script.name(); 57 script_name = script.name_space() + "/" + script.name();
58 else 58 else
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 scoped_ptr<Extension> extension(new Extension(temp_dir.path())); 141 scoped_ptr<Extension> extension(new Extension(temp_dir.path()));
142 if (!extension->InitFromValue(*root, false, error)) { 142 if (!extension->InitFromValue(*root, false, error)) {
143 NOTREACHED() << "Could not init extension " << *error; 143 NOTREACHED() << "Could not init extension " << *error;
144 return NULL; 144 return NULL;
145 } 145 }
146 146
147 temp_dir.Take(); // The caller takes ownership of the directory. 147 temp_dir.Take(); // The caller takes ownership of the directory.
148 return extension.release(); 148 return extension.release();
149 } 149 }
OLDNEW
« no previous file with comments | « base/scoped_temp_dir_unittest.cc ('k') | chrome/browser/extensions/sandboxed_extension_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698