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

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

Issue 6324004: Made return types of various Value::DeepCopy() implementations more specific (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test for covariant return types Created 9 years, 11 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 | « ceee/ie/broker/window_api_module.cc ('k') | chrome/browser/extensions/extension_prefs.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/extension_function.h" 5 #include "chrome/browser/extensions/extension_function.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/extensions/extension_function_dispatcher.h" 9 #include "chrome/browser/extensions/extension_function_dispatcher.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 22 matching lines...) Expand all
33 33
34 AsyncExtensionFunction::AsyncExtensionFunction() 34 AsyncExtensionFunction::AsyncExtensionFunction()
35 : args_(NULL), bad_message_(false) { 35 : args_(NULL), bad_message_(false) {
36 } 36 }
37 37
38 AsyncExtensionFunction::~AsyncExtensionFunction() { 38 AsyncExtensionFunction::~AsyncExtensionFunction() {
39 } 39 }
40 40
41 void AsyncExtensionFunction::SetArgs(const ListValue* args) { 41 void AsyncExtensionFunction::SetArgs(const ListValue* args) {
42 DCHECK(!args_.get()); // Should only be called once. 42 DCHECK(!args_.get()); // Should only be called once.
43 args_.reset(static_cast<ListValue*>(args->DeepCopy())); 43 args_.reset(args->DeepCopy());
44 } 44 }
45 45
46 const std::string AsyncExtensionFunction::GetResult() { 46 const std::string AsyncExtensionFunction::GetResult() {
47 std::string json; 47 std::string json;
48 // Some functions might not need to return any results. 48 // Some functions might not need to return any results.
49 if (result_.get()) 49 if (result_.get())
50 base::JSONWriter::Write(result_.get(), false, &json); 50 base::JSONWriter::Write(result_.get(), false, &json);
51 return json; 51 return json;
52 } 52 }
53 53
(...skipping 23 matching lines...) Expand all
77 77
78 SyncExtensionFunction::SyncExtensionFunction() { 78 SyncExtensionFunction::SyncExtensionFunction() {
79 } 79 }
80 80
81 SyncExtensionFunction::~SyncExtensionFunction() { 81 SyncExtensionFunction::~SyncExtensionFunction() {
82 } 82 }
83 83
84 void SyncExtensionFunction::Run() { 84 void SyncExtensionFunction::Run() {
85 SendResponse(RunImpl()); 85 SendResponse(RunImpl());
86 } 86 }
OLDNEW
« no previous file with comments | « ceee/ie/broker/window_api_module.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698