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

Side by Side Diff: chrome/browser/local_discovery/privetv3_crypto_provider.cc

Issue 316873004: Interface plus stub implementation for PrivetV3CryptoProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/local_discovery/privetv3_crypto_provider.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/local_discovery/privetv3_crypto_provider.h"
6
7 namespace local_discovery {
8
9 namespace {
10
11 // A stub session type used for development/debugging.
12 const char kAuthMethodEmpty[] = "empty";
13 }
14
15 class PrivetV3CryptoProviderEmpty : public PrivetV3CryptoProvider {
16 public:
17 PrivetV3CryptoProviderEmpty();
18 virtual ~PrivetV3CryptoProviderEmpty();
19
20 // PrivetV3CryptoProvider implementation.
21 virtual const std::string& GetAuthMethod() OVERRIDE;
22 virtual bool GetNextStep(int* step, std::string* package) OVERRIDE;
23 virtual bool SetStepResponse(int step, const std::string& package) OVERRIDE;
24 virtual bool EncryptData(const std::string& input,
25 std::string* output) OVERRIDE;
26 };
27
28 scoped_ptr<PrivetV3CryptoProvider> Create(
29 const std::vector<std::string>& available_auth_methods) {
30 for (size_t i = 0; i < available_auth_methods.size(); i++) {
31 if (available_auth_methods[i] == kAuthMethodEmpty) {
32 return scoped_ptr<PrivetV3CryptoProvider>(
33 new PrivetV3CryptoProviderEmpty());
34 }
35 }
36
37 return scoped_ptr<PrivetV3CryptoProvider>();
38 }
39
40 PrivetV3CryptoProviderEmpty::PrivetV3CryptoProviderEmpty() {
41 }
42
43 PrivetV3CryptoProviderEmpty::~PrivetV3CryptoProviderEmpty() {
44 }
45
46 bool PrivetV3CryptoProviderEmpty::GetNextStep(int* step, std::string* package) {
47 *step = 0;
48 *package = std::string();
Vitaly Buka (NO REVIEWS) 2014/06/04 18:34:46 package->clear()
Noam Samuel 2014/06/04 18:44:38 Done.
49 return true;
50 }
51
52 bool PrivetV3CryptoProviderEmpty::SetStepResponse(int step,
53 const std::string& package) {
54 return step == 0 && package == std::string();
Vitaly Buka (NO REVIEWS) 2014/06/04 18:34:46 package.empty()
Noam Samuel 2014/06/04 18:44:38 Done.
55 }
56
57 bool PrivetV3CryptoProviderEmpty::EncryptData(const std::string& input,
58 std::string* output) {
59 *output = input;
60 return true;
61 }
62
63 } // namespace local_discovery
OLDNEW
« no previous file with comments | « chrome/browser/local_discovery/privetv3_crypto_provider.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698