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

Side by Side Diff: chrome/browser/safe_json_parser.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/safe_json_parser.h" 5 #include "chrome/browser/safe_json_parser.h"
6 6
7 #include "chrome/common/chrome_utility_messages.h" 7 #include "chrome/common/chrome_utility_messages.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/utility_process_host.h" 9 #include "content/public/browser/utility_process_host.h"
10 10
(...skipping 13 matching lines...) Expand all
24 BrowserThread::IO, 24 BrowserThread::IO,
25 FROM_HERE, 25 FROM_HERE,
26 base::Bind(&SafeJsonParser::StartWorkOnIOThread, this)); 26 base::Bind(&SafeJsonParser::StartWorkOnIOThread, this));
27 } 27 }
28 28
29 SafeJsonParser::~SafeJsonParser() {} 29 SafeJsonParser::~SafeJsonParser() {}
30 30
31 void SafeJsonParser::StartWorkOnIOThread() { 31 void SafeJsonParser::StartWorkOnIOThread() {
32 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 32 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
33 UtilityProcessHost* host = 33 UtilityProcessHost* host =
34 UtilityProcessHost::Create( 34 UtilityProcessHost::Create(this, base::MessageLoopProxy::current().get());
35 this, base::MessageLoopProxy::current());
36 host->EnableZygote(); 35 host->EnableZygote();
37 host->Send(new ChromeUtilityMsg_ParseJSON(unsafe_json_)); 36 host->Send(new ChromeUtilityMsg_ParseJSON(unsafe_json_));
38 } 37 }
39 38
40 void SafeJsonParser::OnJSONParseSucceeded(const base::ListValue& wrapper) { 39 void SafeJsonParser::OnJSONParseSucceeded(const base::ListValue& wrapper) {
41 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
42 const Value* value = NULL; 41 const Value* value = NULL;
43 CHECK(wrapper.Get(0, &value)); 42 CHECK(wrapper.Get(0, &value));
44 43
45 parsed_json_.reset(value->DeepCopy()); 44 parsed_json_.reset(value->DeepCopy());
(...skipping 30 matching lines...) Expand all
76 bool handled = true; 75 bool handled = true;
77 IPC_BEGIN_MESSAGE_MAP(SafeJsonParser, message) 76 IPC_BEGIN_MESSAGE_MAP(SafeJsonParser, message)
78 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded, 77 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded,
79 OnJSONParseSucceeded) 78 OnJSONParseSucceeded)
80 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, 79 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed,
81 OnJSONParseFailed) 80 OnJSONParseFailed)
82 IPC_MESSAGE_UNHANDLED(handled = false) 81 IPC_MESSAGE_UNHANDLED(handled = false)
83 IPC_END_MESSAGE_MAP() 82 IPC_END_MESSAGE_MAP()
84 return handled; 83 return handled;
85 } 84 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/two_phase_uploader_unittest.cc ('k') | chrome/browser/service/service_process_control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698