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

Side by Side Diff: chrome/browser/extensions/api/socket/socket_api.cc

Issue 177003015: Pull AsyncApiFunction out of src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/api/socket/socket_api.h" 5 #include "chrome/browser/extensions/api/socket/socket_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 const int kWildcardPort = 0; 48 const int kWildcardPort = 0;
49 49
50 SocketAsyncApiFunction::SocketAsyncApiFunction() { 50 SocketAsyncApiFunction::SocketAsyncApiFunction() {
51 } 51 }
52 52
53 SocketAsyncApiFunction::~SocketAsyncApiFunction() { 53 SocketAsyncApiFunction::~SocketAsyncApiFunction() {
54 } 54 }
55 55
56 bool SocketAsyncApiFunction::PrePrepare() { 56 bool SocketAsyncApiFunction::PrePrepare() {
57 manager_ = CreateSocketResourceManager(); 57 manager_ = CreateSocketResourceManager();
58 return manager_->SetProfile(GetProfile()); 58 return manager_->SetBrowserContext(context());
59 } 59 }
60 60
61 bool SocketAsyncApiFunction::Respond() { 61 bool SocketAsyncApiFunction::Respond() {
62 return error_.empty(); 62 return error_.empty();
63 } 63 }
64 64
65 scoped_ptr<SocketResourceManagerInterface> 65 scoped_ptr<SocketResourceManagerInterface>
66 SocketAsyncApiFunction::CreateSocketResourceManager() { 66 SocketAsyncApiFunction::CreateSocketResourceManager() {
67 return scoped_ptr<SocketResourceManagerInterface>( 67 return scoped_ptr<SocketResourceManagerInterface>(
68 new SocketResourceManager<Socket>()).Pass(); 68 new SocketResourceManager<Socket>()).Pass();
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 return; 891 return;
892 } 892 }
893 893
894 base::ListValue* values = new base::ListValue(); 894 base::ListValue* values = new base::ListValue();
895 values->AppendStrings((std::vector<std::string>&) 895 values->AppendStrings((std::vector<std::string>&)
896 static_cast<UDPSocket*>(socket)->GetJoinedGroups()); 896 static_cast<UDPSocket*>(socket)->GetJoinedGroups());
897 SetResult(values); 897 SetResult(values);
898 } 898 }
899 899
900 } // namespace extensions 900 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698