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

Side by Side Diff: ceee/ie/broker/window_api_module.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 | « base/values_unittest.cc ('k') | chrome/browser/extensions/extension_function.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 // Window API implementation. 5 // Window API implementation.
6 // 6 //
7 // Window IDs are the HWND of the top-level frame window of IE. 7 // Window IDs are the HWND of the top-level frame window of IE.
8 8
9 #include "ceee/ie/broker/window_api_module.h" 9 #include "ceee/ie/broker/window_api_module.h"
10 10
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 return; 258 return;
259 } 259 }
260 if (first_arg->GetType() != Value::TYPE_NULL) { 260 if (first_arg->GetType() != Value::TYPE_NULL) {
261 DictionaryValue* args_dict = NULL; 261 DictionaryValue* args_dict = NULL;
262 if (!args.GetDictionary(0, &args_dict) || args_dict == NULL) { 262 if (!args.GetDictionary(0, &args_dict) || args_dict == NULL) {
263 NOTREACHED() << "bad request"; 263 NOTREACHED() << "bad request";
264 result->PostError(api_module_constants::kInvalidArgumentsError); 264 result->PostError(api_module_constants::kInvalidArgumentsError);
265 return; 265 return;
266 } 266 }
267 // Remember the arguments so that we can use them later. 267 // Remember the arguments so that we can use them later.
268 input_dict.reset(static_cast<DictionaryValue*>(args_dict->DeepCopy())); 268 input_dict.reset(args_dict->DeepCopy());
269 } 269 }
270 } 270 }
271 271
272 // Look for optional url. 272 // Look for optional url.
273 scoped_ptr<GURL> spec(new GURL(chrome::kAboutBlankURL)); 273 scoped_ptr<GURL> spec(new GURL(chrome::kAboutBlankURL));
274 std::string url_input; 274 std::string url_input;
275 if (input_dict.get() != NULL) { 275 if (input_dict.get() != NULL) {
276 if (input_dict->HasKey(ext::kUrlKey)) { 276 if (input_dict->HasKey(ext::kUrlKey)) {
277 if (!input_dict->GetString(ext::kUrlKey, &url_input)) { 277 if (!input_dict->GetString(ext::kUrlKey, &url_input)) {
278 NOTREACHED() << "bad request"; 278 NOTREACHED() << "bad request";
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 DCHECK(success) << "Failed to retrieve populate tabs that we saved ourselves"; 687 DCHECK(success) << "Failed to retrieve populate tabs that we saved ourselves";
688 688
689 FillResult(result.get(), populate_tabs); 689 FillResult(result.get(), populate_tabs);
690 if (result->IsEmpty()) // This is an error! 690 if (result->IsEmpty()) // This is an error!
691 result->PostError(api_module_constants::kInternalErrorError); 691 result->PostError(api_module_constants::kInternalErrorError);
692 result->FlushAllPosts(); 692 result->FlushAllPosts();
693 return S_OK; 693 return S_OK;
694 } 694 }
695 695
696 } // namespace window_api 696 } // namespace window_api
OLDNEW
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/extensions/extension_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698